]>
Commit | Line | Data |
---|---|---|
9e1a0ddb | 1 | #ifndef ALI_STACK_H |
2 | #define ALI_STACK_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
af7ba10c | 8 | // Particles stack class |
9 | // Implements the TMCVirtualStack of the Virtual Monte Carlo | |
10 | // Author A.Morsch | |
88cb7938 | 11 | |
e2afb3b6 | 12 | class TClonesArray; |
9e1a0ddb | 13 | class TFile; |
e2afb3b6 | 14 | class TObjArray; |
15 | class TParticle; | |
88cb7938 | 16 | class TString; |
af7ba10c | 17 | class TTree; |
18 | #include <TArrayI.h> | |
19 | #include <TVirtualMCStack.h> | |
20 | ||
21 | class AliHeader; | |
22 | #include "AliConfig.h" | |
23 | ||
9e1a0ddb | 24 | |
b9d0a01d | 25 | class AliStack : public TVirtualMCStack |
9e1a0ddb | 26 | { |
27 | public: | |
28 | // creators, destructors | |
e191bb57 | 29 | AliStack(Int_t size, const char* evfoldname = AliConfig::GetDefaultEventFolderName()); |
9e1a0ddb | 30 | AliStack(); |
e2afb3b6 | 31 | AliStack(const AliStack& st); |
9e1a0ddb | 32 | virtual ~AliStack(); |
e2afb3b6 | 33 | AliStack& operator=(const AliStack& st) |
34 | {st.Copy(*this); return(*this);} | |
9e1a0ddb | 35 | |
36 | // methods | |
88cb7938 | 37 | |
642f15cf | 38 | virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg, |
88cb7938 | 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); | |
42 | ||
642f15cf | 43 | virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg, |
88cb7938 | 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, | |
48 | Int_t is); | |
49 | ||
642f15cf | 50 | virtual TParticle* PopNextTrack(Int_t& track); |
51 | virtual TParticle* GetCurrentTrack() const {return fCurrentTrack;} | |
52 | virtual TParticle* PopPrimaryForTracking(Int_t i); | |
b9d0a01d | 53 | |
88cb7938 | 54 | void ConnectTree(); |
55 | void BeginEvent(); | |
9e1a0ddb | 56 | void FinishRun(); |
88cb7938 | 57 | Bool_t GetEvent(); |
9e1a0ddb | 58 | void PurifyKine(); |
59 | void FinishEvent(); | |
60 | void FlagTrack(Int_t track); | |
61 | void KeepTrack(Int_t itrack); | |
62 | void Reset(Int_t size = 0); | |
63 | void DumpPart(Int_t i) const; | |
64 | void DumpPStack (); | |
65 | void DumpLoadedStack () const; | |
66 | ||
67 | // set methods | |
68 | void SetNtrack(Int_t ntrack); | |
b9d0a01d | 69 | virtual void SetCurrentTrack(Int_t track); |
9e1a0ddb | 70 | void SetHighWaterMark(Int_t hgwmk); |
71 | // get methods | |
b9d0a01d | 72 | virtual Int_t GetNtrack() const; |
9e1a0ddb | 73 | Int_t GetNprimary() const; |
642f15cf | 74 | virtual Int_t GetCurrentTrackNumber() const; |
75 | virtual Int_t GetCurrentParentTrackNumber() const; | |
9e1a0ddb | 76 | TObjArray* Particles() const; |
77 | TParticle* Particle(Int_t id); | |
f5f55563 | 78 | Int_t GetPrimary(Int_t id); |
88cb7938 | 79 | TTree* TreeK(); |
80 | void SetEventFolderName(const char* foldname); | |
e94530da | 81 | TParticle* ParticleFromTreeK(Int_t id) const; |
82 | Int_t TreeKEntry(Int_t id) const; | |
9e1a0ddb | 83 | |
84 | protected: | |
85 | // methods | |
86 | void CleanParents(); | |
87 | void ResetArrays(Int_t size); | |
88 | TParticle* GetNextParticle(); | |
e44c5340 | 89 | Bool_t KeepPhysics(TParticle* part); |
9e1a0ddb | 90 | |
91 | private: | |
6c4904c2 | 92 | void Copy(TObject &st) const; |
e2afb3b6 | 93 | |
9e1a0ddb | 94 | // data members |
95 | TClonesArray *fParticles; //! Pointer to list of particles | |
96 | TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray | |
97 | TArrayI fParticleFileMap; // Map for particle ids | |
98 | TParticle *fParticleBuffer; //! Pointer to current particle for writing | |
fe046ade | 99 | TParticle *fCurrentTrack; //! Pointer to particle currently transported |
9e1a0ddb | 100 | TTree *fTreeK; //! Particle stack |
101 | Int_t fNtrack; // Number of tracks | |
102 | Int_t fNprimary; // Number of primaries | |
103 | Int_t fCurrent; //! Last track returned from the stack | |
104 | Int_t fCurrentPrimary; //! Last primary track returned from the stack | |
105 | Int_t fHgwmk; //! Last track purified | |
106 | Int_t fLoadPoint; //! Next free position in the particle buffer | |
b9d0a01d | 107 | |
88cb7938 | 108 | TString fEventFolderName; //! Folder name where event is mounted |
109 | ClassDef(AliStack,4) //Particles stack | |
9e1a0ddb | 110 | }; |
111 | ||
112 | // inline | |
113 | ||
114 | inline void AliStack::SetNtrack(Int_t ntrack) | |
115 | { fNtrack = ntrack; } | |
116 | ||
117 | inline void AliStack::SetCurrentTrack(Int_t track) | |
118 | { fCurrent = track; } | |
119 | ||
120 | inline Int_t AliStack::GetNtrack() const | |
121 | { return fNtrack; } | |
122 | ||
123 | inline Int_t AliStack::GetNprimary() const | |
124 | { return fNprimary; } | |
125 | ||
642f15cf | 126 | inline Int_t AliStack::GetCurrentTrackNumber() const |
9e1a0ddb | 127 | { return fCurrent; } |
128 | ||
129 | inline TObjArray* AliStack::Particles() const | |
130 | { return fParticleMap; } | |
131 | ||
132 | #endif //ALI_STACK_H |