1 #include "AgStarReader.h"
4 #include "StarCallf77.h"
5 #include "TDatabasePDG.h"
6 #include "TParticlePDG.h"
8 #include "TLorentzVector.h"
15 #include "StarGenerator/UTIL/StarParticleData.h"
16 #include "StarGenerator/BASE/StarParticleStack.h"
25 #define ageventread F77_NAME(ageventread,AGEVENTREAD)
26 #define agsvert F77_NAME(agsvert, AGSVERT)
27 #define agskine F77_NAME(agskine, AGSKINE)
28 #define gskine F77_NAME(gskine, GSKINE)
29 #define gsvert F77_NAME(gsvert, GSVERT)
32 #define gcomad F77_NAME(gcomad,GCOMAD)
36 void type_of_call agsvert(
float *
vertex,
int *nb,
int *nt,
float *ubuf,
int *nu,
int *nv );
37 void type_of_call agskine(
float *plab,
int *ip,
int *nv,
float *ubuf,
int *nb,
int *nt );
38 void type_of_call gsvert(
float *,
int &,
int &,
float *,
int &,
int &);
39 void type_of_call gskine(
float *,
int &,
int &,
float *,
int &,
int &);
40 void type_of_call gcomad(DEFCHARD,
int*& DEFCHARL);
89 AgStarReader::AgStarReader() : TObject(), mStack(0), mParticleData(&
StarParticleData::instance())
100 gcomad(PASSCHARD(
"GCTRAK"),(
int*&) fGctrak PASSCHARL(
"GCTRAK"));
119 map<int, int> start_vtx;
129 if ( part->GetStatusCode() != 1 )
continue;
132 int parent = part->GetFirstMother();
133 int myvtx = start_vtx[parent];
136 start_vtx[parent]=++idvtx;
149 gsvert(v, nt, nb, ubuf, nwbuf, myvtx);
150 assert(myvtx==idvtx);
155 fGctrak->tofg = part->T();
166 int ipdg = part->GetPdgCode();
169 TParticlePDG *pdg = mParticleData->
GetParticle( ipdg ); assert(pdg);
170 g3id = pdg->TrackingCode();
173 Warning(GetName(),Form(
"Particle %s with PDG id=%i has no G3 code. Skipped.",pdg->GetName(),ipdg));
180 gskine( plab, g3id, myvtx, ubuf, nwbuf, nt );
189 void AgStarReader::SetVert(
float *
vertex,
int ntbeam,
int nttarg,
float *ubuf,
int nu,
int &nv )
191 agsvert( vertex, &ntbeam, &nttarg, ubuf, &nu, &nv );
196 void AgStarReader::SetKine(
float *plab,
int idpart,
int nv,
float *ubuf,
int nb,
int &nt )
198 agskine( plab, &idpart, &nv, ubuf, &nb, &nt );
void ReadEvent()
Read events from the particle stack and push them out to starsim.
TParticlePDG * GetParticle(const Char_t *name)
Get a particle by name.
static AgStarReader & Instance()
Return the single instance of this class.
Interface to PDG information.
Pushes particles out from the StarParticleStack to geant3.
virtual TParticle * PopNextTrack(Int_t &itrack)