59 virtual void endJob()
override;
68 std::vector<std::pair<edm::RunNumber_t,edm::EventNumber_t> >
RunEventData_;
114 : vetoByRunEventNumber_ (iConfig.getUntrackedParameter<bool>(
"vetoByRunEventNumber",
true))
115 , vetoByHBHEOccupancy_ (iConfig.getUntrackedParameter<bool>(
"vetoByHBHEOccupancy",
false))
116 , minOccupiedHBHE_ (iConfig.getUntrackedParameter<unsigned int>(
"minOccupiedHBHE",5000))
117 , debug_ (iConfig.getUntrackedParameter<bool>(
"debug",
false))
118 , reverseFilter_ (iConfig.getUntrackedParameter<bool>(
"reverseFilter",
false))
119 , hbheInputLabel_ (iConfig.getUntrackedParameter<edm::
InputTag>(
"hbheInputLabel",edm::
InputTag(
"hbhereco")))
122 , hcalNoiseSummaryLabel_ (iConfig.getUntrackedParameter<edm::
InputTag>(
"hcalNoiseSummaryLabel",edm::
InputTag(
"hcalnoise")))
123 , hcalNoiseSummaryToken_ (mayConsume<
HcalNoiseSummary>(hcalNoiseSummaryLabel_))
124 , taggingMode_ (iConfig.getParameter<bool>(
"taggingMode"))
125 , maxerrormessage_ (iConfig.getUntrackedParameter<int>(
"maxerrormessage",1))
126 , forceUseRecHitCollection_ (iConfig.getUntrackedParameter<bool>(
"forceUseRecHitCollection",
false))
127 , forceUseHcalNoiseSummary_ (iConfig.getUntrackedParameter<bool>(
"forceUseHcalNoiseSummary",
false))
130 std::vector<unsigned int> dummy;
133 std::vector<unsigned int> temprunevt = iConfig.
getUntrackedParameter<std::vector<unsigned int> >(
"BadRunEventNumbers",dummy);
137 for (
unsigned int i=0;
i+1<temprunevt.size();
i+=2)
167 bool filterDecision=
true;
179 if (
debug_)
std::cout<<
"\t<HcalLaserEventFilter> Filtering bad event; Run "<<iEvent.
id().
run()<<
" Event = "<<iEvent.
id().
event()<<std::endl;
180 filterDecision=
false;
209 if (
debug_)
std::cout <<
"<HcalLaserEventFilter> Filtering because of large HBHE rechit size; "<<hbheRecHits->size()<<
" rechits is greater than or equal to the allowed maximum of "<<
minOccupiedHBHE_<<std::endl;
210 filterDecision=
false;
216 std::cout <<
"<HcalLaserEventFilter::Error> No valid HBHERecHitCollection with label '"<<
hbheInputLabel_<<
"' found"<<std::endl;
234 if (
debug_)
std::cout <<
"<HcalLaserEventFilter> Filtering because of large HBHE rechit size in HcalNoiseSummary; "<<hSummary->GetRecHitCount()<<
" rechits is greater than or equal to the allowed maximum of "<<
minOccupiedHBHE_<<std::endl;
235 filterDecision=
false;
249 filterDecision=!filterDecision;
251 iEvent.
put( std::auto_ptr<bool>(
new bool(filterDecision)) );
290 std::vector <int>
temp;
296 std::istringstream oss(instring);
297 getline(oss, prefix,
'_');
298 getline(oss, v1,
'_');
299 getline(oss, v2,
'_');
300 getline(oss, v3,
'_');
302 std::stringstream buffer(v1);
329 if (currentVersion[0]<
minVersion_[0])
return false;
334 if (currentVersion[1]<
minVersion_[1])
return false;
338 if (currentVersion[2]<
minVersion_[2])
return false;
edm::EDGetTokenT< HBHERecHitCollection > hbheToken_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > GetCMSSWVersion(std::string const &)
edm::EDGetTokenT< HcalNoiseSummary > hcalNoiseSummaryToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool forceUseRecHitCollection_
#define DEFINE_FWK_MODULE(type)
const edm::InputTag hcalNoiseSummaryLabel_
const edm::InputTag hbheInputLabel_
HcalLaserEventFilter(const edm::ParameterSet &)
unsigned long long EventNumber_t
const bool vetoByRunEventNumber_
const bool reverseFilter_
bool useHcalNoiseSummary_
virtual bool filter(edm::Event &, const edm::EventSetup &) override
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool forceUseHcalNoiseSummary_
virtual void endJob() override
std::string getReleaseVersion()
std::vector< int > minVersion_
const bool vetoByHBHEOccupancy_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool IsGreaterThanMinCMSSWVersion(std::vector< int > const &)
std::vector< std::pair< edm::RunNumber_t, edm::EventNumber_t > > RunEventData_
const unsigned int minOccupiedHBHE_
volatile std::atomic< bool > shutdown_flag false
virtual void beginJob() override