]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliStack.h
Catching up to NewIO -> Particle stores all passible PID and their probabilities
[u/mrichter/AliRoot.git] / STEER / AliStack.h
CommitLineData
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 11class AliHeader;
e2afb3b6 12class TClonesArray;
9e1a0ddb 13class TFile;
e2afb3b6 14class TObjArray;
15class TParticle;
9e1a0ddb 16class TTree;
17
b9d0a01d 18class 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);
fe046ade 41 virtual TParticle* GetCurrentTrack() {return fCurrentTrack;}
b9d0a01d 42 virtual TParticle* GetPrimaryForTracking(Int_t i);
43
9e1a0ddb 44 void MakeTree(Int_t event, const char *file);
45 void BeginEvent(Int_t event);
46 void FinishRun();
cec14bc5 47 Bool_t GetEvent(Int_t nevent);
9e1a0ddb 48 void PurifyKine();
49 void FinishEvent();
50 void FlagTrack(Int_t track);
51 void KeepTrack(Int_t itrack);
52 void Reset(Int_t size = 0);
53 void DumpPart(Int_t i) const;
54 void DumpPStack ();
55 void DumpLoadedStack () const;
56
57 // set methods
58 void SetNtrack(Int_t ntrack);
b9d0a01d 59 virtual void SetCurrentTrack(Int_t track);
9e1a0ddb 60 void SetHighWaterMark(Int_t hgwmk);
61 // get methods
b9d0a01d 62 virtual Int_t GetNtrack() const;
9e1a0ddb 63 Int_t GetNprimary() const;
b9d0a01d 64 virtual Int_t CurrentTrack() const;
5d8718b8 65 virtual Int_t CurrentTrackParent() const;
9e1a0ddb 66 TObjArray* Particles() const;
67 TParticle* Particle(Int_t id);
f5f55563 68 Int_t GetPrimary(Int_t id);
9e1a0ddb 69 TTree* TreeK() const {return fTreeK;}
e94530da 70 TParticle* ParticleFromTreeK(Int_t id) const;
71 Int_t TreeKEntry(Int_t id) const;
9e1a0ddb 72
73 protected:
74 // methods
75 void CleanParents();
76 void ResetArrays(Int_t size);
77 TParticle* GetNextParticle();
e44c5340 78 Bool_t KeepPhysics(TParticle* part);
9e1a0ddb 79
80 private:
e2afb3b6 81 void Copy(AliStack &st) const;
82
9e1a0ddb 83 // data members
84 TClonesArray *fParticles; //! Pointer to list of particles
85 TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray
86 TArrayI fParticleFileMap; // Map for particle ids
87 TParticle *fParticleBuffer; //! Pointer to current particle for writing
fe046ade 88 TParticle *fCurrentTrack; //! Pointer to particle currently transported
9e1a0ddb 89 TTree *fTreeK; //! Particle stack
90 Int_t fNtrack; // Number of tracks
91 Int_t fNprimary; // Number of primaries
92 Int_t fCurrent; //! Last track returned from the stack
93 Int_t fCurrentPrimary; //! Last primary track returned from the stack
94 Int_t fHgwmk; //! Last track purified
95 Int_t fLoadPoint; //! Next free position in the particle buffer
b9d0a01d 96
97 ClassDef(AliStack,3) //Particles stack
9e1a0ddb 98};
99
100// inline
101
102inline void AliStack::SetNtrack(Int_t ntrack)
103{ fNtrack = ntrack; }
104
105inline void AliStack::SetCurrentTrack(Int_t track)
106{ fCurrent = track; }
107
108inline Int_t AliStack::GetNtrack() const
109{ return fNtrack; }
110
111inline Int_t AliStack::GetNprimary() const
112{ return fNprimary; }
113
114inline Int_t AliStack::CurrentTrack() const
115{ return fCurrent; }
116
117inline TObjArray* AliStack::Particles() const
118{ return fParticleMap; }
119
120#endif //ALI_STACK_H