X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliStack.h;h=b5cb4754c4133b35500f0393a27ae660a2c0011f;hb=a7a1e1c78ae322eab47470ea787794dd56f7d83c;hp=155736482db9c6595c0dece945752066a7bed379;hpb=27f087a91c859c9f7f847e2e98fe0ccb721719d2;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliStack.h b/STEER/AliStack.h index 155736482db..b5cb4754c41 100644 --- a/STEER/AliStack.h +++ b/STEER/AliStack.h @@ -5,79 +5,100 @@ /* $Id$ */ -#include -#include -#include - -#include "AliMCProcess.h" +// Particles stack class +// Implements the TMCVirtualStack of the Virtual Monte Carlo +// Author A.Morsch -class TObjArray; class TClonesArray; -class TParticle; -class AliHeader; class TFile; +class TObjArray; +class TParticle; +class TString; class TTree; +#include +#include +class AliHeader; +enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4, kTransportBit=BIT(14)}; -class AliStack : public TObject +class AliStack : public TVirtualMCStack { public: // creators, destructors - AliStack(Int_t size); + AliStack(Int_t size, const char* name = ""); AliStack(); + AliStack(const AliStack& st); virtual ~AliStack(); + AliStack& operator=(const AliStack& st) + {st.Copy(*this); return(*this);} // methods - void MakeTree(Int_t event, const char *file); - void BeginEvent(Int_t event); - void FinishRun(); - Bool_t GetEvent(Int_t nevent, Int_t dummy=0); - void SetTrack(Int_t done, Int_t parent, Int_t pdg, - Float_t *pmom, Float_t *vpos, Float_t *polar, - Float_t tof, AliMCProcess mech, Int_t &ntr, - Float_t weight=1); - void SetTrack(Int_t done, Int_t parent, Int_t pdg, - Double_t px, Double_t py, Double_t pz, Double_t e, - Double_t vx, Double_t vy, Double_t vz, Double_t tof, - Double_t polx, Double_t poly, Double_t polz, - AliMCProcess mech, Int_t &ntr, Float_t weight=1); - void GetNextTrack(Int_t &mtrack, Int_t &ipart, Float_t *pmom, - Float_t &e, Float_t *vpos, Float_t *polar, Float_t &tof); - void PurifyKine(); - void FinishEvent(); - void FlagTrack(Int_t track); - void KeepTrack(Int_t itrack); - void Reset(Int_t size = 0); - void DumpPart(Int_t i) const; - void DumpPStack (); - void DumpLoadedStack () const; + + virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg, + Float_t *pmom, Float_t *vpos, Float_t *polar, + Float_t tof, TMCProcess mech, Int_t &ntr, + Float_t weight, Int_t is); + + virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg, + Double_t px, Double_t py, Double_t pz, Double_t e, + Double_t vx, Double_t vy, Double_t vz, Double_t tof, + Double_t polx, Double_t poly, Double_t polz, + TMCProcess mech, Int_t &ntr, Double_t weight, + Int_t is); + + virtual TParticle* PopNextTrack(Int_t& track); + virtual TParticle* GetCurrentTrack() const {return fCurrentTrack;} + virtual TParticle* PopPrimaryForTracking(Int_t i); + + void ConnectTree(TTree* tree); + Bool_t GetEvent(); + Bool_t PurifyKine(); + Bool_t ReorderKine(); + void FinishEvent(); + void FlagTrack(Int_t track); + void KeepTrack(Int_t itrack); + void Clean(Int_t size = 0); + void Reset(Int_t size = 0); + void DumpPart(Int_t i) const; + void DumpPStack (); + void DumpLoadedStack () const; // set methods void SetNtrack(Int_t ntrack); - void SetCurrentTrack(Int_t track); + virtual void SetCurrentTrack(Int_t track); void SetHighWaterMark(Int_t hgwmk); // get methods - Int_t GetNtrack() const; + virtual Int_t GetNtrack() const; Int_t GetNprimary() const; - Int_t CurrentTrack() const; + virtual Int_t GetCurrentTrackNumber() const; + virtual Int_t GetCurrentParentTrackNumber() const; TObjArray* Particles() const; TParticle* Particle(Int_t id); - Int_t GetPrimary(Int_t id) const; - TTree* TreeK() const {return fTreeK;} - + Int_t GetPrimary(Int_t id); + TTree* TreeK(); + TParticle* ParticleFromTreeK(Int_t id) const; + Int_t TreeKEntry(Int_t id) const; + Bool_t IsPhysicalPrimary(Int_t i); + Int_t TrackLabel(Int_t label) {return fTrackLabelMap[label];} + Int_t* TrackLabelMap() {return fTrackLabelMap.GetArray();} + protected: // methods void CleanParents(); void ResetArrays(Int_t size); TParticle* GetNextParticle(); - + Bool_t KeepPhysics(TParticle* part); + Bool_t IsStable(Int_t pdg) const; private: + void Copy(TObject &st) const; + // data members TClonesArray *fParticles; //! Pointer to list of particles TObjArray *fParticleMap; //! Map of particles in the supporting TClonesArray TArrayI fParticleFileMap; // Map for particle ids TParticle *fParticleBuffer; //! Pointer to current particle for writing + TParticle *fCurrentTrack; //! Pointer to particle currently transported TTree *fTreeK; //! Particle stack Int_t fNtrack; // Number of tracks Int_t fNprimary; // Number of primaries @@ -85,8 +106,8 @@ class AliStack : public TObject Int_t fCurrentPrimary; //! Last primary track returned from the stack Int_t fHgwmk; //! Last track purified Int_t fLoadPoint; //! Next free position in the particle buffer - TStopwatch fTimer; //! Timer object - ClassDef(AliStack,2) //Particles stack + TArrayI fTrackLabelMap; //! Map of track labels + ClassDef(AliStack,5) //Particles stack }; // inline @@ -103,7 +124,7 @@ inline Int_t AliStack::GetNtrack() const inline Int_t AliStack::GetNprimary() const { return fNprimary; } -inline Int_t AliStack::CurrentTrack() const +inline Int_t AliStack::GetCurrentTrackNumber() const { return fCurrent; } inline TObjArray* AliStack::Particles() const