37 : inputTag_(iConfig.getParameter<edm::
InputTag>(
"TriggerResultsTag")),
38 inputToken_(consumes<edm::TriggerResults>(inputTag_)),
40 andOr_(iConfig.getParameter<bool>(
"andOr")),
41 throw_(iConfig.getParameter<bool>(
"throw")),
42 eventSetupPathsKey_(iConfig.getParameter<std::
string>(
"eventSetupPathsKey")),
43 HLTPatterns_(iConfig.getParameter<std::
vector<std::
string> >(
"HLTPaths")),
70 std::vector<std::string>
hltPaths(0);
72 desc.
add<std::vector<std::string> >(
"HLTPaths",
hltPaths);
76 desc.
add<
bool>(
"andOr",
true);
78 desc.
add<
bool>(
"throw",
true);
79 descriptions.
add(
"hltHighLevel", desc);
106 for (
unsigned int i = 0;
i <
n; ++
i) {
115 std::vector<std::vector<std::string>::const_iterator> matches =
117 if (matches.empty()) {
121 <<
"requested pattern \"" << pattern <<
"\" does not match any HLT paths";
123 edm::LogInfo(
"Configuration") <<
"requested pattern \"" << pattern <<
"\" does not match any HLT paths";
126 for (
auto const&
match : matches)
156 <<
"none of the requested paths and pattern match any HLT path - no events will be selected";
162 <<
" - andOr mode: " <<
andOr_ <<
" - throw mode: " <<
throw_;
164 LogTrace(
"HLTHighLevel") <<
"The HLT trigger paths (# index name):";
165 for (
unsigned int i = 0;
i <
n; ++
i)
178 typedef std::map<std::string, std::string> TriggerMap;
179 const TriggerMap& triggerMap = triggerBits.m_alcarecoToTrig;
181 auto listIter = triggerMap.find(key);
182 if (listIter == triggerMap.end()) {
185 <<
"]: No triggerList with key " << key <<
" in AlCaRecoTriggerBitsRcd";
190 return triggerBits.decompose(listIter->second);
202 LogDebug(
"HLTHighLevel") <<
"TriggerResults found, number of HLT paths: " << trh->size();
205 <<
" not found - returning result=false!";
211 bool config_changed =
false;
214 config_changed =
true;
225 unsigned int nbad = 0;
226 unsigned int fired = 0;
229 for (
unsigned int i = 0;
i <
n;
i++)
235 if ((nbad > 0) and (config_changed
or throw_)) {
239 for (
unsigned int i = 0; i <
n; i++)
243 if (config_changed) {
245 <<
"] configured with " << nbad <<
"/" << n <<
" unknown HLT path names: " << message;
250 <<
" HLTHighLevel [instance: " <<
moduleLabel() <<
" - path: " <<
pathName(iEvent) <<
"] configured with "
251 << nbad <<
"/" << n <<
" unknown HLT path names: " << message;
257 LogDebug(
"HLTHighLevel") <<
"Accept = " << std::boolalpha <<
accept;
263 return event.moduleCallingContext()->placeInPathContext()->pathContext()->pathName();
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
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 is_glob(std::string const &pattern)
unsigned int triggerIndex(std::string_view name) const
bool andOr_
false = and-mode (all requested triggers), true = or-mode (at least one)
Log< level::Error, false > LogError
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
ModuleDescription const & moduleDescription() const
std::string const & moduleLabel() const
Strings const & triggerNames() const
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
std::string const & moduleLabel() const
bool getData(T &iHolder) const
unsigned int size() const
Get number of paths stored.
std::vector< unsigned int > HLTPathsByIndex_
list of required HLT triggers by HLT index
tuple key
prepare the HTCondor submission files and eventually submit them
edm::ParameterSetID triggerNamesID_
HLT trigger names.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool filter(edm::Event &, const edm::EventSetup &) override
Log< level::Info, false > LogInfo
std::optional< edm::ESWatcher< AlCaRecoTriggerBitsRcd > > watchAlCaRecoTriggerBitsRcd_
Watcher to be created and used if 'eventSetupPathsKey_' non empty:
edm::ESGetToken< AlCaRecoTriggerBits, AlCaRecoTriggerBitsRcd > alcaRecotriggerBitsToken_
ESGetToken to read AlCaRecoTriggerBits.
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
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
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 &)
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)
Log< level::Warning, false > LogWarning
std::vector< std::string > HLTPatterns_
input patterns that will be expanded into trigger names
edm::InputTag inputTag_
HLT TriggerResults EDProduct.