From e5aa9df9d440dcfe4c606414af607a250c835920 Mon Sep 17 00:00:00 2001 From: mjkim525 Date: Tue, 22 Sep 2026 18:45:42 +0900 Subject: [PATCH 1/4] Adjust LF resonance injection pT and rapidity ranges Use pT 0-15 GeV/c for f0 and 0-12 GeV/c for the remaining resonances. Set rapidity and eta configuration bounds to +/-0.8. Current Rare INIs use rapidity mode, so the eta bounds do not add an eta cut. Validation: both eta settings produce identical particles in a fixed-seed 500-event comparison with the actual O2 generator; all nine species, pT/y bounds, and gap=5 pass. --- .../generator/resonancelistgun_width_inj.json | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_width_inj.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_width_inj.json index 6aa349acb..119411991 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun_width_inj.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_width_inj.json @@ -3,99 +3,99 @@ "pdg": 9010221, "n": 1, "ptMin": 0.0, - "ptMax": 20, - "etaMin": -1.2, - "etaMax": 1.2, - "rapidityMin": -1.2, - "rapidityMax": 1.2, + "ptMax": 15, + "etaMin": -0.8, + "etaMax": 0.8, + "rapidityMin": -0.8, + "rapidityMax": 0.8, "genDecayed": true }, "Xi(1530)0" : { "pdg": 3324, "n": 1, "ptMin": 0.0, - "ptMax": 20, - "etaMin": -1.2, - "etaMax": 1.2, - "rapidityMin": -1.2, - "rapidityMax": 1.2, + "ptMax": 12, + "etaMin": -0.8, + "etaMax": 0.8, + "rapidityMin": -0.8, + "rapidityMax": 0.8, "genDecayed": true }, "anti-Xi(1530)0" : { "pdg": -3324, "n": 1, "ptMin": 0.0, - "ptMax": 20, - "etaMin": -1.2, - "etaMax": 1.2, - "rapidityMin": -1.2, - "rapidityMax": 1.2, + "ptMax": 12, + "etaMin": -0.8, + "etaMax": 0.8, + "rapidityMin": -0.8, + "rapidityMax": 0.8, "genDecayed": true }, "Xi(1820)0" : { "pdg": 123324, "n": 1, "ptMin": 0.0, - "ptMax": 20, - "etaMin": -1.2, - "etaMax": 1.2, - "rapidityMin": -1.2, - "rapidityMax": 1.2, + "ptMax": 12, + "etaMin": -0.8, + "etaMax": 0.8, + "rapidityMin": -0.8, + "rapidityMax": 0.8, "genDecayed": true }, "Anti-Xi(1820)0" : { "pdg": -123324, "n": 1, "ptMin": 0.0, - "ptMax": 20, - "etaMin": -1.2, - "etaMax": 1.2, - "rapidityMin": -1.2, - "rapidityMax": 1.2, + "ptMax": 12, + "etaMin": -0.8, + "etaMax": 0.8, + "rapidityMin": -0.8, + "rapidityMax": 0.8, "genDecayed": true }, "Xi(1820)-" : { "pdg": 123314, "n": 1, "ptMin": 0.0, - "ptMax": 20, - "etaMin": -1.2, - "etaMax": 1.2, - "rapidityMin": -1.2, - "rapidityMax": 1.2, + "ptMax": 12, + "etaMin": -0.8, + "etaMax": 0.8, + "rapidityMin": -0.8, + "rapidityMax": 0.8, "genDecayed": true }, "Xi(1820)+" : { "pdg": -123314, "n": 1, "ptMin": 0.0, - "ptMax": 20, - "etaMin": -1.2, - "etaMax": 1.2, - "rapidityMin": -1.2, - "rapidityMax": 1.2, + "ptMax": 12, + "etaMin": -0.8, + "etaMax": 0.8, + "rapidityMin": -0.8, + "rapidityMax": 0.8, "genDecayed": true }, "Omega(2012)-" : { "pdg": 123334, "n": 1, "ptMin": 0.0, - "ptMax": 20, - "etaMin": -1.2, - "etaMax": 1.2, - "rapidityMin": -1.2, - "rapidityMax": 1.2, + "ptMax": 12, + "etaMin": -0.8, + "etaMax": 0.8, + "rapidityMin": -0.8, + "rapidityMax": 0.8, "genDecayed": true }, "Omega(2012)+" : { "pdg": -123334, "n": 1, "ptMin": 0.0, - "ptMax": 20, - "etaMin": -1.2, - "etaMax": 1.2, - "rapidityMin": -1.2, - "rapidityMax": 1.2, + "ptMax": 12, + "etaMin": -0.8, + "etaMax": 0.8, + "rapidityMin": -0.8, + "rapidityMax": 0.8, "genDecayed": true } } From 343d7e8463125028f7ad9d7bf04043088ec43f4f Mon Sep 17 00:00:00 2001 From: mjkim525 Date: Tue, 22 Sep 2026 23:18:07 +0900 Subject: [PATCH 2/4] Add LF resonance injection INI for pp at 5.36 TeV Use the existing 5.36 TeV inelastic Pythia configuration with the shared resonance injection JSON, gap 5, rapidity mode, and the existing resonance decay settings. Validation: INI parsing and tracked references verified; differs from the 13.6 TeV INI only in its two MB configuration paths. --- .../PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini new file mode 100644 index 000000000..f39d7ab4f --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini @@ -0,0 +1,10 @@ +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity_width.C +funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_width_inj.json", true, 5, false, true, "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp536tev.cfg", "") + +[GeneratorPythia8] # if triggered then this will be used as the background event +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp536tev.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_width.cfg From a68c3fd46249eb518302f396583050c79192c26d Mon Sep 17 00:00:00 2001 From: mjkim525 Date: Tue, 22 Sep 2026 23:44:53 +0900 Subject: [PATCH 3/4] Register CI test for 5.36 TeV LF resonance INI Use the supported INI test redirection to share the Rare generator kinematics test with the 13.6 TeV setup. This fixes the missing-test failure without changing generator settings. Validation: run_generator_tests.sh --keep-artifacts --fail-immediately passed for the 5.36 TeV INI (100-event DPL eventgen, o2-sim --noGeant, generic kinematics, and Rare-specific checks). --- MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini index f39d7ab4f..b57f4262b 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini @@ -1,3 +1,4 @@ +#---> GeneratorLF_Resonances_pp_Rare [GeneratorExternal] fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity_width.C funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_width_inj.json", true, 5, false, true, "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp536tev.cfg", "") From d1f2e9aaaad9b5c417485f5dd986fe17a1858ca5 Mon Sep 17 00:00:00 2001 From: mjkim525 Date: Tue, 22 Sep 2026 23:49:59 +0900 Subject: [PATCH 4/4] Add dedicated CI macro for 5.36 TeV LF resonances Provide GeneratorLF_Resonances_pp5360_Rare.C with the existing Rare injection PDG, decay, and gap sanity checks. Remove the INI test redirection so CI discovers the dedicated macro by filename. Validation: the actual generator CI runner passed with 100 events, including DPL eventgen, o2-sim --noGeant, generic kinematics, and the dedicated External macro. --- .../GeneratorLF_Resonances_pp5360_Rare.ini | 1 - .../GeneratorLF_Resonances_pp5360_Rare.C | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp5360_Rare.C diff --git a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini index b57f4262b..f39d7ab4f 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Resonances_pp5360_Rare.ini @@ -1,4 +1,3 @@ -#---> GeneratorLF_Resonances_pp_Rare [GeneratorExternal] fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity_width.C funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_width_inj.json", true, 5, false, true, "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp536tev.cfg", "") diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp5360_Rare.C b/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp5360_Rare.C new file mode 100644 index 000000000..b88244335 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp5360_Rare.C @@ -0,0 +1,112 @@ +// Dedicated kinematics test for Rare resonance injection in pp at 5.36 TeV. + +int External() +{ + const std::string path{"o2sim_Kine.root"}; + const int numberOfGapEvents{4}; // generateLFRapidity(..., gap=5) + const std::vector injectedPDGs = { + 9010221, // f0(980) + 3324, -3324, // Xi(1530)0 and anti-Xi(1530)0 + 123324, -123324, // Xi(1820)0 and anti-Xi(1820)0 + 123314, -123314, // Xi(1820)- and Xi(1820)+ + 123334, -123334 // Omega(2012)- and Omega(2012)+ + }; + const std::vector> decayDaughters = { + {211, -211}, + {3312, 211}, {-3312, -211}, + {3122, 310}, {-3122, 310}, + {3122, -321}, {-3122, 321}, + {3312, 310}, {-3312, 310} + }; + + 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(injectedPDGs.size(), 0); + std::vector nNotDecayed(injectedPDGs.size(), 0); + std::vector> nDecays; + for (const auto& daughters : decayDaughters) { + nDecays.emplace_back(daughters.size(), 0); + } + + int numberOfEventsProcessed{0}; + int numberOfEventsProcessedWithoutInjection{0}; + for (Long64_t i = 0; i < tree->GetEntries(); ++i) { + tree->GetEntry(i); + ++numberOfEventsProcessed; + bool hasInjection{false}; + for (const auto& track : *tracks) { + const auto pdg = track.GetPdgCode(); + const auto it = std::find(injectedPDGs.begin(), injectedPDGs.end(), pdg); + if (it == injectedPDGs.end()) { + continue; + } + const auto index = static_cast(std::distance(injectedPDGs.begin(), it)); + ++nSignal[index]; + if (track.getFirstDaughterTrackId() < 0) { + ++nNotDecayed[index]; + continue; + } + for (int j = track.getFirstDaughterTrackId(); j <= track.getLastDaughterTrackId(); ++j) { + const auto pdgDau = tracks->at(j).GetPdgCode(); + bool foundDau{false}; + for (size_t k = 0; k < decayDaughters[index].size(); ++k) { + if (pdgDau == decayDaughters[index][k]) { + ++nDecays[index][k]; + foundDau = true; + hasInjection = true; + break; + } + } + if (!foundDau) { + std::cerr << "Decay daughter not found: " << pdg << " -> " << pdgDau + << " (mother=" << track.getMotherTrackId() + << ", secondMother=" << track.getSecondMotherTrackId() << ")\n"; + } + } + } + if (!hasInjection) { + ++numberOfEventsProcessedWithoutInjection; + } + } + + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << tree->GetEntries() << "\n"; + for (size_t i = 0; i < injectedPDGs.size(); ++i) { + std::cout << "# Mother\n"; + std::cout << injectedPDGs[i] << " generated: " << nSignal[i] + << ", " << nNotDecayed[i] << " did not decay\n"; + for (size_t j = 0; j < decayDaughters[i].size(); ++j) { + std::cout << "# Daughter " << decayDaughters[i][j] << ": " << nDecays[i][j] << "\n"; + } + } + 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"; + const double ratioOfNormalEvents = numberOfEventsProcessed + ? static_cast(numberOfEventsProcessedWithoutInjection) / + numberOfEventsProcessed + : 0.0; + std::cout << "Fraction without injection: " << ratioOfNormalEvents << "\n"; + const double expectedRatio = static_cast(numberOfGapEvents) / (numberOfGapEvents + 1); + std::cout << "Expected fraction for 1+" << numberOfGapEvents << " pattern: " << expectedRatio << "\n"; + + // Same basic gap sanity check as the referenced O2DPG test. + if (ratioOfNormalEvents > 0.90 || ratioOfNormalEvents < 0.70) { + std::cerr << "The number of injected events is too low or too high\n"; + return 1; + } + return 0; +}