From bc2326e88f5da7dc00f60cb3f5fbfe7931f9d8df Mon Sep 17 00:00:00 2001 From: Sara Pucillo Date: Tue, 13 Oct 2026 17:22:43 +0200 Subject: [PATCH 1/6] Add ini files for gap-trigger scan --- ...> GeneratorLFCascadesInJets_pp536TeV_gap2.ini} | 0 .../GeneratorLFCascadesInJets_pp536TeV_gap3.ini | 15 +++++++++++++++ .../GeneratorLFCascadesInJets_pp536TeV_gap4.ini | 15 +++++++++++++++ .../GeneratorLFCascadesInJets_pp536TeV_gap5.ini | 15 +++++++++++++++ ...ini => GeneratorLFV0sInJets_pp536TeV_gap2.ini} | 0 .../ini/GeneratorLFV0sInJets_pp536TeV_gap3.ini | 15 +++++++++++++++ .../ini/GeneratorLFV0sInJets_pp536TeV_gap4.ini | 15 +++++++++++++++ .../ini/GeneratorLFV0sInJets_pp536TeV_gap5.ini | 15 +++++++++++++++ 8 files changed, 90 insertions(+) rename MC/config/PWGLF/ini/{GeneratorLFCascadesInJets_pp536TeV.ini => GeneratorLFCascadesInJets_pp536TeV_gap2.ini} (100%) create mode 100644 MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap3.ini create mode 100644 MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap4.ini create mode 100644 MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap5.ini rename MC/config/PWGLF/ini/{GeneratorLFV0sInJets_pp536TeV.ini => GeneratorLFV0sInJets_pp536TeV_gap2.ini} (100%) create mode 100644 MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap3.ini create mode 100644 MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap4.ini create mode 100644 MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap5.ini diff --git a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV.ini b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini similarity index 100% rename from MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV.ini rename to MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini diff --git a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap3.ini b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap3.ini new file mode 100644 index 000000000..6dc106166 --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap3.ini @@ -0,0 +1,15 @@ +### Cascades in jets - pp collisions at 5.36 TeV + +[GeneratorExternal] +# Generate jet-biased Pythia8 events and require the presence of one cascade species +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C +funcName=generateLFTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/strangeparticlelist.gun", 3) + +[GeneratorPythia8] +# Underlying pp event: HardQCD production with jet-pT bias and rope hadronization +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_jet_ropes_536tev.cfg +includePartonEvent=false + +[DecayerPythia8] +# Standard Pythia8 decay configuration +config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap4.ini b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap4.ini new file mode 100644 index 000000000..8b9c48b54 --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap4.ini @@ -0,0 +1,15 @@ +### Cascades in jets - pp collisions at 5.36 TeV + +[GeneratorExternal] +# Generate jet-biased Pythia8 events and require the presence of one cascade species +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C +funcName=generateLFTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/strangeparticlelist.gun", 4) + +[GeneratorPythia8] +# Underlying pp event: HardQCD production with jet-pT bias and rope hadronization +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_jet_ropes_536tev.cfg +includePartonEvent=false + +[DecayerPythia8] +# Standard Pythia8 decay configuration +config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap5.ini b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap5.ini new file mode 100644 index 000000000..7456c2900 --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap5.ini @@ -0,0 +1,15 @@ +### Cascades in jets - pp collisions at 5.36 TeV + +[GeneratorExternal] +# Generate jet-biased Pythia8 events and require the presence of one cascade species +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C +funcName=generateLFTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/strangeparticlelist.gun", 5) + +[GeneratorPythia8] +# Underlying pp event: HardQCD production with jet-pT bias and rope hadronization +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_jet_ropes_536tev.cfg +includePartonEvent=false + +[DecayerPythia8] +# Standard Pythia8 decay configuration +config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV.ini b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini similarity index 100% rename from MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV.ini rename to MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini diff --git a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap3.ini b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap3.ini new file mode 100644 index 000000000..9bf37db66 --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap3.ini @@ -0,0 +1,15 @@ +### V0s in jets - pp collisions at 5.36 TeV + +[GeneratorExternal] +# Generate jet-biased Pythia8 events and require the presence of one V0 particle +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C +funcName=generateLFTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/v0particlelist.gun", 3) + +[GeneratorPythia8] +# Underlying pp event: HardQCD production with jet-pT bias and rope hadronization +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_jet_ropes_536tev.cfg +includePartonEvent=false + +[DecayerPythia8] +# Standard Pythia8 decay configuration +config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap4.ini b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap4.ini new file mode 100644 index 000000000..ff694521b --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap4.ini @@ -0,0 +1,15 @@ +### V0s in jets - pp collisions at 5.36 TeV + +[GeneratorExternal] +# Generate jet-biased Pythia8 events and require the presence of one V0 particle +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C +funcName=generateLFTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/v0particlelist.gun", 4) + +[GeneratorPythia8] +# Underlying pp event: HardQCD production with jet-pT bias and rope hadronization +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_jet_ropes_536tev.cfg +includePartonEvent=false + +[DecayerPythia8] +# Standard Pythia8 decay configuration +config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg diff --git a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap5.ini b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap5.ini new file mode 100644 index 000000000..250619e91 --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap5.ini @@ -0,0 +1,15 @@ +### V0s in jets - pp collisions at 5.36 TeV + +[GeneratorExternal] +# Generate jet-biased Pythia8 events and require the presence of one V0 particle +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C +funcName=generateLFTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/v0particlelist.gun", 5) + +[GeneratorPythia8] +# Underlying pp event: HardQCD production with jet-pT bias and rope hadronization +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_jet_ropes_536tev.cfg +includePartonEvent=false + +[DecayerPythia8] +# Standard Pythia8 decay configuration +config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg From 2bbbb6464facd7924e58b6ee126082f5b0cd72e7 Mon Sep 17 00:00:00 2001 From: Sara Pucillo Date: Wed, 14 Oct 2026 11:47:05 +0200 Subject: [PATCH 2/6] Add generator tests for gap-trigger scan --- ...GeneratorLFCascadesInJets_pp536TeV_gap2.C} | 0 .../GeneratorLFCascadesInJets_pp536TeV_gap3.C | 58 +++++++++++++++++++ .../GeneratorLFCascadesInJets_pp536TeV_gap4.C | 58 +++++++++++++++++++ .../GeneratorLFCascadesInJets_pp536TeV_gap5.C | 58 +++++++++++++++++++ ...C => GeneratorLFV0sInJets_pp536TeV_gap2.C} | 0 .../GeneratorLFV0sInJets_pp536TeV_gap3.C | 57 ++++++++++++++++++ .../GeneratorLFV0sInJets_pp536TeV_gap4.C | 57 ++++++++++++++++++ .../GeneratorLFV0sInJets_pp536TeV_gap5.C | 57 ++++++++++++++++++ 8 files changed, 345 insertions(+) rename MC/config/PWGLF/ini/tests/{GeneratorLFCascadesInJets_pp536TeV.C => GeneratorLFCascadesInJets_pp536TeV_gap2.C} (100%) create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap3.C create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap4.C create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap5.C rename MC/config/PWGLF/ini/tests/{GeneratorLFV0sInJets_pp536TeV.C => GeneratorLFV0sInJets_pp536TeV_gap2.C} (100%) create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap3.C create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap4.C create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap5.C diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV.C b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap2.C similarity index 100% rename from MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV.C rename to MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap2.C diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap3.C b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap3.C new file mode 100644 index 000000000..49ba5d4e2 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap3.C @@ -0,0 +1,58 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + int numberOfInjectedSignalsPerEvent{1}; + std::vector injectedPDGs = { + 3334, + -3334, + 3312, + -3312}; + + 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); + } + + auto nEvents = tree->GetEntries(); + for (int i = 0; i < nEvents; i++) { + 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]++; + } + } + } + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + for (int i = 0; i < nInjection; i++) { + std::cout << "# Injected nuclei \n"; + std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; + if (nSignal[i] == 0) { + std::cerr << "No generated: " << injectedPDGs[i] << "\n"; + return 1; // At least one of the injected particles should be generated + } + } + return 0; +} \ No newline at end of file diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap4.C b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap4.C new file mode 100644 index 000000000..49ba5d4e2 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap4.C @@ -0,0 +1,58 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + int numberOfInjectedSignalsPerEvent{1}; + std::vector injectedPDGs = { + 3334, + -3334, + 3312, + -3312}; + + 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); + } + + auto nEvents = tree->GetEntries(); + for (int i = 0; i < nEvents; i++) { + 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]++; + } + } + } + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + for (int i = 0; i < nInjection; i++) { + std::cout << "# Injected nuclei \n"; + std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; + if (nSignal[i] == 0) { + std::cerr << "No generated: " << injectedPDGs[i] << "\n"; + return 1; // At least one of the injected particles should be generated + } + } + return 0; +} \ No newline at end of file diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap5.C b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap5.C new file mode 100644 index 000000000..49ba5d4e2 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap5.C @@ -0,0 +1,58 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + int numberOfInjectedSignalsPerEvent{1}; + std::vector injectedPDGs = { + 3334, + -3334, + 3312, + -3312}; + + 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); + } + + auto nEvents = tree->GetEntries(); + for (int i = 0; i < nEvents; i++) { + 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]++; + } + } + } + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + for (int i = 0; i < nInjection; i++) { + std::cout << "# Injected nuclei \n"; + std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; + if (nSignal[i] == 0) { + std::cerr << "No generated: " << injectedPDGs[i] << "\n"; + return 1; // At least one of the injected particles should be generated + } + } + return 0; +} \ No newline at end of file diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV.C b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap2.C similarity index 100% rename from MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV.C rename to MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap2.C diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap3.C b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap3.C new file mode 100644 index 000000000..4fec0a0f0 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap3.C @@ -0,0 +1,57 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + int numberOfInjectedSignalsPerEvent{1}; + std::vector injectedPDGs = { + 310, // K0S + 3122, // Lambda + -3122 // Anti-Lambda + }; + 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); + } + + auto nEvents = tree->GetEntries(); + for (int i = 0; i < nEvents; i++) { + 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]++; + } + } + } + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + for (int i = 0; i < nInjection; i++) { + std::cout << "# Injected nuclei \n"; + std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; + if (nSignal[i] == 0) { + std::cerr << "No generated: " << injectedPDGs[i] << "\n"; + return 1; // At least one of the injected particles should be generated + } + } + return 0; +} diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap4.C b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap4.C new file mode 100644 index 000000000..4fec0a0f0 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap4.C @@ -0,0 +1,57 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + int numberOfInjectedSignalsPerEvent{1}; + std::vector injectedPDGs = { + 310, // K0S + 3122, // Lambda + -3122 // Anti-Lambda + }; + 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); + } + + auto nEvents = tree->GetEntries(); + for (int i = 0; i < nEvents; i++) { + 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]++; + } + } + } + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + for (int i = 0; i < nInjection; i++) { + std::cout << "# Injected nuclei \n"; + std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; + if (nSignal[i] == 0) { + std::cerr << "No generated: " << injectedPDGs[i] << "\n"; + return 1; // At least one of the injected particles should be generated + } + } + return 0; +} diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap5.C b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap5.C new file mode 100644 index 000000000..4fec0a0f0 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap5.C @@ -0,0 +1,57 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + int numberOfInjectedSignalsPerEvent{1}; + std::vector injectedPDGs = { + 310, // K0S + 3122, // Lambda + -3122 // Anti-Lambda + }; + 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); + } + + auto nEvents = tree->GetEntries(); + for (int i = 0; i < nEvents; i++) { + 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]++; + } + } + } + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + for (int i = 0; i < nInjection; i++) { + std::cout << "# Injected nuclei \n"; + std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; + if (nSignal[i] == 0) { + std::cerr << "No generated: " << injectedPDGs[i] << "\n"; + return 1; // At least one of the injected particles should be generated + } + } + return 0; +} From f67b8083a4f10e91d53ec28dd6be35efcbd3cb8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Thu, 15 Oct 2026 09:26:18 +0200 Subject: [PATCH 3/6] Renamed files --- ...eneratorLFCascadesInJets_pp536TeV_gap2.ini | 1 + ...eneratorLFCascadesInJets_pp536TeV_gap3.ini | 1 + ...eneratorLFCascadesInJets_pp536TeV_gap4.ini | 1 + ...eneratorLFCascadesInJets_pp536TeV_gap5.ini | 1 + .../GeneratorLFV0sInJets_pp536TeV_gap2.ini | 1 + .../GeneratorLFV0sInJets_pp536TeV_gap3.ini | 1 + .../GeneratorLFV0sInJets_pp536TeV_gap4.ini | 1 + .../GeneratorLFV0sInJets_pp536TeV_gap5.ini | 1 + ...C => GeneratorLFCascadesInJets_pp536TeV.C} | 0 .../GeneratorLFCascadesInJets_pp536TeV_gap3.C | 58 ------------------- .../GeneratorLFCascadesInJets_pp536TeV_gap4.C | 58 ------------------- .../GeneratorLFCascadesInJets_pp536TeV_gap5.C | 58 ------------------- ...gap2.C => GeneratorLFV0sInJets_pp536TeV.C} | 0 .../GeneratorLFV0sInJets_pp536TeV_gap3.C | 57 ------------------ .../GeneratorLFV0sInJets_pp536TeV_gap4.C | 57 ------------------ .../GeneratorLFV0sInJets_pp536TeV_gap5.C | 57 ------------------ 16 files changed, 8 insertions(+), 345 deletions(-) rename MC/config/PWGLF/ini/tests/{GeneratorLFCascadesInJets_pp536TeV_gap2.C => GeneratorLFCascadesInJets_pp536TeV.C} (100%) delete mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap3.C delete mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap4.C delete mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap5.C rename MC/config/PWGLF/ini/tests/{GeneratorLFV0sInJets_pp536TeV_gap2.C => GeneratorLFV0sInJets_pp536TeV.C} (100%) delete mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap3.C delete mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap4.C delete mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap5.C diff --git a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini index c24165d49..3ac0ae5c6 100644 --- a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini +++ b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini @@ -1,3 +1,4 @@ +#---> GeneratorLFCascadesInJets_pp536TeV ### Cascades in jets - pp collisions at 5.36 TeV [GeneratorExternal] diff --git a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap3.ini b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap3.ini index 6dc106166..dbd1d8f33 100644 --- a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap3.ini +++ b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap3.ini @@ -1,3 +1,4 @@ +#---> GeneratorLFCascadesInJets_pp536TeV ### Cascades in jets - pp collisions at 5.36 TeV [GeneratorExternal] diff --git a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap4.ini b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap4.ini index 8b9c48b54..0554bb10a 100644 --- a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap4.ini +++ b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap4.ini @@ -1,3 +1,4 @@ +#---> GeneratorLFCascadesInJets_pp536TeV ### Cascades in jets - pp collisions at 5.36 TeV [GeneratorExternal] diff --git a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap5.ini b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap5.ini index 7456c2900..b5672f10b 100644 --- a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap5.ini +++ b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap5.ini @@ -1,3 +1,4 @@ +#---> GeneratorLFCascadesInJets_pp536TeV ### Cascades in jets - pp collisions at 5.36 TeV [GeneratorExternal] diff --git a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini index ba7f9fbb0..6aeeb19c6 100644 --- a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini +++ b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini @@ -1,3 +1,4 @@ +#---> GeneratorLFCascadesInJets_pp536TeV ### V0s in jets - pp collisions at 5.36 TeV [GeneratorExternal] diff --git a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap3.ini b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap3.ini index 9bf37db66..15550b855 100644 --- a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap3.ini +++ b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap3.ini @@ -1,3 +1,4 @@ +#---> GeneratorLFV0sInJets_pp536TeV ### V0s in jets - pp collisions at 5.36 TeV [GeneratorExternal] diff --git a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap4.ini b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap4.ini index ff694521b..88766bf6b 100644 --- a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap4.ini +++ b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap4.ini @@ -1,3 +1,4 @@ +#---> GeneratorLFV0sInJets_pp536TeV ### V0s in jets - pp collisions at 5.36 TeV [GeneratorExternal] diff --git a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap5.ini b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap5.ini index 250619e91..ef89de2c7 100644 --- a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap5.ini +++ b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap5.ini @@ -1,3 +1,4 @@ +#---> GeneratorLFV0sInJets_pp536TeV ### V0s in jets - pp collisions at 5.36 TeV [GeneratorExternal] diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap2.C b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV.C similarity index 100% rename from MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap2.C rename to MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV.C diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap3.C b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap3.C deleted file mode 100644 index 49ba5d4e2..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap3.C +++ /dev/null @@ -1,58 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - int numberOfInjectedSignalsPerEvent{1}; - std::vector injectedPDGs = { - 3334, - -3334, - 3312, - -3312}; - - 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); - } - - auto nEvents = tree->GetEntries(); - for (int i = 0; i < nEvents; i++) { - 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]++; - } - } - } - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - for (int i = 0; i < nInjection; i++) { - std::cout << "# Injected nuclei \n"; - std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; - if (nSignal[i] == 0) { - std::cerr << "No generated: " << injectedPDGs[i] << "\n"; - return 1; // At least one of the injected particles should be generated - } - } - return 0; -} \ No newline at end of file diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap4.C b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap4.C deleted file mode 100644 index 49ba5d4e2..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap4.C +++ /dev/null @@ -1,58 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - int numberOfInjectedSignalsPerEvent{1}; - std::vector injectedPDGs = { - 3334, - -3334, - 3312, - -3312}; - - 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); - } - - auto nEvents = tree->GetEntries(); - for (int i = 0; i < nEvents; i++) { - 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]++; - } - } - } - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - for (int i = 0; i < nInjection; i++) { - std::cout << "# Injected nuclei \n"; - std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; - if (nSignal[i] == 0) { - std::cerr << "No generated: " << injectedPDGs[i] << "\n"; - return 1; // At least one of the injected particles should be generated - } - } - return 0; -} \ No newline at end of file diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap5.C b/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap5.C deleted file mode 100644 index 49ba5d4e2..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLFCascadesInJets_pp536TeV_gap5.C +++ /dev/null @@ -1,58 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - int numberOfInjectedSignalsPerEvent{1}; - std::vector injectedPDGs = { - 3334, - -3334, - 3312, - -3312}; - - 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); - } - - auto nEvents = tree->GetEntries(); - for (int i = 0; i < nEvents; i++) { - 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]++; - } - } - } - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - for (int i = 0; i < nInjection; i++) { - std::cout << "# Injected nuclei \n"; - std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; - if (nSignal[i] == 0) { - std::cerr << "No generated: " << injectedPDGs[i] << "\n"; - return 1; // At least one of the injected particles should be generated - } - } - return 0; -} \ No newline at end of file diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap2.C b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV.C similarity index 100% rename from MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap2.C rename to MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV.C diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap3.C b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap3.C deleted file mode 100644 index 4fec0a0f0..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap3.C +++ /dev/null @@ -1,57 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - int numberOfInjectedSignalsPerEvent{1}; - std::vector injectedPDGs = { - 310, // K0S - 3122, // Lambda - -3122 // Anti-Lambda - }; - 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); - } - - auto nEvents = tree->GetEntries(); - for (int i = 0; i < nEvents; i++) { - 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]++; - } - } - } - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - for (int i = 0; i < nInjection; i++) { - std::cout << "# Injected nuclei \n"; - std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; - if (nSignal[i] == 0) { - std::cerr << "No generated: " << injectedPDGs[i] << "\n"; - return 1; // At least one of the injected particles should be generated - } - } - return 0; -} diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap4.C b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap4.C deleted file mode 100644 index 4fec0a0f0..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap4.C +++ /dev/null @@ -1,57 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - int numberOfInjectedSignalsPerEvent{1}; - std::vector injectedPDGs = { - 310, // K0S - 3122, // Lambda - -3122 // Anti-Lambda - }; - 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); - } - - auto nEvents = tree->GetEntries(); - for (int i = 0; i < nEvents; i++) { - 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]++; - } - } - } - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - for (int i = 0; i < nInjection; i++) { - std::cout << "# Injected nuclei \n"; - std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; - if (nSignal[i] == 0) { - std::cerr << "No generated: " << injectedPDGs[i] << "\n"; - return 1; // At least one of the injected particles should be generated - } - } - return 0; -} diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap5.C b/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap5.C deleted file mode 100644 index 4fec0a0f0..000000000 --- a/MC/config/PWGLF/ini/tests/GeneratorLFV0sInJets_pp536TeV_gap5.C +++ /dev/null @@ -1,57 +0,0 @@ -int External() -{ - std::string path{"o2sim_Kine.root"}; - int numberOfInjectedSignalsPerEvent{1}; - std::vector injectedPDGs = { - 310, // K0S - 3122, // Lambda - -3122 // Anti-Lambda - }; - 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); - } - - auto nEvents = tree->GetEntries(); - for (int i = 0; i < nEvents; i++) { - 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]++; - } - } - } - std::cout << "--------------------------------\n"; - std::cout << "# Events: " << nEvents << "\n"; - for (int i = 0; i < nInjection; i++) { - std::cout << "# Injected nuclei \n"; - std::cout << injectedPDGs[i] << ": " << nSignal[i] << "\n"; - if (nSignal[i] == 0) { - std::cerr << "No generated: " << injectedPDGs[i] << "\n"; - return 1; // At least one of the injected particles should be generated - } - } - return 0; -} From 6ed5ad43420b0fb3869aa0fe432498e0e9c59da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Thu, 15 Oct 2026 09:44:30 +0200 Subject: [PATCH 4/6] Rename generator in ini configuration file --- .../PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini index 3ac0ae5c6..da37309f8 100644 --- a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini +++ b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini @@ -1,4 +1,4 @@ -#---> GeneratorLFCascadesInJets_pp536TeV +#---> GeneratorLFV0sInJets_pp536TeV ### Cascades in jets - pp collisions at 5.36 TeV [GeneratorExternal] @@ -13,4 +13,4 @@ includePartonEvent=false [DecayerPythia8] # Standard Pythia8 decay configuration -config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg \ No newline at end of file +config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg From 5e5f4b4ef435e8dff2c1f99f12c91ce2a1cb75ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Thu, 15 Oct 2026 09:45:10 +0200 Subject: [PATCH 5/6] Update generator name in configuration file --- MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini index da37309f8..5bdd49711 100644 --- a/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini +++ b/MC/config/PWGLF/ini/GeneratorLFCascadesInJets_pp536TeV_gap2.ini @@ -1,4 +1,4 @@ -#---> GeneratorLFV0sInJets_pp536TeV +#---> GeneratorLFCascadesInJets_pp536TeV ### Cascades in jets - pp collisions at 5.36 TeV [GeneratorExternal] From 1aeb0563b1a22571f55355be5b2fba6727254028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Thu, 15 Oct 2026 09:45:46 +0200 Subject: [PATCH 6/6] Update generator name in ini configuration file --- MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini index 6aeeb19c6..553ad5617 100644 --- a/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini +++ b/MC/config/PWGLF/ini/GeneratorLFV0sInJets_pp536TeV_gap2.ini @@ -1,4 +1,4 @@ -#---> GeneratorLFCascadesInJets_pp536TeV +#---> GeneratorLFV0sInJets_pp536TeV ### V0s in jets - pp collisions at 5.36 TeV [GeneratorExternal] @@ -13,4 +13,4 @@ includePartonEvent=false [DecayerPythia8] # Standard Pythia8 decay configuration -config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg \ No newline at end of file +config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg