//basic example of how to read a file in c++ #include "EventFile.hh" #include "io_util.hh" int main(int argc, char* argv[]) { if (argc < 2) { print("please give input file on cmd line"); exit(1); } EventFile f( argv[1] ); // event loop for(auto& evt: f ) { // print one-line summary of evt print(evt); cout << evt << endl; // does the same as print(evt) // print more extensive details dump(evt); // print all the (reconstructed) tracks for( auto& t : evt.trks ) { print("track", t); } // print all the monte-carlo tracks for( auto& t : evt.mc_trks ) { print("track", t, t.name() ); } // print something for every hit for (auto& h : evt.hits ) { print ( h.dom_id, h.channel_id ); } } }