20 #include <TDatabasePDG.h>
21 #include <TObjArray.h>
22 #include <TParticle.h>
23 #include <TParticlePDG.h>
26 Int_t FairIonGenerator::fgNIon = 0;
60 fIon =
static_cast<FairIon*
>(UserIons->FindObject(ionName));
63 fPx = Double_t(fIon->
GetA()) * px;
64 fPy = Double_t(fIon->
GetA()) * py;
65 fPz = Double_t(fIon->
GetA()) * pz;
67 part =
static_cast<FairParticle*
>(UserParticles->FindObject(ionName));
71 fPx = Double_t(particle->GetMass() / 0.92827231) * px;
72 fPy = Double_t(particle->GetMass() / 0.92827231) * py;
73 fPz = Double_t(particle->GetMass() / 0.92827231) * pz;
76 if (fIon == 0 && part == 0) {
77 LOG(fatal) <<
"Ion or Particle is not defined !";
92 , fPx(Double_t(a) * px)
93 , fPy(Double_t(a) * py)
94 , fPz(Double_t(a) * pz)
111 sprintf(buffer,
"FairIon%d", fgNIon);
112 fIon =
new FairIon(buffer, z, a, q);
115 LOG(error) <<
"No FairRun instantised!";
133 LOG(error) <<
"No FairRun instantised!";
155 TParticlePDG* thisPart = TDatabasePDG::Instance()->GetParticle(fIon->GetName());
157 LOG(warn) <<
"FairIonGenerator: Ion " << fIon->GetName() <<
" not found in database!";
161 int pdgType = thisPart->PdgCode();
164 LOG(debug) <<
"FairIonGenerator: Generating ion " << fIon->GetName()
165 << Form(
" p=(%.2f, %.2f, %.2f) GeV,", fPx, fPy, fPz);
TParticle * GetParticle() const
void SetMultiplicity(Int_t mult)
void SetMass(Double_t mass)
virtual ~FairIonGenerator()
static FairRunSim * Instance()
ClassImp(FairEventBuilder)
void SetExcitationEnergy(Double_t eExc)
TObjArray * GetUserDefIons()
void SetMass(Double_t mass)
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)
void SetExcEnergy(Double_t eExc)
virtual void AddTrack(Int_t pdgid, Double_t px, Double_t py, Double_t pz, Double_t vx, Double_t vy, Double_t vz, Int_t parent=-1, Bool_t wanttracking=true, Double_t e=-9e9, Double_t tof=0., Double_t weight=0., TMCProcess proc=kPPrimary)
virtual void GenerateEventParameters()
void SetVertex(Double_t vx, Double_t vy, Double_t vz, Double_t evx=0, Double_t evy=0, Double_t evz=0, eVertexSmear sm=kBox)
void AddNewIon(FairIon *ion)
Int_t GetMultiplicity() const
TObjArray * GetUserDefParticles()
virtual FairGenerator * CloneGenerator() const