7 #include "FairMCEventHeader.h"
8 #include "FairPrimaryGenerator.h"
11 #include "FairRunSim.h"
13 #include "TDatabasePDG.h"
14 #include "TParticlePDG.h"
39 , fPDG(TDatabasePDG::Instance())
42 cout <<
"-I- CbmShieldGenerator: Opening input file " << fileName << endl;
45 Fatal(
"CbmShieldGenerator",
"Cannot open input file.");
46 cout <<
"-I- CbmShieldGenerator: Looking for ions..." << endl;
48 cout <<
"-I- CbmShieldGenerator: " << nIons <<
" ions registered." << endl;
50 cout <<
"-I- CbmShieldGenerator: Reopening input file " << fileName << endl;
66 cout <<
"-E- CbmShieldGenerator: Input file not open!" << endl;
97 cout <<
"-I- CbmShieldGenerator: End of input file reached " << endl;
103 cout <<
"-I- CbmShieldGenerator: Event " << eventId <<
", pBeam = " << pBeam
104 <<
"GeV, b = " << bx <<
" " << by <<
" fm, multiplicity " << nTracks
111 FairMCEventHeader*
event = primGen->GetEvent();
112 if (event && (!event->IsSet())) {
113 event->SetEventID(eventId);
114 event->SetB(bb.Mod());
115 event->SetRotZ(bb.Phi());
116 event->MarkSet(kTRUE);
121 for (Int_t itrack = 0; itrack < nTracks; itrack++) {
125 *
fInputFile >> pdgType >> iMass >> iCharge >> px >> py >> pz
147 primGen->AddTrack(pdgType, px, py, pz, 0., 0., 0.);
149 primGen->AddTrack(pdgType, px, py, pz, 0., 0., 0.);
150 if (
fpartType == 3 && pdgType >= 1000000000)
151 primGen->AddTrack(pdgType, px, py, pz, 0., 0., 0.);
153 if (
fpartType == -1) primGen->AddTrack(pdgType, px, py, pz, 0., 0., 0.);
166 cout <<
"-I- CbmShieldGenerator: Closing input file " <<
fFileName
180 cout <<
" CbmShieldGenerator::RegisterIons() start " << endl;
184 Int_t eventId, nTracks, iMass, iCharge;
185 Double_t bx, by, px, py, pz;
197 for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
199 *
fInputFile >> pdgType >> iMass >> iCharge >> px >> py >> pz
202 if (pdgType > 1000000000)
205 sprintf(
buffer,
"Ion_%d_%d", iMass, iCharge);
208 FairIon* ion =
new FairIon(ionName, iCharge, iMass, iCharge);
217 FairRunSim* run = FairRunSim::Instance();
218 map<TString, FairIon*>::iterator mapIt;
220 FairIon* ion = (*mapIt).second;