Skip to content

Commit 2040ba3

Browse files
authored
Add test for OO cascade configuration
1 parent 4319f1d commit 2040ba3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
}
27+
return 0;
28+
}

0 commit comments

Comments
 (0)