Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions MC/config/PWGEM/ini/GeneratorEMCocktail_502PbPb_0510.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### The setup uses an external event generator
### This part sets the path of the file and the function call to retrieve it

[GeneratorExternal]
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
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)
6 changes: 6 additions & 0 deletions MC/config/PWGEM/ini/GeneratorEMCocktail_502PbPb_3040.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### The setup uses an external event generator
### This part sets the path of the file and the function call to retrieve it

[GeneratorExternal]
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
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)
6 changes: 6 additions & 0 deletions MC/config/PWGEM/ini/GeneratorEMCocktail_502PbPb_4050.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### The setup uses an external event generator
### This part sets the path of the file and the function call to retrieve it

[GeneratorExternal]
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
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)
6 changes: 6 additions & 0 deletions MC/config/PWGEM/ini/GeneratorEMCocktail_502PbPb_5060.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### The setup uses an external event generator
### This part sets the path of the file and the function call to retrieve it

[GeneratorExternal]
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
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)
6 changes: 6 additions & 0 deletions MC/config/PWGEM/ini/GeneratorEMCocktail_502PbPb_6070.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### The setup uses an external event generator
### This part sets the path of the file and the function call to retrieve it

[GeneratorExternal]
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
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)
6 changes: 6 additions & 0 deletions MC/config/PWGEM/ini/GeneratorEMCocktail_502PbPb_7080.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### The setup uses an external event generator
### This part sets the path of the file and the function call to retrieve it

[GeneratorExternal]
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
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)
6 changes: 6 additions & 0 deletions MC/config/PWGEM/ini/GeneratorEMCocktail_502PbPb_8090.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### The setup uses an external event generator
### This part sets the path of the file and the function call to retrieve it

[GeneratorExternal]
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/GeneratorEMCocktailV2.C
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)
179 changes: 0 additions & 179 deletions MC/config/PWGEM/ini/tests/GeneratorEMCocktail.C

This file was deleted.

64 changes: 64 additions & 0 deletions MC/config/PWGEM/ini/tests/GeneratorEMCocktail_502PbPb_0005.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
int External()
{

int checkPdgDecay = -11;
std::string path{"o2sim_Kine.root"};
TFile file(path.c_str(), "READ");
if (file.IsZombie()) {
std::cerr << "Cannot open ROOT file " << path << "\n";
return 1;
}

auto tree = (TTree*)file.Get("o2sim");
std::vector<o2::MCTrack>* tracks{};
tree->SetBranchAddress("MCTrack", &tracks);

int nMesons{};
int nMesonsDiElectronDecay{};
auto nEvents = tree->GetEntries();

for (int i = 0; i < nEvents; i++) {
tree->GetEntry(i);
for (auto& track : *tracks) {
auto pdg = track.GetPdgCode();
auto y = track.GetRapidity();
if ((pdg == 111) || (pdg == 221) || (pdg == 331) || (pdg == 223) || (pdg == 113) || (pdg == 333)) {
if ((y>-1.2) && (y<1.2)) {
nMesons++;
Int_t counterel = 0;
Int_t counterpos = 0;
int k1 = track.getFirstDaughterTrackId();
int k2 = track.getLastDaughterTrackId();
// k1 < k2 and no -1 for k2
for (int d=k1; d <= k2; d++) {
if (d>0) {
auto decay = (*tracks)[d];
int pdgdecay = decay.GetPdgCode();
if (pdgdecay == 11) {
counterel++;
}
if (pdgdecay == -11) {
counterpos++;
}
}
}
if ((counterel>0) && (counterpos>0)) nMesonsDiElectronDecay++;
}
}
}
}

std::cout << "#events: " << nEvents << "\n"
<< "#mesons: " << nMesons << "\n"
<< "#mesons which decay semi-electronicly: " << nMesonsDiElectronDecay << "\n";
if (nMesonsDiElectronDecay < nEvents) {
std::cerr << "One should have at least one meson that decays into dielectrons per event.\n";
return 1;
}
if (nMesons < nEvents) {
std::cerr << "One meson per event should be produced.\n";
return 1;
}

return 0;
}
64 changes: 64 additions & 0 deletions MC/config/PWGEM/ini/tests/GeneratorEMCocktail_502PbPb_0510.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
int External()
{

int checkPdgDecay = -11;
std::string path{"o2sim_Kine.root"};
TFile file(path.c_str(), "READ");
if (file.IsZombie()) {
std::cerr << "Cannot open ROOT file " << path << "\n";
return 1;
}

auto tree = (TTree*)file.Get("o2sim");
std::vector<o2::MCTrack>* tracks{};
tree->SetBranchAddress("MCTrack", &tracks);

int nMesons{};
int nMesonsDiElectronDecay{};
auto nEvents = tree->GetEntries();

for (int i = 0; i < nEvents; i++) {
tree->GetEntry(i);
for (auto& track : *tracks) {
auto pdg = track.GetPdgCode();
auto y = track.GetRapidity();
if ((pdg == 111) || (pdg == 221) || (pdg == 331) || (pdg == 223) || (pdg == 113) || (pdg == 333)) {
if ((y>-1.2) && (y<1.2)) {
nMesons++;
Int_t counterel = 0;
Int_t counterpos = 0;
int k1 = track.getFirstDaughterTrackId();
int k2 = track.getLastDaughterTrackId();
// k1 < k2 and no -1 for k2
for (int d=k1; d <= k2; d++) {
if (d>0) {
auto decay = (*tracks)[d];
int pdgdecay = decay.GetPdgCode();
if (pdgdecay == 11) {
counterel++;
}
if (pdgdecay == -11) {
counterpos++;
}
}
}
if ((counterel>0) && (counterpos>0)) nMesonsDiElectronDecay++;
}
}
}
}

std::cout << "#events: " << nEvents << "\n"
<< "#mesons: " << nMesons << "\n"
<< "#mesons which decay semi-electronicly: " << nMesonsDiElectronDecay << "\n";
if (nMesonsDiElectronDecay < nEvents) {
std::cerr << "One should have at least one meson that decays into dielectrons per event.\n";
return 1;
}
if (nMesons < nEvents) {
std::cerr << "One meson per event should be produced.\n";
return 1;
}

return 0;
}
Loading