22 #include <boost/regex.hpp>
30 return &dummyHLTConfigData;
50 LogInfo(
"HLTConfigData") <<
"Called (R) with processName '"
52 <<
"' for " << iRun.
id() << endl;
82 if ((processPSet!=0) && (processPSet->
exists(
"hltTriggerSummaryAOD"))) {
87 LogInfo(
"HLTConfigData") <<
"Auto-discovered processName: '"
92 LogError(
"HLTConfigData") <<
"Auto-discovery of processName failed!"
106 <<
" times in history!" << endl;
121 LogError(
"HLTConfigProvider") <<
"Falling back to ProcessName-only init using ProcessName '"<<
processName_<<
"' !";
141 edm::LogError(
"HLTConfigProvider") <<
"ProcessPSet found is empty!";
156 edm::LogError(
"HLTConfigProvider") <<
"ProcessPSet not found in regsistry!";
177 unsigned int nPSets(0);
182 if (
i->second.exists(
"@process_name")) {
183 const std::string pName(
i->second.getParameter<
string>(
"@process_name"));
185 if ( pName == processName ) {
190 }
else if ( 0 != (pset = registry_->
getMapped(psetID))) {
191 if (pset->exists(
"HLTConfigVersion")) {
192 const ParameterSet& HLTPSet(pset->getParameterSet(
"HLTConfigVersion"));
193 if (HLTPSet.exists(
"tableName")) {
194 hNames += HLTPSet.
getParameter<
string>(
"tableName")+
" ";
202 LogVerbatim(
"HLTConfigProvider") <<
"Unordered list of all process names found: "
203 << pNames <<
"." << endl;
205 LogVerbatim(
"HLTConfigProvider") <<
"HLT TableName of each selected process: "
206 << hNames <<
"." << endl;
209 LogError(
"HLTConfigProvider") <<
" Process name '"
211 <<
"' not found in registry!" << endl;
216 LogError(
"HLTConfigProvider") <<
" Process name '"
218 <<
"' found but ParameterSetID invalid!"
224 LogError(
"HLTConfigProvider") <<
" Process name '"
226 <<
" found " << nPSets
227 <<
" times in registry!" << endl;
259 assert(psfsiTech==psfsiPhys);
260 if ( (errorTech==0) && (errorPhys==0) &&
261 (psfsiTech>=0) && (psfsiPhys>=0) && (psfsiTech==psfsiPhys) ) {
266 <<
" Error in determining HLT prescale set index from L1 data using L1GtUtils: "
267 <<
" Tech/Phys error = " << errorTech <<
"/" << errorPhys
268 <<
" Tech/Phys psfsi = " << psfsiTech <<
"/" << psfsiPhys;
278 return prescaleValue(static_cast<unsigned int>(set),trigger);
285 std::pair<int,int>
result(std::pair<int,int>(0,0));
292 result.second =
static_cast<int>(
prescaleValue(static_cast<unsigned int>(set),trigger));
298 if (nL1GTSeedModules==0) {
301 }
else if (nL1GTSeedModules==1) {
305 result.first =
l1GtUtils_->prescaleFactor(iEvent,l1tname,l1error);
308 <<
" Error in determining L1T prescale for HLT path: '" << trigger
309 <<
"' with L1T seed: '" << l1tname
310 <<
"' using L1GtUtils: error code = " << l1error <<
"." << std::endl
311 <<
" Note: for this method ('prescaleValues'), only a single L1T name (and not a bit number) is allowed as seed!" << std::endl
312 <<
" For seeds being complex logical expressions, try the new method 'prescaleValuesInDetail'."<< std::endl;
318 for (
unsigned int i=1;
i!=nL1GTSeedModules; ++
i) {
322 <<
" Error in determining L1T prescale for HLT path: '" << trigger
323 <<
"' has multiple L1GTSeed modules, " << nL1GTSeedModules
324 <<
", with L1 seeds: " << dump
325 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
334 std::pair<std::vector<std::pair<std::string,int> >,
int>
result;
335 result.first.clear();
342 result.second =
static_cast<int>(
prescaleValue(static_cast<unsigned int>(set),trigger));
348 if (nL1GTSeedModules==0) {
350 result.first.clear();
351 }
else if (nL1GTSeedModules==1) {
356 const std::vector<std::pair<std::string, int> >& errorCodes(l1Logical.
errorCodes(iEvent));
358 int l1error(l1Logical.
isValid() ? 0 : 1);
359 for (
unsigned int i=0;
i<errorCodes.size(); ++
i) {
365 <<
" Error in determining L1T prescales for HLT path: '" << trigger
366 <<
"' with complex L1T seed: '" << l1tname
367 <<
"' using L1GtUtils: " << std::endl
368 <<
" isValid=" << l1Logical.
isValid()
369 <<
" l1tname/error/prescale " << errorCodes.size()
371 for (
unsigned int i=0;
i< errorCodes.size(); ++
i) {
372 message <<
" " <<
i <<
":" << errorCodes[
i].first <<
"/" << errorCodes[
i].second <<
"/" << result.first[
i].second;
376 result.first.clear();
381 for (
unsigned int i=1;
i!=nL1GTSeedModules; ++
i) {
385 <<
" Error in determining L1T prescale for HLT path: '" << trigger
386 <<
"' has multiple L1GTSeed modules, " << nL1GTSeedModules
387 <<
", with L1 seeds: " << dump
388 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
389 result.first.clear();
396 std::vector<std::string>
matched;
398 const unsigned int n(inputs.size());
399 for (
unsigned int i=0;
i<
n; ++
i) {
401 if (boost::regex_match(input,regexp)) matched.push_back(input);
407 const boost::regex regexp(
"_v[0-9]+$");
408 return boost::regex_replace(trigger,regexp,
"");
412 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
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 &)
bool insertMapped(value_type const &v)
const_iterator end() const
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()
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
static const std::string removeVersion(const std::string &trigger)
static std::string const input
static ThreadSafeRegistry * instance()
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
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 &)