// $Id$ // // Created Dec 22, 2007 David Lawrence #include "hddm_merge_files.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; bool HDDM_USE_COMPRESSION = false; bool HDDM_USE_INTEGRITY_CHECKS = false; //----------- // main //----------- int main(int narg,char* argv[]) { // Set up to catch SIGINTs for graceful exits signal(SIGINT, ctrlCHandle); ParseCommandLineArguments(narg, argv); unsigned int NEvents = 0; unsigned int NEvents_read = 0; // Each HDDM class must have it's own cull routine if (HDDM_CLASS == "s") Process_s(NEvents, NEvents_read); else if (HDDM_CLASS == "r") Process_r(NEvents, NEvents_read); else { std::cout << "Don't know how to process HDDM class \"" << HDDM_CLASS << "\"!" << std::endl; return -1; } std::cout << std::endl; std::cout << " " << NEvents_read << " events read, " << NEvents << " events written" << std::endl; return 0; } //----------- // ParseCommandLineArguments //----------- void ParseCommandLineArguments(int narg, char* argv[]) { INFILENAMES.clear(); for (int i=1; i