// $Id$ // // Created Dec 22, 2007 David Lawrence #include #include #include using namespace std; #include #include #include "HDDM/hddm_s.h" void Smear(s_HDDM_t *hddm_s); void ParseCommandLineArguments(int narg, char* argv[]); void Usage(void); void ctrlCHandle(int x); vector INFILENAMES; char *OUTFILENAME = NULL; int QUIT = 0; unsigned int EVENTS_TO_SKIP = 0; unsigned int EVENTS_TO_KEEP = 1; unsigned int SPECIFIC_EVENT_TO_KEEP = 0; #define _DBG_ cout<<__FILE__<<":"<<__LINE__<<" " #define _DBG__ cout<<__FILE__<<":"<<__LINE__<EVENTS_TO_SKIP){ flush_s_HDDM(hddm_s, fout); NEvents++; }else{ flush_s_HDDM(hddm_s, NULL); } // Update ticker time_t now = time(NULL); if(now != last_time){ cout<<" "<=(EVENTS_TO_SKIP+EVENTS_TO_KEEP))break; if(QUIT)break; } // Close input file close_s_HDDM(fin); } // Close output file close_s_HDDM(fout); cout<0){ EVENTS_TO_KEEP=1; EVENTS_TO_SKIP=SPECIFIC_EVENT_TO_KEEP-1; } if(OUTFILENAME==NULL){ if(SPECIFIC_EVENT_TO_KEEP>0){ OUTFILENAME = new char[256]; sprintf(OUTFILENAME,"evt%d.hddm", SPECIFIC_EVENT_TO_KEEP); }else{ OUTFILENAME = "culled.hddm"; } } } //----------- // Usage //----------- void Usage(void) { cout<