Skip to content

Commit 99bc6c8

Browse files
committed
added proper test macro
1 parent 2761632 commit 99bc6c8

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+
#include "TFile.h"
2+
#include "TTree.h"
3+
#include <vector>
4+
#include <iostream>
5+
#include "SimulationDataFormat/MCTrack.h"
6+
7+
int Hybrid()
8+
{
9+
std::string path{"o2sim_Kine.root"};
10+
11+
TFile file(path.c_str(), "READ");
12+
if (file.IsZombie()) {
13+
std::cerr << "Cannot open ROOT file " << path << "\n";
14+
return 1;
15+
}
16+
17+
auto tree = (TTree *)file.Get("o2sim");
18+
if (!tree) {
19+
std::cerr << "Cannot find tree o2sim in file " << path << "\n";
20+
return 1;
21+
}
22+
23+
std::vector<o2::MCTrack> *tracks{};
24+
tree->SetBranchAddress("MCTrack", &tracks);
25+
26+
std::cout << "Found " << tree->GetEntries() << " events." << std::endl;
27+
return 0;
28+
}

0 commit comments

Comments
 (0)