Skip to content

Commit e227d82

Browse files
authored
[PWGHF] Add config for Hb -> Hc + K decays (#1970)
* Add config for Hb -> Hc + K decays (correlated background in Hb -> Hc + pi) * Add ini file and test
1 parent f7e61c0 commit e227d82

File tree

3 files changed

+306
-0
lines changed

3 files changed

+306
-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_MC_CONFIG_ROOT}/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C
4+
funcName=GeneratorPythia8GapTriggeredBeauty(5, -1.5, 1.5)
5+
6+
[GeneratorPythia8]
7+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_beautyhadronic_with_BtoDK_Mode2.cfg
8+
includePartonEvent=true
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
int External() {
2+
std::string path{"o2sim_Kine.root"};
3+
4+
int checkPdgQuark{5};
5+
float ratioTrigger = 1./5; // one event triggered out of 5
6+
7+
std::vector<int> checkPdgHadron{411, 421, 431, 4122, 4132, 4232, 4332, 511, 521, 531, 5122};
8+
std::map<int, std::vector<std::vector<int>>> checkHadronDecays{ // sorted pdg of daughters
9+
{411, {{-321, 211, 211}, {-313, 211}, {211, 311}, {211, 333}}}, // D+
10+
{421, {{-321, 211}, {-321, 111, 211}}}, // D0
11+
{431, {{211, 333}, {-313, 321}}}, // Ds+
12+
{4122, {{-313, 2212}, {-321, 2224}, {211, 102134}, {-321, 211, 2212}, {311, 2212}}}, // Lc+
13+
{4132, {{211, 3312}}}, // Xic0
14+
{4232, {{-313, 2212}, {-321, 3324}, {211, 211, 3312}, {-321, 211, 2212}}}, // Xic+
15+
{4332, {{211, 3334}}}, // Omegac+
16+
{511, {{-411, 211}, {-411, 321}}}, // B0
17+
{521, {{-421, 211}, {-421, 321}}}, // B+
18+
{531, {{-431, 211}, {-431, 321}}}, // Bs0
19+
{5122, {{4122, -211}, {4122, -321}}} // Lb0
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+
28+
auto tree = (TTree *)file.Get("o2sim");
29+
std::vector<o2::MCTrack> *tracks{};
30+
tree->SetBranchAddress("MCTrack", &tracks);
31+
o2::dataformats::MCEventHeader *eventHeader = nullptr;
32+
tree->SetBranchAddress("MCEventHeader.", &eventHeader);
33+
34+
int nEventsMB{}, nEventsInj{};
35+
int nQuarks{}, nSignals{}, nSignalGoodDecay{};
36+
auto nEvents = tree->GetEntries();
37+
38+
for (int i = 0; i < nEvents; i++) {
39+
tree->GetEntry(i);
40+
41+
// check subgenerator information
42+
if (eventHeader->hasInfo(o2::mcgenid::GeneratorProperty::SUBGENERATORID)) {
43+
bool isValid = false;
44+
int subGeneratorId = eventHeader->getInfo<int>(o2::mcgenid::GeneratorProperty::SUBGENERATORID, isValid);
45+
if (subGeneratorId == 0) {
46+
nEventsMB++;
47+
} else if (subGeneratorId == checkPdgQuark) {
48+
nEventsInj++;
49+
}
50+
}
51+
52+
for (auto &track : *tracks) {
53+
auto pdg = track.GetPdgCode();
54+
if (std::abs(pdg) == checkPdgQuark) {
55+
nQuarks++;
56+
continue;
57+
}
58+
if (std::find(checkPdgHadron.begin(), checkPdgHadron.end(), std::abs(pdg)) != checkPdgHadron.end()) { // found signal
59+
nSignals++; // count signal PDG
60+
61+
std::vector<int> pdgsDecay{};
62+
std::vector<int> pdgsDecayAntiPart{};
63+
for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j) {
64+
auto pdgDau = tracks->at(j).GetPdgCode();
65+
pdgsDecay.push_back(pdgDau);
66+
if (pdgDau != 333) { // phi is antiparticle of itself
67+
pdgsDecayAntiPart.push_back(-pdgDau);
68+
} else {
69+
pdgsDecayAntiPart.push_back(pdgDau);
70+
}
71+
}
72+
73+
std::sort(pdgsDecay.begin(), pdgsDecay.end());
74+
std::sort(pdgsDecayAntiPart.begin(), pdgsDecayAntiPart.end());
75+
76+
for (auto &decay : checkHadronDecays[std::abs(pdg)]) {
77+
if (pdgsDecay == decay || pdgsDecayAntiPart == decay) {
78+
nSignalGoodDecay++;
79+
break;
80+
}
81+
}
82+
}
83+
}
84+
}
85+
86+
std::cout << "--------------------------------\n";
87+
std::cout << "# Events: " << nEvents << "\n";
88+
std::cout << "# MB events: " << nEventsMB << "\n";
89+
std::cout << Form("# events injected with %d quark pair: ", checkPdgQuark) << nEventsInj << "\n";
90+
std::cout << Form("# %d (anti)quarks: ", checkPdgQuark) << nQuarks << "\n";
91+
std::cout <<"# signal hadrons: " << nSignals << "\n";
92+
std::cout <<"# signal hadrons decaying in the correct channel: " << nSignalGoodDecay << "\n";
93+
94+
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
95+
std::cerr << "Number of generated MB events different than expected\n";
96+
return 1;
97+
}
98+
if (nEventsInj < nEvents * ratioTrigger * 0.95 || nEventsInj > nEvents * ratioTrigger * 1.05) {
99+
std::cerr << "Number of generated events injected with " << checkPdgQuark << " different than expected\n";
100+
return 1;
101+
}
102+
103+
if (nQuarks < nEvents * ratioTrigger) { // we expect anyway more because the same quark is repeated several time, after each gluon radiation
104+
std::cerr << "Number of generated (anti)quarks " << checkPdgQuark << " lower than expected\n";
105+
return 1;
106+
}
107+
108+
float fracForcedDecays = float(nSignalGoodDecay) / nSignals;
109+
if (fracForcedDecays < 0.85) { // we put some tolerance (e.g. due to oscillations which might change the final state)
110+
std::cerr << "Fraction of signals decaying into the correct channel " << fracForcedDecays << " lower than expected\n";
111+
return 1;
112+
}
113+
114+
return 0;
115+
}
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
### authors: Fabrizio Grosa (fabrizio.grosa@cern.ch)
2+
### Cristina Terrevoli (cristina.terrevoli@cern.ch)
3+
### Fabio Catalano (fabio.catalano@cern.ch)
4+
### last update: November 2023
5+
6+
### beams
7+
Beams:idA 2212 # proton
8+
Beams:idB 2212 # proton
9+
Beams:eCM 13600. # GeV
10+
11+
### processes
12+
SoftQCD:inelastic on # all inelastic processes
13+
14+
### decays
15+
ParticleDecays:limitTau0 on
16+
ParticleDecays:tau0Max 10.
17+
18+
### switching on Pythia Mode2
19+
ColourReconnection:mode 1
20+
ColourReconnection:allowDoubleJunRem off
21+
ColourReconnection:m0 0.3
22+
ColourReconnection:allowJunctions on
23+
ColourReconnection:junctionCorrection 1.20
24+
ColourReconnection:timeDilationMode 2
25+
ColourReconnection:timeDilationPar 0.18
26+
StringPT:sigma 0.335
27+
StringZ:aLund 0.36
28+
StringZ:bLund 0.56
29+
StringFlav:probQQtoQ 0.078
30+
StringFlav:ProbStoUD 0.2
31+
StringFlav:probQQ1toQQ0join 0.0275,0.0275,0.0275,0.0275
32+
MultiPartonInteractions:pT0Ref 2.15
33+
BeamRemnants:remnantMode 1
34+
BeamRemnants:saturation 5
35+
36+
# Correct decay lengths (wrong in PYTHIA8 decay table)
37+
# Lb
38+
5122:tau0 = 0.4390
39+
# Xic0
40+
4132:tau0 = 0.0455
41+
# OmegaC
42+
4332:tau0 = 0.0803
43+
44+
### Force golden charm hadrons decay modes for D2H studies
45+
### add D0 decays absent in PYTHIA8 decay table and set BRs from PDG for other
46+
421:oneChannel = 1 0.0389 0 -321 211
47+
421:addChannel = 1 0.00389 0 -321 211 111
48+
### add D+ decays absent in PYTHIA8 decay table and set BRs from PDG for other
49+
411:oneChannel = 1 0.0752 0 -321 211 211
50+
411:addChannel = 1 0.0104 0 -313 211
51+
411:addChannel = 1 0.0156 0 311 211
52+
411:addChannel = 1 0.0752 0 333 211 # to have the same amount of D+->KKpi and D+->Kpipi
53+
## add Lc decays absent in PYTHIA8 decay table and set BRs from PDG for other
54+
4122:oneChannel = 1 0.0196 100 2212 -313
55+
4122:addChannel = 1 0.0108 100 2224 -321
56+
4122:addChannel = 1 0.022 100 102134 211
57+
4122:addChannel = 1 0.035 0 2212 -321 211
58+
4122:addChannel = 1 0.0159 0 2212 311
59+
### add Xic+ decays absent in PYTHIA8 decay table
60+
4232:addChannel = 1 0.2 0 2212 -313
61+
4232:addChannel = 1 0.2 0 2212 -321 211
62+
4232:addChannel = 1 0.2 0 3324 211
63+
4232:addChannel = 1 0.2 0 3312 211 211
64+
### add Xic0 decays absent in PYTHIA8 decay table
65+
4132:addChannel = 1 0.0143 0 3312 211
66+
### add OmegaC decays absent in PYTHIA8 decay table
67+
4332:addChannel = 1 0.5 0 3334 211
68+
4332:addChannel = 1 0.5 0 3312 211
69+
70+
### K* -> K pi
71+
313:onMode = off
72+
313:onIfAll = 321 211
73+
### for Ds -> Phi pi+
74+
333:onMode = off
75+
333:onIfAll = 321 321
76+
### for D0 -> rho0 pi+ k-
77+
113:onMode = off
78+
113:onIfAll = 211 211
79+
### for Lambda_c -> Delta++ K-
80+
2224:onMode = off
81+
2224:onIfAll = 2212 211
82+
### for Lambda_c -> Lambda(1520) K-
83+
102134:onMode = off
84+
102134:onIfAll = 2212 321
85+
### for Xic0 -> pi Xi -> pi pi Lambda -> pi pi pi p
86+
### and Omega_c -> pi Xi -> pi pi Lambda -> pi pi pi p
87+
3312:onMode = off
88+
3312:onIfAll = 3122 -211
89+
3122:onMode = off
90+
3122:onIfAll = 2212 -211
91+
### for Omega_c -> pi Omega -> pi K Lambda -> pi K pi p
92+
3334:onMode = off
93+
3334:onIfAll = 3122 -321
94+
95+
### switch off all decay channels
96+
411:onMode = off
97+
421:onMode = off
98+
431:onMode = off
99+
4122:onMode = off
100+
4232:onMode = off
101+
4132:onMode = off
102+
443:onMode = off
103+
4332:onMode = off
104+
511:onMode = off
105+
521:onMode = off
106+
531:onMode = off
107+
5122:onMode = off
108+
109+
### D0 -> K pi
110+
421:onIfMatch = 321 211
111+
### D0 -> K pi pi0
112+
421:onIfMatch = 321 211 111
113+
114+
### D+/- -> K pi pi
115+
411:onIfMatch = 321 211 211
116+
### D+/- -> K* pi
117+
411:onIfMatch = 313 211
118+
### D+/- -> phi pi
119+
411:onIfMatch = 333 211
120+
121+
### D_s -> K K*
122+
431:onIfMatch = 321 313
123+
### D_s -> Phi pi
124+
431:onIfMatch = 333 211
125+
126+
### Lambda_c -> p K*
127+
4122:onIfMatch = 2212 313
128+
### Lambda_c -> Delta K
129+
4122:onIfMatch = 2224 321
130+
### Lambda_c -> Lambda(1520) pi
131+
4122:onIfMatch = 102134 211
132+
### Lambda_c -> p K pi
133+
4122:onIfMatch = 2212 321 211
134+
### Lambda_c -> pK0s
135+
4122:onIfMatch = 2212 311
136+
137+
### Xic+ -> pK*0
138+
4232:onIfMatch = 2212 313
139+
### Xic+ -> p K- pi+
140+
4232:onIfMatch = 2212 321 211
141+
### Xic+ -> Xi*0 pi+, Xi*->Xi- pi+
142+
4232:onIfMatch = 3324 211
143+
### Xic+ -> Xi- pi+ pi+
144+
4232:onIfMatch = 3312 211 211
145+
146+
### Xic0 -> Xi- pi+
147+
4132:onIfMatch = 3312 211
148+
149+
### Omega_c -> Omega pi
150+
4332:onIfMatch = 3334 211
151+
### Omega_c -> Xi pi
152+
4332:onIfMatch = 3312 211
153+
154+
### Force also golden beauty hadrons decay modes for D2H studies
155+
### add B0 decays
156+
511:oneChannel = 1 0.5 0 -411 211
157+
511:addChannel = 1 0.5 0 -411 321
158+
### add B+ decays
159+
521:oneChannel = 1 0.5 0 -421 211
160+
521:addChannel = 1 0.5 0 -421 321
161+
### add Bs decays
162+
531:oneChannel = 1 0.5 0 -431 211
163+
531:addChannel = 1 0.5 0 -431 321
164+
### add Lb decays
165+
5122:oneChannel = 1 0.5 0 4122 -211
166+
5122:addChannel = 1 0.5 0 4122 -321
167+
168+
### B0 -> D pi
169+
511:onIfMatch = 411 211
170+
### B0 -> D K
171+
511:onIfMatch = 411 321
172+
### B+ -> D0 pi
173+
521:onIfMatch = 421 211
174+
### B+ -> D0 K
175+
521:onIfMatch = 421 321
176+
### Bs -> Ds pi
177+
531:onIfMatch = 431 211
178+
### Bs -> Ds rho
179+
531:onIfMatch = 431 321
180+
### Lb -> Lc pi
181+
5122:onIfMatch = 4122 211
182+
### Lb -> Lc K
183+
5122:onIfMatch = 4122 321

0 commit comments

Comments
 (0)