31 , lvl1Labels_(iPS.getParameter<std::vector<std::string> >(
"lvl1Labels"))
32 , nLvl1Index_(lvl1Labels_.
size())
33 , iLvl1IndexDefault_(0)
34 , vpsetPrescales_(iPS.getParameterSetVector(
"prescaleTable"))
37 std::string lvl1DefaultLabel=
68 std::string lvl1DefaultLabel=
90 std::set<std::string> prescalerModules;
91 std::vector<std::string> allModules=prcPS.
getParameter<std::vector<std::string> >(
"@all_modules");
92 for(
unsigned int i = 0;
i < allModules.size(); ++
i) {
95 std::string moduleType = pset.
getParameter<std::string>(
"@module_type");
96 if (moduleType ==
"HLTPrescaler") prescalerModules.insert(moduleLabel);
100 std::set<std::string> prescaledPathSet;
101 std::vector<std::string> allPaths = prcPS.
getParameter<std::vector<std::string> >(
"@paths");
102 for (
unsigned int iP = 0; iP < allPaths.size(); ++iP) {
103 std::string
pathName = allPaths[iP];
105 for (
unsigned int iM = 0; iM < modules.size(); ++iM) {
107 if (prescalerModules.erase(moduleLabel)>0) {
108 std::set<std::string>::const_iterator itPath=prescaledPathSet.find(pathName);
109 if (itPath==prescaledPathSet.end()) {
110 prescaledPathSet.insert(pathName);
113 <<
"path '"<<pathName<<
"' has more than one HLTPrescaler!";
119 std::vector<std::string> prescaledPaths;
120 for (
unsigned int iVPSet=0; iVPSet <
vpsetPrescales_.size(); ++iVPSet) {
123 if (prescaledPathSet.erase(pathName) > 0) {
125 psetPrescales.
getParameter<std::vector<unsigned int> >(
"prescales");
128 <<
"path '" << pathName <<
"' has unexpected number of prescales";
134 <<
"path '"<<pathName<<
"' is invalid or does not "
135 <<
"contain any HLTPrescaler";
148 std::string
const& prescaledPath)
152 <<
"lvl1Index '"<<lvl1Index<<
"' exceeds number of prescale columns";
159 PrescaleTable_t::const_iterator it =
prescaleTable_.find(prescaledPath);
167 std::vector<std::string> defaultVector;
168 defaultVector.push_back(std::string(
"default"));
169 desc.
add<std::vector<std::string> >(
"lvl1Labels", defaultVector);
175 std::vector<edm::ParameterSet> defaultVPSet;
177 pset0.
addParameter<std::string>(
"pathName", std::string(
"HLTPath"));
178 std::vector<unsigned> defaultVectorU;
179 defaultVectorU.push_back(1u);
180 pset0.
addParameter<std::vector<unsigned> >(
"prescales", defaultVectorU);
181 defaultVPSet.push_back(pset0);
184 validator.
add<std::string>(
"pathName");
185 validator.
add<std::vector<unsigned int> >(
"prescales");
187 desc.
addVPSet(
"prescaleTable", validator, defaultVPSet);
189 desc.
addUntracked<std::string>(
"lvl1DefaultLabel", std::string(
"default"));
191 descriptions.
add(
"PrescaleService", desc);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T 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)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
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)
const std::string * pathName() const
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.
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal
const std::string * moduleLabel() const
unsigned int getPrescale(unsigned int lvl1Index, std::string const &prescaledPath)