Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:13

0001 #ifndef EventFilter_RPCRawToDigi_RPCAMCLinkEvent_h
0002 #define EventFilter_RPCRawToDigi_RPCAMCLinkEvent_h
0003 
0004 class RPCAMCLinkEvent {
0005 public:
0006   static unsigned int const group_mask_ = 0x7000;
0007   static unsigned int const level_mask_ = 0x0700;
0008   static unsigned int const event_mask_ = 0x00ff;
0009 
0010   static unsigned int const not_set_ = 0x0000;
0011 
0012   static unsigned int const fed_ = 0x1000;
0013   static unsigned int const amc_ = 0x2000;
0014   static unsigned int const input_ = 0x3000;
0015 
0016   static unsigned int const debug_ = 0x0100;
0017   static unsigned int const info_ = 0x0200;
0018   static unsigned int const warn_ = 0x0300;
0019   static unsigned int const error_ = 0x0400;
0020   static unsigned int const fatal_ = 0x0500;
0021 
0022 public:
0023   static unsigned int getGroup(unsigned int id);
0024   static unsigned int getLevel(unsigned int id);
0025   static unsigned int getEvent(unsigned int id);
0026 
0027   static unsigned int getId(unsigned int event, unsigned int group = not_set_, unsigned int level = not_set_);
0028 };
0029 
0030 inline unsigned int RPCAMCLinkEvent::getGroup(unsigned int id) { return (id & group_mask_); }
0031 
0032 inline unsigned int RPCAMCLinkEvent::getLevel(unsigned int id) { return (id & level_mask_); }
0033 
0034 inline unsigned int RPCAMCLinkEvent::getEvent(unsigned int id) { return (id & event_mask_); }
0035 
0036 inline unsigned int RPCAMCLinkEvent::getId(unsigned int event, unsigned int group, unsigned int level) {
0037   return ((event & event_mask_) | (group & group_mask_) | (level & level_mask_));
0038 }
0039 
0040 #endif  // EventFilter_RPCRawToDigi_RPCAMCLinkEvent_h