54 virtual void endJob()
override ;
85 std::vector<edm::ParameterSet> prescales_in(iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"Prescales"));
87 for (std::vector<edm::ParameterSet>::const_iterator cit = prescales_in.begin();
88 cit != prescales_in.end(); cit++) {
91 unsigned int factor(cit->getParameter<
unsigned int>(
"PrescaleFactor"));
96 prescale_counter[
name] = 0;
118 trigger_indices.clear();
120 for (std::map<std::string, unsigned int>::const_iterator cit =
prescales.begin();
123 trigger_indices[cit->first] = triggerNames.
triggerIndex(cit->first);
125 if (trigger_indices[cit->first] >= result.
size()) {
127 LogDebug(
"") <<
"requested HLT path does not exist: " << cit->first;
128 trigger_indices.erase(cit->first);
152 LogDebug(
"") <<
"TriggerResults found, number of HLT paths: " << trh->size();
154 LogDebug(
"") <<
"TriggerResults product not found - returning result=false!";
159 if (triggerNamesID_ != triggerNames.parameterSetID()) {
161 init(*trh, triggerNames);
167 bool accept_event =
false;
168 for (std::map<std::string, unsigned int>::const_iterator cit = trigger_indices.begin();
169 cit != trigger_indices.end(); cit++) {
170 if (trh->accept(cit->second)) {
171 prescale_counter[cit->first]++;
172 if (prescale_counter[cit->first] >=
prescales[cit->first]) {
174 prescale_counter[cit->first] = 0;
T getParameter(std::string const &) const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
virtual void beginJob() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
DEFINE_FWK_MODULE(HiMixingModule)
edm::ParameterSetID triggerNamesID_
void init(const edm::TriggerResults &, const edm::TriggerNames &triggerNames)
ParameterSetID const & parameterSetID() const
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.
virtual void endJob() override
std::map< std::string, unsigned int > trigger_indices
edm::EDGetTokenT< TriggerResults > tok_trigger
virtual bool filter(edm::Event &, const edm::EventSetup &) override
PrescalerFHN(const edm::ParameterSet &)