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()
71 if (
conn.i2cAddr(0)) {
74 if (
conn.i2cAddr(1)) {
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";
203 if (npairs == 2 || npairs == 3) {
205 }
else if (npairs == 0) {
218 <<
" Unexpected number of APV pairs: " << npairs;
225 if (lld_channel == 1) {
227 }
else if (lld_channel == 2) {
229 }
else if (lld_channel == 3) {
233 <<
" Unexpected LLD channel: " << lld_channel;
241 if (apv_pair_num > 2) {
243 <<
" Unexpected APV pair number: " << apv_pair_num;
248 <<
" Unexpected number of APV pairs: " <<
nApvPairs_;
253 }
else if (
nApvPairs_ == 2 && apv_pair_num == 2) {
255 <<
" APV pair number is incompatible with" 256 <<
" respect to number of !";
259 return apv_pair_num + 1;
266 if (lld_channel < 1 || lld_channel > 3) {
268 <<
" Unexpected LLD channel: " << lld_channel;
273 <<
" Unexpected number of APV pairs: " <<
nApvPairs_;
278 }
else if (
nApvPairs_ == 2 && lld_channel == 2) {
280 <<
" LLD channel is incompatible with" 281 <<
" respect to number of APV pairs!";
284 return lld_channel - 1;
295 <<
" No APV pairs exist!";
303 }
else if (apv_pair == 1) {
307 <<
" Unexpected pair number! " << apv_pair;
313 }
else if (apv_pair == 1) {
315 }
else if (apv_pair == 2) {
319 <<
" Unexpected pair number! " << apv_pair;
324 <<
" Unexpected number of APV pairs: " <<
nApvPairs();
327 FedCabling::const_iterator ipair =
cabling_.find(lld_ch);
329 return (*ipair).second;
341 if (apv_address == 32 || apv_address == 33) {
343 }
else if (apv_address == 34 || apv_address == 35) {
345 }
else if (apv_address == 36 || apv_address == 37) {
347 }
else if (apv_address == 0) {
352 <<
" Unexpected I2C address (" << apv_address <<
") for APV!";
358 FedCabling::iterator ipair =
cabling_.find(lld_ch);
362 ipair->second = fed_ch;
370 ss <<
" [SiStripModule::" << __func__ <<
"]" << std::endl
374 ss <<
" ActiveApvs : ";
379 std::vector<uint16_t>::const_iterator iapv = apvs.begin();
380 for (; iapv != apvs.end(); ++iapv) {
385 ss <<
" DcuId/DetId/nPairs : " << std::hex <<
"0x" << std::setfill(
'0') << std::setw(8)
390 ss <<
" ApvPairNum/FedCrate/FedSlot/FedId/FedCh : ";
391 FedCabling::const_iterator ichan =
channels.begin();
392 for (; ichan !=
channels.end(); ++ichan) {
393 ss << ichan->first <<
"/" << ichan->second.fedCrate_ <<
"/" << ichan->second.fedSlot_ <<
"/" << ichan->second.fedId_
394 <<
"/" << ichan->second.fedCh_ <<
", ";
405 ss <<
" [SiStripModule::" << __func__ <<
"]" << std::endl
409 ss <<
" ActiveApvs : ";
414 std::vector<uint16_t>::const_iterator iapv = apvs.begin();
415 for (; iapv != apvs.end(); ++iapv) {
420 ss <<
" DcuId/DetId/nPairs : " << std::hex <<
"0x" << std::setfill(
'0') << std::setw(8)
425 ss <<
" ApvPairNum/FedCrate/FedSlot/FedId/FedCh : ";
426 FedCabling::const_iterator ichan =
channels.begin();
427 for (; ichan !=
channels.end(); ++ichan) {
428 ss << ichan->first <<
"/" << ichan->second.fedCrate_ <<
"/" << ichan->second.fedSlot_ <<
"/" << ichan->second.fedId_
429 <<
"/" << ichan->second.fedCh_ <<
", ";
440 std::stringstream
ss;
Device and connection information at the level of a front-end module.
std::vector< uint16_t > activeApvs() const
const uint16_t & ccuAddr() const
const uint16_t & ccuChan() const
const uint16_t & nApvPairs() const
void addDevices(const FedChannelConnection &conn)
std::map< uint16_t, FedChannel > FedCabling
const uint32_t & detId() const
void terse(std::stringstream &) const
static const char mlCabling_[]
uint16_t lldChannel(const uint16_t &apv_pair_num) const
Class containning control, module, detector and connection information, at the level of a FED channel...
FedChannel fedCh(const uint16_t &apv_pair_num) const
void addApv(const uint16_t &apv_address)
const SiStripFecKey & key() const
void print(std::stringstream &) const
const FedCabling & fedChannels() const
std::ostream & operator<<(std::ostream &os, const SiStripModule &device)
PairOfU16 activeApvPair(const uint16_t &lld_channel) const
const uint16_t & fecSlot() const
const uint32_t & dcuId() const
Log< level::Warning, false > LogWarning
const uint16_t & fecRing() const
std::pair< uint16_t, uint16_t > PairOfU16
const uint16_t & fecCrate() const
uint16_t apvPairNumber(const uint16_t &lld_channel) const
const uint16_t & activeApv(const uint16_t &apv_address) const
SiStripModule(const FedChannelConnection &conn)