From 70395f599e7db221da3074ed7633191ab9a966f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Tue, 29 Sep 2026 11:26:04 +0200 Subject: [PATCH 1/3] Add pp at 5.36 TeV AMPT --- MC/config/common/ini/GeneratorAMPTpp536TeV.ini | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 MC/config/common/ini/GeneratorAMPTpp536TeV.ini diff --git a/MC/config/common/ini/GeneratorAMPTpp536TeV.ini b/MC/config/common/ini/GeneratorAMPTpp536TeV.ini new file mode 100644 index 000000000..e674789e9 --- /dev/null +++ b/MC/config/common/ini/GeneratorAMPTpp536TeV.ini @@ -0,0 +1,6 @@ +#---> GeneratorAMPTPbPb536TeV +#NEV_TEST> 1000 +[GeneratorExternal] +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/external/generator/generator_AMPT.C +# Grid path to the AMPT input file +funcName=generateAMPT("alien:///alice/cern.ch/user/n/njacazio/ampt_nucleiSim/input_pp5360_sm.ampt") \ No newline at end of file From ed256615af8755763096fb4cd3b9289151dc56e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Wed, 30 Sep 2026 12:14:41 +0200 Subject: [PATCH 2/3] Fixes --- .../common/ampt/generator/pp_536TeV_AMPT.ampt | 155 ++++++++++++++++++ .../common/ini/GeneratorAMPTpp536TeV.ini | 5 +- 2 files changed, 156 insertions(+), 4 deletions(-) create mode 100644 MC/config/common/ampt/generator/pp_536TeV_AMPT.ampt diff --git a/MC/config/common/ampt/generator/pp_536TeV_AMPT.ampt b/MC/config/common/ampt/generator/pp_536TeV_AMPT.ampt new file mode 100644 index 000000000..740d085ed --- /dev/null +++ b/MC/config/common/ampt/generator/pp_536TeV_AMPT.ampt @@ -0,0 +1,155 @@ +5360 ! EFRM (sqrt(S_NN) in GeV if FRAME is CMS) +CMS ! FRAME +A ! PROJ +A ! TARG +1 ! IAP (projectile A number) +1 ! IZP (projectile Z number) +1 ! IAT (target A number) +1 ! IZT (target Z number) +1 ! NEVNT (total number of events) - overwritten by generator_AMPT.C +0.0 ! BMIN (mininum impact parameter in fm) +2.5 ! BMAX (maximum impact parameter in fm, also see below) +4 ! ISOFT (D=4): select Default AMPT or String Melting(see below) +150 ! NTMAX: number of timesteps (D=150), see below +0.2 ! DT: timestep in fm (hadron cascade time= DT*NTMAX) (D=0.2) +0.30 ! PARJ(41): parameter a in Lund symmetric splitting function +0.15 ! PARJ(42): parameter b in Lund symmetric splitting function +1 ! (D=1,yes;0,no) flag for popcorn mechanism(netbaryon stopping) +1.0 ! PARJ(5) to control BMBbar vs BBbar in popcorn (D=1.0) +1 ! shadowing flag (Default=1,yes; 0,no) +0 ! quenching flag (D=0,no; 1,yes) +2.0 ! quenching parameter -dE/dx (GeV/fm) in case quenching flag=1 +2.0 ! p0 cutoff in HIJING for minijet productions (D=2.0) +2.265d0 ! parton screening mass in fm^(-1) (D=2.265d0), see below +0 ! IZPC: (D=0 forward-angle parton scatterings; 100,isotropic) +0.33d0 ! alpha in parton cascade (D=0.33d0), see parton screening mass +1d6 ! dpcoal in GeV +1d6 ! drcoal in fm +0 ! ihjsed: take HIJING seed from below (D=0)or at runtime(11) - overwritten by generator_AMPT.C +13150909 ! random seed for HIJING - overwritten by generator_AMPT.C +8 ! random seed for parton cascade - overwritten by generator_AMPT.C +0 ! flag for K0s weak decays (D=0,no; 1,yes) +1 ! flag for phi decays at end of hadron cascade (D=1,yes; 0,no) +0 ! flag for pi0 decays at end of hadron cascade (D=0,no; 1,yes) +0 ! optional OSCAR output (D=0,no; 1,yes; 2&3,more parton info) +0 ! flag for perturbative deuteron calculation (D=0,no; 1or2,yes) +1 ! integer factor for perturbative deuterons(>=1 & <=10000) +1 ! choice of cross section assumptions for deuteron reactions +-7. ! Pt in GeV: generate events with >=1 minijet above this value +1000 ! maxmiss (D=1000): maximum # of tries to repeat a HIJING event +3 ! flag on initial and final state radiation (D=3,both yes; 0,no) +1 ! flag on Kt kick (D=1,yes; 0,no) +0 ! flag to turn on quark pair embedding (D=0,no; 1,yes) +7., 0. ! Initial Px and Py values (GeV) of the embedded quark (u or d) +0., 0. ! Initial x & y values (fm) of the embedded back-to-back q/qbar +1, 5., 0. ! nsembd(D=0), psembd (in GeV),tmaxembd (in radian). +0 ! Flag to enable users to modify shadowing (D=0,no; 1,yes) +1.d0 ! Factor used to modify nuclear shadowing +0 ! Flag for random orientation of reaction plane (D=0,no; 1,yes) +0 ! iexotnp, Flag for exotic nuclear structure of projectile (=0, no; =1,yes) +0 ! iexotnt, Flag for exotic nuclear structure of target (=0, no; =1,yes) +0 ! nstrucp, nucl. struct. of projectile, C12, 1(Triangle), 2(Chain); O16, 1(Tetrahedron), 2(Square), 3(Kite), 4(Chain) +0 ! nstruct, nucl. struct. of target, C12, 1(Triangle), 2(Chain); O16, 1(Tetrahedron), 2(Square), 3(Kite), 4(Chain) + +%%%%%%%%%% O2DPG notes: +Pb-Pb at sqrt(s_NN) = 5.36 TeV, minimum bias (b = 0-20 fm), String Melting +with the LHC settings of arXiv:1403.6321 (a=0.30, b=0.15/GeV^2, 1.5 mb parton +cross section: alpha=0.33 and screening mass 3.2264/fm). +Values are read by AMPT line by line: do NOT add or remove lines above. +NEVNT (line 9), ihjsed (line 28) and the two seeds (lines 29-30) are +overwritten by MC/config/common/external/generator/generator_AMPT.C. +%%%%%%%%%% Further explanations: +BMAX: the upper limit HIPR1(34)+HIPR1(35)=19.87fm (dAu), 25.60fm(AuAu). +ISOFT: 1 Default, + 4 String Melting. +PARJ(41) & (42): for string melting AMPT, 0.55 & 0.15/GeV^2 are recommended + for top RHIC energies and 0.30 & 0.15/GeV^2 are recommended for + LHC energies (see arXiv:1403.6321 for details). +NTMAX: number of time-steps for hadron cascade. + Use a large value (e.g. 1000) for LHC studies or HBT studies at RHIC. + Using NTMAX=2 or 3 effectively turns off hadronic cascade. +parton screening mass (in 1/fm): its square is inversely proportional to + the parton cross section. Use D=2.265d0 for 3mb cross section + when alpha in parton cascade is set to 0.33; + (note: 3.2264d0 for 3mb cross section when alpha is set to 0.47). + Using 1d4 effectively turns off parton cascade. +ihjsed: if =11, take HIJING random seed at runtime so that + every run may be automatically different (see file 'exec'). +iksdcy: flag for K0s weak decays for comparison with data. +iphidcy: flag for phi meson decays at the end of hadron cascade for comparison + with data; default is yes; use 0 to turn off these decays. + Note: phi meson decay during hadron cascade is always enabled. +ipi0dcy: flag for pi0 electromagnetic decays at the end of hadron cascade for + comparison with data; set to 1 to turn on pi0 decays. +ioscar: 0 Dafault, + 1 Write output in the OSCAR format, + 2 Write out the complete parton information + (ana/parton-initial-afterPropagation.dat) + right after string melting (before parton cascade), + 3 Write out several more files on parton information (see readme). +idpert: flag for perturbative deuteron and antideuteron calculations + with results in ana/ampt_pert.dat: + 0 No perturbative calculations, + 1 Trigger a production of NPERTD perturbative deuterons + in each NN collision, + 2 Trigger a production of NPERTD perturbative deuterons only in + an NN collision where a conventional deuteron is produced. + Note: conventional deuteron calculations are always performed + with results in ana/ampt.dat. +NPERTD: number of perturbative deuterons produced in each triggered collision; + setting it to 0 turns off perturbative deuteron productions. +idxsec: choose a cross section model for deuteron inelastic/elastic collisions: + 1: same |matrix element|**2/s (after averaging over initial spins + and isospins) for B+B -> deuteron+meson at the same sqrt(s); + 2: same |matrix element|**2/s for B+B -> deuteron+meson + at the same sqrt(s)-threshold; + 3: same |matrix element|**2/s for deuteron+meson -> B+B + at the same sqrt(s); + 4: same |matrix element|**2/s for deuteron+meson -> B+B + at the same sqrt(s)-threshold; + 1 or 3 also chooses the same cross section for deuteron+meson or baryon + elastic collision at the same sqrt(s); + 2 or 4 also chooses the same cross section for deuteron+meson or baryon + elastic collision at the same sqrt(s)-threshold. +%%%%%%%%%% For jet studies: +pttrig: generate events with at least 1 initial minijet parton above this Pt + value, otherwise repeat HIJING event until reaching maxmiss tries; + use a negative value to disable this requirement and get normal events. +maxmiss: maximum number of tries for the repetition of a HIJING event to obtain + a minijet above the Pt value of pttrig; increase maxmiss if some events + fail to generate at least 1 initial minijet parton above pttrig. + it is safer to set a large value for high pttrig and/or large b value + and/or smaller colliding nuclei. +IHPR2(2): flag to turn off initial and final state radiation: + 0 both radiation off, 1 only final off, 2 only initial off, 3 both on. +IHPR2(5): flag to turn off Pt kick due to soft interactions: 0 off, 1 on. + Setting both IHPR2(2) and IHPR2(5) to zero makes it more likely to + have two high-Pt minijet partons that are close to back-to-back. +%%%%%%%%%% To embed a back-to-back light q/qbar jet pair +%%%%%%%%%% and a given number of soft pions along each jet into each event: +iembed: flag to turn on quark pair embedding: + 1: on with fixed position(xembd,pembd) and Pt(pxqembd,pyqembd); + 2: on with fixed position(xembd,pembd) and random azimuthal angle + with Pt-magnitude given by sqrt(pxqembd^2+pyqembd^2); + 3: on with random position and fixed Pt(pxqembd,pyqembd); + 4: on with random position and random random azimuthal angle + with Pt-magnitude given by sqrt(pxqembd^2+pyqembd^2); + for iembed=3 or 4: need a position file "embed-jet-xy.txt"; + Other integers: off. +pxqembd, pyqembd: sqrt(pxqembd^2+pyqembd^2) > 70MeV/c is required; + the embedded quark and antiquark have pz=0. +xembd, yembd: the embedded quark and antiquark jets have z=0 initially. Note: + the x-axis is defined as the direction along the impact parameter. +nsembd: number of soft pions to be embedded with each high-Pt parton + in the embedded jet pair. +psembd: Momentum of each embedded soft pion in GeV. +tmaxembd: maximum angle(rad) of embedded soft pions relative to high-Pt parton. +%%%%%%%%%% User modification of nuclear shadowing: +ishadow: set to 1 to enable users to adjust nuclear shadowing + provided the shadowing flag IHPR2(6) is turned on; default value is 0. +dshadow: valid when ishadow=1; this parameter modifies the HIJING shadowing + parameterization Ra(x,r)==1+fa(x,r) via Ra(x,r)==1+fa(x,r)*dshadow, + so the value of 0.d0 turns off shadowing + and the value of 1.d0 uses the default HIJING shadowing; + currently limited to 0.d0<=dshadow<=1.d0 to make sure Ra(x,r)>0. +iphirp: set to 1 to turn on random orientation of reaction plane (D=0) diff --git a/MC/config/common/ini/GeneratorAMPTpp536TeV.ini b/MC/config/common/ini/GeneratorAMPTpp536TeV.ini index e674789e9..b59152f81 100644 --- a/MC/config/common/ini/GeneratorAMPTpp536TeV.ini +++ b/MC/config/common/ini/GeneratorAMPTpp536TeV.ini @@ -1,6 +1,3 @@ -#---> GeneratorAMPTPbPb536TeV -#NEV_TEST> 1000 [GeneratorExternal] fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/external/generator/generator_AMPT.C -# Grid path to the AMPT input file -funcName=generateAMPT("alien:///alice/cern.ch/user/n/njacazio/ampt_nucleiSim/input_pp5360_sm.ampt") \ No newline at end of file +funcName=generateAMPT("${O2DPG_MC_CONFIG_ROOT}/MC/config/common/ampt/generator/pp_536TeV_AMPT.ampt") From 6198b42838ac163a20bc7c2eb74d204334be7853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Wed, 30 Sep 2026 12:18:43 +0200 Subject: [PATCH 3/3] Add test --- .../common/ini/tests/GeneratorAMPTpp536TeV.C | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 MC/config/common/ini/tests/GeneratorAMPTpp536TeV.C diff --git a/MC/config/common/ini/tests/GeneratorAMPTpp536TeV.C b/MC/config/common/ini/tests/GeneratorAMPTpp536TeV.C new file mode 100644 index 000000000..78a31725e --- /dev/null +++ b/MC/config/common/ini/tests/GeneratorAMPTpp536TeV.C @@ -0,0 +1,35 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + // Check that file exists, can be opened and has the correct tree + 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* eventHeader = nullptr; + tree->SetBranchAddress("MCEventHeader.", &eventHeader); + + // Check if there are 100 events, as simulated in the o2dpg-test + auto nEvents = tree->GetEntries(); + if (nEvents != 100) { + std::cerr << "Expected 100 events, got " << nEvents << "\n"; + return 1; + } + // Beam momentum per nucleon for Pb-Pb at sqrt(s_NN) = 5.36 TeV + for (Long64_t i = 0; i < nEvents; ++i) { + tree->GetEntry(i); + if (tracks->empty()) { + std::cerr << "Empty entry found at event " << i << "\n"; + return 1; + } + } + return 0; +}