CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
FedChannelConnection Class Reference

Class containning control, module, detector and connection information, at the level of a FED channel. More...

#include <FedChannelConnection.h>

Public Member Functions

uint16_t apvPairNumber () const
 
uint16_t apvPairNumberDebug () const
 
const uint16_t & ccuAddr () const
 
const uint16_t & ccuChan () const
 
void consistencyCheck () const
 
const bool & dcu () const
 
const uint32_t & dcuId () const
 
const uint32_t & detId () const
 
const uint16_t & fecCrate () const
 
const uint16_t & fecRing () const
 
const uint16_t & fecSlot () const
 
const uint16_t & fedCh () const
 
void fedCh (uint16_t &fed_ch)
 
 FedChannelConnection (const uint16_t &fec_crate, const uint16_t &fec_slot, const uint16_t &fec_ring, const uint16_t &ccu_addr, const uint16_t &ccu_chan, const uint16_t &apv0=0, const uint16_t &apv1=0, const uint32_t &dcu_id=0, const uint32_t &det_id=0, const uint16_t &pairs=0, const uint16_t &fed_id=0, const uint16_t &fed_ch=0, const uint16_t &length=0, const bool &dcu=false, const bool &pll=false, const bool &mux=false, const bool &lld=false)
 
 FedChannelConnection ()
 
const uint16_t & fedCrate () const
 
void fedCrate (uint16_t &fed_crate)
 
const uint16_t & fedId () const
 
void fedId (uint16_t &fed_id)
 
const uint16_t & fedSlot () const
 
void fedSlot (uint16_t &fed_slot)
 
const uint16_t & fiberLength () const
 
const uint16_t & i2cAddr (const uint16_t &apv0_or_1) const
 
bool isConnected () const
 
const bool & lld () const
 
uint16_t lldChannel () const
 
const bool & mux () const
 
const uint16_t & nApvPairs () const
 
uint16_t nApvs () const
 
uint16_t nDetStrips () const
 
const bool & pll () const
 
void print (std::stringstream &) const
 
void terse (std::stringstream &) const
 
 ~FedChannelConnection ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

uint16_t apv0_
 
uint16_t apv1_
 
uint16_t ccuAddr_
 
uint16_t ccuChan_
 
bool dcu0x00_
 
uint32_t dcuId_
 
uint32_t detId_
 
uint16_t fecCrate_
 
uint16_t fecRing_
 
uint16_t fecSlot_
 
uint16_t fedCh_
 
uint16_t fedCrate_
 
uint16_t fedId_
 
uint16_t fedSlot_
 
uint16_t length_
 
bool lld0x60_
 
bool mux0x43_
 
uint16_t nApvPairs_
 
bool pll0x44_
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Class containning control, module, detector and connection information, at the level of a FED channel.

Author
R.Bainbridge

Definition at line 26 of file FedChannelConnection.h.

Constructor & Destructor Documentation

◆ FedChannelConnection() [1/2]

FedChannelConnection::FedChannelConnection ( const uint16_t &  fec_crate,
const uint16_t &  fec_slot,
const uint16_t &  fec_ring,
const uint16_t &  ccu_addr,
const uint16_t &  ccu_chan,
const uint16_t &  apv0 = 0,
const uint16_t &  apv1 = 0,
const uint32_t &  dcu_id = 0,
const uint32_t &  det_id = 0,
const uint16_t &  pairs = 0,
const uint16_t &  fed_id = 0,
const uint16_t &  fed_ch = 0,
const uint16_t &  length = 0,
const bool &  dcu = false,
const bool &  pll = false,
const bool &  mux = false,
const bool &  lld = false 
)

Constructor requires at least information to uniquely identify a front-end module: ie, crate + FEC + ring + CCU + module.

Definition at line 11 of file FedChannelConnection.cc.

28  : fecCrate_(fec_crate),
29  fecSlot_(fec_slot),
30  fecRing_(fec_ring),
31  ccuAddr_(ccu_addr),
32  ccuChan_(ccu_chan),
33  apv0_(apv0),
34  apv1_(apv1),
35  dcuId_(dcu_id),
36  detId_(det_id),
37  nApvPairs_(pairs),
40  fedId_(fed_id),
41  fedCh_(fed_ch),
42  length_(length),
43  dcu0x00_(dcu),
44  mux0x43_(mux),
45  pll0x44_(pll),
46  lld0x60_(lld) {
47  ;
48 }
const bool & dcu() const
const bool & pll() const
const bool & lld() const
static const uint16_t invalid_
Definition: Constants.h:16
const bool & mux() const

◆ FedChannelConnection() [2/2]

FedChannelConnection::FedChannelConnection ( )

Default constructor.

Definition at line 52 of file FedChannelConnection.cc.

68  dcu0x00_(false),
69  mux0x43_(false),
70  pll0x44_(false),
71  lld0x60_(false) {
72  ;
73 }
static const uint32_t invalid32_
Definition: Constants.h:15
static const uint16_t invalid_
Definition: Constants.h:16

◆ ~FedChannelConnection()

FedChannelConnection::~FedChannelConnection ( )
inline

Default destructor.

Definition at line 54 of file FedChannelConnection.h.

54 { ; }

Member Function Documentation

◆ apvPairNumber()

uint16_t FedChannelConnection::apvPairNumber ( ) const
inline

Returns APV pair number for this connection object. This can be either 0->1 or 0->2, depending on number of detector strips.

Definition at line 230 of file FedChannelConnection.h.

References apv0_, apv1_, and nApvPairs_.

Referenced by SiStripPopConFEDErrorsHandlerFromDQM::addBadAPV(), SiStripSpyMonitorModule::analyze(), NoiseTask::book(), SiStripShotFilter::filter(), print(), sistrip::FEDEmulatorModule::produce(), SiStripCondObjBuilderFromDb::setValuesApvTiming(), SiStripCondObjBuilderFromDb::setValuesCabling(), terse(), PedsOnlyTask::update(), and NoiseTask::update().

230  {
231  if (apv0_ == 32 || apv1_ == 33) {
232  return 0;
233  } else if (apv0_ == 34 || apv1_ == 35) {
234  return 1;
235  } else { // if (apv0_ == 36 || apv1_ == 37) {
236  return nApvPairs_ - 1;
237  }
238 }

◆ apvPairNumberDebug()

uint16_t FedChannelConnection::apvPairNumberDebug ( ) const

Definition at line 125 of file FedChannelConnection.cc.

References apv0_, apv1_, sistrip::invalid_, edm::isDebugEnabled(), sistrip::mlCabling_, and nApvPairs_.

125  {
126  if (nApvPairs_ == 2) {
127  if (apv0_ == 32 || apv1_ == 33) {
128  return 0;
129  } else if (apv0_ == 36 || apv1_ == 37) {
130  return 1;
131  } else {
132  if (edm::isDebugEnabled()) {
133  edm::LogWarning(mlCabling_) << "[FedChannelConnection::" << __func__ << "]"
134  << " APV I2C addresses (" << apv0_ << "/" << apv1_ << ") are incompatible with"
135  << " number of APV pairs (" << nApvPairs_ << ") found for this module!";
136  }
137  }
138  } else if (nApvPairs_ == 3) {
139  if (apv0_ == 32 || apv1_ == 33) {
140  return 0;
141  } else if (apv0_ == 34 || apv1_ == 35) {
142  return 1;
143  } else if (apv0_ == 36 || apv1_ == 37) {
144  return 2;
145  } else {
146  if (edm::isDebugEnabled()) {
147  edm::LogWarning(mlCabling_) << "[FedChannelConnection::" << __func__ << "]"
148  << " APV I2C addresses (" << apv0_ << "/" << apv1_ << ") are incompatible with"
149  << " number of APV pairs (" << nApvPairs_ << ") found for this module!";
150  }
151  }
152  } else {
153  if (edm::isDebugEnabled()) {
154  edm::LogWarning(mlCabling_) << "[FedChannelConnection::" << __func__ << "]"
155  << " Unexpected number of APV pairs: " << nApvPairs_;
156  }
157  }
158  return sistrip::invalid_;
159 }
bool isDebugEnabled()
static const char mlCabling_[]
static const uint16_t invalid_
Definition: Constants.h:16
Log< level::Warning, false > LogWarning

◆ ccuAddr()

const uint16_t & FedChannelConnection::ccuAddr ( ) const
inline

◆ ccuChan()

const uint16_t & FedChannelConnection::ccuChan ( ) const
inline

◆ consistencyCheck()

void FedChannelConnection::consistencyCheck ( ) const
inline

Performs consistency check for this connection object.

Definition at line 62 of file FedChannelConnection.h.

62 { ; } //@@ TO BE IMPLEMENTED...

◆ dcu()

const bool & FedChannelConnection::dcu ( ) const
inline

Indicates whether DCU ASIC is found.

Definition at line 207 of file FedChannelConnection.h.

References dcu0x00_.

Referenced by print().

207 { return dcu0x00_; }

◆ dcuId()

const uint32_t & FedChannelConnection::dcuId ( ) const
inline

Returns DCUid for this module.

Definition at line 212 of file FedChannelConnection.h.

References dcuId_.

Referenced by print(), and terse().

212 { return dcuId_; }

◆ detId()

const uint32_t & FedChannelConnection::detId ( ) const
inline

◆ fecCrate()

const uint16_t & FedChannelConnection::fecCrate ( ) const
inline

◆ fecRing()

const uint16_t & FedChannelConnection::fecRing ( ) const
inline

◆ fecSlot()

const uint16_t & FedChannelConnection::fecSlot ( ) const
inline

◆ fedCh() [1/2]

const uint16_t & FedChannelConnection::fedCh ( ) const
inline

◆ fedCh() [2/2]

void FedChannelConnection::fedCh ( uint16_t &  fed_ch)
inline

Sets FED id for this channel.

Definition at line 226 of file FedChannelConnection.h.

References fedCh_.

226 { fedCh_ = fed_ch; }

◆ fedCrate() [1/2]

const uint16_t & FedChannelConnection::fedCrate ( ) const
inline

Returns FED crate for this channel.

Definition at line 218 of file FedChannelConnection.h.

References fedCrate_.

Referenced by print(), and terse().

218 { return fedCrate_; }

◆ fedCrate() [2/2]

void FedChannelConnection::fedCrate ( uint16_t &  fed_crate)
inline

Sets FED crate for this channel.

Definition at line 227 of file FedChannelConnection.h.

References fedCrate_.

227 { fedCrate_ = fed_crate; }

◆ fedId() [1/2]

const uint16_t & FedChannelConnection::fedId ( ) const
inline

◆ fedId() [2/2]

void FedChannelConnection::fedId ( uint16_t &  fed_id)
inline

Sets FED id for this channel.

Definition at line 225 of file FedChannelConnection.h.

References fedId_.

225 { fedId_ = fed_id; }

◆ fedSlot() [1/2]

const uint16_t & FedChannelConnection::fedSlot ( ) const
inline

Returns FED slot for this channel.

Definition at line 219 of file FedChannelConnection.h.

References fedSlot_.

Referenced by print(), and terse().

219 { return fedSlot_; }

◆ fedSlot() [2/2]

void FedChannelConnection::fedSlot ( uint16_t &  fed_slot)
inline

Sets FED slot for this channel.

Definition at line 228 of file FedChannelConnection.h.

References fedSlot_.

228 { fedSlot_ = fed_slot; }

◆ fiberLength()

const uint16_t & FedChannelConnection::fiberLength ( ) const
inline

Returns the length of the optical fiber

Definition at line 223 of file FedChannelConnection.h.

References length_.

223 { return length_; }

◆ i2cAddr()

const uint16_t & FedChannelConnection::i2cAddr ( const uint16_t &  apv0_or_1) const

Indicates whether APV0 or APV1 of the pair has been found: a non-zero value indicates the I2C address; a null value signifies a problematic APV.

Definition at line 89 of file FedChannelConnection.cc.

References apv0_, apv1_, edm::isDebugEnabled(), and sistrip::mlCabling_.

Referenced by SiStripCondObjBuilderFromDb::SkipDeviceDescription::isConsistent(), print(), SiStripCondObjBuilderFromDb::setValuesApvLatency(), and terse().

89  {
90  if (apv == 0) {
91  return apv0_;
92  } else if (apv == 1) {
93  return apv1_;
94  } else {
95  if (edm::isDebugEnabled()) {
96  edm::LogWarning(mlCabling_) << "[FedChannelConnection::" << __func__ << "]"
97  << " Unexpected APV I2C address!" << apv;
98  }
99  static const uint16_t i2c_addr = 0;
100  return i2c_addr;
101  }
102 }
bool isDebugEnabled()
static const char mlCabling_[]
Log< level::Warning, false > LogWarning

◆ isConnected()

bool FedChannelConnection::isConnected ( ) const
inline

◆ lld()

const bool & FedChannelConnection::lld ( ) const
inline

Indicates whether Linear Laser Driver ASIC is found.

Definition at line 210 of file FedChannelConnection.h.

References lld0x60_.

Referenced by print().

210 { return lld0x60_; }

◆ lldChannel()

uint16_t FedChannelConnection::lldChannel ( ) const

Returns Laser Driver channel (1->3) for this channel.

Definition at line 106 of file FedChannelConnection.cc.

References apv0_, apv1_, sistrip::invalid_, edm::isDebugEnabled(), and sistrip::mlCabling_.

Referenced by CommissioningTask::CommissioningTask(), SiStripCondObjBuilderFromDb::SkipDeviceDescription::isConsistent(), print(), and CommissioningTask::~CommissioningTask().

106  {
107  if (apv0_ == 32 || apv1_ == 33) {
108  return 1;
109  } else if (apv0_ == 34 || apv1_ == 35) {
110  return 2;
111  } else if (apv0_ == 36 || apv1_ == 37) {
112  return 3;
113  } else if (apv0_ != sistrip::invalid_ || apv1_ != sistrip::invalid_) {
114  if (edm::isDebugEnabled()) {
115  edm::LogWarning(mlCabling_) << "[FedChannelConnection::" << __func__ << "]"
116  << " Unexpected APV I2C addresses!"
117  << " Apv0: " << apv0_ << " Apv1: " << apv1_;
118  }
119  }
120  return sistrip::invalid_;
121 }
bool isDebugEnabled()
static const char mlCabling_[]
static const uint16_t invalid_
Definition: Constants.h:16
Log< level::Warning, false > LogWarning

◆ mux()

const bool & FedChannelConnection::mux ( ) const
inline

Indicates whether APV-MUX ASIC is found.

Definition at line 208 of file FedChannelConnection.h.

References mux0x43_.

Referenced by print().

208 { return mux0x43_; }

◆ nApvPairs()

const uint16_t & FedChannelConnection::nApvPairs ( ) const
inline

Returns number of APV pairs for this module.

Definition at line 215 of file FedChannelConnection.h.

References nApvPairs_.

Referenced by SiStripCMMonitorPlugin::analyze(), nApvs(), print(), sistrip::FEDEmulatorModule::produce(), and terse().

215 { return nApvPairs_; }

◆ nApvs()

uint16_t FedChannelConnection::nApvs ( ) const
inline

Returns number of APVs for this module.

Definition at line 216 of file FedChannelConnection.h.

References nApvPairs().

216 { return 2 * nApvPairs(); }
const uint16_t & nApvPairs() const

◆ nDetStrips()

uint16_t FedChannelConnection::nDetStrips ( ) const
inline

Returns number of detector strips for this module.

Definition at line 214 of file FedChannelConnection.h.

References nApvPairs_.

214 { return 256 * nApvPairs_; }

◆ pll()

const bool & FedChannelConnection::pll ( ) const
inline

Indicates whether PLL ASIC is found.

Definition at line 209 of file FedChannelConnection.h.

References pll0x44_.

Referenced by print().

209 { return pll0x44_; }

◆ print()

void FedChannelConnection::print ( std::stringstream &  ss) const

Prints all information for this connection object.

Definition at line 163 of file FedChannelConnection.cc.

References apvPairNumber(), ccuAddr(), ccuChan(), dcu(), dcuId(), TauDecayModes::dec, detId(), fecCrate(), SiStripFedKey::feChan(), fecRing(), fecSlot(), fedCh(), fedCrate(), fedId(), fedSlot(), SiStripFedKey::feUnit(), i2cAddr(), lld(), lldChannel(), mux(), nApvPairs(), pll(), and contentValuesCheck::ss.

163  {
164  ss << " [FedChannelConnection::" << __func__ << "]" << std::endl
165  << " FedCrate/FedSlot/FedId/FeUnit/FeChan/FedCh : " << fedCrate() << "/" << fedSlot() << "/" << fedId() << "/"
166  << SiStripFedKey::feUnit(fedCh()) << "/" << SiStripFedKey::feChan(fedCh()) << "/" << fedCh() << std::endl
167  << " FecCrate/FecSlot/FecRing/CcuAddr/CcuChan : " << fecCrate() << "/" << fecSlot() << "/" << fecRing() << "/"
168  << ccuAddr() << "/" << ccuChan() << std::endl
169  << " DcuId/DetId : " << std::hex << "0x" << std::setfill('0') << std::setw(8)
170  << dcuId() << "/"
171  << "0x" << std::setfill('0') << std::setw(8) << detId() << std::endl
172  << std::dec << " LldChan/APV0/APV1 : " << lldChannel() << "/" << i2cAddr(0) << "/"
173  << i2cAddr(1) << std::endl
174  << " pairNumber/nPairs/nStrips : " << apvPairNumber() << "/" << nApvPairs() << "/"
175  << 256 * nApvPairs() << std::endl
176  << " DCU/MUX/PLL/LLD found : " << std::boolalpha << dcu() << "/" << mux() << "/" << pll()
177  << "/" << lld() << std::noboolalpha;
178 }
const uint16_t & fecCrate() const
const uint16_t & ccuAddr() const
const uint16_t & fedSlot() const
const bool & dcu() const
const uint16_t & feChan() const
const uint16_t & feUnit() const
const uint32_t & dcuId() const
const uint16_t & i2cAddr(const uint16_t &apv0_or_1) const
const uint16_t & fecSlot() const
const bool & pll() const
const uint16_t & ccuChan() const
const uint16_t & fedId() const
const uint16_t & fecRing() const
const bool & lld() const
const uint32_t & detId() const
const uint16_t & fedCrate() const
const uint16_t & nApvPairs() const
uint16_t apvPairNumber() const
const bool & mux() const
const uint16_t & fedCh() const

◆ serialize()

template<class Archive >
void FedChannelConnection::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ terse()

void FedChannelConnection::terse ( std::stringstream &  ss) const

Prints terse information for this connection object.

Definition at line 182 of file FedChannelConnection.cc.

References apvPairNumber(), ccuAddr(), ccuChan(), dcuId(), TauDecayModes::dec, detId(), fecCrate(), SiStripFedKey::feChan(), fecRing(), fecSlot(), fedCh(), fedCrate(), fedId(), fedSlot(), SiStripFedKey::feUnit(), i2cAddr(), nApvPairs(), and contentValuesCheck::ss.

182  {
183  ss << " FED:cr/sl/id/fe/ch/chan=" << fedCrate() << "/" << fedSlot() << "/" << fedId() << "/"
184  << SiStripFedKey::feUnit(fedCh()) << "/" << SiStripFedKey::feChan(fedCh()) << "/" << fedCh() << ","
185  << " FEC:cr/sl/ring/ccu/mod=" << fecCrate() << "/" << fecSlot() << "/" << fecRing() << "/" << ccuAddr() << "/"
186  << ccuChan() << ","
187  << " apvs=" << i2cAddr(0) << "/" << i2cAddr(1) << ","
188  << " pair=" << apvPairNumber() + 1 << " (from " << nApvPairs() << "),"
189  << " dcu/detid=" << std::hex << "0x" << std::setfill('0') << std::setw(8) << dcuId() << "/"
190  << "0x" << std::setfill('0') << std::setw(8) << detId() << std::dec;
191 }
const uint16_t & fecCrate() const
const uint16_t & ccuAddr() const
const uint16_t & fedSlot() const
const uint16_t & feChan() const
const uint16_t & feUnit() const
const uint32_t & dcuId() const
const uint16_t & i2cAddr(const uint16_t &apv0_or_1) const
const uint16_t & fecSlot() const
const uint16_t & ccuChan() const
const uint16_t & fedId() const
const uint16_t & fecRing() const
const uint32_t & detId() const
const uint16_t & fedCrate() const
const uint16_t & nApvPairs() const
uint16_t apvPairNumber() const
const uint16_t & fedCh() const

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 192 of file FedChannelConnection.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 192 of file FedChannelConnection.h.

Member Data Documentation

◆ apv0_

uint16_t FedChannelConnection::apv0_
private

Definition at line 171 of file FedChannelConnection.h.

Referenced by apvPairNumber(), apvPairNumberDebug(), i2cAddr(), and lldChannel().

◆ apv1_

uint16_t FedChannelConnection::apv1_
private

Definition at line 172 of file FedChannelConnection.h.

Referenced by apvPairNumber(), apvPairNumberDebug(), i2cAddr(), and lldChannel().

◆ ccuAddr_

uint16_t FedChannelConnection::ccuAddr_
private

Definition at line 167 of file FedChannelConnection.h.

Referenced by ccuAddr().

◆ ccuChan_

uint16_t FedChannelConnection::ccuChan_
private

Definition at line 168 of file FedChannelConnection.h.

Referenced by ccuChan().

◆ dcu0x00_

bool FedChannelConnection::dcu0x00_
private

Definition at line 187 of file FedChannelConnection.h.

Referenced by dcu().

◆ dcuId_

uint32_t FedChannelConnection::dcuId_
private

Definition at line 175 of file FedChannelConnection.h.

Referenced by dcuId().

◆ detId_

uint32_t FedChannelConnection::detId_
private

Definition at line 176 of file FedChannelConnection.h.

Referenced by detId().

◆ fecCrate_

uint16_t FedChannelConnection::fecCrate_
private

Definition at line 164 of file FedChannelConnection.h.

Referenced by fecCrate().

◆ fecRing_

uint16_t FedChannelConnection::fecRing_
private

Definition at line 166 of file FedChannelConnection.h.

Referenced by fecRing().

◆ fecSlot_

uint16_t FedChannelConnection::fecSlot_
private

Definition at line 165 of file FedChannelConnection.h.

Referenced by fecSlot().

◆ fedCh_

uint16_t FedChannelConnection::fedCh_
private

Definition at line 183 of file FedChannelConnection.h.

Referenced by fedCh(), and isConnected().

◆ fedCrate_

uint16_t FedChannelConnection::fedCrate_
private

Definition at line 180 of file FedChannelConnection.h.

Referenced by fedCrate().

◆ fedId_

uint16_t FedChannelConnection::fedId_
private

Definition at line 182 of file FedChannelConnection.h.

Referenced by fedId(), and isConnected().

◆ fedSlot_

uint16_t FedChannelConnection::fedSlot_
private

Definition at line 181 of file FedChannelConnection.h.

Referenced by fedSlot().

◆ length_

uint16_t FedChannelConnection::length_
private

Definition at line 184 of file FedChannelConnection.h.

Referenced by fiberLength().

◆ lld0x60_

bool FedChannelConnection::lld0x60_
private

Definition at line 190 of file FedChannelConnection.h.

Referenced by lld().

◆ mux0x43_

bool FedChannelConnection::mux0x43_
private

Definition at line 188 of file FedChannelConnection.h.

Referenced by mux().

◆ nApvPairs_

uint16_t FedChannelConnection::nApvPairs_
private

Definition at line 177 of file FedChannelConnection.h.

Referenced by apvPairNumber(), apvPairNumberDebug(), nApvPairs(), and nDetStrips().

◆ pll0x44_

bool FedChannelConnection::pll0x44_
private

Definition at line 189 of file FedChannelConnection.h.

Referenced by pll().