diff --git a/MC/config/PWGLF/ini/GeneratorLF_ExoticResonances_pp1360.ini b/MC/config/PWGLF/ini/GeneratorLF_ExoticResonances_pp1360.ini index 55262cb83..3535d7cbe 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_ExoticResonances_pp1360.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_ExoticResonances_pp1360.ini @@ -1,6 +1,6 @@ [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/exoticresonancegun.json", true, 4) +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/exoticresonancegun.json", true, 4) # [GeneratorPythia8] # if triggered then this will be used as the background event # config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb.ini index b66e66584..529787320 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb.ini @@ -1,6 +1,6 @@ [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_pbpb.json", true, 4) +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_pbpb.json", true, 4) # [GeneratorPythia8] # config=${O2_ROOT}/share/Generators/egconfig/pythia8_hi.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb5360_injection.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb5360_injection.ini index 89faa5413..5050d1760 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb5360_injection.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb5360_injection.ini @@ -1,6 +1,6 @@ [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj_pbpb.json", true, 4) +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj_pbpb.json", true, 4) # [GeneratorPythia8] # config=${O2_ROOT}/share/Generators/egconfig/pythia8_hi.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb5360_trigger.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb5360_trigger.ini deleted file mode 100644 index bffef0d39..000000000 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb5360_trigger.ini +++ /dev/null @@ -1,10 +0,0 @@ -[GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig_pbpb.json", true, 4) - -[GeneratorPythia8] -config=${O2_ROOT}/share/Generators/egconfig/pythia8_hi.cfg - -[DecayerPythia8] # after for transport code! -config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg -config[1]=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonances.cfg \ No newline at end of file diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb_exotic.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb_exotic.ini index e2e575af0..fb7869c66 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb_exotic.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_PbPb_exotic.ini @@ -1,6 +1,6 @@ [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic_pbpb.json", true, 4) +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic_pbpb.json", true, 4) # [GeneratorPythia8] # config=${O2_ROOT}/share/Generators/egconfig/pythia8_hi.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp.ini index 8e91af28b..4ba2a3fd9 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp.ini @@ -1,6 +1,6 @@ [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun.json", true, 4) +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun.json", true, 4) # [GeneratorPythia8] # if triggered then this will be used as the background event # config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360.ini index 8e91af28b..4ba2a3fd9 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360.ini @@ -1,6 +1,6 @@ [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun.json", true, 4) +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun.json", true, 4) # [GeneratorPythia8] # if triggered then this will be used as the background event # config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360_injection.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360_injection.ini index 9e3d43470..cf103d147 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360_injection.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360_injection.ini @@ -1,6 +1,6 @@ [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj.json", true, 4) +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj.json", true, 4) # [GeneratorPythia8] # if triggered then this will be used as the background event # config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360_trigger.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360_trigger.ini deleted file mode 100644 index 0a4d58ca4..000000000 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp1360_trigger.ini +++ /dev/null @@ -1,10 +0,0 @@ -[GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig.json", true, 4) - -[GeneratorPythia8] # if triggered then this will be used as the background event -config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg - -[DecayerPythia8] # after for transport code! -config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg -config[1]=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonances.cfg \ No newline at end of file diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900.ini index d23569e2a..a890a5531 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900.ini @@ -1,6 +1,6 @@ [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun.json", true, 4) +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun.json", true, 4) # [GeneratorPythia8] # if triggered then this will be used as the background event # config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900_injection.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900_injection.ini index 4ef0a59b6..2e5c4a6d4 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900_injection.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900_injection.ini @@ -1,6 +1,6 @@ [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj.json", true, 4) +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj.json", true, 4) # [GeneratorPythia8] # if triggered then this will be used as the background event # config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900_trigger.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900_trigger.ini deleted file mode 100644 index 1f0328d6a..000000000 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp900_trigger.ini +++ /dev/null @@ -1,10 +0,0 @@ -[GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig.json", true, 4) - -[GeneratorPythia8] # if triggered then this will be used as the background event -config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp900gev.cfg - -[DecayerPythia8] # after for transport code! -config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg -config[1]=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonances.cfg \ No newline at end of file diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp_exotic.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp_exotic.ini index a49804cc8..7ec78bb39 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp_exotic.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp_exotic.ini @@ -1,6 +1,6 @@ [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C -funcName=generateLF("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic.json", true, 4) +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic.json", true, 4) # [GeneratorPythia8] # if triggered then this will be used as the background event # config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_PbPb5360_trigger.C b/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_PbPb5360_trigger.C deleted file mode 100644 index b6057017a..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_PbPb5360_trigger.C +++ /dev/null @@ -1,180 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - int numberOfInjectedSignalsPerEvent{1}; - int numberOfGapEvents{4}; - int numberOfEventsProcessed{0}; - int numberOfEventsProcessedWithoutInjection{0}; - std::vector injectedPDGs = { - 323, // K*+- - -323, // K*bar+- - 9010221, // f_0(980) - 113, // rho(770)0 - 213, // rho(770)+ - -213, // rho(770)bar- - 3224, // Sigma(1385)+ - -3224, // Sigma(1385)bar- - 3114, // Sigma(1385)- - -3114, // Sigma(1385)bar+ - 3124, // Lambda(1520)0 - -3124, // Lambda(1520)0bar - 3324, // Xi(1530)0 - -3324, // Xi(1530)0bar - 10323, // K1(1270)+ - -10323, // K1(1270)-bar - 2224, // Delta(1232)+ - -2224, // Delta(1232)bar- - 2114, // Delta(1232)0 - -2114, // Delta(1232)0bar - 123314, // Xi(1820)- - -123314, // Xi(1820)+ - 123324, // Xi(1820)0 - -123324 // Xi(1820)0bar - }; - std::vector> decayDaughters = { - {311, 211}, // K*+- - {-311, -211}, // K*bar+- - {211, -211}, // f_0(980) - {211, -211}, // rho(770)0 - {211, 111}, // rho(770)+ - {-211, 111}, // rho(770)bar- - {3122, 211}, // Sigma(1385)+ - {-3122, -211}, // Sigma(1385)bar- - {3122, -211}, // Sigma(1385)- - {-3122, 211}, // Sigma(1385)bar+ - {2212, -321}, // Lambda(1520)0 - {-2212, 321}, // Lambda(1520)0bar - {3312, 211}, // Xi(1530)0 - {-3312, -211}, // Xi(1530)0bar - {321, 211}, // K1(1270)+ - {-321, -211}, // K1(1270)-bar - {2212, 211}, // Delta(1232)+ - {-2212, -211}, // Delta(1232)bar- - {2212, -211}, // Delta(1232)- - {-2212, 211}, // Delta(1232)bar+ - {3122, -311}, // Xi(1820)- - {3122, 311}, // Xi(1820)+ - {3122, 310}, // Xi(1820)0 - {-3122, 310} // Xi(1820)0bar - }; - - auto nInjection = injectedPDGs.size(); - - TFile file(path.c_str(), "READ"); - if (file.IsZombie()) - { - std::cerr << "Cannot open ROOT file " << path << "\n"; - return 1; - } - - auto tree = (TTree *)file.Get("o2sim"); - if (!tree) - { - std::cerr << "Cannot find tree o2sim in file " << path << "\n"; - return 1; - } - std::vector *tracks{}; - tree->SetBranchAddress("MCTrack", &tracks); - - std::vector nSignal; - for (int i = 0; i < nInjection; i++) - { - nSignal.push_back(0); - } - std::vector> nDecays; - std::vector nNotDecayed; - for (int i = 0; i < nInjection; i++) - { - std::vector nDecay; - for (int j = 0; j < decayDaughters[i].size(); j++) - { - nDecay.push_back(0); - } - nDecays.push_back(nDecay); - nNotDecayed.push_back(0); - } - auto nEvents = tree->GetEntries(); - bool hasInjection = false; - for (int i = 0; i < nEvents; i++) - { - hasInjection = false; - numberOfEventsProcessed++; - auto check = tree->GetEntry(i); - for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack) - { - auto track = tracks->at(idxMCTrack); - auto pdg = track.GetPdgCode(); - auto it = std::find(injectedPDGs.begin(), injectedPDGs.end(), pdg); - int index = std::distance(injectedPDGs.begin(), it); // index of injected PDG - if (it != injectedPDGs.end()) // found - { - // count signal PDG - nSignal[index]++; - if(track.getFirstDaughterTrackId() < 0) - { - nNotDecayed[index]++; - continue; - } - for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j) - { - auto pdgDau = tracks->at(j).GetPdgCode(); - bool foundDau= false; - // count decay PDGs - for (int idxDaughter = 0; idxDaughter < decayDaughters[index].size(); ++idxDaughter) - { - if (pdgDau == decayDaughters[index][idxDaughter]) - { - nDecays[index][idxDaughter]++; - foundDau= true; - hasInjection = true; - break; - } - } - if (!foundDau) { - std::cerr << "Decay daughter not found: " << pdg << " -> " << pdgDau << "\n"; - } - } - } - } - if (!hasInjection) - { - numberOfEventsProcessedWithoutInjection++; - } - } - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - for (int i = 0; i < nInjection; i++) - { - std::cout << "# Mother \n"; - std::cout << injectedPDGs[i] << " generated: " << nSignal[i] << ", " << nNotDecayed[i] << " did not decay\n"; - if (nSignal[i] == 0){ - std::cerr << "No generated: " << injectedPDGs[i] << "\n"; - // return 1; // At least one of the injected particles should be generated - } - for (int j = 0; j < decayDaughters[i].size(); j++) - { - std::cout << "# Daughter " << decayDaughters[i][j] << ": " << nDecays[i][j] << "\n"; - } - // if (nSignal[i] != nEvents * numberOfInjectedSignalsPerEvent) - // { - // std::cerr << "Number of generated: " << injectedPDGs[i] << ", lower than expected\n"; - // // return 1; // Don't need to return 1, since the number of generated particles is not the same for each event - // } - } - std::cout << "--------------------------------\n"; - std::cout << "Number of events processed: " << numberOfEventsProcessed << "\n"; - std::cout << "Number of input for the gap events: " << numberOfGapEvents << "\n"; - std::cout << "Number of events processed without injection: " << numberOfEventsProcessedWithoutInjection << "\n"; - // injected event + numberOfGapEvents*gap events + injected event + numberOfGapEvents*gap events + ... - // total fraction of the gap event: numberOfEventsProcessedWithoutInjection/numberOfEventsProcessed - float ratioOfNormalEvents = numberOfEventsProcessedWithoutInjection/numberOfEventsProcessed; - if (ratioOfNormalEvents > 0.75) - { - std::cout << "The number of injected event is loo low!!" << std::endl; - return 1; - } - - return 0; -} - -void GeneratorLF_Resonances_PbPb5360_trigger() { External(); } diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp1360_trigger.C b/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp1360_trigger.C deleted file mode 100644 index b4d5c81f2..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp1360_trigger.C +++ /dev/null @@ -1,182 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - int numberOfInjectedSignalsPerEvent{1}; - int numberOfGapEvents{4}; - int numberOfEventsProcessed{0}; - int numberOfEventsProcessedWithoutInjection{0}; - std::vector injectedPDGs = { - 323, // K*+- - -323, // K*bar+- - 9010221, // f_0(980) - 113, // rho(770)0 - 213, // rho(770)+ - -213, // rho(770)bar- - 3224, // Sigma(1385)+ - -3224, // Sigma(1385)bar- - 3114, // Sigma(1385)- - -3114, // Sigma(1385)bar+ - 3124, // Lambda(1520)0 - -3124, // Lambda(1520)0bar - 3324, // Xi(1530)0 - -3324, // Xi(1530)0bar - 10323, // K1(1270)+ - -10323, // K1(1270)-bar - 2224, // Delta(1232)+ - -2224, // Delta(1232)bar- - 2114, // Delta(1232)0 - -2114, // Delta(1232)0bar - 123314, // Xi(1820)- - -123314, // Xi(1820)+ - 123324, // Xi(1820)0 - -123324 // Xi(1820)0bar - }; - std::vector> decayDaughters = { - {311, 211}, // K*+- - {-311, -211}, // K*bar+- - {211, -211}, // f_0(980) - {211, -211}, // rho(770)0 - {211, 111}, // rho(770)+ - {-211, 111}, // rho(770)bar- - {3122, 211}, // Sigma(1385)+ - {-3122, -211}, // Sigma(1385)bar- - {3122, -211}, // Sigma(1385)- - {-3122, 211}, // Sigma(1385)bar+ - {2212, -321}, // Lambda(1520)0 - {-2212, 321}, // Lambda(1520)0bar - {3312, 211}, // Xi(1530)0 - {-3312, -211}, // Xi(1530)0bar - {321, 211}, // K1(1270)+ - {-321, -211}, // K1(1270)-bar - {2212, 211}, // Delta(1232)+ - {-2212, -211}, // Delta(1232)bar- - {2212, -211}, // Delta(1232)- - {-2212, 211}, // Delta(1232)bar+ - {3122, -311}, // Xi(1820)- - {3122, 311}, // Xi(1820)+ - {3122, 310}, // Xi(1820)0 - {-3122, 310} // Xi(1820)0bar - }; - - auto nInjection = injectedPDGs.size(); - - TFile file(path.c_str(), "READ"); - if (file.IsZombie()) - { - std::cerr << "Cannot open ROOT file " << path << "\n"; - return 1; - } - - auto tree = (TTree *)file.Get("o2sim"); - if (!tree) - { - std::cerr << "Cannot find tree o2sim in file " << path << "\n"; - return 1; - } - std::vector *tracks{}; - tree->SetBranchAddress("MCTrack", &tracks); - - std::vector nSignal; - for (int i = 0; i < nInjection; i++) - { - nSignal.push_back(0); - } - std::vector> nDecays; - std::vector nNotDecayed; - for (int i = 0; i < nInjection; i++) - { - std::vector nDecay; - for (int j = 0; j < decayDaughters[i].size(); j++) - { - nDecay.push_back(0); - } - nDecays.push_back(nDecay); - nNotDecayed.push_back(0); - } - auto nEvents = tree->GetEntries(); - bool hasInjection = false; - for (int i = 0; i < nEvents; i++) - { - hasInjection = false; - numberOfEventsProcessed++; - auto check = tree->GetEntry(i); - for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack) - { - auto track = tracks->at(idxMCTrack); - auto pdg = track.GetPdgCode(); - auto it = std::find(injectedPDGs.begin(), injectedPDGs.end(), pdg); - int index = std::distance(injectedPDGs.begin(), it); // index of injected PDG - if (it != injectedPDGs.end()) // found - { - // count signal PDG - nSignal[index]++; - if (track.getFirstDaughterTrackId() < 0) - { - nNotDecayed[index]++; - continue; - } - for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j) - { - auto pdgDau = tracks->at(j).GetPdgCode(); - bool foundDau = false; - // count decay PDGs - for (int idxDaughter = 0; idxDaughter < decayDaughters[index].size(); ++idxDaughter) - { - if (pdgDau == decayDaughters[index][idxDaughter]) - { - nDecays[index][idxDaughter]++; - foundDau = true; - hasInjection = true; - break; - } - } - if (!foundDau) - { - std::cerr << "Decay daughter not found: " << pdg << " -> " << pdgDau << "\n"; - } - } - } - } - if (!hasInjection) - { - numberOfEventsProcessedWithoutInjection++; - } - } - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - for (int i = 0; i < nInjection; i++) - { - std::cout << "# Mother \n"; - std::cout << injectedPDGs[i] << " generated: " << nSignal[i] << ", " << nNotDecayed[i] << " did not decay\n"; - if (nSignal[i] == 0) - { - std::cerr << "No generated: " << injectedPDGs[i] << "\n"; - // return 1; // At least one of the injected particles should be generated - } - for (int j = 0; j < decayDaughters[i].size(); j++) - { - std::cout << "# Daughter " << decayDaughters[i][j] << ": " << nDecays[i][j] << "\n"; - } - // if (nSignal[i] != nEvents * numberOfInjectedSignalsPerEvent) - // { - // std::cerr << "Number of generated: " << injectedPDGs[i] << ", lower than expected\n"; - // // return 1; // Don't need to return 1, since the number of generated particles is not the same for each event - // } - } - std::cout << "--------------------------------\n"; - std::cout << "Number of events processed: " << numberOfEventsProcessed << "\n"; - std::cout << "Number of input for the gap events: " << numberOfGapEvents << "\n"; - std::cout << "Number of events processed without injection: " << numberOfEventsProcessedWithoutInjection << "\n"; - // injected event + numberOfGapEvents*gap events + injected event + numberOfGapEvents*gap events + ... - // total fraction of the gap event: numberOfEventsProcessedWithoutInjection/numberOfEventsProcessed - float ratioOfNormalEvents = numberOfEventsProcessedWithoutInjection / numberOfEventsProcessed; - if (ratioOfNormalEvents > 0.75) - { - std::cout << "The number of injected event is loo low!!" << std::endl; - return 1; - } - - return 0; -} - -void GeneratorLF_Resonances_pp1360_trigger() { External(); } diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp900_trigger.C b/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp900_trigger.C deleted file mode 100644 index 701d018ad..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp900_trigger.C +++ /dev/null @@ -1,170 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - int numberOfInjectedSignalsPerEvent{1}; - int numberOfGapEvents{4}; - int numberOfEventsProcessed{0}; - int numberOfEventsProcessedWithoutInjection{0}; - std::vector injectedPDGs = { - 323, // K*+- - -323, // K*bar+- - 9010221, // f_0(980) - 113, // rho(770)0 - 213, // rho(770)+ - -213, // rho(770)bar- - 3224, // Sigma(1385)+ - -3224, // Sigma(1385)bar- - 3114, // Sigma(1385)- - -3114, // Sigma(1385)bar+ - 3324, // Xi(1530)0 - -3324, // Xi(1530)0bar - 10323, // K1(1270)+ - -10323, // K1(1270)-bar - 2224, // Delta(1232)+ - -2224, // Delta(1232)bar- - 2114, // Delta(1232)0 - -2114 // Delta(1232)0bar - }; - std::vector> decayDaughters = { - {311, 211}, // K*+- - {-311, -211}, // K*bar+- - {211, -211}, // f_0(980) - {211, -211}, // rho(770)0 - {211, 111}, // rho(770)+ - {-211, 111}, // rho(770)bar- - {3122, 211}, // Sigma(1385)+ - {-3122, -211}, // Sigma(1385)bar- - {3122, -211}, // Sigma(1385)- - {-3122, 211}, // Sigma(1385)bar+ - {3312, 211}, // Xi(1530)0 - {-3312, -211}, // Xi(1530)0bar - {321, 211}, // K1(1270)+ - {-321, -211}, // K1(1270)-bar - {2212, 211}, // Delta(1232)+ - {-2212, -211}, // Delta(1232)bar- - {2212, -211}, // Delta(1232)- - {-2212, 211} // Delta(1232)bar+ - }; - - auto nInjection = injectedPDGs.size(); - - TFile file(path.c_str(), "READ"); - if (file.IsZombie()) - { - std::cerr << "Cannot open ROOT file " << path << "\n"; - return 1; - } - - auto tree = (TTree *)file.Get("o2sim"); - if (!tree) - { - std::cerr << "Cannot find tree o2sim in file " << path << "\n"; - return 1; - } - std::vector *tracks{}; - tree->SetBranchAddress("MCTrack", &tracks); - - std::vector nSignal; - for (int i = 0; i < nInjection; i++) - { - nSignal.push_back(0); - } - std::vector> nDecays; - std::vector nNotDecayed; - for (int i = 0; i < nInjection; i++) - { - std::vector nDecay; - for (int j = 0; j < decayDaughters[i].size(); j++) - { - nDecay.push_back(0); - } - nDecays.push_back(nDecay); - nNotDecayed.push_back(0); - } - auto nEvents = tree->GetEntries(); - bool hasInjection = false; - for (int i = 0; i < nEvents; i++) - { - hasInjection = false; - numberOfEventsProcessed++; - auto check = tree->GetEntry(i); - for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack) - { - auto track = tracks->at(idxMCTrack); - auto pdg = track.GetPdgCode(); - auto it = std::find(injectedPDGs.begin(), injectedPDGs.end(), pdg); - int index = std::distance(injectedPDGs.begin(), it); // index of injected PDG - if (it != injectedPDGs.end()) // found - { - // count signal PDG - nSignal[index]++; - if (track.getFirstDaughterTrackId() < 0) - { - nNotDecayed[index]++; - continue; - } - for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j) - { - auto pdgDau = tracks->at(j).GetPdgCode(); - bool foundDau = false; - // count decay PDGs - for (int idxDaughter = 0; idxDaughter < decayDaughters[index].size(); ++idxDaughter) - { - if (pdgDau == decayDaughters[index][idxDaughter]) - { - nDecays[index][idxDaughter]++; - foundDau = true; - hasInjection = true; - break; - } - } - if (!foundDau) - { - std::cerr << "Decay daughter not found: " << pdg << " -> " << pdgDau << "\n"; - } - } - } - } - if (!hasInjection) - { - numberOfEventsProcessedWithoutInjection++; - } - } - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - for (int i = 0; i < nInjection; i++) - { - std::cout << "# Mother \n"; - std::cout << injectedPDGs[i] << " generated: " << nSignal[i] << ", " << nNotDecayed[i] << " did not decay\n"; - if (nSignal[i] == 0) - { - std::cerr << "No generated: " << injectedPDGs[i] << "\n"; - // return 1; // At least one of the injected particles should be generated - } - for (int j = 0; j < decayDaughters[i].size(); j++) - { - std::cout << "# Daughter " << decayDaughters[i][j] << ": " << nDecays[i][j] << "\n"; - } - // if (nSignal[i] != nEvents * numberOfInjectedSignalsPerEvent) - // { - // std::cerr << "Number of generated: " << injectedPDGs[i] << ", lower than expected\n"; - // // return 1; // Don't need to return 1, since the number of generated particles is not the same for each event - // } - } - std::cout << "--------------------------------\n"; - std::cout << "Number of events processed: " << numberOfEventsProcessed << "\n"; - std::cout << "Number of input for the gap events: " << numberOfGapEvents << "\n"; - std::cout << "Number of events processed without injection: " << numberOfEventsProcessedWithoutInjection << "\n"; - // injected event + numberOfGapEvents*gap events + injected event + numberOfGapEvents*gap events + ... - // total fraction of the gap event: numberOfEventsProcessedWithoutInjection/numberOfEventsProcessed - float ratioOfNormalEvents = numberOfEventsProcessedWithoutInjection / numberOfEventsProcessed; - if (ratioOfNormalEvents > 0.75) - { - std::cout << "The number of injected event is loo low!!" << std::endl; - return 1; - } - - return 0; -} - -void GeneratorLF_Resonances_pp900_trigger() { External(); } diff --git a/MC/config/PWGLF/pythia8/generator/exoticresonancegun.json b/MC/config/PWGLF/pythia8/generator/exoticresonancegun.json index a2d964c1a..7043cd6d8 100644 --- a/MC/config/PWGLF/pythia8/generator/exoticresonancegun.json +++ b/MC/config/PWGLF/pythia8/generator/exoticresonancegun.json @@ -6,6 +6,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_1(1420)" : { @@ -15,6 +17,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(1500)" : { @@ -24,6 +28,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(1710)" : { @@ -33,6 +39,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_2(1525)" : { @@ -42,6 +50,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(1370)" : { @@ -51,6 +61,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true } } diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun.json index b8c248b16..8fa6a5b4f 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun.json @@ -6,6 +6,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K(892)-" : { @@ -15,6 +17,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(980)" : { @@ -24,6 +28,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)0" : { @@ -33,6 +39,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)+" : { @@ -42,6 +50,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)-" : { @@ -51,6 +61,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Sigma(1385)-" : { @@ -60,6 +72,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Sigma(1385)+" : { @@ -69,6 +83,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Sigma(1385)+" : { @@ -78,6 +94,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Sigma(1385)-" : { @@ -87,6 +105,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Lambda(1520)0" : { @@ -96,6 +116,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Lambda(1520)0" : { @@ -105,6 +127,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1530)0" : { @@ -114,6 +138,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Xi(1530)0" : { @@ -123,6 +149,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)+": { @@ -132,6 +160,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)-": { @@ -141,6 +171,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Delta++" : { @@ -150,6 +182,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Delta++" : { @@ -159,6 +193,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Delta0" : { @@ -168,6 +204,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Delta0" : { @@ -177,6 +215,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)0" : { @@ -186,6 +226,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Anti-Xi(1820)0" : { @@ -195,6 +237,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)-" : { @@ -204,6 +248,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)+" : { @@ -213,6 +259,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true } } diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic.json index 1d1f07fcb..8f6e78f1d 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic.json @@ -6,6 +6,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(1370)" : { @@ -15,6 +17,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(1500)" : { @@ -24,6 +28,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(1710)" : { @@ -33,6 +39,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_1(1285)" : { @@ -42,6 +50,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_1(1420)" : { @@ -51,6 +61,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_2(1525)" : { @@ -60,6 +72,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "a_2(1230)" : { @@ -69,6 +83,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)+": { @@ -78,6 +94,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)-": { @@ -87,6 +105,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)0" : { @@ -96,6 +116,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Anti-Xi(1820)0" : { @@ -105,6 +127,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)-" : { @@ -114,6 +138,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)+" : { @@ -123,6 +149,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true } } diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic_pbpb.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic_pbpb.json index 99b38064d..326752866 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic_pbpb.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_exotic_pbpb.json @@ -6,6 +6,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(1370)" : { @@ -15,6 +17,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(1500)" : { @@ -24,6 +28,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(1710)" : { @@ -33,6 +39,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_1(1285)" : { @@ -42,6 +50,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_1(1420)" : { @@ -51,6 +61,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_2(1525)" : { @@ -60,6 +72,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "a_2(1230)" : { @@ -69,6 +83,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)+": { @@ -78,6 +94,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)-": { @@ -87,6 +105,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)0" : { @@ -96,6 +116,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Anti-Xi(1820)0" : { @@ -105,6 +127,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)-" : { @@ -114,6 +138,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)+" : { @@ -123,6 +149,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true } } diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj.json index e2ff3a233..c15acbf37 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj.json @@ -6,6 +6,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Lambda(1520)0" : { @@ -15,6 +17,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(980)" : { @@ -24,6 +28,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)0" : { @@ -33,6 +39,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Anti-Xi(1820)0" : { @@ -42,6 +50,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)-" : { @@ -51,6 +61,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)+" : { @@ -60,6 +72,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true } } diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj_pbpb.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj_pbpb.json index 1de68db2e..005c8ca76 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj_pbpb.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_inj_pbpb.json @@ -6,6 +6,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Lambda(1520)0" : { @@ -15,6 +17,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(980)" : { @@ -24,6 +28,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)0" : { @@ -33,6 +39,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Anti-Xi(1820)0" : { @@ -42,6 +50,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)-" : { @@ -51,6 +61,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)+" : { @@ -60,6 +72,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true } } diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_pbpb.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_pbpb.json index 89413907a..d2f92f44d 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun_pbpb.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_pbpb.json @@ -6,6 +6,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K(892)-" : { @@ -15,6 +17,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "f_0(980)" : { @@ -24,6 +28,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)0" : { @@ -33,6 +39,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)+" : { @@ -42,6 +50,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)-" : { @@ -51,6 +61,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Sigma(1385)-" : { @@ -60,6 +72,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Sigma(1385)+" : { @@ -69,6 +83,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Sigma(1385)+" : { @@ -78,6 +94,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Sigma(1385)-" : { @@ -87,6 +105,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Lambda(1520)0" : { @@ -96,6 +116,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Lambda(1520)0" : { @@ -105,6 +127,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1530)0" : { @@ -114,6 +138,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Xi(1530)0" : { @@ -123,6 +149,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)+": { @@ -132,6 +160,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)-": { @@ -141,6 +171,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Delta++" : { @@ -150,6 +182,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Delta++" : { @@ -159,6 +193,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Delta0" : { @@ -168,6 +204,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Delta0" : { @@ -177,6 +215,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)0" : { @@ -186,6 +226,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Anti-Xi(1820)0" : { @@ -195,6 +237,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)-" : { @@ -204,6 +248,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1820)+" : { @@ -213,6 +259,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true } } diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig.json index b8e19d235..de1ad01e1 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig.json @@ -6,6 +6,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K(892)-" : { @@ -15,6 +17,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)0" : { @@ -24,6 +28,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)+" : { @@ -33,6 +39,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)-" : { @@ -42,6 +50,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Sigma(1385)-" : { @@ -51,6 +61,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Sigma(1385)+" : { @@ -60,6 +72,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Sigma(1385)+" : { @@ -69,6 +83,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Sigma(1385)-" : { @@ -78,6 +94,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1530)0" : { @@ -87,6 +105,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Xi(1530)0" : { @@ -96,6 +116,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)+": { @@ -105,6 +127,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)-": { @@ -114,6 +138,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Delta++" : { @@ -123,6 +149,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Delta++" : { @@ -132,6 +160,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Delta0" : { @@ -141,6 +171,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Delta0" : { @@ -150,6 +182,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true } } diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig_pbpb.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig_pbpb.json index b778543df..f2c692e5a 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig_pbpb.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_trig_pbpb.json @@ -6,6 +6,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K(892)-" : { @@ -15,6 +17,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)0" : { @@ -24,6 +28,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)+" : { @@ -33,6 +39,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "rho(770)-" : { @@ -42,6 +50,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Sigma(1385)-" : { @@ -51,6 +61,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Sigma(1385)+" : { @@ -60,6 +72,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Sigma(1385)+" : { @@ -69,6 +83,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Sigma(1385)-" : { @@ -78,6 +94,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Xi(1530)0" : { @@ -87,6 +105,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Xi(1530)0" : { @@ -96,6 +116,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)+": { @@ -105,6 +127,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "K1(1270)-": { @@ -114,6 +138,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Delta++" : { @@ -123,6 +149,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Delta++" : { @@ -132,6 +160,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "Delta0" : { @@ -141,6 +171,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true }, "anti-Delta0" : { @@ -150,6 +182,8 @@ "ptMax": 20, "etaMin": -1.2, "etaMax": 1.2, + "rapidityMin": -1.2, + "rapidityMax": 1.2, "genDecayed": true } } diff --git a/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C b/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C new file mode 100644 index 000000000..f3c56f420 --- /dev/null +++ b/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C @@ -0,0 +1,631 @@ +/// +/// \file generator_pythia8_LF_rapidity.C +/// \author Bong-Hwi Lim bong-hwi.lim@cern.ch +/// \author Based on generator_pythia8_LF.C by Nicolò Jacazio +/// \since 2025/08/18 +/// \brief Implementation of a gun generator for multiple particles using rapidity instead of eta, built on generator_pythia8_longlived.C +/// Needs PDG, Number of injected, minimum and maximum pT, minimum and maximum rapidity. These can be provided in three ways, bundeling variables, particles or from input file +/// usage: +/// `o2-sim -g external --configKeyValues 'GeneratorExternal.fileName=generator_pythia8_LF_rapidity.C;GeneratorExternal.funcName=generateLFRapidity({1000010020, 1000010030}, {10, 10}, {0.5, 0.5}, {10, 10}, {-1.0, -1.0}, {1.0, 1.0})'` +/// Here PDG, Number injected, pT limits, rapidity limits are separated and matched by index +/// or: +/// `o2-sim -g external --configKeyValues 'GeneratorExternal.fileName=generator_pythia8_LF_rapidity.C;GeneratorExternal.funcName=generateLFRapidity({{1000010020, 10, 0.5, 10, -1.0, 1.0}, {1000010030, 10, 0.5, 10, -1.0, 1.0}})'` +/// Here PDG, Number injected, pT limits, rapidity limits are divided per particle +/// or: +/// `o2-sim -g external --configKeyValues 'GeneratorExternal.fileName=generator_pythia8_LF_rapidity.C;GeneratorExternal.funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/nuclei_rapidity.gun")'` +/// Here PDG, Number injected, pT limits, rapidity limits are provided via an intermediate configuration file +/// + +#if !defined(__CLING__) || defined(__ROOTCLING__) +#include "Pythia8/Pythia.h" +#include "FairGenerator.h" +#include "Generators/GeneratorPythia8.h" +#include "TRandom3.h" +#include "TParticlePDG.h" +#include "TDatabasePDG.h" +#include "TMath.h" +#if __has_include("SimulationDataFormat/MCGenStatus.h") +#include "SimulationDataFormat/MCGenStatus.h" +#else +#include "SimulationDataFormat/MCGenProperties.h" +#endif +#if __has_include("SimulationDataFormat/MCUtils.h") +#include "SimulationDataFormat/MCUtils.h" +#endif +#include "fairlogger/Logger.h" +#include "TSystem.h" +#include +#include "Generators/GeneratorPythia8Param.h" +#include +#endif +// DecayerPythia8Param needs to be included after the #endif to work with Cling +#include "Generators/DecayerPythia8Param.h" +#if defined(__CLING__) && !defined(__ROOTCLING__) +#if __has_include("SimulationDataFormat/MCGenStatus.h") +#include "SimulationDataFormat/MCGenStatus.h" +#elif __has_include("SimulationDataFormat/MCGenProperties.h") +#include "SimulationDataFormat/MCGenProperties.h" +#endif +#if __has_include("SimulationDataFormat/MCUtils.h") +#include "SimulationDataFormat/MCUtils.h" +#endif +#pragma cling load("libO2Generators") +#endif +#include "Generators/GeneratorPythia8.h" +#include + +using namespace Pythia8; +using namespace o2::mcgenstatus; + +// Helper function to get mass from PDG code (copied from generator_pythia8_longlived.C to avoid include issues) +namespace { +double getMassFromPDG(int input_pdg) +{ + double mass = 0; + if (TDatabasePDG::Instance()) + { + TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(input_pdg); + if (particle) { + mass = particle->Mass(); + } else { + LOG(warning) << "Unknown particle requested with PDG " << input_pdg << ", mass set to 0"; + } + } + return mass; +} +} + +class GeneratorPythia8LFRapidity : public o2::eventgen::GeneratorPythia8 +{ + public: + /// Parametric constructor + GeneratorPythia8LFRapidity(bool injOnePerEvent /*= true*/, + int gapBetweenInjection /*= 0*/, + bool useTrigger /*= false*/, + std::string pythiaCfgMb /*= "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/pythia8_inel_minbias.cfg"*/, + std::string pythiaCfgSignal /*= "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/pythia8_inel_signal.cfg"*/) : GeneratorPythia8{}, + mOneInjectionPerEvent{injOnePerEvent}, + mGapBetweenInjection{gapBetweenInjection}, + mUseTriggering{useTrigger} + { + LOG(info) << "GeneratorPythia8LFRapidity constructor"; + LOG(info) << "++ mOneInjectionPerEvent: " << mOneInjectionPerEvent; + LOG(info) << "++ mGapBetweenInjection: " << mGapBetweenInjection; + LOG(info) << "++ mUseTriggering: " << mUseTriggering; + LOG(info) << "++ pythiaCfgMb: " << pythiaCfgMb; + LOG(info) << "++ pythiaCfgSignal: " << pythiaCfgSignal; + gRandom->SetSeed(0); + if (useTrigger) { + mPythia.readString("ProcessLevel:all off"); + if (pythiaCfgMb == "") { // If no configuration file is provided, use the one from the Pythia8Param + auto& param = o2::eventgen::GeneratorPythia8Param::Instance(); + LOG(info) << "Instance LFRapidity \'Pythia8\' generator with following parameters for MB event"; + LOG(info) << param; + pythiaCfgMb = param.config; + } + if (pythiaCfgSignal == "") { // If no configuration file is provided, use the one from the Pythia8Param + auto& param = o2::eventgen::GeneratorPythia8Param::Instance(); + LOG(info) << "Instance LFRapidity \'Pythia8\' generator with following parameters for signal event"; + LOG(info) << param; + pythiaCfgSignal = param.config; + } + pythiaCfgMb = gSystem->ExpandPathName(pythiaCfgMb.c_str()); + pythiaCfgSignal = gSystem->ExpandPathName(pythiaCfgSignal.c_str()); + LOG(info) << " ++ Using trigger, initializing Pythia8 for trigger"; + if (!pythiaObjectMinimumBias.readFile(pythiaCfgMb)) { + LOG(fatal) << "Could not pythiaObjectMinimumBias.readFile(\"" << pythiaCfgMb << "\")"; + } + pythiaObjectMinimumBias.readString("Random:setSeed = on"); + pythiaObjectMinimumBias.readString("Random:seed =" + std::to_string(gRandom->Integer(900000000 - 2) + 1)); + + if (!pythiaObjectMinimumBias.init()) { + LOG(fatal) << "Could not pythiaObjectMinimumBias.init() from " << pythiaCfgMb; + } + if (!pythiaObjectSignal.readFile(pythiaCfgSignal)) { + LOG(fatal) << "Could not pythiaObjectSignal.readFile(\"" << pythiaCfgSignal << "\")"; + } + pythiaObjectSignal.readString("Random:setSeed = on"); + pythiaObjectSignal.readString("Random:seed =" + std::to_string(gRandom->Integer(900000000 - 2) + 1)); + if (!pythiaObjectSignal.init()) { + LOG(fatal) << "Could not pythiaObjectSignal.init() from " << pythiaCfgSignal; + } + } else { // Using simple injection with internal decay (if needed). Fetching the parameters from the configuration file of the PythiaDecayer + /** switch off process level **/ + mPythia.readString("ProcessLevel:all off"); + + /** config **/ + auto& paramGen = o2::eventgen::GeneratorPythia8Param::Instance(); + if (!paramGen.config.empty()) { + LOG(fatal) << "Configuration file provided for \'GeneratorPythia8\' should be empty for this injection scheme"; + return; + } + auto& param = o2::eventgen::DecayerPythia8Param::Instance(); + LOG(info) << "Init \'GeneratorPythia8LFRapidity\' with following parameters"; + LOG(info) << param; + for (int i = 0; i < 8; ++i) { + if (param.config[i].empty()) { + continue; + } + std::string config = gSystem->ExpandPathName(param.config[i].c_str()); + LOG(info) << "GeneratorPythia8LFRapidity Reading configuration from file: " << config; + if (!mPythia.readFile(config, true)) { + LOG(fatal) << "Failed to init \'DecayerPythia8\': problems with configuration file " + << config; + return; + } + } + + /** show changed particle data **/ + if (param.showChanged) { + mPythia.readString(std::string("Init:showChangedParticleData on")); + } else { + mPythia.readString(std::string("Init:showChangedParticleData off")); + } + + /** initialise **/ + if (!mPythia.init()) { + LOG(fatal) << "Failed to init \'DecayerPythia8\': init returned with error"; + return; + } + if (pythiaCfgSignal != "") { + LOG(fatal) << "Cannot use simple injection and have a configuration file. pythiaCfgSignal= `" << pythiaCfgSignal << "` must be empty"; + } + } + } + + /// Destructor + ~GeneratorPythia8LFRapidity() = default; + + //__________________________________________________________________ + Bool_t generateEvent() override + { + if (!mUseTriggering) { // If the triggering is used we handle the the gap when generating the signal + if (mGapBetweenInjection > 0) { + if (mGapBetweenInjection == 1 && mEventCounter % 2 == 0) { + LOG(info) << "Skipping event " << mEventCounter; + return true; + } else if (mEventCounter % mGapBetweenInjection != 0) { + LOG(info) << "Skipping event " << mEventCounter; + return true; + } + } + } + LOG(info) << "generateEvent " << mEventCounter; + mPythia.event.reset(); + + mConfigToUse = mOneInjectionPerEvent ? static_cast(gRandom->Uniform(0.f, getNGuns())) : -1; + LOG(info) << "Using configuration " << mConfigToUse << " out of " << getNGuns() << ", of which " << mGunConfigs.size() << " are transport decayed and " << mGunConfigsGenDecayed.size() << " are generator decayed"; + + bool injectedForThisEvent = false; + int nConfig = mGunConfigs.size(); // We start counting from the configurations of the transport decayed particles + for (const ConfigContainer& cfg : mGunConfigsGenDecayed) { + nConfig++; + if (mConfigToUse >= 0 && (nConfig - 1) != mConfigToUse) { + continue; + } + LOG(info) << "Using config container "; + cfg.print(); + if (mUseTriggering) { // Do the triggering + bool doSignal{mEventCounter % (mGapBetweenInjection + 1) == 0}; // Do signal or gap + + if (doSignal) { + LOG(info) << "Generating triggered signal event for particle"; + cfg.print(); + bool satisfiesTrigger = false; + int nTries = 0; + while (!satisfiesTrigger) { + if (!pythiaObjectSignal.next()) { + continue; + } + // Check if triggered condition satisfied - using rapidity instead of eta + for (Long_t j = 0; j < pythiaObjectSignal.event.size(); j++) { + const int& pypid = pythiaObjectSignal.event[j].id(); + const float& pyrapidity = pythiaObjectSignal.event[j].y(); // Using rapidity (y) instead of eta + const float& pypt = pythiaObjectSignal.event[j].pT(); + if (pypid == cfg.mPdg && cfg.mRapidityMin < pyrapidity && pyrapidity < cfg.mRapidityMax && pypt > cfg.mPtMin && pypt < cfg.mPtMax) { + LOG(info) << "Found particle " << j << " " << pypid << " with rapidity " << pyrapidity << " and pT " << pypt << " in event " << mEventCounter << " after " << nTries << " tries"; + satisfiesTrigger = true; + break; + } + } + nTries++; + } + mPythia.event = pythiaObjectSignal.event; + } else { + LOG(info) << "Generating background event " << mEventCounter; + // Generate minimum-bias event + bool lGenerationOK = false; + while (!lGenerationOK) { + lGenerationOK = pythiaObjectMinimumBias.next(); + } + mPythia.event = pythiaObjectMinimumBias.event; + } + continue; + } + // Do the injection - using rapidity instead of eta + for (int i{0}; i < cfg.mNInject; ++i) { + const double pt = gRandom->Uniform(cfg.mPtMin, cfg.mPtMax); + const double rapidity = gRandom->Uniform(cfg.mRapidityMin, cfg.mRapidityMax); + const double phi = gRandom->Uniform(0, TMath::TwoPi()); + const double px{pt * std::cos(phi)}; + const double py{pt * std::sin(phi)}; + // Convert rapidity to pz using the relation: pz = pt * sinh(rapidity) + const double mT = std::sqrt(cfg.mMass * cfg.mMass + pt * pt); + const double pz{mT * std::sinh(rapidity)}; + const double et{mT * std::cosh(rapidity)}; // Energy E = mT * cosh(y) + + Particle particle; + particle.id(cfg.mPdg); + particle.status(11); + particle.m(cfg.mMass); + particle.px(px); + particle.py(py); + particle.pz(pz); + particle.e(et); + particle.xProd(0.f); + particle.yProd(0.f); + particle.zProd(0.f); + mPythia.particleData.mayDecay(cfg.mPdg, true); // force decay + mPythia.event.append(particle); + } + injectedForThisEvent = true; + } + if (injectedForThisEvent) { + LOG(info) << "Calling next!"; + mPythia.moreDecays(); + mPythia.next(); + if (mPythia.event.size() <= 2) { + LOG(fatal) << "Event size is " << mPythia.event.size() << ", this is not good! Check that the decay actually happened or consider not using the generator decayed particles!"; + } else { + LOG(info) << "Event size is " << mPythia.event.size() << " particles"; + } + } + + if (mVerbose) { + LOG(info) << "Eventlisting"; + mPythia.event.list(1); + mPythia.stat(); + } + return true; + } + + //__________________________________________________________________ + Bool_t importParticles() override + { + if (!mUseTriggering) { // If the triggering is used we handle the the gap when generating the signal + if (mGapBetweenInjection > 0) { + if (mGapBetweenInjection == 1 && mEventCounter % 2 == 0) { + LOG(info) << "Skipping importParticles event " << mEventCounter++; + return true; + } else if (mEventCounter % mGapBetweenInjection != 0) { + LOG(info) << "Skipping importParticles event " << mEventCounter++; + return true; + } + } + } + LOG(info) << "importParticles " << mEventCounter++; + GeneratorPythia8::importParticles(); + int nConfig = 0; + for (const ConfigContainer& cfg : mGunConfigs) { + nConfig++; + if (mConfigToUse >= 0 && (nConfig - 1) != mConfigToUse) { + continue; + } + LOGF(info, "Injecting %i particles with PDG %i, pT in [%f, %f], rapidity in [%f, %f]", cfg.mNInject, cfg.mPdg, cfg.mPtMin, cfg.mPtMax, cfg.mRapidityMin, cfg.mRapidityMax); + + for (int i{0}; i < cfg.mNInject; ++i) { + const double pt = gRandom->Uniform(cfg.mPtMin, cfg.mPtMax); + const double rapidity = gRandom->Uniform(cfg.mRapidityMin, cfg.mRapidityMax); + const double phi = gRandom->Uniform(0, TMath::TwoPi()); + const double px{pt * std::cos(phi)}; + const double py{pt * std::sin(phi)}; + const double mT = std::sqrt(cfg.mMass * cfg.mMass + pt * pt); + const double pz{mT * std::sinh(rapidity)}; + const double et{mT * std::cosh(rapidity)}; + + // TParticle::TParticle(Int_t pdg, + // Int_t status, + // Int_t mother1, Int_t mother2, + // Int_t daughter1, Int_t daughter2, + // Double_t px, Double_t py, Double_t pz, Double_t etot, + // Double_t vx, Double_t vy, Double_t vz, Double_t time) + + mParticles.push_back(TParticle(cfg.mPdg, + MCGenStatusEncoding(1, 1).fullEncoding, + -1, -1, + -1, -1, + px, py, pz, et, + 0., 0., 0., 0.)); + // make sure status code is encoded properly. Transport flag will be set by default and we have nothing + // to do since all pushed particles should be tracked. + o2::mcutils::MCGenHelper::encodeParticleStatusAndTracking(mParticles.back()); + } + nConfig++; + } + if (mVerbose) { + LOG(info) << "Printing particles that are appended"; + int n = 0; + for (const auto& p : mParticles) { + LOG(info) << "Particle " << n++ << " is a " << p.GetPdgCode() << " with status " << p.GetStatusCode() << " and px = " << p.Px() << " py = " << p.Py() << " pz = " << p.Pz(); + } + } + return true; + } + + struct ConfigContainer { + ConfigContainer(int input_pdg = 0, int n = 1, + float ptMin = 1, float ptMax = 10, + float rapidityMin = -1, float rapidityMax = 1) : mPdg{input_pdg}, + mNInject{n}, + mPtMin{ptMin}, + mPtMax{ptMax}, + mRapidityMin{rapidityMin}, + mRapidityMax{rapidityMax} + { + mMass = getMassFromPDG(mPdg); + if (mMass <= 0) { + LOG(fatal) << "Could not find mass for mPdg " << mPdg; + } + LOGF(info, "ConfigContainer: mPdg = %i, mNInject = %i, mPtMin = %f, mPtMax = %f, mRapidityMin = %f, mRapidityMax = %f, mMass = %f", + mPdg, mNInject, mPtMin, mPtMax, mRapidityMin, mRapidityMax, mMass); + }; + + ConfigContainer(TObjArray* arr) : ConfigContainer(atoi(arr->At(0)->GetName()), + atoi(arr->At(1)->GetName()), + atof(arr->At(2)->GetName()), + atof(arr->At(3)->GetName()), + atof(arr->At(4)->GetName()), + atof(arr->At(5)->GetName())) + { + bool hasGenDecayed = false; + for (int i = 0; i < arr->GetEntries(); i++) { + const TString n = arr->At(i)->GetName(); + std::cout << n << std::endl; + if (n == "genDecayed") { + hasGenDecayed = true; + break; + } + } + if (hasGenDecayed) { + if (arr->GetEntries() != 7) { + LOG(fatal) << "Wrong number of entries in the configuration array, should be 7, is " << arr->GetEntries(); + } + } else { + if (arr->GetEntries() != 6) { + LOG(fatal) << "Wrong number of entries in the configuration array, should be 6, is " << arr->GetEntries(); + } + } + }; + ConfigContainer(TString line) : ConfigContainer(line.Tokenize(" ")){}; + ConfigContainer(const nlohmann::json& jsonParams) : ConfigContainer(jsonParams["pdg"], + jsonParams["n"], + jsonParams["ptMin"], + jsonParams["ptMax"], + jsonParams["rapidityMin"], + jsonParams["rapidityMax"]){}; + + // Data Members + const int mPdg = 0; + const int mNInject = 1; + const float mPtMin = 1; + const float mPtMax = 10; + const float mRapidityMin = -1.f; + const float mRapidityMax = 1.f; + double mMass = 0.f; + + void print() const + { + LOGF(info, "int mPdg = %i", mPdg); + LOGF(info, "int mNInject = %i", mNInject); + LOGF(info, "float mPtMin = %f", mPtMin); + LOGF(info, "float mPtMax = %f", mPtMax); + LOGF(info, "float mRapidityMin = %f", mRapidityMin); + LOGF(info, "float mRapidityMax = %f", mRapidityMax); + LOGF(info, "double mMass = %f", mMass); + } + }; + + //__________________________________________________________________ + ConfigContainer addGun(int input_pdg, int nInject = 1, float ptMin = 1, float ptMax = 10, float rapidityMin = 1, float rapidityMax = 10) + { + if (mUseTriggering) { // If in trigger mode, every particle needs to be generated from pythia + return addGunGenDecayed(input_pdg, nInject, ptMin, ptMax, rapidityMin, rapidityMax); + } + ConfigContainer cfg{input_pdg, nInject, ptMin, ptMax, rapidityMin, rapidityMax}; + mGunConfigs.push_back(cfg); + return cfg; + } + + //__________________________________________________________________ + ConfigContainer addGun(ConfigContainer cfg) { return addGun(cfg.mPdg, cfg.mNInject, cfg.mPtMin, cfg.mPtMax, cfg.mRapidityMin, cfg.mRapidityMax); } + + //__________________________________________________________________ + ConfigContainer addGunGenDecayed(int input_pdg, int nInject = 1, float ptMin = 1, float ptMax = 10, float rapidityMin = 1, float rapidityMax = 10) + { + ConfigContainer cfg{input_pdg, nInject, ptMin, ptMax, rapidityMin, rapidityMax}; + mGunConfigsGenDecayed.push_back(cfg); + return cfg; + } + + //__________________________________________________________________ + ConfigContainer addGunGenDecayed(ConfigContainer cfg) { return addGunGenDecayed(cfg.mPdg, cfg.mNInject, cfg.mPtMin, cfg.mPtMax, cfg.mRapidityMin, cfg.mRapidityMax); } + + //__________________________________________________________________ + long int getNGuns() const { return mGunConfigs.size() + mGunConfigsGenDecayed.size(); } + + //__________________________________________________________________ + void print() + { + LOG(info) << "GeneratorPythia8LFRapidity configuration with " << getNGuns() << " guns:"; + LOG(info) << "Particles decayed by the transport:"; + int n = 0; + for (const auto& cfg : mGunConfigs) { + LOG(info) << n++ << "/" << mGunConfigs.size() << ":"; + cfg.print(); + } + n = 0; + LOG(info) << "Particles decayed by the generator:"; + for (const auto& cfg : mGunConfigsGenDecayed) { + LOG(info) << n++ << "/" << mGunConfigs.size() << ":"; + cfg.print(); + } + } + + void setVerbose(bool verbose = true) { mVerbose = verbose; } + + private: + // Configuration + const bool mOneInjectionPerEvent = true; // if true, only one injection per event is performed, i.e. if multiple PDG (including antiparticles) are requested to be injected only one will be done per event + const bool mUseTriggering = false; // if true, use triggering instead of injection + const int mGapBetweenInjection = 0; // Gap between two signal events. 0 means injection at every event + + // Running variables + int mConfigToUse = -1; // Index of the configuration to use + int mEventCounter = 0; // Event counter + bool mVerbose = true; // Verbosity flag + + std::vector mGunConfigs; // List of gun configurations to use + std::vector mGunConfigsGenDecayed; // List of gun configurations to use that will be decayed by the generator + Pythia8::Pythia pythiaObjectSignal; // Signal collision generator + Pythia8::Pythia pythiaObjectMinimumBias; // Minimum bias collision generator +}; + +///___________________________________________________________ +/// Create generator via arrays of entries. By default injecting in every event and all particles +FairGenerator* generateLFRapidity(std::vector PDGs, std::vector nInject, std::vector ptMin, std::vector ptMax, std::vector rapidityMin, std::vector rapidityMax) +{ + const std::vector entries = {PDGs.size(), nInject.size(), ptMin.size(), ptMax.size(), rapidityMin.size(), rapidityMax.size()}; + if (!std::equal(entries.begin() + 1, entries.end(), entries.begin())) { + LOGF(fatal, "Not equal number of entries, check configuration"); + return nullptr; + } + GeneratorPythia8LFRapidity* multiGun = new GeneratorPythia8LFRapidity(false, 0, false, "", ""); + for (unsigned long i = 0; i < entries[0]; i++) { + multiGun->addGun(PDGs[i], nInject[i], ptMin[i], ptMax[i], rapidityMin[i], rapidityMax[i]); + } + return multiGun; +} + +///___________________________________________________________ +/// Create generator via an array of configurations +FairGenerator* generateLFRapidity(std::vector cfg, + std::vector cfgGenDecayed, + bool injectOnePDGPerEvent = true, + int gapBetweenInjection = 0, + bool useTrigger = false, + std::string pythiaCfgMb = "", + std::string pythiaCfgSignal = "") +{ + GeneratorPythia8LFRapidity* multiGun = new GeneratorPythia8LFRapidity(injectOnePDGPerEvent, gapBetweenInjection, useTrigger, pythiaCfgMb, pythiaCfgSignal); + for (const auto& c : cfg) { + LOGF(info, "Adding gun %i", multiGun->getNGuns()); + c.print(); + multiGun->addGun(c); + } + for (const auto& c : cfgGenDecayed) { + LOGF(info, "Adding gun %i, particle will be decayed by the generator", multiGun->getNGuns()); + c.print(); + multiGun->addGunGenDecayed(c); + } + multiGun->print(); + return multiGun; +} + +///___________________________________________________________ +/// Create generator via input file +FairGenerator* generateLFRapidity(std::string configuration = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/nuclei_rapidity.gun", + bool injectOnePDGPerEvent = true, + int gapBetweenInjection = 0, + bool useTrigger = false, + std::string pythiaCfgMb = "", + std::string pythiaCfgSignal = "") +{ + configuration = gSystem->ExpandPathName(configuration.c_str()); + LOGF(info, "Using configuration file '%s'", configuration.c_str()); + std::ifstream inputFile(configuration.c_str(), ios::in); + std::vector cfgVec; + std::vector cfgVecGenDecayed; + if (!inputFile.is_open()) { + LOGF(fatal, "Can't open '%s' !", configuration.c_str()); + return nullptr; + } + if (TString(configuration.c_str()).EndsWith(".json")) { // read from JSON file + nlohmann::json paramfile = nlohmann::json::parse(inputFile); + std::cout << "paramfile " << paramfile << std::endl; + for (const auto& param : paramfile) { + std::cout << param << std::endl; + // cfgVecGenDecayed.push_back(GeneratorPythia8LFRapidity::ConfigContainer{paramfile[n].template get(), param}); + if (param["genDecayed"]) { + cfgVecGenDecayed.push_back(GeneratorPythia8LFRapidity::ConfigContainer{param}); + } else { + cfgVec.push_back(GeneratorPythia8LFRapidity::ConfigContainer{param}); + } + } + } else { + std::string l; + int n = 0; + while (getline(inputFile, l)) { + TString line = l; + line.Strip(TString::kBoth, ' '); + std::cout << n++ << " '" << line << "'" << endl; + if (line.IsNull() || line.IsWhitespace()) { + continue; + } + if (line.BeginsWith("#")) { + std::cout << "Skipping\n"; + continue; + } + if (line.Contains("genDecayed")) { + cfgVecGenDecayed.push_back(GeneratorPythia8LFRapidity::ConfigContainer{line}); + } else { + cfgVec.push_back(GeneratorPythia8LFRapidity::ConfigContainer{line}); + } + } + } + return generateLFRapidity(cfgVec, cfgVecGenDecayed, injectOnePDGPerEvent, gapBetweenInjection, useTrigger, pythiaCfgMb, pythiaCfgSignal); +} + +///___________________________________________________________ +/// Create generator via input file for the triggered mode +FairGenerator* generateLFRapidityTriggered(std::string configuration = "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/nuclei_rapidity.gun", + int gapBetweenInjection = 0, + std::string pythiaCfgMb = "", + std::string pythiaCfgSignal = "") +{ + return generateLFRapidity(configuration, /*injectOnePDGPerEvent=*/true, gapBetweenInjection, /*useTrigger=*/true, pythiaCfgMb, pythiaCfgSignal); +} + +///___________________________________________________________ +void generator_pythia8_LF_rapidity(bool testInj = true, bool testTrg = false, const char* particleListFile = "cfg_rapidity.json") +{ + LOG(info) << "Compiled correctly!"; + if (!testInj && !testTrg) { + return; + } + // Injected mode + if (testInj) { + LOG(info) << "Testing the injected mode"; + auto* gen = static_cast(generateLFRapidity(particleListFile)); + gen->setVerbose(); + gen->Print(); + gen->print(); + gen->Init(); + gen->generateEvent(); + gen->importParticles(); + } + + // Triggered mode + if (testTrg) { + LOG(info) << "Testing the triggered mode"; + GeneratorPythia8LFRapidity* gen = static_cast(generateLFRapidityTriggered(particleListFile, + /*gapBetweenInjection=*/0, + /*pythiaCfgMb=*/"inel136tev.cfg", + /*pythiaCfgSignal=*/"inel136tev.cfg")); + gen->setVerbose(); + gen->Print(); + gen->print(); + gen->Init(); + gen->generateEvent(); + gen->importParticles(); + } +}