3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 // Particles stack class
9 // Implements the TMCVirtualStack of the Virtual Monte Carlo
19 #include <TVirtualMCStack.h>
22 #include "AliConfig.h"
25 class AliStack : public TVirtualMCStack
28 // creators, destructors
29 AliStack(Int_t size, const char* evfoldname = AliConfig::GetDefaultEventFolderName());
31 AliStack(const AliStack& st);
33 AliStack& operator=(const AliStack& st)
34 {st.Copy(*this); return(*this);}
38 virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
39 Float_t *pmom, Float_t *vpos, Float_t *polar,
40 Float_t tof, TMCProcess mech, Int_t &ntr,
41 Float_t weight, Int_t is);
43 virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
44 Double_t px, Double_t py, Double_t pz, Double_t e,
45 Double_t vx, Double_t vy, Double_t vz, Double_t tof,
46 Double_t polx, Double_t poly, Double_t polz,
47 TMCProcess mech, Int_t &ntr, Double_t weight,
50 virtual TParticle* PopNextTrack(Int_t& track);
51 virtual TParticle* GetCurrentTrack() const {return fCurrentTrack;}
52 virtual TParticle* PopPrimaryForTracking(Int_t i);
61 void FlagTrack(Int_t track);
62 void KeepTrack(Int_t itrack);
63 void Reset(Int_t size = 0);
64 void DumpPart(Int_t i) const;
66 void DumpLoadedStack () const;
69 void SetNtrack(Int_t ntrack);
70 virtual void SetCurrentTrack(Int_t track);
71 void SetHighWaterMark(Int_t hgwmk);
73 virtual Int_t GetNtrack() const;
74 Int_t GetNprimary() const;
75 virtual Int_t GetCurrentTrackNumber() const;
76 virtual Int_t GetCurrentParentTrackNumber() const;
77 TObjArray* Particles() const;
78 TParticle* Particle(Int_t id);
79 Int_t GetPrimary(Int_t id);
81 void SetEventFolderName(const char* foldname);
82 TParticle* ParticleFromTreeK(Int_t id) const;
83 Int_t TreeKEntry(Int_t id) const;
84 Bool_t IsPhysicalPrimary(Int_t i);
88 void ResetArrays(Int_t size);
89 TParticle* GetNextParticle();
90 Bool_t KeepPhysics(TParticle* part);
91 Bool_t IsStable(Int_t pdg) const;
93 void Copy(TObject &st) const;
96 TClonesArray *fParticles; //! Pointer to list of particles
97 TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray
98 TArrayI fParticleFileMap; // Map for particle ids
99 TParticle *fParticleBuffer; //! Pointer to current particle for writing
100 TParticle *fCurrentTrack; //! Pointer to particle currently transported
101 TTree *fTreeK; //! Particle stack
102 Int_t fNtrack; // Number of tracks
103 Int_t fNprimary; // Number of primaries
104 Int_t fCurrent; //! Last track returned from the stack
105 Int_t fCurrentPrimary; //! Last primary track returned from the stack
106 Int_t fHgwmk; //! Last track purified
107 Int_t fLoadPoint; //! Next free position in the particle buffer
109 TString fEventFolderName; //! Folder name where event is mounted
110 ClassDef(AliStack,4) //Particles stack
115 inline void AliStack::SetNtrack(Int_t ntrack)
116 { fNtrack = ntrack; }
118 inline void AliStack::SetCurrentTrack(Int_t track)
119 { fCurrent = track; }
121 inline Int_t AliStack::GetNtrack() const
124 inline Int_t AliStack::GetNprimary() const
125 { return fNprimary; }
127 inline Int_t AliStack::GetCurrentTrackNumber() const
130 inline TObjArray* AliStack::Particles() const
131 { return fParticleMap; }