CbmRoot
|
Generates input to transport simulation from files in Unigen format. More...
#include <CbmUnigenGenerator.h>
Public Types | |
enum | EMode { kStandard, kNoRotation, kRotateFixed, kReuseEvents } |
Mode enumerator. More... | |
Public Member Functions | |
CbmUnigenGenerator (const char *fileName="", EMode mode=kStandard) | |
Default constructor. More... | |
CbmUnigenGenerator (const char *fileName, EMode mode, Double_t phi) | |
Constructor with fixed rotation angle. More... | |
virtual | ~CbmUnigenGenerator () |
Destructor. More... | |
virtual Bool_t | ReadEvent (FairPrimaryGenerator *primGen) |
Read one event from the input file. More... | |
Private Member Functions | |
void | AddPrimary (FairPrimaryGenerator *primGen, Int_t pdgCode, const TVector3 &momentum) |
Add a primary particle to the event generator. More... | |
void | CloseInput () |
Close the input file. More... | |
Int_t | GetIonCharge (Int_t pdgCode) const |
Charge number of an ion. More... | |
Int_t | GetIonLambdas (Int_t pdgCode) const |
Number of Lambdas in an ion. More... | |
Int_t | GetIonMass (Int_t pdgCode) const |
Mass number of an ion. More... | |
Bool_t | GetNextEntry () |
Get next entry from input tree. More... | |
Bool_t | Init () |
Initialisation. More... | |
void | ProcessIon (FairPrimaryGenerator *primGen, Int_t pdgCode, const TVector3 &momentum) |
Treat a composite particle (ion) More... | |
Int_t | RegisterIons () |
Register ions to the simulation. More... | |
CbmUnigenGenerator (const CbmUnigenGenerator &)=delete | |
Copy constructor forbidden. More... | |
CbmUnigenGenerator & | operator= (const CbmUnigenGenerator &)=delete |
Assignment operator forbidden. More... | |
ClassDef (CbmUnigenGenerator, 4) | |
Private Attributes | |
TString | fFileName |
Input file name. More... | |
EMode | fMode |
Rotation mode. More... | |
Double_t | fPhi |
Event plane rotation angle. More... | |
Bool_t | fIsInit |
Flag whether generator is initialised. More... | |
TFile * | fFile |
Input ROOT file. More... | |
TTree * | fTree |
Input ROOT tree. More... | |
Int_t | fCurrentEntry |
Current entry number. More... | |
UEvent * | fEvent |
Current input event. More... | |
Int_t | fNofPrimaries |
Number of primaries registered in current event. More... | |
Int_t | fNofEvents |
Number of processed events. More... | |
Double_t | fBetaCM |
CM velocity in the lab frame. More... | |
Double_t | fGammaCM |
Gamma factor of CM in lab frame. More... | |
std::map< TString, FairIon * > | fIonMap |
Map from ion name to FairIon. More... | |
Static Private Attributes | |
static const Int_t | kPdgLambda = 10000000 |
Decomposition of ion PDG code. More... | |
static const Int_t | kPdgCharge = 10000 |
Decomposition of ion PDG code. More... | |
static const Int_t | kPdgMass = 10 |
Decomposition of ion PDG code. More... | |
Generates input to transport simulation from files in Unigen format.
This class reads ROOT files containing Unigen data (UEvent, UParticle) and inputs them to the transport simulation.
A Lorentz transformation to the lab (target) system is applied. Depending on the chosen mode, the event plane angle is rotated by a fixed value (kRotateFixed) or by a random value (kReuseEvents). In the mode kRotateToZero, the event plane will be rotated by the negative angle found in UEvent, such that the resulting event plane angle is zero (impact parameter in x direction).
In the mode kReuseEvents, the input events are be used multiple times if more events are requested than present in the input tree. This implies random event plane rotation.
Definition at line 44 of file CbmUnigenGenerator.h.
Mode enumerator.
Definition at line 48 of file CbmUnigenGenerator.h.
Default constructor.
fileName | Name of input file in UniGen format |
mode | Execution mode (see EMode) |
This constructor cannot be used for mode kRotateFixed.
Definition at line 27 of file CbmUnigenGenerator.cxx.
References Init(), and kRotateFixed.
CbmUnigenGenerator::CbmUnigenGenerator | ( | const char * | fileName, |
EMode | mode, | ||
Double_t | phi | ||
) |
Constructor with fixed rotation angle.
fileName | Name of input file in UniGen format |
mode | Execution mode (see EMode) |
phi | Event plane rotation angle (only for mode fRotateFixed) |
Definition at line 54 of file CbmUnigenGenerator.cxx.
References Init().
|
virtual |
Destructor.
Definition at line 80 of file CbmUnigenGenerator.cxx.
References CloseInput(), and fEvent.
|
privatedelete |
Copy constructor forbidden.
|
private |
Add a primary particle to the event generator.
primGen | FairPrimaryGenerator instance |
pdgCode | Particle ID (PDG code) |
momentum | Momentum vector [GeV] |
Definition at line 89 of file CbmUnigenGenerator.cxx.
References fNofPrimaries.
Referenced by ProcessIon(), and ReadEvent().
|
private |
|
private |
Close the input file.
Definition at line 100 of file CbmUnigenGenerator.cxx.
References fFile, and fFileName.
Referenced by ~CbmUnigenGenerator().
|
inlineprivate |
Charge number of an ion.
pdgCode | Particle ID (PDG code) |
For ions the PDG code is +-10LZZZAAAI, with ZZZ the number of protons
Definition at line 134 of file CbmUnigenGenerator.h.
References kPdgCharge, and kPdgLambda.
Referenced by ProcessIon(), and RegisterIons().
|
inlineprivate |
Number of Lambdas in an ion.
pdgCode | Particle ID (PDG code) |
For ions the PDG code is +-10LZZZAAAI, with L the number of Lambdas
Definition at line 145 of file CbmUnigenGenerator.h.
References kPdgLambda.
Referenced by ProcessIon(), and RegisterIons().
|
inlineprivate |
Mass number of an ion.
pdgCode | Particle ID (PDG code) |
For ions the PDG code is +-10LZZZAAAI, with AAA the mass number
Definition at line 156 of file CbmUnigenGenerator.h.
References kPdgCharge, and kPdgMass.
Referenced by ProcessIon(), and RegisterIons().
|
private |
Get next entry from input tree.
Definition at line 110 of file CbmUnigenGenerator.cxx.
References fCurrentEntry, fMode, fTree, and kReuseEvents.
Referenced by ReadEvent().
|
private |
Initialisation.
The input file is opened, run information is retrieved, and the input branch is connected.
Definition at line 138 of file CbmUnigenGenerator.cxx.
References fBetaCM, fEvent, fFile, fFileName, fGammaCM, fIsInit, fMode, fPhi, fTree, URun::GetNNSqrtS(), URun::GetPProj(), URun::GetPTarg(), kNoRotation, kReuseEvents, kRotateFixed, kStandard, URun::Print(), and RegisterIons().
Referenced by CbmUnigenGenerator().
|
privatedelete |
Assignment operator forbidden.
|
private |
Treat a composite particle (ion)
primGen | FairPrimaryGenerator instance |
pdgCode | Particle ID (PDG code) |
momentum | Momentum vector [GeV] |
Composite particle need special treatment because hyper-nuclei ** are not supported by FairRoot, and neutral ions are not supported by GEANT4. Hyper-nuclei are thus replaced by their non-strange analogue, and neutral ions are decomposed into neutrons.
Definition at line 216 of file CbmUnigenGenerator.cxx.
References AddPrimary(), GetIonCharge(), GetIonLambdas(), GetIonMass(), and kPdgLambda.
Referenced by ReadEvent().
|
virtual |
Read one event from the input file.
primGen | Pointer to FairPrimaryGenerator instance |
Framework interface to define one input event for the transport simulation. Is called from the FairPrimaryGenerator instance. It adds all particles in the input event to the stack using FairPrimaryGenerator::AddTrack after having applied the Lorentz transformation and (if required) event plane rotation.
Definition at line 249 of file CbmUnigenGenerator.cxx.
References AddPrimary(), UParticle::E(), fBetaCM, fEvent, fGammaCM, fIsInit, fMode, fNofEvents, fNofPrimaries, fPhi, UEvent::GetB(), UEvent::GetEventNr(), GetNextEntry(), UEvent::GetNpa(), UEvent::GetParticle(), UParticle::GetPdg(), UEvent::GetPhi(), kNoRotation, kReuseEvents, kRotateFixed, kStandard, xMath::Pi(), ProcessIon(), UParticle::Px(), UParticle::Py(), and UParticle::Pz().
|
private |
Register ions to the simulation.
The input may contain ions, which are not known to the simulation engine. They are added using the method FairRunSim::AddIon. This has to be done at initialisation. The method scans the entire input for ions and registers them before the start of the transport run.
Definition at line 319 of file CbmUnigenGenerator.cxx.
References fEvent, fIonMap, fTree, GetIonCharge(), GetIonLambdas(), GetIonMass(), UEvent::GetNpa(), UEvent::GetParticle(), and UParticle::GetPdg().
Referenced by Init().
|
private |
CM velocity in the lab frame.
Definition at line 101 of file CbmUnigenGenerator.h.
Referenced by Init(), and ReadEvent().
|
private |
Current entry number.
Definition at line 97 of file CbmUnigenGenerator.h.
Referenced by GetNextEntry().
|
private |
Current input event.
Definition at line 98 of file CbmUnigenGenerator.h.
Referenced by Init(), ReadEvent(), RegisterIons(), and ~CbmUnigenGenerator().
|
private |
Input ROOT file.
Definition at line 95 of file CbmUnigenGenerator.h.
Referenced by CloseInput(), and Init().
|
private |
Input file name.
Definition at line 91 of file CbmUnigenGenerator.h.
Referenced by CloseInput(), and Init().
|
private |
Gamma factor of CM in lab frame.
Definition at line 102 of file CbmUnigenGenerator.h.
Referenced by Init(), and ReadEvent().
|
private |
Map from ion name to FairIon.
Definition at line 103 of file CbmUnigenGenerator.h.
Referenced by RegisterIons().
|
private |
Flag whether generator is initialised.
Definition at line 94 of file CbmUnigenGenerator.h.
Referenced by Init(), and ReadEvent().
|
private |
Rotation mode.
Definition at line 92 of file CbmUnigenGenerator.h.
Referenced by GetNextEntry(), Init(), and ReadEvent().
|
private |
Number of processed events.
Definition at line 100 of file CbmUnigenGenerator.h.
Referenced by ReadEvent().
|
private |
Number of primaries registered in current event.
Definition at line 99 of file CbmUnigenGenerator.h.
Referenced by AddPrimary(), and ReadEvent().
|
private |
Event plane rotation angle.
Definition at line 93 of file CbmUnigenGenerator.h.
Referenced by Init(), and ReadEvent().
|
private |
Input ROOT tree.
Definition at line 96 of file CbmUnigenGenerator.h.
Referenced by GetNextEntry(), Init(), and RegisterIons().
|
staticprivate |
Decomposition of ion PDG code.
Definition at line 110 of file CbmUnigenGenerator.h.
Referenced by GetIonCharge(), and GetIonMass().
|
staticprivate |
Decomposition of ion PDG code.
Definition at line 109 of file CbmUnigenGenerator.h.
Referenced by GetIonCharge(), GetIonLambdas(), and ProcessIon().
|
staticprivate |
Decomposition of ion PDG code.
Definition at line 111 of file CbmUnigenGenerator.h.
Referenced by GetIonMass().