forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread_event_info.macro
More file actions
31 lines (23 loc) · 818 Bytes
/
read_event_info.macro
File metadata and controls
31 lines (23 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "generator.macro"
void
read_event_info(const char *fname)
{
auto fin = TFile::Open(fname);
auto tin = (TTree*)fin->Get("o2sim");
auto head = new o2::dataformats::MCEventHeader;
tin->SetBranchAddress("MCEventHeader.", &head);
bool isvalid;
for (int iev = 0; iev < tin->GetEntries(); ++iev) {
tin->GetEntry(iev);
std::cout << " ---------------" << std::endl;
auto Xsection = Generator::getXsection(head, isvalid);
if (isvalid)
std::cout << " Xsection = " << Xsection << std::endl;
auto XsectionErr = Generator::getXsectionErr(head, isvalid);
if (isvalid)
std::cout << " XsectionErr = " << XsectionErr << std::endl;
auto Nmpi = Generator::getNmpi(head, isvalid);
if (isvalid)
std::cout << " Nmpi = " << Nmpi << std::endl;
}
}