EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairPrimaryGenerator Class Reference

#include <EicRoot/blob/master/base/FairPrimaryGenerator.h>

+ Inheritance diagram for FairPrimaryGenerator:
+ Collaboration diagram for FairPrimaryGenerator:

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)
 
FairMCEventHeaderGetEvent ()
 
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
 
FairGenericStackfStack
 
TObjArray * fGenList
 
TIterator * fListIter
 
FairMCEventHeaderfEvent
 
Bool_t fdoTracking
 
Double_t fEventTimeMin
 
Double_t fEventTimeMax
 
Double_t fEventTime
 
Double_t fEventMeanTime
 
TF1 * fTimeProb
 
Int_t fMCIndexOffset
 
FairLoggerfLogger
 
Int_t fEventNr
 

Static Protected Attributes

static Int_t fTotPrim =0
 

Private Member Functions

 FairPrimaryGenerator (const FairPrimaryGenerator &)
 
FairPrimaryGeneratoroperator= (const FairPrimaryGenerator &)
 
 ClassDef (FairPrimaryGenerator, 4)
 

Detailed Description

Definition at line 33 of file FairPrimaryGenerator.h.

View newest version in sPHENIX GitHub at line 33 of file FairPrimaryGenerator.h

Constructor & Destructor Documentation

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.

FairPrimaryGenerator::~FairPrimaryGenerator ( )
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.

FairPrimaryGenerator::FairPrimaryGenerator ( const FairPrimaryGenerator )
private

Member Function Documentation

void FairPrimaryGenerator::AddGenerator ( FairGenerator generator)
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().

+ Here is the caller graph for this function:

void FairPrimaryGenerator::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 
)
virtual

Public method AddTrack Adding a track to the MC stack. To be called within the ReadEvent methods of the registered generators.

Parameters
pdgidParticle ID (PDG code)
px,py,pzMomentum coordinates [GeV]
vx,vy,vzTrack 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

FairPrimaryGenerator::ClassDef ( FairPrimaryGenerator  ,
 
)
private
void FairPrimaryGenerator::DoTracking ( Bool_t  doTracking = kTRUE)
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.

Bool_t FairPrimaryGenerator::GenerateEvent ( FairGenericStack pStack)
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.

Parameters
pStackThe particle stack
Returns
kTRUE if successful, kFALSE if not

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

FairMCEventHeader* FairPrimaryGenerator::GetEvent ( )
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.

TObjArray* FairPrimaryGenerator::GetListOfGenerators ( )
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().

+ Here is the caller graph for this function:

Int_t FairPrimaryGenerator::GetTotPrimary ( )
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().

+ Here is the caller graph for this function:

Bool_t FairPrimaryGenerator::Init ( )
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void FairPrimaryGenerator::MakeVertex ( )
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().

+ Here is the caller graph for this function:

FairPrimaryGenerator& FairPrimaryGenerator::operator= ( const FairPrimaryGenerator )
private
void FairPrimaryGenerator::SetBeam ( Double_t  beamX0,
Double_t  beamY0,
Double_t  beamSigmaX,
Double_t  beamSigmaY 
)

Set beam position and widths.

Parameters
beamX0mean x position of beam at target
beamY0mean y position of beam at target
beamSigmaXGaussian beam width in x
beamSigmaYGaussian 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.

void FairPrimaryGenerator::SetEvent ( FairMCEventHeader event)
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().

+ Here is the caller graph for this function:

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.

Parameters
nroftargetsnumber of targets
*targetZz positions of target center
targetDzfull 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.

Parameters
targetZz position of target center
targetDzfull target thickness

Definition at line 260 of file FairPrimaryGenerator.cxx.

View newest version in sPHENIX GitHub at line 260 of file FairPrimaryGenerator.cxx

References dz, fTargetDz, fTargetZ, and z.

void FairPrimaryGenerator::SmearGausVertexZ ( Bool_t  flag)
inline

Definition at line 111 of file FairPrimaryGenerator.h.

View newest version in sPHENIX GitHub at line 111 of file FairPrimaryGenerator.h

References fSmearGausVertexZ.

void FairPrimaryGenerator::SmearVertexXY ( Bool_t  flag)
inline

Definition at line 112 of file FairPrimaryGenerator.h.

View newest version in sPHENIX GitHub at line 112 of file FairPrimaryGenerator.h

References fSmearVertexXY.

void FairPrimaryGenerator::SmearVertexZ ( Bool_t  flag)
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.

Member Data Documentation

Double_t FairPrimaryGenerator::fBeamSigmaX
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().

Double_t FairPrimaryGenerator::fBeamSigmaY
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().

Double_t FairPrimaryGenerator::fBeamX0
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().

Double_t FairPrimaryGenerator::fBeamY0
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().

Bool_t FairPrimaryGenerator::fdoTracking
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().

FairMCEventHeader* FairPrimaryGenerator::fEvent
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().

Double_t FairPrimaryGenerator::fEventMeanTime
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().

Int_t FairPrimaryGenerator::fEventNr
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().

Double_t FairPrimaryGenerator::fEventTime
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().

Double_t FairPrimaryGenerator::fEventTimeMax
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().

Double_t FairPrimaryGenerator::fEventTimeMin
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().

TObjArray* FairPrimaryGenerator::fGenList
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().

TIterator* FairPrimaryGenerator::fListIter
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().

FairLogger* FairPrimaryGenerator::fLogger
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().

Int_t FairPrimaryGenerator::fMCIndexOffset
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().

Int_t FairPrimaryGenerator::fNrTargets
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().

Int_t FairPrimaryGenerator::fNTracks
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().

Bool_t FairPrimaryGenerator::fSmearGausVertexZ
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().

Bool_t FairPrimaryGenerator::fSmearVertexXY
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().

Bool_t FairPrimaryGenerator::fSmearVertexZ
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().

FairGenericStack* FairPrimaryGenerator::fStack
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().

Double_t FairPrimaryGenerator::fTargetDz
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().

Double_t* FairPrimaryGenerator::fTargetZ
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().

TF1* FairPrimaryGenerator::fTimeProb
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().

Int_t FairPrimaryGenerator::fTotPrim =0
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().

TVector3 FairPrimaryGenerator::fVertex
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().


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