CMS 3D CMS Logo

TriggerNames.cc
Go to the documentation of this file.
1 
4 
5 namespace edm {
6 
8 
10  triggerNames_ = pset.getParameter<Strings>("@trigger_paths");
11 
12  unsigned int index = 0;
13  for (Strings::const_iterator iName = triggerNames_.begin(), iEnd = triggerNames_.end(); iName != iEnd;
14  ++iName, ++index) {
15  indexMap_[*iName] = index;
16  }
17  psetID_ = pset.id();
18  }
19 
21 
22  std::string const& TriggerNames::triggerName(unsigned int index) const { return triggerNames_.at(index); }
23 
24  unsigned int TriggerNames::triggerIndex(const std::string& name) const {
25  IndexMap::const_iterator const pos = indexMap_.find(name);
26  if (pos == indexMap_.end())
27  return indexMap_.size();
28  return pos->second;
29  }
30 
32 
34 } // namespace edm
T getParameter(std::string const &) const
ParameterSetID id() const
Strings::size_type size() const
Definition: TriggerNames.cc:31
IndexMap indexMap_
Definition: TriggerNames.h:86
uint16_t size_type
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:33
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:24
std::vector< std::string > Strings
Definition: TriggerNames.h:57
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:22
HLT enums.
Strings triggerNames_
Definition: TriggerNames.h:85
ParameterSetID psetID_
Definition: TriggerNames.h:83