10 #include "StG3Particle.h"
11 #include "StGimParticle.h"
14 GFKINE_t StG3ParticleMaster::mgFK=0;
15 GFVERT_t StG3ParticleMaster::mgFV=0;
17 static std::vector<StGimParticle*> myVec;
20 StG3ParticleMaster::StG3ParticleMaster(GFKINE_t fk,GFVERT_t fv)
22 assert(!mgInst &&
"Never,Jamais");
28 StG3ParticleMaster::~StG3ParticleMaster()
31 for (
int i=0;i<(int)myVec.size();i++) {
delete myVec[i]; }
37 assert(mgInst &&
"Never,Jamais");
41 void StG3ParticleMaster::Update()
45 const double kC =2.99792458000000000e+10;
47 int ITRA,IPART,NVERT,NWBUF,UBUF[100];
48 float VERT[4],PVERT[5];
49 int NVTX,NTBEAM,NTTARG;
52 int size0 = myVec.size();
54 for (ITRA = 1; 2009; ITRA++)
56 (mgFK)(ITRA,VERT,PVERT,IPART,NVERT,UBUF,NWBUF);
60 TOFG = 0;NTBEAM=0,NTTARG=0;
62 (mgFV)(NVTX,V,NTBEAM,NTTARG,TOFG,UBUF,NWBUF);
64 if (ITRA > size0) {myVec.push_back(
new StGimParticle(ITRA-1));}
65 else {myVec[ITRA-1]->Clear() ;}
69 PVERT[4] = Gea2Mas(IPART);
71 tk->SetPdg(Gea2Pdg(IPART));
76 assert(NTBEAM<ITRA &&
"Never,Jamais");
77 tk->SetMother(0,myVec[NTBEAM-1]);
78 myVec[NTBEAM-1]->AddDaughter(tk);
80 if (NTTARG>0 && NTTARG<ITRA) tk->SetMother(1,myVec[NTTARG-1]);
85 const StGenParticle *StG3ParticleMaster::operator()(
int idx)
const
87 assert(idx>=0 &&
"Never,Jamais");
88 if (idx >= mNTk)
return 0;
89 if (!myVec[idx]->GetStatusCode())
return 0;
Master class for StGimParticle filled from GEANT3 internal structures.
Abstract base class for particles related to common /HEPEVT/.
Implementation of StGenParticle similar to ROOT TParticle.