Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef EventFilter_RPCRawToDigi_RPCLBRecord_icc
0002 #define EventFilter_RPCRawToDigi_RPCLBRecord_icc
0003 
0004 #include "EventFilter/RPCRawToDigi/interface/RPCLBRecord.h"
0005 
0006 inline void RPCLBRecord::set(std::uint32_t const record) { record_ = record; }
0007 
0008 inline void RPCLBRecord::reset() { record_ = 0x0; }
0009 
0010 inline std::uint32_t const& RPCLBRecord::getRecord() const { return record_; }
0011 
0012 inline unsigned int RPCLBRecord::getBCN() const { return (record_ & bcn_mask_) >> bcn_offset_; }
0013 
0014 inline bool RPCLBRecord::isBC0() const { return ((record_ & bc0_mask_) ? true : false); }
0015 
0016 inline unsigned int RPCLBRecord::getLinkBoard() const { return (record_ & link_board_mask_) >> link_board_offset_; }
0017 
0018 inline bool RPCLBRecord::isEOD() const { return ((record_ & eod_mask_) ? true : false); }
0019 
0020 inline unsigned int RPCLBRecord::getDelay() const { return (record_ & delay_mask_) >> delay_offset_; }
0021 
0022 inline unsigned int RPCLBRecord::getConnector() const { return (record_ & connector_mask_) >> connector_offset_; }
0023 
0024 inline unsigned int RPCLBRecord::getPartition() const { return (record_ & partition_mask_) >> partition_offset_; }
0025 
0026 inline std::uint8_t RPCLBRecord::getPartitionData() const {
0027   return (record_ & partition_data_mask_) >> partition_data_offset_;
0028 }
0029 
0030 inline void RPCLBRecord::setBCN(unsigned int bcn) {
0031   record_ &= ~bcn_mask_;
0032   record_ |= (((std::uint32_t)(bcn) << bcn_offset_) & bcn_mask_);
0033 }
0034 
0035 inline void RPCLBRecord::setBC0(bool bc0) {
0036   if (bc0)
0037     record_ |= bc0_mask_;
0038   else
0039     record_ &= ~(bc0_mask_);
0040 }
0041 
0042 inline void RPCLBRecord::setLinkBoard(unsigned int link_board) {
0043   record_ &= ~link_board_mask_;
0044   record_ |= (((std::uint32_t)(link_board) << link_board_offset_) & link_board_mask_);
0045 }
0046 
0047 inline void RPCLBRecord::setEOD(bool eod) {
0048   if (eod)
0049     record_ |= eod_mask_;
0050   else
0051     record_ &= ~(eod_mask_);
0052 }
0053 
0054 inline void RPCLBRecord::setDelay(unsigned int delay) {
0055   record_ &= ~delay_mask_;
0056   record_ |= (((std::uint32_t)(delay) << delay_offset_) & delay_mask_);
0057 }
0058 
0059 inline void RPCLBRecord::setConnector(unsigned int connector) {
0060   record_ &= ~connector_mask_;
0061   record_ |= (((std::uint32_t)(connector) << connector_offset_) & connector_mask_);
0062 }
0063 
0064 inline void RPCLBRecord::setPartition(unsigned int partition) {
0065   record_ &= ~partition_mask_;
0066   record_ |= (((std::uint32_t)(partition) << partition_offset_) & partition_mask_);
0067 }
0068 
0069 inline void RPCLBRecord::setPartitionData(std::uint8_t data) {
0070   record_ &= ~partition_data_mask_;
0071   record_ |= (((std::uint32_t)(data) << partition_data_offset_) & partition_data_mask_);
0072 }
0073 
0074 inline bool RPCLBRecord::operator<(RPCLBRecord const& rhs) const { return record_ < rhs.record_; }
0075 
0076 #endif  // EventFilter_RPCRawToDigi_RPCLBRecord_icc