VMC Version 2.0
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
TMCManagerStack Class Reference

Concrete implementation of particles stack used by the TMCManager. More...

#include <TMCManagerStack.h>

Inheritance diagram for TMCManagerStack:
Inheritance graph
[legend]

Public Member Functions

 TMCManagerStack ()
 Default constructor.
 
virtual ~TMCManagerStack ()=default
 Destructor.
 
void PushTrack (Int_t toBeDone, Int_t parent, Int_t pdg, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t tof, Double_t polx, Double_t poly, Double_t polz, TMCProcess mech, Int_t &ntr, Double_t weight, Int_t is) override final
 This will just forward the call to the fUserStack's PushTrack.
 
TParticle * PopNextTrack (Int_t &itrack) override final
 Pop next track.
 
TParticle * PopPrimaryForTracking (Int_t i) override final
 Pop i'th primar, that does not mean that this primariy also has ID==i.
 
TParticle * PopPrimaryForTracking (Int_t i, Int_t &itrack)
 Pop i'th primary, that does not mean that this primariy also has ID==i.
 
Int_t GetNtrack () const override final
 Get number of tracks on current sub-stack.
 
Int_t GetStackedNtrack () const
 Get only the number of currently stacked tracks.
 
Int_t GetNprimary () const override final
 Get number of primaries on current sub-stack.
 
Int_t GetStackedNprimary () const
 Get only the number of currently stacked primaries.
 
TParticle * GetCurrentTrack () const override final
 Current track.
 
Int_t GetCurrentTrackNumber () const override final
 Current track number.
 
Int_t GetCurrentParentTrackNumber () const override final
 Number of the parent of the current track.
 
void SetCurrentTrack (Int_t trackId) override final
 Set the current track id from the outside and forward this to the user's stack.
 
const TMCParticleStatusGetParticleStatus (Int_t trackId) const
 Get TMCParticleStatus by trackId.
 
const TGeoBranchArray * GetGeoState (Int_t trackId) const
 Get particle's geometry status by trackId.
 
const TGeoBranchArray * GetCurrentGeoState () const
 Get current particle's geometry status.
 
- Public Member Functions inherited from TVirtualMCStack
 TVirtualMCStack ()
 Default constructor.
 
virtual ~TVirtualMCStack ()
 Destructor.
 
virtual void PushTrack (Int_t toBeDone, Int_t parent, Int_t pdg, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t tof, Double_t polx, Double_t poly, Double_t polz, TMCProcess mech, Int_t &ntr, Double_t weight, Int_t is)=0
 Create a new particle and push into stack;.
 
virtual TParticle * PopNextTrack (Int_t &itrack)=0
 The stack has to provide two pop mechanisms: The first pop mechanism required.
 
virtual TParticle * PopPrimaryForTracking (Int_t i)=0
 The second pop mechanism required.
 
virtual void SetCurrentTrack (Int_t trackNumber)=0
 Set the current track number.
 
virtual Int_t GetNtrack () const =0
 Total number of tracks.
 
virtual Int_t GetNprimary () const =0
 Total number of primary tracks.
 
virtual TParticle * GetCurrentTrack () const =0
 Current track particle.
 
virtual Int_t GetCurrentTrackNumber () const =0
 Current track number.
 
virtual Int_t GetCurrentParentTrackNumber () const =0
 Number of the parent of the current track.
 

Private Member Functions

Bool_t HasTrackId (Int_t trackId) const
 Check whether track trackId exists.
 
void SetUserStack (TVirtualMCStack *stack)
 Set the user stack.
 
void ConnectTrackContainers (std::vector< TParticle * > *particles, std::vector< std::unique_ptr< TMCParticleStatus > > *tracksStatus, TGeoMCBranchArrayContainer *branchArrayContainer, Int_t *totalNPrimaries, Int_t *totalNTracks)
 Set the pointer to vector with all particles and status.
 
void PushPrimaryTrackId (Int_t trackId)
 Push primary id to be processed.
 
void PushSecondaryTrackId (Int_t trackId)
 Push secondary id to be processed.
 
void ResetInternals ()
 Reset internals, clear engine stack and fParticles and reset buffered values.
 

Private Attributes

Int_t fCurrentTrackId
 Pointer to current track.
 
TVirtualMCStackfUserStack
 Pointer to user stack for forwarding PushTrack calls.
 
Int_t * fTotalNPrimaries
 Number of all primaries ever pushed linked from the TMCManager.
 
Int_t * fTotalNTracks
 Number of all tracks ever pushed linked from the TMCManager.
 
std::vector< TParticle * > * fParticles
 All tracks linked from the TMCManager.
 
std::vector< std::unique_ptr< TMCParticleStatus > > * fParticlesStatus
 All TMCParticleStatus linked from the TMCManager.
 
TGeoMCBranchArrayContainerfBranchArrayContainer
 Storage of TGeoBranchArray pointers.
 
std::stack< Int_t > fPrimariesStack
 IDs of primaries to be tracked.
 
std::stack< Int_t > fSecondariesStack
 IDs of secondaries to be trackedk.
 

Friends

class TMCManager
 

Detailed Description

Concrete implementation of particles stack used by the TMCManager.

Definition at line 42 of file TMCManagerStack.h.

Constructor & Destructor Documentation

◆ TMCManagerStack()

TMCManagerStack::TMCManagerStack ( )

Default constructor.

Definition at line 38 of file TMCManagerStack.cxx.

◆ ~TMCManagerStack()

virtual TMCManagerStack::~TMCManagerStack ( )
virtualdefault

Destructor.

Member Function Documentation

◆ PushTrack()

void TMCManagerStack::PushTrack ( Int_t  toBeDone,
Int_t  parent,
Int_t  pdg,
Double_t  px,
Double_t  py,
Double_t  pz,
Double_t  e,
Double_t  vx,
Double_t  vy,
Double_t  vz,
Double_t  tof,
Double_t  polx,
Double_t  poly,
Double_t  polz,
TMCProcess  mech,
Int_t &  ntr,
Double_t  weight,
Int_t  is 
)
finaloverridevirtual

This will just forward the call to the fUserStack's PushTrack.

Create a new particle and push into stack;

  • toBeDone - 1 if particles should go to tracking, 0 otherwise
  • parent - number of the parent track, -1 if track is primary
  • pdg - PDG encoding
  • px, py, pz - particle momentum [GeV/c]
  • e - total energy [GeV]
  • vx, vy, vz - position [cm]
  • tof - time of flight [s]
  • polx, poly, polz - polarization
  • mech - creator process VMC code
  • ntr - track number (is filled by the stack
  • weight - particle weight
  • is - generation status code

Implements TVirtualMCStack.

Definition at line 49 of file TMCManagerStack.cxx.

◆ PopNextTrack()

TParticle * TMCManagerStack::PopNextTrack ( Int_t &  itrack)
finaloverridevirtual

Pop next track.

Implements TVirtualMCStack.

Definition at line 63 of file TMCManagerStack.cxx.

◆ PopPrimaryForTracking() [1/2]

TParticle * TMCManagerStack::PopPrimaryForTracking ( Int_t  i)
finaloverridevirtual

Pop i'th primar, that does not mean that this primariy also has ID==i.

Pop i'th primary; that does not mean that this primariy has ID==i.

Implements TVirtualMCStack.

Definition at line 87 of file TMCManagerStack.cxx.

Referenced by PopPrimaryForTracking().

◆ PopPrimaryForTracking() [2/2]

TParticle * TMCManagerStack::PopPrimaryForTracking ( Int_t  i,
Int_t &  itrack 
)

Pop i'th primary, that does not mean that this primariy also has ID==i.

Pop i'th primary; that does not mean that this primariy has ID==i.

including actual index

Definition at line 99 of file TMCManagerStack.cxx.

◆ GetNtrack()

Int_t TMCManagerStack::GetNtrack ( ) const
finaloverridevirtual

Get number of tracks on current sub-stack.

Implements TVirtualMCStack.

Definition at line 118 of file TMCManagerStack.cxx.

◆ GetStackedNtrack()

Int_t TMCManagerStack::GetStackedNtrack ( ) const

Get only the number of currently stacked tracks.

Definition at line 128 of file TMCManagerStack.cxx.

◆ GetNprimary()

Int_t TMCManagerStack::GetNprimary ( ) const
finaloverridevirtual

Get number of primaries on current sub-stack.

Implements TVirtualMCStack.

Definition at line 138 of file TMCManagerStack.cxx.

◆ GetStackedNprimary()

Int_t TMCManagerStack::GetStackedNprimary ( ) const

Get only the number of currently stacked primaries.

Get number of primaries on current sub-stack.

Definition at line 148 of file TMCManagerStack.cxx.

◆ GetCurrentTrack()

TParticle * TMCManagerStack::GetCurrentTrack ( ) const
finaloverridevirtual

Current track.

Implements TVirtualMCStack.

Definition at line 158 of file TMCManagerStack.cxx.

◆ GetCurrentTrackNumber()

Int_t TMCManagerStack::GetCurrentTrackNumber ( ) const
finaloverridevirtual

Current track number.

Implements TVirtualMCStack.

Definition at line 173 of file TMCManagerStack.cxx.

◆ GetCurrentParentTrackNumber()

Int_t TMCManagerStack::GetCurrentParentTrackNumber ( ) const
finaloverridevirtual

Number of the parent of the current track.

Implements TVirtualMCStack.

Definition at line 183 of file TMCManagerStack.cxx.

◆ SetCurrentTrack()

void TMCManagerStack::SetCurrentTrack ( Int_t  trackId)
finaloverridevirtual

Set the current track id from the outside and forward this to the user's stack.

Implements TVirtualMCStack.

Definition at line 194 of file TMCManagerStack.cxx.

Referenced by PopNextTrack().

◆ GetParticleStatus()

const TMCParticleStatus * TMCManagerStack::GetParticleStatus ( Int_t  trackId) const

Get TMCParticleStatus by trackId.

Definition at line 208 of file TMCManagerStack.cxx.

◆ GetGeoState()

const TGeoBranchArray * TMCManagerStack::GetGeoState ( Int_t  trackId) const

Get particle's geometry status by trackId.

Definition at line 221 of file TMCManagerStack.cxx.

◆ GetCurrentGeoState()

const TGeoBranchArray * TMCManagerStack::GetCurrentGeoState ( ) const

Get current particle's geometry status.

Definition at line 234 of file TMCManagerStack.cxx.

◆ HasTrackId()

Bool_t TMCManagerStack::HasTrackId ( Int_t  trackId) const
private

Check whether track trackId exists.

Definition at line 244 of file TMCManagerStack.cxx.

Referenced by GetGeoState(), GetParticleStatus(), and SetCurrentTrack().

◆ SetUserStack()

void TMCManagerStack::SetUserStack ( TVirtualMCStack stack)
private

Set the user stack.

Definition at line 257 of file TMCManagerStack.cxx.

◆ ConnectTrackContainers()

void TMCManagerStack::ConnectTrackContainers ( std::vector< TParticle * > *  particles,
std::vector< std::unique_ptr< TMCParticleStatus > > *  tracksStatus,
TGeoMCBranchArrayContainer branchArrayContainer,
Int_t *  totalNPrimaries,
Int_t *  totalNTracks 
)
private

Set the pointer to vector with all particles and status.

Connect an engine's stack to the centrally managed vectors.

Definition at line 267 of file TMCManagerStack.cxx.

◆ PushPrimaryTrackId()

void TMCManagerStack::PushPrimaryTrackId ( Int_t  trackId)
private

Push primary id to be processed.

Push primary track id to be processed.

Definition at line 284 of file TMCManagerStack.cxx.

◆ PushSecondaryTrackId()

void TMCManagerStack::PushSecondaryTrackId ( Int_t  trackId)
private

Push secondary id to be processed.

Push secondary track id to be processed.

Definition at line 294 of file TMCManagerStack.cxx.

◆ ResetInternals()

void TMCManagerStack::ResetInternals ( )
private

Reset internals, clear engine stack and fParticles and reset buffered values.

Definition at line 304 of file TMCManagerStack.cxx.

Friends And Related Function Documentation

◆ TMCManager

friend class TMCManager
friend

Definition at line 122 of file TMCManagerStack.h.

Member Data Documentation

◆ fCurrentTrackId

Int_t TMCManagerStack::fCurrentTrackId
private

◆ fUserStack

TVirtualMCStack* TMCManagerStack::fUserStack
private

Pointer to user stack for forwarding PushTrack calls.

Definition at line 143 of file TMCManagerStack.h.

Referenced by PushTrack(), SetCurrentTrack(), and SetUserStack().

◆ fTotalNPrimaries

Int_t* TMCManagerStack::fTotalNPrimaries
private

Number of all primaries ever pushed linked from the TMCManager.

Definition at line 145 of file TMCManagerStack.h.

Referenced by ConnectTrackContainers(), and GetNprimary().

◆ fTotalNTracks

Int_t* TMCManagerStack::fTotalNTracks
private

Number of all tracks ever pushed linked from the TMCManager.

Definition at line 147 of file TMCManagerStack.h.

Referenced by ConnectTrackContainers(), and GetNtrack().

◆ fParticles

std::vector<TParticle *>* TMCManagerStack::fParticles
private

All tracks linked from the TMCManager.

Definition at line 149 of file TMCManagerStack.h.

Referenced by ConnectTrackContainers(), GetCurrentTrack(), HasTrackId(), PopNextTrack(), and PopPrimaryForTracking().

◆ fParticlesStatus

std::vector<std::unique_ptr<TMCParticleStatus> >* TMCManagerStack::fParticlesStatus
private

◆ fBranchArrayContainer

TGeoMCBranchArrayContainer* TMCManagerStack::fBranchArrayContainer
private

Storage of TGeoBranchArray pointers.

Definition at line 153 of file TMCManagerStack.h.

Referenced by ConnectTrackContainers(), GetCurrentGeoState(), and GetGeoState().

◆ fPrimariesStack

std::stack<Int_t> TMCManagerStack::fPrimariesStack
private

IDs of primaries to be tracked.

Definition at line 155 of file TMCManagerStack.h.

Referenced by GetStackedNprimary(), GetStackedNtrack(), PopNextTrack(), PopPrimaryForTracking(), PushPrimaryTrackId(), and ResetInternals().

◆ fSecondariesStack

std::stack<Int_t> TMCManagerStack::fSecondariesStack
private

IDs of secondaries to be trackedk.

Definition at line 157 of file TMCManagerStack.h.

Referenced by GetStackedNtrack(), PopNextTrack(), PushSecondaryTrackId(), and ResetInternals().


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