Skip to content

Commit e09b9ba

Browse files
authored
PWGHF: add semimuonic process with acceptance -4.3 to -2.2 (#1804)
* Add files via upload .cfg for semimuonic decays (c and b) * Add files via upload HF generator for semimuonic decays * Add files via upload test MC of semimuonic decays at kinematics * remove unnecessary channels and updated one comment * removed unnecessary decay channels and corrected a comment * Update pythia8_beauty_with_mudecays_Mode2.cfg corrected the decay channels (wrong comments in run 2 decayer) * Update pythia8_charm_with_mudecays_Mode2.cfg the decay channels are corrected (the comments were not correct in the Run 2 PYTHIA8 decayer) * Update O2DPG_ROOT to O2DPG_MC_CONFIG_ROOT
1 parent 043a97b commit e09b9ba

6 files changed

+361
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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, -4.3, -2.2)
5+
[GeneratorPythia8]
6+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_beauty_with_mudecays_Mode2.cfg
7+
includePartonEvent=true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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=GeneratorPythia8GapTriggeredCharm(5, -4.3, -2.2)
5+
[GeneratorPythia8]
6+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_charm_with_mudecays_Mode2.cfg
7+
includePartonEvent=true
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
int External() {
2+
3+
int checkPdgDecayMuon = 13;
4+
int checkPdgQuark = 5;
5+
6+
float ratioTrigger = 1. / 5; // one event triggered out of 5
7+
8+
std::string path{"o2sim_Kine.root"};
9+
10+
TFile file(path.c_str(), "READ");
11+
if (file.IsZombie()) {
12+
std::cerr << "Cannot open ROOT file" << path << "\n";
13+
return 1;
14+
}
15+
16+
auto tree = (TTree *)file.Get("o2sim");
17+
if (!tree) {
18+
std::cerr << "Cannot find tree o2sim in file" << path << "\n";
19+
return 1;
20+
}
21+
22+
std::vector<o2::MCTrack> *tracks{};
23+
tree->SetBranchAddress("MCTrack", &tracks);
24+
25+
o2::dataformats::MCEventHeader *eventHeader = nullptr;
26+
tree->SetBranchAddress("MCEventHeader.", &eventHeader);
27+
28+
int nEventsMB{};
29+
int nEventsInj{};
30+
int nQuarks{};
31+
int nMuons{};
32+
33+
int nMuonsInAcceptance{};
34+
35+
auto nEvents = tree->GetEntries();
36+
37+
for (int i = 0; i < nEvents; i++) {
38+
tree->GetEntry(i);
39+
// check subgenerator information
40+
if (eventHeader->hasInfo(o2::mcgenid::GeneratorProperty::SUBGENERATORID)) {
41+
bool isValid = false;
42+
int subGeneratorId = eventHeader->getInfo<int>(
43+
o2::mcgenid::GeneratorProperty::SUBGENERATORID, isValid);
44+
if (subGeneratorId == 0) {
45+
nEventsMB++;
46+
} else if (subGeneratorId == checkPdgQuark) {
47+
nEventsInj++;
48+
}
49+
} // if event header
50+
51+
int nmuonsev = 0;
52+
int nmuonsevinacc = 0;
53+
54+
for (auto &track : *tracks) {
55+
auto pdg = track.GetPdgCode();
56+
if (std::abs(pdg) == checkPdgQuark) {
57+
nQuarks++;
58+
continue;
59+
} // pdgquark
60+
auto y = track.GetRapidity();
61+
if (std::abs(pdg) == checkPdgDecayMuon) {
62+
int igmother = track.getMotherTrackId();
63+
auto gmTrack = (*tracks)[igmother];
64+
int gmpdg = gmTrack.GetPdgCode();
65+
if (int(std::abs(gmpdg) / 100.) == 5 ||
66+
int(std::abs(gmpdg) / 1000.) == 5) {
67+
nMuons++;
68+
nmuonsev++;
69+
if (-4.3 < y && y < -2.2) {
70+
nMuonsInAcceptance++;
71+
nmuonsevinacc++;
72+
}
73+
} // gmpdg
74+
75+
} // pdgdecay
76+
77+
} // loop track
78+
// std::cout << "#muons per event: " << nmuonsev << "\n";
79+
// std::cout << "#muons in acceptance per event: " << nmuonsev << "\n";
80+
} // events
81+
82+
std::cout << "#events: " << nEvents << "\n";
83+
std::cout << "# MB events: " << nEventsMB << "\n";
84+
std::cout << Form("# events injected with %d quark pair: ", checkPdgQuark)
85+
<< nEventsInj << "\n";
86+
if (nEventsMB < nEvents * (1 - ratioTrigger) * 0.95 ||
87+
nEventsMB > nEvents * (1 - ratioTrigger) *
88+
1.05) { // we put some tolerance since the number of
89+
// generated events is small
90+
std::cerr << "Number of generated MB events different than expected\n";
91+
return 1;
92+
}
93+
if (nEventsInj < nEvents * ratioTrigger * 0.95 ||
94+
nEventsInj > nEvents * ratioTrigger * 1.05) {
95+
std::cerr << "Number of generated events injected with " << checkPdgQuark
96+
<< " different than expected\n";
97+
return 1;
98+
}
99+
std::cout << "#muons: " << nMuons << "\n";
100+
std::cout << "#muons in acceptance: " << nMuonsInAcceptance << "\n";
101+
102+
return 0;
103+
} // external
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
int External() {
2+
3+
int checkPdgDecayMuon = 13;
4+
int checkPdgQuark = 4;
5+
6+
float ratioTrigger = 1. / 5; // one event triggered out of 5
7+
8+
std::string path{"o2sim_Kine.root"};
9+
10+
TFile file(path.c_str(), "READ");
11+
if (file.IsZombie()) {
12+
std::cerr << "Cannot open ROOT file" << path << "\n";
13+
return 1;
14+
}
15+
16+
auto tree = (TTree *)file.Get("o2sim");
17+
if (!tree) {
18+
std::cerr << "Cannot find tree o2sim in file" << path << "\n";
19+
return 1;
20+
}
21+
22+
std::vector<o2::MCTrack> *tracks{};
23+
tree->SetBranchAddress("MCTrack", &tracks);
24+
25+
o2::dataformats::MCEventHeader *eventHeader = nullptr;
26+
tree->SetBranchAddress("MCEventHeader.", &eventHeader);
27+
28+
int nEventsMB{};
29+
int nEventsInj{};
30+
int nQuarks{};
31+
int nMuons{};
32+
33+
int nMuonsInAcceptance{};
34+
35+
auto nEvents = tree->GetEntries();
36+
37+
for (int i = 0; i < nEvents; i++) {
38+
tree->GetEntry(i);
39+
// check subgenerator information
40+
if (eventHeader->hasInfo(o2::mcgenid::GeneratorProperty::SUBGENERATORID)) {
41+
bool isValid = false;
42+
int subGeneratorId = eventHeader->getInfo<int>(
43+
o2::mcgenid::GeneratorProperty::SUBGENERATORID, isValid);
44+
if (subGeneratorId == 0) {
45+
nEventsMB++;
46+
} else if (subGeneratorId == checkPdgQuark) {
47+
nEventsInj++;
48+
}
49+
} // if event header
50+
51+
int nmuonsev = 0;
52+
int nmuonsevinacc = 0;
53+
54+
for (auto &track : *tracks) {
55+
auto pdg = track.GetPdgCode();
56+
if (std::abs(pdg) == checkPdgQuark) {
57+
nQuarks++;
58+
continue;
59+
} // pdgquark
60+
auto y = track.GetRapidity();
61+
if (std::abs(pdg) == checkPdgDecayMuon) {
62+
int igmother = track.getMotherTrackId();
63+
auto gmTrack = (*tracks)[igmother];
64+
int gmpdg = gmTrack.GetPdgCode();
65+
if (int(std::abs(gmpdg) / 100.) == 5 ||
66+
int(std::abs(gmpdg) / 1000.) == 5) {
67+
nMuons++;
68+
nmuonsev++;
69+
if (-4.3 < y && y < -2.2) {
70+
nMuonsInAcceptance++;
71+
nmuonsevinacc++;
72+
}
73+
} // gmpdg
74+
75+
} // pdgdecay
76+
77+
} // loop track
78+
// std::cout << "#muons per event: " << nmuonsev << "\n";
79+
// std::cout << "#muons in acceptance per event: " << nmuonsev << "\n";
80+
} // events
81+
82+
std::cout << "#events: " << nEvents << "\n";
83+
std::cout << "# MB events: " << nEventsMB << "\n";
84+
std::cout << Form("# events injected with %d quark pair: ", checkPdgQuark)
85+
<< nEventsInj << "\n";
86+
if (nEventsMB < nEvents * (1 - ratioTrigger) * 0.95 ||
87+
nEventsMB > nEvents * (1 - ratioTrigger) *
88+
1.05) { // we put some tolerance since the number of
89+
// generated events is small
90+
std::cerr << "Number of generated MB events different than expected\n";
91+
return 1;
92+
}
93+
if (nEventsInj < nEvents * ratioTrigger * 0.95 ||
94+
nEventsInj > nEvents * ratioTrigger * 1.05) {
95+
std::cerr << "Number of generated events injected with " << checkPdgQuark
96+
<< " different than expected\n";
97+
return 1;
98+
}
99+
std::cout << "#muons: " << nMuons << "\n";
100+
std::cout << "#muons in acceptance: " << nMuonsInAcceptance << "\n";
101+
102+
return 0;
103+
} // external
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
### authors: Fabrizio Grosa (fabrizio.grosa@cern.ch)
2+
### Cristina Terrevoli (cristina.terrevoli@cern.ch)
3+
### Fabio Catalano (fabio.catalano@cern.ch)
4+
### Nicole Bastid (nicole.bastid@cern.ch)
5+
### Beauty decay muons
6+
### last update: November 2024
7+
8+
### beams
9+
Beams:idA 2212 # proton
10+
Beams:idB 2212 # proton
11+
Beams:eCM 13600. # GeV
12+
13+
### processes
14+
SoftQCD:inelastic on # all inelastic processes
15+
16+
### decays
17+
ParticleDecays:limitTau0 on
18+
ParticleDecays:tau0Max 10.
19+
20+
### switching on Pythia Mode2
21+
ColourReconnection:mode 1
22+
ColourReconnection:allowDoubleJunRem off
23+
ColourReconnection:m0 0.3
24+
ColourReconnection:allowJunctions on
25+
ColourReconnection:junctionCorrection 1.20
26+
ColourReconnection:timeDilationMode 2
27+
ColourReconnection:timeDilationPar 0.18
28+
StringPT:sigma 0.335
29+
StringZ:aLund 0.36
30+
StringZ:bLund 0.56
31+
StringFlav:probQQtoQ 0.078
32+
StringFlav:ProbStoUD 0.2
33+
StringFlav:probQQ1toQQ0join 0.0275,0.0275,0.0275,0.0275
34+
MultiPartonInteractions:pT0Ref 2.15
35+
BeamRemnants:remnantMode 1
36+
BeamRemnants:saturation 5
37+
38+
# Correct decay lengths (wrong in PYTHIA8 decay table)
39+
# Lb
40+
5122:tau0 = 0.4390
41+
# Xic0
42+
4132:tau0 = 0.0455
43+
# OmegaC
44+
4332:tau0 = 0.0803
45+
46+
47+
### switch off all decay channels for charm
48+
511:onMode = off
49+
521:onMode = off
50+
531:onMode = off
51+
5122:onMode = off
52+
5132:onMode = off
53+
5232:onMode = off
54+
5332:onMode = off
55+
56+
###Semimuonic decays of charm
57+
58+
### B0 -> mu X
59+
511:onIfAny = 13
60+
### B+/- -> mu X
61+
521:onIfAny = 13
62+
### B_s -> mu X
63+
531:onIfAny = 13
64+
### Lambda_b -> mu X
65+
5122:onIfAny = 13
66+
### Xsi_b -> mu X
67+
5132:onIfAny = 13
68+
### Xsi0_b -> mu X
69+
5232:onIfAny = 13
70+
### Omega_b -> mu X
71+
5332:onIfAny = 13
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
### authors: Fabrizio Grosa (fabrizio.grosa@cern.ch)
2+
### Cristina Terrevoli (cristina.terrevoli@cern.ch)
3+
### Fabio Catalano (fabio.catalano@cern.ch)
4+
### Nicole Bastid (nicole.bastid@cern.ch)
5+
### charm decay muons
6+
### last update: November 2024
7+
8+
### beams
9+
Beams:idA 2212 # proton
10+
Beams:idB 2212 # proton
11+
Beams:eCM 13600. # GeV
12+
13+
### processes
14+
SoftQCD:inelastic on # all inelastic processes
15+
16+
### decays
17+
ParticleDecays:limitTau0 on
18+
ParticleDecays:tau0Max 10.
19+
20+
### switching on Pythia Mode2
21+
ColourReconnection:mode 1
22+
ColourReconnection:allowDoubleJunRem off
23+
ColourReconnection:m0 0.3
24+
ColourReconnection:allowJunctions on
25+
ColourReconnection:junctionCorrection 1.20
26+
ColourReconnection:timeDilationMode 2
27+
ColourReconnection:timeDilationPar 0.18
28+
StringPT:sigma 0.335
29+
StringZ:aLund 0.36
30+
StringZ:bLund 0.56
31+
StringFlav:probQQtoQ 0.078
32+
StringFlav:ProbStoUD 0.2
33+
StringFlav:probQQ1toQQ0join 0.0275,0.0275,0.0275,0.0275
34+
MultiPartonInteractions:pT0Ref 2.15
35+
BeamRemnants:remnantMode 1
36+
BeamRemnants:saturation 5
37+
38+
# Correct decay lengths (wrong in PYTHIA8 decay table)
39+
# Lb
40+
5122:tau0 = 0.4390
41+
# Xic0
42+
4132:tau0 = 0.0455
43+
# OmegaC
44+
4332:tau0 = 0.0803
45+
46+
### switch off all decay channels for charm
47+
411:onMode = off
48+
421:onMode = off
49+
431:onMode = off
50+
4122:onMode = off
51+
4132:onMode = off
52+
4232:onMode = off
53+
4332:onMode = off
54+
55+
###Semimuonic decays of charm
56+
57+
### D+/- -> mu X
58+
411:onIfAny = 13
59+
### D0 -> mu X
60+
421:onIfAny = 13
61+
### D_s -> mu X
62+
431:onIfAny = 13
63+
### Lambda_c -> mu X
64+
4122:onIfAny = 13
65+
### Xsi0_c -> mu X
66+
4132:onIfAny = 13
67+
### Xsi+_c
68+
4232:onIfAny = 13
69+
### Omega_c -> mu X
70+
4332:onIfAny = 13

0 commit comments

Comments
 (0)