From 7e5749a8d5ed8e7c04e3b3d796cb03be17fa0ac3 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 6 Mar 2026 16:22:36 +0530 Subject: [PATCH 1/7] Add files via upload --- .../resonancelistgun_baryonic_inj.json | 90 +++++++++++++++++++ .../pythia8/generator/resonances_baryonic.cfg | 28 ++++++ 2 files changed, 118 insertions(+) create mode 100644 MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json create mode 100644 MC/config/PWGLF/pythia8/generator/resonances_baryonic.cfg diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json new file mode 100644 index 000000000..b9742c9e8 --- /dev/null +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json @@ -0,0 +1,90 @@ +{ + "Lambda(1520)0" : { + "pdg": 102134, + "n": 5, + "ptMin": 0.0, + "ptMax": 15, + "etaMin": -1.0, + "etaMax": 1.0, + "rapidityMin": -1.0, + "rapidityMax": 1.0, + "genDecayed": true + }, + "anti-Lambda(1520)0" : { + "pdg": -102134, + "n": 5, + "ptMin": 0.0, + "ptMax": 15, + "etaMin": -1.0, + "etaMax": 1.0, + "rapidityMin": -1.0, + "rapidityMax": 1.0, + "genDecayed": true + }, + "Xi(1530)0" : { + "pdg": 3324, + "n": 5, + "ptMin": 0.0, + "ptMax": 15, + "etaMin": -1.0, + "etaMax": 1.0, + "rapidityMin": -1.0, + "rapidityMax": 1.0, + "genDecayed": true + }, + "anti-Xi(1530)0" : { + "pdg": -3324, + "n": 5, + "ptMin": 0.0, + "ptMax": 15, + "etaMin": -1.0, + "etaMax": 1.0, + "rapidityMin": -1.0, + "rapidityMax": 1.0, + "genDecayed": true + }, + "Xi(1820)0" : { + "pdg": 123314, + "n": 5, + "ptMin": 0.0, + "ptMax": 15, + "etaMin": -1.0, + "etaMax": 1.0, + "rapidityMin": -1.0, + "rapidityMax": 1.0, + "genDecayed": true + }, + "Anti-Xi(1820)0" : { + "pdg": -123314, + "n": 5, + "ptMin": 0.0, + "ptMax": 15, + "etaMin": -1.0, + "etaMax": 1.0, + "rapidityMin": -1.0, + "rapidityMax": 1.0, + "genDecayed": true + }, + "Xi(1820)-" : { + "pdg": 123324, + "n": 5, + "ptMin": 0.0, + "ptMax": 15, + "etaMin": -1.0, + "etaMax": 1.0, + "rapidityMin": -1.0, + "rapidityMax": 1.0, + "genDecayed": true + }, + "Xi(1820)+" : { + "pdg": -123324, + "n": 5, + "ptMin": 0.0, + "ptMax": 15, + "etaMin": -1.0, + "etaMax": 1.0, + "rapidityMin": -1.0, + "rapidityMax": 1.0, + "genDecayed": true + } +} diff --git a/MC/config/PWGLF/pythia8/generator/resonances_baryonic.cfg b/MC/config/PWGLF/pythia8/generator/resonances_baryonic.cfg new file mode 100644 index 000000000..0002ccb90 --- /dev/null +++ b/MC/config/PWGLF/pythia8/generator/resonances_baryonic.cfg @@ -0,0 +1,28 @@ +### Define resonance +ProcessLevel:all = off # will not look for the 'process' + +### Lambda1520 +# id::all = name antiName spinType chargeType colType m0 mWidth mMin mMax tau0 +102134:all = Lambda1520 Lambda1520bar 4 0 0 1.51950 0.01560 1.47 1.60 0 +102134:oneChannel = 1 1.000 0 2212 -321 +102134:onMode = off +102134:onIfMatch = 2212 -321 + +### Xi1530 +# id::all = name antiName spinType chargeType colType m0 mWidth mMin mMax tau0 +3324:all = Xi1530 Xi1530bar 4 0 0 1.53180 0.0091 1.50 1.59 0 +3324:oneChannel = 1 1.000 0 3312 211 +3324:onMode = off +3324:onIfMatch = 3312 211 + +### Xi1820 +103324:all = Xi1820 Xi1820bar 4 0 0 1.823 0.024 1.75 1.95 0 +103324:oneChannel = 1 1.000 0 3122 310 +103324:onMode = off +103324:onIfMatch = 3122 310 + +103314:all = Xi1820Minus Xi1820Plus 4 -3 0 1.823 0.024 1.75 1.95 0 +103314:oneChannel = 1 1.000 0 3122 -321 +103314:onMode = off +103314:onIfMatch = 3122 -321 + From 04fd52c618e7a0304357b6be225952b1af97c9c8 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 6 Mar 2026 16:24:45 +0530 Subject: [PATCH 2/7] Added configuration for baryonic resonances --- ...GeneratorLF_ResonancesBaryonic_pp1360_injection.ini | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 MC/config/PWGLF/ini/GeneratorLF_ResonancesBaryonic_pp1360_injection.ini diff --git a/MC/config/PWGLF/ini/GeneratorLF_ResonancesBaryonic_pp1360_injection.ini b/MC/config/PWGLF/ini/GeneratorLF_ResonancesBaryonic_pp1360_injection.ini new file mode 100644 index 000000000..5fb6619ea --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLF_ResonancesBaryonic_pp1360_injection.ini @@ -0,0 +1,10 @@ +[GeneratorExternal] +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_baryonic_inj.json", true, 1, false, false, "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.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_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_baryonic.cfg From 793e9c60097aa7b20b4d74937670c037e8267586 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 6 Mar 2026 16:27:55 +0530 Subject: [PATCH 3/7] test macro --- ...orLF_ResonancesBaryonic_pp1360_injection.C | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLF_ResonancesBaryonic_pp1360_injection.C diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_ResonancesBaryonic_pp1360_injection.C b/MC/config/PWGLF/ini/tests/GeneratorLF_ResonancesBaryonic_pp1360_injection.C new file mode 100644 index 000000000..543626e34 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLF_ResonancesBaryonic_pp1360_injection.C @@ -0,0 +1,150 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + int numberOfInjectedSignalsPerEvent{1}; + int numberOfGapEvents{4}; + int numberOfEventsProcessed{0}; + int numberOfEventsProcessedWithoutInjection{0}; + std::vector injectedPDGs = { + 102134, // Lambda(1520)0 + -102134, // Lambda(1520)0bar + 3324, // Xi(1530)0 + -3324, // Xi(1530)0bar + 103314, // Xi(1820)- + -103314, // Xi(1820)+ + 103324, // Xi(1820)0 + -103324 // Xi(1820)0bar + }; + std::vector> decayDaughters = { + {2212, -321}, // Lambda(1520)0 + {-2212, 321}, // Lambda(1520)0bar + {3312, 211}, // Xi(1530)0 + {-3312, -211}, // Xi(1530)0bar + {3122, -321}, // Xi(1820)- + {-3122, 321}, // 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_injection() { External(); } From 8bd2b48e32ed5fa2cb1d4a03d4038cde95fa0d2d Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 6 Mar 2026 16:31:16 +0530 Subject: [PATCH 4/7] updated PDG for Xi1820 --- .../pythia8/generator/resonancelistgun_baryonic_inj.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json index b9742c9e8..2668a6c54 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json @@ -44,7 +44,7 @@ "genDecayed": true }, "Xi(1820)0" : { - "pdg": 123314, + "pdg": 103324, "n": 5, "ptMin": 0.0, "ptMax": 15, @@ -55,7 +55,7 @@ "genDecayed": true }, "Anti-Xi(1820)0" : { - "pdg": -123314, + "pdg": -103324, "n": 5, "ptMin": 0.0, "ptMax": 15, @@ -66,7 +66,7 @@ "genDecayed": true }, "Xi(1820)-" : { - "pdg": 123324, + "pdg": 103314, "n": 5, "ptMin": 0.0, "ptMax": 15, @@ -77,7 +77,7 @@ "genDecayed": true }, "Xi(1820)+" : { - "pdg": -123324, + "pdg": -103314, "n": 5, "ptMin": 0.0, "ptMax": 15, From 8f4e2ff2086d9912791c02f3681656fab606932c Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Sat, 7 Mar 2026 19:19:42 +0530 Subject: [PATCH 5/7] Update Xi(1820) resonance IDs in GeneratorLF --- .../GeneratorLF_ResonancesBaryonic_pp1360_injection.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_ResonancesBaryonic_pp1360_injection.C b/MC/config/PWGLF/ini/tests/GeneratorLF_ResonancesBaryonic_pp1360_injection.C index 543626e34..7ee3c81c2 100644 --- a/MC/config/PWGLF/ini/tests/GeneratorLF_ResonancesBaryonic_pp1360_injection.C +++ b/MC/config/PWGLF/ini/tests/GeneratorLF_ResonancesBaryonic_pp1360_injection.C @@ -10,10 +10,10 @@ int External() -102134, // Lambda(1520)0bar 3324, // Xi(1530)0 -3324, // Xi(1530)0bar - 103314, // Xi(1820)- - -103314, // Xi(1820)+ - 103324, // Xi(1820)0 - -103324 // Xi(1820)0bar + 123314, // Xi(1820)- + -123314, // Xi(1820)+ + 123324, // Xi(1820)0 + -123324 // Xi(1820)0bar }; std::vector> decayDaughters = { {2212, -321}, // Lambda(1520)0 From a61b6f8a26ae427a96fd545402f866562e8722e0 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Sat, 7 Mar 2026 19:21:11 +0530 Subject: [PATCH 6/7] Update PDG codes for baryonic resonance list --- .../pythia8/generator/resonancelistgun_baryonic_inj.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json index 2668a6c54..60864a9cd 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json @@ -44,7 +44,7 @@ "genDecayed": true }, "Xi(1820)0" : { - "pdg": 103324, + "pdg": 123324, "n": 5, "ptMin": 0.0, "ptMax": 15, @@ -55,7 +55,7 @@ "genDecayed": true }, "Anti-Xi(1820)0" : { - "pdg": -103324, + "pdg": -123324, "n": 5, "ptMin": 0.0, "ptMax": 15, @@ -66,7 +66,7 @@ "genDecayed": true }, "Xi(1820)-" : { - "pdg": 103314, + "pdg": 123314, "n": 5, "ptMin": 0.0, "ptMax": 15, @@ -77,7 +77,7 @@ "genDecayed": true }, "Xi(1820)+" : { - "pdg": -103314, + "pdg": -123314, "n": 5, "ptMin": 0.0, "ptMax": 15, From 0fe5edec49199669100c34d701b3eb74c4e7ce04 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Sat, 7 Mar 2026 19:22:08 +0530 Subject: [PATCH 7/7] Update Xi1820 resonance configuration IDs --- .../pythia8/generator/resonances_baryonic.cfg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/MC/config/PWGLF/pythia8/generator/resonances_baryonic.cfg b/MC/config/PWGLF/pythia8/generator/resonances_baryonic.cfg index 0002ccb90..e05459994 100644 --- a/MC/config/PWGLF/pythia8/generator/resonances_baryonic.cfg +++ b/MC/config/PWGLF/pythia8/generator/resonances_baryonic.cfg @@ -16,13 +16,13 @@ ProcessLevel:all = off # will not look for the 'process' 3324:onIfMatch = 3312 211 ### Xi1820 -103324:all = Xi1820 Xi1820bar 4 0 0 1.823 0.024 1.75 1.95 0 -103324:oneChannel = 1 1.000 0 3122 310 -103324:onMode = off -103324:onIfMatch = 3122 310 +123324:all = Xi1820 Xi1820bar 4 0 0 1.823 0.024 1.75 1.95 0 +123324:oneChannel = 1 1.000 0 3122 310 +123324:onMode = off +123324:onIfMatch = 3122 310 -103314:all = Xi1820Minus Xi1820Plus 4 -3 0 1.823 0.024 1.75 1.95 0 -103314:oneChannel = 1 1.000 0 3122 -321 -103314:onMode = off -103314:onIfMatch = 3122 -321 +123314:all = Xi1820Minus Xi1820Plus 4 -3 0 1.823 0.024 1.75 1.95 0 +123314:oneChannel = 1 1.000 0 3122 -321 +123314:onMode = off +123314:onIfMatch = 3122 -321