From 7e468eccb976871375fbda6352ad8118651a08f6 Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 29 Apr 2026 18:00:36 +0200 Subject: [PATCH 1/2] Add configuration for rescattering in Pythia8 pp 13.6 TeV --- .../ini/pythia8_pp_rescattering_136tev.ini | 9 +++++++ .../tests/pythia8_pp_rescattering_136tev.C | 24 +++++++++++++++++++ .../pythia8_pp_rescattering_136tev.cfg | 23 ++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 MC/config/ALICE3/ini/pythia8_pp_rescattering_136tev.ini create mode 100644 MC/config/ALICE3/ini/tests/pythia8_pp_rescattering_136tev.C create mode 100644 MC/config/ALICE3/pythia8/generator/pythia8_pp_rescattering_136tev.cfg diff --git a/MC/config/ALICE3/ini/pythia8_pp_rescattering_136tev.ini b/MC/config/ALICE3/ini/pythia8_pp_rescattering_136tev.ini new file mode 100644 index 000000000..4189c775a --- /dev/null +++ b/MC/config/ALICE3/ini/pythia8_pp_rescattering_136tev.ini @@ -0,0 +1,9 @@ +[Diamond] +width[2]=6.0 + +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_ALICE3.C +funcName=generator_pythia8_ALICE3() + +[GeneratorPythia8] +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator/pythia8_pp_rescattering_136tev.cfg diff --git a/MC/config/ALICE3/ini/tests/pythia8_pp_rescattering_136tev.C b/MC/config/ALICE3/ini/tests/pythia8_pp_rescattering_136tev.C new file mode 100644 index 000000000..9b21ec151 --- /dev/null +++ b/MC/config/ALICE3/ini/tests/pythia8_pp_rescattering_136tev.C @@ -0,0 +1,24 @@ +int External() { + 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); + + auto nEvents = tree->GetEntries(); + if (nEvents == 0) { + std::cerr << "No event of interest\n"; + return 1; + } + return 0; +} \ No newline at end of file diff --git a/MC/config/ALICE3/pythia8/generator/pythia8_pp_rescattering_136tev.cfg b/MC/config/ALICE3/pythia8/generator/pythia8_pp_rescattering_136tev.cfg new file mode 100644 index 000000000..9d0adf1fe --- /dev/null +++ b/MC/config/ALICE3/pythia8/generator/pythia8_pp_rescattering_136tev.cfg @@ -0,0 +1,23 @@ +### Specify beams +Beams:idA = 2212 +Beams:idB = 2212 +Beams:eCM = 13600. ### energy + +Beams:frameType = 1 +ParticleDecays:limitTau0 = on +ParticleDecays:tau0Max = 10. ### match alice: 1cm/c = 10.0mm/c + +### processes +SoftQCD:inelastic = on # all inelastic processes + +# default: do nothing, Monash 2013 will do its thing +Tune:pp = 14 + +### enable hadronic rescattering +HadronLevel:Rescatter = on # default = off +Fragmentation:setVertices = on # default = off +PartonVertex:setVertex = on # default = off +Rescattering:nearestNeighbours = off # default = on (but "require a larger retuning effort") +Rescattering:inelastic = on # default = on + +Random:setSeed = on From 762199e90462aee1c478db0b2068f9cd4fab11db Mon Sep 17 00:00:00 2001 From: romainschotter Date: Wed, 29 Apr 2026 18:01:11 +0200 Subject: [PATCH 2/2] Add configuration for rescattering in Pythia8 OO 5.36 TeV --- .../ini/pythia8_OO_rescattering_536.ini | 9 +++++++ .../ini/tests/pythia8_OO_rescattering_536.C | 24 +++++++++++++++++++ .../generator/pythia8_OO_rescattering_536.cfg | 22 +++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 MC/config/common/ini/pythia8_OO_rescattering_536.ini create mode 100644 MC/config/common/ini/tests/pythia8_OO_rescattering_536.C create mode 100644 MC/config/common/pythia8/generator/pythia8_OO_rescattering_536.cfg diff --git a/MC/config/common/ini/pythia8_OO_rescattering_536.ini b/MC/config/common/ini/pythia8_OO_rescattering_536.ini new file mode 100644 index 000000000..a0f2fc2e5 --- /dev/null +++ b/MC/config/common/ini/pythia8_OO_rescattering_536.ini @@ -0,0 +1,9 @@ +[Diamond] +width[2]=6.0 + +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/ALICE3/pythia8/generator_pythia8_ALICE3.C +funcName=generator_pythia8_ALICE3() + +[GeneratorPythia8] +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/generator/pythia8_OO_rescattering_536.cfg diff --git a/MC/config/common/ini/tests/pythia8_OO_rescattering_536.C b/MC/config/common/ini/tests/pythia8_OO_rescattering_536.C new file mode 100644 index 000000000..1c28040e2 --- /dev/null +++ b/MC/config/common/ini/tests/pythia8_OO_rescattering_536.C @@ -0,0 +1,24 @@ +int External() { + 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); + + auto nEvents = tree->GetEntries(); + if (nEvents == 0) { + std::cerr << "No event of interest\n"; + return 1; + } + return 0; +} diff --git a/MC/config/common/pythia8/generator/pythia8_OO_rescattering_536.cfg b/MC/config/common/pythia8/generator/pythia8_OO_rescattering_536.cfg new file mode 100644 index 000000000..cd0a11e50 --- /dev/null +++ b/MC/config/common/pythia8/generator/pythia8_OO_rescattering_536.cfg @@ -0,0 +1,22 @@ +### OO beams +Beams:idA = 1000080160 +Beams:idB = 1000080160 +Beams:eCM = 5360.0 ### energy + +Beams:frameType = 1 +ParticleDecays:limitTau0 = on +ParticleDecays:tau0Max = 10. ### match alice: 1cm/c = 10.0mm/c + +### Save some CPU at init of jobs +### To avoid refitting, add the following lines to your configuration file: +HeavyIon:SigFitNGen = 0 +HeavyIon:SigFitDefPar = 2.15,18.42,0.33 + +### enable hadronic rescattering +HadronLevel:Rescatter = on # default = off +Fragmentation:setVertices = on # default = off +PartonVertex:setVertex = on # default = off +Rescattering:nearestNeighbours = off # default = on (but "require a larger retuning effort") +Rescattering:inelastic = on # default = on + +Random:setSeed = on