Skip to content

Commit

Permalink
Restore forceDefault functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Grunewald committed Dec 3, 2013
1 parent 01a3ef9 commit f2cb53f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions FWCore/PrescaleService/interface/PrescaleService.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ namespace edm {
//
// member data
//
const bool forceDefault_;
const VString_t lvl1Labels_;
const unsigned int lvl1Default_;
const std::vector<ParameterSet> vpsetPrescales_;
Expand Down
5 changes: 4 additions & 1 deletion FWCore/PrescaleService/src/PrescaleService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ namespace edm {

// constructor
PrescaleService::PrescaleService(ParameterSet const& iPS,ActivityRegistry& iReg)
: lvl1Labels_(iPS.getParameter<std::vector<std::string> >("lvl1Labels"))
: forceDefault_(iPS.getParameter<bool>("forceDefault"))
, lvl1Labels_(iPS.getParameter<std::vector<std::string> >("lvl1Labels"))
, lvl1Default_(findDefaultIndex(iPS.getParameter<std::string>("lvl1DefaultLabel"), lvl1Labels_))
, vpsetPrescales_(iPS.getParameterSetVector("prescaleTable"))
, prescaleTable_()
Expand Down Expand Up @@ -133,6 +134,8 @@ namespace edm {
// const method
unsigned int PrescaleService::getPrescale(unsigned int lvl1Index, std::string const& prescaledPath) const
{
if (forceDefault_) lvl1Index = lvl1Default_;

if (lvl1Index >= lvl1Labels_.size()) {
throw cms::Exception("InvalidLvl1Index")
<< "lvl1Index '" << lvl1Index << "' exceeds number of prescale columns " << lvl1Labels_.size() << "!";
Expand Down

0 comments on commit f2cb53f

Please sign in to comment.