116 if (!light_particles_filename) {
117 dd = getenv(
"VMCWORKDIR");
118 if (gSystem->OpenDirectory(dd +
"/parameters"))
121 if (gSystem->OpenDirectory(dd +
"/generators"))
124 dd = gSystem->WorkingDirectory();
127 fname = dd +
"/MpdLAQGSM_light_particles.dat";
129 fname = light_particles_filename;
136 FILE* fInputFile_light = fopen(fname.Data(),
"r");
138 while (!(feof(fInputFile_light))) {
139 la_tab_t* lt =
new la_tab_t;
150 fscanf(fInputFile_light,
"%d", &i_val);
152 fscanf(fInputFile_light,
"%d", &i_val);
154 fscanf(fInputFile_light,
"%d", &i_val);
156 fscanf(fInputFile_light,
"%d", &i_val);
158 fscanf(fInputFile_light,
"%d", &i_val);
160 fscanf(fInputFile_light,
"%f", &a_val);
162 fscanf(fInputFile_light,
"%s", ss);
163 strncpy(lt->name, ss, 10);
166 fclose(fInputFile_light);
344 cout <<
"-E- MpdLAQGSMGenerator: Input file not open!" << endl;
349 cout <<
"-E- MpdLAQGSMGenerator: Input file not open!" << endl;
356 cout <<
"-E- MpdLAQGSMGenerator::ReadEvent: "
357 <<
"No PrimaryGenerator!" << endl;
368 Float_t b = 0., bx = 0, by = 0;
371 Int_t iCharge = 0, iLeptonic = 0, iStrange = 0, iBarionic = 0, iCode = 0, io1 = 0, io2 = 0, io3 = 0
375 Float_t px = 0., py = 0., pz = 0., pz1 = 0, pza1 = 0,
389 Float_t projA, projZ, projEex, targA, targZ, targEex;
392 sscanf(ss,
" %d %d %n", &eventId, &nTracks, &bpos);
395 sscanf(&(ss[bpos]),
"%g %g %g %g %g %g %g %g %g", &b, &bx, &by, &projA, &projZ, &projEex, &targA, &targZ,
398 sscanf(&(ss[bpos]),
"%g %g %g", &b, &bx, &by);
400 cout <<
"-I- MpdLAQGSMGenerator::ReadEvent: Event " << eventId <<
", b = " << b <<
" fm, multiplicity " << nTracks
407 FairMCEventHeader*
event = primGen->GetEvent();
408 if (event && (!event->IsSet())) {
409 event->SetEventID(eventId - 1);
411 event->SetRotZ(bb.Phi());
412 event->MarkSet(kTRUE);
457 for (Int_t itrack = 0; itrack < nTracks; itrack++) {
463 sscanf(ss,
" %d %d %d %d %d", &iCharge, &iLeptonic, &iStrange, &iBarionic, &iCode);
465 sscanf(ss,
" %d %d %d %d %d %d %d", &iCharge, &iLeptonic, &iStrange, &iBarionic, &io1, &io2, &io3);
474 sscanf(&(ss[p_num]),
"%g%g%g%g%g", &px, &py, &pz, &pz1, &mass);
476 sscanf(&(ss[p_num]),
"%g%g%g%g%g%g", &px, &py, &pz, &pz1, &pza1, &mass);
478 if (
FindParticle(iCharge, iStrange, iLeptonic, iBarionic, mass, PDG, ionName)) {
480 if (!
fPDG->GetParticle(PDG)) {
481 cout <<
"-W- MpdLAQGSMGenerator::ReadEvent: Cannot find " << PDG <<
" " << ionName <<
" in database!"
488 primGen->AddTrack(PDG, px, py, pz, 0., 0., 0.);
490 primGen->AddTrack(PDG, px, py, pz1,
fX,
fY,
fZ);
494 Int_t nTr = gMC->GetStack()->GetNtrack();
495 TParticle* part = ((
CbmStack*)gMC->GetStack())->GetParticle(nTr - 1);
496 Double_t polx = pza1;
500 Double_t poly = TMath::Sqrt(1.0 - polx * polx);
502 part->SetPolarisation(polx, poly, polz);
532 const Int_t kion = 1000000000;
533 const Int_t kion_strange = kion + 10000000;
534 const Int_t kspecial = 50000000;
537 Int_t ss = abs(Strange);
540 return (kion_strange + Z * 10000 + A * 10);
542 return (kion + 10000000 * ss + Z * 10000 + A * 10);
544 return (kspecial + A * 10);
546 return (kion + Z * 10000 + A * 10 + user);
573 Int_t iCharge = 0, iLeptonic = 0, iStrange = 0, iBarionic = 0, iCode = 0;
574 Float_t px = 0., py = 0., pz = 0., pz1 = 0, pza1 = 0,
577 mass = 0, excEnergy = 0;
578 char ss[252], buf_ionName[30];
580 Int_t A = 0, Z = 0, Q = 0;
587 Bool_t geant4_bug_case = 1;
594 sscanf(ss,
" %d %d", &eventId, &nTracks);
599 for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
603 sscanf(ss,
" %d %d %d %d %d", &iCharge, &iLeptonic, &iStrange, &iBarionic, &iCode);
617 sscanf(&(ss[p_num]),
"%g%g%g%g%g", &px, &py, &pz, &pz1, &mass);
619 sscanf(&(ss[p_num]),
"%g%g%g%g%g%g", &px, &py, &pz, &pz1, &pza1, &mass);
630 if (
FindParticle(iCharge, iStrange, iLeptonic, iBarionic, mass, PDG, buf_ionName)) {
632 if (
fPDG->GetParticle(PDG))
635 ionName = buf_ionName;
638 if (Z > 2 || (Z == 2 && A > 4)) {
642 FairIon* ion =
new FairIon(ionName, Z, A, Q);
666 new FairParticle(PDG, buf_ionName, kPTHadron, mass, Z, 2.6e-10,
"hadron");
668 FairRunSim::Instance()->AddNewParticle(pa);
671 new FairParticle(PDG, buf_ionName, kPTNeutron, mass, Z, 2.6e-10,
"special");
673 FairRunSim::Instance()->AddNewParticle(pa);
688 if (geant4_bug_case) {
691 TString ionName_dummy =
"Ion_10_5";
693 FairIon* ion =
new FairIon(ionName_dummy, 5, 10, 5, excEnergy, mass);
699 FairRunSim*
run = FairRunSim::Instance();
700 map<TString, FairIon*>::iterator mapIt;
702 FairIon* ion = (*mapIt).second;
715 Int_t nIons = 0, nPart =
fLa_tab.size();
718 Bool_t geant4_bug_case = 1;
721 Float_t mass = 0.0, excEnergy = 0.0;
722 char buf_ionName[30];
724 for (Int_t
i = 0;
i < nPart; ++
i) {
725 Int_t Z =
fLa_tab[
i]->Z, iCharge = Z, Q = Z;
726 Int_t iLeptonic =
fLa_tab[
i]->lepton;
727 Int_t iStrange =
fLa_tab[
i]->strange;
728 Int_t A =
fLa_tab[
i]->A, iBarionic = A;
736 if (
FindParticle(iCharge, iStrange, iLeptonic, iBarionic, mass, PDG, buf_ionName)) {
738 if (
fPDG->GetParticle(PDG))
741 ionName = buf_ionName;
748 FairIon* ion =
new FairIon(ionName, Z, A, Q, excEnergy, mass);
760 new FairParticle(PDG, buf_ionName, kPTHadron, mass, Z, 2.6e-10,
"hadron");
762 FairRunSim::Instance()->AddNewParticle(pa);
765 new FairParticle(PDG, buf_ionName, kPTNeutron, mass, Z, 2.6e-10,
"special");
767 FairRunSim::Instance()->AddNewParticle(pa);
777 if (geant4_bug_case) {
780 TString ionName_dummy =
"Ion_10_5";
782 FairIon* ion =
new FairIon(ionName_dummy, 5, 10, 5, excEnergy, mass);
788 FairRunSim*
run = FairRunSim::Instance();
789 map<TString, FairIon*>::iterator mapIt;
791 FairIon* ion = (*mapIt).second;
984 const Double_t khSlash = 1.0545726663e-27;
985 const Double_t kErg2Gev = 1 / 1.6021773349e-3;
986 const Double_t khShGev = khSlash * kErg2Gev;
987 const Double_t kYear2Sec = 3600 * 24 * 365.25;
989 Double_t width = khShGev / (12.33 * kYear2Sec);
991 cout <<
"-I- MpdLAQGSMGenerator::CreateNucleus " << pdgName <<
" " << pdgCode << endl;
996 p =
fPDG->AddParticle(pdgName, pdgName, mass, kFALSE, width, Z * 3,
"nucleus", pdgCode, 0, kPTHadron);
998 p =
fPDG->AddParticle(pdgName, pdgName, mass, kFALSE, 6.58211889e-25 / 2.6e-10, 0,
1000 "special", pdgCode, 0, kPTNeutron);