Skip to content

Commit 5ea414e

Browse files
authored
Update GeneratorLF_pp1360_wDeCoal.C
1 parent de34192 commit 5ea414e

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

MC/config/PWGLF/ini/tests/GeneratorLF_pp1360_wDeCoal.C

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
1-
int External() {
1+
int External()
2+
{
3+
std::string path{"o2sim_Kine.root"};
4+
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+
12+
auto tree = (TTree *)file.Get("o2sim");
13+
if (!tree)
14+
{
15+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
16+
return 1;
17+
}
18+
std::vector<o2::MCTrack> *tracks{};
19+
tree->SetBranchAddress("MCTrack", &tracks);
20+
21+
auto nEvents = tree->GetEntries();
22+
if (nEvents < 1)
23+
{
24+
std::cerr << "No events actually generated: not OK!";
25+
return 1;
26+
}
227
return 0;
328
}
4-
5-
int Pythia8()
6-
{
7-
return External();
8-
}

0 commit comments

Comments
 (0)