CbmRoot
Loading...
Searching...
No Matches
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)
 
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)
 
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.
 
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
 
CbmStackoperator= (const CbmStack &)
 

Private Attributes

std::stack< TParticle * > fStack
 
std::unique_ptr< CbmStackFilterfFilter
 
TClonesArray * fParticles
 Stack filter class.
 
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.
 
Int_t fNParticles
 Number of primary particles.
 
Int_t fNTracks
 Number of entries in fParticles.
 
Int_t fIndex
 Number of entries in fTracks.
 
Bool_t fStoreSecondaries
 Used for merging.
 
Int_t fMinPoints
 
Double32_t fEnergyCut
 
Bool_t fStoreMothers
 
Bool_t fdoTracking
 

Detailed Description

Definition at line 50 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 32 of file CbmStack.cxx.

◆ ~CbmStack()

CbmStack::~CbmStack ( )
virtual

Destructor

Definition at line 58 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 186 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 331 of file CbmStack.cxx.

References fCurrentTrack, and fPointsMap.

Referenced by CbmFsdMC::ProcessHits(), CbmMuch::ProcessHits(), CbmMvd::ProcessHits(), CbmPsdMC::ProcessHits(), CbmRich::ProcessHits(), CbmStsMC::ProcessHits(), CbmTof::ProcessHits(), and CbmTrd::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 343 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 240 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 198 of file CbmStack.cxx.

References fFilter, fIndexMap, fNTracks, fParticles, fPointsMap, fTracks, GetParticle(), kNofSystems, 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 356 of file CbmStack.cxx.

References GetCurrentTrack().

◆ GetCurrentTrack()

TParticle * CbmStack::GetCurrentTrack ( ) const
virtual

Get the current track's particle Declared in TVirtualMCStack

Definition at line 176 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 172 of file CbmStack.h.

References fCurrentTrack.

◆ GetListOfParticles()

TClonesArray * CbmStack::GetListOfParticles ( )
inline

Definition at line 237 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 160 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 154 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 368 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 129 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 156 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 316 of file CbmStack.cxx.

References fNParticles, fNPrimaries, fNTracks, and fTracks.

◆ 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 87 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 73 of file CbmStack.cxx.

References PushTrack().

Referenced by PushTrack().

◆ Register()

void CbmStack::Register ( )
virtual

Register the MCTrack array to the Root Manager

Definition at line 311 of file CbmStack.cxx.

References fTracks.

◆ Reset()

void CbmStack::Reset ( )
virtual

Resets arrays and stack and deletes particles and tracks

Definition at line 295 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 148 of file CbmStack.h.

References fCurrentTrack.

◆ SetEnergyCut()

void CbmStack::SetEnergyCut ( Double_t eMin)
inline

Definition at line 210 of file CbmStack.h.

References fEnergyCut.

◆ SetFilter()

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

Set the stack filter class.

Definition at line 215 of file CbmStack.h.

References fFilter.

◆ SetMinPoints()

void CbmStack::SetMinPoints ( Int_t min)
inline

Definition at line 209 of file CbmStack.h.

References fMinPoints, and min().

◆ StoreMothers()

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

Definition at line 211 of file CbmStack.h.

References fStoreMothers.

◆ StoreSecondaries()

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

Modifiers

Definition at line 208 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 245 of file CbmStack.cxx.

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

Member Data Documentation

◆ fCurrentTrack

Int_t CbmStack::fCurrentTrack
private

Some indizes and counters

Definition at line 271 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 285 of file CbmStack.h.

Referenced by DoTracking(), and PushTrack().

◆ fEnergyCut

Double32_t CbmStack::fEnergyCut
private

Definition at line 281 of file CbmStack.h.

Referenced by SetEnergyCut().

◆ fFilter

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

Definition at line 248 of file CbmStack.h.

Referenced by FillTrackArray(), and SetFilter().

◆ fIndex

Int_t CbmStack::fIndex
private

Number of entries in fTracks.

Definition at line 275 of file CbmStack.h.

Referenced by AddParticle(), and Reset().

◆ fIndexIter

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

Definition at line 263 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 262 of file CbmStack.h.

Referenced by FillTrackArray(), and UpdateTrackIndex().

◆ fMinPoints

Int_t CbmStack::fMinPoints
private

Definition at line 280 of file CbmStack.h.

Referenced by SetMinPoints().

◆ fNParticles

Int_t CbmStack::fNParticles
private

Number of primary particles.

Definition at line 273 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 272 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 274 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 254 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 267 of file CbmStack.h.

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

◆ fStack

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

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

Definition at line 245 of file CbmStack.h.

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

◆ fStoreMothers

Bool_t CbmStack::fStoreMothers
private

Definition at line 282 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 279 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 258 of file CbmStack.h.

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


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