Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:47:24

0001 #ifndef CondFormats_RPCObjects_RPCFebConnector_h
0002 #define CondFormats_RPCObjects_RPCFebConnector_h
0003 
0004 #include <cstdint>
0005 #include <string>
0006 #include <iosfwd>
0007 
0008 #include "CondFormats/Serialization/interface/Serializable.h"
0009 
0010 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
0011 
0012 class RPCFebConnector {
0013 public:
0014   static unsigned int const min_first_strip_ = 1;
0015   static unsigned int const max_first_strip_ = 128;
0016   static unsigned int const nchannels_ = 16;
0017 
0018   static unsigned int bit_count(std::uint16_t);
0019 
0020 public:
0021   RPCFebConnector(RPCDetId const& rpc_det_id = RPCDetId(0, 0, 1, 1, 1, 1, 0),
0022                   unsigned int first_strip = 1,
0023                   int slope = 1,
0024                   std::uint16_t channels = 0x0);
0025 
0026   void reset();
0027 
0028   RPCDetId getRPCDetId() const;
0029   unsigned int getFirstStrip() const;
0030   int getSlope() const;
0031   std::uint16_t getChannels() const;
0032 
0033   RPCFebConnector& setRPCDetId(RPCDetId const& rpc_det_id);
0034   RPCFebConnector& setFirstStrip(unsigned int strip);
0035   RPCFebConnector& setSlope(int slope);
0036   RPCFebConnector& setChannels(std::uint16_t channels);
0037 
0038   bool isActive(unsigned int channel) const;
0039   unsigned int getNChannels() const;
0040   unsigned int getStrip(unsigned int channel) const;
0041 
0042   bool hasStrip(unsigned int strip) const;
0043   unsigned int getChannel(unsigned int strip) const;
0044 
0045   std::string getString() const;
0046 
0047 protected:
0048   std::uint8_t first_strip_;  ///< strip, allowing range [1-128]
0049   ::int8_t slope_;            ///< -1 or 1
0050   std::uint16_t channels_;    ///< active channels in range [1-16]
0051 
0052   std::uint32_t rpc_det_id_;
0053 
0054   COND_SERIALIZABLE;
0055 };
0056 
0057 std::ostream& operator<<(std::ostream& ostream, RPCFebConnector const& connector);
0058 
0059 #include "CondFormats/RPCObjects/interface/RPCFebConnector.icc"
0060 
0061 #endif  // CondFormats_RPCObjects_RPCFebConnector_h