Skip to content

Commit dff205f

Browse files
Luca610alcaliva
authored andcommitted
PWGHF: add ini for D resonances MCs for pp collisions (#1710)
* Simulation workflow for D resonances * fixed typo * fixed typo * Update pythia8_charmhadronic_with_decays_DReso.cfg, change CL1S1J1 parameter (cherry picked from commit 945d7f2)
1 parent d951504 commit dff205f

File tree

3 files changed

+385
-0
lines changed

3 files changed

+385
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### The external generator derives from GeneratorPythia8.
2+
[GeneratorExternal]
3+
fileName=${O2DPG_ROOT}/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C
4+
funcName=GeneratorPythia8GapTriggeredCharmAndBeauty(5, -1.5, 1.5)
5+
6+
[GeneratorPythia8]
7+
config=${O2DPG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_DReso.cfg
8+
includePartonEvent=true
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
int External() {
2+
std::string path{"o2sim_Kine.root"};
3+
4+
int checkPdgQuarkOne{4};
5+
int checkPdgQuarkTwo{5};
6+
float ratioTrigger = 1./5.; // one event triggered out of 5
7+
8+
std::vector<int> checkPdgHadron{411, 415, 421, 425, 431, 435, 511, 521, 531, 4122, 10411, 10421, 10433, 20423, 20433};
9+
std::map<int, std::vector<std::vector<int>>> checkHadronDecays{ // sorted pdg of daughters
10+
{411, {{-321, 211, 211}, {-313, 211}, {211, 311}, {211, 333}}}, // D+
11+
{415, {{211, 421}}}, // D2*(2460)+
12+
{421, {{-321, 211}, {-321, 111, 211}}}, // D0
13+
{425, {{-211, 413},{-211, 411}}}, // D2*(2460)0
14+
{431, {{211, 333}, {-313, 321}}}, // Ds+
15+
{425, {{311, 413}, {311, 411}, {321,421}}}, // Ds2*(2573)
16+
{511, {{-415, -11, 12}, {-10411, -11, 12}, {-415, -13, 14}, {-10411, -13, 14}, {-415, -15, 16}, {-10411, -15, 16},
17+
{-10411, 211}, {-10421, 211}, {-415, 433}, { -415, 431}, {-415, 211}, {-415, 213} }}, // B0
18+
{521, {{-20423, -11, 12}, {-425, -11, 12}, {-10421, -11, 12}, {-20423, -13, 14}, {-425, -13, 14}, {-10421, -13, 14},
19+
{-20423, -15, 16}, {-425, -15, 16}, {-10421, -15, 16}, {-20423, 211}, {-20423, 213}, {-20423, 431}, {-20423, 433},
20+
{-425, 211}, {-425, 213}, {-425, 431}, {-425, 433}}}, // B+
21+
{531, {{-435, -11, 12}, {-10433, -11, 12}, {-435, -13, 14}, {-10433, -13, 14}, {-435, -15, 16}, {-10433, -15, 16},
22+
{-435, 211}, {-20433, 211}, {-20433, 213}}},// Bs0
23+
{4122, {{-313, 2212}, {-321, 2224}, {211, 3124}, {-321, 211, 2212}, {311, 2212}}}, // Lc+
24+
{10411, {{211, 421}}}, // D0*+
25+
{10421, {{-211, 411}}}, // D0*0
26+
{10433, {{311, 413}}}, // Ds1(2536)
27+
{20423, {{-211, 413}}}, // D1(2430)0
28+
{20433, {{22, 431}, {-211, 211, 431} }} // Ds1 (2460)
29+
};
30+
31+
TFile file(path.c_str(), "READ");
32+
if (file.IsZombie()) {
33+
std::cerr << "Cannot open ROOT file " << path << "\n";
34+
return 1;
35+
}
36+
37+
auto tree = (TTree *)file.Get("o2sim");
38+
std::vector<o2::MCTrack> *tracks{};
39+
tree->SetBranchAddress("MCTrack", &tracks);
40+
o2::dataformats::MCEventHeader *eventHeader = nullptr;
41+
tree->SetBranchAddress("MCEventHeader.", &eventHeader);
42+
43+
int nEventsMB{}, nEventsInjOne{}, nEventsInjTwo{};
44+
int nQuarksOne{}, nQuarksTwo{}, nSignals{}, nSignalGoodDecay{};
45+
auto nEvents = tree->GetEntries();
46+
47+
for (int i = 0; i < nEvents; i++) {
48+
tree->GetEntry(i);
49+
50+
// check subgenerator information
51+
if (eventHeader->hasInfo(o2::mcgenid::GeneratorProperty::SUBGENERATORID)) {
52+
bool isValid = false;
53+
int subGeneratorId = eventHeader->getInfo<int>(o2::mcgenid::GeneratorProperty::SUBGENERATORID, isValid);
54+
if (subGeneratorId == 0) {
55+
nEventsMB++;
56+
} else if (subGeneratorId == checkPdgQuarkOne) {
57+
nEventsInjOne++;
58+
} else if (subGeneratorId == checkPdgQuarkTwo) {
59+
nEventsInjTwo++;
60+
}
61+
}
62+
63+
for (auto &track : *tracks) {
64+
auto pdg = track.GetPdgCode();
65+
if (std::abs(pdg) == checkPdgQuarkOne) {
66+
nQuarksOne++;
67+
continue;
68+
}
69+
if (std::abs(pdg) == checkPdgQuarkTwo) {
70+
nQuarksTwo++;
71+
continue;
72+
}
73+
if (std::find(checkPdgHadron.begin(), checkPdgHadron.end(), std::abs(pdg)) != checkPdgHadron.end()) { // found signal
74+
nSignals++; // count signal PDG
75+
76+
std::vector<int> pdgsDecay{};
77+
std::vector<int> pdgsDecayAntiPart{};
78+
for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j) {
79+
auto pdgDau = tracks->at(j).GetPdgCode();
80+
pdgsDecay.push_back(pdgDau);
81+
if (pdgDau != 333) { // phi is antiparticle of itself
82+
pdgsDecayAntiPart.push_back(-pdgDau);
83+
} else {
84+
pdgsDecayAntiPart.push_back(pdgDau);
85+
}
86+
}
87+
88+
std::sort(pdgsDecay.begin(), pdgsDecay.end());
89+
std::sort(pdgsDecayAntiPart.begin(), pdgsDecayAntiPart.end());
90+
91+
for (auto &decay : checkHadronDecays[std::abs(pdg)]) {
92+
if (pdgsDecay == decay || pdgsDecayAntiPart == decay) {
93+
nSignalGoodDecay++;
94+
break;
95+
}
96+
}
97+
}
98+
}
99+
}
100+
101+
std::cout << "--------------------------------\n";
102+
std::cout << "# Events: " << nEvents << "\n";
103+
std::cout << "# MB events: " << nEventsMB << "\n";
104+
std::cout << Form("# events injected with %d quark pair: ", checkPdgQuarkOne) << nEventsInjOne << "\n";
105+
std::cout << Form("# events injected with %d quark pair: ", checkPdgQuarkTwo) << nEventsInjTwo << "\n";
106+
std::cout << Form("# %d (anti)quarks: ", checkPdgQuarkOne) << nQuarksOne << "\n";
107+
std::cout << Form("# %d (anti)quarks: ", checkPdgQuarkTwo) << nQuarksTwo << "\n";
108+
std::cout <<"# signal hadrons: " << nSignals << "\n";
109+
std::cout <<"# signal hadrons decaying in the correct channel: " << nSignalGoodDecay << "\n";
110+
111+
if (nEventsMB < nEvents * (1 - ratioTrigger) * 0.95 || nEventsMB > nEvents * (1 - ratioTrigger) * 1.05) { // we put some tolerance since the number of generated events is small
112+
std::cerr << "Number of generated MB events different than expected\n";
113+
return 1;
114+
}
115+
if (nEventsInjOne < nEvents * ratioTrigger * 0.5 * 0.95 || nEventsInjOne > nEvents * ratioTrigger * 0.5 * 1.05) {
116+
std::cerr << "Number of generated events injected with " << checkPdgQuarkOne << " different than expected\n";
117+
return 1;
118+
}
119+
if (nEventsInjTwo < nEvents * ratioTrigger * 0.5 * 0.95 || nEventsInjTwo > nEvents * ratioTrigger * 0.5 * 1.05) {
120+
std::cerr << "Number of generated events injected with " << checkPdgQuarkTwo << " different than expected\n";
121+
return 1;
122+
}
123+
124+
if (nQuarksOne < nEvents * ratioTrigger) { // we expect anyway more because the same quark is repeated several time, after each gluon radiation
125+
std::cerr << "Number of generated (anti)quarks " << checkPdgQuarkOne << " lower than expected\n";
126+
return 1;
127+
}
128+
if (nQuarksTwo < nEvents * ratioTrigger) { // we expect anyway more because the same quark is repeated several time, after each gluon radiation
129+
std::cerr << "Number of generated (anti)quarks " << checkPdgQuarkTwo << " lower than expected\n";
130+
return 1;
131+
}
132+
133+
float fracForcedDecays = float(nSignalGoodDecay) / nSignals;
134+
if (fracForcedDecays < 0.9) { // we put some tolerance (e.g. due to oscillations which might change the final state)
135+
std::cerr << "Fraction of signals decaying into the correct channel " << fracForcedDecays << " lower than expected\n";
136+
return 1;
137+
}
138+
139+
return 0;
140+
}
Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
### author: Stefano Politano, Luca Aglietta (stefano.politano@cern.ch, luca.aglietta@cern.ch)
2+
### since: July 2024
3+
4+
### beams
5+
Beams:idA 2212 # proton
6+
Beams:idB 2212 # proton
7+
Beams:eCM 13600. # GeV
8+
9+
### processes
10+
SoftQCD:inelastic on # all inelastic processes
11+
12+
### decays
13+
ParticleDecays:limitTau0 on
14+
ParticleDecays:tau0Max 10.
15+
16+
# parameters to boost resonances production
17+
StringFlav:mesonCL1S0J1= 3
18+
StringFlav:mesonCL1S1J2= 3.2
19+
StringFlav:mesonCL1S1J0= 0.75
20+
StringFlav:mesonCL1S1J1= 1.
21+
22+
23+
### turn off all charm resonances decays
24+
10433:onMode = off # Ds1(2536)
25+
435:onMode = off # Ds2*(2573)
26+
425:onMode = off # D2*(2460)0
27+
415:onMode = off # D2*(2460)+
28+
10411:onMode = off # D0*+
29+
10421:onMode = off # D0*0
30+
20433:onMode = off # Ds1 (2460)
31+
20423:onMode = off # D1(2430)0
32+
33+
### turn off all beauty hadron decays
34+
531:onMode = off
35+
511:onMode = off
36+
521:onMode = off
37+
38+
### add D1(2430)0
39+
20423:oneChannel = 1 1 0 413 -211
40+
20423:onIfMatch = 413 -211
41+
42+
### add Ds1(2536)
43+
10433:oneChannel = 1 1 0 413 311
44+
10433:onIfMatch = 413 311
45+
46+
### Ds1 (2460)
47+
20433:oneChannel = 1 0.5 0 431 22
48+
20433:addChannel = 1 0.5 0 431 211 -211
49+
20433:onIfMatch = 431 22
50+
20433:onIfMatch = 431 211 211
51+
52+
### add Ds2*(2573)
53+
435:oneChannel = 1 0.0500000 0 413 311
54+
435:addChannel = 1 0.4500000 0 411 311
55+
435:addChannel = 1 0.4500000 0 421 321
56+
435:onIfMatch = 413 311
57+
435:onIfMatch = 411 311
58+
435:onIfMatch = 421 321
59+
60+
### add D2*(2460)0
61+
425:oneChannel = 1 0.5 0 413 -211
62+
425:addChannel = 1 0.5 0 411 -211
63+
425:onIfMatch = 413 211
64+
425:onIfMatch = 411 211
65+
66+
### add D2*(2460)+
67+
415:oneChannel = 1 1 0 421 211
68+
415:onIfMatch = 421 211
69+
70+
71+
### add D0*+
72+
10411:oneChannel = 1 1 0 421 211
73+
10411:onIfMatch = 421 211
74+
75+
### add D0*0
76+
10421:oneChannel = 1 1 0 411 -211
77+
10421:onIfMatch = 411 211
78+
79+
80+
### add Bs0
81+
531:oneChannel = 1 0.0070000 0 12 -11 -435
82+
531:addChannel = 1 0.0070000 0 12 -11 -10433
83+
531:addChannel = 1 0.0070000 0 14 -13 -435
84+
531:addChannel = 1 0.0070000 0 14 -13 -10433
85+
531:addChannel = 1 0.0040000 0 14 -13 -20433
86+
531:addChannel = 1 0.0160000 0 16 -15 -433
87+
531:addChannel = 1 0.0028000 0 16 -15 -435
88+
531:addChannel = 1 0.0028000 0 16 -15 -10433
89+
531:addChannel = 1 0.0013000 0 -435 211
90+
531:addChannel = 1 0.0008000 0 -20433 211
91+
531:addChannel = 1 0.0021000 0 -20433 213
92+
93+
531:onIfMatch = 12 11 435
94+
531:onIfMatch = 12 11 10433
95+
531:onIfMatch = 14 13 435
96+
531:onIfMatch = 14 13 10433
97+
531:onIfMatch = 14 13 20433
98+
531:onIfMatch = 16 15 433
99+
531:onIfMatch = 16 15 435
100+
531:onIfMatch = 16 15 10433
101+
531:onIfMatch = 435 211
102+
531:onIfMatch = 20433 211
103+
531:onIfMatch = 20433 213
104+
105+
### add B0
106+
511:oneChannel = 1 0.0023000 0 12 -11 -415
107+
511:addChannel = 1 0.0045000 0 12 -11 -10411
108+
511:addChannel = 1 0.0023000 0 14 -13 -415
109+
511:addChannel = 1 0.0045000 0 14 -13 -10411
110+
511:addChannel = 1 0.0020000 0 16 -15 -415
111+
511:addChannel = 1 0.0013000 0 16 -15 -10411
112+
511:addChannel = 1 0.0002000 0 -10411 211
113+
511:addChannel = 1 0.0009100 0 -10421 211
114+
511:addChannel = 1 0.0040000 0 433 -415
115+
511:addChannel = 1 0.0042000 0 431 -415
116+
511:addChannel = 1 0.0009000 0 -415 211
117+
511:addChannel = 1 0.0022000 0 -415 213
118+
119+
511:onIfMatch = 12 11 415
120+
511:onIfMatch = 12 11 10411
121+
511:onIfMatch = 14 13 415
122+
511:onIfMatch = 14 13 10411
123+
511:onIfMatch = 16 15 415
124+
511:onIfMatch = 16 15 10411
125+
511:onIfMatch = 10411 211
126+
511:onIfMatch = 10421 211
127+
511:onIfMatch = 433 415
128+
511:onIfMatch = 431 415
129+
511:onIfMatch = 415 211
130+
511:onIfMatch = 415 213
131+
132+
### add B+
133+
521:oneChannel = 1 0.0090000 0 12 -11 -20423
134+
521:addChannel = 1 0.0090000 0 14 -13 -20423
135+
521:addChannel = 1 0.0020000 0 16 -15 -20423
136+
521:addChannel = 1 0.0030000 0 12 -11 -425
137+
521:addChannel = 1 0.0030000 0 14 -13 -425
138+
521:addChannel = 1 0.0020000 0 16 -15 -425
139+
521:addChannel = 1 0.0049000 0 12 -11 -10421
140+
521:addChannel = 1 0.0049000 0 14 -13 -10421
141+
521:addChannel = 1 0.0013000 0 16 -15 -10421
142+
521:addChannel = 1 0.0007500 0 -20423 211
143+
521:addChannel = 1 0.0022000 0 -20423 213
144+
521:addChannel = 1 0.0006000 0 -20423 431
145+
521:addChannel = 1 0.0012000 0 -20423 433
146+
521:addChannel = 1 0.0008000 0 -425 211
147+
521:addChannel = 1 0.0038000 0 -425 213
148+
521:addChannel = 1 0.0042000 0 431 -425
149+
521:addChannel = 1 0.0040000 0 433 -425
150+
151+
521:onIfMatch = 12 11 20423
152+
521:onIfMatch = 14 13 20423
153+
521:onIfMatch = 16 15 20423
154+
521:onIfMatch = 12 11 425
155+
521:onIfMatch = 14 13 425
156+
521:onIfMatch = 16 15 425
157+
521:onIfMatch = 12 11 10421
158+
521:onIfMatch = 14 13 10421
159+
521:onIfMatch = 16 15 10421
160+
521:onIfMatch = 20423 211
161+
521:onIfMatch = 20423 213
162+
521:onIfMatch = 20423 431
163+
521:onIfMatch = 20423 433
164+
521:onIfMatch = 425 211
165+
521:onIfMatch = 425 213
166+
521:onIfMatch = 431 425
167+
521:onIfMatch = 433 425
168+
169+
# Correct decay lengths (wrong in PYTHIA8 decay table)
170+
# Lb
171+
5122:tau0 = 0.4390
172+
# Xic0
173+
4132:tau0 = 0.0455
174+
# OmegaC
175+
4332:tau0 = 0.0803
176+
177+
### Force golden charm hadrons decay modes for D2H studies
178+
### add D+ decays absent in PYTHIA8 decay table and set BRs from PDG for other
179+
411:oneChannel = 1 0.0752 0 -321 211 211
180+
411:addChannel = 1 0.0104 0 -313 211
181+
411:addChannel = 1 0.0156 0 311 211
182+
411:addChannel = 1 0.0752 0 333 211 # to have the same amount of D+->KKpi and D+->Kpipi
183+
## add Lc decays absent in PYTHIA8 decay table and set BRs from PDG for other
184+
4122:oneChannel = 1 0.0196 100 2212 -313
185+
4122:addChannel = 1 0.0108 100 2224 -321
186+
4122:addChannel = 1 0.022 100 102134 211
187+
4122:addChannel = 1 0.035 0 2212 -321 211
188+
4122:addChannel = 1 0.0159 0 2212 311
189+
190+
### K* -> K pi
191+
313:onMode = off
192+
313:onIfAll = 321 211
193+
### for Ds -> Phi pi+
194+
333:onMode = off
195+
333:onIfAll = 321 321
196+
### for D0 -> rho0 pi+ k-
197+
113:onMode = off
198+
113:onIfAll = 211 211
199+
### for Lambda_c -> Delta++ K-
200+
2224:onMode = off
201+
2224:onIfAll = 2212 211
202+
### for Lambda_c -> Lambda(1520) K-
203+
102134:onMode = off
204+
102134:onIfAll = 2212 321
205+
206+
### switch off all decay channels
207+
411:onMode = off
208+
421:onMode = off
209+
431:onMode = off
210+
4122:onMode = off
211+
212+
### D0 -> K pi
213+
421:onIfMatch = 321 211
214+
215+
### D+/- -> K pi pi
216+
411:onIfMatch = 321 211 211
217+
### D+/- -> K* pi
218+
411:onIfMatch = 313 211
219+
### D+/- -> phi pi
220+
411:onIfMatch = 333 211
221+
222+
### D_s -> K K*
223+
431:onIfMatch = 321 313
224+
### D_s -> Phi pi
225+
431:onIfMatch = 333 211
226+
227+
### Lambda_c -> p K*
228+
4122:onIfMatch = 2212 313
229+
### Lambda_c -> Delta K
230+
4122:onIfMatch = 2224 321
231+
### Lambda_c -> Lambda(1520) pi
232+
4122:onIfMatch = 102134 211
233+
### Lambda_c -> p K pi
234+
4122:onIfMatch = 2212 321 211
235+
### Lambda_c -> pK0s
236+
4122:onIfMatch = 2212 311
237+

0 commit comments

Comments
 (0)