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