/******************************************************************************/ /* */ /* THRESHOLD.CC */ /* */ /******************************************************************************/ // Excludes events whose normalized energy is below the specified threshold. A // second form is provided for thresholding collocated veto lists that also // provides a correction factor for calibration uncertainty. Veto events are // excluded if there normalized energy is less than the specified significance // threshold plus a term given by the product of the specified uncertainty // factor and the incoherent energy of the event. // // threshold significanceThreshold inputEventList outputEventList // // threshold significanceThreshold uncertaintyFactor inputEventList // outputEventList // Shourov K. Chatterji // shourov@ligo.caltech.edu // $Id: threshold.cc,v 1.1 2006/11/03 15:33:59 shourov Exp $ #include #include #include "eventlist.hh" int main(int argc, char **argv) { double significanceThreshold; double uncertaintyFactor; std::string inputEventListFile; std::string outputEventListFile; if (argc == 4) { significanceThreshold = atof(argv[1]); uncertaintyFactor = 0.0; inputEventListFile = argv[2]; outputEventListFile = argv[3]; } else if (argc == 5) { significanceThreshold = atof(argv[1]); uncertaintyFactor = atof(argv[2]); inputEventListFile = argv[3]; outputEventListFile = argv[4]; } else { std::cerr << "error: incorrect number of arguments" << std::endl; std::cerr << std::endl; std::cerr << "usage: threshold significanceThreshold \\" << std::endl; std::cerr << " inputEventList outputEventList" << std::endl; std::cerr << std::endl; std::cerr << " threshold significanceThreshold uncertaintyFactor \\" << std::endl; std::cerr << " inputEventList outputEventList" << std::endl; return 1; } event::EventNormalizedEnergyLessThanCutCriterion cutCriterion(significanceThreshold, uncertaintyFactor); event::EventList eventList; eventList.read(inputEventListFile); eventList.cut(cutCriterion); eventList.write(outputEventListFile); return 0; }