 |
Belle II Software
release-05-02-19
|
13 #include <TLorentzVector.h>
14 #include <TLorentzRotation.h>
27 class MCInitialParticles:
public TObject {
70 #if defined(MCP_DBL_CMP) || defined(MCP_VEC3_CMP) || defined(MCP_VEC4_CMP)
71 #error Macro already defined, cannot continue
73 #define MCP_DBL_CMP(a,b,x) ((a.x()==b.x())||(std::abs(a.x()-b.x())<1e-10))
74 #define MCP_VEC3_CMP(a,b) (MCP_DBL_CMP(a,b,X) && MCP_DBL_CMP(a,b,Y) && MCP_DBL_CMP(a,b,Z))
75 #define MCP_VEC4_CMP(a,b) (MCP_VEC3_CMP(a,b) && MCP_DBL_CMP(a,b,E))
76 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)
93 void set(
const TLorentzVector& her,
const TLorentzVector& ler,
const TVector3& vertex)
103 void setHER(
const TLorentzVector& her)
110 void setLER(
const TLorentzVector& ler)
129 const TLorentzVector&
getHER()
const {
return m_her; }
132 const TLorentzVector&
getLER()
const {
return m_ler; }
178 TLorentzVector
m_her;
180 TLorentzVector
m_ler;
217 m_labToCMS =
new TLorentzRotation(-beam.BoostVector());
219 const TLorentzVector electronCMS = (*m_labToCMS) *
m_her;
221 const TVector3 zaxis(0., 0., 1.);
222 TVector3 rotaxis = zaxis.Cross(electronCMS.Vect()) * (1. / electronCMS.Vect().Mag());
223 double rotangle = TMath::ASin(rotaxis.Mag());
const TLorentzRotation & getLabToCMS() const
Return the LorentzRotation to convert from lab to CMS frame.
const TLorentzVector & getLER() const
Get 4vector of the low energy beam.
@ c_smearBeamEnergy
smear energy of HER and LER (but not direction)
void setHER(const TLorentzVector &her)
Set the High Energy Beam 4-momentum.
MCInitialParticles & operator=(const MCInitialParticles &b)
Assignment operator.
@ c_smearBeam
smear the full beam momentum (energy and direction)
TLorentzRotation * m_labToCMS
Boost from Lab into CMS.
TLorentzVector m_her
HER 4vector.
double m_invariantMass
transient
int m_generationFlags
Flags to be used when generating events.
@ c_smearBeamDirection
smear direction of HER and LER (but not energy)
ClassDef(MCInitialParticles, 3)
ROOT Dictionary.
TVector3 m_vertex
collision position
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)
TLorentzVector m_ler
LER 4vector.
std::string getGenerationFlagString(const std::string &separator=" ") const
Return string representation of all active flags for printing.
@ c_smearVertex
smear vertex
TLorentzRotation * m_CMSToLab
transient
void setTime(double time)
Set collison time.
double getTime() const
Get collison time.
bool m_validFlag
transient
This class contains the initial state for the given event.
void resetBoost()
Reset cached transformations after changing parameters.
double getMass() const
Get the invariant mass of the collision (= energy in CMS)
@ c_generateCMS
generate initial event in CMS instead of lab
Abstract base class for different kinds of events.
void setVertex(const TVector3 &vertex)
Set the vertex position.
void setLER(const TLorentzVector &ler)
Set the Low Energy Beam 4-momentum.
bool operator==(const MCInitialParticles &b) const
Equality operator.
const TVector3 & getVertex() const
Get the position of the collision.
double m_time
collision time
const TLorentzRotation & getCMSToLab() const
Return the LorentzRotation to convert from CMS to lab frame.
double getEnergy() const
Get the the actual collision energy (in lab system)
MCInitialParticles()
Default constructor.
EGenerationFlags
Possible Flags for initial event generation.
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 set(const TLorentzVector &her, const TLorentzVector &ler, const TVector3 &vertex)
Set the initial event values, i.e.
bool hasGenerationFlags(int flags) const
Check if a certain set of EGenerationFlags is set.
void calculateBoost() const
Calculate the boost if necessary.