24 #include <boost/regex.hpp>
32 return &dummyHLTConfigData;
75 LogInfo(
"HLTConfigData") <<
"Called (R) with processName '"
77 <<
"' for " << iRun.
id() << endl;
107 if ((processPSet!=0) && (processPSet->
exists(
"hltTriggerSummaryAOD"))) {
112 LogInfo(
"HLTConfigData") <<
"Auto-discovered processName: '"
118 LogError(
"HLTConfigData") <<
"Auto-discovery of processName failed!"
132 <<
" times in history!" << endl;
143 getDataFrom(processConfiguration.parameterSetID());
146 LogError(
"HLTConfigProvider") <<
"Falling back to processName-only init!";
150 LogError(
"HLTConfigProvider") <<
"ProcessName not found in history!";
170 edm::LogError(
"HLTConfigProvider") <<
"ProcessPSet found is empty!";
185 edm::LogError(
"HLTConfigProvider") <<
"ProcessPSet not found in regsistry!";
206 unsigned int nPSets(0);
211 if (
i->second.exists(
"@process_name")) {
212 const std::string pName(
i->second.getParameter<
string>(
"@process_name"));
214 if ( pName == processName ) {
219 }
else if ( 0 != (pset = registry_->
getMapped(psetID))) {
220 if (pset->exists(
"HLTConfigVersion")) {
221 const ParameterSet& HLTPSet(pset->getParameterSet(
"HLTConfigVersion"));
222 if (HLTPSet.exists(
"tableName")) {
223 hNames += HLTPSet.
getParameter<
string>(
"tableName")+
" ";
231 LogVerbatim(
"HLTConfigProvider") <<
"Unordered list of all process names found: "
232 << pNames <<
"." << endl;
234 LogVerbatim(
"HLTConfigProvider") <<
"HLT TableName of each selected process: "
235 << hNames <<
"." << endl;
239 LogError(
"HLTConfigProvider") <<
" Process name '"
241 <<
"' not found in registry!" << endl;
246 LogError(
"HLTConfigProvider") <<
" Process name '"
248 <<
"' found but ParameterSetID invalid!"
254 LogError(
"HLTConfigProvider") <<
" Process name '"
256 <<
" found " << nPSets
257 <<
" times in registry!" << endl;
288 assert(psfsiTech==psfsiPhys);
289 if ( (errorTech==0) && (errorPhys==0) &&
290 (psfsiTech>=0) && (psfsiPhys>=0) && (psfsiTech==psfsiPhys) ) {
295 <<
" Error in determining HLT prescale set index from L1 data using L1GtUtils: "
296 <<
" Tech/Phys error = " << errorTech <<
"/" << errorPhys
297 <<
" Tech/Phys psfsi = " << psfsiTech <<
"/" << psfsiPhys;
307 return prescaleValue(static_cast<unsigned int>(set),trigger);
314 std::pair<int,int>
result(std::pair<int,int>(0,0));
321 result.second =
static_cast<int>(
prescaleValue(static_cast<unsigned int>(set),trigger));
327 if (nL1GTSeedModules==0) {
330 }
else if (nL1GTSeedModules==1) {
334 result.first =
l1GtUtils_->prescaleFactor(iEvent,l1tname,l1error);
337 <<
" Error in determining L1T prescale for HLT path: '" << trigger
338 <<
"' with L1T seed: '" << l1tname
339 <<
"' using L1GtUtils: error code: " << l1error
340 <<
". (Note: only a single L1T name, not a bit number, is allowed as seed for a proper determination of the L1T prescale!)";
346 for (
unsigned int i=1;
i!=nL1GTSeedModules; ++
i) {
350 <<
" Error in determining L1T prescale for HLT path: '" << trigger
351 <<
"' has multiple L1GTSeed modules, " << nL1GTSeedModules
352 <<
", with L1 seeds: " << dump
353 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
361 std::vector<std::string>
matched;
363 const unsigned int n(inputs.size());
364 for (
unsigned int i=0;
i<
n; ++
i) {
365 const std::string&
input(inputs[
i]);
366 if (boost::regex_match(input,regexp)) matched.push_back(input);
372 const boost::regex regexp(
"_v[0-9]+$");
373 return boost::regex_replace(trigger,regexp,
"");
377 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()
static const std::vector< std::string > matched(const std::vector< std::string > &inputs, const std::string &pattern)
regexp processing
static PFTauRenderPlugin instance
void getDataFrom(const edm::ParameterSetID &iID)
ParameterSetID id() const
static ThreadSafeRegistry * instance()
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
bool getMapped(key_type const &k, value_type &result) const
static const HLTConfigData * s_dummyHLTConfigData()
const std::string & tableName() const
HLT ConfDB table name.
std::string processName_
data members
bool insertMapped(value_type const &v)
bool changed() const
changed?
static const std::string removeVersion(const std::string &trigger)
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.
const_iterator begin() const
collection_type::const_iterator const_iterator
ProcessHistory const & processHistory() 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)
const_iterator end() const
edm::ParameterSetID id() const
technical: id() function needed for use with ThreadSafeRegistry
void set(const std::string &name, int value)
set the flag, with a run-time name