7 #include <HDDM/hddm_s.hpp>
16 void Process_s(
unsigned int &NEvents,
unsigned int &NEvents_read)
19 std::ofstream *ofs =
new std::ofstream(
OUTFILENAME);
20 if (! ofs->is_open()) {
21 std::cout <<
" Error opening output file \"" <<
OUTFILENAME <<
"\"!"
26 hddm_s::ostream *fout =
new hddm_s::ostream(*ofs);
28 std::cout <<
" Enabling bz2 compression of output HDDM file stream"
30 fout->setCompression(hddm_s::k_bz2_compression);
33 std::cout <<
" HDDM compression disabled on output" << std::endl;
37 std::cout <<
" Enabling data integrity check on output HDDM file stream"
39 fout->setIntegrityChecks(hddm_s::k_crc32_integrity);
42 std::cout <<
" HDDM integrity checks disabled on output" << std::endl;
46 time_t last_time = time(NULL);
47 for (
unsigned int i=0; i <
INFILENAMES.size(); i++) {
48 std::cout <<
" input file: " <<
INFILENAMES[i] << std::endl;
49 std::ifstream *ifs =
new std::ifstream(
INFILENAMES[i]);
50 if (! ifs->is_open()) {
51 std::cout <<
" Error opening input file \"" <<
INFILENAMES[i]
52 <<
"\"!" << std::endl;
55 hddm_s::istream *fin =
new hddm_s::istream(*ifs);
63 bool write_this_event =
false;
68 hddm_s::PhysicsEventList pes = record.getPhysicsEvents();
69 hddm_s::PhysicsEventList::iterator eviter;
70 for (eviter = pes.begin(); eviter != pes.end(); ++eviter) {
71 uint64_t eventNo = eviter->getEventNo();
73 write_this_event =
true;
81 write_this_event =
true;
84 if (write_this_event) {
91 time_t now = time(NULL);
92 if (now != last_time) {
93 std::cout <<
" " << NEvents_read <<
" events read ("
94 << NEvents <<
" event written) \r";
unsigned int EVENTS_TO_KEEP
void Process_s(unsigned int &NEvents, unsigned int &NEvents_read)
unsigned int SPECIFIC_EVENT_TO_KEEP
bool HDDM_USE_COMPRESSION
bool HDDM_USE_INTEGRITY_CHECKS
vector< char * > INFILENAMES
unsigned int EVENTS_TO_SKIP