Skip to content

Commit 988ad66

Browse files
committed
Added EPOS4 PbPb example
1 parent b3d66e3 commit 988ad66

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
!--------------------------------------------------------------------
2+
! Lead-Lead collision with hydro and hadronic cascade
3+
!--------------------------------------------------------------------
4+
5+
!---------------------------------------
6+
! Define run
7+
!---------------------------------------
8+
9+
application hadron !hadron-hadron, hadron-nucleus, or nucleus-nucleus
10+
set laproj 82 !projectile atomic number
11+
set maproj 208 !projectile mass number
12+
set latarg 82 !target atomic number
13+
set matarg 208 !target mass number
14+
set ecms 5360 !sqrt(s)_pp
15+
set istmax 25 !max status considered for storage
16+
17+
ftime on !string formation time non-zero
18+
!suppressed decays:
19+
nodecays
20+
110 20 2130 -2130 2230 -2230 1130 -1130 1330 -1330 2330 -2330 3331 -3331
21+
end
22+
23+
set ninicon 1 !number of initial conditions used for hydro evolution
24+
core full !core/corona activated
25+
hydro hlle !hydro activated
26+
eos x3ff !eos activated (epos standard EoS)
27+
hacas full !hadronic cascade activated (UrQMD)
28+
set nfreeze 1 !number of freeze out events per hydro event
29+
set modsho 1 !printout every modsho events
30+
set centrality 0 !0=min bias
31+
set ihepmc 2 !HepMC output enabled on stdout
32+
set nfull 10
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#NEV> 1
2+
[GeneratorExternal]
3+
fileName=${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generator_EPOS4.C
4+
funcName=generateEPOS4("${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/generator/examplepbpb.optns", 2147483647)
5+
6+
[GeneratorFileOrCmd]
7+
cmd=${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/epos4/epos.sh
8+
bMaxSwitch=none
9+
10+
# Set to version 2 if EPOS4.0.0 is used
11+
[HepMC]
12+
version=3
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
int External()
2+
{
3+
std::string path{"o2sim_Kine.root"};
4+
// Check that file exists, can be opened and has the correct tree
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+
auto tree = (TTree *)file.Get("o2sim");
12+
if (!tree)
13+
{
14+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
15+
return 1;
16+
}
17+
std::vector<o2::MCTrack> *tracks{};
18+
tree->SetBranchAddress("MCTrack", &tracks);
19+
20+
// Check if all events are filled
21+
auto nEvents = tree->GetEntries();
22+
for (Long64_t i = 0; i < nEvents; ++i)
23+
{
24+
tree->GetEntry(i);
25+
if (tracks->empty())
26+
{
27+
std::cerr << "Empty entry found at event " << i << "\n";
28+
return 1;
29+
}
30+
}
31+
// Check if there is 1 event, as customly set in the ini file
32+
// Lead-Lead collisions with hydro and hadronic cascade are very slow to simulate
33+
if (nEvents != 1)
34+
{
35+
std::cerr << "Expected 1 event, got " << nEvents << "\n";
36+
return 1;
37+
}
38+
// check if each event has two lead ions with 557440 (208*5360) GeV of energy
39+
for (int i = 0; i < nEvents; i++)
40+
{
41+
auto check = tree->GetEntry(i);
42+
int count = 0;
43+
for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack)
44+
{
45+
auto track = tracks->at(idxMCTrack);
46+
double energy = track.GetEnergy();
47+
// Check if lead ion track energy is approximately equal to 557440 GeV (a tolerance of 50 MeV is considered, straight equality does not work due to floating point precision)
48+
if (std::abs(energy - 557440) < 5e-2 && track.GetPdgCode() == 1000822080)
49+
{
50+
count++;
51+
}
52+
}
53+
if (count < 2)
54+
{
55+
std::cerr << "Event " << i << " has less than 2 lead ions at 557440 GeV\n";
56+
return 1;
57+
}
58+
}
59+
return 0;
60+
}

0 commit comments

Comments
 (0)