Skip to content
Open
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
30 changes: 30 additions & 0 deletions MC/config/examples/hybrid/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"generators": [
{
"name": "pythia8",
"config": {
"config": "${O2_ROOT}/share/Generators/egconfig/pythia8_inel.cfg",
"hooksFileName": "",
"hooksFuncName": "",
"includePartonEvent": false,
"particleFilter": "",
"verbose": 0
}
},
{
"name": "evtpool",
"config": {
"eventPoolPath" : "${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/hybrid/examplemanifest.dat",
"skipNonTrackable" : true,
"roundRobin" : false,
"randomize" : true,
"rngseed" : 0,
"randomphi" : false
}
}
],
"fractions": [
1,
1
]
}
10 changes: 10 additions & 0 deletions MC/config/examples/hybrid/examplemanifest.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
alien:///alice/sim/2025/EP25i1_GeneratorHF_D2H_bbbar_Mode2_XiC_NoDecay/1/001/evtpool.root
alien:///alice/sim/2025/EP25i1_GeneratorHF_D2H_bbbar_Mode2_XiC_NoDecay/1/002/evtpool.root
alien:///alice/sim/2025/EP25i1_GeneratorHF_D2H_bbbar_Mode2_XiC_NoDecay/1/003/evtpool.root
alien:///alice/sim/2025/EP25i1_GeneratorHF_D2H_bbbar_Mode2_XiC_NoDecay/1/004/evtpool.root
alien:///alice/sim/2025/EP25i1_GeneratorHF_D2H_bbbar_Mode2_XiC_NoDecay/1/005/evtpool.root
alien:///alice/sim/2025/EP25i1_GeneratorHF_D2H_bbbar_Mode2_XiC_NoDecay/1/006/evtpool.root
alien:///alice/sim/2025/EP25i1_GeneratorHF_D2H_bbbar_Mode2_XiC_NoDecay/1/007/evtpool.root
alien:///alice/sim/2025/EP25i1_GeneratorHF_D2H_bbbar_Mode2_XiC_NoDecay/1/008/evtpool.root
alien:///alice/sim/2025/EP25i1_GeneratorHF_D2H_bbbar_Mode2_XiC_NoDecay/1/009/evtpool.root
alien:///alice/sim/2025/EP25i1_GeneratorHF_D2H_bbbar_Mode2_XiC_NoDecay/1/010/evtpool.root
3 changes: 3 additions & 0 deletions MC/config/examples/ini/GeneratorExtToHybrid.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[GeneratorHybrid]
configFile = ${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/hybrid/example.json
switchExtToHybrid = true
3 changes: 3 additions & 0 deletions MC/config/examples/ini/GeneratorExtToHybridAlien.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[GeneratorHybrid]
configFile = alien:///alice/cern.ch/user/p/pwg_pp/Hybrid/alienhybrid.json
switchExtToHybrid = true
38 changes: 38 additions & 0 deletions MC/config/examples/ini/tests/GeneratorExtToHybrid.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
int Hybrid()
{
std::string path{"o2sim_Kine.root"};
// Check that file exists, can be opened and has the correct tree
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");
if (!tree)
{
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
return 1;
}
std::vector<o2::MCTrack> *tracks{};
tree->SetBranchAddress("MCTrack", &tracks);

// Check if all events are filled
auto nEvents = tree->GetEntries();
for (Long64_t i = 0; i < nEvents; ++i)
{
tree->GetEntry(i);
if (tracks->empty())
{
std::cerr << "Empty entry found at event " << i << "\n";
return 1;
}
}
// Check if there are 100 events, as simulated in the o2dpg-test
if (nEvents != 100)
{
std::cerr << "Expected 100 events, got " << nEvents << "\n";
return 1;
}
return 0;
}
38 changes: 38 additions & 0 deletions MC/config/examples/ini/tests/GeneratorExtToHybridAlien.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
int Hybrid()
{
std::string path{"o2sim_Kine.root"};
// Check that file exists, can be opened and has the correct tree
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");
if (!tree)
{
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
return 1;
}
std::vector<o2::MCTrack> *tracks{};
tree->SetBranchAddress("MCTrack", &tracks);

// Check if all events are filled
auto nEvents = tree->GetEntries();
for (Long64_t i = 0; i < nEvents; ++i)
{
tree->GetEntry(i);
if (tracks->empty())
{
std::cerr << "Empty entry found at event " << i << "\n";
return 1;
}
}
// Check if there are 100 events, as simulated in the o2dpg-test
if (nEvents != 100)
{
std::cerr << "Expected 100 events, got " << nEvents << "\n";
return 1;
}
return 0;
}
Loading