]>
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 | ||
9e1a0ddb | 8 | #include <TArrayI.h> |
b9d0a01d | 9 | #include <TVirtualMCStack.h> |
9e1a0ddb | 10 | |
9e1a0ddb | 11 | class AliHeader; |
e2afb3b6 | 12 | class TClonesArray; |
9e1a0ddb | 13 | class TFile; |
e2afb3b6 | 14 | class TObjArray; |
15 | class TParticle; | |
9e1a0ddb | 16 | class TTree; |
17 | ||
b9d0a01d | 18 | class AliStack : public TVirtualMCStack |
9e1a0ddb | 19 | { |
20 | public: | |
21 | // creators, destructors | |
22 | AliStack(Int_t size); | |
23 | AliStack(); | |
e2afb3b6 | 24 | AliStack(const AliStack& st); |
9e1a0ddb | 25 | virtual ~AliStack(); |
e2afb3b6 | 26 | AliStack& operator=(const AliStack& st) |
27 | {st.Copy(*this); return(*this);} | |
9e1a0ddb | 28 | |
29 | // methods | |
b9d0a01d | 30 | virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg, |
31 | Float_t *pmom, Float_t *vpos, Float_t *polar, | |
32 | Float_t tof, TMCProcess mech, Int_t &ntr, | |
33 | Float_t weight, Int_t is); | |
34 | virtual void SetTrack(Int_t done, Int_t parent, Int_t pdg, | |
35 | Double_t px, Double_t py, Double_t pz, Double_t e, | |
36 | Double_t vx, Double_t vy, Double_t vz, Double_t tof, | |
37 | Double_t polx, Double_t poly, Double_t polz, | |
38 | TMCProcess mech, Int_t &ntr, Double_t weight, | |
39 | Int_t is); | |
40 | virtual TParticle* GetNextTrack(Int_t& track); | |
41 | virtual TParticle* GetPrimaryForTracking(Int_t i); | |
42 | ||
9e1a0ddb | 43 | void MakeTree(Int_t event, const char *file); |
44 | void BeginEvent(Int_t event); | |
45 | void FinishRun(); | |
cec14bc5 | 46 | Bool_t GetEvent(Int_t nevent); |
9e1a0ddb | 47 | void PurifyKine(); |
48 | void FinishEvent(); | |
49 | void FlagTrack(Int_t track); | |
50 | void KeepTrack(Int_t itrack); | |
51 | void Reset(Int_t size = 0); | |
52 | void DumpPart(Int_t i) const; | |
53 | void DumpPStack (); | |
54 | void DumpLoadedStack () const; | |
55 | ||
56 | // set methods | |
57 | void SetNtrack(Int_t ntrack); | |
b9d0a01d | 58 | virtual void SetCurrentTrack(Int_t track); |
9e1a0ddb | 59 | void SetHighWaterMark(Int_t hgwmk); |
60 | // get methods | |
b9d0a01d | 61 | virtual Int_t GetNtrack() const; |
9e1a0ddb | 62 | Int_t GetNprimary() const; |
b9d0a01d | 63 | virtual Int_t CurrentTrack() const; |
5d8718b8 | 64 | virtual Int_t CurrentTrackParent() const; |
9e1a0ddb | 65 | TObjArray* Particles() const; |
66 | TParticle* Particle(Int_t id); | |
f5f55563 | 67 | Int_t GetPrimary(Int_t id); |
9e1a0ddb | 68 | TTree* TreeK() const {return fTreeK;} |
e94530da | 69 | TParticle* ParticleFromTreeK(Int_t id) const; |
70 | Int_t TreeKEntry(Int_t id) const; | |
9e1a0ddb | 71 | |
72 | protected: | |
73 | // methods | |
74 | void CleanParents(); | |
75 | void ResetArrays(Int_t size); | |
76 | TParticle* GetNextParticle(); | |
e44c5340 | 77 | Bool_t KeepPhysics(TParticle* part); |
9e1a0ddb | 78 | |
79 | private: | |
e2afb3b6 | 80 | void Copy(AliStack &st) const; |
81 | ||
9e1a0ddb | 82 | // data members |
83 | TClonesArray *fParticles; //! Pointer to list of particles | |
84 | TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray | |
85 | TArrayI fParticleFileMap; // Map for particle ids | |
86 | TParticle *fParticleBuffer; //! Pointer to current particle for writing | |
87 | TTree *fTreeK; //! Particle stack | |
88 | Int_t fNtrack; // Number of tracks | |
89 | Int_t fNprimary; // Number of primaries | |
90 | Int_t fCurrent; //! Last track returned from the stack | |
91 | Int_t fCurrentPrimary; //! Last primary track returned from the stack | |
92 | Int_t fHgwmk; //! Last track purified | |
93 | Int_t fLoadPoint; //! Next free position in the particle buffer | |
b9d0a01d | 94 | |
95 | ClassDef(AliStack,3) //Particles stack | |
9e1a0ddb | 96 | }; |
97 | ||
98 | // inline | |
99 | ||
100 | inline void AliStack::SetNtrack(Int_t ntrack) | |
101 | { fNtrack = ntrack; } | |
102 | ||
103 | inline void AliStack::SetCurrentTrack(Int_t track) | |
104 | { fCurrent = track; } | |
105 | ||
106 | inline Int_t AliStack::GetNtrack() const | |
107 | { return fNtrack; } | |
108 | ||
109 | inline Int_t AliStack::GetNprimary() const | |
110 | { return fNprimary; } | |
111 | ||
112 | inline Int_t AliStack::CurrentTrack() const | |
113 | { return fCurrent; } | |
114 | ||
115 | inline TObjArray* AliStack::Particles() const | |
116 | { return fParticleMap; } | |
117 | ||
118 | #endif //ALI_STACK_H |