16 #include <boost/foreach.hpp>
37 inputTag_ (iConfig.getParameter<edm::InputTag> (
"TriggerResultsTag")),
39 andOr_ (iConfig.getParameter<bool> (
"andOr")),
40 throw_ (iConfig.getParameter<bool> (
"throw")),
41 eventSetupPathsKey_(iConfig.getParameter<std::string>(
"eventSetupPathsKey")),
42 watchAlCaRecoTriggerBitsRcd_(0),
43 HLTPatterns_ (iConfig.getParameter<std::vector<std::string> >(
"HLTPaths")),
55 <<
" HLTHighLevel instance: "<< iConfig.
getParameter<std::string>(
"@module_label")
56 <<
"\n configured with " <<
HLTPatterns_.size() <<
" HLTPaths and\n"
96 for (
unsigned int i = 0;
i <
n; ++
i) {
106 if (matches.empty()) {
109 throw cms::Exception(
"Configuration") <<
"requested pattern \"" << pattern <<
"\" does not match any HLT paths";
111 edm::LogInfo(
"Configuration") <<
"requested pattern \"" << pattern <<
"\" does not match any HLT paths";
114 BOOST_FOREACH(std::vector<std::string>::const_iterator
match, matches)
143 edm::LogWarning(
"Configuration") <<
"none of the requested paths and pattern match any HLT path - no events will be selected";
150 <<
" - Number of paths: " << n
151 <<
" - andOr mode: " <<
andOr_
152 <<
" - throw mode: " <<
throw_;
154 LogTrace(
"HLTHighLevel") <<
"The HLT trigger paths (# index name):";
155 for (
unsigned int i = 0;
i <
n; ++
i)
164 std::vector<std::string>
170 typedef std::map<std::string, std::string> TriggerMap;
171 const TriggerMap &triggerMap = triggerBits->m_alcarecoToTrig;
173 TriggerMap::const_iterator listIter = triggerMap.find(key);
174 if (listIter == triggerMap.end()) {
177 <<
"]: No triggerList with key " << key <<
" in AlCaRecoTriggerBitsRcd";
182 return triggerBits->decompose(listIter->second);
196 LogDebug(
"HLTHighLevel") <<
"TriggerResults found, number of HLT paths: " << trh->size();
198 LogError(
"HLTHighLevel") <<
"TriggerResults product " <<
inputTag_.
encode() <<
" not found - returning result=false!";
204 bool config_changed =
false;
207 config_changed =
true;
215 this->
init(*trh, iSetup, triggerNames);
218 unsigned int nbad = 0;
219 unsigned int fired = 0;
222 for (
unsigned int i = 0;
i <
n;
i++)
228 if ((nbad > 0) and (config_changed
or throw_)) {
232 for (
unsigned int i = 0; i <
n; i++)
236 if (config_changed) {
240 <<
"] configured with " << nbad
242 <<
" unknown HLT path names: " <<
message;
249 <<
"] configured with " << nbad
251 <<
" unknown HLT path names: " <<
message;
257 LogDebug(
"HLTHighLevel") <<
"Accept = " << std::boolalpha <<
accept;
T getParameter(std::string const &) const
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::string const * moduleLabel() const
bool is_glob(std::string const &pattern)
bool andOr_
false = and-mode (all requested triggers), true = or-mode (at least one)
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Strings const & triggerNames() const
std::string const & moduleLabel() const
std::vector< std::string > pathsFromSetup(const std::string &key, const edm::EventSetup &iSetup) const
get HLTPaths with key 'key' from EventSetup (AlCaRecoTriggerBitsRcd)
unsigned int triggerIndex(std::string const &name) const
unsigned int size() const
Get number of paths stored.
std::vector< unsigned int > HLTPathsByIndex_
list of required HLT triggers by HLT index
edm::ParameterSetID triggerNamesID_
HLT trigger names.
void init(const edm::TriggerResults &results, const edm::EventSetup &iSetup, const edm::TriggerNames &triggerNames)
initialize the trigger conditions (call this if the trigger paths have changed)
std::vector< std::vector< std::string >::const_iterator > regexMatch(std::vector< std::string > const &strings, boost::regex const ®exp)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const std::string eventSetupPathsKey_
not empty => use read paths from AlCaRecoTriggerBitsRcd via this key
std::string const & triggerName(unsigned int index) const
std::string const & pathName() const
stolen from HLTFilter
bool check(const edm::EventSetup &iSetup)
virtual bool filter(edm::Event &, const edm::EventSetup &)
bool throw_
throw on any requested trigger being unknown
HLTHighLevel(const edm::ParameterSet &)
std::vector< std::string > HLTPathsByName_
list of required HLT triggers by HLT name
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::vector< std::string > HLTPatterns_
input patterns that will be expanded into trigger names
std::string const * pathName() const
edm::InputTag inputTag_
HLT TriggerResults EDProduct.
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchAlCaRecoTriggerBitsRcd_
Watcher to be created and used if 'eventSetupPathsKey_' non empty:
CurrentProcessingContext const * currentContext() const