#include "km3net-dataformat/offline/Evt.hh"
#include "km3net-dataformat/definitions/root.hh"
#include "TFile.h"
#include "TTree.h"
#include <iostream>
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 7 of file readEvtFile.cc.
7 {
9 if (argc != 2) {
10 cout << "usage: readEvtFile file.root" << endl;
11 return 1;
12 }
13
14 TFile *
f1 = TFile::Open(argv[1]);
15
16 if (f1 == nullptr) {
17 cerr << "File can't be open." << endl;
18 return 1;
19 }
20
22 if (EvtTree == 0) {
24 return 1;
25 }
27 EvtTree->SetBranchAddress("Evt",&evt);
28 Long64_t nentries = EvtTree->GetEntries();
29 for (Long64_t i=0; i<nentries; i++) {
30 EvtTree->GetEntry(i);
31 cout <<
"Event ID: " << evt->
id << endl;
33 }
35 return 0;
36}
const JPolynome f1(1.0, 2.0, 3.0)
Function.
static const char *const TTREE_OFFLINE_EVENT
ROOT TTree name.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
void print(std::ostream &out=std::cout) const
Print event.
int id
offline event identifier