From 1ecc5830b9f31cf8640cb7f62f8574bd857cfe08 Mon Sep 17 00:00:00 2001 From: Arvind Khuntia Date: Thu, 9 Oct 2025 11:30:43 +0200 Subject: [PATCH 1/4] ini file for OO nuclei-injected --- MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini diff --git a/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini b/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini new file mode 100644 index 000000000..1aacd50e5 --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini @@ -0,0 +1,10 @@ +[GeneratorExternal] fileName = + ${O2DPG_MC_CONFIG_ROOT} / MC / config / PWGLF / pythia8 / + generator_pythia8_longlived_gaptriggered.C funcName = + generateLongLivedGapTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/" + "pythia8/generator/hypernuclei_pbpb.gun", + 1) + + [GeneratorPythia8] config = + ${O2DPG_MC_CONFIG_ROOT} / MC / config / common / pythia8 / + generator / pythia8_OO_536.cfg From bdfacc65f2803853dcda23deb7589b57616cf06b Mon Sep 17 00:00:00 2001 From: Arvind Khuntia Date: Thu, 9 Oct 2025 11:37:29 +0200 Subject: [PATCH 2/4] corrected the format --- .../PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini b/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini index 1aacd50e5..b960ffe3a 100644 --- a/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini +++ b/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini @@ -1,10 +1,6 @@ -[GeneratorExternal] fileName = - ${O2DPG_MC_CONFIG_ROOT} / MC / config / PWGLF / pythia8 / - generator_pythia8_longlived_gaptriggered.C funcName = - generateLongLivedGapTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/" - "pythia8/generator/hypernuclei_pbpb.gun", - 1) +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_longlived_gaptriggered.C +funcName=generateLongLivedGapTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/hypernuclei_pbpb.gun", 1) - [GeneratorPythia8] config = - ${O2DPG_MC_CONFIG_ROOT} / MC / config / common / pythia8 / - generator / pythia8_OO_536.cfg +[GeneratorPythia8] +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/generator/pythia8_OO_536.cfg From 32389d24850883f4d978eaf0c2fffe5a422d45d0 Mon Sep 17 00:00:00 2001 From: Arvind Khuntia Date: Thu, 9 Oct 2025 15:38:40 +0200 Subject: [PATCH 3/4] test macro added --- .../ini/tests/GeneratorLFHyperNucleiOOGap.C | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 MC/config/PWGLF/ini/tests/GeneratorLFHyperNucleiOOGap.C diff --git a/MC/config/PWGLF/ini/tests/GeneratorLFHyperNucleiOOGap.C b/MC/config/PWGLF/ini/tests/GeneratorLFHyperNucleiOOGap.C new file mode 100644 index 000000000..0f51674fb --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLFHyperNucleiOOGap.C @@ -0,0 +1,58 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + std::vector possiblePDGs = {1000010020, -1000010020, + 1000010030, -1000010030, + 1000020030, -1000020030, + 1000020040, -1000020040, + 1010010030, -1010010030, + 1010010040, -1010010040}; + + int nPossiblePDGs = possiblePDGs.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 injectedPDGs; + + 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(possiblePDGs.begin(), possiblePDGs.end(), pdg); + if (it != possiblePDGs.end() && track.isPrimary()) // found + { + injectedPDGs.push_back(pdg); + } + } + } + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + if(injectedPDGs.empty()){ + std::cerr << "No injected particles\n"; + return 1; // At least one of the injected particles should be generated + } + for (int i = 0; i < nPossiblePDGs; i++) + { + std::cout << "# Injected nuclei \n"; + std::cout << possiblePDGs[i] << ": " << std::count(injectedPDGs.begin(), injectedPDGs.end(), possiblePDGs[i]) << "\n"; + } + return 0; +} From 6dab391c32d6e9cb687a949ba2e633e23fabe5ea Mon Sep 17 00:00:00 2001 From: Arvind Khuntia Date: Mon, 13 Oct 2025 17:40:10 +0200 Subject: [PATCH 4/4] Added OO-Gun for nuclei and hypernuclei --- MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini | 2 +- MC/config/PWGLF/pythia8/generator/hypernuclei_oo.gun | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 MC/config/PWGLF/pythia8/generator/hypernuclei_oo.gun diff --git a/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini b/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini index b960ffe3a..a86514628 100644 --- a/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini +++ b/MC/config/PWGLF/ini/GeneratorLFHyperNucleiOOGap.ini @@ -1,6 +1,6 @@ [GeneratorExternal] fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_longlived_gaptriggered.C -funcName=generateLongLivedGapTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/hypernuclei_pbpb.gun", 1) +funcName=generateLongLivedGapTriggered("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/hypernuclei_oo.gun", 1) [GeneratorPythia8] config=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/generator/pythia8_OO_536.cfg diff --git a/MC/config/PWGLF/pythia8/generator/hypernuclei_oo.gun b/MC/config/PWGLF/pythia8/generator/hypernuclei_oo.gun new file mode 100644 index 000000000..66ba2dc0f --- /dev/null +++ b/MC/config/PWGLF/pythia8/generator/hypernuclei_oo.gun @@ -0,0 +1,10 @@ +# PDG N ptMin ptMax yMin yMax +1000010020 2 0.2 10 -1 1 +1000010030 2 0.2 10 -1 1 +1000020030 2 0.2 10 -1 1 +1000020040 2 0.2 10 -1 1 +1010010030 2 0.2 10 -1 1 +1010010040 2 0.2 10 -1 1 +1010020040 2 0.2 10 -1 1 +1010000030 1 0.2 10 -1 1 +1000030040 1 0.2 10 -1 1 \ No newline at end of file