Skip to content

Commit 93aab58

Browse files
committed
MC/PWGEM: update DY generator in OO
1 parent 0ae184a commit 93aab58

14 files changed

Lines changed: 419 additions & 121 deletions

MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_DYLL.C renamed to MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_DYll.C

File renamed without changes.

MC/config/PWGEM/ini/GeneratorDYee_GapTriggered_Gap5_PbPb5360GeV.ini renamed to MC/config/PWGEM/ini/GeneratorDYee_GapTriggered_Gap2_OO5360GeV.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[GeneratorExternal]
22
fileName = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/external/generator/Generator_pythia8_GapTriggered_DYll.C
3-
funcName = GeneratorPythia8GapTriggeredDYll(5, 1, 11, -1.5, +1.5, 1000822080, 1000822080, 5360.0)
3+
funcName = GeneratorPythia8GapTriggeredDYll(2, 1, 11, -1.5, +1.5, 1000080160, 1000080160, 5360.0)
44

55
[GeneratorPythia8]
66
config = ${O2DPG_MC_CONFIG_ROOT}/MC/config/PWGEM/pythia8/generator/configPythiaEmpty.cfg

MC/config/PWGEM/ini/GeneratorDYee_GapTriggered_Gap5_pp13600GeV.ini

Lines changed: 0 additions & 7 deletions
This file was deleted.

MC/config/PWGEM/ini/GeneratorDYmumu_GapTriggered_Gap5_PbPb5360GeV.ini

Lines changed: 0 additions & 7 deletions
This file was deleted.

MC/config/PWGEM/ini/GeneratorDYmumu_GapTriggered_Gap5_pp13600GeV.ini

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
int External() {
2+
std::string path{"o2sim_Kine.root"};
3+
// Check that file exists, can be opened and has the correct tree
4+
TFile file(path.c_str(), "READ");
5+
if (file.IsZombie())
6+
{
7+
std::cerr << "Cannot open ROOT file " << path << "\n";
8+
return 1;
9+
}
10+
auto tree = (TTree *)file.Get("o2sim");
11+
if (!tree)
12+
{
13+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
14+
return 1;
15+
}
16+
std::vector<o2::MCTrack> *tracks{};
17+
tree->SetBranchAddress("MCTrack", &tracks);
18+
19+
// Check if all events are filled
20+
auto nEvents = tree->GetEntries();
21+
for (Long64_t i = 0; i < nEvents; ++i)
22+
{
23+
tree->GetEntry(i);
24+
if (tracks->empty())
25+
{
26+
std::cerr << "Empty entry found at event " << i << "\n";
27+
return 1;
28+
}
29+
}
30+
// check if each event has at least two oxygen ions
31+
for (int i = 0; i < nEvents; i++)
32+
{
33+
auto check = tree->GetEntry(i);
34+
int count = 0;
35+
for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack)
36+
{
37+
auto track = tracks->at(idxMCTrack);
38+
if (track.GetPdgCode() == 1000080160)
39+
{
40+
count++;
41+
}
42+
}
43+
if (count < 2)
44+
{
45+
std::cerr << "Event " << i << " has less than 2 oxygen ions\n";
46+
return 1;
47+
}
48+
}
49+
50+
return 0;
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
int External() {
2+
std::string path{"o2sim_Kine.root"};
3+
// Check that file exists, can be opened and has the correct tree
4+
TFile file(path.c_str(), "READ");
5+
if (file.IsZombie())
6+
{
7+
std::cerr << "Cannot open ROOT file " << path << "\n";
8+
return 1;
9+
}
10+
auto tree = (TTree *)file.Get("o2sim");
11+
if (!tree)
12+
{
13+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
14+
return 1;
15+
}
16+
std::vector<o2::MCTrack> *tracks{};
17+
tree->SetBranchAddress("MCTrack", &tracks);
18+
19+
// Check if all events are filled
20+
auto nEvents = tree->GetEntries();
21+
for (Long64_t i = 0; i < nEvents; ++i)
22+
{
23+
tree->GetEntry(i);
24+
if (tracks->empty())
25+
{
26+
std::cerr << "Empty entry found at event " << i << "\n";
27+
return 1;
28+
}
29+
}
30+
// check if each event has at least two oxygen ions
31+
for (int i = 0; i < nEvents; i++)
32+
{
33+
auto check = tree->GetEntry(i);
34+
int count = 0;
35+
for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack)
36+
{
37+
auto track = tracks->at(idxMCTrack);
38+
if (track.GetPdgCode() == 1000080160)
39+
{
40+
count++;
41+
}
42+
}
43+
if (count < 2)
44+
{
45+
std::cerr << "Event " << i << " has less than 2 oxygen ions\n";
46+
return 1;
47+
}
48+
}
49+
50+
return 0;
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
int External() {
2+
std::string path{"o2sim_Kine.root"};
3+
// Check that file exists, can be opened and has the correct tree
4+
TFile file(path.c_str(), "READ");
5+
if (file.IsZombie())
6+
{
7+
std::cerr << "Cannot open ROOT file " << path << "\n";
8+
return 1;
9+
}
10+
auto tree = (TTree *)file.Get("o2sim");
11+
if (!tree)
12+
{
13+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
14+
return 1;
15+
}
16+
std::vector<o2::MCTrack> *tracks{};
17+
tree->SetBranchAddress("MCTrack", &tracks);
18+
19+
// Check if all events are filled
20+
auto nEvents = tree->GetEntries();
21+
for (Long64_t i = 0; i < nEvents; ++i)
22+
{
23+
tree->GetEntry(i);
24+
if (tracks->empty())
25+
{
26+
std::cerr << "Empty entry found at event " << i << "\n";
27+
return 1;
28+
}
29+
}
30+
// check if each event has at least two oxygen ions
31+
for (int i = 0; i < nEvents; i++)
32+
{
33+
auto check = tree->GetEntry(i);
34+
int count = 0;
35+
for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack)
36+
{
37+
auto track = tracks->at(idxMCTrack);
38+
if (track.GetPdgCode() == 1000080160)
39+
{
40+
count++;
41+
}
42+
}
43+
if (count < 2)
44+
{
45+
std::cerr << "Event " << i << " has less than 2 oxygen ions\n";
46+
return 1;
47+
}
48+
}
49+
50+
return 0;
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
int External() {
2+
std::string path{"o2sim_Kine.root"};
3+
// Check that file exists, can be opened and has the correct tree
4+
TFile file(path.c_str(), "READ");
5+
if (file.IsZombie())
6+
{
7+
std::cerr << "Cannot open ROOT file " << path << "\n";
8+
return 1;
9+
}
10+
auto tree = (TTree *)file.Get("o2sim");
11+
if (!tree)
12+
{
13+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
14+
return 1;
15+
}
16+
std::vector<o2::MCTrack> *tracks{};
17+
tree->SetBranchAddress("MCTrack", &tracks);
18+
19+
// Check if all events are filled
20+
auto nEvents = tree->GetEntries();
21+
for (Long64_t i = 0; i < nEvents; ++i)
22+
{
23+
tree->GetEntry(i);
24+
if (tracks->empty())
25+
{
26+
std::cerr << "Empty entry found at event " << i << "\n";
27+
return 1;
28+
}
29+
}
30+
// check if each event has at least two oxygen ions
31+
for (int i = 0; i < nEvents; i++)
32+
{
33+
auto check = tree->GetEntry(i);
34+
int count = 0;
35+
for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack)
36+
{
37+
auto track = tracks->at(idxMCTrack);
38+
if (track.GetPdgCode() == 1000080160)
39+
{
40+
count++;
41+
}
42+
}
43+
if (count < 2)
44+
{
45+
std::cerr << "Event " << i << " has less than 2 oxygen ions\n";
46+
return 1;
47+
}
48+
}
49+
50+
return 0;
51+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
int External() {
2+
std::string path{"o2sim_Kine.root"};
3+
// Check that file exists, can be opened and has the correct tree
4+
TFile file(path.c_str(), "READ");
5+
if (file.IsZombie())
6+
{
7+
std::cerr << "Cannot open ROOT file " << path << "\n";
8+
return 1;
9+
}
10+
auto tree = (TTree *)file.Get("o2sim");
11+
if (!tree)
12+
{
13+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
14+
return 1;
15+
}
16+
std::vector<o2::MCTrack> *tracks{};
17+
tree->SetBranchAddress("MCTrack", &tracks);
18+
19+
// Check if all events are filled
20+
auto nEvents = tree->GetEntries();
21+
for (Long64_t i = 0; i < nEvents; ++i)
22+
{
23+
tree->GetEntry(i);
24+
if (tracks->empty())
25+
{
26+
std::cerr << "Empty entry found at event " << i << "\n";
27+
return 1;
28+
}
29+
}
30+
// check if each event has at least two oxygen ions
31+
for (int i = 0; i < nEvents; i++)
32+
{
33+
auto check = tree->GetEntry(i);
34+
int count = 0;
35+
for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack)
36+
{
37+
auto track = tracks->at(idxMCTrack);
38+
if (track.GetPdgCode() == 1000080160)
39+
{
40+
count++;
41+
}
42+
}
43+
if (count < 2)
44+
{
45+
std::cerr << "Event " << i << " has less than 2 oxygen ions\n";
46+
return 1;
47+
}
48+
}
49+
50+
return 0;
51+
}

0 commit comments

Comments
 (0)