23 #include <boost/regex.hpp>
30 return &dummyHLTConfigData;
44 const std::string& processName,
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: '"
93 LogError(
"HLTConfigData") <<
"Auto-discovery of processName failed!"
107 <<
" times in history!" << endl;
118 getDataFrom(processConfiguration.parameterSetID());
121 LogError(
"HLTConfigProvider") <<
"Falling back to processName-only init!";
125 LogError(
"HLTConfigProvider") <<
"ProcessName not found in history!";
145 edm::LogError(
"HLTConfigProvider") <<
"ProcessPSet found is empty!";
160 edm::LogError(
"HLTConfigProvider") <<
"ProcessPSet not found in regsistry!";
181 unsigned int nPSets(0);
186 if (
i->second.exists(
"@process_name")) {
187 const std::string pName(
i->second.getParameter<
string>(
"@process_name"));
189 if ( pName == processName ) {
195 if (
pset->exists(
"HLTConfigVersion")) {
197 if (HLTPSet.exists(
"tableName")) {
198 hNames += HLTPSet.
getParameter<
string>(
"tableName")+
" ";
206 LogVerbatim(
"HLTConfigProvider") <<
"Unordered list of all process names found: "
207 << pNames <<
"." << endl;
209 LogVerbatim(
"HLTConfigProvider") <<
"HLT TableName of each selected process: "
210 << hNames <<
"." << endl;
214 LogError(
"HLTConfigProvider") <<
" Process name '"
216 <<
"' not found in registry!" << endl;
221 LogError(
"HLTConfigProvider") <<
" Process name '"
223 <<
"' found but ParameterSetID invalid!"
229 LogError(
"HLTConfigProvider") <<
" Process name '"
231 <<
" found " << nPSets
232 <<
" times in registry!" << endl;
263 assert(psfsiTech==psfsiPhys);
264 if ( (errorTech==0) && (errorPhys==0) &&
265 (psfsiTech>=0) && (psfsiPhys>=0) && (psfsiTech==psfsiPhys) ) {
270 <<
" Error in determining HLT prescale set index from L1 data using L1GtUtils: "
271 <<
" Tech/Phys error = " << errorTech <<
"/" << errorPhys
272 <<
" Tech/Phys psfsi = " << psfsiTech <<
"/" << psfsiPhys;
282 return prescaleValue(static_cast<unsigned int>(set),trigger);
289 std::pair<int,int>
result(std::pair<int,int>(0,0));
296 result.second =
static_cast<int>(
prescaleValue(static_cast<unsigned int>(set),trigger));
302 if (nL1GTSeedModules==0) {
305 }
else if (nL1GTSeedModules==1) {
309 result.first =
l1GtUtils_->prescaleFactor(iEvent,l1tname,l1error);
312 <<
" Error in determining L1T prescale for HLT path: '" << trigger
313 <<
"' with L1T seed: '" << l1tname
314 <<
"' using L1GtUtils: error code: " << l1error
315 <<
". (Note: only a single L1T name, not a bit number, is allowed as seed for a proper determination of the L1T prescale!)";
321 for (
unsigned int i=1;
i!=nL1GTSeedModules; ++
i) {
325 <<
" Error in determining L1T prescale for HLT path: '" << trigger
326 <<
"' has multiple L1GTSeed modules, " << nL1GTSeedModules
327 <<
", with L1 seeds: " << dump
328 <<
". (Note: at most one L1GTSeed module is allowed for a proper determination of the L1T prescale!)";
336 std::vector<std::string>
matched;
338 const unsigned int n(inputs.size());
339 for (
unsigned int i=0;
i<
n; ++
i) {
340 const std::string&
input(inputs[
i]);
341 if (boost::regex_match(input,regexp)) matched.push_back(input);
347 const boost::regex regexp(
"_v[0-9]+$");
348 return boost::regex_replace(trigger,regexp,
"");
352 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
edm::detail::ThreadSafeRegistry< edm::ParameterSetID, HLTConfigData > HLTConfigDataRegistry
static const std::vector< std::string > matched(const std::vector< std::string > &inputs, const std::string &pattern)
regexp processing
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
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)
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
const std::string & processName() const
Accessors (const methods)
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)
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
const_iterator end() const
static ThreadSafeRegistry * instance()
edm::ParameterSetID id() const
technical: id() function needed for use with ThreadSafeRegistry