CbmRoot
CbmStack Class Reference

#include <CbmStack.h>

Inheritance diagram for CbmStack:
[legend]
Collaboration diagram for CbmStack:
[legend]

Public Member Functions

 CbmStack (Int_t size=100)
 
virtual ~CbmStack ()
 
virtual void PushTrack (Int_t toBeDone, Int_t parentId, Int_t pdgCode, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx, Double_t poly, Double_t polz, TMCProcess process, Int_t &ntr, Double_t weight, Int_t status)
 Add a track to the stack (TVirtualMCStack) More...
 
virtual void PushTrack (Int_t toBeDone, Int_t parentId, Int_t pdgCode, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx, Double_t poly, Double_t polz, TMCProcess proc, Int_t &ntr, Double_t weight, Int_t is, Int_t generatorParentID)
 Add a track to the stack (FairGenericStack) More...
 
virtual TParticle * PopNextTrack (Int_t &iTrack)
 
virtual TParticle * PopPrimaryForTracking (Int_t iPrim)
 
virtual void SetCurrentTrack (Int_t iTrack)
 
virtual Int_t GetNtrack () const
 
virtual Int_t GetNprimary () const
 
virtual TParticle * GetCurrentTrack () const
 
virtual Int_t GetCurrentTrackNumber () const
 
virtual Int_t GetCurrentParentTrackNumber () const
 
virtual void AddParticle (TParticle *part)
 
virtual void FillTrackArray ()
 
virtual void UpdateTrackIndex (TRefArray *detArray)
 
virtual void Reset ()
 
virtual void Register ()
 
virtual void Print (Option_t *="") const
 
void StoreSecondaries (Bool_t choice=kTRUE)
 
void SetMinPoints (Int_t min)
 
void SetEnergyCut (Double_t eMin)
 
void StoreMothers (Bool_t choice=kTRUE)
 
void SetFilter (std::unique_ptr< CbmStackFilter > &filter)
 Set the stack filter class. More...
 
void AddPoint (ECbmModuleId iDet)
 
void AddPoint (ECbmModuleId iDet, Int_t iTrack)
 
TParticle * GetParticle (Int_t trackId) const
 
TClonesArray * GetListOfParticles ()
 
void DoTracking (Bool_t doTracking=kTRUE)
 

Private Member Functions

 CbmStack (const CbmStack &)
 global switch for geant propagation More...
 
CbmStackoperator= (const CbmStack &)
 

Private Attributes

std::stack< TParticle * > fStack
 
std::unique_ptr< CbmStackFilterfFilter
 
TClonesArray * fParticles
 Stack filter class. More...
 
TClonesArray * fTracks
 
std::map< Int_t, Int_t > fIndexMap
 
std::map< Int_t, Int_t >::iterator fIndexIter
 
std::map< std::pair< Int_t, ECbmModuleId >, Int_t > fPointsMap
 
Int_t fCurrentTrack
 
Int_t fNPrimaries
 Index of current track. More...
 
Int_t fNParticles
 Number of primary particles. More...
 
Int_t fNTracks
 Number of entries in fParticles. More...
 
Int_t fIndex
 Number of entries in fTracks. More...
 
Bool_t fStoreSecondaries
 Used for merging. More...
 
Int_t fMinPoints
 
Double32_t fEnergyCut
 
Bool_t fStoreMothers
 
Bool_t fdoTracking
 

Detailed Description

Definition at line 45 of file CbmStack.h.

Constructor & Destructor Documentation

◆ CbmStack() [1/2]

CbmStack::CbmStack ( Int_t  size = 100)

Default constructor param size Estimated track number

Definition at line 28 of file CbmStack.cxx.

◆ ~CbmStack()

CbmStack::~CbmStack ( )
virtual

Destructor

Definition at line 52 of file CbmStack.cxx.

References fParticles, and fTracks.

◆ CbmStack() [2/2]

CbmStack::CbmStack ( const CbmStack )
private

global switch for geant propagation

Member Function Documentation

◆ AddParticle()

void CbmStack::AddParticle ( TParticle *  part)
virtual

Add a TParticle to the fParticles array

Definition at line 230 of file CbmStack.cxx.

References fIndex, and fParticles.

◆ AddPoint() [1/2]

void CbmStack::AddPoint ( ECbmModuleId  iDet)

Increment number of points for the current track in a given detector

Parameters
iDetDetector unique identifier

Definition at line 383 of file CbmStack.cxx.

References fCurrentTrack, and fPointsMap.

Referenced by CbmMuch::ProcessHits(), CbmTrd::ProcessHits(), CbmTof::ProcessHits(), CbmMvd::ProcessHits(), CbmRich::ProcessHits(), CbmPsdMC::ProcessHits(), and CbmStsMC::ProcessHits().

◆ AddPoint() [2/2]

void CbmStack::AddPoint ( ECbmModuleId  iDet,
Int_t  iTrack 
)

Increment number of points for an arbitrary track in a given detector

Parameters
iDetDetector unique identifier
iTrackTrack number

Definition at line 395 of file CbmStack.cxx.

References fPointsMap.

◆ DoTracking()

void CbmStack::DoTracking ( Bool_t  doTracking = kTRUE)
inline

Swich on/off the tracking of a particle

Definition at line 264 of file CbmStack.h.

References fdoTracking.

Referenced by CbmFastDecayer::ReadEvent().

◆ FillTrackArray()

void CbmStack::FillTrackArray ( )
virtual

Fill the MCTrack output array, applying filter criteria

Definition at line 241 of file CbmStack.cxx.

References fFilter, fIndexMap, fNTracks, fParticles, fPointsMap, fTracks, GetParticle(), kPsd, kRef, and CbmMCTrack::SetNPoints().

◆ GetCurrentParentTrackNumber()

Int_t CbmStack::GetCurrentParentTrackNumber ( ) const
virtual

Get the track number of the parent of the current track Declared in TVirtualMCStack

Definition at line 408 of file CbmStack.cxx.

References GetCurrentTrack().

◆ GetCurrentTrack()

TParticle * CbmStack::GetCurrentTrack ( ) const
virtual

Get the current track's particle Declared in TVirtualMCStack

Definition at line 221 of file CbmStack.cxx.

References fCurrentTrack, and GetParticle().

Referenced by GetCurrentParentTrackNumber().

◆ GetCurrentTrackNumber()

virtual Int_t CbmStack::GetCurrentTrackNumber ( ) const
inlinevirtual

Get the number of the current track Declared in TVirtualMCStack

Definition at line 197 of file CbmStack.h.

References fCurrentTrack.

◆ GetListOfParticles()

TClonesArray* CbmStack::GetListOfParticles ( )
inline

Definition at line 261 of file CbmStack.h.

References fParticles.

◆ GetNprimary()

virtual Int_t CbmStack::GetNprimary ( ) const
inlinevirtual

Get number of primary tracks Declared in TVirtualMCStack

Definition at line 185 of file CbmStack.h.

References fNPrimaries.

Referenced by CbmFastDecayer::ReadEvent().

◆ GetNtrack()

virtual Int_t CbmStack::GetNtrack ( ) const
inlinevirtual

Get total number of tracks Declared in TVirtualMCStack

Definition at line 179 of file CbmStack.h.

References fNParticles.

Referenced by CbmFastSim::Exec(), and CbmFastDecayer::ReadEvent().

◆ GetParticle()

TParticle * CbmStack::GetParticle ( Int_t  trackId) const

Accessors

Definition at line 420 of file CbmStack.cxx.

References fNParticles, and fParticles.

Referenced by CbmFastSim::Exec(), FillTrackArray(), GetCurrentTrack(), and CbmFastDecayer::ReadEvent().

◆ operator=()

CbmStack& CbmStack::operator= ( const CbmStack )
private

◆ PopNextTrack()

TParticle * CbmStack::PopNextTrack ( Int_t &  iTrack)
virtual

Get next particle for tracking from the stack. Declared in TVirtualMCStack

Parameters
iTrackindex of popped track (return)
Returns
Pointer to the TParticle of the track

This method is called when using TGeant3.

Definition at line 179 of file CbmStack.cxx.

References fCurrentTrack, and fStack.

◆ PopPrimaryForTracking()

TParticle * CbmStack::PopPrimaryForTracking ( Int_t  iPrim)
virtual

Get primary particle by index for tracking from stack Declared in TVirtualMCStack

Parameters
iPrimindex of primary particle
Returns
Pointer to the TParticle of the track

This method is called when using TGeant4.

Definition at line 205 of file CbmStack.cxx.

References fNPrimaries, and fParticles.

◆ Print()

void CbmStack::Print ( Option_t *  = "") const
virtual

Output to screen

Parameters
iVerbose0=events summary, 1=track info

Definition at line 368 of file CbmStack.cxx.

References fNParticles, fNPrimaries, fNTracks, fTracks, and Cbm::ToString().

◆ PushTrack() [1/2]

void CbmStack::PushTrack ( Int_t  toBeDone,
Int_t  parentId,
Int_t  pdgCode,
Double_t  px,
Double_t  py,
Double_t  pz,
Double_t  e,
Double_t  vx,
Double_t  vy,
Double_t  vz,
Double_t  time,
Double_t  polx,
Double_t  poly,
Double_t  polz,
TMCProcess  proc,
Int_t &  ntr,
Double_t  weight,
Int_t  is,
Int_t  generatorParentID 
)
virtual

Add a track to the stack (FairGenericStack)

Parameters
toBeDoneFlag for putting the track on the internal stack
parentIdIndex of parent track
pdgCodePDG particle code
pxMomentum x component [GeV]
pyMomentum y component [GeV]
pzMomentum z component [GeV]
eEnergy [GeV]
vxStart vertex x coordinate [cm]
vyStart vertex y coordinate [cm]
vzStart vertex z coordinate [cm]
polxPolarisation in x
polyPolarisation in y
polzPolarisation in z
processGeneration process
weightWeight factor
status"Generation status code" - no idea what that means
generatorParentIdIndex of the mother track on generator level
[out]ntrTrack index

This method is pure virtual in FairGenericStack. It is called by FairPrimaryGenerator::AddTrack for primary tracks.

The meaning of generatorParentId is that a mother-daughter relationship may be present already at generator level - usually, when a particle decay is done in the generator itself. An example is the CbmPlutoGenerator. This parental relationship is preserved for the particles during transport.

Definition at line 112 of file CbmStack.cxx.

References fdoTracking, fNParticles, fNPrimaries, and fStack.

◆ PushTrack() [2/2]

void CbmStack::PushTrack ( Int_t  toBeDone,
Int_t  parentId,
Int_t  pdgCode,
Double_t  px,
Double_t  py,
Double_t  pz,
Double_t  e,
Double_t  vx,
Double_t  vy,
Double_t  vz,
Double_t  time,
Double_t  polx,
Double_t  poly,
Double_t  polz,
TMCProcess  process,
Int_t &  ntr,
Double_t  weight,
Int_t  status 
)
virtual

Add a track to the stack (TVirtualMCStack)

Parameters
toBeDoneFlag for putting the track on the internal stack
parentIdIndex of parent track
pdgCodePDG particle code
pxMomentum x component [GeV]
pyMomentum y component [GeV]
pzMomentum z component [GeV]
eEnergy [GeV]
vxStart vertex x coordinate [cm]
vyStart vertex y coordinate [cm]
vzStart vertex z coordinate [cm]
polxPolarisation in x
polyPolarisation in y
polzPolarisation in z
processGeneration process
weightWeight factor
status"Generation status code" - no idea what that means
[out]ntrTrack index

This method is pure virtual in TVirtualMCStack. It is called by the by the transport engine for tracks generated during the transport.

Definition at line 66 of file CbmStack.cxx.

◆ Register()

void CbmStack::Register ( )
virtual

Register the MCTrack array to the Root Manager

Definition at line 361 of file CbmStack.cxx.

References fTracks.

◆ Reset()

void CbmStack::Reset ( )
virtual

Resets arrays and stack and deletes particles and tracks

Definition at line 346 of file CbmStack.cxx.

References fCurrentTrack, fIndex, fNParticles, fNPrimaries, fNTracks, fParticles, fPointsMap, fStack, and fTracks.

◆ SetCurrentTrack()

virtual void CbmStack::SetCurrentTrack ( Int_t  iTrack)
inlinevirtual

Set the current track number Declared in TVirtualMCStack

Parameters
iTracktrack number

Definition at line 173 of file CbmStack.h.

References fCurrentTrack.

◆ SetEnergyCut()

void CbmStack::SetEnergyCut ( Double_t  eMin)
inline

Definition at line 235 of file CbmStack.h.

References fEnergyCut.

◆ SetFilter()

void CbmStack::SetFilter ( std::unique_ptr< CbmStackFilter > &  filter)
inline

Set the stack filter class.

Definition at line 240 of file CbmStack.h.

References fFilter.

◆ SetMinPoints()

void CbmStack::SetMinPoints ( Int_t  min)
inline

Definition at line 234 of file CbmStack.h.

References fMinPoints, and min().

◆ StoreMothers()

void CbmStack::StoreMothers ( Bool_t  choice = kTRUE)
inline

Definition at line 236 of file CbmStack.h.

References fStoreMothers.

◆ StoreSecondaries()

void CbmStack::StoreSecondaries ( Bool_t  choice = kTRUE)
inline

Modifiers

Definition at line 233 of file CbmStack.h.

References fStoreSecondaries.

◆ UpdateTrackIndex()

void CbmStack::UpdateTrackIndex ( TRefArray *  detArray)
virtual

Update the track index in the MCTracks and MCPoints

Definition at line 291 of file CbmStack.cxx.

References fIndexIter, fIndexMap, fNTracks, fTracks, CbmMCTrack::GetMotherId(), i, and CbmMCTrack::SetMotherId().

Member Data Documentation

◆ fCurrentTrack

Int_t CbmStack::fCurrentTrack
private

Some indizes and counters

Definition at line 295 of file CbmStack.h.

Referenced by AddPoint(), GetCurrentTrack(), GetCurrentTrackNumber(), PopNextTrack(), Reset(), and SetCurrentTrack().

◆ fdoTracking

Bool_t CbmStack::fdoTracking
private

go to tracking

Definition at line 309 of file CbmStack.h.

Referenced by DoTracking(), and PushTrack().

◆ fEnergyCut

Double32_t CbmStack::fEnergyCut
private

Definition at line 305 of file CbmStack.h.

Referenced by SetEnergyCut().

◆ fFilter

std::unique_ptr<CbmStackFilter> CbmStack::fFilter
private

Definition at line 272 of file CbmStack.h.

Referenced by FillTrackArray(), and SetFilter().

◆ fIndex

Int_t CbmStack::fIndex
private

Number of entries in fTracks.

Definition at line 299 of file CbmStack.h.

Referenced by AddParticle(), and Reset().

◆ fIndexIter

std::map<Int_t, Int_t>::iterator CbmStack::fIndexIter
private

Definition at line 287 of file CbmStack.h.

Referenced by UpdateTrackIndex().

◆ fIndexMap

std::map<Int_t, Int_t> CbmStack::fIndexMap
private

STL map from particle index to track index

Definition at line 286 of file CbmStack.h.

Referenced by FillTrackArray(), and UpdateTrackIndex().

◆ fMinPoints

Int_t CbmStack::fMinPoints
private

Definition at line 304 of file CbmStack.h.

Referenced by SetMinPoints().

◆ fNParticles

Int_t CbmStack::fNParticles
private

Number of primary particles.

Definition at line 297 of file CbmStack.h.

Referenced by GetNtrack(), GetParticle(), Print(), PushTrack(), and Reset().

◆ fNPrimaries

Int_t CbmStack::fNPrimaries
private

Index of current track.

Definition at line 296 of file CbmStack.h.

Referenced by GetNprimary(), PopPrimaryForTracking(), Print(), PushTrack(), and Reset().

◆ fNTracks

Int_t CbmStack::fNTracks
private

Number of entries in fParticles.

Definition at line 298 of file CbmStack.h.

Referenced by FillTrackArray(), Print(), Reset(), and UpdateTrackIndex().

◆ fParticles

TClonesArray* CbmStack::fParticles
private

Stack filter class.

Array of TParticles (contains all TParticles put into or created by the transport

Definition at line 278 of file CbmStack.h.

Referenced by AddParticle(), FillTrackArray(), GetListOfParticles(), GetParticle(), PopPrimaryForTracking(), Reset(), and ~CbmStack().

◆ fPointsMap

std::map<std::pair<Int_t, ECbmModuleId>, Int_t> CbmStack::fPointsMap
private

STL map from track index and detector ID to number of MCPoints

Definition at line 291 of file CbmStack.h.

Referenced by AddPoint(), FillTrackArray(), and Reset().

◆ fStack

std::stack<TParticle*> CbmStack::fStack
private

STL stack (FILO) used to handle the TParticles for tracking

Definition at line 269 of file CbmStack.h.

Referenced by PopNextTrack(), PushTrack(), and Reset().

◆ fStoreMothers

Bool_t CbmStack::fStoreMothers
private

Definition at line 306 of file CbmStack.h.

Referenced by StoreMothers().

◆ fStoreSecondaries

Bool_t CbmStack::fStoreSecondaries
private

Used for merging.

Variables defining the criteria for output selection

Definition at line 303 of file CbmStack.h.

Referenced by StoreSecondaries().

◆ fTracks

TClonesArray* CbmStack::fTracks
private

Array of CbmMCTracks containg the tracks written to the output

Definition at line 282 of file CbmStack.h.

Referenced by FillTrackArray(), Print(), Register(), Reset(), UpdateTrackIndex(), and ~CbmStack().


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