Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:31

0001 #include "CondFormats/RPCObjects/interface/RPCDCCLink.h"
0002 
0003 #include <ostream>
0004 #include <sstream>
0005 
0006 RPCDCCLink::RPCDCCLink() : id_(0x0) {}
0007 
0008 RPCDCCLink::RPCDCCLink(std::uint32_t const& id) : id_(id) {}
0009 
0010 RPCDCCLink::RPCDCCLink(int fed, int dccinput, int tbinput) : id_(0x0) {
0011   setFED(fed);
0012   setDCCInput(dccinput);
0013   setTBInput(tbinput);
0014 }
0015 
0016 std::uint32_t RPCDCCLink::getMask() const {
0017   std::uint32_t mask(0x0);
0018   if (id_ & mask_fed_)
0019     mask |= mask_fed_;
0020   if (id_ & mask_dccinput_)
0021     mask |= mask_dccinput_;
0022   if (id_ & mask_tbinput_)
0023     mask |= mask_tbinput_;
0024   return mask;
0025 }
0026 
0027 std::string RPCDCCLink::getName() const {
0028   std::ostringstream oss;
0029   oss << "RPCDCCLink_";
0030   bf_stream(oss, min_fed_, mask_fed_, pos_fed_);
0031   bf_stream(oss << '_', min_dccinput_, mask_dccinput_, pos_dccinput_);
0032   bf_stream(oss << '_', min_tbinput_, mask_tbinput_, pos_tbinput_);
0033   return oss.str();
0034 }
0035 
0036 std::ostream& operator<<(std::ostream& ostream, RPCDCCLink const& link) { return (ostream << link.getName()); }