File indexing completed on 2024-04-06 12:03:54
0001 #ifndef DataFormats_Common_TriggerResults_h
0002 #define DataFormats_Common_TriggerResults_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #include "DataFormats/Common/interface/HLTGlobalStatus.h"
0028 #include "DataFormats/Common/interface/traits.h"
0029 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0030
0031 #include <string>
0032 #include <vector>
0033
0034 namespace edm {
0035 class TriggerResults : public HLTGlobalStatus, public DoNotRecordParents {
0036 typedef std::vector<std::string> Strings;
0037
0038 private:
0039
0040 edm::ParameterSetID psetid_;
0041
0042
0043 Strings names_;
0044
0045 public:
0046
0047 TriggerResults() : HLTGlobalStatus(), psetid_(), names_() {}
0048
0049
0050 TriggerResults(const HLTGlobalStatus& hlt, const edm::ParameterSetID& psetid)
0051 : HLTGlobalStatus(hlt), psetid_(psetid), names_() {}
0052
0053
0054 TriggerResults(const HLTGlobalStatus& hlt, const Strings& names) : HLTGlobalStatus(hlt), psetid_(), names_(names) {}
0055
0056
0057 const ParameterSetID& parameterSetID() const { return psetid_; }
0058
0059
0060 void swap(TriggerResults& other) {
0061 this->HLTGlobalStatus::swap(other);
0062 psetid_.swap(other.psetid_);
0063
0064 names_.swap(other.names_);
0065 }
0066
0067
0068
0069
0070
0071 const std::vector<std::string>& getTriggerNames() const { return names_; }
0072
0073
0074 const std::string& name(unsigned int i) const { return names_.at(i); }
0075
0076
0077 unsigned int find(const std::string& name) const {
0078 const unsigned int n(size());
0079 for (unsigned int i = 0; i != n; ++i)
0080 if (names_[i] == name)
0081 return i;
0082 return n;
0083 }
0084 };
0085
0086
0087 inline void swap(TriggerResults& lhs, TriggerResults& rhs) { lhs.swap(rhs); }
0088 }
0089
0090 #endif