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"))
41 for (
unsigned int iVPSet=0; iVPSet <
vpsetPrescales_.size(); ++iVPSet) {
46 <<
" Path '" << pathName <<
"' found more than once!";
48 std::vector<unsigned int>
prescales = psetPrescales.
getParameter<std::vector<unsigned int> >(
"prescales");
51 <<
" Path '" << pathName <<
"' has " << prescales.size() <<
" prescales, instead of expected " <<
lvl1Labels_.size() <<
"!";
70 std::map<std::string,std::string> path2module;
72 std::map<std::string,std::string> module2path;
80 const std::vector<std::string> allModules=prcPS.
getParameter<std::vector<std::string> >(
"@all_modules");
81 for(
unsigned int i = 0;
i < allModules.size(); ++
i) {
85 if (moduleType ==
"HLTPrescaler") module2path[moduleLabel]=
"";
88 const std::vector<std::string> allPaths = prcPS.
getParameter<std::vector<std::string> >(
"@paths");
89 for (
unsigned int iP = 0; iP < allPaths.size(); ++iP) {
92 for (
unsigned int iM = 0; iM < modules.size(); ++iM) {
94 if (module2path.find(moduleLabel)!=module2path.end()) {
95 if (path2module.find(pathName)==path2module.end()) {
99 <<
"Path '" << pathName <<
"' with (>1) HLTPrescalers: " << path2module[
pathName] <<
"+" << moduleLabel <<
"!";
101 if (module2path[moduleLabel]==
"") {
105 <<
" HLTPrescaler '" << moduleLabel <<
"' on (>1) Paths: " << module2path[moduleLabel] <<
"+" << pathName <<
"!";
111 for (std::map<std::string,std::string>::const_iterator it = module2path.begin(); it!=module2path.end(); ++it) {
112 if (it->second==
"") {
114 <<
" HLTPrescaler '" << it->first <<
"' not found on any path!";
120 if (path2module.find(it->first)==path2module.end()) {
122 <<
" Path '"<< it->first <<
"' is unknown or does not contain any HLTPrescaler!";
141 <<
"lvl1Index '" << lvl1Index <<
"' exceeds number of prescale columns " <<
lvl1Labels_.size() <<
"!";
143 PrescaleTable_t::const_iterator it =
prescaleTable_.find(prescaledPath);
149 for (
unsigned int i = 0;
i < labels.size(); ++
i) {
150 if (labels[
i] == label) {
154 return labels.size();
161 std::vector<std::string> defaultVector;
163 desc.
add<std::vector<std::string> >(
"lvl1Labels", defaultVector);
168 std::vector<edm::ParameterSet> defaultVPSet;
171 std::vector<unsigned> defaultVectorU;
172 defaultVectorU.push_back(1u);
173 pset0.
addParameter<std::vector<unsigned> >(
"prescales", defaultVectorU);
174 defaultVPSet.push_back(pset0);
178 validator.
add<std::vector<unsigned int> >(
"prescales");
180 desc.
addVPSet(
"prescaleTable", validator, defaultVPSet);
183 desc.
add<
bool> (
"forceDefault",
false);
185 descriptions.
add(
"PrescaleService", desc);
T getParameter(std::string const &) const
const unsigned int lvl1Default_
const VString_t lvl1Labels_
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
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 & getProcessParameterSet()
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)
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