EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <EicRoot/blob/master/base/FairPrimaryGenerator.h>
Public Member Functions | |
FairPrimaryGenerator () | |
FairPrimaryGenerator (const char *name, const char *title="FAIR Generator") | |
virtual | ~FairPrimaryGenerator () |
virtual Bool_t | Init () |
void | AddGenerator (FairGenerator *generator) |
virtual Bool_t | GenerateEvent (FairGenericStack *pStack) |
virtual void | AddTrack (Int_t pdgid, Double_t px, Double_t py, Double_t pz, Double_t vx, Double_t vy, Double_t vz, Int_t parent=-1, Bool_t wanttracking=true, Double_t e=-9e9) |
void | SetBeam (Double_t beamX0, Double_t beamY0, Double_t beamSigmaX, Double_t beamSigmaY) |
void | SetTarget (Double_t targetZ, Double_t targetDz) |
void | SetMultTarget (Int_t nroftargets, Double_t *targetZ, Double_t targetDz) |
void | SmearVertexZ (Bool_t flag) |
void | SmearGausVertexZ (Bool_t flag) |
void | SmearVertexXY (Bool_t flag) |
TObjArray * | GetListOfGenerators () |
void | SetEvent (FairMCEventHeader *event) |
FairMCEventHeader * | GetEvent () |
void | DoTracking (Bool_t doTracking=kTRUE) |
void | SetEventTimeInterval (Double_t min, Double_t max) |
void | SetEventMeanTime (Double_t mean) |
void | SetEventTime (TF1 *timeProb) |
Int_t | GetTotPrimary () |
Protected Member Functions | |
void | MakeVertex () |
Protected Attributes | |
Double_t | fBeamX0 |
Double_t | fBeamY0 |
Double_t | fBeamSigmaX |
Double_t | fBeamSigmaY |
Double_t * | fTargetZ |
Int_t | fNrTargets |
Double_t | fTargetDz |
TVector3 | fVertex |
Int_t | fNTracks |
Bool_t | fSmearVertexZ |
Bool_t | fSmearGausVertexZ |
Bool_t | fSmearVertexXY |
FairGenericStack * | fStack |
TObjArray * | fGenList |
TIterator * | fListIter |
FairMCEventHeader * | fEvent |
Bool_t | fdoTracking |
Double_t | fEventTimeMin |
Double_t | fEventTimeMax |
Double_t | fEventTime |
Double_t | fEventMeanTime |
TF1 * | fTimeProb |
Int_t | fMCIndexOffset |
FairLogger * | fLogger |
Int_t | fEventNr |
Static Protected Attributes | |
static Int_t | fTotPrim =0 |
Private Member Functions | |
FairPrimaryGenerator (const FairPrimaryGenerator &) | |
FairPrimaryGenerator & | operator= (const FairPrimaryGenerator &) |
ClassDef (FairPrimaryGenerator, 4) | |
Definition at line 33 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 33 of file FairPrimaryGenerator.h
FairPrimaryGenerator::FairPrimaryGenerator | ( | ) |
Default constructor.
Definition at line 21 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 21 of file FairPrimaryGenerator.cxx
References fTargetZ.
FairPrimaryGenerator::FairPrimaryGenerator | ( | const char * | name, |
const char * | title = "FAIR Generator" |
||
) |
Constructor with name and title
Definition at line 56 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 56 of file FairPrimaryGenerator.cxx
References fTargetZ.
|
virtual |
Destructor.
Definition at line 99 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 99 of file FairPrimaryGenerator.cxx
References fGenList, fListIter, fNrTargets, fTargetZ, and fTimeProb.
|
private |
|
inline |
Register a generator derived from FairGenerator.
Definition at line 54 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 54 of file FairPrimaryGenerator.h
References fGenList.
Referenced by EicRunSim::AddGenerator().
|
virtual |
Public method AddTrack Adding a track to the MC stack. To be called within the ReadEvent methods of the registered generators.
pdgid | Particle ID (PDG code) |
px,py,pz | Momentum coordinates [GeV] |
vx,vy,vz | Track origin relative to event vertex |
Definition at line 182 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 182 of file FairPrimaryGenerator.cxx
References fdoTracking, fMCIndexOffset, fNTracks, fStack, fVertex, mass, and FairGenericStack::PushTrack().
Referenced by EicAsciiBoxGenerator::ReadEvent(), EicBoxGenerator::ReadEvent(), and EicEventGenerator::ReadEvent().
|
private |
|
inline |
Swich on/off the tracking of a particle
Definition at line 126 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 126 of file FairPrimaryGenerator.h
References fdoTracking.
|
virtual |
Public method GenerateEvent To be called at the beginning of each event from FairMCApplication. Generates an event vertex and calls the ReadEvent methods from the registered generators.
pStack | The particle stack |
Definition at line 120 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 120 of file FairPrimaryGenerator.cxx
References FairLogger::Error(), FairLogger::Fatal(), fEvent, fEventNr, fEventTime, fEventTimeMax, fEventTimeMin, fListIter, fLogger, fMCIndexOffset, fNTracks, fStack, fTimeProb, fTotPrim, fVertex, FairMCEventHeader::GetEventID(), FairLogger::Info(), MakeVertex(), MESSAGE_ORIGIN, FairGenerator::ReadEvent(), FairMCEventHeader::Reset(), FairMCEventHeader::SetEventID(), FairMCEventHeader::SetNPrim(), FairMCEventHeader::SetTime(), and FairMCEventHeader::SetVertex().
Referenced by FairMCApplication::GeneratePrimaries().
|
inline |
Accessor to the MCEvent
Definition at line 122 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 122 of file FairPrimaryGenerator.h
References fEvent.
|
inline |
Definition at line 114 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 114 of file FairPrimaryGenerator.h
References fGenList.
Referenced by FwdTrackFinder::Init().
|
inline |
Definition at line 137 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 137 of file FairPrimaryGenerator.h
References fTotPrim.
Referenced by FairMCApplication::FinishRun().
|
virtual |
Initialize the generater (if needed!)
Initialize list of generators
Definition at line 87 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 87 of file FairPrimaryGenerator.cxx
References fGenList, and FairGenerator::Init().
Referenced by FairMCApplication::AddIons().
|
protected |
Private method MakeVertex. If vertex smearing in xy is switched on, the event vertex is smeared Gaussianlike in x and y direction according to the mean beam positions and widths set by the SetBeam method. If vertex smearing in z is switched on, the z coordinate of the event vertex is flatly distributed over the extension of the target. To be called at the beginning of the event from the GenerateEvent method.
Definition at line 292 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 292 of file FairPrimaryGenerator.cxx
References fBeamSigmaX, fBeamSigmaY, fBeamX0, fBeamY0, fNrTargets, fSmearGausVertexZ, fSmearVertexXY, fSmearVertexZ, fTargetDz, fTargetZ, fVertex, and Target.
Referenced by GenerateEvent().
|
private |
void FairPrimaryGenerator::SetBeam | ( | Double_t | beamX0, |
Double_t | beamY0, | ||
Double_t | beamSigmaX, | ||
Double_t | beamSigmaY | ||
) |
Set beam position and widths.
beamX0 | mean x position of beam at target |
beamY0 | mean y position of beam at target |
beamSigmaX | Gaussian beam width in x |
beamSigmaY | Gaussian beam width in y |
Definition at line 247 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 247 of file FairPrimaryGenerator.cxx
References fBeamSigmaX, fBeamSigmaY, fBeamX0, and fBeamY0.
|
inline |
Set the pointer to the MCEvent
Definition at line 118 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 118 of file FairPrimaryGenerator.h
References fEvent.
Referenced by FairMCApplication::InitGeometry().
void FairPrimaryGenerator::SetEventMeanTime | ( | Double_t | mean | ) |
Set the mean time for the event in ns
Definition at line 325 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 325 of file FairPrimaryGenerator.cxx
References fEventMeanTime, and fTimeProb.
void FairPrimaryGenerator::SetEventTime | ( | TF1 * | timeProb | ) |
Set the time function for event
Definition at line 339 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 339 of file FairPrimaryGenerator.cxx
References fTimeProb.
void FairPrimaryGenerator::SetEventTimeInterval | ( | Double_t | min, |
Double_t | max | ||
) |
Set the min and max limit for event time in ns
Definition at line 317 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 317 of file FairPrimaryGenerator.cxx
References fEventTimeMax, fEventTimeMin, max, and min.
void FairPrimaryGenerator::SetMultTarget | ( | Int_t | nroftargets, |
Double_t * | targetZ, | ||
Double_t | targetDz | ||
) |
Set target position for multiple tagets. The thickness is the same for all targets.
nroftargets | number of targets |
*targetZ | z positions of target center |
targetDz | full target thickness |
Definition at line 269 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 269 of file FairPrimaryGenerator.cxx
References dz, fNrTargets, fTargetDz, and fTargetZ.
void FairPrimaryGenerator::SetTarget | ( | Double_t | targetZ, |
Double_t | targetDz | ||
) |
Set target position and thickness.
targetZ | z position of target center |
targetDz | full target thickness |
Definition at line 260 of file FairPrimaryGenerator.cxx.
View newest version in sPHENIX GitHub at line 260 of file FairPrimaryGenerator.cxx
|
inline |
Definition at line 111 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 111 of file FairPrimaryGenerator.h
References fSmearGausVertexZ.
|
inline |
Definition at line 112 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 112 of file FairPrimaryGenerator.h
References fSmearVertexXY.
|
inline |
Enable vertex smearing in z and/or xy direction
Definition at line 110 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 110 of file FairPrimaryGenerator.h
References fSmearVertexZ.
|
protected |
Beam width (Gaussian) in x [cm]
Definition at line 148 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 148 of file FairPrimaryGenerator.h
Referenced by MakeVertex(), and SetBeam().
|
protected |
Beam width (Gaussian) in y [cm]
Definition at line 150 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 150 of file FairPrimaryGenerator.h
Referenced by MakeVertex(), and SetBeam().
|
protected |
Nominal beam position at target in x [cm]
Definition at line 144 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 144 of file FairPrimaryGenerator.h
Referenced by MakeVertex(), and SetBeam().
|
protected |
Nominal beam position at target in y [cm]
Definition at line 146 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 146 of file FairPrimaryGenerator.h
Referenced by MakeVertex(), and SetBeam().
|
protected |
go to tracking
Definition at line 176 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 176 of file FairPrimaryGenerator.h
Referenced by AddTrack(), and DoTracking().
|
protected |
Pointer to MCEventHeader
Definition at line 174 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 174 of file FairPrimaryGenerator.h
Referenced by GenerateEvent(), GetEvent(), and SetEvent().
|
protected |
EventMean time used (P(t)=1/fEventMeanTime*Exp(-t/fEventMeanTime)
Definition at line 184 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 184 of file FairPrimaryGenerator.h
Referenced by SetEventMeanTime().
|
protected |
Event number (Set by the primary generator if not set already by one of the specific generators
Definition at line 196 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 196 of file FairPrimaryGenerator.h
Referenced by GenerateEvent().
|
protected |
Time of event since th start (ns)
Definition at line 182 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 182 of file FairPrimaryGenerator.h
Referenced by GenerateEvent().
|
protected |
max time for one Event (ns)
Definition at line 180 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 180 of file FairPrimaryGenerator.h
Referenced by GenerateEvent(), and SetEventTimeInterval().
|
protected |
min time for one event (ns)
Definition at line 178 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 178 of file FairPrimaryGenerator.h
Referenced by GenerateEvent(), and SetEventTimeInterval().
|
protected |
List of registered generators
Definition at line 170 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 170 of file FairPrimaryGenerator.h
Referenced by AddGenerator(), GetListOfGenerators(), Init(), and ~FairPrimaryGenerator().
|
protected |
Iterator over generator list
Definition at line 172 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 172 of file FairPrimaryGenerator.h
Referenced by GenerateEvent(), and ~FairPrimaryGenerator().
|
protected |
Fair Logger
Definition at line 190 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 190 of file FairPrimaryGenerator.h
Referenced by GenerateEvent().
|
protected |
Number of MC tracks before a Generator is called, needed for MC index update
Definition at line 188 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 188 of file FairPrimaryGenerator.h
Referenced by AddTrack(), and GenerateEvent().
|
protected |
Number of targets;
Definition at line 154 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 154 of file FairPrimaryGenerator.h
Referenced by MakeVertex(), SetMultTarget(), and ~FairPrimaryGenerator().
|
protected |
Number of primary tracks in current event
Definition at line 160 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 160 of file FairPrimaryGenerator.h
Referenced by AddTrack(), and GenerateEvent().
|
protected |
Flag for gaus vertex smearing in z
Definition at line 164 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 164 of file FairPrimaryGenerator.h
Referenced by MakeVertex(), and SmearGausVertexZ().
|
protected |
Flag for vertex smearing in xy
Definition at line 166 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 166 of file FairPrimaryGenerator.h
Referenced by MakeVertex(), and SmearVertexXY().
|
protected |
Flag for uniform vertex smearing in z
Definition at line 162 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 162 of file FairPrimaryGenerator.h
Referenced by MakeVertex(), and SmearVertexZ().
|
protected |
Pointer to MC stack
Definition at line 168 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 168 of file FairPrimaryGenerator.h
Referenced by AddTrack(), and GenerateEvent().
|
protected |
Full target thickness [cm]
Definition at line 156 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 156 of file FairPrimaryGenerator.h
Referenced by MakeVertex(), SetMultTarget(), and SetTarget().
|
protected |
Nominal z position of center of targets [cm]
Definition at line 152 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 152 of file FairPrimaryGenerator.h
Referenced by FairPrimaryGenerator(), MakeVertex(), SetMultTarget(), SetTarget(), and ~FairPrimaryGenerator().
|
protected |
used to generate random numbers for event time;
Definition at line 186 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 186 of file FairPrimaryGenerator.h
Referenced by GenerateEvent(), SetEventMeanTime(), SetEventTime(), and ~FairPrimaryGenerator().
|
staticprotected |
Number of all primaries of this run
Definition at line 192 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 192 of file FairPrimaryGenerator.h
Referenced by GenerateEvent(), and GetTotPrimary().
|
protected |
Vertex position of current event [cm]
Definition at line 158 of file FairPrimaryGenerator.h.
View newest version in sPHENIX GitHub at line 158 of file FairPrimaryGenerator.h
Referenced by AddTrack(), GenerateEvent(), and MakeVertex().