CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerResults.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_TriggerResults_h
2 #define DataFormats_Common_TriggerResults_h
3 
31 
32 
33 #include <string>
34 #include <vector>
35 
36 namespace edm
37 {
39 
40  typedef std::vector<std::string> Strings;
41 
42  private:
45 
48 
49  public:
50 
53 
56  : HLTGlobalStatus(hlt), psetid_(psetid), names_() { }
57 
60  : HLTGlobalStatus(hlt), psetid_(), names_(names) { }
61 
63  const ParameterSetID& parameterSetID() const { return psetid_; }
64 
66  void swap(TriggerResults& other) {
67  this->HLTGlobalStatus::swap(other);
68  psetid_.swap(other.psetid_);
69  // next line not used any more
70  names_.swap(other.names_);
71  }
72 
75  TriggerResults temp(rhs);
76  this->swap(temp);
77  return *this;
78  }
79 
80  // The next three functions are OBSOLETE and should only be used for backward
81  // compatibility to older data. The names_ vector is always empty in new data.
82 
84  const std::vector<std::string>& getTriggerNames() const { return names_; }
85 
87  const std::string& name(unsigned int i) const {return names_.at(i);}
88 
90  unsigned int find (const std::string& name) const {
91  const unsigned int n(size());
92  for (unsigned int i = 0; i != n; ++i) if (names_[i] == name) return i;
93  return n;
94  }
95  };
96 
97  // Free swap function
98  inline
99  void
101  lhs.swap(rhs);
102  }
103 }
104 
105 #endif
int i
Definition: DBlmapReader.cc:9
static const HistoName names[]
void swap(Hash< I > &other)
Definition: Hash.h:202
const std::string & name(unsigned int i) const
Obsolete.
TriggerResults & operator=(TriggerResults const &rhs)
Copy assignment using swap.
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
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.
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.