/* $Id$ */
-#include <TArrayI.h>
-#include <TVirtualMCStack.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 TString;
class TTree;
+#include <TArrayI.h>
+#include <TVirtualMCStack.h>
+
+class AliHeader;
+#include "AliConfig.h"
+
class AliStack : public TVirtualMCStack
{
public:
// creators, destructors
- AliStack(Int_t size);
+ AliStack(Int_t size, const char* evfoldname = AliConfig::GetDefaultEventFolderName());
AliStack();
AliStack(const AliStack& st);
virtual ~AliStack();
{st.Copy(*this); return(*this);}
// methods
- virtual void SetTrack(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 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,
- TMCProcess mech, Int_t &ntr, Double_t weight,
- Int_t is);
- virtual TParticle* GetNextTrack(Int_t& track);
- virtual TParticle* GetPrimaryForTracking(Int_t i);
-
- void MakeTree(Int_t event, const char *file);
- void BeginEvent(Int_t event);
+
+ 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();
+ void BeginEvent();
void FinishRun();
- Bool_t GetEvent(Int_t nevent);
+ Bool_t GetEvent();
void PurifyKine();
+ void ReorderKine();
void FinishEvent();
void FlagTrack(Int_t track);
void KeepTrack(Int_t itrack);
// get methods
virtual Int_t GetNtrack() const;
Int_t GetNprimary() const;
- virtual 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);
- TTree* TreeK() const {return fTreeK;}
+ 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);
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(AliStack &st) const;
+ 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
Int_t fHgwmk; //! Last track purified
Int_t fLoadPoint; //! Next free position in the particle buffer
- ClassDef(AliStack,3) //Particles stack
+ TString fEventFolderName; //! Folder name where event is mounted
+ ClassDef(AliStack,4) //Particles stack
};
// inline
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