CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
84  hlt::HLTState state(std::string const& pathName) const;
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
ParameterSetID const & parameterSetID() const
TriggerNames const * triggerNames_
std::vector< std::string >::size_type size() const
unsigned getAndCheckIndex(std::string const &pathName) const
HLTState
status of a trigger path
Definition: HLTenums.h:16
HLTPathStatus const & at(std::string const &pathName) const
unsigned triggerIndex(std::string const &pathName) const
std::string const & triggerName(unsigned i) const
uint16_t size_type
std::vector< std::string > const & triggerNames() const
unsigned index(std::string const &pathName) const
static std::string const triggerResults("TriggerResults")
hlt::HLTState state(std::string const &pathName) const
TriggerResultsByName(TriggerResults const *triggerResults, TriggerNames const *triggerNames)
HLTPathStatus const & operator[](std::string const &pathName) const
TriggerResults const * triggerResults_