10 #include <TDatabasePDG.h>
11 #include <TParticlePDG.h>
13 #include "FairLogger.h"
14 #include "FairMCEventHeader.h"
15 #include "FairPrimaryGenerator.h"
16 #include "FairRunSim.h"
30 : FairGenerator(
"BeamGenerator",
"CBM generator")
43 : FairGenerator(
"BeamGenerator",
"CBM generator")
44 , fP(momentum * Double_t(beamA))
50 sprintf(name,
"Beam_%d_%d_%d", beamZ, beamA, beamQ);
51 fIon =
new FairIon(name, beamZ, beamA, beamQ);
52 FairRunSim* run = FairRunSim::Instance();
57 FairPrimaryGenerator* primGen = run->GetPrimaryGenerator();
61 evGen->SmearVertexZ(kFALSE);
79 TParticlePDG* ion = TDatabasePDG::Instance()->GetParticle(
fIon->GetName());
86 primGen->AddTrack(ion->PdgCode(), 0., 0.,
fP, 0., 0., 0.);
97 ss << GetName() <<
" ion: " <<
fIon->GetName() <<
" Z " <<
fIon->GetZ()
98 <<
" A " <<
fIon->GetA() <<
" Q " <<
fIon->GetQ() <<
" mass "
99 <<
fIon->GetMass() <<
", momentum " <<
fP
100 <<
" GeV/u, start Z = " <<
fStartZ;