24 : forceDefault_(iPS.getParameter<
bool>(
"forceDefault")),
26 lvl1Default_(findDefaultIndex(iPS.getParameter<
std::
string>(
"lvl1DefaultLabel"), lvl1Labels_)),
27 vpsetPrescales_(iPS.getParameterSetVector(
"prescaleTable")),
39 for (
unsigned int iVPSet = 0; iVPSet <
vpsetPrescales_.size(); ++iVPSet) {
45 std::vector<unsigned int>
prescales = psetPrescales.
getParameter<std::vector<unsigned int> >(
"prescales");
48 <<
" Path '" <<
pathName <<
"' has " <<
prescales.size() <<
" prescales, instead of expected " 70 std::map<std::string, std::string> path2module;
72 std::map<std::string, std::string> module2path;
85 if (moduleType ==
"HLTPrescaler")
89 const std::vector<std::string>
allPaths = prcPS.
getParameter<std::vector<std::string> >(
"@paths");
90 for (
unsigned int iP = 0; iP <
allPaths.size(); ++iP) {
93 for (
unsigned int iM = 0; iM <
modules.size(); ++iM) {
95 if (module2path.find(
moduleLabel) != module2path.end()) {
96 if (path2module.find(
pathName) == path2module.end()) {
100 <<
"Path '" <<
pathName <<
"' with (>1) HLTPrescalers: " << path2module[
pathName] <<
"+" 114 for (std::map<std::string, std::string>::const_iterator it = module2path.begin(); it != module2path.end(); ++it) {
115 if (it->second.empty()) {
117 <<
" HLTPrescaler '" << it->first <<
"' not found on any path!";
125 if (path2module.find(it->first) == path2module.end()) {
127 <<
" Path '" << it->first <<
"' is unknown or does not contain any HLTPrescaler!";
144 <<
"lvl1Index '" << lvl1Index <<
"' exceeds number of prescale columns " <<
lvl1Labels_.size() <<
"!";
146 PrescaleTable_t::const_iterator it =
prescaleTable_.find(prescaledPath);
152 for (
unsigned int i = 0;
i <
labels.size(); ++
i) {
164 std::vector<std::string> defaultVector;
166 desc.add<std::vector<std::string> >(
"lvl1Labels", defaultVector);
171 std::vector<edm::ParameterSet> defaultVPSet;
174 std::vector<unsigned> defaultVectorU;
175 defaultVectorU.push_back(1u);
176 pset0.
addParameter<std::vector<unsigned> >(
"prescales", defaultVectorU);
177 defaultVPSet.push_back(pset0);
181 validator.
add<std::vector<unsigned int> >(
"prescales");
183 desc.addVPSet(
"prescaleTable", validator, defaultVPSet);
186 desc.add<
bool>(
"forceDefault",
false);
188 descriptions.
add(
"PrescaleService",
desc);
void preBeginJob(PathsAndConsumesOfModulesBase const &, ProcessContext const &)
T getParameter(std::string const &) const
const unsigned int lvl1Default_
const VString_t lvl1Labels_
unsigned int getPrescale(std::string const &prescaledPath) const
ParameterSet const & getParameterSet(std::string const &) 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 &)
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
ParameterSet const & getParameterSet(ParameterSetID const &id)
ParameterSetID processParameterSetID_
static unsigned int findDefaultIndex(std::string const &label, std::vector< std::string > const &labels)
ParameterSetID const & parameterSetID() const
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal