1 #include "StarParticleStack.h"
7 #define agsvert F77_NAME(agsvert,AGSVERT)
8 #define agskine F77_NAME(agskine,AGSKINE)
10 #include "TMCProcess.h"
15 void type_of_call agsvert( Float_t *
vertex, Int_t *ntbeam, Int_t *nttarg, Float_t *ubuf, Int_t *nu, Int_t *nv );
16 void type_of_call agskine( Float_t *plab, Int_t *iparti, Int_t *nv, Float_t *ubuf, Int_t *nb, Int_t *nt );
19 const Int_t kDefaultStackSize = 400;
20 const Int_t kDefaultArraySize = 4000;
25 StarParticleStack::StarParticleStack(
const Char_t *name ) :
34 mArray =
new TClonesArray(
"TParticle", kDefaultArraySize );
40 StarParticleStack::~StarParticleStack()
42 if ( mArray )
delete mArray;
48 Double_t px, Double_t py, Double_t pz, Double_t energy,
49 Double_t vx, Double_t vy, Double_t vz, Double_t vt,
50 Double_t polx, Double_t poly, Double_t polz,
51 TMCProcess mech, Int_t& ntr, Double_t weight,
60 TClonesArray &array = (*mArray);
61 TParticle *particle =
new(array[mArraySize]) TParticle( pdg, is, parent, -1, -1, -1,
62 px, py, pz, energy, vx, vy, vz, vt);
63 particle->SetPolarisation( polx, poly, polz );
64 particle->SetWeight(weight);
65 particle->SetUniqueID(mech);
78 mStack.push_back( particle );
79 mStackIdx.push_back( mArraySize );
104 TParticle *particle = mStack.front(); mStack.pop_front();
105 itrack = mStackIdx.front(); mStackIdx.pop_front();
116 assert(i<mArraySize);
117 return (TParticle *)(*mArray)[i];
131 return mArray->GetEntriesFast();
153 return (current)? current->GetFirstMother() : -1;
160 return (TParticle *)(*mArray)[idx];
static TParticlePDG * pdg(Int_t pdgid)
virtual void SetCurrentTrack(Int_t trackNumber)
Set the current track number.
virtual void PushTrack(Int_t toBeDone, 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 Int_t GetCurrentTrackNumber() const
Current track number.
virtual TParticle * GetParticle(const Int_t i) const
Retrieve the ith particle in the array.
virtual Int_t GetCurrentParentTrackNumber() const
Number of the parent of the current track.
virtual TParticle * GetCurrentTrack() const
Current track particle.
Implementation of the VMC particle stack for use in STAR.
virtual TParticle * PopPrimaryForTracking(Int_t i)
virtual Int_t GetNtrack() const
Total number of tracks.
virtual TParticle * PopNextTrack(Int_t &itrack)
virtual void Clear(const Option_t *opts="")
Clear the stack.