54 void endJob()
override;
83 std::vector<edm::ParameterSet> prescales_in(iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"Prescales"));
85 for (std::vector<edm::ParameterSet>::const_iterator cit = prescales_in.begin(); cit != prescales_in.end(); cit++) {
87 unsigned int factor(cit->getParameter<
unsigned int>(
"PrescaleFactor"));
91 prescales[
name] = factor;
92 prescale_counter[
name] = 0;
106 trigger_indices.clear();
108 for (std::map<std::string, unsigned int>::const_iterator cit = prescales.begin(); cit != prescales.end(); cit++) {
109 trigger_indices[cit->first] = triggerNames.
triggerIndex(cit->first);
111 if (trigger_indices[cit->first] >= result.
size()) {
113 LogDebug(
"") <<
"requested HLT path does not exist: " << cit->first;
114 trigger_indices.erase(cit->first);
135 LogDebug(
"") <<
"TriggerResults found, number of HLT paths: " << trh->
size();
137 LogDebug(
"") <<
"TriggerResults product not found - returning result=false!";
144 init(*trh, triggerNames);
150 bool accept_event =
false;
151 for (std::map<std::string, unsigned int>::const_iterator cit = trigger_indices.begin(); cit != trigger_indices.end();
153 if (trh->
accept(cit->second)) {
154 prescale_counter[cit->first]++;
155 if (prescale_counter[cit->first] >= prescales[cit->first]) {
157 prescale_counter[cit->first] = 0;
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool accept() const
Has at least one path accepted the event?
edm::ParameterSetID triggerNamesID_
void init(const edm::TriggerResults &, const edm::TriggerNames &triggerNames)
ParameterSetID const & parameterSetID() const
#define DEFINE_FWK_MODULE(type)
std::map< std::string, unsigned int > prescales
unsigned int triggerIndex(std::string const &name) const
std::map< std::string, unsigned int > prescale_counter
unsigned int size() const
Get number of paths stored.
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 &)
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override