CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HLTPathStatus.h
Go to the documentation of this file.
1 #ifndef DataFormats_Common_HLTPathStatus_h
2 #define DataFormats_Common_HLTPathStatus_h
3 
29 #include <cassert>
30 #include <cstdint>
31 
32 namespace edm {
33  class HLTPathStatus {
34  private:
36  uint16_t status_;
37  // bits 0- 1 (0- 3): HLT state
38  // bits 2-16 (0-16383): index of module on path making path decision
39 
40  public:
42  HLTPathStatus(const hlt::HLTState state = hlt::Ready, const unsigned int index = 0) : status_(index * 4 + state) {
43  assert(((int)state) < 4);
44  assert(index < 16384);
45  }
46 
48  hlt::HLTState state() const { return (static_cast<hlt::HLTState>(status_ % 4)); }
52  unsigned int index() const { return (static_cast<unsigned int>(status_ / 4)); }
54  void reset() { status_ = 0; }
55 
57  bool wasrun() const { return (state() != hlt::Ready); }
59  bool accept() const { return (state() == hlt::Pass); }
61  bool error() const { return (state() == hlt::Exception); }
62  };
63 } // namespace edm
64 
65 #endif // DataFormats_Common_HLTPathStatus_h
not [yet] run
Definition: HLTenums.h:17
HLTPathStatus(const hlt::HLTState state=hlt::Ready, const unsigned int index=0)
constructor
Definition: HLTPathStatus.h:42
uint16_t status_
packed status of trigger path [unsigned char is too small]
Definition: HLTPathStatus.h:36
void reset()
reset this path
Definition: HLTPathStatus.h:54
bool wasrun() const
was this path run?
Definition: HLTPathStatus.h:57
HLTState
status of a trigger path
Definition: HLTenums.h:16
assert(be >=bs)
accept
Definition: HLTenums.h:18
hlt::HLTState state() const
get state of path
Definition: HLTPathStatus.h:48
bool error() const
has this path encountered an error (exception)?
Definition: HLTPathStatus.h:61
bool accept() const
has this path accepted the event?
Definition: HLTPathStatus.h:59
unsigned int index() const
Definition: HLTPathStatus.h:52