/******************************************************************************/ /* */ /* VETO.CC */ /* */ /******************************************************************************/ // Compares a list of observed events with a list of veto events to produce // lists of vetoed events, accepted events, applied vetoes, and unapplied // vetoes. Three forms are provided. The more limited forms are // computationally more efficient, but provides only a list of accepted // observations. // // veto observedEventList vetoEventList acceptedEventList // // veto durationInflation bandwidthInflation observedEventList // vetoEventList acceptedEventList // // veto coincidenceWindowDuration coincidenceWindowBandwidth // durationInflation bandwidthInflation observedEventList // vetoEventList acceptedEventList // // veto durationInflation bandwidthInflation observedEventList // vetoEventList vetoedEventList acceptedEventList // appliedEventList unappliedEventList // // veto coincidenceWindowDuration coincidenceWindowBandwidth // durationInflation bandwidthInflation observedEventList // vetoEventList vetoedEventList acceptedEventList // appliedEventList unappliedEventList // Shourov K. Chatterji // shourov@ligo.caltech.edu // $Id: veto.cc,v 1.1 2006/11/03 15:33:59 shourov Exp $ #include #include #include "eventlist.hh" int main(int argc, char **argv) { double coincidenceWindowDuration; double coincidenceWindowBandwidth; double durationInflation; double bandwidthInflation; std::string observedEventListFile; std::string vetoEventListFile; std::string vetoedEventListFile; std::string acceptedEventListFile; std::string appliedEventListFile; std::string unappliedEventListFile; if (argc == 4) { coincidenceWindowDuration = 0.0; coincidenceWindowBandwidth = 0.0; durationInflation = 1.0; bandwidthInflation = 1.0; observedEventListFile= argv[1]; vetoEventListFile= argv[2]; vetoedEventListFile= ""; acceptedEventListFile= argv[3]; appliedEventListFile= ""; unappliedEventListFile= ""; } else if (argc == 6) { coincidenceWindowDuration = 0.0; coincidenceWindowBandwidth = 0.0; durationInflation = atof(argv[1]); bandwidthInflation = atof(argv[2]); observedEventListFile= argv[3]; vetoEventListFile= argv[4]; vetoedEventListFile= ""; acceptedEventListFile= argv[5]; appliedEventListFile= ""; unappliedEventListFile= ""; } else if (argc == 8) { coincidenceWindowDuration = atof(argv[1]); coincidenceWindowBandwidth = atof(argv[2]); durationInflation = atof(argv[3]); bandwidthInflation = atof(argv[4]); observedEventListFile= argv[5]; vetoEventListFile= argv[6]; vetoedEventListFile= ""; acceptedEventListFile= argv[7]; appliedEventListFile= ""; unappliedEventListFile= ""; } else if (argc == 9) { coincidenceWindowDuration = 0.0; coincidenceWindowBandwidth = 0.0; durationInflation = atof(argv[1]); bandwidthInflation = atof(argv[2]); observedEventListFile= argv[3]; vetoEventListFile= argv[4]; vetoedEventListFile= argv[5]; acceptedEventListFile= argv[6]; appliedEventListFile= argv[7]; unappliedEventListFile= argv[8]; } else if (argc == 11) { coincidenceWindowDuration = atof(argv[1]); coincidenceWindowBandwidth = atof(argv[2]); durationInflation = atof(argv[3]); bandwidthInflation = atof(argv[4]); observedEventListFile= argv[5]; vetoEventListFile= argv[6]; vetoedEventListFile= argv[7]; acceptedEventListFile= argv[8]; appliedEventListFile= argv[9]; unappliedEventListFile= argv[10]; } else { std::cerr << "error: incorrect number of arguments" << std::endl; std::cerr << std::endl; std::cerr << "usage: veto observedEventList vetoEventList \\" << std::endl; std::cerr << " acceptedEventList \\" << std::endl; std::cerr << std::endl; std::cerr << " veto durationInflation bandwidthInflation \\" << std::endl; std::cerr << " observedEventList vetoEventList \\" << std::endl; std::cerr << " acceptedEventList \\" << std::endl; std::cerr << std::endl; std::cerr << " veto coincidenceDuration coincidenceBandwidth \\" << std::endl; std::cerr << " durationInflation bandwidthInflation \\" << std::endl; std::cerr << " observedEventList vetoEventList \\" << std::endl; std::cerr << " acceptedEventList \\" << std::endl; std::cerr << std::endl; std::cerr << " veto durationInflation bandwidthInflation \\" << std::endl; std::cerr << " observedEventList vetoEventList \\" << std::endl; std::cerr << " vetoedEventList acceptedEventList \\" << std::endl; std::cerr << " appliedEventList unappliedEventList" << std::endl; std::cerr << std::endl; std::cerr << " veto coincidenceDuration coincidenceBandwidth \\" << std::endl; std::cerr << " durationInflation bandwidthInflation \\" << std::endl; std::cerr << " observedEventList vetoEventList \\" << std::endl; std::cerr << " vetoedEventList acceptedEventList \\" << std::endl; std::cerr << " appliedEventList unappliedEventList" << std::endl; return 1; } event::EventTimeFrequencyCoincidenceCriterion coincidenceCriterion(coincidenceWindowDuration, coincidenceWindowBandwidth, durationInflation, bandwidthInflation); event::EventList observedEventList; event::EventList vetoEventList; event::EventList vetoedEventList; event::EventList acceptedEventList; event::EventList appliedEventList; event::EventList unappliedEventList; observedEventList.read(observedEventListFile); vetoEventList.read(vetoEventListFile); if ((argc == 9) || (argc == 11)) { event::veto(observedEventList, vetoEventList, vetoedEventList, acceptedEventList, appliedEventList, unappliedEventList, coincidenceCriterion); vetoedEventList.write(vetoedEventListFile); acceptedEventList.write(acceptedEventListFile); appliedEventList.write(appliedEventListFile); unappliedEventList.write(unappliedEventListFile); } else { event::veto(observedEventList, vetoEventList, acceptedEventList, coincidenceCriterion); acceptedEventList.write(acceptedEventListFile); } return 0; }