CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DataFormats/Common/interface/HLTPathStatus.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Common_HLTPathStatus_h
00002 #define DataFormats_Common_HLTPathStatus_h
00003 
00031 #include "DataFormats/Common/interface/HLTenums.h"
00032 #include <boost/cstdint.hpp>
00033 #include <cassert>
00034 
00035 namespace edm
00036 {
00037   class HLTPathStatus {
00038 
00039   private:
00041     uint16_t status_;
00042     // bits 0- 1 (0-    3): HLT state
00043     // bits 2-16 (0-16383): index of module on path making path decision
00044 
00045   public:
00047     HLTPathStatus(const hlt::HLTState state = hlt::Ready, const unsigned int index = 0)
00048     : status_(index*4+state) {
00049       assert (state<4);
00050       assert (index<16384);
00051     }
00052 
00054     hlt::HLTState state() const {return (static_cast<hlt::HLTState>(status_ % 4));}
00056     unsigned int  index() const {return (static_cast<unsigned int >(status_ / 4));}
00058     void reset() {status_=0;}
00059 
00061     bool wasrun() const {return (state() != hlt::Ready);}
00063     bool accept() const {return (state() == hlt::Pass);}
00065     bool error()  const {return (state() == hlt::Exception);}
00066 
00067   };
00068 }
00069 
00070 #endif // DataFormats_Common_HLTPathStatus_h