Skip to content

Commit d07c87f

Browse files
authored
[PWGLF] Revise injected-particle pT and rapidity ranges and add .ini file for rare-resonance MC in pp at 5.36 TeV (#2471)
* Adjust LF resonance injection pT and rapidity ranges Use pT 0-15 GeV/c for f0 and 0-12 GeV/c for the remaining resonances. Set rapidity and eta configuration bounds to +/-0.8. Current Rare INIs use rapidity mode, so the eta bounds do not add an eta cut. Validation: both eta settings produce identical particles in a fixed-seed 500-event comparison with the actual O2 generator; all nine species, pT/y bounds, and gap=5 pass. * Add LF resonance injection INI for pp at 5.36 TeV Use the existing 5.36 TeV inelastic Pythia configuration with the shared resonance injection JSON, gap 5, rapidity mode, and the existing resonance decay settings. Validation: INI parsing and tracked references verified; differs from the 13.6 TeV INI only in its two MB configuration paths. * Register CI test for 5.36 TeV LF resonance INI Use the supported INI test redirection to share the Rare generator kinematics test with the 13.6 TeV setup. This fixes the missing-test failure without changing generator settings. Validation: run_generator_tests.sh --keep-artifacts --fail-immediately passed for the 5.36 TeV INI (100-event DPL eventgen, o2-sim --noGeant, generic kinematics, and Rare-specific checks). * Add dedicated CI macro for 5.36 TeV LF resonances Provide GeneratorLF_Resonances_pp5360_Rare.C with the existing Rare injection PDG, decay, and gap sanity checks. Remove the INI test redirection so CI discovers the dedicated macro by filename. Validation: the actual generator CI runner passed with 100 events, including DPL eventgen, o2-sim --noGeant, generic kinematics, and the dedicated External macro.
1 parent 8d5dc8b commit d07c87f

3 files changed

Lines changed: 167 additions & 45 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[GeneratorExternal]
2+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity_width.C
3+
funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_width_inj.json", true, 5, false, true, "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp536tev.cfg", "")
4+
5+
[GeneratorPythia8] # if triggered then this will be used as the background event
6+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_pp536tev.cfg
7+
8+
[DecayerPythia8] # after for transport code!
9+
config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg
10+
config[1]=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonances_width.cfg
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// Dedicated kinematics test for Rare resonance injection in pp at 5.36 TeV.
2+
3+
int External()
4+
{
5+
const std::string path{"o2sim_Kine.root"};
6+
const int numberOfGapEvents{4}; // generateLFRapidity(..., gap=5)
7+
const std::vector<int> injectedPDGs = {
8+
9010221, // f0(980)
9+
3324, -3324, // Xi(1530)0 and anti-Xi(1530)0
10+
123324, -123324, // Xi(1820)0 and anti-Xi(1820)0
11+
123314, -123314, // Xi(1820)- and Xi(1820)+
12+
123334, -123334 // Omega(2012)- and Omega(2012)+
13+
};
14+
const std::vector<std::vector<int>> decayDaughters = {
15+
{211, -211},
16+
{3312, 211}, {-3312, -211},
17+
{3122, 310}, {-3122, 310},
18+
{3122, -321}, {-3122, 321},
19+
{3312, 310}, {-3312, 310}
20+
};
21+
22+
TFile file(path.c_str(), "READ");
23+
if (file.IsZombie()) {
24+
std::cerr << "Cannot open ROOT file " << path << "\n";
25+
return 1;
26+
}
27+
auto tree = (TTree*)file.Get("o2sim");
28+
if (!tree) {
29+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
30+
return 1;
31+
}
32+
std::vector<o2::MCTrack>* tracks{};
33+
tree->SetBranchAddress("MCTrack", &tracks);
34+
35+
std::vector<int> nSignal(injectedPDGs.size(), 0);
36+
std::vector<int> nNotDecayed(injectedPDGs.size(), 0);
37+
std::vector<std::vector<int>> nDecays;
38+
for (const auto& daughters : decayDaughters) {
39+
nDecays.emplace_back(daughters.size(), 0);
40+
}
41+
42+
int numberOfEventsProcessed{0};
43+
int numberOfEventsProcessedWithoutInjection{0};
44+
for (Long64_t i = 0; i < tree->GetEntries(); ++i) {
45+
tree->GetEntry(i);
46+
++numberOfEventsProcessed;
47+
bool hasInjection{false};
48+
for (const auto& track : *tracks) {
49+
const auto pdg = track.GetPdgCode();
50+
const auto it = std::find(injectedPDGs.begin(), injectedPDGs.end(), pdg);
51+
if (it == injectedPDGs.end()) {
52+
continue;
53+
}
54+
const auto index = static_cast<size_t>(std::distance(injectedPDGs.begin(), it));
55+
++nSignal[index];
56+
if (track.getFirstDaughterTrackId() < 0) {
57+
++nNotDecayed[index];
58+
continue;
59+
}
60+
for (int j = track.getFirstDaughterTrackId(); j <= track.getLastDaughterTrackId(); ++j) {
61+
const auto pdgDau = tracks->at(j).GetPdgCode();
62+
bool foundDau{false};
63+
for (size_t k = 0; k < decayDaughters[index].size(); ++k) {
64+
if (pdgDau == decayDaughters[index][k]) {
65+
++nDecays[index][k];
66+
foundDau = true;
67+
hasInjection = true;
68+
break;
69+
}
70+
}
71+
if (!foundDau) {
72+
std::cerr << "Decay daughter not found: " << pdg << " -> " << pdgDau
73+
<< " (mother=" << track.getMotherTrackId()
74+
<< ", secondMother=" << track.getSecondMotherTrackId() << ")\n";
75+
}
76+
}
77+
}
78+
if (!hasInjection) {
79+
++numberOfEventsProcessedWithoutInjection;
80+
}
81+
}
82+
83+
std::cout << "--------------------------------\n";
84+
std::cout << "# Events: " << tree->GetEntries() << "\n";
85+
for (size_t i = 0; i < injectedPDGs.size(); ++i) {
86+
std::cout << "# Mother\n";
87+
std::cout << injectedPDGs[i] << " generated: " << nSignal[i]
88+
<< ", " << nNotDecayed[i] << " did not decay\n";
89+
for (size_t j = 0; j < decayDaughters[i].size(); ++j) {
90+
std::cout << "# Daughter " << decayDaughters[i][j] << ": " << nDecays[i][j] << "\n";
91+
}
92+
}
93+
std::cout << "--------------------------------\n";
94+
std::cout << "Number of events processed: " << numberOfEventsProcessed << "\n";
95+
std::cout << "Number of input for the gap events: " << numberOfGapEvents << "\n";
96+
std::cout << "Number of events processed without injection: "
97+
<< numberOfEventsProcessedWithoutInjection << "\n";
98+
const double ratioOfNormalEvents = numberOfEventsProcessed
99+
? static_cast<double>(numberOfEventsProcessedWithoutInjection) /
100+
numberOfEventsProcessed
101+
: 0.0;
102+
std::cout << "Fraction without injection: " << ratioOfNormalEvents << "\n";
103+
const double expectedRatio = static_cast<double>(numberOfGapEvents) / (numberOfGapEvents + 1);
104+
std::cout << "Expected fraction for 1+" << numberOfGapEvents << " pattern: " << expectedRatio << "\n";
105+
106+
// Same basic gap sanity check as the referenced O2DPG test.
107+
if (ratioOfNormalEvents > 0.90 || ratioOfNormalEvents < 0.70) {
108+
std::cerr << "The number of injected events is too low or too high\n";
109+
return 1;
110+
}
111+
return 0;
112+
}

MC/config/PWGLF/pythia8/generator/resonancelistgun_width_inj.json

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,99 +3,99 @@
33
"pdg": 9010221,
44
"n": 1,
55
"ptMin": 0.0,
6-
"ptMax": 20,
7-
"etaMin": -1.2,
8-
"etaMax": 1.2,
9-
"rapidityMin": -1.2,
10-
"rapidityMax": 1.2,
6+
"ptMax": 15,
7+
"etaMin": -0.8,
8+
"etaMax": 0.8,
9+
"rapidityMin": -0.8,
10+
"rapidityMax": 0.8,
1111
"genDecayed": true
1212
},
1313
"Xi(1530)0" : {
1414
"pdg": 3324,
1515
"n": 1,
1616
"ptMin": 0.0,
17-
"ptMax": 20,
18-
"etaMin": -1.2,
19-
"etaMax": 1.2,
20-
"rapidityMin": -1.2,
21-
"rapidityMax": 1.2,
17+
"ptMax": 12,
18+
"etaMin": -0.8,
19+
"etaMax": 0.8,
20+
"rapidityMin": -0.8,
21+
"rapidityMax": 0.8,
2222
"genDecayed": true
2323
},
2424
"anti-Xi(1530)0" : {
2525
"pdg": -3324,
2626
"n": 1,
2727
"ptMin": 0.0,
28-
"ptMax": 20,
29-
"etaMin": -1.2,
30-
"etaMax": 1.2,
31-
"rapidityMin": -1.2,
32-
"rapidityMax": 1.2,
28+
"ptMax": 12,
29+
"etaMin": -0.8,
30+
"etaMax": 0.8,
31+
"rapidityMin": -0.8,
32+
"rapidityMax": 0.8,
3333
"genDecayed": true
3434
},
3535
"Xi(1820)0" : {
3636
"pdg": 123324,
3737
"n": 1,
3838
"ptMin": 0.0,
39-
"ptMax": 20,
40-
"etaMin": -1.2,
41-
"etaMax": 1.2,
42-
"rapidityMin": -1.2,
43-
"rapidityMax": 1.2,
39+
"ptMax": 12,
40+
"etaMin": -0.8,
41+
"etaMax": 0.8,
42+
"rapidityMin": -0.8,
43+
"rapidityMax": 0.8,
4444
"genDecayed": true
4545
},
4646
"Anti-Xi(1820)0" : {
4747
"pdg": -123324,
4848
"n": 1,
4949
"ptMin": 0.0,
50-
"ptMax": 20,
51-
"etaMin": -1.2,
52-
"etaMax": 1.2,
53-
"rapidityMin": -1.2,
54-
"rapidityMax": 1.2,
50+
"ptMax": 12,
51+
"etaMin": -0.8,
52+
"etaMax": 0.8,
53+
"rapidityMin": -0.8,
54+
"rapidityMax": 0.8,
5555
"genDecayed": true
5656
},
5757
"Xi(1820)-" : {
5858
"pdg": 123314,
5959
"n": 1,
6060
"ptMin": 0.0,
61-
"ptMax": 20,
62-
"etaMin": -1.2,
63-
"etaMax": 1.2,
64-
"rapidityMin": -1.2,
65-
"rapidityMax": 1.2,
61+
"ptMax": 12,
62+
"etaMin": -0.8,
63+
"etaMax": 0.8,
64+
"rapidityMin": -0.8,
65+
"rapidityMax": 0.8,
6666
"genDecayed": true
6767
},
6868
"Xi(1820)+" : {
6969
"pdg": -123314,
7070
"n": 1,
7171
"ptMin": 0.0,
72-
"ptMax": 20,
73-
"etaMin": -1.2,
74-
"etaMax": 1.2,
75-
"rapidityMin": -1.2,
76-
"rapidityMax": 1.2,
72+
"ptMax": 12,
73+
"etaMin": -0.8,
74+
"etaMax": 0.8,
75+
"rapidityMin": -0.8,
76+
"rapidityMax": 0.8,
7777
"genDecayed": true
7878
},
7979
"Omega(2012)-" : {
8080
"pdg": 123334,
8181
"n": 1,
8282
"ptMin": 0.0,
83-
"ptMax": 20,
84-
"etaMin": -1.2,
85-
"etaMax": 1.2,
86-
"rapidityMin": -1.2,
87-
"rapidityMax": 1.2,
83+
"ptMax": 12,
84+
"etaMin": -0.8,
85+
"etaMax": 0.8,
86+
"rapidityMin": -0.8,
87+
"rapidityMax": 0.8,
8888
"genDecayed": true
8989
},
9090
"Omega(2012)+" : {
9191
"pdg": -123334,
9292
"n": 1,
9393
"ptMin": 0.0,
94-
"ptMax": 20,
95-
"etaMin": -1.2,
96-
"etaMax": 1.2,
97-
"rapidityMin": -1.2,
98-
"rapidityMax": 1.2,
94+
"ptMax": 12,
95+
"etaMin": -0.8,
96+
"etaMax": 0.8,
97+
"rapidityMin": -0.8,
98+
"rapidityMax": 0.8,
9999
"genDecayed": true
100100
}
101101
}

0 commit comments

Comments
 (0)