26 : forceDefault_(iPS.getParameter<bool>(
"forceDefault"))
27 , lvl1Labels_(iPS.getParameter<
std::vector<
std::
string> >(
"lvl1Labels"))
28 , lvl1Default_(findDefaultIndex(iPS.getParameter<
std::
string>(
"lvl1DefaultLabel"), lvl1Labels_))
29 , vpsetPrescales_(iPS.getParameterSetVector(
"prescaleTable"))
42 for (
unsigned int iVPSet=0; iVPSet <
vpsetPrescales_.size(); ++iVPSet) {
47 <<
" Path '" << pathName <<
"' found more than once!";
49 std::vector<unsigned int> prescales = psetPrescales.
getParameter<std::vector<unsigned int> >(
"prescales");
52 <<
" Path '" << pathName <<
"' has " << prescales.size() <<
" prescales, instead of expected " <<
lvl1Labels_.size() <<
"!";
77 std::map<std::string,std::string> path2module;
79 std::map<std::string,std::string> module2path;
87 const std::vector<std::string> allModules=prcPS.
getParameter<std::vector<std::string> >(
"@all_modules");
88 for(
unsigned int i = 0;
i < allModules.size(); ++
i) {
92 if (moduleType ==
"HLTPrescaler") module2path[moduleLabel]=
"";
95 const std::vector<std::string> allPaths = prcPS.
getParameter<std::vector<std::string> >(
"@paths");
96 for (
unsigned int iP = 0; iP < allPaths.size(); ++iP) {
99 for (
unsigned int iM = 0; iM < modules.size(); ++iM) {
101 if (module2path.find(moduleLabel)!=module2path.end()) {
102 if (path2module.find(pathName)==path2module.end()) {
103 path2module[pathName]=moduleLabel;
106 <<
"Path '" << pathName <<
"' with (>1) HLTPrescalers: " << path2module[pathName] <<
"+" << moduleLabel <<
"!";
108 if (module2path[moduleLabel]==
"") {
109 module2path[moduleLabel]=pathName;
112 <<
" HLTPrescaler '" << moduleLabel <<
"' on (>1) Paths: " << module2path[moduleLabel] <<
"+" << pathName <<
"!";
118 for (std::map<std::string,std::string>::const_iterator it = module2path.begin(); it!=module2path.end(); ++it) {
119 if (it->second==
"") {
121 <<
" HLTPrescaler '" << it->first <<
"' not found on any path!";
127 if (path2module.find(it->first)==path2module.end()) {
129 <<
" Path '"<< it->first <<
"' is unknown or does not contain any HLTPrescaler!";
148 <<
"lvl1Index '" << lvl1Index <<
"' exceeds number of prescale columns " <<
lvl1Labels_.size() <<
"!";
150 PrescaleTable_t::const_iterator it =
prescaleTable_.find(prescaledPath);
156 for (
unsigned int i = 0;
i < labels.size(); ++
i) {
157 if (labels[
i] == label) {
161 return labels.size();
168 std::vector<std::string> defaultVector;
170 desc.
add<std::vector<std::string> >(
"lvl1Labels", defaultVector);
175 std::vector<edm::ParameterSet> defaultVPSet;
178 std::vector<unsigned> defaultVectorU;
179 defaultVectorU.push_back(1u);
180 pset0.
addParameter<std::vector<unsigned> >(
"prescales", defaultVectorU);
181 defaultVPSet.push_back(pset0);
185 validator.
add<std::vector<unsigned int> >(
"prescales");
187 desc.
addVPSet(
"prescaleTable", validator, defaultVPSet);
190 desc.
add<
bool> (
"forceDefault",
false);
192 descriptions.
add(
"PrescaleService", desc);
T getParameter(std::string const &) const
void preBeginJob(PathsAndConsumesOfModulesBase const &, ProcessContext const &)
const unsigned int lvl1Default_
const VString_t lvl1Labels_
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
ParameterSet const & getParameterSet(ParameterSetID const &id)
ParameterSetID const & parameterSetID() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
PrescaleTable_t prescaleTable_
void addParameter(std::string const &name, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
PrescaleService(ParameterSet const &, ActivityRegistry &)
ParameterSet const & getParameterSet(std::string const &) const
unsigned int getPrescale(std::string const &prescaledPath) const
const std::vector< ParameterSet > vpsetPrescales_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void watchPreBeginJob(PreBeginJob::slot_type const &iSlot)
convenience function for attaching to signal
ParameterSetID processParameterSetID_
static unsigned int findDefaultIndex(std::string const &label, std::vector< std::string > const &labels)
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal