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

#include <EicRoot/blob/master/pnddata/PndStack.h>

+ Inheritance diagram for PndStack:
+ Collaboration diagram for PndStack:

Public Member Functions

 PndStack (Int_t size=100)
 
virtual ~PndStack ()
 
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)
 
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 secondParentId)
 
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 (Int_t iVerbose=0) const
 
void StoreSecondaries (Bool_t choice=kTRUE)
 
void SetMinPoints (Int_t min)
 
void SetEnergyCut (Double_t eMin)
 
void StoreMothers (Bool_t choice=kTRUE)
 
void AddPoint (DetectorId iDet)
 
void AddPoint (DetectorId iDet, Int_t iTrack)
 
TParticle * GetParticle (Int_t trackId) const
 
TClonesArray * GetListOfParticles ()
 
- Public Member Functions inherited from FairGenericStack
 FairGenericStack ()
 
 FairGenericStack (Int_t size)
 
virtual ~FairGenericStack ()
 
void AddParticle (TParticle *part)
 

Private Member Functions

void SelectTracks ()
 
void SetGeneratorFlags (Int_t myid)
 
 PndStack (const PndStack &L)
 
PndStackoperator= (const PndStack &)
 

Private Attributes

std::stack< TParticle * > fStack
 
TClonesArray * fParticles
 
TClonesArray * fTracks
 
std::map< Int_t, Bool_t > fStoreMap
 
std::map< Int_t, Bool_t >::iterator fStoreIter
 
std::map< Int_t, Int_t > fIndexMap
 
std::map< Int_t, Int_t >::iterator fIndexIter
 
std::map< std::pair< Int_t,
Int_t >, 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
 

Additional Inherited Members

- Protected Attributes inherited from FairGenericStack
FairLoggerfLogger
 
Int_t fVerbose
 

Detailed Description

PndStack.h

Author
D.Bertini d.ber.nosp@m.tini.nosp@m.@gsi..nosp@m.de
V.Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e

Version 14/06/07 by V. Friese

This class handles the particle stack for the transport simulation. For the stack FILO functunality, it uses the STL stack. To store the tracks during transport, a TParticle arry is used. At the end of the event, tracks satisfying the filter criteria are copied to a PndMCTrack array, which is stored in the output.

The filtering criteria for the output tracks are:

  • primary tracks are stored in any case.
  • secondary tracks are stored if they have a minimal number of points (sum of all detectors) and a minimal energy, or are the

The storage of secondaries can be switched off. The storage of all mothers can be switched off. By default, the minimal number of points is 1 and the energy cut is 0.

Definition at line 43 of file PndStack.h.

View newest version in sPHENIX GitHub at line 43 of file PndStack.h

Constructor & Destructor Documentation

PndStack::PndStack ( Int_t  size = 100)

Default constructor *param size Estimated track number

Definition at line 27 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 27 of file PndStack.cxx

References fIndexMap, fParticles, fPointsMap, fStoreMap, and fTracks.

PndStack::~PndStack ( )
virtual

Destructor

Definition at line 42 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 42 of file PndStack.cxx

References fParticles, and fTracks.

PndStack::PndStack ( const PndStack L)
private

Member Function Documentation

void PndStack::AddParticle ( TParticle *  part)
virtual

Add a TParticle to the fParticles array

Definition at line 181 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 181 of file PndStack.cxx

References fIndex, and fParticles.

void PndStack::AddPoint ( DetectorId  iDet)

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

Parameters
iDetDetector unique identifier

Definition at line 405 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 405 of file PndStack.cxx

References fCurrentTrack, and fPointsMap.

void PndStack::AddPoint ( DetectorId  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 416 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 416 of file PndStack.cxx

References fPointsMap.

void PndStack::FillTrackArray ( )
virtual

Fill the MCTrack output array, applying filter criteria

Reimplemented from FairGenericStack.

Definition at line 193 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 193 of file PndStack.cxx

References FairLogger::Debug(), FairLogger::Error(), fIndexMap, fNParticles, fNTracks, fPointsMap, fStoreIter, fStoreMap, GetParticle(), gLogger, kHYP, kRICH, MESSAGE_ORIGIN, Print(), SelectTracks(), SetGeneratorFlags(), and PndMCTrack::SetNPoints().

+ Here is the call graph for this function:

Int_t PndStack::GetCurrentParentTrackNumber ( ) const
virtual

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

Reimplemented from FairGenericStack.

Definition at line 429 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 429 of file PndStack.cxx

References GetCurrentTrack().

+ Here is the call graph for this function:

TParticle * PndStack::GetCurrentTrack ( ) const
virtual

Get the current track's particle Declared in TVirtualMCStack

Reimplemented from FairGenericStack.

Definition at line 168 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 168 of file PndStack.cxx

References fCurrentTrack, GetParticle(), gLogger, MESSAGE_ORIGIN, and FairLogger::Warning().

Referenced by GetCurrentParentTrackNumber().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual Int_t PndStack::GetCurrentTrackNumber ( ) const
inlinevirtual

Get the number of the current track Declared in TVirtualMCStack

Reimplemented from FairGenericStack.

Definition at line 132 of file PndStack.h.

View newest version in sPHENIX GitHub at line 132 of file PndStack.h

References fCurrentTrack.

TClonesArray* PndStack::GetListOfParticles ( )
inline

Definition at line 189 of file PndStack.h.

View newest version in sPHENIX GitHub at line 189 of file PndStack.h

References fParticles.

virtual Int_t PndStack::GetNprimary ( ) const
inlinevirtual

Get number of primary tracks Declared in TVirtualMCStack

Reimplemented from FairGenericStack.

Definition at line 120 of file PndStack.h.

View newest version in sPHENIX GitHub at line 120 of file PndStack.h

References fNPrimaries.

virtual Int_t PndStack::GetNtrack ( ) const
inlinevirtual

Get total number of tracks Declared in TVirtualMCStack

Reimplemented from FairGenericStack.

Definition at line 114 of file PndStack.h.

View newest version in sPHENIX GitHub at line 114 of file PndStack.h

References fNParticles.

TParticle * PndStack::GetParticle ( Int_t  trackId) const
virtual

Accessors

Reimplemented from FairGenericStack.

Definition at line 439 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 439 of file PndStack.cxx

References FairLogger::Error(), fNParticles, fParticles, gLogger, and MESSAGE_ORIGIN.

Referenced by FillTrackArray(), GetCurrentTrack(), and SelectTracks().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PndStack& PndStack::operator= ( const PndStack )
inlineprivate

Definition at line 244 of file PndStack.h.

View newest version in sPHENIX GitHub at line 244 of file PndStack.h

TParticle * PndStack::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

Reimplemented from FairGenericStack.

Definition at line 113 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 113 of file PndStack.cxx

References fCurrentTrack, and fStack.

TParticle * PndStack::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

Reimplemented from FairGenericStack.

Definition at line 141 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 141 of file PndStack.cxx

References FairLogger::Error(), fNPrimaries, fParticles, gLogger, MESSAGE_ORIGIN, and part.

+ Here is the call graph for this function:

void PndStack::Print ( Int_t  iVerbose = 0) const
virtual

Output to screen

Parameters
iVerbose,:0=events summary, 1=track info

Reimplemented from FairGenericStack.

Definition at line 390 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 390 of file PndStack.cxx

References FairLogger::Debug(), fNParticles, fNPrimaries, fNTracks, fTracks, gLogger, and MESSAGE_ORIGIN.

Referenced by FillTrackArray().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Add a TParticle to the stack. Declared in TVirtualMCStack

Parameters
toBeDoneFlag for tracking
parentIDIndex of mother particle
pdgCodeParticle type (PDG encoding)
px,py,pzMomentum components at start vertex [GeV]
eTotal energy at start vertex [GeV]
vx,vy,vzCoordinates of start vertex [cm]
timeStart time of track [s]
polx,poly,polzPolarisation vector
procProduction mechanism (VMC encoding)
ntrTrack number (filled by the stack)
weightParticle weight
isGeneration status code (whatever that means)

Reimplemented from FairGenericStack.

Definition at line 57 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 57 of file PndStack.cxx

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

Reimplemented from FairGenericStack.

Definition at line 73 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 73 of file PndStack.cxx

References fNParticles, fNPrimaries, fParticles, fStack, and particle.

void PndStack::Register ( )
virtual

Register the MCTrack array to the Root Manager

Reimplemented from FairGenericStack.

Definition at line 382 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 382 of file PndStack.cxx

References fTracks, FairRootManager::Instance(), and FairRootManager::Register().

+ Here is the call graph for this function:

void PndStack::Reset ( )
virtual

Resets arrays and stack and deletes particles and tracks

Reimplemented from FairGenericStack.

Definition at line 368 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 368 of file PndStack.cxx

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

void PndStack::SelectTracks ( )
private

Mark tracks for output using selection criteria

Definition at line 451 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 451 of file PndStack.cxx

References fEnergyCut, fMinPoints, fNParticles, fPointsMap, fStoreMap, fStoreMothers, fStoreSecondaries, GetParticle(), kHYP, kRICH, mass, and p.

Referenced by FillTrackArray().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void PndStack::SetCurrentTrack ( Int_t  iTrack)
inlinevirtual

Set the current track number Declared in TVirtualMCStack

Parameters
iTracktrack number

Reimplemented from FairGenericStack.

Definition at line 108 of file PndStack.h.

View newest version in sPHENIX GitHub at line 108 of file PndStack.h

References fCurrentTrack.

void PndStack::SetEnergyCut ( Double_t  eMin)
inline

Definition at line 170 of file PndStack.h.

View newest version in sPHENIX GitHub at line 170 of file PndStack.h

References fEnergyCut.

void PndStack::SetGeneratorFlags ( Int_t  myid)
private

Definition at line 243 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 243 of file PndStack.cxx

References FairLogger::Error(), fIndexMap, fParticles, fTracks, PndMCTrack::GetMotherID(), gLogger, Acts::UnitConstants::m, MESSAGE_ORIGIN, n, part, PndMCTrack::SetGeneratorCreated(), and PndMCTrack::SetGeneratorDecayed().

Referenced by FillTrackArray().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PndStack::SetMinPoints ( Int_t  min)
inline

Definition at line 169 of file PndStack.h.

View newest version in sPHENIX GitHub at line 169 of file PndStack.h

References fMinPoints, and min.

Referenced by Config().

+ Here is the caller graph for this function:

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

Definition at line 171 of file PndStack.h.

View newest version in sPHENIX GitHub at line 171 of file PndStack.h

References fStoreMothers.

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

Modifiers

Definition at line 168 of file PndStack.h.

View newest version in sPHENIX GitHub at line 168 of file PndStack.h

References fStoreSecondaries.

Referenced by Config().

+ Here is the caller graph for this function:

void PndStack::UpdateTrackIndex ( TRefArray *  detArray)
virtual

Update the track index in the MCTracks and MCPoints

Reimplemented from FairGenericStack.

Definition at line 298 of file PndStack.cxx.

View newest version in sPHENIX GitHub at line 298 of file PndStack.cxx

References FairLogger::Debug(), FairLogger::Error(), fIndexIter, fIndexMap, fNTracks, fTracks, FairDetector::GetCollection(), FairMCEventHeader::GetEventID(), PndMCTrack::GetMotherID(), FairRootManager::GetObject(), PndMCTrack::GetSecondMotherID(), FairMCPoint::GetTrackID(), gLogger, hitArray, FairRootManager::Instance(), MESSAGE_ORIGIN, FairMultiLinkedData::SetLink(), PndMCTrack::SetMotherID(), PndMCTrack::SetSecondMotherID(), and FairMCPoint::SetTrackID().

+ Here is the call graph for this function:

Member Data Documentation

Int_t PndStack::fCurrentTrack
private

Some indizes and counters

Definition at line 225 of file PndStack.h.

View newest version in sPHENIX GitHub at line 225 of file PndStack.h

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

Double32_t PndStack::fEnergyCut
private

Definition at line 235 of file PndStack.h.

View newest version in sPHENIX GitHub at line 235 of file PndStack.h

Referenced by SelectTracks(), and SetEnergyCut().

Int_t PndStack::fIndex
private

Number of entries in fTracks.

Definition at line 229 of file PndStack.h.

View newest version in sPHENIX GitHub at line 229 of file PndStack.h

Referenced by AddParticle(), and Reset().

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

Definition at line 217 of file PndStack.h.

View newest version in sPHENIX GitHub at line 217 of file PndStack.h

Referenced by UpdateTrackIndex().

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

STL map from particle index to track index

Definition at line 216 of file PndStack.h.

View newest version in sPHENIX GitHub at line 216 of file PndStack.h

Referenced by FillTrackArray(), PndStack(), SetGeneratorFlags(), and UpdateTrackIndex().

Int_t PndStack::fMinPoints
private

Definition at line 234 of file PndStack.h.

View newest version in sPHENIX GitHub at line 234 of file PndStack.h

Referenced by SelectTracks(), and SetMinPoints().

Int_t PndStack::fNParticles
private

Number of primary particles.

Definition at line 227 of file PndStack.h.

View newest version in sPHENIX GitHub at line 227 of file PndStack.h

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

Int_t PndStack::fNPrimaries
private

Index of current track.

Definition at line 226 of file PndStack.h.

View newest version in sPHENIX GitHub at line 226 of file PndStack.h

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

Int_t PndStack::fNTracks
private

Number of entries in fParticles.

Definition at line 228 of file PndStack.h.

View newest version in sPHENIX GitHub at line 228 of file PndStack.h

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

TClonesArray* PndStack::fParticles
private

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

Definition at line 203 of file PndStack.h.

View newest version in sPHENIX GitHub at line 203 of file PndStack.h

Referenced by AddParticle(), GetListOfParticles(), GetParticle(), PndStack(), PopPrimaryForTracking(), PushTrack(), Reset(), SetGeneratorFlags(), and ~PndStack().

std::map<std::pair<Int_t, Int_t>, Int_t> PndStack::fPointsMap
private

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

Definition at line 221 of file PndStack.h.

View newest version in sPHENIX GitHub at line 221 of file PndStack.h

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

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

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

Definition at line 197 of file PndStack.h.

View newest version in sPHENIX GitHub at line 197 of file PndStack.h

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

std::map<Int_t, Bool_t>::iterator PndStack::fStoreIter
private

Definition at line 212 of file PndStack.h.

View newest version in sPHENIX GitHub at line 212 of file PndStack.h

Referenced by FillTrackArray().

std::map<Int_t, Bool_t> PndStack::fStoreMap
private

STL map from particle index to storage flag

Definition at line 211 of file PndStack.h.

View newest version in sPHENIX GitHub at line 211 of file PndStack.h

Referenced by FillTrackArray(), PndStack(), and SelectTracks().

Bool_t PndStack::fStoreMothers
private

Definition at line 236 of file PndStack.h.

View newest version in sPHENIX GitHub at line 236 of file PndStack.h

Referenced by SelectTracks(), and StoreMothers().

Bool_t PndStack::fStoreSecondaries
private

Used for merging.

Variables defining the criteria for output selection

Definition at line 233 of file PndStack.h.

View newest version in sPHENIX GitHub at line 233 of file PndStack.h

Referenced by SelectTracks(), and StoreSecondaries().

TClonesArray* PndStack::fTracks
private

Array of PndMCTracks containg the tracks written to the output

Definition at line 207 of file PndStack.h.

View newest version in sPHENIX GitHub at line 207 of file PndStack.h

Referenced by PndStack(), Print(), Register(), Reset(), SetGeneratorFlags(), UpdateTrackIndex(), and ~PndStack().


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