R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BStack Class Reference

R3BStack.h. More...

#include <R3BMCStack.h>

Public Member Functions

 R3BStack (Int_t size=100)
 Default constructor param size Estimated track number.
 
virtual ~R3BStack ()
 Destructor.
 
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)
 Add a TParticle to the stack.
 
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)
 Get next particle for tracking from the stack.
 
virtual TParticle * PopPrimaryForTracking (Int_t iPrim)
 Get primary particle by index for tracking from stack Declared in TVirtualMCStack.
 
virtual void SetCurrentTrack (Int_t iTrack)
 Set the current track number Declared in TVirtualMCStack.
 
virtual Int_t GetNtrack () const
 Get total number of tracks Declared in TVirtualMCStack.
 
virtual Int_t GetNprimary () const
 Get number of primary tracks Declared in TVirtualMCStack.
 
virtual TParticle * GetCurrentTrack () const
 Get the current track's particle Declared in TVirtualMCStack.
 
virtual Int_t GetCurrentTrackNumber () const
 Get the number of the current track Declared in TVirtualMCStack.
 
virtual Int_t GetCurrentParentTrackNumber () const
 Get the track number of the parent of the current track Declared in TVirtualMCStack.
 
virtual void AddParticle (TParticle *part)
 Add a TParticle to the fParticles array.
 
virtual void FillTrackArray ()
 Fill the MCTrack output array, applying filter criteria.
 
virtual void UpdateTrackIndex (TRefArray *detArray)
 Update the track index in the MCTracks and MCPoints.
 
virtual void Reset ()
 Resets arrays and stack and deletes particles and tracks.
 
virtual void Register ()
 Register the MCTrack array to the Root Manager.
 
virtual void PrintStack (Int_t iVerbose) const
 Output to screen.
 
void StoreSecondaries (Bool_t choice=kTRUE)
 Modifiers.
 
void SetMinPoints (Int_t min)
 
void SetEnergyCut (Double_t eMin)
 
void StoreMothers (Bool_t choice=kTRUE)
 
void AddPoint (DetectorId iDet)
 Increment number of points for the current track in a given detector.
 
void AddPoint (DetectorId iDet, Int_t iTrack)
 Increment number of points for an arbitrary track in a given detector.
 
TParticle * GetParticle (Int_t trackId) const
 Accessors.
 
TClonesArray * GetListOfParticles ()
 
void SetDebug (Bool_t t)
 

Private Member Functions

 R3BStack (const R3BStack &)
 
R3BStackoperator= (const R3BStack &)
 
void SelectTracks ()
 Mark tracks for output using selection criteria.
 

Private Attributes

std::stack< TParticle * > fStack
 STL stack (FILO) used to handle the TParticles for tracking.
 
TClonesArray * fParticles
 Array of TParticles (contains all TParticles put into or created by the transport.
 
TClonesArray * fTracks
 Array of R3BMCTracks containg the tracks written to the output.
 
std::map< Int_t, Bool_t > fStoreMap
 STL map from particle index to storage flag.
 
std::map< Int_t, Bool_t >::iterator fStoreIter
 
std::map< Int_t, Int_t > fIndexMap
 STL map from particle index to track index.
 
std::map< Int_t, Int_t >::iterator fIndexIter
 
std::map< int, std::array< int, kLAST+1 > > fPointsMap
 STL map from track index and detector ID to number of MCPoints.
 
Int_t fCurrentTrack
 Some indizes and counters.
 
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.
 
Int_t fMC
 Used for merging.
 
Bool_t fStoreSecondaries
 index for MC units testing
 
Int_t fMinPoints
 
Double32_t fEnergyCut
 
Bool_t fStoreMothers
 
Bool_t fDebug
 

Detailed Description

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 R3BMCTrack 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 54 of file R3BMCStack.h.

Constructor & Destructor Documentation

◆ R3BStack() [1/2]

R3BStack::R3BStack ( Int_t size = 100)

Definition at line 41 of file R3BMCStack.cxx.

◆ ~R3BStack()

R3BStack::~R3BStack ( )
virtual

Definition at line 76 of file R3BMCStack.cxx.

◆ R3BStack() [2/2]

R3BStack::R3BStack ( const R3BStack & )
private

Member Function Documentation

◆ AddParticle()

void R3BStack::AddParticle ( TParticle * part)
virtual

Definition at line 231 of file R3BMCStack.cxx.

◆ AddPoint() [1/2]

void R3BStack::AddPoint ( DetectorId iDet)
Parameters
iDetDetector unique identifier

Definition at line 403 of file R3BMCStack.cxx.

◆ AddPoint() [2/2]

void R3BStack::AddPoint ( DetectorId iDet,
Int_t iTrack )
Parameters
iDetDetector unique identifier
iTrackTrack number

Definition at line 413 of file R3BMCStack.cxx.

◆ FillTrackArray()

void R3BStack::FillTrackArray ( )
virtual

Definition at line 242 of file R3BMCStack.cxx.

◆ GetCurrentParentTrackNumber()

Int_t R3BStack::GetCurrentParentTrackNumber ( ) const
virtual

Definition at line 425 of file R3BMCStack.cxx.

◆ GetCurrentTrack()

TParticle * R3BStack::GetCurrentTrack ( ) const
virtual

Definition at line 219 of file R3BMCStack.cxx.

◆ GetCurrentTrackNumber()

virtual Int_t R3BStack::GetCurrentTrackNumber ( ) const
inlinevirtual

Definition at line 158 of file R3BMCStack.h.

◆ GetListOfParticles()

TClonesArray * R3BStack::GetListOfParticles ( )
inline

Definition at line 204 of file R3BMCStack.h.

◆ GetNprimary()

virtual Int_t R3BStack::GetNprimary ( ) const
inlinevirtual

Definition at line 148 of file R3BMCStack.h.

◆ GetNtrack()

virtual Int_t R3BStack::GetNtrack ( ) const
inlinevirtual

Definition at line 143 of file R3BMCStack.h.

◆ GetParticle()

TParticle * R3BStack::GetParticle ( Int_t trackId) const

Definition at line 436 of file R3BMCStack.cxx.

◆ operator=()

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

Definition at line 210 of file R3BMCStack.h.

◆ PopNextTrack()

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

Declared in TVirtualMCStack

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

Definition at line 166 of file R3BMCStack.cxx.

◆ PopPrimaryForTracking()

TParticle * R3BStack::PopPrimaryForTracking ( Int_t iPrim)
virtual
Parameters
iPrimindex of primary particle
Returns
Pointer to the TParticle of the track

Definition at line 194 of file R3BMCStack.cxx.

◆ PrintStack()

void R3BStack::PrintStack ( Int_t iVerbose) const
virtual
Parameters
iVerbose0=events summary, 1=track info

Definition at line 385 of file R3BMCStack.cxx.

◆ PushTrack() [1/2]

void R3BStack::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

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)

Definition at line 92 of file R3BMCStack.cxx.

◆ PushTrack() [2/2]

void R3BStack::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

Definition at line 117 of file R3BMCStack.cxx.

◆ Register()

void R3BStack::Register ( )
virtual

Definition at line 381 of file R3BMCStack.cxx.

◆ Reset()

void R3BStack::Reset ( )
virtual

Definition at line 367 of file R3BMCStack.cxx.

◆ SelectTracks()

void R3BStack::SelectTracks ( )
private

Definition at line 447 of file R3BMCStack.cxx.

◆ SetCurrentTrack()

virtual void R3BStack::SetCurrentTrack ( Int_t iTrack)
inlinevirtual
Parameters
iTracktrack number

Definition at line 138 of file R3BMCStack.h.

◆ SetDebug()

void R3BStack::SetDebug ( Bool_t t)
inline

Definition at line 206 of file R3BMCStack.h.

◆ SetEnergyCut()

void R3BStack::SetEnergyCut ( Double_t eMin)
inline

Definition at line 188 of file R3BMCStack.h.

◆ SetMinPoints()

void R3BStack::SetMinPoints ( Int_t min)
inline

Definition at line 187 of file R3BMCStack.h.

◆ StoreMothers()

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

Definition at line 189 of file R3BMCStack.h.

◆ StoreSecondaries()

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

Definition at line 186 of file R3BMCStack.h.

◆ UpdateTrackIndex()

void R3BStack::UpdateTrackIndex ( TRefArray * detArray)
virtual

Definition at line 303 of file R3BMCStack.cxx.

Member Data Documentation

◆ fCurrentTrack

Int_t R3BStack::fCurrentTrack
private

Definition at line 235 of file R3BMCStack.h.

◆ fDebug

Bool_t R3BStack::fDebug
private

Definition at line 247 of file R3BMCStack.h.

◆ fEnergyCut

Double32_t R3BStack::fEnergyCut
private

Definition at line 245 of file R3BMCStack.h.

◆ fIndex

Int_t R3BStack::fIndex
private

Definition at line 239 of file R3BMCStack.h.

◆ fIndexIter

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

Definition at line 229 of file R3BMCStack.h.

◆ fIndexMap

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

Definition at line 228 of file R3BMCStack.h.

◆ fMC

Int_t R3BStack::fMC
private

Definition at line 240 of file R3BMCStack.h.

◆ fMinPoints

Int_t R3BStack::fMinPoints
private

Definition at line 244 of file R3BMCStack.h.

◆ fNParticles

Int_t R3BStack::fNParticles
private

Definition at line 237 of file R3BMCStack.h.

◆ fNPrimaries

Int_t R3BStack::fNPrimaries
private

Definition at line 236 of file R3BMCStack.h.

◆ fNTracks

Int_t R3BStack::fNTracks
private

Definition at line 238 of file R3BMCStack.h.

◆ fParticles

TClonesArray* R3BStack::fParticles
private

Definition at line 218 of file R3BMCStack.h.

◆ fPointsMap

std::map<int, std::array<int, kLAST + 1> > R3BStack::fPointsMap
private

Definition at line 232 of file R3BMCStack.h.

◆ fStack

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

Definition at line 213 of file R3BMCStack.h.

◆ fStoreIter

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

Definition at line 225 of file R3BMCStack.h.

◆ fStoreMap

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

Definition at line 224 of file R3BMCStack.h.

◆ fStoreMothers

Bool_t R3BStack::fStoreMothers
private

Definition at line 246 of file R3BMCStack.h.

◆ fStoreSecondaries

Bool_t R3BStack::fStoreSecondaries
private

Variables defining the criteria for output selection

Definition at line 243 of file R3BMCStack.h.

◆ fTracks

TClonesArray* R3BStack::fTracks
private

Definition at line 221 of file R3BMCStack.h.


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