]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliStack.h
Added methods for finding a given module in the DDL map (F. Prino)
[u/mrichter/AliRoot.git] / STEER / AliStack.h
index 4bb4b1aec945908ab6acc7f1720952f7cca256f0..b5cb4754c4133b35500f0393a27ae660a2c0011f 100644 (file)
@@ -5,24 +5,28 @@
 
 /* $Id$ */
 
-#include <TArrayI.h>
-#include <TVirtualMCStack.h>
-
-#include "AliConfig.h"
+//  Particles stack class
+//  Implements the TMCVirtualStack of the Virtual Monte Carlo
+//  Author A.Morsch
 
-class AliHeader;
 class TClonesArray;
 class TFile;
 class TObjArray;
 class TParticle;
-class TTree;
 class TString;
+class TTree;
+#include <TArrayI.h>
+#include <TVirtualMCStack.h>
+
+class AliHeader;
+
+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::fgkDefaultEventFolderName);
+    AliStack(Int_t size, const char* name = "");
     AliStack();
     AliStack(const AliStack& st);
     virtual ~AliStack();
@@ -47,18 +51,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  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);
@@ -73,17 +77,19 @@ class AliStack : public TVirtualMCStack
     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();}
+           
   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;
 
@@ -100,9 +106,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