22 #include <boost/regex.hpp>
30 return &dummyHLTConfigData;
73 LogInfo(
"HLTConfigData") <<
"Called (R) with processName '"
75 <<
"' for " << iRun.
id() << endl;
105 if ((processPSet!=0) && (processPSet->
exists(
"hltTriggerSummaryAOD"))) {
110 LogInfo(
"HLTConfigData") <<
"Auto-discovered processName: '"
116 LogError(
"HLTConfigData") <<
"Auto-discovery of processName failed!"
130 <<
" times in history!" << endl;
144 LogError(
"HLTConfigProvider") <<
"Falling back to processName-only init!";
148 LogError(
"HLTConfigProvider") <<
"ProcessName not found in history!";
168 edm::LogError(
"HLTConfigProvider") <<
"ProcessPSet found is empty!";
183 edm::LogError(
"HLTConfigProvider") <<
"ProcessPSet not found in regsistry!";
204 unsigned int nPSets(0);
209 if (
i->second.exists(
"@process_name")) {
210 const std::string pName(
i->second.getParameter<
string>(
"@process_name"));
212 if ( pName == processName ) {
217 }
else if ( 0 != (pset = registry_->
getMapped(psetID))) {
218 if (pset->exists(
"HLTConfigVersion")) {
219 const ParameterSet& HLTPSet(pset->getParameterSet(
"HLTConfigVersion"));
220 if (HLTPSet.exists(
"tableName")) {
221 hNames += HLTPSet.
getParameter<
string>(
"tableName")+
" ";
229 LogVerbatim(
"HLTConfigProvider") <<
"Unordered list of all process names found: "
230 << pNames <<
"." << endl;
232 LogVerbatim(
"HLTConfigProvider") <<
"HLT TableName of each selected process: "
233 << hNames <<
"." << endl;
237 LogError(
"HLTConfigProvider") <<
" Process name '"
239 <<
"' not found in registry!" << endl;
244 LogError(
"HLTConfigProvider") <<
" Process name '"
246 <<
"' found but ParameterSetID invalid!"
252 LogError(
"HLTConfigProvider") <<
" Process name '"
254 <<
" found " << nPSets
255 <<
" times in registry!" << endl;
286 assert(psfsiTech==psfsiPhys);
287 if ( (errorTech==0) && (errorPhys==0) &&
288 (psfsiTech>=0) && (psfsiPhys>=0) && (psfsiTech==psfsiPhys) ) {
293 <<
" Error in determining HLT prescale set index from L1 data using L1GtUtils: "
294 <<
" Tech/Phys error = " << errorTech <<
"/" << errorPhys
295 <<
" Tech/Phys psfsi = " << psfsiTech <<
"/" << psfsiPhys;
305 return prescaleValue(static_cast<unsigned int>(set),trigger);
312 std::pair<int,int>
result(std::pair<int,int>(0,0));
319 result.second =
static_cast<int>(
prescaleValue(static_cast<unsigned int>(set),trigger));
325 if (nL1GTSeedModules==0) {
328 }
else if (nL1GTSeedModules==1) {
332 result.first =
l1GtUtils_->prescaleFactor(iEvent,l1tname,l1error);
335 <<
" Error in determining L1T prescale for HLT path: '" << trigger
336 <<
"' with L1T seed: '" << l1tname
337 <<
"' using L1GtUtils: error code = " << l1error <<
"." << std::endl
338 <<
" Note: for this method ('prescaleValues'), only a single L1T name (and not a bit number) is allowed as seed!" << std::endl
339 <<
" For seeds being complex logical expressions, try the new method 'prescaleValuesInDetail'."<< std::endl;
345 for (
unsigned int i=1;
i!=nL1GTSeedModules; ++
i) {
349 <<
" Error in determining L1T prescale for HLT path: '" << trigger
350 <<
"' has multiple L1GTSeed modules, " << nL1GTSeedModules
351 <<
", with L1 seeds: " << dump
352 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
361 std::pair<std::vector<std::pair<std::string,int> >,
int>
result;
362 result.first.clear();
369 result.second =
static_cast<int>(
prescaleValue(static_cast<unsigned int>(set),trigger));
375 if (nL1GTSeedModules==0) {
377 result.first.clear();
378 }
else if (nL1GTSeedModules==1) {
383 const std::vector<std::pair<std::string, int> >& errorCodes(l1Logical.
errorCodes(iEvent));
385 int l1error(l1Logical.
isValid() ? 0 : 1);
386 for (
unsigned int i=0;
i<errorCodes.size(); ++
i) {
392 <<
" Error in determining L1T prescales for HLT path: '" << trigger
393 <<
"' with complex L1T seed: '" << l1tname
394 <<
"' using L1GtUtils: " << std::endl
395 <<
" isValid=" << l1Logical.
isValid()
396 <<
" l1tname/error/prescale " << errorCodes.size()
398 for (
unsigned int i=0;
i< errorCodes.size(); ++
i) {
399 message <<
" " <<
i <<
":" << errorCodes[
i].first <<
"/" << errorCodes[
i].second <<
"/" << result.first[
i].second;
403 result.first.clear();
408 for (
unsigned int i=1;
i!=nL1GTSeedModules; ++
i) {
412 <<
" Error in determining L1T prescale for HLT path: '" << trigger
413 <<
"' has multiple L1GTSeed modules, " << nL1GTSeedModules
414 <<
", with L1 seeds: " << dump
415 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
416 result.first.clear();
423 std::vector<std::string>
matched;
425 const unsigned int n(inputs.size());
426 for (
unsigned int i=0;
i<
n; ++
i) {
428 if (boost::regex_match(input,regexp)) matched.push_back(input);
434 const boost::regex regexp(
"_v[0-9]+$");
435 return boost::regex_replace(trigger,regexp,
"");
439 return matched(inputs,trigger+
"_v[0-9]+$");
unsigned int size() const
number of trigger paths in trigger table
collection_type::const_iterator const_iterator
void dump(const std::string &what) const
Dumping config info to cout.
T getParameter(std::string const &) const
const_iterator begin() const
~HLTConfigCounterSentry()
map_type::const_iterator const_iterator
static const std::vector< std::string > matched(const std::vector< std::string > &inputs, const std::string &pattern)
regexp processing
const int logicalExpressionRunUpdate(const edm::Run &, const edm::EventSetup &, const std::string &)
const_iterator end() const
extra_type & extraForUpdate()
static PFTauRenderPlugin instance
void getDataFrom(const edm::ParameterSetID &iID)
ParameterSetID id() const
const std::vector< std::vector< std::pair< bool, std::string > > > & hltL1GTSeeds() const
std::string glob2reg(std::string const &pattern)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::pair< std::vector< std::pair< std::string, int > >, int > prescaleValuesInDetail(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger) const
static const HLTConfigData * s_dummyHLTConfigData()
static ThreadSafeRegistry * instance()
const std::vector< std::pair< std::string, int > > & prescaleFactors()
Run const & getRun() const
const std::string & tableName() const
HLT ConfDB table name.
std::string processName_
data members
bool changed() const
changed?
static const std::string removeVersion(const std::string &trigger)
static std::string const input
const HLTConfigData * hltConfigData_
U second(std::pair< T, U > const &p)
bool getConfigurationForProcess(std::string const &name, ProcessConfiguration &config) const
boost::shared_ptr< L1GtUtils > l1GtUtils_
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
const edm::ParameterSet & processPSet() const
ParameterSet of process.
bool getMapped(key_type const &k, value_type &result) const
const_iterator begin() const
Abs< T >::type abs(const T &t)
ProcessHistory const & processHistory() const
bool getMapped(key_type const &k, value_type &result) const
Hash< ParameterSetType > ParameterSetID
HLTConfigProvider()
c'tor
static const bool useL1GtTriggerMenuLite(false)
const std::string & processName() const
process name
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup) const
static const std::vector< std::string > restoreVersion(const std::vector< std::string > &inputs, const std::string &trigger)
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
std::pair< int, int > prescaleValues(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger) const
Combined L1T (pair.first) and HLT (pair.second) prescales per HLT path.
const_iterator end() const
static const bool useL1EventSetup(true)
volatile std::atomic< bool > shutdown_flag false
bool insertMapped(value_type const &v)
edm::ParameterSetID id() const
technical: id() function needed for use with ThreadSafeRegistry
static Registry * instance()
bool isValid()
return true if the logical expression is syntactically correct
const std::vector< std::pair< std::string, int > > & errorCodes(const edm::Event &)