39 inputTag_ (iConfig.getParameter<
edm::InputTag> (
"TriggerResultsTag")),
40 inputToken_ (consumes<
edm::TriggerResults>(inputTag_)),
42 andOr_ (iConfig.getParameter<
bool> (
"andOr")),
43 throw_ (iConfig.getParameter<
bool> (
"throw")),
44 eventSetupPathsKey_(iConfig.getParameter<
std::
string>(
"eventSetupPathsKey")),
45 watchAlCaRecoTriggerBitsRcd_(
nullptr),
46 HLTPatterns_ (iConfig.getParameter<
std::vector<
std::
string> >(
"HLTPaths")),
59 <<
"\n configured with " <<
HLTPatterns_.size() <<
" HLTPaths and\n" 79 std::vector<std::string>
hltPaths(0);
81 desc.
add<std::vector<std::string> >(
"HLTPaths",
hltPaths);
85 desc.
add<
bool>(
"andOr",
true);
87 desc.
add<
bool>(
"throw",
true);
88 descriptions.
add(
"hltHighLevel", desc);
116 for (
unsigned int i = 0;
i <
n; ++
i) {
126 if (matches.empty()) {
129 throw cms::Exception(
"Configuration") <<
"requested pattern \"" <<
pattern <<
"\" does not match any HLT paths";
131 edm::LogInfo(
"Configuration") <<
"requested pattern \"" <<
pattern <<
"\" does not match any HLT paths";
134 for(
auto const&
match : matches)
163 edm::LogWarning(
"Configuration") <<
"none of the requested paths and pattern match any HLT path - no events will be selected";
170 <<
" - Number of paths: " << n
171 <<
" - andOr mode: " <<
andOr_ 172 <<
" - throw mode: " <<
throw_;
174 LogTrace(
"HLTHighLevel") <<
"The HLT trigger paths (# index name):";
175 for (
unsigned int i = 0;
i <
n; ++
i)
184 std::vector<std::string>
190 typedef std::map<std::string, std::string> TriggerMap;
193 auto listIter = triggerMap.find(key);
194 if (listIter == triggerMap.end()) {
197 <<
"]: No triggerList with key " << key <<
" in AlCaRecoTriggerBitsRcd";
202 return triggerBits->
decompose(listIter->second);
216 LogDebug(
"HLTHighLevel") <<
"TriggerResults found, number of HLT paths: " << trh->
size();
218 LogError(
"HLTHighLevel") <<
"TriggerResults product " <<
inputTag_.
encode() <<
" not found - returning result=false!";
224 bool config_changed =
false;
227 config_changed =
true;
235 this->
init(*trh, iEvent, iSetup, triggerNames);
238 unsigned int nbad = 0;
239 unsigned int fired = 0;
242 for (
unsigned int i = 0;
i <
n;
i++)
248 if ((nbad > 0) and (config_changed
or throw_)) {
252 for (
unsigned int i = 0; i <
n; i++)
256 if (config_changed) {
260 <<
"] configured with " << nbad
262 <<
" unknown HLT path names: " << message;
269 <<
"] configured with " << nbad
271 <<
" unknown HLT path names: " << message;
276 const bool accept( (fired > 0) and (
andOr_ or (fired == n-nbad) ) );
277 LogDebug(
"HLTHighLevel") <<
"Accept = " << std::boolalpha <<
accept;
284 return event.moduleCallingContext()->placeInPathContext()->pathContext()->pathName();
T getParameter(std::string const &) const
std::map< std::string, std::string > m_alcarecoToTrig
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void init(const edm::TriggerResults &results, const edm::Event &, const edm::EventSetup &iSetup, const edm::TriggerNames &triggerNames)
initialize the trigger conditions (call this if the trigger paths have changed)
bool accept() const
Has at least one path accepted the event?
bool is_glob(std::string const &pattern)
std::vector< std::string > decompose(const std::string &concatPaths) const
Decompose one value of map from concatenated string.
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)
std::string const & moduleLabel() const
Strings const & triggerNames() const
std::string const & moduleLabel() const
ParameterSetID const & parameterSetID() const
unsigned int triggerIndex(std::string const &name) const
unsigned int size() const
Get number of paths stored.
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::vector< unsigned int > HLTPathsByIndex_
list of required HLT triggers by HLT index
edm::ParameterSetID triggerNamesID_
HLT trigger names.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool filter(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< edm::TriggerResults > inputToken_
const std::string eventSetupPathsKey_
not empty => use read paths from AlCaRecoTriggerBitsRcd via this key
std::string const & triggerName(unsigned int index) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool check(const edm::EventSetup &iSetup)
std::vector< std::string > pathsFromSetup(const std::string &key, const edm::Event &, const edm::EventSetup &iSetup) const
get HLTPaths with key 'key' from EventSetup (AlCaRecoTriggerBitsRcd)
std::vector< std::vector< std::string >::const_iterator > regexMatch(std::vector< std::string > const &strings, std::regex const ®exp)
bool throw_
throw on any requested trigger being unknown
HLTHighLevel(const edm::ParameterSet &)
ModuleDescription const & moduleDescription() const
std::string const & pathName(const edm::Event &) const
stolen from HLTFilter
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.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< std::string > HLTPatterns_
input patterns that will be expanded into trigger names
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
edm::InputTag inputTag_
HLT TriggerResults EDProduct.
edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchAlCaRecoTriggerBitsRcd_
Watcher to be created and used if 'eventSetupPathsKey_' non empty: