From d66d31ce1d385e201e3db2f535246bbfd97fe822 Mon Sep 17 00:00:00 2001 From: ldellost Date: Mon, 16 Nov 2026 16:40:32 +0000 Subject: [PATCH 1/6] Lstar ini files for gap trigger 3 and 4 --- .../PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap3.ini | 6 ++++++ .../PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap4.ini | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap3.ini create mode 100644 MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap4.ini diff --git a/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap3.ini b/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap3.ini new file mode 100644 index 000000000..b69b956c1 --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap3.ini @@ -0,0 +1,6 @@ +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_Lstar.C +funcName=generator_Lstar(3) + +[GeneratorPythia8] +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_forceLStar.cfg \ No newline at end of file diff --git a/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap4.ini b/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap4.ini new file mode 100644 index 000000000..d2d6f62fa --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap4.ini @@ -0,0 +1,6 @@ +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_Lstar.C +funcName=generator_Lstar(4) + +[GeneratorPythia8] +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_forceLStar.cfg \ No newline at end of file From 5b5dccfd2559858ca6d0edb60a6784193d657a2e Mon Sep 17 00:00:00 2001 From: ldellost Date: Mon, 16 Nov 2026 16:48:48 +0000 Subject: [PATCH 2/6] test files --- .../GeneratorLF_Strangeness_ppLStar_gap3.C | 95 +++++++++++++++++++ .../GeneratorLF_Strangeness_ppLStar_gap4.C | 95 +++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap3.C create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap4.C diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap3.C b/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap3.C new file mode 100644 index 000000000..478e29ff4 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap3.C @@ -0,0 +1,95 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + const int pdgMother = 3124; // Lambda(1520)0 + const int triggerRatio = 3; // must match generator_Lstar(N) in the .ini file + + 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); + + const auto nEvents = tree->GetEntries(); + int nMother = 0; + int nNotDecayed = 0; + int nBadDecay = 0; // mothers not decaying exactly to Lambda + gamma + int nEventsWrongCount = 0; // events with the wrong number of injected mothers + int nGapEvents = 0; // events expected to contain the injected mother + + for (int i = 0; i < nEvents; i++) { + tree->GetEntry(i); + + // the generator injects in every triggerRatio-th event (it counts events from 1) + const bool isGapEvent = ((i + 1) % triggerRatio == 0); + if (isGapEvent) { + nGapEvents++; + } + + int nInEvent = 0; + for (auto &track : *tracks) { + const int pdg = track.GetPdgCode(); + if (std::abs(pdg) != pdgMother) { + continue; + } + nInEvent++; + nMother++; + + if (track.getFirstDaughterTrackId() < 0) { + nNotDecayed++; + continue; + } + const int expectedLambda = (pdg > 0) ? 3122 : -3122; + int nLambda = 0, nGamma = 0, nDau = 0; + for (int j = track.getFirstDaughterTrackId(); j <= track.getLastDaughterTrackId(); ++j) { + const int pdgDau = tracks->at(j).GetPdgCode(); + nDau++; + if (pdgDau == expectedLambda) nLambda++; + if (pdgDau == 22) nGamma++; + } + if (nDau != 2 || nLambda != 1 || nGamma != 1) { + nBadDecay++; + std::cerr << "Unexpected decay of " << pdg << " (" << nDau << " daughters)\n"; + } + } + + const int nExpected = isGapEvent ? 1 : 0; + if (nInEvent != nExpected) { + nEventsWrongCount++; + std::cerr << "Event " << i << ": found " << nInEvent + << " Lambda(1520), expected " << nExpected << "\n"; + } + } + + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + std::cout << "# Gap-trigger events: " << nGapEvents << " (ratio " << triggerRatio << ")\n"; + std::cout << "# Lambda(1520) + anti: " << nMother << "\n"; + std::cout << "# not decayed: " << nNotDecayed << "\n"; + std::cout << "# unexpected decays: " << nBadDecay << "\n"; + std::cout << "# events wrong count: " << nEventsWrongCount << "\n"; + std::cout << "--------------------------------\n"; + + if (nMother != nGapEvents) { + std::cerr << "Expected one injected Lambda(1520) per gap-trigger event\n"; + return 1; + } + if (nEventsWrongCount > 0) { + std::cerr << "Lambda(1520) must appear in every gap-triggered events\n"; + return 1; + } + if (nNotDecayed > 0 || nBadDecay > 0) { + std::cerr << "Lambda(1520) must always decay to Lambda + gamma\n"; + return 1; + } + return 0; +} + +void GeneratorLF_Strangeness_ppLStar() { External(); } \ No newline at end of file diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap4.C b/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap4.C new file mode 100644 index 000000000..f214baed9 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap4.C @@ -0,0 +1,95 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + const int pdgMother = 3124; // Lambda(1520)0 + const int triggerRatio = 4; // must match generator_Lstar(N) in the .ini file + + 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); + + const auto nEvents = tree->GetEntries(); + int nMother = 0; + int nNotDecayed = 0; + int nBadDecay = 0; // mothers not decaying exactly to Lambda + gamma + int nEventsWrongCount = 0; // events with the wrong number of injected mothers + int nGapEvents = 0; // events expected to contain the injected mother + + for (int i = 0; i < nEvents; i++) { + tree->GetEntry(i); + + // the generator injects in every triggerRatio-th event (it counts events from 1) + const bool isGapEvent = ((i + 1) % triggerRatio == 0); + if (isGapEvent) { + nGapEvents++; + } + + int nInEvent = 0; + for (auto &track : *tracks) { + const int pdg = track.GetPdgCode(); + if (std::abs(pdg) != pdgMother) { + continue; + } + nInEvent++; + nMother++; + + if (track.getFirstDaughterTrackId() < 0) { + nNotDecayed++; + continue; + } + const int expectedLambda = (pdg > 0) ? 3122 : -3122; + int nLambda = 0, nGamma = 0, nDau = 0; + for (int j = track.getFirstDaughterTrackId(); j <= track.getLastDaughterTrackId(); ++j) { + const int pdgDau = tracks->at(j).GetPdgCode(); + nDau++; + if (pdgDau == expectedLambda) nLambda++; + if (pdgDau == 22) nGamma++; + } + if (nDau != 2 || nLambda != 1 || nGamma != 1) { + nBadDecay++; + std::cerr << "Unexpected decay of " << pdg << " (" << nDau << " daughters)\n"; + } + } + + const int nExpected = isGapEvent ? 1 : 0; + if (nInEvent != nExpected) { + nEventsWrongCount++; + std::cerr << "Event " << i << ": found " << nInEvent + << " Lambda(1520), expected " << nExpected << "\n"; + } + } + + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + std::cout << "# Gap-trigger events: " << nGapEvents << " (ratio " << triggerRatio << ")\n"; + std::cout << "# Lambda(1520) + anti: " << nMother << "\n"; + std::cout << "# not decayed: " << nNotDecayed << "\n"; + std::cout << "# unexpected decays: " << nBadDecay << "\n"; + std::cout << "# events wrong count: " << nEventsWrongCount << "\n"; + std::cout << "--------------------------------\n"; + + if (nMother != nGapEvents) { + std::cerr << "Expected one injected Lambda(1520) per gap-trigger event\n"; + return 1; + } + if (nEventsWrongCount > 0) { + std::cerr << "Lambda(1520) must appear in every gap-triggered events\n"; + return 1; + } + if (nNotDecayed > 0 || nBadDecay > 0) { + std::cerr << "Lambda(1520) must always decay to Lambda + gamma\n"; + return 1; + } + return 0; +} + +void GeneratorLF_Strangeness_ppLStar() { External(); } \ No newline at end of file From 157e4de408256e808ac0a5e5de3b800e0c625c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 16 Nov 2026 17:52:41 +0100 Subject: [PATCH 3/6] Delete MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap3.C --- .../GeneratorLF_Strangeness_ppLStar_gap3.C | 95 ------------------- 1 file changed, 95 deletions(-) delete mode 100644 MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap3.C diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap3.C b/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap3.C deleted file mode 100644 index 478e29ff4..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap3.C +++ /dev/null @@ -1,95 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - const int pdgMother = 3124; // Lambda(1520)0 - const int triggerRatio = 3; // must match generator_Lstar(N) in the .ini file - - 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); - - const auto nEvents = tree->GetEntries(); - int nMother = 0; - int nNotDecayed = 0; - int nBadDecay = 0; // mothers not decaying exactly to Lambda + gamma - int nEventsWrongCount = 0; // events with the wrong number of injected mothers - int nGapEvents = 0; // events expected to contain the injected mother - - for (int i = 0; i < nEvents; i++) { - tree->GetEntry(i); - - // the generator injects in every triggerRatio-th event (it counts events from 1) - const bool isGapEvent = ((i + 1) % triggerRatio == 0); - if (isGapEvent) { - nGapEvents++; - } - - int nInEvent = 0; - for (auto &track : *tracks) { - const int pdg = track.GetPdgCode(); - if (std::abs(pdg) != pdgMother) { - continue; - } - nInEvent++; - nMother++; - - if (track.getFirstDaughterTrackId() < 0) { - nNotDecayed++; - continue; - } - const int expectedLambda = (pdg > 0) ? 3122 : -3122; - int nLambda = 0, nGamma = 0, nDau = 0; - for (int j = track.getFirstDaughterTrackId(); j <= track.getLastDaughterTrackId(); ++j) { - const int pdgDau = tracks->at(j).GetPdgCode(); - nDau++; - if (pdgDau == expectedLambda) nLambda++; - if (pdgDau == 22) nGamma++; - } - if (nDau != 2 || nLambda != 1 || nGamma != 1) { - nBadDecay++; - std::cerr << "Unexpected decay of " << pdg << " (" << nDau << " daughters)\n"; - } - } - - const int nExpected = isGapEvent ? 1 : 0; - if (nInEvent != nExpected) { - nEventsWrongCount++; - std::cerr << "Event " << i << ": found " << nInEvent - << " Lambda(1520), expected " << nExpected << "\n"; - } - } - - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - std::cout << "# Gap-trigger events: " << nGapEvents << " (ratio " << triggerRatio << ")\n"; - std::cout << "# Lambda(1520) + anti: " << nMother << "\n"; - std::cout << "# not decayed: " << nNotDecayed << "\n"; - std::cout << "# unexpected decays: " << nBadDecay << "\n"; - std::cout << "# events wrong count: " << nEventsWrongCount << "\n"; - std::cout << "--------------------------------\n"; - - if (nMother != nGapEvents) { - std::cerr << "Expected one injected Lambda(1520) per gap-trigger event\n"; - return 1; - } - if (nEventsWrongCount > 0) { - std::cerr << "Lambda(1520) must appear in every gap-triggered events\n"; - return 1; - } - if (nNotDecayed > 0 || nBadDecay > 0) { - std::cerr << "Lambda(1520) must always decay to Lambda + gamma\n"; - return 1; - } - return 0; -} - -void GeneratorLF_Strangeness_ppLStar() { External(); } \ No newline at end of file From 7485a1f8098438e230facf7a6f9ee295be9b9fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 16 Nov 2026 17:53:01 +0100 Subject: [PATCH 4/6] Delete MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap4.C --- .../GeneratorLF_Strangeness_ppLStar_gap4.C | 95 ------------------- 1 file changed, 95 deletions(-) delete mode 100644 MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap4.C diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap4.C b/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap4.C deleted file mode 100644 index f214baed9..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLF_Strangeness_ppLStar_gap4.C +++ /dev/null @@ -1,95 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - const int pdgMother = 3124; // Lambda(1520)0 - const int triggerRatio = 4; // must match generator_Lstar(N) in the .ini file - - 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); - - const auto nEvents = tree->GetEntries(); - int nMother = 0; - int nNotDecayed = 0; - int nBadDecay = 0; // mothers not decaying exactly to Lambda + gamma - int nEventsWrongCount = 0; // events with the wrong number of injected mothers - int nGapEvents = 0; // events expected to contain the injected mother - - for (int i = 0; i < nEvents; i++) { - tree->GetEntry(i); - - // the generator injects in every triggerRatio-th event (it counts events from 1) - const bool isGapEvent = ((i + 1) % triggerRatio == 0); - if (isGapEvent) { - nGapEvents++; - } - - int nInEvent = 0; - for (auto &track : *tracks) { - const int pdg = track.GetPdgCode(); - if (std::abs(pdg) != pdgMother) { - continue; - } - nInEvent++; - nMother++; - - if (track.getFirstDaughterTrackId() < 0) { - nNotDecayed++; - continue; - } - const int expectedLambda = (pdg > 0) ? 3122 : -3122; - int nLambda = 0, nGamma = 0, nDau = 0; - for (int j = track.getFirstDaughterTrackId(); j <= track.getLastDaughterTrackId(); ++j) { - const int pdgDau = tracks->at(j).GetPdgCode(); - nDau++; - if (pdgDau == expectedLambda) nLambda++; - if (pdgDau == 22) nGamma++; - } - if (nDau != 2 || nLambda != 1 || nGamma != 1) { - nBadDecay++; - std::cerr << "Unexpected decay of " << pdg << " (" << nDau << " daughters)\n"; - } - } - - const int nExpected = isGapEvent ? 1 : 0; - if (nInEvent != nExpected) { - nEventsWrongCount++; - std::cerr << "Event " << i << ": found " << nInEvent - << " Lambda(1520), expected " << nExpected << "\n"; - } - } - - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - std::cout << "# Gap-trigger events: " << nGapEvents << " (ratio " << triggerRatio << ")\n"; - std::cout << "# Lambda(1520) + anti: " << nMother << "\n"; - std::cout << "# not decayed: " << nNotDecayed << "\n"; - std::cout << "# unexpected decays: " << nBadDecay << "\n"; - std::cout << "# events wrong count: " << nEventsWrongCount << "\n"; - std::cout << "--------------------------------\n"; - - if (nMother != nGapEvents) { - std::cerr << "Expected one injected Lambda(1520) per gap-trigger event\n"; - return 1; - } - if (nEventsWrongCount > 0) { - std::cerr << "Lambda(1520) must appear in every gap-triggered events\n"; - return 1; - } - if (nNotDecayed > 0 || nBadDecay > 0) { - std::cerr << "Lambda(1520) must always decay to Lambda + gamma\n"; - return 1; - } - return 0; -} - -void GeneratorLF_Strangeness_ppLStar() { External(); } \ No newline at end of file From a61cf2f5f256f08870062afa21efcf37025d8384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 16 Nov 2026 17:54:17 +0100 Subject: [PATCH 5/6] Update GeneratorLF_Strangeness_ppLStar_gap3.ini --- MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap3.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap3.ini b/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap3.ini index b69b956c1..d96b90e48 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap3.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap3.ini @@ -1,6 +1,7 @@ +#---> GeneratorLF_Strangeness_ppLStar [GeneratorExternal] fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_Lstar.C funcName=generator_Lstar(3) [GeneratorPythia8] -config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_forceLStar.cfg \ No newline at end of file +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_forceLStar.cfg From c4b086e67928253b65ce870e0fd03bbbc7f0c5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Mon, 16 Nov 2026 17:54:33 +0100 Subject: [PATCH 6/6] Add comment header to GeneratorLF_Strangeness_ini file --- MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap4.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap4.ini b/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap4.ini index d2d6f62fa..3f57505d4 100644 --- a/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap4.ini +++ b/MC/config/PWGLF/ini/GeneratorLF_Strangeness_ppLStar_gap4.ini @@ -1,6 +1,7 @@ +#---> GeneratorLF_Strangeness_ppLStar [GeneratorExternal] fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_Lstar.C funcName=generator_Lstar(4) [GeneratorPythia8] -config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_forceLStar.cfg \ No newline at end of file +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_forceLStar.cfg