Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
200f5ad
Create the Non-HFE–enhanced dataset.
rashigupt Nov 23, 2025
db1cd10
Create the Non-HFE–enhanced dataset
rashigupt Nov 23, 2025
abd70d4
Create the Non-HFE–enhanced dataset
rashigupt Nov 23, 2025
41fabe0
Update and rename GeneratorHF_Non_Hfe_enhance.ini to GeneratorHF_Non_…
rashigupt Dec 22, 2025
fa2d14d
Create generator_pythia8_gaptriggered_nonhfe.C
rashigupt Dec 22, 2025
64baf33
Update generator_pythia8_gaptriggered_nonhfe.C
rashigupt Jan 10, 2026
c31e83c
remove build error
rashigupt Jan 10, 2026
71e837a
Update generator_pythia8_gaptriggered_nonhfe.C
rashigupt Jan 10, 2026
c2bdacf
Correct name
rashigupt Jan 11, 2026
738d263
correct name
rashigupt Jan 11, 2026
9f8a12b
remove build error
rashigupt Jan 11, 2026
b5239c1
remove e and add pion , eta ID
rashigupt Jan 11, 2026
1ae8543
Remove build error
rashigupt Jan 11, 2026
35ccc9a
Update generator_pythia8_gaptriggered_nonhfe.C
rashigupt Jan 11, 2026
99fdf6a
Update GeneratorHF_Non_Hfe.ini
rashigupt Jan 12, 2026
11f2902
Replace 1/2 to 1/3
rashigupt Jan 15, 2026
20a6450
ncrease the tolerance to 10%
rashigupt Jan 16, 2026
310f1a6
Update and rename MC/config/PWGHF/external/generator/generator_pythia…
rashigupt Feb 9, 2026
ead9fb3
Update GeneratorHF_Non_Hfe.ini
rashigupt Feb 9, 2026
24328aa
Update pythia8_NonHfe.cfg
rashigupt Feb 9, 2026
eca0412
Update GeneratorHF_Non_Hfe.C
rashigupt Feb 9, 2026
76c6771
Update GeneratorHF_Non_Hfe.ini
rashigupt Feb 9, 2026
8aff829
Add correctly pDg cut
rashigupt Feb 9, 2026
620e774
Update GeneratorHF_Non_Hfe.ini
rashigupt Feb 9, 2026
998d36f
usetriggerexternal
rashigupt Feb 9, 2026
fc6613f
Rename MC/config/PWGHF/trigger/selectNonHfe.C to MC/config/PWGHF/exte…
rashigupt Feb 9, 2026
6fc3f71
Update GeneratorHF_Non_Hfe.ini
rashigupt Feb 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions MC/config/PWGHF/external/generator/selectNonHfe.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include <TParticle.h>
#include "Generators/Trigger.h"
#include <vector>
#include <TMath.h>

///============================================================================

/// 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)
{
return [pdgPartForAccCut, rapidityMin, rapidityMax, minNb](const std::vector<TParticle>& particles) -> bool {
TObjArray* obj = pdgPartForAccCut.Tokenize(";");
int count = 0;
for (const auto& particle : particles) {
int pdg = TMath::Abs(particle.GetPdgCode());
double y = particle.Y();

if (y < rapidityMin || y > rapidityMax) continue;

for (int i = 0; i < obj->GetEntriesFast(); ++i) {
int pdgCode = std::stoi(obj->At(i)->GetName());

if (pdg == pdgCode) {
count++;
break;
}
}
}
// Only accept events with at least minNb π⁰/η
if (count >= minNb)
return kTRUE;
else
return kFALSE;
};
}
14 changes: 14 additions & 0 deletions MC/config/PWGHF/ini/GeneratorHF_Non_Hfe.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### The external generator trigger for π⁰/η within rapidity window
[TriggerExternal]
# Path to your trigger C++ file
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/external/generator/selectNonHfe.C

# Function name and arguments
# Arguments: pdgPartForAccCut (TString "111;221"), rapidityMin, rapidityMax, minNb
funcName = selectPionEtaWithinAcc("111;221",-1.5,1.5,1)

### The Pythia8 generator configuration
[GeneratorPythia8]
config = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg
includePartonEvent = true

68 changes: 68 additions & 0 deletions MC/config/PWGHF/ini/tests/GeneratorHF_Non_Hfe.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#include <TFile.h>
#include <TTree.h>
#include <vector>
#include <iostream>
#include <cmath>
#include "DataFormats/MCTrack.h"

int External() {
std::string path{"o2sim_Kine.root"};

const int pdgPi0 = 111;
const int pdgEta = 221;
const double yMin = -1.5;
const double yMax = 1.5;
const int minNb = 1;

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\n";
return 1;
}

std::vector<o2::MCTrack>* tracks{};
tree->SetBranchAddress("MCTrack", &tracks);

int nEvents = tree->GetEntries();
int nAccepted = 0;
int totalPi0 = 0, totalEta = 0;

for (int i = 0; i < nEvents; ++i) {
tree->GetEntry(i);

int count = 0;
for (auto& track : *tracks) {
int pdg = std::abs(track.GetPdgCode());
double y = track.GetRapidity();

if ((pdg == pdgPi0 || pdg == pdgEta) && y >= yMin && y <= yMax) {
count++;
if (pdg == pdgPi0) totalPi0++;
if (pdg == pdgEta) totalEta++;
}
}

if (count < minNb) {
std::cerr << " Trigger violation in event " << i
<< " (found " << count << " π0/η in rapidity window)\n";
return 1;
}

nAccepted++;
}

std::cout << "--------------------------------------\n";
std::cout << "Trigger test: π0/η within rapidity window\n";
std::cout << "Events tested: " << nEvents << "\n";
std::cout << "Events accepted: " << nAccepted << "\n";
std::cout << "# π0: " << totalPi0 << ", # η: " << totalEta << "\n";
std::cout << "Trigger test PASSED\n";

return 0;
}
41 changes: 41 additions & 0 deletions MC/config/PWGHF/pythia8/generator/pythia8_NonHfe.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
### authors: Rashi Gupta (rashi.gupta@cern.ch)
### authors: Ravindra Singh (ravindra.singh@cern.ch)
### electrons from pi0 and eta enhancement

### beams
Beams:idA 2212 # proton
Beams:idB 2212 # proton
Beams:eCM 13600. # GeV

### processes
SoftQCD:inelastic on # all inelastic processes

### decays
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

111:onIfAny = 11 # pi0 -> e+ e- gamma
221:onIfAny = 11 # eta -> e+ e- gamma