7 #include <HDDM/hddm_r.hpp>
8 using namespace hddm_r;
18 void Process_r(
unsigned int &NEvents,
unsigned int &NEvents_read)
21 std::cout <<
" output file: " <<
OUTFILENAME << std::endl;
24 std::cout <<
" Error opening output file \"" <<
OUTFILENAME <<
"\"!" << std::endl;
28 hddm_r::ostream ostr(ofs);
30 std::cout <<
" Enabling bz2 compression of output HDDM file stream"
32 ostr.setCompression(hddm_r::k_bz2_compression);
35 std::cout <<
" HDDM compression disabled on output" << std::endl;
39 std::cout <<
" Enabling data integrity check on output HDDM file stream"
41 ostr.setIntegrityChecks(hddm_r::k_crc32_integrity);
44 std::cout <<
" HDDM integrity checks disabled on output" << std::endl;
48 time_t last_time = time(NULL);
50 std::cout <<
" input file: " <<
INFILENAMES[i] << std::endl;
56 hddm_r::istream istr(ifs);
59 while (!ifs.eof() && ifs.good()) {
65 bool write_this_event =
false;
69 class ReconstructedPhysicsEvent &reconstructedPhysicsEvent = xrec.getReconstructedPhysicsEvent();
71 uint64_t eventNo = reconstructedPhysicsEvent.getEventNo();
73 write_this_event =
true;
82 if (write_this_event) {
88 time_t now = time(NULL);
89 if (now != last_time) {
90 std::cout <<
" " << NEvents_read <<
" events read (" << NEvents <<
" event written) \r"; std::cout.flush();
unsigned int EVENTS_TO_KEEP
unsigned int SPECIFIC_EVENT_TO_KEEP
void Process_r(unsigned int &NEvents, unsigned int &NEvents_read)
bool HDDM_USE_COMPRESSION
bool HDDM_USE_INTEGRITY_CHECKS
vector< char * > INFILENAMES
unsigned int EVENTS_TO_SKIP