80 std::vector<edm::ParameterSet> prescales_in(iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"Prescales"));
82 for (std::vector<edm::ParameterSet>::const_iterator cit = prescales_in.begin(); cit != prescales_in.end(); cit++) {
84 unsigned int factor(cit->getParameter<
unsigned int>(
"PrescaleFactor"));
89 prescale_counter[
name] = 0;
98 trigger_indices.clear();
100 for (std::map<std::string, unsigned int>::const_iterator cit =
prescales.begin(); cit !=
prescales.end(); cit++) {
103 trigger_indices[cit->first] =
index;
106 LogDebug(
"") <<
"requested HLT path does not exist: " << cit->first;
123 auto const& trh =
iEvent.getHandle(tok_trigger);
126 LogDebug(
"") <<
"TriggerResults found, number of HLT paths: " << trh->size();
128 LogDebug(
"") <<
"TriggerResults product not found - returning result=false!";
141 bool accept_event =
false;
142 for (std::map<std::string, unsigned int>::const_iterator cit = trigger_indices.begin(); cit != trigger_indices.end();
144 if (trh->accept(cit->second)) {
145 prescale_counter[cit->first]++;
146 if (prescale_counter[cit->first] >=
prescales[cit->first]) {
148 prescale_counter[cit->first] = 0;
T getParameter(std::string const &) const
edm::ParameterSetID triggerNamesID_
void init(const edm::TriggerResults &, const edm::TriggerNames &triggerNames)
std::map< std::string, unsigned int > prescales
std::map< std::string, unsigned int > prescale_counter
#define DEFINE_FWK_MODULE(type)
std::map< std::string, unsigned int > trigger_indices
edm::EDGetTokenT< TriggerResults > tok_trigger
bool filter(edm::Event &, const edm::EventSetup &) override
PrescalerFHN(const edm::ParameterSet &)