From ac6b522f9fa37091fae6ae8cb54d6befcecbbdcd Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Fri, 10 Apr 2026 17:38:48 +0530 Subject: [PATCH 01/14] Update GeneratorHF_Non_Hfe.json Flat pion and eta distributions are added to enhance statistics at high transverse momentum. --- .../PWGHF/hybrid/GeneratorHF_Non_Hfe.json | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json b/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json index a80e0da31..acad82508 100644 --- a/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json +++ b/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json @@ -3,12 +3,7 @@ { "name": "pythia8", "config": { - "config": "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg", - "hooksFileName": "", - "hooksFuncName": "", - "includePartonEvent": true, - "particleFilter": "", - "verbose": 0 + "config": "${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/generator/pythia8_NonHfe.cfg" }, "triggers": { "mode": "or", @@ -19,9 +14,29 @@ } ] } + }, + { + "name": "boxgenPion", + "config": { + "pdg": 111, + "prange[0]": 0.1, + "prange[1]": 50.0, + "eta[0]": -0.8, + "eta[1]": 0.8, + "number": 1 + } + }, + { + "name": "boxgenEta", + "config": { + "pdg": 221, + "prange[0]": 0.1, + "prange[1]": 50.0, + "eta[0]": -0.8, + "eta[1]": 0.8, + "number": 1 + } } ], - "fractions": [ - 1 - ] + "fractions": [1, 1, 1] } From 230de7d7a3c5f6a19b3776ec84e500a1b0fa9c3d Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sat, 11 Apr 2026 14:56:03 +0530 Subject: [PATCH 02/14] Update pythia8_NonHfe.cfg Remove CR mode2 --- .../pythia8/generator/pythia8_NonHfe.cfg | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg b/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg index e4fe0e6f2..b19227718 100644 --- a/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg +++ b/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg @@ -14,25 +14,6 @@ SoftQCD:inelastic on # all inelastic processes ParticleDecays:limitTau0 on ParticleDecays:tau0Max 10. -### switching on Pythia Mode2 -ColourReconnection:mode 1 -ColourReconnection:allowDoubleJunRem off -ColourReconnection:m0 0.3 -ColourReconnection:allowJunctions on -ColourReconnection:junctionCorrection 1.20 -ColourReconnection:timeDilationMode 2 -ColourReconnection:timeDilationPar 0.18 -StringPT:sigma 0.335 -StringZ:aLund 0.36 -StringZ:bLund 0.56 -StringFlav:probQQtoQ 0.078 -StringFlav:ProbStoUD 0.2 -StringFlav:probQQ1toQQ0join 0.0275,0.0275,0.0275,0.0275 -MultiPartonInteractions:pT0Ref 2.15 -BeamRemnants:remnantMode 1 -BeamRemnants:saturation 5 - - ### switch off all decay channels 111:onMode = off 221:onMode = off From 813315eecbe70b941ce5860e441ea9273d1f942b Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Mon, 13 Apr 2026 18:51:01 +0530 Subject: [PATCH 03/14] Update GeneratorHF_Non_Hfe.json --- MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json b/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json index acad82508..07597d40a 100644 --- a/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json +++ b/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json @@ -16,7 +16,7 @@ } }, { - "name": "boxgenPion", + "name": "boxgen", "config": { "pdg": 111, "prange[0]": 0.1, @@ -27,7 +27,7 @@ } }, { - "name": "boxgenEta", + "name": "boxgen", "config": { "pdg": 221, "prange[0]": 0.1, From 0c5ac32cc071be89d24cecb1bf4ecdf7b3044c7f Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:14:42 +0530 Subject: [PATCH 04/14] Remove number parameter --- MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json b/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json index 07597d40a..1e242cbd2 100644 --- a/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json +++ b/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json @@ -23,7 +23,6 @@ "prange[1]": 50.0, "eta[0]": -0.8, "eta[1]": 0.8, - "number": 1 } }, { @@ -34,7 +33,6 @@ "prange[1]": 50.0, "eta[0]": -0.8, "eta[1]": 0.8, - "number": 1 } } ], From ecdd57554f4725f53d49e23127995f5ff24fee84 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:16:16 +0530 Subject: [PATCH 05/14] Update GeneratorHF_Non_Hfe.json --- MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json b/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json index 1e242cbd2..c729060bb 100644 --- a/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json +++ b/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json @@ -22,7 +22,7 @@ "prange[0]": 0.1, "prange[1]": 50.0, "eta[0]": -0.8, - "eta[1]": 0.8, + "eta[1]": 0.8 } }, { @@ -32,7 +32,7 @@ "prange[0]": 0.1, "prange[1]": 50.0, "eta[0]": -0.8, - "eta[1]": 0.8, + "eta[1]": 0.8 } } ], From a5ab7a979ab95a12bd48717c153a7dc93bc7baad Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 26 Apr 2026 12:45:50 +0530 Subject: [PATCH 06/14] implement flat pT generation for pi0 and eta --- MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg b/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg index b19227718..9ffaf921b 100644 --- a/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg +++ b/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg @@ -8,11 +8,13 @@ Beams:idB 2212 # proton Beams:eCM 13600. # GeV ### processes -SoftQCD:inelastic on # all inelastic processes + +ProcessLevel:all = off # <--- MUST ADD ### decays ParticleDecays:limitTau0 on ParticleDecays:tau0Max 10. +### processes ### switch off all decay channels 111:onMode = off From 9d1d64c0e8bde64d06c9ab0069eac709904eef2e Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 26 Apr 2026 12:50:36 +0530 Subject: [PATCH 07/14] implement flat pT generation for pi0 and eta --- MC/config/PWGHF/trigger/selectNonHfe.C | 109 +++++++++++++++++++------ 1 file changed, 82 insertions(+), 27 deletions(-) diff --git a/MC/config/PWGHF/trigger/selectNonHfe.C b/MC/config/PWGHF/trigger/selectNonHfe.C index 2acfc23fe..7c685c585 100644 --- a/MC/config/PWGHF/trigger/selectNonHfe.C +++ b/MC/config/PWGHF/trigger/selectNonHfe.C @@ -1,41 +1,96 @@ -#include -#include "Generators/Trigger.h" -#include -#include - -///============================================================================ - /// Select π⁰ and η within a given rapidity window for enhancement /// pdgPartForAccCut: PDG of the particle to select (111=π⁰, 221=η) /// minNb: minimum number of such particles per event for enhancement //// authors: Rashi Gupta (rashi.gupta@cern.ch) /// authors: Ravindra Singh (ravindra.singh@cern.ch) -/// ============================================================================ -o2::eventgen::Trigger selectPionEtaWithinAcc(TString pdgPartForAccCut = "111;221", double rapidityMin = -1.5, double rapidityMax = 1.5, int minNb = 1) + + +#if !defined(__CLING__) || defined(__ROOTCLING__) +#include "FairGenerator.h" +#include "FairPrimaryGenerator.h" +#include "Generators/GeneratorPythia8.h" +#include "TRandom3.h" +#include "TParticlePDG.h" +#include "TDatabasePDG.h" +#include "TMath.h" +#include +#include +#endif + +#include "Pythia8/Pythia.h" +using namespace Pythia8; + +class GeneratorPythia8Box : public o2::eventgen::GeneratorPythia8 +{ +public: + + GeneratorPythia8Box(std::vector pdgList, int nInject = 3, float ptMin = 0.1, float ptMax = 50.0, float etaMin = -0.8, float etaMax = 0.8) + : mPdgList(pdgList), nParticles(nInject), genMinPt(ptMin), genMaxPt(ptMax), genMinEta(etaMin), genMaxEta(etaMax) + { + } + + ~GeneratorPythia8Box() = default; + +Bool_t generateEvent() override { - return [pdgPartForAccCut, rapidityMin, rapidityMax, minNb](const std::vector& particles) -> bool { - TObjArray* obj = pdgPartForAccCut.Tokenize(";"); - int count = 0; - for (const auto& particle : particles) { - int pdg = TMath::Abs(particle.GetPdgCode()); - double y = particle.Y(); + bool hasElectron = false; + + while (!hasElectron) { + mPythia.event.reset(); - if (y < rapidityMin || y > rapidityMax) continue; + for (int i{0}; i < nParticles; ++i) + { + int currentPdg = mPdgList[gRandom->Integer(mPdgList.size())]; + double mass = TDatabasePDG::Instance()->GetParticle(currentPdg)->Mass(); - for (int i = 0; i < obj->GetEntriesFast(); ++i) { - int pdgCode = std::stoi(obj->At(i)->GetName()); + const double pt = gRandom->Uniform(genMinPt, genMaxPt); + const double eta = gRandom->Uniform(genMinEta, genMaxEta); + const double phi = gRandom->Uniform(0, TMath::TwoPi()); - if (pdg == pdgCode) { - count++; - break; + const double px{pt * std::cos(phi)}; + const double py{pt * std::sin(phi)}; + const double pz{pt * std::sinh(eta)}; + const double et{std::hypot(std::hypot(pt, pz), mass)}; + + + mPythia.event.append(currentPdg, 11, 0, 0, px, py, pz, et, mass); + } + + + if (!mPythia.next()) continue; + + + for (int i = 0; i < mPythia.event.size(); ++i) { + if (std::abs(mPythia.event[i].id()) == 11) { + + + double childPt = mPythia.event[i].pT(); + double childEta = mPythia.event[i].eta(); + + if (childPt > 0.1 && std::abs(childEta) < 1.2) { + hasElectron = true; // Mil gaya! + break; } } } - // Only accept events with at least minNb π⁰/η - if (count >= minNb) - return kTRUE; - else - return kFALSE; - }; + + } + + return true; +} + +private: + std::vector mPdgList; + double genMinPt, genMaxPt; + double genMinEta, genMaxEta; + int nParticles; +}; + + +FairGenerator *generatePythia8Box(float ptMin = 0.1, float ptMax = 50.0) +{ + + std::vector pdgList = {111, 221}; + return new GeneratorPythia8Box(pdgList, 3, ptMin, ptMax, -0.8, 0.8); } From 4394b696245e3a4b254bb8bafd9121e5caeb04a6 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 26 Apr 2026 12:53:51 +0530 Subject: [PATCH 08/14] implement flat pT generation for pi0 and eta --- MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini b/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini index 7ed9bb10b..b76a5a87b 100644 --- a/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini +++ b/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini @@ -1,4 +1,7 @@ -#### This configuration uses the Hybrid external generator to trigger π⁰/η production within the specified rapidity window - -[GeneratorHybrid] -configFile = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/hybrid/GeneratorHF_Non_Hfe.json +#### This configuration uses the Box generator to trigger π⁰/η production within the specified rapidity window +[GeneratorExternal] +fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/trigger/selectbox.C +funcName = generatePythia8Box(0.1, 50.0) +[GeneratorPythia8] +config= ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg +includePartonEvent=true From 2ddb2485a5c8f5ce86b03f8202fb02e6eb55b982 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 26 Apr 2026 12:58:46 +0530 Subject: [PATCH 09/14] Update GeneratorHF_Non_Hfe.ini --- MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini b/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini index b76a5a87b..b079a97d4 100644 --- a/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini +++ b/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini @@ -1,7 +1,7 @@ #### This configuration uses the Box generator to trigger π⁰/η production within the specified rapidity window [GeneratorExternal] -fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/trigger/selectbox.C +fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/trigger/selectNonHfe.C funcName = generatePythia8Box(0.1, 50.0) [GeneratorPythia8] -config= ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg +config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg includePartonEvent=true From 37413e5580f22b31177f8cb4e04605e4e7568a70 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 26 Apr 2026 13:00:04 +0530 Subject: [PATCH 10/14] Update GeneratorHF_Non_Hfe.ini --- MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini b/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini index b079a97d4..1cac89225 100644 --- a/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini +++ b/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini @@ -1,6 +1,6 @@ #### This configuration uses the Box generator to trigger π⁰/η production within the specified rapidity window [GeneratorExternal] -fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/trigger/selectNonHfe.C +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/trigger/selectNonHfe.C funcName = generatePythia8Box(0.1, 50.0) [GeneratorPythia8] config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg From db36453d9e4513b132b572bd9b5d5d358d0915c3 Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 26 Apr 2026 15:01:03 +0530 Subject: [PATCH 11/14] Update GeneratorHF_Non_Hfe.C --- MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C b/MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C index ba9dcb737..2affeeb0c 100644 --- a/MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C +++ b/MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C @@ -1,4 +1,4 @@ -int Hybrid() { +int External()() { std::string path{"o2sim_Kine.root"}; const int pdgPi0 = 111; From 76a22cd5583fcb5e51598b095228bbef388cc14b Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 26 Apr 2026 15:36:59 +0530 Subject: [PATCH 12/14] Rename MC/config/PWGHF/trigger/selectNonHfe.C to MC/config/PWGHF/external/generator/selectNonHfe.C --- MC/config/PWGHF/{trigger => external/generator}/selectNonHfe.C | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename MC/config/PWGHF/{trigger => external/generator}/selectNonHfe.C (100%) diff --git a/MC/config/PWGHF/trigger/selectNonHfe.C b/MC/config/PWGHF/external/generator/selectNonHfe.C similarity index 100% rename from MC/config/PWGHF/trigger/selectNonHfe.C rename to MC/config/PWGHF/external/generator/selectNonHfe.C From 64e2241a0892910897f2b27209be3575834dbfbb Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 26 Apr 2026 15:38:59 +0530 Subject: [PATCH 13/14] Update GeneratorHF_Non_Hfe.ini --- MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini b/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini index 1cac89225..f5455e34d 100644 --- a/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini +++ b/MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini @@ -1,6 +1,6 @@ #### This configuration uses the Box generator to trigger π⁰/η production within the specified rapidity window [GeneratorExternal] -fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/trigger/selectNonHfe.C +fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/external/generator/selectNonHfe.C funcName = generatePythia8Box(0.1, 50.0) [GeneratorPythia8] config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg From 4f9435ed3b8fcf6d808afd6bfcfda3556322f22b Mon Sep 17 00:00:00 2001 From: Rashi gupta <167059733+rashigupt@users.noreply.github.com> Date: Sun, 26 Apr 2026 16:06:22 +0530 Subject: [PATCH 14/14] Update GeneratorHF_Non_Hfe.C --- MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C b/MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C index 2affeeb0c..fb2c280d9 100644 --- a/MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C +++ b/MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C @@ -1,4 +1,4 @@ -int External()() { +int External() { std::string path{"o2sim_Kine.root"}; const int pdgPi0 = 111;