CMS 3D CMS Logo

TriggerResultsByName.h
Go to the documentation of this file.
1 #ifndef FWCore_Common_TriggerResultsByName_h
2 #define FWCore_Common_TriggerResultsByName_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Common
6 // Class : TriggerResultsByName
7 //
31 //
32 // Original Author: W. David Dagenhart
33 // Created: 11 December 2009
34 //
35 
38 
39 #include <string>
40 #include <vector>
41 
42 namespace edm {
43 
44  class TriggerResults;
45  class TriggerNames;
46  class HLTPathStatus;
47 
49  public:
51 
52  bool isValid() const;
53 
54  ParameterSetID const& parameterSetID() const;
55 
56  // Was at least one path run?
57  bool wasrun() const;
58 
59  // Has at least one path accepted the event?
60  bool accept() const;
61 
62  // Has any path encountered an error (exception)
63  bool error() const;
64 
65  HLTPathStatus const& at(std::string const& pathName) const;
66  HLTPathStatus const& at(unsigned i) const;
67 
68  HLTPathStatus const& operator[](std::string const& pathName) const;
69  HLTPathStatus const& operator[](unsigned i) const;
70 
71  // Was ith path run?
72  bool wasrun(std::string const& pathName) const;
73  bool wasrun(unsigned i) const;
74 
75  // Has ith path accepted the event
76  bool accept(std::string const& pathName) const;
77  bool accept(unsigned i) const;
78 
79  // Has ith path encountered an error (exception)?
80  bool error(std::string const& pathName) const;
81  bool error(unsigned i) const;
82 
83  // Get status of ith path
85  hlt::HLTState state(unsigned i) const;
86 
87  // Get index (slot position) of module giving the decision of the ith path
88  unsigned index(std::string const& pathName) const;
89  unsigned index(unsigned i) const;
90 
91  std::vector<std::string> const& triggerNames() const;
92 
93  // Throws if the number is out of range.
94  std::string const& triggerName(unsigned i) const;
95 
96  // If the input name is not known, this returns a value
97  // equal to the size.
98  unsigned triggerIndex(std::string const& pathName) const;
99 
100  // The number of trigger names.
102 
103  private:
104  unsigned getAndCheckIndex(std::string const& pathName) const;
105 
106  void throwTriggerResultsMissing() const;
107  void throwTriggerNamesMissing() const;
108 
111  };
112 } // namespace edm
113 #endif
edm::hlt::HLTState
HLTState
status of a trigger path
Definition: HLTenums.h:16
mps_fire.i
i
Definition: mps_fire.py:428
edm::TriggerResultsByName::isValid
bool isValid() const
Definition: TriggerResultsByName.cc:34
edm::TriggerResultsByName::triggerName
std::string const & triggerName(unsigned i) const
Definition: TriggerResultsByName.cc:163
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::TriggerResultsByName::throwTriggerResultsMissing
void throwTriggerResultsMissing() const
Definition: TriggerResultsByName.cc:197
edm::TriggerResultsByName::throwTriggerNamesMissing
void throwTriggerNamesMissing() const
Definition: TriggerResultsByName.cc:206
edm::TriggerResultsByName::triggerIndex
unsigned triggerIndex(std::string const &pathName) const
Definition: TriggerResultsByName.cc:171
edm::TriggerResultsByName::at
HLTPathStatus const & at(std::string const &pathName) const
Definition: TriggerResultsByName.cc:64
edm::TriggerResultsByName::index
unsigned index(std::string const &pathName) const
Definition: TriggerResultsByName.cc:142
edm::TriggerResultsByName::triggerResults_
TriggerResults const * triggerResults_
Definition: TriggerResultsByName.h:109
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
hltMonBTagIPClient_cfi.pathName
pathName
Definition: hltMonBTagIPClient_cfi.py:5
edm::TriggerResultsByName::TriggerResultsByName
TriggerResultsByName(TriggerResults const *triggerResults, TriggerNames const *triggerNames)
Definition: TriggerResultsByName.cc:9
edm::TriggerResultsByName::state
hlt::HLTState state(std::string const &pathName) const
Definition: TriggerResultsByName.cc:129
edm::Hash< ParameterSetType >
edm::TriggerResultsByName::parameterSetID
ParameterSetID const & parameterSetID() const
Definition: TriggerResultsByName.cc:40
edm::TriggerResultsByName::triggerNames_
TriggerNames const * triggerNames_
Definition: TriggerResultsByName.h:110
edm::TriggerResultsByName::wasrun
bool wasrun() const
Definition: TriggerResultsByName.cc:46
edm::HLTPathStatus
Definition: HLTPathStatus.h:33
edm::TriggerResultsByName::accept
bool accept() const
Definition: TriggerResultsByName.cc:52
edm::TriggerResultsByName::operator[]
HLTPathStatus const & operator[](std::string const &pathName) const
Definition: TriggerResultsByName.cc:77
edm::TriggerResultsByName
Definition: TriggerResultsByName.h:48
edm::TriggerResultsByName::size
std::vector< std::string >::size_type size() const
Definition: TriggerResultsByName.cc:179
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::TriggerResultsByName::getAndCheckIndex
unsigned getAndCheckIndex(std::string const &pathName) const
Definition: TriggerResultsByName.cc:185
edm::TriggerResultsByName::error
bool error() const
Definition: TriggerResultsByName.cc:58
edm::TriggerNames
Definition: TriggerNames.h:55
edm::triggerResults
static const std::string triggerResults("TriggerResults")
HLTenums.h
ParameterSetID.h
HLTObjectsMonitor_cfi.TriggerResults
TriggerResults
Definition: HLTObjectsMonitor_cfi.py:9
edm::TriggerResultsByName::triggerNames
std::vector< std::string > const & triggerNames() const
Definition: TriggerResultsByName.cc:155
edm::TriggerResults
Definition: TriggerResults.h:35