![]() |
![]() |
00001 #include "CalibTracker/SiStripDCS/plugins/FilterTrackerOn.h" 00002 00003 #include "FWCore/Framework/interface/ESHandle.h" 00004 #include "FWCore/Framework/interface/EventSetup.h" 00005 #include "CondFormats/SiStripObjects/interface/SiStripDetVOff.h" 00006 #include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h" 00007 00008 #include <iostream> 00009 #include <algorithm> 00010 00011 FilterTrackerOn::FilterTrackerOn(const edm::ParameterSet& iConfig) : 00012 minModulesWithHVoff_(iConfig.getParameter<int>("MinModulesWithHVoff")) 00013 { 00014 } 00015 00016 FilterTrackerOn::~FilterTrackerOn() 00017 { 00018 } 00019 00020 bool FilterTrackerOn::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) 00021 { 00022 using namespace edm; 00023 00024 ESHandle<SiStripDetVOff> detVOff; 00025 iSetup.get<SiStripDetVOffRcd>().get( detVOff ); 00026 00027 // std::cout << "detVOff->getHVoffCounts() = " << detVOff->getHVoffCounts() << " < " << minModulesWithHVoff_; 00028 if( detVOff->getHVoffCounts() > minModulesWithHVoff_ ) { 00029 // std::cout << " skipping event" << std::endl; 00030 return false; 00031 } 00032 // cout << " keeping event" << endl; 00033 return true; 00034 } 00035 00036 // ------------ method called once each job just before starting event loop ------------ 00037 void FilterTrackerOn::beginJob() 00038 { 00039 } 00040 00041 // ------------ method called once each job just after ending the event loop ------------ 00042 void FilterTrackerOn::endJob() 00043 { 00044 }