Skip to content

Commit 9991d49

Browse files
authored
Merge branch 'AliceO2Group:master' into nj-ditto
2 parents 7944f1f + ea6d40d commit 9991d49

8 files changed

Lines changed: 450 additions & 75 deletions

File tree

‎MC/bin/o2dpg_sim_workflow_anchored.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ def main():
742742
forwardargs += " -tf " + str(args.tf) + " --sor " + str(effective_run_start) + " --timestamp " + str(timestamp) + " --production-offset " + str(prod_offset) + " -run " + str(args.run_number) + " --run-anchored --first-orbit " \
743743
+ str(effective_first_orbit) + " --orbitsPerTF " + str(GLOparams["OrbitsPerTF"]) + str(energyarg)
744744
# the following options can be overwritten/influenced from the outside
745-
if not '-col' in forwardargs:
745+
if not re.search(r'(?<!\S)-col(?=[\s=])', forwardargs):
746746
forwardargs += ' -col ' + ColSystem
747747
if not '--readoutDets' in forwardargs:
748748
forwardargs += ' --readoutDets ' + GLOparams['detList']

‎MC/config/PWGDQ/external/generator/generator_pythia8_NonPromptSignals_gaptriggered_dq.C‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ FairGenerator*
259259
TString pathO2 = gSystem->ExpandPathName("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGDQ/EvtGen/DecayTablesEvtgen");
260260
//gen->SetDecayTable(Form("%s/BPLUSTOKAONJPSITOELE.DEC", pathO2.Data()));
261261
//gen->SetDecayTable(Form("%s/BPLUSTOKAONJPSITOELEALLMODES.DEC", pathO2.Data())); // decay table including decay modes for correlated background
262-
gen->SetDecayTable(Form("%s/BTOJPSITOELE.DEC", pathO2.Data())); // decay table including decay modes for correlated background
262+
//gen->SetDecayTable(Form("%s/BTOJPSITOELE.DEC", pathO2.Data())); // decay table including decay modes for correlated background
263+
gen->SetDecayTable(Form("%s/BTOPSIJPSITODIELECTRON.DEC", pathO2.Data())); // decay table including decay modes for correlated background and jpsi feeddown
263264
// print debug
264265
// gen->PrintDebug();
265266
// set random seed

‎MC/config/PWGEM/external/generator/Generator_pythia8_embed_HFLepton.C‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ public:
9292

9393
/// number of events to be embedded in a background event
9494
// gen->setFormula("max(1.,120.*(x<5.)+80.*(1.-x/20.)*(x>5.)*(x<11.)+240.*(1.-x/13.)*(x>11.))");
95-
//mNumSigEvs = static_cast<int>(std::lround(5.0 + 0.886202881 * std::pow(std::max(0.0f, 17.5f - x), 1.7)));
96-
mNumSigEvs = static_cast<int>(std::max(1.,120.*(x<5.)+80.*(1.-x/20.)*(x>5.)*(x<11.)+240.*(1.-x/13.)*(x>11.)));
97-
//mNumSigEvs = 1;
98-
LOG(info) << "[notifyEmbedding] ----- generating " << mNumSigEvs << " signal events " << std::endl;
95+
mNumSigEvs = static_cast<int>(std::lround(5.0 + 0.886202881 * std::pow(std::max(0.0f, 17.5f - x), 1.7)));
96+
//mNumSigEvs = static_cast<int>(std::max(1.,120.*(x<5.)+80.*(1.-x/20.)*(x>5.)*(x<11.)+240.*(1.-x/13.)*(x>11.)));
97+
//mNumSigEvs = 1;
98+
LOG(info) << "[notifyEmbedding] ----- generating " << mNumSigEvs << " signal events " << std::endl;
9999
};
100100

101101
protected:

‎MC/config/PWGHF/ini/tests/GeneratorHF_D2H_bbbar_Bforced_gap5_Mode2.C‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ int External() {
66

77
std::vector<int> checkPdgHadron{411, 421, 431, 4122, 4132, 4232, 4332, 511, 521, 531, 5122};
88
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+
9+
{411, {{-321, 211, 211}, {-313, 211}, {211, 333}}}, // D+
1010
{421, {{-321, 211}, {-321, 111, 211}}}, // D0
1111
{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}, {-413, 211}, {-411, 213}, {431, -211}}}, // B0
17-
{521, {{-421, 211}, {-423, 211}, {-421, 213}}}, // B+
12+
{4122, {{-313, 2212}, {-321, 2224}, {211, 102134}, {-321, 211, 2212}}}, // Lc+
13+
{511, {{-411, 211}, {-413, 211}, {-411, 213}, {-411, 321}, {-413, 213}, {-413, 321}}}, // B0
14+
{521, {{-421, 211}, {-423, 211}, {-421, 213}, {-421, 321}}}, // B+
1815
{531, {{-431, 211}, {-433, 211}, {-431, 213}}}, // Bs0
19-
{5122, {{4122, -211}, {4122, -213}, {4122, 211, -211, -211}, {4212, -211}}} // Lb0
16+
{5122, {{4122, -211}, {4122, -213}, {14122, -211}, {4124, -211}, {4212, -211}}} // Lb0
2017
};
2118

2219
TFile file(path.c_str(), "READ");

‎MC/config/PWGHF/pythia8/generator/pythia8_beautyhadronic_with_decays_Mode2.cfg‎

Lines changed: 22 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,12 @@ BeamRemnants:saturation 5
4848
### add D+ decays absent in PYTHIA8 decay table and set BRs from PDG for other
4949
411:oneChannel = 1 0.0752 0 -321 211 211
5050
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
51+
411:addChannel = 1 0.0100 0 333 211 # to have the same amount of D+->KKpi and D+->Kpipi
5352
## add Lc decays absent in PYTHIA8 decay table and set BRs from PDG for other
5453
4122:oneChannel = 1 0.0196 100 2212 -313
5554
4122:addChannel = 1 0.0108 100 2224 -321
5655
4122:addChannel = 1 0.022 100 102134 211
5756
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
6957

7058
### K* -> K pi
7159
313:onMode = off
@@ -82,25 +70,12 @@ BeamRemnants:saturation 5
8270
### for Lambda_c -> Lambda(1520) K-
8371
102134:onMode = off
8472
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
9473

9574
### switch off all decay channels
9675
411:onMode = off
9776
421:onMode = off
9877
431:onMode = off
9978
4122:onMode = off
100-
4232:onMode = off
101-
4132:onMode = off
102-
443:onMode = off
103-
4332:onMode = off
10479
511:onMode = off
10580
521:onMode = off
10681
531:onMode = off
@@ -131,60 +106,46 @@ BeamRemnants:saturation 5
131106
4122:onIfMatch = 102134 211
132107
### Lambda_c -> p K pi
133108
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
153109

154110
### Force also golden beauty hadrons decay modes for D2H studies
155111
### add B0 decays
156-
511:oneChannel = 1 0.4 0 -411 211
157-
511:addChannel = 1 0.3 0 -413 211
158-
511:addChannel = 1 0.2 0 431 -211
112+
511:oneChannel = 1 0.35 0 -411 211
113+
511:addChannel = 1 0.35 0 -413 211
159114
### add B+ decays
160-
521:oneChannel = 1 0.8 0 -421 211
115+
521:oneChannel = 1 0.7 0 -421 211
161116
### add Bs0 decays
162-
531:oneChannel = 1 0.8 0 -431 211
117+
531:oneChannel = 1 0.7 0 -431 211
163118
### add Lb decays
164-
5122:oneChannel = 1 0.8 0 4122 -211
119+
5122:oneChannel = 1 0.6 0 4122 -211
165120

166121
### we also add channels useful for studies of partly reconstructed decays / correlated backgrounds
167122
### add B0 decays
168123
511:addChannel = 1 0.1 0 -411 213
124+
511:addChannel = 1 0.1 0 -413 213
125+
511:addChannel = 1 0.05 0 -411 321
126+
511:addChannel = 1 0.05 0 -413 321
169127
### add B+ decays
170128
521:addChannel = 1 0.1 0 -421 213
171129
521:addChannel = 1 0.1 0 -423 211
130+
521:addChannel = 1 0.1 0 -421 321
172131
### add Bs0 decays
173132
531:addChannel = 1 0.1 0 -431 213
174133
531:addChannel = 1 0.1 0 -433 211
134+
531:addChannel = 1 0.1 0 -433 321
175135
### add Lb decays
176-
5122:addChannel = 1 0.1 0 4122 -213
177-
5122:addChannel = 1 0.05 0 4122 211 -211 -211
178-
5122:addChannel = 1 0.05 0 4212 -211
136+
5122:addChannel = 1 0.10 0 14122 -211
137+
5122:addChannel = 1 0.10 0 4124 -211
138+
5122:addChannel = 1 0.10 0 4212 -211
139+
5122:addChannel = 1 0.10 0 4122 -321
179140

180141
### B0 -> D pi
181142
511:onIfMatch = 411 211
182143
### B0 -> D* pi
183144
511:onIfMatch = 413 211
184-
### B0 -> Ds pi
185-
511:onIfMatch = 431 211
186145
### B0 -> D rho
187146
511:onIfMatch = 411 213
147+
### B0 -> D rho
148+
511:onIfMatch = 411 321
188149

189150
### B+ -> D0 pi
190151
521:onIfMatch = 421 211
@@ -202,9 +163,9 @@ BeamRemnants:saturation 5
202163

203164
### Lb -> Lc pi
204165
5122:onIfMatch = 4122 211
205-
### Lb -> Lc rho
206-
5122:onIfMatch = 4122 213
207-
### Lb -> Lc pi pi pi
208-
5122:onIfMatch = 4122 211 211 211
209-
### Lb -> Sc pi
166+
### Lb -> Lc(2595)+ pi
167+
5122:onIfMatch = 14122 211
168+
### Lb -> Lc(2625)+ pi
169+
5122:onIfMatch = 4124 211
170+
### Lb -> Sc(2455)+ pi
210171
5122:onIfMatch = 4212 211
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[GeneratorExternal]
2+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/GeneratorLF_phiphi.C
3+
funcName=generatePhiResonanceGun(999999, 0.0, 50.0, -1.0, 1.0, "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg", 3)
4+
5+
[GeneratorPythia8]
6+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg
7+
8+
[DecayerPythia8]
9+
config[0]=${O2DPG_MC_CONFIG_ROOT}/MC/config/common/pythia8/decayer/base.cfg
10+
config[1]=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonances.cfg
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
int External()
2+
{
3+
const std::string path{"o2sim_Kine.root"};
4+
5+
TFile file(path.c_str(), "READ");
6+
if (file.IsZombie())
7+
{
8+
std::cerr << "Cannot open ROOT file " << path << "\n";
9+
return 1;
10+
}
11+
12+
auto tree = (TTree *)file.Get("o2sim");
13+
if (!tree)
14+
{
15+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
16+
return 1;
17+
}
18+
19+
std::vector<o2::MCTrack> *tracks{};
20+
tree->SetBranchAddress("MCTrack", &tracks);
21+
22+
// Counters
23+
int nResonance999999 = 0;
24+
int nNotDecayed999999 = 0;
25+
int nPhiFromResonance = 0;
26+
27+
// Decay counts into K+ K- (PDG 321, -321)
28+
int nKPlusFromResonancePhi = 0;
29+
int nKMinusFromResonancePhi = 0;
30+
31+
int nDirectInjectedPhi = 0;
32+
int nMBPhi = 0;
33+
34+
int nKPlusFromDirectPhi = 0;
35+
int nKMinusFromDirectPhi = 0;
36+
int nKPlusFromMBPhi = 0;
37+
int nKMinusFromMBPhi = 0;
38+
39+
int numberOfEventsProcessed = 0;
40+
int numberOfEventsProcessedWithoutInjection = 0;
41+
42+
for (Long64_t i = 0; i < tree->GetEntries(); ++i)
43+
{
44+
tree->GetEntry(i);
45+
++numberOfEventsProcessed;
46+
bool hasInjection = false;
47+
48+
for (size_t idx = 0; idx < tracks->size(); ++idx)
49+
{
50+
const auto &track = tracks->at(idx);
51+
const auto pdg = track.GetPdgCode();
52+
53+
// 1. Process Custom Resonance 999999
54+
if (pdg == 999999)
55+
{
56+
++nResonance999999;
57+
hasInjection = true;
58+
59+
if (track.getFirstDaughterTrackId() < 0)
60+
{
61+
++nNotDecayed999999;
62+
continue;
63+
}
64+
65+
// Loop through daughters of 999999 (Phi mesons)
66+
for (int j = track.getFirstDaughterTrackId(); j <= track.getLastDaughterTrackId(); ++j)
67+
{
68+
const auto &phiTrack = tracks->at(j);
69+
if (phiTrack.GetPdgCode() == 333)
70+
{
71+
++nPhiFromResonance;
72+
73+
// Check daughters of this Phi (granddaughters of 999999)
74+
if (phiTrack.getFirstDaughterTrackId() >= 0)
75+
{
76+
for (int k = phiTrack.getFirstDaughterTrackId(); k <= phiTrack.getLastDaughterTrackId(); ++k)
77+
{
78+
auto grandDauPdg = tracks->at(k).GetPdgCode();
79+
if (grandDauPdg == 321) ++nKPlusFromResonancePhi;
80+
if (grandDauPdg == -321) ++nKMinusFromResonancePhi;
81+
}
82+
}
83+
}
84+
}
85+
}
86+
87+
// 2. Process Phi (333) Mesons
88+
else if (pdg == 333)
89+
{
90+
int motherId = track.getMotherTrackId();
91+
int motherPdg = (motherId >= 0 && motherId < (int)tracks->size()) ? tracks->at(motherId).GetPdgCode() : 0;
92+
93+
// Skip Phi from 999999 here as it was handled above
94+
if (motherPdg == 999999)
95+
{
96+
continue;
97+
}
98+
99+
bool isDirectInjected = (motherId < 0);
100+
101+
if (isDirectInjected)
102+
{
103+
++nDirectInjectedPhi;
104+
hasInjection = true;
105+
106+
if (track.getFirstDaughterTrackId() >= 0)
107+
{
108+
for (int j = track.getFirstDaughterTrackId(); j <= track.getLastDaughterTrackId(); ++j)
109+
{
110+
auto dauPdg = tracks->at(j).GetPdgCode();
111+
if (dauPdg == 321) ++nKPlusFromDirectPhi;
112+
if (dauPdg == -321) ++nKMinusFromDirectPhi;
113+
}
114+
}
115+
}
116+
else
117+
{
118+
// Minimum Bias Phi
119+
++nMBPhi;
120+
121+
if (track.getFirstDaughterTrackId() >= 0)
122+
{
123+
for (int j = track.getFirstDaughterTrackId(); j <= track.getLastDaughterTrackId(); ++j)
124+
{
125+
auto dauPdg = tracks->at(j).GetPdgCode();
126+
if (dauPdg == 321) ++nKPlusFromMBPhi;
127+
if (dauPdg == -321) ++nKMinusFromMBPhi;
128+
}
129+
}
130+
}
131+
}
132+
}
133+
134+
if (!hasInjection)
135+
{
136+
++numberOfEventsProcessedWithoutInjection;
137+
}
138+
}
139+
140+
std::cout << "--------------------------------\n";
141+
std::cout << "Total Events Processed: " << tree->GetEntries() << "\n\n";
142+
143+
std::cout << "--- 1. INJECTED RESONANCE (999999) ---\n";
144+
std::cout << "Total Injected Resonance 999999: " << nResonance999999 << "\n";
145+
std::cout << "Resonances not decayed: " << nNotDecayed999999 << "\n";
146+
std::cout << "Daughter Phi (333) produced from 999999: " << nPhiFromResonance << "\n";
147+
std::cout << " -> Decayed to K+: " << nKPlusFromResonancePhi << "\n";
148+
std::cout << " -> Decayed to K-: " << nKMinusFromResonancePhi << "\n\n";
149+
150+
std::cout << "--- 2. DIRECTLY INJECTED PHI (333) ---\n";
151+
std::cout << "Total Directly Injected Phi (333): " << nDirectInjectedPhi << "\n";
152+
std::cout << " -> Decayed to K+: " << nKPlusFromDirectPhi << "\n";
153+
std::cout << " -> Decayed to K-: " << nKMinusFromDirectPhi << "\n\n";
154+
155+
std::cout << "--- 3. MINIMUM BIAS PHI (333) ---\n";
156+
std::cout << "Total Minimum Bias Phi (333): " << nMBPhi << "\n";
157+
std::cout << " -> Decayed to K+: " << nKPlusFromMBPhi << "\n";
158+
std::cout << " -> Decayed to K-: " << nKMinusFromMBPhi << "\n";
159+
std::cout << "--------------------------------\n";
160+
std::cout << "Events processed without signal injection: " << numberOfEventsProcessedWithoutInjection << "\n";
161+
162+
return 0;
163+
}
164+
165+
void GeneratorLF_phiphiInvMass()
166+
{
167+
External();
168+
}

0 commit comments

Comments
 (0)