]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/STEERBase/AliStack.h
Ignore streamer of raw header v3_14.
[u/mrichter/AliRoot.git] / STEER / STEERBase / 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
af7ba10c 8// Particles stack class
9// Implements the TMCVirtualStack of the Virtual Monte Carlo
10// Author A.Morsch
88cb7938 11
e2afb3b6 12class TClonesArray;
9e1a0ddb 13class TFile;
e2afb3b6 14class TObjArray;
15class TParticle;
88cb7938 16class TString;
af7ba10c 17class TTree;
d94af0c1 18#include <TClonesArray.h>
af7ba10c 19#include <TArrayI.h>
20#include <TVirtualMCStack.h>
21
22class AliHeader;
af7ba10c 23
f4414561 24enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4, kTransportBit=BIT(14)};
9e1a0ddb 25
b9d0a01d 26class AliStack : public TVirtualMCStack
9e1a0ddb 27{
28 public:
29 // creators, destructors
942a9039 30 AliStack(Int_t size, const char* name = "");
9e1a0ddb 31 AliStack();
e2afb3b6 32 AliStack(const AliStack& st);
9e1a0ddb 33 virtual ~AliStack();
e2afb3b6 34 AliStack& operator=(const AliStack& st)
35 {st.Copy(*this); return(*this);}
9e1a0ddb 36
37 // methods
88cb7938 38
642f15cf 39 virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
3e2e3ece 40 const Float_t *pmom, const Float_t *vpos, const Float_t *polar,
88cb7938 41 Float_t tof, TMCProcess mech, Int_t &ntr,
42 Float_t weight, Int_t is);
43
642f15cf 44 virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
88cb7938 45 Double_t px, Double_t py, Double_t pz, Double_t e,
46 Double_t vx, Double_t vy, Double_t vz, Double_t tof,
47 Double_t polx, Double_t poly, Double_t polz,
48 TMCProcess mech, Int_t &ntr, Double_t weight,
49 Int_t is);
50
642f15cf 51 virtual TParticle* PopNextTrack(Int_t& track);
52 virtual TParticle* GetCurrentTrack() const {return fCurrentTrack;}
53 virtual TParticle* PopPrimaryForTracking(Int_t i);
b9d0a01d 54
942a9039 55 void ConnectTree(TTree* tree);
88cb7938 56 Bool_t GetEvent();
77db8cbf 57 Bool_t PurifyKine();
58 Bool_t ReorderKine();
942a9039 59 void FinishEvent();
60 void FlagTrack(Int_t track);
61 void KeepTrack(Int_t itrack);
ae96e41f 62 void Clean(Int_t size = 0);
942a9039 63 void Reset(Int_t size = 0);
64 void DumpPart(Int_t i) const;
65 void DumpPStack ();
66 void DumpLoadedStack () const;
9e1a0ddb 67
68 // set methods
69 void SetNtrack(Int_t ntrack);
b9d0a01d 70 virtual void SetCurrentTrack(Int_t track);
9e1a0ddb 71 void SetHighWaterMark(Int_t hgwmk);
72 // get methods
b9d0a01d 73 virtual Int_t GetNtrack() const;
9e1a0ddb 74 Int_t GetNprimary() const;
642f15cf 75 virtual Int_t GetCurrentTrackNumber() const;
76 virtual Int_t GetCurrentParentTrackNumber() const;
9e1a0ddb 77 TParticle* Particle(Int_t id);
f5f55563 78 Int_t GetPrimary(Int_t id);
3e2e3ece 79 TTree* TreeK() const {return fTreeK;}
e94530da 80 TParticle* ParticleFromTreeK(Int_t id) const;
81 Int_t TreeKEntry(Int_t id) const;
1fed0e8b 82 Bool_t IsPhysicalPrimary(Int_t i);
1935773d 83 Bool_t IsSecondaryFromWeakDecay(Int_t index);
84 Bool_t IsSecondaryFromMaterial (Int_t index);
3e2e3ece 85 Int_t TrackLabel(Int_t label) const {return fTrackLabelMap[label];}
942a9039 86 Int_t* TrackLabelMap() {return fTrackLabelMap.GetArray();}
d94af0c1 87 const TObjArray* Particles() const;
88
9e1a0ddb 89 protected:
90 // methods
91 void CleanParents();
92 void ResetArrays(Int_t size);
d58b4b69 93 TParticle* GetParticleMapEntry(Int_t id) const;
9e1a0ddb 94 TParticle* GetNextParticle();
3e2e3ece 95 Bool_t KeepPhysics(const TParticle* part);
1fed0e8b 96 Bool_t IsStable(Int_t pdg) const;
9e1a0ddb 97 private:
6c4904c2 98 void Copy(TObject &st) const;
e2afb3b6 99
9e1a0ddb 100 // data members
d94af0c1 101 TClonesArray fParticles; //! Pointer to list of particles
102 TObjArray fParticleMap; //! Map of particles in the supporting TClonesArray
9e1a0ddb 103 TArrayI fParticleFileMap; // Map for particle ids
104 TParticle *fParticleBuffer; //! Pointer to current particle for writing
fe046ade 105 TParticle *fCurrentTrack; //! Pointer to particle currently transported
9e1a0ddb 106 TTree *fTreeK; //! Particle stack
107 Int_t fNtrack; // Number of tracks
108 Int_t fNprimary; // Number of primaries
109 Int_t fCurrent; //! Last track returned from the stack
110 Int_t fCurrentPrimary; //! Last primary track returned from the stack
111 Int_t fHgwmk; //! Last track purified
112 Int_t fLoadPoint; //! Next free position in the particle buffer
942a9039 113 TArrayI fTrackLabelMap; //! Map of track labels
114 ClassDef(AliStack,5) //Particles stack
9e1a0ddb 115};
116
117// inline
118
119inline void AliStack::SetNtrack(Int_t ntrack)
120{ fNtrack = ntrack; }
121
9e1a0ddb 122inline Int_t AliStack::GetNtrack() const
123{ return fNtrack; }
124
125inline Int_t AliStack::GetNprimary() const
126{ return fNprimary; }
127
642f15cf 128inline Int_t AliStack::GetCurrentTrackNumber() const
9e1a0ddb 129{ return fCurrent; }
130
d94af0c1 131inline const TObjArray* AliStack::Particles() const
132{ return &fParticleMap; }
9e1a0ddb 133
d58b4b69 134// inline protected
135
136inline TParticle* AliStack::GetParticleMapEntry(Int_t id) const
137{ return (TParticle*) fParticleMap.At(id); }
138
9e1a0ddb 139#endif //ALI_STACK_H