CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PackedTriggerPrescales.cc
Go to the documentation of this file.
3 
5  prescaleValues_(),
6  triggerResults_(edm::RefProd<edm::TriggerResults>(handle).refCore()),
7  triggerNames_(0)
8 {
9  prescaleValues_.resize(handle->size(),0);
10 }
11 
13  if (unsigned(index) >= triggerResults().size()) throw cms::Exception("InvalidReference", "Index out of bounds");
14  return prescaleValues_[index];
15 }
16 
18  if (triggerNames_ == 0) throw cms::Exception("LogicError", "getPrescaleForName called without having called setTriggerNames first");
19  if (prefixOnly) {
20  const std::vector<std::string> &names = triggerNames_->triggerNames();
21  size_t siz = name.length()-1;
22  while (siz > 0 && (name[siz] == '*' || name[siz] == '\0')) siz--;
23  for (unsigned int i = 0, n = names.size(); i < n; ++i) {
24  if (strncmp(name.c_str(), names[i].c_str(), siz) == 0) {
25  return getPrescaleForIndex(i);
26  }
27  }
28  throw cms::Exception("InvalidReference", "Index out of bounds");
29  } else {
30  int index = triggerNames_->triggerIndex(name);
31  return getPrescaleForIndex(index);
32  }
33 }
34 
36  if (unsigned(index) >= triggerResults().size()) throw cms::Exception("InvalidReference", "Index out of bounds");
37  prescaleValues_[index] = prescale;
38 }
39 
int i
Definition: DBlmapReader.cc:9
int getPrescaleForName(const std::string &name, bool prefixOnly=false) const
static const HistoName names[]
void addPrescaledTrigger(int index, int prescale)
tuple handle
Definition: patZpeak.py:22
static std::string const triggerResults
Definition: EdmProvDump.cc:41
edm::RefProd< Container > RefProd
int getPrescaleForIndex(int index) const
tuple size
Write out results.