// // eviocount // // scans through file counting events. #include #include #include #include #include #include #include #include "evioBankIndex.hxx" #include "evioUtil.hxx" #include "evioFileChannel.hxx" extern "C" { #include "evio.h" //int swap_int32_t(uint32_t*,int,uint32_t*); } using namespace evio; #define _DBG_ cerr<<__FILE__<<":"<<__LINE__<<" " #define _DBG__ cerr<<__FILE__<<":"<<__LINE__<open(); cout << "Scanning " << fname << " ..." << endl; // loop over all buffers in file, copy data, swap, then write int nev=0; while(chan->readNoCopy()) { nev++; if(nev%1000 == 0){ cout << " " << nev << " events read \r"; cout.flush(); } } chan->close(); cout << endl; cout << "Found " << nev << " events in file" << endl; } catch (evioException e) { cerr << e.what() << endl; exit(EXIT_FAILURE); } // done exit(EXIT_SUCCESS); } //-------------------------------------------------------------------------------