Skip to content

Commit 690deb1

Browse files
authored
[PWGLF] Added configuration for baryonic resonances (#2291)
* Add files via upload * Added configuration for baryonic resonances * updated PDG for Xi1820 * Update Xi(1820) resonance IDs in GeneratorLF * Update PDG codes for baryonic resonance list * Update Xi1820 resonance configuration IDs
1 parent 12e659b commit 690deb1

File tree

4 files changed

+278
-0
lines changed

4 files changed

+278
-0
lines changed
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/generator_pythia8_LF_rapidity.C
3+
funcName=generateLFRapidity("${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/resonancelistgun_baryonic_inj.json", true, 1, false, false, "${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg", "")
4+
5+
[GeneratorPythia8] # if triggered then this will be used as the background event
6+
config=${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg
7+
8+
[DecayerPythia8] # after for transport code!
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_baryonic.cfg
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
int External()
2+
{
3+
std::string path{"o2sim_Kine.root"};
4+
int numberOfInjectedSignalsPerEvent{1};
5+
int numberOfGapEvents{4};
6+
int numberOfEventsProcessed{0};
7+
int numberOfEventsProcessedWithoutInjection{0};
8+
std::vector<int> injectedPDGs = {
9+
102134, // Lambda(1520)0
10+
-102134, // Lambda(1520)0bar
11+
3324, // Xi(1530)0
12+
-3324, // Xi(1530)0bar
13+
123314, // Xi(1820)-
14+
-123314, // Xi(1820)+
15+
123324, // Xi(1820)0
16+
-123324 // Xi(1820)0bar
17+
};
18+
std::vector<std::vector<int>> decayDaughters = {
19+
{2212, -321}, // Lambda(1520)0
20+
{-2212, 321}, // Lambda(1520)0bar
21+
{3312, 211}, // Xi(1530)0
22+
{-3312, -211}, // Xi(1530)0bar
23+
{3122, -321}, // Xi(1820)-
24+
{-3122, 321}, // Xi(1820)+
25+
{3122, 310}, // Xi(1820)0
26+
{-3122, -310} // Xi(1820)0bar
27+
};
28+
29+
auto nInjection = injectedPDGs.size();
30+
31+
TFile file(path.c_str(), "READ");
32+
if (file.IsZombie())
33+
{
34+
std::cerr << "Cannot open ROOT file " << path << "\n";
35+
return 1;
36+
}
37+
38+
auto tree = (TTree *)file.Get("o2sim");
39+
if (!tree)
40+
{
41+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
42+
return 1;
43+
}
44+
std::vector<o2::MCTrack> *tracks{};
45+
tree->SetBranchAddress("MCTrack", &tracks);
46+
47+
std::vector<int> nSignal;
48+
for (int i = 0; i < nInjection; i++)
49+
{
50+
nSignal.push_back(0);
51+
}
52+
std::vector<std::vector<int>> nDecays;
53+
std::vector<int> nNotDecayed;
54+
for (int i = 0; i < nInjection; i++)
55+
{
56+
std::vector<int> nDecay;
57+
for (int j = 0; j < decayDaughters[i].size(); j++)
58+
{
59+
nDecay.push_back(0);
60+
}
61+
nDecays.push_back(nDecay);
62+
nNotDecayed.push_back(0);
63+
}
64+
auto nEvents = tree->GetEntries();
65+
bool hasInjection = false;
66+
for (int i = 0; i < nEvents; i++)
67+
{
68+
hasInjection = false;
69+
numberOfEventsProcessed++;
70+
auto check = tree->GetEntry(i);
71+
for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack)
72+
{
73+
auto track = tracks->at(idxMCTrack);
74+
auto pdg = track.GetPdgCode();
75+
auto it = std::find(injectedPDGs.begin(), injectedPDGs.end(), pdg);
76+
int index = std::distance(injectedPDGs.begin(), it); // index of injected PDG
77+
if (it != injectedPDGs.end()) // found
78+
{
79+
// count signal PDG
80+
nSignal[index]++;
81+
if (track.getFirstDaughterTrackId() < 0)
82+
{
83+
nNotDecayed[index]++;
84+
continue;
85+
}
86+
for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j)
87+
{
88+
auto pdgDau = tracks->at(j).GetPdgCode();
89+
bool foundDau = false;
90+
// count decay PDGs
91+
for (int idxDaughter = 0; idxDaughter < decayDaughters[index].size(); ++idxDaughter)
92+
{
93+
if (pdgDau == decayDaughters[index][idxDaughter])
94+
{
95+
nDecays[index][idxDaughter]++;
96+
foundDau = true;
97+
hasInjection = true;
98+
break;
99+
}
100+
}
101+
if (!foundDau)
102+
{
103+
std::cerr << "Decay daughter not found: " << pdg << " -> " << pdgDau << "\n";
104+
}
105+
}
106+
}
107+
}
108+
if (!hasInjection)
109+
{
110+
numberOfEventsProcessedWithoutInjection++;
111+
}
112+
}
113+
std::cout << "--------------------------------\n";
114+
std::cout << "# Events: " << nEvents << "\n";
115+
for (int i = 0; i < nInjection; i++)
116+
{
117+
std::cout << "# Mother \n";
118+
std::cout << injectedPDGs[i] << " generated: " << nSignal[i] << ", " << nNotDecayed[i] << " did not decay\n";
119+
if (nSignal[i] == 0)
120+
{
121+
std::cerr << "No generated: " << injectedPDGs[i] << "\n";
122+
// return 1; // At least one of the injected particles should be generated
123+
}
124+
for (int j = 0; j < decayDaughters[i].size(); j++)
125+
{
126+
std::cout << "# Daughter " << decayDaughters[i][j] << ": " << nDecays[i][j] << "\n";
127+
}
128+
// if (nSignal[i] != nEvents * numberOfInjectedSignalsPerEvent)
129+
// {
130+
// std::cerr << "Number of generated: " << injectedPDGs[i] << ", lower than expected\n";
131+
// // return 1; // Don't need to return 1, since the number of generated particles is not the same for each event
132+
// }
133+
}
134+
std::cout << "--------------------------------\n";
135+
std::cout << "Number of events processed: " << numberOfEventsProcessed << "\n";
136+
std::cout << "Number of input for the gap events: " << numberOfGapEvents << "\n";
137+
std::cout << "Number of events processed without injection: " << numberOfEventsProcessedWithoutInjection << "\n";
138+
// injected event + numberOfGapEvents*gap events + injected event + numberOfGapEvents*gap events + ...
139+
// total fraction of the gap event: numberOfEventsProcessedWithoutInjection/numberOfEventsProcessed
140+
float ratioOfNormalEvents = numberOfEventsProcessedWithoutInjection / numberOfEventsProcessed;
141+
if (ratioOfNormalEvents > 0.75)
142+
{
143+
std::cout << "The number of injected event is loo low!!" << std::endl;
144+
return 1;
145+
}
146+
147+
return 0;
148+
}
149+
150+
void GeneratorLF_Resonances_pp1360_injection() { External(); }
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"Lambda(1520)0" : {
3+
"pdg": 102134,
4+
"n": 5,
5+
"ptMin": 0.0,
6+
"ptMax": 15,
7+
"etaMin": -1.0,
8+
"etaMax": 1.0,
9+
"rapidityMin": -1.0,
10+
"rapidityMax": 1.0,
11+
"genDecayed": true
12+
},
13+
"anti-Lambda(1520)0" : {
14+
"pdg": -102134,
15+
"n": 5,
16+
"ptMin": 0.0,
17+
"ptMax": 15,
18+
"etaMin": -1.0,
19+
"etaMax": 1.0,
20+
"rapidityMin": -1.0,
21+
"rapidityMax": 1.0,
22+
"genDecayed": true
23+
},
24+
"Xi(1530)0" : {
25+
"pdg": 3324,
26+
"n": 5,
27+
"ptMin": 0.0,
28+
"ptMax": 15,
29+
"etaMin": -1.0,
30+
"etaMax": 1.0,
31+
"rapidityMin": -1.0,
32+
"rapidityMax": 1.0,
33+
"genDecayed": true
34+
},
35+
"anti-Xi(1530)0" : {
36+
"pdg": -3324,
37+
"n": 5,
38+
"ptMin": 0.0,
39+
"ptMax": 15,
40+
"etaMin": -1.0,
41+
"etaMax": 1.0,
42+
"rapidityMin": -1.0,
43+
"rapidityMax": 1.0,
44+
"genDecayed": true
45+
},
46+
"Xi(1820)0" : {
47+
"pdg": 123324,
48+
"n": 5,
49+
"ptMin": 0.0,
50+
"ptMax": 15,
51+
"etaMin": -1.0,
52+
"etaMax": 1.0,
53+
"rapidityMin": -1.0,
54+
"rapidityMax": 1.0,
55+
"genDecayed": true
56+
},
57+
"Anti-Xi(1820)0" : {
58+
"pdg": -123324,
59+
"n": 5,
60+
"ptMin": 0.0,
61+
"ptMax": 15,
62+
"etaMin": -1.0,
63+
"etaMax": 1.0,
64+
"rapidityMin": -1.0,
65+
"rapidityMax": 1.0,
66+
"genDecayed": true
67+
},
68+
"Xi(1820)-" : {
69+
"pdg": 123314,
70+
"n": 5,
71+
"ptMin": 0.0,
72+
"ptMax": 15,
73+
"etaMin": -1.0,
74+
"etaMax": 1.0,
75+
"rapidityMin": -1.0,
76+
"rapidityMax": 1.0,
77+
"genDecayed": true
78+
},
79+
"Xi(1820)+" : {
80+
"pdg": -123314,
81+
"n": 5,
82+
"ptMin": 0.0,
83+
"ptMax": 15,
84+
"etaMin": -1.0,
85+
"etaMax": 1.0,
86+
"rapidityMin": -1.0,
87+
"rapidityMax": 1.0,
88+
"genDecayed": true
89+
}
90+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
### Define resonance
2+
ProcessLevel:all = off # will not look for the 'process'
3+
4+
### Lambda1520
5+
# id::all = name antiName spinType chargeType colType m0 mWidth mMin mMax tau0
6+
102134:all = Lambda1520 Lambda1520bar 4 0 0 1.51950 0.01560 1.47 1.60 0
7+
102134:oneChannel = 1 1.000 0 2212 -321
8+
102134:onMode = off
9+
102134:onIfMatch = 2212 -321
10+
11+
### Xi1530
12+
# id::all = name antiName spinType chargeType colType m0 mWidth mMin mMax tau0
13+
3324:all = Xi1530 Xi1530bar 4 0 0 1.53180 0.0091 1.50 1.59 0
14+
3324:oneChannel = 1 1.000 0 3312 211
15+
3324:onMode = off
16+
3324:onIfMatch = 3312 211
17+
18+
### Xi1820
19+
123324:all = Xi1820 Xi1820bar 4 0 0 1.823 0.024 1.75 1.95 0
20+
123324:oneChannel = 1 1.000 0 3122 310
21+
123324:onMode = off
22+
123324:onIfMatch = 3122 310
23+
24+
123314:all = Xi1820Minus Xi1820Plus 4 -3 0 1.823 0.024 1.75 1.95 0
25+
123314:oneChannel = 1 1.000 0 3122 -321
26+
123314:onMode = off
27+
123314:onIfMatch = 3122 -321
28+

0 commit comments

Comments
 (0)