Skip to content

Commit afcace8

Browse files
author
Francesco Mazzaschi
committed
Add generator for LambdaB --> nuclei
1 parent eb3f9e7 commit afcace8

File tree

3 files changed

+136
-0
lines changed

3 files changed

+136
-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_hfhadron_to_nuclei.C
4+
funcName=generateHFHadToNuclei(3, {5122}, {1000020030, 1000010030}, true, 0.5)
5+
6+
[GeneratorPythia8]
7+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_lambdab_with_decays_Mode2.cfg
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
int External()
2+
{
3+
std::string path{"o2sim_Kine.root"};
4+
std::vector<int> checkPdgHadron{5122}; // Lambda_b
5+
std::vector<int> nucleiDauPdg{1000020030, 1000010030}; // 3He, 3H
6+
7+
TFile file(path.c_str(), "READ");
8+
if (file.IsZombie())
9+
{
10+
std::cerr << "Cannot open ROOT file " << path << "\n";
11+
return 1;
12+
}
13+
14+
auto tree = (TTree *)file.Get("o2sim");
15+
std::vector<o2::MCTrack> *tracks{};
16+
tree->SetBranchAddress("MCTrack", &tracks);
17+
18+
int nSignals{}, nSignalGoodDecay{};
19+
auto nEvents = tree->GetEntries();
20+
21+
for (int i = 0; i < nEvents; i++)
22+
{
23+
tree->GetEntry(i);
24+
for (auto &track : *tracks)
25+
{
26+
auto pdg = track.GetPdgCode();
27+
if (std::find(checkPdgHadron.begin(), checkPdgHadron.end(), std::abs(pdg)) != checkPdgHadron.end()) // found signal
28+
{
29+
// count signal PDG
30+
if(std::abs(track.GetRapidity()) > 1.5) continue; // skip if outside rapidity window
31+
nSignals++;
32+
for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j)
33+
{
34+
auto pdgDau = tracks->at(j).GetPdgCode();
35+
if (std::find(nucleiDauPdg.begin(), nucleiDauPdg.end(), std::abs(pdgDau)) != nucleiDauPdg.end())
36+
{
37+
nSignalGoodDecay++;
38+
}
39+
}
40+
}
41+
}
42+
}
43+
std::cout << "--------------------------------\n";
44+
std::cout << "# Events: " << nEvents << "\n";
45+
std::cout <<"# signal hadrons: " << nSignals << "\n";
46+
std::cout <<"# signal hadrons decaying into nuclei: " << nSignalGoodDecay << "\n";
47+
48+
float fracForcedDecays = float(nSignalGoodDecay) / nSignals;
49+
if (fracForcedDecays < 0.8) // we put some tolerance (lambdaB in MB events do not coalesce)
50+
{
51+
std::cerr << "Fraction of signals decaying into nuclei: " << fracForcedDecays << ", lower than expected\n";
52+
return 1;
53+
}
54+
55+
return 0;
56+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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+
## Lb decay modes
45+
5122:onMode = off
46+
5122:oneChannel = 1 9.03e-05 0 2212 2212 -2212 -2212 2112
47+
5122:addChannel = 1 0.00181 0 2212 2212 -2212 -2212 2112 111
48+
5122:addChannel = 1 0.0181 0 2212 2212 -2212 -2212 2112 111 111
49+
5122:addChannel = 1 0.0271 0 2212 2212 -2212 -2212 2112 211 -211
50+
5122:addChannel = 1 0.0181 0 2212 2212 -2212 -2212 2112 211 211 -211 -211
51+
5122:addChannel = 1 0.181 0 2212 2212 -2212 -2212 2112 211 -211 111
52+
5122:addChannel = 1 0.199 0 2212 2212 -2212 -2212 2112 211 -211 111 111
53+
5122:addChannel = 1 0.0271 0 2212 2212 -2212 -2212 2112 211 211 -211 -211 111
54+
5122:addChannel = 1 0.00452 0 2212 2212 -2212 -2212 2112 211 111
55+
5122:addChannel = 1 0.0361 0 2212 2212 2112 -2212 -2112 -211 111
56+
5122:addChannel = 1 0.0452 0 2212 2212 2112 -2212 -2112 -211 111 111
57+
5122:addChannel = 1 0.0542 0 2212 2212 2112 -2212 -2112 -211 -211 211
58+
5122:addChannel = 1 0.361 0 2212 2212 2112 -2212 -2112 -211 -211 211 111
59+
5122:addChannel = 1 0.0271 0 2212 2212 2112 -2212 -2112 -211 -211 211 111 111
60+
5122:onIfMatch = 2212 2212 2212 2212 2112
61+
5122:onIfMatch = 2212 2212 2212 2212 2112 111
62+
5122:onIfMatch = 2212 2212 2212 2212 2112 111 111
63+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211
64+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 211 211
65+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 111
66+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 111 111
67+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 211 211 111
68+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 111
69+
5122:onIfMatch = 2212 2212 2112 2212 2112 211 111
70+
5122:onIfMatch = 2212 2212 2112 2212 2112 211 111 111
71+
5122:onIfMatch = 2212 2212 2112 2212 2112 211 211 211
72+
5122:onIfMatch = 2212 2212 2112 2212 2112 211 211 211 111
73+
5122:onIfMatch = 2212 2212 2112 2212 2112 211 211 211 111 111

0 commit comments

Comments
 (0)