CMS 3D CMS Logo

TriggerResults.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_TriggerResults_h
2 #define DataFormats_Common_TriggerResults_h
3 
30 
31 #include <string>
32 #include <vector>
33 
34 namespace edm {
36  typedef std::vector<std::string> Strings;
37 
38  private:
41 
44 
45  public:
48 
51  : HLTGlobalStatus(hlt), psetid_(psetid), names_() {}
52 
55 
57  const ParameterSetID& parameterSetID() const { return psetid_; }
58 
61  this->HLTGlobalStatus::swap(other);
62  psetid_.swap(other.psetid_);
63  // next line not used any more
64  names_.swap(other.names_);
65  }
66 
67  // The next three functions are OBSOLETE and should only be used for backward
68  // compatibility to older data. The names_ vector is always empty in new data.
69 
71  const std::vector<std::string>& getTriggerNames() const { return names_; }
72 
74  const std::string& name(unsigned int i) const { return names_.at(i); }
75 
77  unsigned int find(const std::string& name) const {
78  const unsigned int n(size());
79  for (unsigned int i = 0; i != n; ++i)
80  if (names_[i] == name)
81  return i;
82  return n;
83  }
84  };
85 
86  // Free swap function
87  inline void swap(TriggerResults& lhs, TriggerResults& rhs) { lhs.swap(rhs); }
88 } // namespace edm
89 
90 #endif
const ParameterSetID & parameterSetID() const
Get stored parameter set id.
void swap(Hash< I > &other)
Definition: Hash.h:181
const std::string names[nVars_]
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
unsigned int size() const
Get number of paths stored.
void swap(HLTGlobalStatus &other)
swap function
const std::vector< std::string > & getTriggerNames() const
Obsolete.
TriggerResults(const HLTGlobalStatus &hlt, const Strings &names)
Not used anymore.
std::vector< std::string > Strings
unsigned int find(const std::string &name) const
Obsolete.
Strings names_
Not used anymore.
edm::ParameterSetID psetid_
Parameter set id.
HLT enums.
TriggerResults(const HLTGlobalStatus &hlt, const edm::ParameterSetID &psetid)
Standard contructor.
TriggerResults()
Trivial contructor.
void swap(TriggerResults &other)
swap function
const std::string & name(unsigned int i) const
Obsolete.