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 
32 #include <string>
33 #include <vector>
34 
35 namespace edm
36 {
38 
39  typedef std::vector<std::string> Strings;
40 
41  private:
44 
46  Strings names_;
47 
48  public:
49 
51  TriggerResults() : HLTGlobalStatus(), psetid_(), names_() { }
52 
55  : HLTGlobalStatus(hlt), psetid_(psetid), names_() { }
56 
58  TriggerResults(const HLTGlobalStatus& hlt, const Strings& names)
59  : HLTGlobalStatus(hlt), psetid_(), names_(names) { }
60 
62  const ParameterSetID& parameterSetID() const { return psetid_; }
63 
66  this->HLTGlobalStatus::swap(other);
67  psetid_.swap(other.psetid_);
68  // next line not used any more
69  names_.swap(other.names_);
70  }
71 
74  TriggerResults temp(rhs);
75  this->swap(temp);
76  return *this;
77  }
78 
79  // The next three functions are OBSOLETE and should only be used for backward
80  // compatibility to older data. The names_ vector is always empty in new data.
81 
83  const std::vector<std::string>& getTriggerNames() const { return names_; }
84 
86  const std::string& name(unsigned int i) const {return names_.at(i);}
87 
89  unsigned int find (const std::string& name) const {
90  const unsigned int n(size());
91  for (unsigned int i = 0; i != n; ++i) if (names_[i] == name) return i;
92  return n;
93  }
94  };
95 
96  // Free swap function
97  inline
98  void
100  lhs.swap(rhs);
101  }
102 }
103 
104 #endif
static const HistoName names[]
void swap(Hash< I > &other)
Definition: Hash.h:207
const std::string & name(unsigned int i) const
Obsolete.
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.