// $Id$ // // Created Dec 22, 2007 David Lawrence #include "hddm_cull_events.h" void ParseCommandLineArguments(int narg, char* argv[]); void Usage(void); void ctrlCHandle(int x); string HDDM_CLASS = "s"; vector INFILENAMES; char *OUTFILENAME = NULL; int QUIT = 0; unsigned int EVENTS_TO_SKIP = 0; unsigned int EVENTS_TO_KEEP = 1; unsigned int SPECIFIC_OFFSET_TO_KEEP = 0; unsigned int SPECIFIC_EVENT_TO_KEEP = 0; bool EVENT_TO_KEEP_MODE = false; //----------- // main //----------- int main(int narg,char* argv[]) { // Set up to catch SIGINTs for graceful exits signal(SIGINT,ctrlCHandle); ParseCommandLineArguments(narg, argv); cout<<"Skipping "<0){ EVENTS_TO_KEEP=1; EVENTS_TO_SKIP=SPECIFIC_OFFSET_TO_KEEP-1; } if(SPECIFIC_EVENT_TO_KEEP>0){ EVENTS_TO_KEEP=1; EVENTS_TO_SKIP=1000000000; // Large number of events to read in while looking for the specified event } if(OUTFILENAME==NULL){ if(SPECIFIC_OFFSET_TO_KEEP>0){ OUTFILENAME = new char[256]; sprintf(OUTFILENAME,"evt%d.hddm", SPECIFIC_OFFSET_TO_KEEP); }else{ OUTFILENAME = (char*)"culled.hddm"; } } } //----------- // Usage //----------- void Usage(void) { cout<