137 cout <<
"-E CbmPhsdGenerator: phsd.dat input file is not open! " << endl;
145 if (fscanf(
fDatFile,
"%d %*d %*d %lf%*[^\n]%*c", &nTracks, &b) == EOF) {
146 cout <<
"-E- CbmPhsdGenerator::ReadEvent: "
147 <<
"No more events!" << endl;
153 cout <<
"Event: " <<
nextEvent <<
" nTracks: " << nTracks <<
"\n";
159 FairMCEventHeader*
event = primGen->GetEvent();
160 if (event && (!event->IsSet())) {
163 event->MarkSet(kTRUE);
166 for (
int i = 0; i < nTracks; ++i) {
168 double tmppz, tmppx, tmppy, tmpp0;
169 fscanf(
fDatFile,
"%d%d%lf%lf%lf%lf%*[^\n]%*c", &ttype, &tchr, &tmppx, &tmppy, &tmppz, &tmpp0);
178 Double_t gammaCM = TMath::Sqrt(1. / (1. - betaCM * betaCM));
182 Double_t px = Double_t(tmppx);
183 Double_t py = Double_t(tmppy);
184 Double_t pz = Double_t(tmppz);
185 Double_t e = Double_t(tmpp0);
186 Double_t mass =
sqrt(e * e - px * px - py * py - pz * pz);
187 pz = gammaCM * (pz + betaCM * e);
188 Double_t ee =
sqrt(mass * mass + px * px + py * py + pz * pz);
190 TVector3 aa(px, py, pz);
198 primGen->AddTrack(pdgID, px, py, pz, 0., 0., 0.);
201 cout <<
"-I CbmPhsdGenerator: Event " <<
nextEvent <<
", b = " << b <<
" fm, multiplicity " << nTracks
202 <<
", ekin: " <<
ekin << endl;
217 cout <<
"-E CbmPhsdGenerator: Baryons input file is not open! " << endl;
222 cout <<
"-E CbmPhsdGenerator: Mesons input file is not open! " << endl;
228 cout <<
"-E- CbmPhsdGenerator::ReadEvent: "
229 <<
"No PrimaryGenerator!" << endl;
234 cout <<
"-E- CbmPhsdGenerator::ReadEvent: "
235 <<
"No more events!" << endl;
262 int nTracks = 0, pid = 0;
266 FairMCEventHeader*
event = primGen->GetEvent();
267 if (event && (!event->IsSet())) {
270 event->MarkSet(kTRUE);
286 << pid <<
")" << endl;
302 Double_t gammaCM = TMath::Sqrt(1. / (1. - betaCM * betaCM));
310 Double_t mass =
sqrt(e * e - px * px - py * py - pz * pz);
311 pz = gammaCM * (pz + betaCM * e);
312 Double_t ee =
sqrt(mass * mass + px * px + py * py + pz * pz);
314 TVector3 aa(px, py, pz);
322 primGen->AddTrack(pdgID, px, py, pz, 0., 0., 0.);
348 << pid <<
")" << endl;
360 Double_t gammaCM = TMath::Sqrt(1. / (1. - betaCM * betaCM));
368 Double_t mass =
sqrt(e * e - px * px - py * py - pz * pz);
369 pz = gammaCM * (pz + betaCM * e);
370 Double_t ee =
sqrt(mass * mass + px * px + py * py + pz * pz);
372 TVector3 aa(px, py, pz);
380 primGen->AddTrack(pdgID, px, py, pz, 0., 0., 0.);
395 cout <<
"-I CbmPhsdGenerator: Event " <<
nextEvent <<
", b = " << b <<
" fm, multiplicity " << nTracks
396 <<
", ekin: " <<
ekin << endl;
476 TString work = getenv(
"VMCWORKDIR");
477 TString fileName = work +
"/input/hsd_pdg.dat";
478 std::ifstream* pdgconv =
new std::ifstream(fileName.Data());
480 if (!(*pdgconv).is_open()) {
481 Fatal(
"CbmPhsdGenerator",
"Particle table for conversion was not found!");
490 while (!pdgconv->eof()) {
492 *pdgconv >> index >> pdgId;
493 std::getline(*pdgconv, tmpStr);
500 cout <<
"-I CbmPhsdGenerator: Particle table for conversion from "
501 <<
"HSD loaded" << endl;
509 std::ifstream* inputf =
new std::ifstream(fileNameInput);
515 string val, name, tname, tmpStr;
517 while (!inputf->eof()) {
520 *inputf >> val >> name;
521 tname = name.substr(0, 6);
523 if (tname ==
"MASSTA")
At = atoi(val.substr(0, val.size() - 1).c_str());
524 else if (tname ==
"MSTAPR")
525 Zt = atoi(val.substr(0, val.size() - 1).c_str());
526 else if (tname ==
"MASSPR")
527 Ap = atoi(val.substr(0, val.size() - 1).c_str());
528 else if (tname ==
"MSPRPR")
529 Zp = atoi(val.substr(0, val.size() - 1).c_str());
530 tname = name.substr(0, 4);
531 if (tname ==
"ELAB")
ekin = atof(val.substr(0, val.size() - 1).c_str());
532 tname = name.substr(0, 5);
533 if (tname ==
"ISUBS")
ISUBS = atof(val.substr(0, val.size() - 1).c_str());
534 tname = name.substr(0, 3);
535 if (tname ==
"NUM")
IRUNS = atof(val.substr(0, val.size() - 1).c_str());
536 std::getline(*inputf, tmpStr);
542 cout <<
"-I CbmPhsdGenerator: Collision data from "
543 <<
"HSD loaded" << endl;