Skip to content

Commit 2d83347

Browse files
authored
PbPb cocktail (#2264)
* PbPbCocktail * fix
1 parent ce0c917 commit 2d83347

19 files changed

+955
-398
lines changed
File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### The setup uses an external event generator
2+
### This part sets the path of the file and the function call to retrieve it
3+
4+
[GeneratorExternal]
5+
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
6+
funcName=GenerateEMCocktail(400,0,3,63,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/parametrizations/PbPb5TeV_central.json","5TeV_0510_wRatio_etatest",350,0.0,30.0,10000,1,1,0,0,"",0,1.1,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/decaytables/decaytable_LMee.dat",1)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### The setup uses an external event generator
2+
### This part sets the path of the file and the function call to retrieve it
3+
4+
[GeneratorExternal]
5+
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
6+
funcName=GenerateEMCocktail(400,0,3,63,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/parametrizations/PbPb5TeV_central.json","5TeV_3040_wRatio_etatest",350,0.0,30.0,10000,1,1,0,0,"",0,1.1,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/decaytables/decaytable_LMee.dat",1)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### The setup uses an external event generator
2+
### This part sets the path of the file and the function call to retrieve it
3+
4+
[GeneratorExternal]
5+
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
6+
funcName=GenerateEMCocktail(400,0,3,63,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/parametrizations/PbPb5TeV_central.json","5TeV_4050_wRatio_etatest",350,0.0,30.0,10000,1,1,0,0,"",0,1.1,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/decaytables/decaytable_LMee.dat",1)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### The setup uses an external event generator
2+
### This part sets the path of the file and the function call to retrieve it
3+
4+
[GeneratorExternal]
5+
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
6+
funcName=GenerateEMCocktail(400,0,3,63,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/parametrizations/PbPb5TeV_peripheral.json","5TeV_5060_wRatio_pi0corr",350,0.0,30.0,10000,1,1,0,0,"",0,1.1,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/decaytables/decaytable_LMee.dat",1)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### The setup uses an external event generator
2+
### This part sets the path of the file and the function call to retrieve it
3+
4+
[GeneratorExternal]
5+
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
6+
funcName=GenerateEMCocktail(400,0,3,63,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/parametrizations/PbPb5TeV_peripheral.json","5TeV_6070_wRatio_pi0corr",350,0.0,30.0,10000,1,1,0,0,"",0,1.1,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/decaytables/decaytable_LMee.dat",1)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### The setup uses an external event generator
2+
### This part sets the path of the file and the function call to retrieve it
3+
4+
[GeneratorExternal]
5+
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
6+
funcName=GenerateEMCocktail(400,0,3,63,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/parametrizations/PbPb5TeV_peripheral.json","5TeV_7080_wRatio_pi0corr",350,0.0,30.0,10000,1,1,0,0,"",0,1.1,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/decaytables/decaytable_LMee.dat",1)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
### The setup uses an external event generator
2+
### This part sets the path of the file and the function call to retrieve it
3+
4+
[GeneratorExternal]
5+
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
6+
funcName=GenerateEMCocktail(400,0,3,63,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/parametrizations/PbPb5TeV_peripheral.json","5TeV_8090_wRatio_pi0corr",350,0.0,30.0,10000,1,1,0,0,"",0,1.1,"${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/decaytables/decaytable_LMee.dat",1)

MC/config/PWGEM/ini/tests/GeneratorEMCocktail.C

Lines changed: 0 additions & 179 deletions
This file was deleted.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
int External()
2+
{
3+
4+
int checkPdgDecay = -11;
5+
std::string path{"o2sim_Kine.root"};
6+
TFile file(path.c_str(), "READ");
7+
if (file.IsZombie()) {
8+
std::cerr << "Cannot open ROOT file " << path << "\n";
9+
return 1;
10+
}
11+
12+
auto tree = (TTree*)file.Get("o2sim");
13+
std::vector<o2::MCTrack>* tracks{};
14+
tree->SetBranchAddress("MCTrack", &tracks);
15+
16+
int nMesons{};
17+
int nMesonsDiElectronDecay{};
18+
auto nEvents = tree->GetEntries();
19+
20+
for (int i = 0; i < nEvents; i++) {
21+
tree->GetEntry(i);
22+
for (auto& track : *tracks) {
23+
auto pdg = track.GetPdgCode();
24+
auto y = track.GetRapidity();
25+
if ((pdg == 111) || (pdg == 221) || (pdg == 331) || (pdg == 223) || (pdg == 113) || (pdg == 333)) {
26+
if ((y>-1.2) && (y<1.2)) {
27+
nMesons++;
28+
Int_t counterel = 0;
29+
Int_t counterpos = 0;
30+
int k1 = track.getFirstDaughterTrackId();
31+
int k2 = track.getLastDaughterTrackId();
32+
// k1 < k2 and no -1 for k2
33+
for (int d=k1; d <= k2; d++) {
34+
if (d>0) {
35+
auto decay = (*tracks)[d];
36+
int pdgdecay = decay.GetPdgCode();
37+
if (pdgdecay == 11) {
38+
counterel++;
39+
}
40+
if (pdgdecay == -11) {
41+
counterpos++;
42+
}
43+
}
44+
}
45+
if ((counterel>0) && (counterpos>0)) nMesonsDiElectronDecay++;
46+
}
47+
}
48+
}
49+
}
50+
51+
std::cout << "#events: " << nEvents << "\n"
52+
<< "#mesons: " << nMesons << "\n"
53+
<< "#mesons which decay semi-electronicly: " << nMesonsDiElectronDecay << "\n";
54+
if (nMesonsDiElectronDecay < nEvents) {
55+
std::cerr << "One should have at least one meson that decays into dielectrons per event.\n";
56+
return 1;
57+
}
58+
if (nMesons < nEvents) {
59+
std::cerr << "One meson per event should be produced.\n";
60+
return 1;
61+
}
62+
63+
return 0;
64+
}

0 commit comments

Comments
 (0)