11 #include <TLorentzVector.h>
12 #include <TLorentzRotation.h>
68 #if defined(MCP_DBL_CMP) || defined(MCP_VEC3_CMP) || defined(MCP_VEC4_CMP)
69 #error Macro already defined, cannot continue
71 #define MCP_DBL_CMP(a,b,x) ((a.x()==b.x())||(std::abs(a.x()-b.x())<1e-10))
72 #define MCP_VEC3_CMP(a,b) (MCP_DBL_CMP(a,b,X) && MCP_DBL_CMP(a,b,Y) && MCP_DBL_CMP(a,b,Z))
73 #define MCP_VEC4_CMP(a,b) (MCP_VEC3_CMP(a,b) && MCP_DBL_CMP(a,b,E))
74 return MCP_VEC4_CMP(
m_her, b.m_her) && MCP_VEC4_CMP(
m_ler, b.m_ler) && MCP_VEC3_CMP(
m_vertex, b.m_vertex)
91 void set(
const TLorentzVector& her,
const TLorentzVector& ler,
const TVector3& vertex)
215 m_labToCMS =
new TLorentzRotation(-beam.BoostVector());
217 const TLorentzVector electronCMS = (*m_labToCMS) *
m_her;
219 const TVector3 zaxis(0., 0., 1.);
220 TVector3 rotaxis = zaxis.Cross(electronCMS.Vect()) * (1. / electronCMS.Vect().Mag());
221 double rotangle = TMath::ASin(rotaxis.Mag());
This class contains the initial state for the given event.
ClassDef(MCInitialParticles, 3)
ROOT Dictionary.
int m_generationFlags
Flags to be used when generating events.
bool operator==(const MCInitialParticles &b) const
Equality operator.
int getGenerationFlags() const
Get the generation flags to be used for event generation (ORed combination of EGenerationFlags)
bool getValidFlag() const
Get the flag to check if a valid MCInitialParticles object was already generated and filled in an eve...
void setLER(const TLorentzVector &ler)
Set the Low Energy Beam 4-momentum.
const TLorentzRotation & getLabToCMS() const
Return the LorentzRotation to convert from lab to CMS frame.
void setVertex(const TVector3 &vertex)
Set the vertex position.
double m_time
collision time
void setTime(double time)
Set collison time.
void setHER(const TLorentzVector &her)
Set the High Energy Beam 4-momentum.
double getEnergy() const
Get the the actual collision energy (in lab system)
const TLorentzRotation & getCMSToLab() const
Return the LorentzRotation to convert from CMS to lab frame.
EGenerationFlags
Possible Flags for initial event generation.
@ c_smearVertex
smear vertex
@ c_smearBeam
smear the full beam momentum (energy and direction)
@ c_generateCMS
generate initial event in CMS instead of lab
@ c_smearBeamEnergy
smear energy of HER and LER (but not direction)
@ c_smearBeamDirection
smear direction of HER and LER (but not energy)
void set(const TLorentzVector &her, const TLorentzVector &ler, const TVector3 &vertex)
Set the initial event values, i.e.
TLorentzVector m_her
HER 4vector.
const TLorentzVector & getLER() const
Get 4vector of the low energy beam.
const TVector3 & getVertex() const
Get the position of the collision.
MCInitialParticles & operator=(const MCInitialParticles &b)
Assignment operator.
TLorentzRotation * m_labToCMS
Boost from Lab into CMS.
std::string getGenerationFlagString(const std::string &separator=" ") const
Return string representation of all active flags for printing.
TVector3 m_vertex
collision position
MCInitialParticles()
Default constructor.
TLorentzRotation * m_CMSToLab
transient
bool hasGenerationFlags(int flags) const
Check if a certain set of EGenerationFlags is set.
MCInitialParticles(const MCInitialParticles &b)
Copy constructor.
TLorentzVector m_ler
LER 4vector.
bool m_validFlag
transient
double m_invariantMass
transient
virtual ~MCInitialParticles()
Free memory of the LorentzRotation if it was created.
const TLorentzVector & getHER() const
Get 4vector of the high energy beam.
void setGenerationFlags(int flags)
Set the generation flags to be used for event generation (ORed combination of EGenerationFlags)
double getMass() const
Get the invariant mass of the collision (= energy in CMS)
double getTime() const
Get collison time.
void resetBoost()
Reset cached transformations after changing parameters.
void calculateBoost() const
Calculate the boost if necessary.
Abstract base class for different kinds of events.