Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

PisaVMCStackv1.h

Go to the documentation of this file.
00001 #ifndef __PISAVMCSTACKV1_H__
00002 #define __PISAVMCSTACKV1_H__
00003 
00004 #include "TVirtualMCStack.h"
00005 #include <stack>
00006 
00007 class TParticle;
00008 class TClonesArray;
00009 
00013 class PisaVMCStackv1 : public TVirtualMCStack
00014 {
00015  public:
00016   PisaVMCStackv1();
00017   PisaVMCStackv1(size_t thesize);
00018   virtual ~PisaVMCStackv1();
00019   //
00020   // Methods for stacking
00021   //
00022 
00023   // Create a new particle and push into stack;
00024   // Arguments:
00025   // toBeDone   - 1 if particles should go to tracking, 0 otherwise
00026   // parent     - number of the parent track, -1 if track is primary
00027   // pdg        - PDG encoding
00028   // px, py, pz - particle momentum [GeV/c]
00029   // e          - total energy [GeV]
00030   // vx, vy, vx - position [cm]
00031   // tof        - time of flight [s]
00032   // polx, poly, polz - polarization
00033   // mech       - creator process VMC code
00034   // ntr        - track number (is filled by the stack
00035   // weight     - particle weight
00036   // is         - generation status code
00037   //
00038   void PushTrack(Int_t toBeDone, Int_t parent, Int_t pdg,
00039                  Double_t px, Double_t py, Double_t pz, Double_t e,
00040                  Double_t vx, Double_t vy, Double_t vz, Double_t tof,
00041                  Double_t polx, Double_t poly, Double_t polz,
00042                  TMCProcess mech, Int_t& ntr, Double_t weight,
00043                  Int_t is);
00044 
00045   // The stack has to provide two pop mechanisms:
00046   // PopNextTrack() - pops all particles with toBeDone = 1,
00047   //                  both primaries and seconadies
00048   // PopPrimaryForTracking() - pops only primary particles with toBeDone = 1,
00049   //                  stacking of secondaries is done by MC
00050   //
00051   TParticle* PopNextTrack(Int_t& itrack);
00052   TParticle* PopPrimaryForTracking(Int_t i);
00053 
00054   //
00055   // Set methods
00056   //
00057 
00058   // Set current track number
00059   void SetCurrentTrack(Int_t trackNumber);
00060 
00061   //
00062   // Get methods
00063   //
00064 
00065   // Total number of tracks
00066   Int_t GetNtrack() const;
00067 
00068   // Total number of primary tracks
00069   Int_t GetNprimary() const;
00070 
00071   // Current track particle
00072   TParticle* GetCurrentTrack() const;
00073 
00074   // Current track number
00075   Int_t GetCurrentTrackNumber() const;
00076 
00077   // Number of the parent of the current track
00078   Int_t GetCurrentParentTrackNumber() const;
00079 
00080   void Reset();
00081 
00082   void Print(Option_t*) const;
00083 
00084  private:
00085   TParticle* GetParticle(Int_t id) const;
00086 
00087  private:
00088 
00089   std::stack<TParticle*> fStack;
00090   TClonesArray* fParticles;
00091   Int_t fCurrentTrack;
00092   Int_t fNPrimary;
00093 
00094   ClassDef(PisaVMCStackv1,1)
00095 };
00096 
00097 #endif