]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliStack.h
In AliStack: TClonesArray* fParticles replaced by TClonesArray
[u/mrichter/AliRoot.git] / STEER / AliStack.h
index c1d526244b62ee7d4c241524d538c00017f401c3..70d089b90f0dcfb46194c1ea21793ed897bb46b9 100644 (file)
@@ -15,18 +15,19 @@ class TObjArray;
 class TParticle;
 class TString;
 class TTree;
+#include <TClonesArray.h>
 #include <TArrayI.h>
 #include <TVirtualMCStack.h>
 
 class AliHeader;
-#include "AliConfig.h"
 
+enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4, kTransportBit=BIT(14)};
 
 class AliStack : public TVirtualMCStack
 {
   public:
     // creators, destructors
-    AliStack(Int_t size, const char* evfoldname = AliConfig::GetDefaultEventFolderName());
+    AliStack(Int_t size, const char* name = "");
     AliStack();
     AliStack(const AliStack& st);
     virtual ~AliStack();
@@ -51,19 +52,18 @@ class AliStack : public TVirtualMCStack
     virtual TParticle* GetCurrentTrack() const {return fCurrentTrack;}
     virtual TParticle* PopPrimaryForTracking(Int_t i);    
 
-    void  ConnectTree();
-    void  BeginEvent();
-    void  FinishRun();
+    void   ConnectTree(TTree* tree);
     Bool_t GetEvent();
-    void  PurifyKine();
-    void  ReorderKine();
-    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;
+    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);
@@ -74,13 +74,15 @@ class AliStack : public TVirtualMCStack
     Int_t       GetNprimary() 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);
     TTree*      TreeK();
-    void        SetEventFolderName(const char* foldname);
     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();}
+    const TObjArray*  Particles() const;
     
   protected:
     // methods
@@ -88,13 +90,13 @@ class AliStack : public TVirtualMCStack
     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
+    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
@@ -105,9 +107,8 @@ class AliStack : public TVirtualMCStack
     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
-    
-    TString        fEventFolderName;   //! Folder name where event is mounted
-    ClassDef(AliStack,4) //Particles stack
+    TArrayI        fTrackLabelMap;     //! Map of track labels
+    ClassDef(AliStack,5) //Particles stack
 };
 
 // inline
@@ -127,7 +128,7 @@ inline Int_t AliStack::GetNprimary() const
 inline Int_t AliStack::GetCurrentTrackNumber() const 
 { return fCurrent; }
 
-inline TObjArray* AliStack::Particles() const
-{ return fParticleMap; }
+inline const TObjArray* AliStack::Particles() const
+{ return &fParticleMap; }
 
 #endif //ALI_STACK_H