Skip to content

Commit abe5dac

Browse files
committed
External to Hybrid examples
1 parent e03096e commit abe5dac

4 files changed

Lines changed: 75 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"generators": [
3+
{
4+
"name": "pythia8",
5+
"config": {
6+
"config": "${O2_ROOT}/share/Generators/egconfig/pythia8_inel.cfg",
7+
"hooksFileName": "",
8+
"hooksFuncName": "",
9+
"includePartonEvent": false,
10+
"particleFilter": "",
11+
"verbose": 0
12+
}
13+
},
14+
{
15+
"name": "evtpool",
16+
"config": {
17+
"eventPoolPath" : "alien:///alice/cern.ch/user/a/aliprod/LHC26c9/manifest1.dat",
18+
"skipNonTrackable" : true,
19+
"roundRobin" : false,
20+
"randomize" : true,
21+
"rngseed" : 0,
22+
"randomphi" : false
23+
}
24+
}
25+
],
26+
"fractions": [
27+
1,
28+
1
29+
]
30+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[GeneratorHybrid]
2+
configFile = ${O2DPG_MC_CONFIG_ROOT}/MC/config/examples/hybrid/example.json
3+
switchExtToHybrid = true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#---> GeneratorExtToHybrid
2+
[GeneratorHybrid]
3+
configFile = alien:///alice/cern.ch/user/p/pwg_pp/Hybrid/alienhybrid.json
4+
switchExtToHybrid = true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
int Hybrid()
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 are 100 events, as simulated in the o2dpg-test
32+
if (nEvents != 100)
33+
{
34+
std::cerr << "Expected 100 events, got " << nEvents << "\n";
35+
return 1;
36+
}
37+
return 0;
38+
}

0 commit comments

Comments
 (0)