13 : key_(conn.fecCrate(), conn.fecSlot(), conn.fecRing(), conn.ccuAddr(), conn.ccuChan()),
37 <<
" Unexpected FEC crate (" << conn.
fecCrate() <<
") for this module (" 44 <<
" Unexpected FEC slot (" << conn.
fecSlot() <<
") for this module (" <<
key_.
fecSlot()
51 <<
" Unexpected FEC ring (" << conn.
fecRing() <<
") for this module (" <<
key_.
fecRing()
58 <<
" Unexpected CCU addr (" << conn.
ccuAddr() <<
") for this module (" <<
key_.
ccuAddr()
65 <<
" Unexpected CCU chan (" << conn.
ccuChan() <<
") for this module (" <<
key_.
ccuChan()
105 std::vector<uint16_t> apvs;
130 if (apv_address == 0 || apv_address == 32) {
132 }
else if (apv_address == 1 || apv_address == 33) {
134 }
else if (apv_address == 2 || apv_address == 34) {
136 }
else if (apv_address == 3 || apv_address == 35) {
138 }
else if (apv_address == 4 || apv_address == 36) {
140 }
else if (apv_address == 5 || apv_address == 37) {
144 <<
" Unexpected I2C address or number (" << apv_address <<
") for this module!";
146 static const uint16_t address = 0;
154 if (apv_address == 0) {
156 <<
" Null APV I2C address!";
158 }
else if (apv_address < 32 && apv_address > 37) {
160 <<
" Unexpected I2C address (" << apv_address <<
") for APV!";
164 bool added_apv =
false;
165 if (!
apv32_ && apv_address == 32) {
168 }
else if (!
apv33_ && apv_address == 33) {
171 }
else if (!
apv34_ && apv_address == 34) {
174 }
else if (!
apv35_ && apv_address == 35) {
177 }
else if (!
apv36_ && apv_address == 36) {
180 }
else if (!
apv37_ && apv_address == 37) {
185 std::stringstream ss;
186 ss <<
"SiStripModule::" << __func__ <<
"]";
188 ss <<
" Added new APV for";
190 ss <<
" APV already exists for";
201 if (npairs == 2 || npairs == 3) {
203 }
else if (npairs == 0) {
216 <<
" Unexpected number of APV pairs: " << npairs;
223 if (lld_channel == 1) {
225 }
else if (lld_channel == 2) {
227 }
else if (lld_channel == 3) {
231 <<
" Unexpected LLD channel: " << lld_channel;
239 if (apv_pair_num > 2) {
241 <<
" Unexpected APV pair number: " << apv_pair_num;
246 <<
" Unexpected number of APV pairs: " <<
nApvPairs_;
251 }
else if (
nApvPairs_ == 2 && apv_pair_num == 2) {
253 <<
" APV pair number is incompatible with" 254 <<
" respect to number of !";
257 return apv_pair_num + 1;
264 if (lld_channel < 1 || lld_channel > 3) {
266 <<
" Unexpected LLD channel: " << lld_channel;
271 <<
" Unexpected number of APV pairs: " <<
nApvPairs_;
276 }
else if (
nApvPairs_ == 2 && lld_channel == 2) {
278 <<
" LLD channel is incompatible with" 279 <<
" respect to number of APV pairs!";
282 return lld_channel - 1;
293 <<
" No APV pairs exist!";
301 }
else if (apv_pair == 1) {
305 <<
" Unexpected pair number! " << apv_pair;
311 }
else if (apv_pair == 1) {
313 }
else if (apv_pair == 2) {
317 <<
" Unexpected pair number! " << apv_pair;
322 <<
" Unexpected number of APV pairs: " <<
nApvPairs();
325 FedCabling::const_iterator ipair =
cabling_.find(lld_ch);
327 return (*ipair).second;
339 if (apv_address == 32 || apv_address == 33) {
341 }
else if (apv_address == 34 || apv_address == 35) {
343 }
else if (apv_address == 36 || apv_address == 37) {
345 }
else if (apv_address == 0) {
350 <<
" Unexpected I2C address (" << apv_address <<
") for APV!";
356 FedCabling::iterator ipair =
cabling_.find(lld_ch);
360 ipair->second = fed_ch;
368 ss <<
" [SiStripModule::" << __func__ <<
"]" << std::endl
372 ss <<
" ActiveApvs : ";
377 std::vector<uint16_t>::const_iterator iapv = apvs.begin();
378 for (; iapv != apvs.end(); ++iapv) {
383 ss <<
" DcuId/DetId/nPairs : " << std::hex <<
"0x" << std::setfill(
'0') << std::setw(8)
388 ss <<
" ApvPairNum/FedCrate/FedSlot/FedId/FedCh : ";
389 FedCabling::const_iterator ichan = channels.begin();
390 for (; ichan != channels.end(); ++ichan) {
391 ss << ichan->first <<
"/" << ichan->second.fedCrate_ <<
"/" << ichan->second.fedSlot_ <<
"/" << ichan->second.fedId_
392 <<
"/" << ichan->second.fedCh_ <<
", ";
403 ss <<
" [SiStripModule::" << __func__ <<
"]" << std::endl
407 ss <<
" ActiveApvs : ";
412 std::vector<uint16_t>::const_iterator iapv = apvs.begin();
413 for (; iapv != apvs.end(); ++iapv) {
418 ss <<
" DcuId/DetId/nPairs : " << std::hex <<
"0x" << std::setfill(
'0') << std::setw(8)
423 ss <<
" ApvPairNum/FedCrate/FedSlot/FedId/FedCh : ";
424 FedCabling::const_iterator ichan = channels.begin();
425 for (; ichan != channels.end(); ++ichan) {
426 ss << ichan->first <<
"/" << ichan->second.fedCrate_ <<
"/" << ichan->second.fedSlot_ <<
"/" << ichan->second.fedId_
427 <<
"/" << ichan->second.fedCh_ <<
", ";
438 std::stringstream ss;
const uint16_t & fecSlot() const
Device and connection information at the level of a front-end module.
void terse(std::stringstream &) const
const uint16_t & fecCrate() const
std::vector< uint16_t > activeApvs() const
const uint16_t & fecRing() const
const uint16_t & fedCh() const
void print(std::stringstream &) const
const SiStripFecKey & key() const
void addDevices(const FedChannelConnection &conn)
const uint16_t & fecSlot() const
std::map< uint16_t, FedChannel > FedCabling
const FedCabling & fedChannels() const
const uint16_t & fedId() const
uint16_t apvPairNumber(const uint16_t &lld_channel) const
static const char mlCabling_[]
const uint16_t & fecRing() const
const uint16_t & fedSlot() const
const uint32_t & detId() const
Class containning control, module, detector and connection information, at the level of a FED channel...
const uint16_t & ccuChan() const
uint16_t lldChannel(const uint16_t &apv_pair_num) const
void addApv(const uint16_t &apv_address)
const uint16_t & ccuAddr() const
const uint32_t & dcuId() const
const uint16_t & fecCrate() const
PairOfU16 activeApvPair(const uint16_t &lld_channel) const
const uint16_t & nApvPairs() const
const uint32_t & dcuId() const
std::ostream & operator<<(std::ostream &os, const SiStripModule &device)
const uint16_t & nApvPairs() const
const uint16_t & ccuAddr() const
const uint32_t & detId() const
const uint16_t & fedCrate() const
FedChannel fedCh(const uint16_t &apv_pair_num) const
const uint16_t & ccuChan() const
const uint16_t & i2cAddr(const uint16_t &apv0_or_1) const
std::pair< uint16_t, uint16_t > PairOfU16
const uint16_t & activeApv(const uint16_t &apv_address) const
SiStripModule(const FedChannelConnection &conn)