Skip to content

Commit c5094b9

Browse files
committed
add generator for LambdaB to deuteron
1 parent b664d2d commit c5094b9

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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}, {1000010020}, true, 0.5)
5+
[GeneratorPythia8]
6+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_lambdab_probQQtoQ.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{1000010020}; // d, 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: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
### beams
2+
Beams:idA 2212 # proton
3+
Beams:idB 2212 # proton
4+
Beams:eCM 13600. # GeV
5+
6+
### processes
7+
SoftQCD:inelastic on # all inelastic processes
8+
9+
### decays
10+
ParticleDecays:limitTau0 on
11+
ParticleDecays:tau0Max 10.
12+
13+
# enable deuteron production by coalescence collisions
14+
HadronLevel:DeuteronProduction = on
15+
DeuteronProduction:channels = {2212 2112 > 22}
16+
DeuteronProduction:models = {0}
17+
DeuteronProduction:norm = 1
18+
DeuteronProduction:parms = {0.5 1} # coalescence momentum p0 in GeV/c
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:probQQtoQ 0.17
33+
StringFlav:ProbStoUD 0.2
34+
StringFlav:probQQ1toQQ0join 0.0275,0.0275,0.0275,0.0275
35+
MultiPartonInteractions:pT0Ref 2.15
36+
BeamRemnants:remnantMode 1
37+
BeamRemnants:saturation 5
38+
39+
# Correct decay lengths (wrong in PYTHIA8 decay table)
40+
# Lb
41+
5122:tau0 = 0.4390
42+
# Xic0
43+
4132:tau0 = 0.0455
44+
# OmegaC
45+
4332:tau0 = 0.0803
46+
47+
## Lb decay modes
48+
5122:onMode = off
49+
5122:oneChannel = 1 9.03e-05 0 2212 2212 -2212 -2212 2112
50+
5122:addChannel = 1 0.00181 0 2212 2212 -2212 -2212 2112 111
51+
5122:addChannel = 1 0.0181 0 2212 2212 -2212 -2212 2112 111 111
52+
5122:addChannel = 1 0.0271 0 2212 2212 -2212 -2212 2112 211 -211
53+
5122:addChannel = 1 0.0181 0 2212 2212 -2212 -2212 2112 211 211 -211 -211
54+
5122:addChannel = 1 0.181 0 2212 2212 -2212 -2212 2112 211 -211 111
55+
5122:addChannel = 1 0.199 0 2212 2212 -2212 -2212 2112 211 -211 111 111
56+
5122:addChannel = 1 0.0271 0 2212 2212 -2212 -2212 2112 211 211 -211 -211 111
57+
5122:addChannel = 1 0.00452 0 2212 2212 -2212 -2212 2112 211 111
58+
5122:addChannel = 1 0.0361 0 2212 2212 2112 -2212 -2112 -211 111
59+
5122:addChannel = 1 0.0452 0 2212 2212 2112 -2212 -2112 -211 111 111
60+
5122:addChannel = 1 0.0542 0 2212 2212 2112 -2212 -2112 -211 -211 211
61+
5122:addChannel = 1 0.361 0 2212 2212 2112 -2212 -2112 -211 -211 211 111
62+
5122:addChannel = 1 0.0271 0 2212 2212 2112 -2212 -2112 -211 -211 211 111 111
63+
5122:onIfMatch = 2212 2212 2212 2212 2112
64+
5122:onIfMatch = 2212 2212 2212 2212 2112 111
65+
5122:onIfMatch = 2212 2212 2212 2212 2112 111 111
66+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211
67+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 211 211
68+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 111
69+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 111 111
70+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 211 211 211 111
71+
5122:onIfMatch = 2212 2212 2212 2212 2112 211 111
72+
5122:onIfMatch = 2212 2212 2112 2212 2112 211 111
73+
5122:onIfMatch = 2212 2212 2112 2212 2112 211 111 111
74+
5122:onIfMatch = 2212 2212 2112 2212 2112 211 211 211
75+
5122:onIfMatch = 2212 2212 2112 2212 2112 211 211 211 111
76+
5122:onIfMatch = 2212 2212 2112 2212 2112 211 211 211 111 111

0 commit comments

Comments
 (0)