31 , forceDefault_(iPS.getParameter<bool>(
"forceDefault"))
32 , lvl1Labels_(iPS.getParameter<std::vector<std::string> >(
"lvl1Labels"))
33 , nLvl1Index_(lvl1Labels_.
size())
34 , iLvl1IndexDefault_(findDefaultIndex(iPS.getParameter<std::string>(
"lvl1DefaultLabel"), lvl1Labels_))
35 , vpsetPrescales_(iPS.getParameterSetVector(
"prescaleTable"))
80 std::set<std::string> prescalerModules;
81 std::vector<std::string> allModules=prcPS.
getParameter<std::vector<std::string> >(
"@all_modules");
82 for(
unsigned int i = 0;
i < allModules.size(); ++
i) {
84 std::string moduleLabel = pset.
getParameter<std::string>(
"@module_label");
85 std::string moduleType = pset.
getParameter<std::string>(
"@module_type");
86 if (moduleType ==
"HLTPrescaler") prescalerModules.insert(moduleLabel);
90 std::set<std::string> prescaledPathSet;
91 std::vector<std::string> allPaths = prcPS.
getParameter<std::vector<std::string> >(
"@paths");
92 for (
unsigned int iP = 0; iP < allPaths.size(); ++iP) {
95 for (
unsigned int iM = 0; iM < modules.size(); ++iM) {
96 std::string moduleLabel = modules[iM];
97 if (prescalerModules.erase(moduleLabel)>0) {
98 std::set<std::string>::const_iterator itPath=prescaledPathSet.find(pathName);
99 if (itPath==prescaledPathSet.end()) {
100 prescaledPathSet.insert(pathName);
103 <<
"path '"<<pathName<<
"' has more than one HLTPrescaler!";
109 std::vector<std::string> prescaledPaths;
110 for (
unsigned int iVPSet=0; iVPSet <
vpsetPrescales_.size(); ++iVPSet) {
113 if (prescaledPathSet.erase(pathName) > 0) {
115 psetPrescales.
getParameter<std::vector<unsigned int> >(
"prescales");
118 <<
"path '" << pathName <<
"' has unexpected number of prescales";
124 <<
"path '"<<pathName<<
"' is invalid or does not "
125 <<
"contain any HLTPrescaler";
138 std::string
const& prescaledPath)
145 <<
"lvl1Index '"<<lvl1Index<<
"' exceeds number of prescale columns";
152 PrescaleTable_t::const_iterator it =
prescaleTable_.find(prescaledPath);
158 for (
unsigned int i = 0;
i < labels.size(); ++
i) {
159 if (labels[
i] == label) {
171 std::vector<std::string> defaultVector;
172 defaultVector.push_back(std::string(
"default"));
173 desc.
add<std::vector<std::string> >(
"lvl1Labels", defaultVector);
178 std::vector<edm::ParameterSet> defaultVPSet;
180 pset0.
addParameter<std::string>(
"pathName", std::string(
"HLTPath"));
181 std::vector<unsigned> defaultVectorU;
182 defaultVectorU.push_back(1u);
183 pset0.
addParameter<std::vector<unsigned> >(
"prescales", defaultVectorU);
184 defaultVPSet.push_back(pset0);
187 validator.
add<std::string>(
"pathName");
188 validator.
add<std::vector<unsigned int> >(
"prescales");
190 desc.
addVPSet(
"prescaleTable", validator, defaultVPSet);
192 desc.
add<std::string>(
"lvl1DefaultLabel", std::string(
"default"));
193 desc.
add<
bool> (
"forceDefault",
false);
195 descriptions.
add(
"PrescaleService", desc);
T getParameter(std::string const &) const
std::vector< ParameterSet > vpsetPrescales_
VParameterSet const & getParameterSetVector(std::string const &name) const
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void watchPostModule(PostModule::slot_type const &iSlot)
void watchPreProcessEvent(PreProcessEvent::slot_type const &iSlot)
void watchPreModule(PreModule::slot_type const &iSlot)
void watchPostProcessEvent(PostProcessEvent::slot_type const &iSlot)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
PrescaleTable_t prescaleTable_
void addParameter(std::string const &name, T const &value)
void reconfigure(ParameterSet const &ps)
void preEventProcessing(EventID const &, Timestamp const &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void postModule(ModuleDescription const &)
PrescaleService(ParameterSet const &, ActivityRegistry &)
ParameterSet const & getProcessParameterSet()
ParameterSet const & getParameterSet(std::string const &) const
void postEventProcessing(Event const &, EventSetup const &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
unsigned int iLvl1IndexDefault_
void preModule(ModuleDescription const &)
tuple size
Write out results.
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
unsigned int getPrescale(unsigned int lvl1Index, std::string const &prescaledPath)