From c4347727d2f0d06c0c8d444e9f748a5591760509 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Fri, 27 Nov 2026 15:20:02 +0100 Subject: [PATCH 1/5] Add GeneratorHGPythia8OO536TeV.ini configuration file --- MC/config/common/ini/GeneratorHGPythia8OO536TeV.ini | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 MC/config/common/ini/GeneratorHGPythia8OO536TeV.ini diff --git a/MC/config/common/ini/GeneratorHGPythia8OO536TeV.ini b/MC/config/common/ini/GeneratorHGPythia8OO536TeV.ini new file mode 100644 index 000000000..c654a45f9 --- /dev/null +++ b/MC/config/common/ini/GeneratorHGPythia8OO536TeV.ini @@ -0,0 +1,8 @@ +#NEV_TEST> 5 +# HG-PYTHIA (Glauber + PYTHIA 8 pp collisions) OO at sqrt(s_NN) = 5.36 TeV, minimum bias +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/external/generator/GeneratorHGPythia8.C +funcName=generateHGPythia8(16, 16) + +[GeneratorPythia8] +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/generator/pythia8_OO_536.cfg From f5c30b7ff3ef1331fada3adc5b63499db9cd0371 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Fri, 27 Nov 2026 15:21:16 +0100 Subject: [PATCH 2/5] Add test for HGPythia for OO --- .../ini/tests/GeneratorHGPythia8OO536TeV.C | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 MC/config/common/ini/tests/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C diff --git a/MC/config/common/ini/tests/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C b/MC/config/common/ini/tests/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C new file mode 100644 index 000000000..a1fa0c959 --- /dev/null +++ b/MC/config/common/ini/tests/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C @@ -0,0 +1,56 @@ +int External() +{ + const int A = 16; // mass number of both nuclei + std::string path{"o2sim_Kine.root"}; + 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); + o2::dataformats::MCEventHeader* header = nullptr; + tree->SetBranchAddress("MCEventHeader.", &header); + + using Key = o2::dataformats::MCInfoKeys; + const auto nEvents = tree->GetEntries(); + if (nEvents == 0) { + std::cerr << "No events found\n"; + return 1; + } + for (Long64_t i = 0; i < nEvents; ++i) { + tree->GetEntry(i); + bool valid = false; + const int nColl = header->getInfo(Key::nColl, valid); + if (!valid || nColl < 1 || nColl > A * A) { + std::cerr << "Missing or invalid Ncoll in event " << i << "\n"; + return 1; + } + const int nPart = header->getInfo(Key::nPart, valid); + if (!valid || nPart < 2 || nPart > 2 * A) { + std::cerr << "Missing or invalid Npart in event " << i << "\n"; + return 1; + } + // each NN collision is a PYTHIA pp event: two beam protons with half of sqrt(s_NN) each + int nBeams = 0; + for (const auto& track : *tracks) { + if (o2::mcgenstatus::getHepMCStatusCode(track.getStatusCode()) == 4) { + if (track.GetPdgCode() != 2212 || std::abs(track.GetEnergy() - 2680.) > 1e-3) { + std::cerr << "Unexpected beam particle " << track.GetPdgCode() << " with energy " << track.GetEnergy() << " in event " << i << "\n"; + return 1; + } + nBeams++; + } + } + if (nBeams != 2 * nColl) { + std::cerr << "Found " << nBeams << " beam protons for " << nColl << " NN collisions in event " << i << "\n"; + return 1; + } + } + return 0; +} From 25602f85e57ea47742211551a8d43e0a9e76aa91 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Fri, 27 Nov 2026 15:22:45 +0100 Subject: [PATCH 3/5] Add test for HGPythia in OO --- .../ini/tests/GeneratorHGPythia8OO536TeV.C | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C diff --git a/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C b/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C new file mode 100644 index 000000000..a1fa0c959 --- /dev/null +++ b/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C @@ -0,0 +1,56 @@ +int External() +{ + const int A = 16; // mass number of both nuclei + std::string path{"o2sim_Kine.root"}; + 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); + o2::dataformats::MCEventHeader* header = nullptr; + tree->SetBranchAddress("MCEventHeader.", &header); + + using Key = o2::dataformats::MCInfoKeys; + const auto nEvents = tree->GetEntries(); + if (nEvents == 0) { + std::cerr << "No events found\n"; + return 1; + } + for (Long64_t i = 0; i < nEvents; ++i) { + tree->GetEntry(i); + bool valid = false; + const int nColl = header->getInfo(Key::nColl, valid); + if (!valid || nColl < 1 || nColl > A * A) { + std::cerr << "Missing or invalid Ncoll in event " << i << "\n"; + return 1; + } + const int nPart = header->getInfo(Key::nPart, valid); + if (!valid || nPart < 2 || nPart > 2 * A) { + std::cerr << "Missing or invalid Npart in event " << i << "\n"; + return 1; + } + // each NN collision is a PYTHIA pp event: two beam protons with half of sqrt(s_NN) each + int nBeams = 0; + for (const auto& track : *tracks) { + if (o2::mcgenstatus::getHepMCStatusCode(track.getStatusCode()) == 4) { + if (track.GetPdgCode() != 2212 || std::abs(track.GetEnergy() - 2680.) > 1e-3) { + std::cerr << "Unexpected beam particle " << track.GetPdgCode() << " with energy " << track.GetEnergy() << " in event " << i << "\n"; + return 1; + } + nBeams++; + } + } + if (nBeams != 2 * nColl) { + std::cerr << "Found " << nBeams << " beam protons for " << nColl << " NN collisions in event " << i << "\n"; + return 1; + } + } + return 0; +} From dc4184aa0cc1415722d165777cce3bfbd0f34bb7 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Fri, 27 Nov 2026 15:24:08 +0100 Subject: [PATCH 4/5] Delete MC/config/common/ini/tests/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C --- .../ini/tests/GeneratorHGPythia8OO536TeV.C | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 MC/config/common/ini/tests/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C diff --git a/MC/config/common/ini/tests/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C b/MC/config/common/ini/tests/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C deleted file mode 100644 index a1fa0c959..000000000 --- a/MC/config/common/ini/tests/MC/config/common/ini/tests/GeneratorHGPythia8OO536TeV.C +++ /dev/null @@ -1,56 +0,0 @@ -int External() -{ - const int A = 16; // mass number of both nuclei - std::string path{"o2sim_Kine.root"}; - 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); - o2::dataformats::MCEventHeader* header = nullptr; - tree->SetBranchAddress("MCEventHeader.", &header); - - using Key = o2::dataformats::MCInfoKeys; - const auto nEvents = tree->GetEntries(); - if (nEvents == 0) { - std::cerr << "No events found\n"; - return 1; - } - for (Long64_t i = 0; i < nEvents; ++i) { - tree->GetEntry(i); - bool valid = false; - const int nColl = header->getInfo(Key::nColl, valid); - if (!valid || nColl < 1 || nColl > A * A) { - std::cerr << "Missing or invalid Ncoll in event " << i << "\n"; - return 1; - } - const int nPart = header->getInfo(Key::nPart, valid); - if (!valid || nPart < 2 || nPart > 2 * A) { - std::cerr << "Missing or invalid Npart in event " << i << "\n"; - return 1; - } - // each NN collision is a PYTHIA pp event: two beam protons with half of sqrt(s_NN) each - int nBeams = 0; - for (const auto& track : *tracks) { - if (o2::mcgenstatus::getHepMCStatusCode(track.getStatusCode()) == 4) { - if (track.GetPdgCode() != 2212 || std::abs(track.GetEnergy() - 2680.) > 1e-3) { - std::cerr << "Unexpected beam particle " << track.GetPdgCode() << " with energy " << track.GetEnergy() << " in event " << i << "\n"; - return 1; - } - nBeams++; - } - } - if (nBeams != 2 * nColl) { - std::cerr << "Found " << nBeams << " beam protons for " << nColl << " NN collisions in event " << i << "\n"; - return 1; - } - } - return 0; -} From c07f2b1c5be029b7049c0441d6568f12e300aa82 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Fri, 27 Nov 2026 15:40:02 +0100 Subject: [PATCH 5/5] Update Pythia8 configuration file path --- MC/config/common/ini/GeneratorHGPythia8OO536TeV.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MC/config/common/ini/GeneratorHGPythia8OO536TeV.ini b/MC/config/common/ini/GeneratorHGPythia8OO536TeV.ini index c654a45f9..3056c77a2 100644 --- a/MC/config/common/ini/GeneratorHGPythia8OO536TeV.ini +++ b/MC/config/common/ini/GeneratorHGPythia8OO536TeV.ini @@ -5,4 +5,4 @@ fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/external/generator/GeneratorHG funcName=generateHGPythia8(16, 16) [GeneratorPythia8] -config=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/generator/pythia8_OO_536.cfg +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/generator/pythia8_inel_536.cfg