]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliStack.h
Add particle status code to argument list of SetTrack(..).
[u/mrichter/AliRoot.git] / STEER / AliStack.h
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
8 #include <TObject.h>
9 #include <TArrayI.h>
10 #include <TStopwatch.h>
11
12 #include "AliMCProcess.h"
13
14 class TObjArray;
15 class TClonesArray;
16 class TParticle;
17 class AliHeader;
18 class TFile;
19 class TTree;
20
21
22
23 class AliStack : public TObject
24 {
25   public:
26     // creators, destructors
27     AliStack(Int_t size);
28     AliStack();
29     virtual ~AliStack();
30
31     // methods
32     void  MakeTree(Int_t event, const char *file);
33     void  BeginEvent(Int_t event);
34     void  FinishRun();
35     Bool_t GetEvent(Int_t nevent);
36     void  SetTrack(Int_t done, Int_t parent, Int_t pdg, 
37                    Float_t *pmom, Float_t *vpos, Float_t *polar, 
38                    Float_t tof, AliMCProcess mech, Int_t &ntr,
39                    Float_t weight = 1, Int_t is = 0);
40     void  SetTrack(Int_t done, Int_t parent, Int_t pdg,
41                    Double_t px, Double_t py, Double_t pz, Double_t e,
42                    Double_t vx, Double_t vy, Double_t vz, Double_t tof,
43                    Double_t polx, Double_t poly, Double_t polz,
44                    AliMCProcess mech, Int_t &ntr, Float_t weight = 1,
45                    Int_t is = 0);
46     void  GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom,
47                    Float_t &e, Float_t *vpos, Float_t *polar, Float_t &tof);
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);
59     void  SetCurrentTrack(Int_t track);                           
60     void  SetHighWaterMark(Int_t hgwmk);    
61     // get methods
62     Int_t       GetNtrack() const;
63     Int_t       GetNprimary() const;
64     Int_t       CurrentTrack() const;
65     TObjArray*  Particles() const;
66     TParticle*  Particle(Int_t id);
67     Int_t       GetPrimary(Int_t id);
68     TTree*      TreeK() const {return fTreeK;}
69     
70   protected:
71     // methods
72     void  CleanParents();
73     void  ResetArrays(Int_t size);
74     TParticle* GetNextParticle();
75     
76   private:
77     // data members
78     TClonesArray  *fParticles;         //! Pointer to list of particles
79     TObjArray     *fParticleMap;       //! Map of particles in the supporting TClonesArray
80     TArrayI        fParticleFileMap;   //  Map for particle ids 
81     TParticle     *fParticleBuffer;    //! Pointer to current particle for writing
82     TTree         *fTreeK;             //! Particle stack  
83     Int_t          fNtrack;            //  Number of tracks
84     Int_t          fNprimary;          //  Number of primaries
85     Int_t          fCurrent;           //! Last track returned from the stack
86     Int_t          fCurrentPrimary;    //! Last primary track returned from the stack
87     Int_t          fHgwmk;             //! Last track purified
88     Int_t          fLoadPoint;         //! Next free position in the particle buffer
89     TStopwatch     fTimer;             //! Timer object
90     ClassDef(AliStack,2) //Particles stack
91 };
92
93 // inline
94
95 inline void  AliStack::SetNtrack(Int_t ntrack)
96 { fNtrack = ntrack; }
97
98 inline void  AliStack::SetCurrentTrack(Int_t track)
99 { fCurrent = track; }
100
101 inline Int_t AliStack::GetNtrack() const
102 { return fNtrack; }
103
104 inline Int_t AliStack::GetNprimary() const
105 { return fNprimary; }
106
107 inline Int_t AliStack::CurrentTrack() const 
108 { return fCurrent; }
109
110 inline TObjArray* AliStack::Particles() const
111 { return fParticleMap; }
112
113 #endif //ALI_STACK_H