CMS 3D CMS Logo

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