22#include "TGeoBranchArray.h"
39 :
TVirtualMCStack(), fCurrentTrackId(-1), fUserStack(nullptr), fTotalNPrimaries(nullptr), fTotalNTracks(nullptr),
40 fParticles(nullptr), fParticlesStatus(nullptr), fBranchArrayContainer(nullptr)
50 Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t tof, Double_t polx,
51 Double_t poly, Double_t polz,
TMCProcess mech, Int_t &ntr, Double_t weight, Int_t is)
54 fUserStack->
PushTrack(toBeDone, parent, pdg, px, py, pz, e, vx, vy, vz, tof, polx, poly, polz, mech, ntr, weight,
76 itrack = mcStack->top();
103 Warning(
"PopPrimaryForTracking",
"Lookup index %i is ignored.", i);
161 Fatal(
"GetCurrentTrack",
"There is no current track set");
197 Fatal(
"SetCurrentTrack",
"Invalid track ID %i", trackId);
211 Fatal(
"GetParticleStatus",
"Invalid track ID %i", trackId);
224 Fatal(
"GetParticleStatus",
"Invalid track ID %i", trackId);
246 if (trackId >= 0 && trackId <
static_cast<Int_t
>(
fParticles->size()) &&
fParticles->operator[](trackId)) {
268 std::vector<std::unique_ptr<TMCParticleStatus>> *tracksStatus,
TMCProcess
VMC physics process codes.
Storing and re-using geometry states of the TGeoManager in use by storing them as TGeoBranchArrays.
const TGeoBranchArray * GetGeoState(UInt_t userIndex)
Get a TGeoBranchArray to read the current state from.
Bool_t HasTrackId(Int_t trackId) const
Check whether track trackId exists.
void ResetInternals()
Reset internals, clear engine stack and fParticles and reset buffered values.
TParticle * PopPrimaryForTracking(Int_t i) override final
Pop i'th primar, that does not mean that this primariy also has ID==i.
Int_t * fTotalNTracks
Number of all tracks ever pushed linked from the TMCManager.
Int_t GetNtrack() const override final
Get number of tracks on current sub-stack.
std::vector< TParticle * > * fParticles
All tracks linked from the TMCManager.
void SetCurrentTrack(Int_t trackId) override final
Set the current track id from the outside and forward this to the user's stack.
TParticle * PopNextTrack(Int_t &itrack) override final
Pop next track.
Int_t GetStackedNtrack() const
Get only the number of currently stacked tracks.
void PushPrimaryTrackId(Int_t trackId)
Push primary id to be processed.
std::vector< std::unique_ptr< TMCParticleStatus > > * fParticlesStatus
All TMCParticleStatus linked from the TMCManager.
Int_t GetNprimary() const override final
Get number of primaries on current sub-stack.
std::stack< Int_t > fSecondariesStack
IDs of secondaries to be trackedk.
TVirtualMCStack * fUserStack
Pointer to user stack for forwarding PushTrack calls.
TParticle * GetCurrentTrack() const override final
Current track.
void PushSecondaryTrackId(Int_t trackId)
Push secondary id to be processed.
Int_t * fTotalNPrimaries
Number of all primaries ever pushed linked from the TMCManager.
Int_t GetCurrentTrackNumber() const override final
Current track number.
std::stack< Int_t > fPrimariesStack
IDs of primaries to be tracked.
const TGeoBranchArray * GetGeoState(Int_t trackId) const
Get particle's geometry status by trackId.
TGeoMCBranchArrayContainer * fBranchArrayContainer
Storage of TGeoBranchArray pointers.
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.
TMCManagerStack()
Default constructor.
Int_t GetCurrentParentTrackNumber() const override final
Number of the parent of the current track.
const TMCParticleStatus * GetParticleStatus(Int_t trackId) const
Get TMCParticleStatus by trackId.
Int_t fCurrentTrackId
Pointer to current track.
Int_t GetStackedNprimary() const
Get only the number of currently stacked primaries.
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 SetUserStack(TVirtualMCStack *stack)
Set the user stack.
const TGeoBranchArray * GetCurrentGeoState() const
Get current particle's geometry status.
Interface to a user defined particles stack.
virtual void SetCurrentTrack(Int_t trackNumber)=0
Set the current track number.
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;.