]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliStack.h
Updated SDigitizer; Added AliTOFanalyzeSDigits.C macro
[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
8#include <TObject.h>
9#include <TArrayI.h>
10#include <TStopwatch.h>
11
12#include "AliMCProcess.h"
13
14class TObjArray;
15class TClonesArray;
16class TParticle;
17class AliHeader;
18class TFile;
19class TTree;
20
21
22
23class 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();
cec14bc5 35 Bool_t GetEvent(Int_t nevent);
9e1a0ddb 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,
47c8bcbe 39 Float_t weight = 1, Int_t is = 0);
9e1a0ddb 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,
47c8bcbe 44 AliMCProcess mech, Int_t &ntr, Float_t weight = 1,
45 Int_t is = 0);
9e1a0ddb 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);
f5f55563 67 Int_t GetPrimary(Int_t id);
9e1a0ddb 68 TTree* TreeK() const {return fTreeK;}
69
70 protected:
71 // methods
72 void CleanParents();
73 void ResetArrays(Int_t size);
74 TParticle* GetNextParticle();
e44c5340 75 Bool_t KeepPhysics(TParticle* part);
9e1a0ddb 76
77 private:
78 // data members
79 TClonesArray *fParticles; //! Pointer to list of particles
80 TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray
81 TArrayI fParticleFileMap; // Map for particle ids
82 TParticle *fParticleBuffer; //! Pointer to current particle for writing
83 TTree *fTreeK; //! Particle stack
84 Int_t fNtrack; // Number of tracks
85 Int_t fNprimary; // Number of primaries
86 Int_t fCurrent; //! Last track returned from the stack
87 Int_t fCurrentPrimary; //! Last primary track returned from the stack
88 Int_t fHgwmk; //! Last track purified
89 Int_t fLoadPoint; //! Next free position in the particle buffer
90 TStopwatch fTimer; //! Timer object
ccf7a81f 91 ClassDef(AliStack,2) //Particles stack
9e1a0ddb 92};
93
94// inline
95
96inline void AliStack::SetNtrack(Int_t ntrack)
97{ fNtrack = ntrack; }
98
99inline void AliStack::SetCurrentTrack(Int_t track)
100{ fCurrent = track; }
101
102inline Int_t AliStack::GetNtrack() const
103{ return fNtrack; }
104
105inline Int_t AliStack::GetNprimary() const
106{ return fNprimary; }
107
108inline Int_t AliStack::CurrentTrack() const
109{ return fCurrent; }
110
111inline TObjArray* AliStack::Particles() const
112{ return fParticleMap; }
113
114#endif //ALI_STACK_H