Skip to content

Commit ff3b1ce

Browse files
committed
Configs for Lc resonance prod.
1 parent 8b165c5 commit ff3b1ce

File tree

4 files changed

+269
-2
lines changed

4 files changed

+269
-2
lines changed

MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public:
3333
mHadronPdgList = hadronPdgList;
3434
mPartPdgToReplaceList = partPdgToReplaceList;
3535
mFreqReplaceList = freqReplaceList;
36-
// Ds1*(2700), Ds1*(2860), Ds3*(2860), Xic(3055)+, Xic(3080)+, Xic(3055)0, Xic(3080)0, LambdaC(2625), LambdaC(2595)
37-
mCustomPartPdgs = {30433, 40433, 437, 4315, 4316, 4325, 4326, 4124, 14122};
36+
// Ds1*(2700), Ds1*(2860), Ds3*(2860), Xic(3055)+, Xic(3080)+, Xic(3055)0, Xic(3080)0, LambdaC(2625), LambdaC(2595), LambdaC(2860), LambdaC(2880), LambdaC(2940), ThetaC(3100)
37+
mCustomPartPdgs = {30433, 40433, 437, 4315, 4316, 4325, 4326, 4124, 14122, 34122, 44122, 54122, 9422111};
3838
mCustomPartMasses[30433] = 2.714f;
3939
mCustomPartMasses[40433] = 2.859f;
4040
mCustomPartMasses[437] = 2.860f;
@@ -44,6 +44,10 @@ public:
4444
mCustomPartMasses[4326] = 3.0772f;
4545
mCustomPartMasses[4124] = 2.62810f;
4646
mCustomPartMasses[14122] = 2.59225f;
47+
mCustomPartMasses[34122] = 2.8561f;
48+
mCustomPartMasses[44122] = 2.8816;
49+
mCustomPartMasses[54124] = 2.9396f;
50+
mCustomPartMasses[9422111] = 3.099f;
4751
mCustomPartWidths[30433] = 0.122f;
4852
mCustomPartWidths[40433] = 0.160f;
4953
mCustomPartWidths[437] = 0.053f;
@@ -53,6 +57,10 @@ public:
5357
mCustomPartWidths[4326] = 0.0036f;
5458
mCustomPartWidths[4124] = 0.00052f;
5559
mCustomPartWidths[14122] = 0.0026f;
60+
mCustomPartWidths[34122] = 0.0676f;
61+
mCustomPartWidths[44122] = 0.0056f;
62+
mCustomPartWidths[54122] = 0.017f;
63+
mCustomPartWidths[9422111] = 0.0000083f;
5664
Print();
5765
}
5866

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#NEV_TEST> 20
2+
### The external generator derives from GeneratorPythia8.
3+
[GeneratorExternal]
4+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C
5+
funcName=GeneratorPythia8GapTriggeredCharmAndBeauty(5, -1.5, 1.5, -1.5, 1.5, {34122, 44122, 54122, 9422111}, {{4122, 34122}, {4122, 44122}, {4122, 54122}, {4122, 9422111}}, {0.1, 0.1, 0.1, 0.1})
6+
7+
[GeneratorPythia8]
8+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_LcResoTrigger.cfg
9+
includePartonEvent=false
10+
### not needed for jet studies, hence no need to keep parton event
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
int ExternalLc() {
2+
std::string path{"o2sim_Kine.root"};
3+
4+
int checkPdgQuarkOne{4}; // c quark injection
5+
int checkPdgQuarkTwo{5}; // b quark injection
6+
float ratioTrigger = 1./5.; // one event triggered out of 5
7+
8+
// PDG replacements: Λc(4122) -> resonances
9+
std::array<std::array<int, 2>, 4> pdgReplParticles = {
10+
std::array{4122, 34122}, // Λc -> Λc(2860)
11+
std::array{4122, 44122}, // Λc -> Λc(2880)
12+
std::array{4122, 54122}, // Λc -> Λc(2940)
13+
std::array{4122, 9422111} // Λc -> Tc(3100)
14+
};
15+
16+
// Counters for replacements
17+
std::array<std::array<int, 2>, 4> pdgReplPartCounters = {
18+
std::array{0,0}, std::array{0,0}, std::array{0,0}, std::array{0,0}
19+
};
20+
21+
std::array<float, 4> freqRepl = {0.2, 0.2, 0.2, 0.2};
22+
std::map<int,int> sumOrigReplacedParticles = {{4122,0}};
23+
24+
// Hadrons to check
25+
std::array<int, 5> checkPdgHadron{34122, 44122, 54122, 9422111, 5122};
26+
27+
// Correct decays
28+
std::map<int, std::vector<std::vector<int>>> checkHadronDecays{
29+
{34122, {{421, 2212}}},
30+
{44122, {{421, 2212}}},
31+
{54122, {{421, 2212}}},
32+
{9422111, {{413, 2212}}},
33+
{5122, {{421, 2212, -211}, {41221, -211}, {34122, -211}, {44122, -211}, {54122, -211}}}
34+
};
35+
36+
TFile file(path.c_str(), "READ");
37+
if (file.IsZombie()) { std::cerr << "Cannot open ROOT file " << path << "\n"; return 1; }
38+
39+
auto tree = (TTree*)file.Get("o2sim");
40+
std::vector<o2::MCTrack>* tracks{};
41+
tree->SetBranchAddress("MCTrack", &tracks);
42+
o2::dataformats::MCEventHeader* eventHeader = nullptr;
43+
tree->SetBranchAddress("MCEventHeader.", &eventHeader);
44+
45+
int nEventsMB{}, nEventsInjOne{}, nEventsInjTwo{};
46+
int nSignals{}, nSignalGoodDecay{};
47+
auto nEvents = tree->GetEntries();
48+
49+
std::map<int,int> signalHadronsPerType;
50+
std::map<int,int> signalGoodDecayPerType;
51+
for (auto pdg : checkPdgHadron) { signalHadronsPerType[pdg] = 0; signalGoodDecayPerType[pdg] = 0; }
52+
53+
for (int i=0; i<nEvents; i++) {
54+
tree->GetEntry(i);
55+
56+
int subGeneratorId{-1};
57+
if (eventHeader->hasInfo(o2::mcgenid::GeneratorProperty::SUBGENERATORID)) {
58+
bool isValid=false;
59+
subGeneratorId = eventHeader->getInfo<int>(o2::mcgenid::GeneratorProperty::SUBGENERATORID, isValid);
60+
if (subGeneratorId==0) nEventsMB++;
61+
else if (subGeneratorId==checkPdgQuarkOne) nEventsInjOne++;
62+
else if (subGeneratorId==checkPdgQuarkTwo) nEventsInjTwo++;
63+
}
64+
65+
for (auto& track : *tracks) {
66+
int pdg = track.GetPdgCode();
67+
int absPdg = std::abs(pdg);
68+
69+
if (std::find(checkPdgHadron.begin(), checkPdgHadron.end(), absPdg) != checkPdgHadron.end()) {
70+
nSignals++;
71+
signalHadronsPerType[absPdg]++;
72+
73+
if (subGeneratorId==checkPdgQuarkOne) {
74+
for (int iRepl=0; iRepl<3; ++iRepl) {
75+
if (absPdg == pdgReplParticles[iRepl][0]) { pdgReplPartCounters[iRepl][0]++; sumOrigReplacedParticles[pdgReplParticles[iRepl][0]]++; }
76+
else if (absPdg == pdgReplParticles[iRepl][1]) { pdgReplPartCounters[iRepl][1]++; sumOrigReplacedParticles[pdgReplParticles[iRepl][0]]++; }
77+
}
78+
}
79+
80+
std::vector<int> pdgsDecay;
81+
std::vector<int> pdgsDecayAnti;
82+
if (track.getFirstDaughterTrackId()>=0) {
83+
for (int j=track.getFirstDaughterTrackId(); j<=track.getLastDaughterTrackId(); ++j) {
84+
int pdgDau = tracks->at(j).GetPdgCode();
85+
pdgsDecay.push_back(pdgDau);
86+
pdgsDecayAnti.push_back((pdgDau==111||pdgDau==333)? pdgDau : -pdgDau);
87+
}
88+
}
89+
90+
std::sort(pdgsDecay.begin(), pdgsDecay.end());
91+
std::sort(pdgsDecayAnti.begin(), pdgsDecayAnti.end());
92+
93+
bool matchedDecay = false;
94+
for (auto& decay : checkHadronDecays[absPdg]) {
95+
std::vector<int> decayCopy = decay;
96+
std::sort(decayCopy.begin(), decayCopy.end());
97+
if (pdgsDecay == decayCopy || pdgsDecayAnti == decayCopy) {
98+
matchedDecay = true;
99+
nSignalGoodDecay++;
100+
signalGoodDecayPerType[absPdg]++;
101+
break;
102+
}
103+
}
104+
105+
// Print daughters
106+
std::cout << "Particle " << absPdg << " daughters: ";
107+
for (auto d : pdgsDecay) std::cout << d << " ";
108+
if (matchedDecay) std::cout << "(matches expected decay)";
109+
else std::cout << "(does NOT match expected decay)";
110+
std::cout << "\n";
111+
}
112+
}
113+
}
114+
115+
std::cout << "--------------------------------\n";
116+
std::cout << "# Events: " << nEvents << "\n";
117+
std::cout << "# MB events: " << nEventsMB << "\n";
118+
std::cout << "# events injected with " << checkPdgQuarkOne << ": " << nEventsInjOne << "\n";
119+
std::cout << "# events injected with " << checkPdgQuarkTwo << ": " << nEventsInjTwo << "\n";
120+
std::cout << "# signal hadrons: " << nSignals << "\n";
121+
std::cout << "# signal hadrons decaying in correct channels: " << nSignalGoodDecay << "\n";
122+
123+
for (auto& [pdg, count] : signalHadronsPerType) {
124+
int good = signalGoodDecayPerType[pdg];
125+
float frac = count>0 ? float(good)/count : 0.;
126+
std::cout << "Particle " << pdg << ": " << count << " signals, " << good << " good decays, fraction: " << frac << "\n";
127+
}
128+
129+
// Optional: sanity checks...
130+
return 0;
131+
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
### author: Antonio Palasciano (antonio.palasciano@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+
### switching on Pythia Mode2
13+
ColourReconnection:mode 1
14+
ColourReconnection:allowDoubleJunRem off
15+
ColourReconnection:m0 0.3
16+
ColourReconnection:allowJunctions on
17+
ColourReconnection:junctionCorrection 1.20
18+
ColourReconnection:timeDilationMode 2
19+
ColourReconnection:timeDilationPar 0.18
20+
StringPT:sigma 0.335
21+
StringZ:aLund 0.36
22+
StringZ:bLund 0.56
23+
StringFlav:probQQtoQ 0.078
24+
StringFlav:ProbStoUD 0.2
25+
StringFlav:probQQ1toQQ0join 0.0275,0.0275,0.0275,0.0275
26+
MultiPartonInteractions:pT0Ref 2.15
27+
BeamRemnants:remnantMode 1
28+
BeamRemnants:saturation 5
29+
30+
### decays
31+
ParticleDecays:limitTau0 on
32+
ParticleDecays:tau0Max 10.
33+
34+
### add resonances not present in PYTHIA
35+
### id:all = name antiName spinType chargeType colType m0 mWidth mMin mMax tau0
36+
37+
### LambdaC(2860)
38+
34122:all = Lambda_c(2860)+ Lambda_c(2860)- 3 1 0 2.8561 0.0676 2.7 10. 0.
39+
34122:mayDecay = on
40+
41+
### LambdaC(2880)
42+
44122:all = Lambda_c(2880)+ Lambda_c(2880)- 5 1 0 2.8816 0.0056 2.85 10. 0.
43+
44122:mayDecay = on
44+
45+
### LambdaC(2940)
46+
54122:all = Lambda_c(2940)+ Lambda_c(2940)- 3 1 0 2.9396 0.020 2.9 10. 0.
47+
54122:mayDecay = on
48+
49+
### TC(3100)
50+
9422111:all = Theta_c(3100) 3 0 0 3.099 0.0000083 2.95 10. 0.
51+
9422111:mayDecay = on
52+
53+
### turn off all charm resonances decays
54+
# 34122:onMode = off # LambdaC(2860)
55+
# 44122:onMode = off # LambdaC(2880)
56+
# 54122:onMode = off # LambdaC(2940)
57+
# 9422111:onMode = off # Theta_c(3100)
58+
59+
### turn off all beauty hadron decays
60+
531:onMode = off
61+
521:onMode = off
62+
5122:onMode = off
63+
64+
### add LambdaC(2860)
65+
34122:oneChannel = 1 1 0 421 2212
66+
34122:onIfMatch = 421 2212
67+
68+
### add LambdaC(2880)
69+
44122:oneChannel = 1 1 0 421 2212
70+
44122:onIfMatch = 421 2212
71+
72+
### add LambdaC(2940)
73+
54122:oneChannel = 1 1 0 421 2212
74+
54122:onIfMatch = 421 2212
75+
76+
### add ThetaC(3100)
77+
9422111:oneChannel = 1 1 0 413 2212
78+
9422111:onIfMatch = 413 2212
79+
80+
### add Lb
81+
5122:addChannel = 1 0.2 0 421 2212 -211 # Lb -> D0 p pi- non resonant
82+
5122:addChannel = 1 0.4 0 34122 -211 # Lb -> LambdaC(2860)+ pi-
83+
5122:addChannel = 1 0.25 0 44122 -211 # Lb -> LambdaC(2880)+ pi-
84+
5122:addChannel = 1 0.15 0 54122 -211 # Lb -> LambdaC(2940)+ pi-
85+
86+
5122:onIfMatch = 421 2212 -211 # D0 p pi-
87+
5122:onIfMatch = 34122 -211 # LambdaC(2860)+ pi-
88+
5122:onIfMatch = 44122 -211 # LambdaC(2880)+ pi-
89+
5122:onIfMatch = 54122 -211 # LambdaC(2940)+ pi-
90+
91+
# Correct decay lengths (wrong in PYTHIA8 decay table)
92+
# Lb
93+
5122:tau0 = 0.4390
94+
# Xic0
95+
4132:tau0 = 0.0455
96+
# OmegaC
97+
4332:tau0 = 0.0803
98+
99+
### Force golden charm hadrons decay modes for D2H studies
100+
### set D0 BRs
101+
421:oneChannel = 1 0.9 0 -321 211
102+
421:addChannel = 1 0.1 0 -321 211 111
103+
104+
### K* -> K pi
105+
313:onMode = off
106+
313:onIfAll = 321 211
107+
108+
### switch off all decay channels
109+
411:onMode = off
110+
413:onMode = off
111+
421:onMode = off
112+
113+
### D0 -> K pi
114+
421:onIfMatch = 321 211
115+
### D0 -> K pi pi0
116+
421:onIfMatch = 321 211 111
117+
### D*+0 -> D0 pi
118+
413:onIfMatch = 421 211

0 commit comments

Comments
 (0)