00001 #include "caf_util/EventQuality.hpp" 00002 #include "cafe/Stat.hpp" 00003 #include "cafe/Config.hpp" 00004 00005 using namespace std ; 00006 using namespace cafe ; 00007 00008 namespace caf_util { 00009 00010 EventQuality::EventQuality(const char *name) : cafe::Processor(name), 00011 _vars("_cal_empty_crate", 00012 "_cal_coherent_noise", 00013 "_cal_ring_of_fire", 00014 "_cal_noon_noise") 00015 { 00016 00017 err() << "cafe::EventQuality Processor is obsolete! " 00018 << "Use caf_dq instead. " << endl 00019 << "http://www-d0.fnal.gov/computing/data_quality/d0_private/DataQualityChecker/doc/html/index.html" 00020 << endl ; 00021 00022 exit(1) ; 00023 00024 // get parameters from the configuration file 00025 cafe::Config config(name); 00026 00027 _cal_empty_crate = config.get("cal_empty_crate", true) ; 00028 _cal_coherent_noise = config.get("cal_coherent_noise", true) ; 00029 _cal_ring_of_fire = config.get("cal_ring_of_fire", true) ; 00030 _cal_noon_noise = config.get("cal_noon_noise", true) ; 00031 00032 00033 }; 00034 00035 bool EventQuality::processEvent(cafe::Event &event) 00036 { 00037 00038 00039 00040 //get pointer to statistics collector 00041 StatPointer stat ; 00042 event.get("StatPointer", stat) ; 00043 00044 const TMBGlobal* global = event.getGlobal(_vars) ; 00045 00046 if(_cal_empty_crate && global->cal_empty_crate()) return false; 00047 stat.EventSelected("Event quality: \"cal_empty_crate\"") ; 00048 00049 if(_cal_ring_of_fire && global->cal_ring_of_fire ()) return false; 00050 stat.EventSelected("Event quality: \"cal_ring_of_fire\"") ; 00051 00052 if(_cal_noon_noise && global->cal_noon_noise ()) return false; 00053 stat.EventSelected("Event quality: \"cal_noon_noise\"") ; 00054 00055 if(_cal_coherent_noise && global->cal_coherent_noise ()) return false; 00056 stat.EventSelected("Event quality: \"cal_coherent_noise\"") ; 00057 00058 return true ; 00059 }; 00060 } 00061 ClassImp(caf_util::EventQuality) ; 00062
1.3.4