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 
43  Strings names_;
44 
45  public:
47  TriggerResults() : HLTGlobalStatus(), psetid_(), names_() {}
48 
51  : HLTGlobalStatus(hlt), psetid_(psetid), names_() {}
52 
54  TriggerResults(const HLTGlobalStatus& hlt, const Strings& names) : HLTGlobalStatus(hlt), psetid_(), names_(names) {}
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 
69  TriggerResults temp(rhs);
70  this->swap(temp);
71  return *this;
72  }
73 
74  // The next three functions are OBSOLETE and should only be used for backward
75  // compatibility to older data. The names_ vector is always empty in new data.
76 
78  const std::vector<std::string>& getTriggerNames() const { return names_; }
79 
81  const std::string& name(unsigned int i) const { return names_.at(i); }
82 
84  unsigned int find(const std::string& name) const {
85  const unsigned int n(size());
86  for (unsigned int i = 0; i != n; ++i)
87  if (names_[i] == name)
88  return i;
89  return n;
90  }
91  };
92 
93  // Free swap function
94  inline void swap(TriggerResults& lhs, TriggerResults& rhs) { lhs.swap(rhs); }
95 } // namespace edm
96 
97 #endif
void swap(Hash< I > &other)
Definition: Hash.h:181
const std::string & name(unsigned int i) const
Obsolete.
const std::string names[nVars_]
TriggerResults & operator=(TriggerResults const &rhs)
Copy assignment using swap.
const std::vector< std::string > & getTriggerNames() const
Obsolete.
unsigned int size() const
Get number of paths stored.
void swap(HLTGlobalStatus &other)
swap function
TriggerResults(const HLTGlobalStatus &hlt, const Strings &names)
Not used anymore.
std::vector< std::string > Strings
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
unsigned int find(const std::string &name) const
Obsolete.
const ParameterSetID & parameterSetID() const
Get stored parameter set id.