Belle II Software  release-06-02-00
MCInitialParticles Class Reference

This class contains the initial state for the given event. More...

#include <MCInitialParticles.h>

Inheritance diagram for MCInitialParticles:
Collaboration diagram for MCInitialParticles:

Public Types

enum  EGenerationFlags {
  c_generateCMS = 1 << 0 ,
  c_smearBeamEnergy = 1 << 1 ,
  c_smearBeamDirection = 1 << 2 ,
  c_smearBeam = c_smearBeamEnergy | c_smearBeamDirection ,
  c_smearVertex = 1 << 3 ,
  c_smearALL = c_smearVertex | c_smearBeam
}
 Possible Flags for initial event generation. More...
 

Public Member Functions

 MCInitialParticles ()
 Default constructor.
 
 MCInitialParticles (const MCInitialParticles &b)
 Copy constructor.
 
MCInitialParticlesoperator= (const MCInitialParticles &b)
 Assignment operator.
 
bool operator== (const MCInitialParticles &b) const
 Equality operator.
 
virtual ~MCInitialParticles ()
 Free memory of the LorentzRotation if it was created.
 
void set (const TLorentzVector &her, const TLorentzVector &ler, const TVector3 &vertex)
 Set the initial event values, i.e. More...
 
void setHER (const TLorentzVector &her)
 Set the High Energy Beam 4-momentum.
 
void setLER (const TLorentzVector &ler)
 Set the Low Energy Beam 4-momentum.
 
void setVertex (const TVector3 &vertex)
 Set the vertex position.
 
void setTime (double time)
 Set collison time.
 
void setGenerationFlags (int flags)
 Set the generation flags to be used for event generation (ORed combination of EGenerationFlags)
 
const TLorentzVector & getHER () const
 Get 4vector of the high energy beam.
 
const TLorentzVector & getLER () const
 Get 4vector of the low energy beam.
 
const TVector3 & getVertex () const
 Get the position of the collision.
 
double getTime () const
 Get collison time.
 
double getEnergy () const
 Get the the actual collision energy (in lab system)
 
double getMass () const
 Get the invariant mass of the collision (= energy in CMS)
 
const TLorentzRotation & getLabToCMS () const
 Return the LorentzRotation to convert from lab to CMS frame.
 
const TLorentzRotation & getCMSToLab () const
 Return the LorentzRotation to convert from CMS to lab frame.
 
bool getValidFlag () const
 Get the flag to check if a valid MCInitialParticles object was already generated and filled in an event.
 
int getGenerationFlags () const
 Get the generation flags to be used for event generation (ORed combination of EGenerationFlags)
 
bool hasGenerationFlags (int flags) const
 Check if a certain set of EGenerationFlags is set.
 
std::string getGenerationFlagString (const std::string &separator=" ") const
 Return string representation of all active flags for printing. More...
 

Private Member Functions

void calculateBoost () const
 Calculate the boost if necessary.
 
void resetBoost ()
 Reset cached transformations after changing parameters.
 
 ClassDef (MCInitialParticles, 3)
 ROOT Dictionary.
 

Private Attributes

TLorentzVector m_her
 HER 4vector.
 
TLorentzVector m_ler
 LER 4vector.
 
TVector3 m_vertex
 collision position
 
double m_time = 0
 collision time
 
TLorentzRotation * m_labToCMS {nullptr}
 Boost from Lab into CMS. More...
 
TLorentzRotation * m_CMSToLab {nullptr}
 transient More...
 
double m_invariantMass {0.0}
 transient More...
 
bool m_validFlag = false
 transient More...
 
int m_generationFlags {0}
 Flags to be used when generating events.
 

Detailed Description

This class contains the initial state for the given event.

This is not to be confused with the nominal beam parameters but is an event dependent info which contains all implemented smearing effects. It is only set in Montecarlo.

Definition at line 25 of file MCInitialParticles.h.

Member Enumeration Documentation

◆ EGenerationFlags

Possible Flags for initial event generation.

Enumerator
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)

c_smearBeam 

smear the full beam momentum (energy and direction)

c_smearVertex 

smear vertex

c_smearALL 

smear all

Definition at line 30 of file MCInitialParticles.h.

30  {
32  c_generateCMS = 1 << 0,
34  c_smearBeamEnergy = 1 << 1,
36  c_smearBeamDirection = 1 << 2,
40  c_smearVertex = 1 << 3,
43  };
@ 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)

Member Function Documentation

◆ getGenerationFlagString()

std::string getGenerationFlagString ( const std::string &  separator = " ") const

Return string representation of all active flags for printing.

Parameters
separatorseparation string to be put between flags

Definition at line 13 of file MCInitialParticles.cc.

14 {
15  std::string flags = "";
16  const std::vector<std::pair<int, std::string>> flagvalues{
17  {c_generateCMS, "generateCMS"},
18  {c_smearBeamEnergy, "smearBeamEnergy"},
19  {c_smearBeamDirection, "smearBeamDirection"},
20  {c_smearVertex, "smearVertex"}
21  };
22  for (auto& i : flagvalues) {
23  if (hasGenerationFlags(i.first)) {
24  if (flags.size() > 0) flags += separator;
25  flags += i.second;
26  }
27  }
28  return flags;
29 }
bool hasGenerationFlags(int flags) const
Check if a certain set of EGenerationFlags is set.

◆ set()

void set ( const TLorentzVector &  her,
const TLorentzVector &  ler,
const TVector3 &  vertex 
)
inline

Set the initial event values, i.e.

the four momenta of both beams and the vertex

Parameters
her4vector of the high energy beam
ler4vector of the low energy beam
vertexposition of the actual collision vertex

Definition at line 91 of file MCInitialParticles.h.

Member Data Documentation

◆ m_CMSToLab

TLorentzRotation* m_CMSToLab {nullptr}
mutableprivate

transient

Boost from CMS into lab. (calculated on first use, not saved to file)

Definition at line 186 of file MCInitialParticles.h.

◆ m_invariantMass

double m_invariantMass {0.0}
mutableprivate

transient

invariant mass of HER+LER (calculated on first use, not saved to file)

Definition at line 188 of file MCInitialParticles.h.

◆ m_labToCMS

TLorentzRotation* m_labToCMS {nullptr}
mutableprivate

Boost from Lab into CMS.

(calculated on first use, not saved to file)

Definition at line 184 of file MCInitialParticles.h.

◆ m_validFlag

bool m_validFlag = false
private

transient

Flag to check if a valid MCInitialParticles object was already generated and filled in an event.

Definition at line 190 of file MCInitialParticles.h.


The documentation for this class was generated from the following files: