1 #include "ERGenerator.h" 5 #include "TDatabasePDG.h" 7 #include "TLorentzVector.h" 8 #include "TVirtualMC.h" 10 #include "G4IonTable.hh" 11 #include "G4ParticleTable.hh" 13 #include "FairRunSim.h" 22 Int_t ERGenerator::fgNIon = 0;
32 fRnd =
new TRandom3();
36 Double_t px, Double_t py, Double_t pz,
37 Double_t vx, Double_t vy, Double_t vz):
38 fPx(Double_t(a)*px), fPy(Double_t(a)*py), fPz(Double_t(a)*pz),
39 fVx(vx), fVy(vy), fVz(vz),
fPrimaryIon(NULL), fSecondIon(NULL), fThirdIon(NULL)
41 fPrimaryIon=
new FairIon(
"ExpertPrimaryIon", z, a, q);
42 FairRunSim* run = FairRunSim::Instance();
44 cout <<
"-E- ERGenerator: No FairRun instantised!" << endl;
45 Fatal(
"ERGenerator",
"No FairRun instantised!");
57 TParticlePDG* thisPart =
58 TDatabasePDG::Instance()->GetParticle(
fPrimaryIon->GetName());
60 cout <<
"-W- FairIonGenerator: Ion " <<
fPrimaryIon->GetName()
61 <<
" not found in database!" << endl;
65 int primaryIonPDG = thisPart->PdgCode();
67 cout <<
"-I- ERGenerator: Generating ion of type " 68 <<
fPrimaryIon->GetName() <<
" (PDG code " << primaryIonPDG <<
")" << endl;
69 cout <<
" Momentum (" << fPx <<
", " << fPy <<
", " << fPz
70 <<
") Gev from vertex (" << fVx <<
", " << fVy
71 <<
", " << fVz <<
") cm" << endl;
73 primGen->AddTrack(primaryIonPDG, fPx, fPy, fPz, fVx, fVy, fVz);
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
FairIon * fPrimaryIon
Number of the instance of this class.