]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliStack.h
Code clean-up (F.Carminati)
[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>
e2afb3b6 9#include <TMCProcess.h>
10#include <TObject.h>
9e1a0ddb 11#include <TStopwatch.h>
b9d0a01d 12#include <TVirtualMCStack.h>
9e1a0ddb 13
9e1a0ddb 14class AliHeader;
e2afb3b6 15class TClonesArray;
9e1a0ddb 16class TFile;
e2afb3b6 17class TObjArray;
18class TParticle;
9e1a0ddb 19class TTree;
20
b9d0a01d 21class AliStack : public TVirtualMCStack
9e1a0ddb 22{
23 public:
24 // creators, destructors
25 AliStack(Int_t size);
26 AliStack();
e2afb3b6 27 AliStack(const AliStack& st);
9e1a0ddb 28 virtual ~AliStack();
e2afb3b6 29 AliStack& operator=(const AliStack& st)
30 {st.Copy(*this); return(*this);}
9e1a0ddb 31
32 // methods
b9d0a01d 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
9e1a0ddb 46 void MakeTree(Int_t event, const char *file);
47 void BeginEvent(Int_t event);
48 void FinishRun();
cec14bc5 49 Bool_t GetEvent(Int_t nevent);
9e1a0ddb 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);
b9d0a01d 61 virtual void SetCurrentTrack(Int_t track);
9e1a0ddb 62 void SetHighWaterMark(Int_t hgwmk);
63 // get methods
b9d0a01d 64 virtual Int_t GetNtrack() const;
9e1a0ddb 65 Int_t GetNprimary() const;
b9d0a01d 66 virtual Int_t CurrentTrack() const;
9e1a0ddb 67 TObjArray* Particles() const;
68 TParticle* Particle(Int_t id);
f5f55563 69 Int_t GetPrimary(Int_t id);
9e1a0ddb 70 TTree* TreeK() const {return fTreeK;}
e94530da 71 TParticle* ParticleFromTreeK(Int_t id) const;
72 Int_t TreeKEntry(Int_t id) const;
9e1a0ddb 73
74 protected:
75 // methods
76 void CleanParents();
77 void ResetArrays(Int_t size);
78 TParticle* GetNextParticle();
e44c5340 79 Bool_t KeepPhysics(TParticle* part);
9e1a0ddb 80
81 private:
e2afb3b6 82 void Copy(AliStack &st) const;
83
9e1a0ddb 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
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