8 using namespace sistrip;
12 #ifndef SISTRIPCABLING_USING_NEW_STRUCTURE // ----------------------------------
25 <<
"[SiStripFedCabling::" << __func__ <<
"]"
26 <<
" Constructing object...";
39 <<
"[SiStripFedCabling::" << __func__ <<
"]"
40 <<
" Constructing object...";
42 std::vector<FedChannelConnection> v_fcc;
45 const std::vector<uint16_t>& fedids = input.
feds();
46 std::vector<uint16_t>::const_iterator ifed=fedids.begin();
47 for ( ; ifed != fedids.end(); ++ifed ) {
65 <<
"[SiStripFedCabling::" << __func__ <<
"]"
66 <<
" Constructing object...";
73 <<
"[SiStripFedCabling::" << __func__ <<
"]"
74 <<
" Destructing object...";
82 if ( input.empty() ) {
84 <<
"[SiStripFedCabling::" << __func__ <<
"]"
85 <<
" Input vector of FedChannelConnections is of zero size!"
86 <<
" Unable to populate FED cabling object!";
91 ss <<
"[SiStripFedCabling::" << __func__ <<
"]"
92 <<
" Building FED cabling from "
103 for ( uint16_t iconn = 0; iconn < input.size(); iconn++ ) {
105 if ( !input[iconn].isConnected() ) {
continue; }
107 uint16_t fed_id = input[iconn].fedId();
108 uint16_t fed_ch = input[iconn].fedCh();
114 <<
"[SiStripFedCabling::" << __func__ <<
"]"
115 <<
" Unexpected FED id! " << fed_id;
122 <<
"[SiStripFedCabling::" << __func__ <<
"]"
123 <<
" Unexpected FED channel! " << fed_ch;
129 if ( connected_.size() <= fed_id ) { connected_.resize(fed_id+1); }
130 if ( connected_[fed_id].
size() != 96 ) { connected_[fed_id].resize(96); }
133 bool detected = input[iconn].i2cAddr(0) || input[iconn].i2cAddr(1);
134 bool connected = input[iconn].fedId();
135 if ( detected && connected ) {
136 connected_[fed_id][fed_ch] = input[iconn];
137 }
else if ( detected && !connected ) {
139 }
else if ( !detected && !connected ) {
143 if ( detected && connected ) {
144 std::vector<uint16_t>::iterator
id =
find(
feds_.begin(),
feds_.end(), fed_id );
145 if (
id ==
feds_.end() ) {
feds_.push_back( fed_id ); }
161 uint16_t fed_chan )
const {
165 if ( !connected_.empty() ) {
166 if ( fed_id < connected_.size() ) {
167 if ( !connected_[fed_id].
empty() ) {
168 if ( fed_chan < connected_[fed_id].
size() ) {
169 return connected_[fed_id][fed_chan];
173 <<
"[SiStripFedCabling::" << __func__ <<
"]"
174 <<
" FED channel (" << fed_chan
175 <<
") is greater than or equal to vector size ("
176 << connected_[fed_chan].size() <<
")!";
182 <<
"[SiStripFedCabling::" << __func__ <<
"]"
183 <<
" Cabling map is empty for FED id "
190 <<
"[SiStripFedCabling::" << __func__ <<
"]"
191 <<
" FED id (" << fed_id
192 <<
") is greater than or equal to vector size ("
193 << connected_.size() <<
")!";
198 <<
"[SiStripFedCabling::" << __func__ <<
"]"
199 <<
" Cabling map is empty!";
211 if ( !connected_.empty() ) {
212 if ( fed_id < connected_.size() ) {
213 if ( !connected_[fed_id].
empty() ) {
214 return connected_[fed_id];
218 <<
"[SiStripFedCabling::" << __func__ <<
"]"
219 <<
" Cabling map is empty for FED id "
226 <<
"[SiStripFedCabling::" << __func__ <<
"]"
227 <<
" FED id (" << fed_id
228 <<
") is greater than or equal to vector size ("
229 << connected_.size() <<
")!";
234 <<
"[SiStripFedCabling::" << __func__ <<
"]"
235 <<
" Cabling map is empty!";
239 static std::vector<FedChannelConnection>
connections(96,conn);
248 const std::vector<uint16_t>& fed_ids =
feds();
250 ss <<
"[SiStripFedCabling::" << __func__ <<
"]"
251 <<
" No FEDs found! Unable to print cabling map!";
254 ss <<
"[SiStripFedCabling::" << __func__ <<
"]"
255 <<
" Printing cabling map for " << fed_ids.size()
256 <<
" FEDs with following ids: ";
259 std::vector<uint16_t>::const_iterator ii = fed_ids.begin();
260 for ( ; ii != fed_ids.end(); ii++ ) { ss << *ii <<
" "; }
261 ss << std::endl << std::endl;
267 std::vector<uint16_t>::const_iterator ifed = fed_ids.begin();
268 for ( ; ifed != fed_ids.end(); ifed++ ) {
269 const std::vector<FedChannelConnection>& conns =
connections(*ifed);
271 ss <<
" Printing cabling information for FED id " << *ifed
272 <<
" (found " << conns.size()
273 <<
" FedChannelConnection objects...)"
277 uint16_t connected = 0;
278 std::vector<FedChannelConnection>::const_iterator iconn = conns.begin();
279 for ( ; iconn != conns.end(); iconn++ ) {
282 ss << *iconn << std::endl;
284 ss <<
" (FedId/Ch " << *ifed <<
"/" << ichan
285 <<
": unconnected channel...)" << std::endl;
291 ss <<
" Found " << connected
292 <<
" connected channels for FED id " << *ifed << std::endl
294 if ( connected ) { nfeds++; total += connected; }
298 float percent = (100.*cntr) / (96.*nfeds);
299 percent =
static_cast<uint16_t
>( 10.*percent );
301 ss <<
" Found " << total
302 <<
" APV pairs that are connected to a total of "
303 << nfeds <<
" FEDs" << std::endl
305 <<
" APV pairs have been detected, but are not connected" << std::endl
307 <<
" APV pairs are undetected (wrt DCU-DetId map)" << std::endl
309 <<
" FED channels out of a possible " << (96*nfeds)
310 <<
" (" << nfeds <<
" FEDs) are unconnected ("
311 << percent <<
"%)" << std::endl
320 ss <<
"[SiStripFedCabling::" << __func__ <<
"]";
322 const std::vector<uint16_t>& fed_ids =
feds();
324 ss <<
" No FEDs found! Unable to print cabling map!";
328 ss <<
" Printing cabling map for " << fed_ids.size()
329 <<
" FEDs: " << std::endl << std::endl;
331 std::vector<uint16_t>::const_iterator ifed = fed_ids.begin();
332 for ( ; ifed != fed_ids.end(); ifed++ ) {
334 const std::vector<FedChannelConnection>& conns =
connections(*ifed);
336 ss <<
" Printing cabling information for FED id " << *ifed
337 <<
" (found " << conns.size()
338 <<
" FedChannelConnection objects...)"
341 uint16_t connected = 0;
342 std::vector<FedChannelConnection>::const_iterator iconn = conns.begin();
343 for ( ; iconn != conns.end(); iconn++ ) {
351 ss <<
" Found " << connected
352 <<
" connected channels for FED id " << *ifed << std::endl
363 ss <<
"[SiStripFedCabling::" << __func__ <<
"]";
365 const std::vector<uint16_t>& fed_ids =
feds();
367 ss <<
" No FEDs found!";
371 ss <<
" Found " <<
feds().size() <<
" FEDs"
372 <<
" with number of connected channels per front-end unit: "
374 <<
" FedId FeUnit1 FeUnit2 FeUnit3 FeUnit4 FeUnit5 FeUnit6 FeUnit7 FeUnit8 Total"
381 std::vector<uint16_t>::const_iterator ii = fed_ids.begin();
382 std::vector<uint16_t>::const_iterator
jj = fed_ids.end();
383 for ( ; ii !=
jj; ++ii ) {
386 const std::vector<FedChannelConnection>& conns =
connections(*ii);
387 if ( conns.size() < 96 ) {
389 <<
"[SiStripFedCabling::" << __func__ <<
"]"
390 <<
" Unexpected size for FedChannelConnection vector! "
396 std::vector<uint16_t> connected;
397 connected.resize(8,0);
398 for ( uint16_t ichan = 0; ichan < 96; ++ichan ) {
401 if ( unit > 8 ) {
continue; }
408 ss <<
" " << std::setw(5) << *ii;
409 if ( !connected.empty() ) { nfeds++; }
411 ss <<
" " << std::setw(7) << connected[
unit];
412 if ( !connected.empty() ) { tot += connected[
unit]; }
414 ss <<
" " << std::setw(5) << tot << std::endl;
420 float percent = (100.*
total) / (96.*nfeds);
421 percent =
static_cast<uint16_t
>( 10.*percent );
423 ss <<
" Found: " << std::endl
424 <<
" " << nfeds <<
" out of " <<
feds().size() <<
" FEDs with at least one connected channel " << std::endl
425 <<
" " <<
feds().size() - nfeds <<
" out of " <<
feds().size() <<
" FEDs with no connected channels." << std::endl
426 <<
" " << total <<
" connected channels in total" << std::endl
427 <<
" " <<
detected_.size() <<
" APV pairs have been detected, but are not connected" << std::endl
428 <<
" " <<
undetected_.size() <<
" APV pairs are undetected (wrt DCU-DetId map)" << std::endl
429 <<
" " << percent <<
"% of FED channels are connected" << std::endl;
436 std::stringstream ss;
444 #else // SISTRIPCABLING_USING_NEW_STRUCTURE ------------------------------------
445 #ifndef SISTRIPCABLING_USING_NEW_INTERFACE // ----------------------------------
459 <<
"[SiStripFedCabling::" << __func__ <<
"]"
460 <<
" Constructing object...";
461 buildFedCabling( input );
467 : feds_( input.feds_ ),
468 registry_( input.registry_ ),
469 connections_( input.connections_ ),
470 detected_( input.detected_ ),
471 undetected_( input.undetected_ )
474 <<
"[SiStripFedCabling::" << __func__ <<
"]"
475 <<
" Constructing object...";
488 <<
"[SiStripFedCabling::" << __func__ <<
"]"
489 <<
" Constructing object...";
496 <<
"[SiStripFedCabling::" << __func__ <<
"]"
497 <<
" Destructing object...";
505 if ( input.empty() ) {
507 <<
"[SiStripFedCabling::" << __func__ <<
"]"
508 <<
" Input vector of FedChannelConnections is of zero size!"
509 <<
" Unable to populate FED cabling object!";
513 std::stringstream ss;
514 ss <<
"[SiStripFedCabling::" << __func__ <<
"]"
515 <<
" Building FED cabling from "
517 <<
" connections...";
525 uint16_t min_id =
static_cast<uint16_t
>( FEDNumbering::getSiStripFEDIds().first );
526 uint16_t max_id =
static_cast<uint16_t
>( FEDNumbering::getSiStripFEDIds().second );
527 uint16_t nfeds = max_id - min_id + 1;
539 for ( ; ii !=
jj; ++ii ) {
541 uint16_t fed_id = ii->fedId();
542 uint16_t fed_ch = ii->fedCh();
543 uint16_t
index = fed_id - min_id;
545 if ( fed_id < min_id || fed_id > max_id ) {
continue; }
546 if ( index >=
registry_.size() ) {
continue; }
547 if ( !ii->isConnected() ) {
continue; }
550 if ( iter ==
feds_.end() ) {
feds_.push_back( fed_id ); }
575 if ( p.first > p.second ||
578 p.first > c.size() ||
579 p.second > c.size() ) {
580 range_ = ConnsConstIterRange( c.end(), c.end() );
588 range_( c.
end(), c.
end() )
594 ss <<
"[SiStripFedCabling::ConnsRange::" << __func__ <<
"] Debug info:" << std::endl
595 <<
" Vector : " << std::endl
596 <<
" size : " <<
vector_.size() << std::endl
598 << std::hex << std::setfill(
'0') << std::setw(8)
600 << std::dec << std::endl
602 << std::hex << std::setfill(
'0') << std::setw(8)
604 << std::dec << std::endl
605 <<
" Range : " << std::endl
606 <<
" size : " <<
range_.size() << std::endl
608 << std::hex << std::setfill(
'0') << std::setw(8)
611 <<
" (dist=" << std::distance(
vector_.begin(),
range_.begin() ) <<
")"
614 << std::hex << std::setfill(
'0') << std::setw(8)
617 <<
" (dist=" << std::distance(
vector_.begin(),
range_.end() ) <<
")"
619 <<
" Offsets : " << std::endl
620 <<
" first : " <<
connsPair().first << std::endl
621 <<
" second : " <<
connsPair().second << std::endl;
627 std::stringstream ss;
640 static std::vector<FedChannelConnection> conns1(96,conn);
641 static std::vector<FedChannelConnection> conns2(96,conn);
643 if ( fed_id < FEDNumbering::getSiStripFEDIds().
first ||
644 fed_id > FEDNumbering::getSiStripFEDIds().
second ) {
return conns1; }
646 uint16_t index = fed_id - FEDNumbering::getSiStripFEDIds().first;
649 conns2.resize( conns.size() );
650 std::copy( conns.begin(), conns.end(), conns2.begin() );
652 }
else {
return conns1; }
665 uint16_t fed_ch )
const {
671 if ( fed_id < FEDNumbering::getSiStripFEDIds().
first ||
672 fed_id > FEDNumbering::getSiStripFEDIds().
second ) {
return conn; }
674 uint16_t index = fed_id - FEDNumbering::getSiStripFEDIds().first;
677 if ( conns.size() != 96 ) {
return conn; }
678 else if ( fed_ch > 95 ) {
return conn; }
679 else {
return *( conns.begin() + fed_ch ); }
680 }
else {
return conn; }
692 if (
feds_.empty() ) {
693 ss <<
"[SiStripFedCabling::" << __func__ <<
"]"
694 <<
" No FEDs found! Unable to print cabling map!";
697 ss <<
"[SiStripFedCabling::" << __func__ <<
"]"
698 <<
" Printing cabling map for " <<
feds_.size()
699 <<
" FEDs with following ids: ";
702 std::vector<uint16_t>::const_iterator ii =
feds_.begin();
703 std::vector<uint16_t>::const_iterator jj =
feds_.end();
704 for ( ; ii !=
jj; ++ii ) { ss << *ii <<
" "; }
705 ss << std::endl << std::endl;
707 std::vector<uint16_t>::const_iterator ifed =
feds_.begin();
708 std::vector<uint16_t>::const_iterator jfed =
feds_.end();
709 for ( ; ifed != jfed; ++ifed ) {
711 uint16_t index = *ifed - FEDNumbering::getSiStripFEDIds().first;
715 ss <<
" Printing cabling information for FED id " << *ifed
716 <<
" (found " << conns.size()
717 <<
" FedChannelConnection objects...)"
721 uint16_t connected = 0;
724 for ( ; iconn != jconn; ++iconn ) {
727 ss << *iconn << std::endl;
729 ss <<
" (FedId/Ch " << *ifed <<
"/" << ichan
730 <<
": unconnected channel...)" << std::endl;
736 ss <<
" Found " << connected
737 <<
" connected channels for FED id " << *ifed << std::endl
739 if ( connected ) { nfeds++; total += connected; }
745 float percent = (100.*cntr) / (96.*nfeds);
746 percent =
static_cast<uint16_t
>( 10.*percent );
748 ss <<
" Found " << total
749 <<
" APV pairs that are connected to a total of "
750 << nfeds <<
" FEDs" << std::endl
752 <<
" APV pairs have been detected, but are not connected" << std::endl
754 <<
" APV pairs are undetected (wrt DCU-DetId map)" << std::endl
756 <<
" FED channels out of a possible " << (96*nfeds)
757 <<
" (" << nfeds <<
" FEDs) are unconnected ("
758 << percent <<
"%)" << std::endl
768 ss <<
"[SiStripFedCabling::" << __func__ <<
"]";
770 if (
feds_.empty() ) {
771 ss <<
" No FEDs found! Unable to print cabling map!";
775 ss <<
" Printing cabling map for " <<
feds_.size()
776 <<
" FEDs: " << std::endl << std::endl;
778 std::vector<uint16_t>::const_iterator ifed =
feds_.begin();
779 std::vector<uint16_t>::const_iterator jfed =
feds_.end();
780 for ( ; ifed != jfed; ++ifed ) {
782 uint16_t index = *ifed - FEDNumbering::getSiStripFEDIds().first;
786 ss <<
" Printing cabling information for FED id " << *ifed
787 <<
" (found " << conns.size()
788 <<
" FedChannelConnection objects...)"
791 uint16_t connected = 0;
794 for ( ; iconn != jconn; ++iconn ) {
802 ss <<
" Found " << connected
803 <<
" connected channels for FED id " << *ifed << std::endl
816 ss <<
"[SiStripFedCabling::" << __func__ <<
"]";
818 if (
feds_.empty() ) {
819 ss <<
" No FEDs found!";
823 ss <<
" Found " <<
feds_.size() <<
" FEDs"
824 <<
" with number of connected channels per front-end unit: "
826 <<
" FedId FeUnit1 FeUnit2 FeUnit3 FeUnit4 FeUnit5 FeUnit6 FeUnit7 FeUnit8 Total"
833 std::vector<uint16_t>::const_iterator ii =
feds_.begin();
834 std::vector<uint16_t>::const_iterator jj =
feds_.end();
835 for ( ; ii !=
jj; ++ii ) {
838 uint16_t index = *ii - FEDNumbering::getSiStripFEDIds().first;
842 if ( conns.size() < 96 ) {
844 <<
"[SiStripFedCabling::" << __func__ <<
"]"
845 <<
" Unexpected size for FedChannelConnection vector! "
851 std::vector<uint16_t> connected;
852 connected.resize(8,0);
853 for ( uint16_t ichan = 0; ichan < 96; ++ichan ) {
857 if ( unit > 8 ) {
continue; }
864 ss <<
" " << std::setw(5) << *ii;
865 if ( !connected.empty() ) { nfeds++; }
867 ss <<
" " << std::setw(7) << connected[
unit];
868 if ( !connected.empty() ) { tot += connected[
unit]; }
870 ss <<
" " << std::setw(5) << tot << std::endl;
878 float percent = (100.*
total) / (96.*nfeds);
879 percent =
static_cast<uint16_t
>( 10.*percent );
881 ss <<
" Found: " << std::endl
882 <<
" " << nfeds <<
" out of " <<
feds_.size()
883 <<
" FEDs with at least one connected channel " << std::endl
884 <<
" " <<
feds_.size() - nfeds <<
" out of " <<
feds_.size()
885 <<
" FEDs with no connected channels." << std::endl
886 <<
" " << total <<
" connected channels in total" << std::endl
888 <<
" APV pairs have been detected, but are not connected" << std::endl
890 <<
" APV pairs are undetected (wrt DCU-DetId map)" << std::endl
892 <<
"% of FED channels are connected" << std::endl;
899 std::stringstream ss;
907 #else // SISTRIPCABLING_USING_NEW_INTERFACE ------------------------------------
921 <<
"[SiStripFedCabling::" << __func__ <<
"]"
922 <<
" Constructing object for vector of connections...";
923 buildFedCabling( ConnsConstIterRange( input.begin(),
937 static std::vector<FedChannelConnection>
output;
940 if ( !input.empty() ) {
941 output.resize( input.size() );
942 std::copy( input.begin(), input.end(), output.begin() );
950 uint16_t fed_ch )
const {
984 <<
"[SiStripFedCabling::" << __func__ <<
"]"
985 <<
" Constructing object from connection range...";
986 buildFedCabling( input );
992 : feds_( input.feds_ ),
993 registry_( input.registry_ ),
994 connections_( input.connections_ ),
995 detected_( input.detected_ ),
996 undetected_( input.undetected_ )
999 <<
"[SiStripFedCabling::" << __func__ <<
"]"
1000 <<
" Copy constructing object...";
1013 <<
"[SiStripFedCabling::" << __func__ <<
"]"
1014 <<
" Default constructing object...";
1021 <<
"[SiStripFedCabling::" << __func__ <<
"]"
1022 <<
" Destructing object...";
1030 if ( input.empty() ) {
1032 <<
"[SiStripFedCabling::" << __func__ <<
"]"
1033 <<
" Input vector of FedChannelConnections is of zero size!"
1034 <<
" Unable to populate FED cabling object!";
1038 std::stringstream ss;
1039 ss <<
"[SiStripFedCabling::" << __func__ <<
"]"
1040 <<
" Building FED cabling from "
1042 <<
" connections...";
1053 uint16_t nfeds = max_id - min_id + 1;
1065 for ( ; ii !=
jj; ++ii ) {
1067 uint16_t fed_id = ii->fedId();
1068 uint16_t fed_ch = ii->fedCh();
1069 uint16_t index = fed_id - min_id;
1071 if ( fed_id < min_id || fed_id > max_id ) {
continue; }
1072 if ( index >=
registry_.size() ) {
continue; }
1073 if ( !ii->isConnected() ) {
continue; }
1076 if ( iter ==
feds_.end() ) {
feds_.push_back( fed_id ); }
1101 if ( p.first > p.second ||
1104 p.first > c.size() ||
1105 p.second > c.size() ) {
1106 range_ = ConnsConstIterRange( c.end(), c.end() );
1114 range_( c.
end(), c.
end() )
1120 ss <<
"[SiStripFedCabling::ConnsRange::" << __func__ <<
"] Debug info:" << std::endl
1121 <<
" Vector : " << std::endl
1122 <<
" size : " <<
vector_.size() << std::endl
1124 << std::hex << std::setfill(
'0') << std::setw(8)
1126 << std::dec << std::endl
1128 << std::hex << std::setfill(
'0') << std::setw(8)
1130 << std::dec << std::endl
1131 <<
" Range : " << std::endl
1132 <<
" size : " <<
range_.size() << std::endl
1134 << std::hex << std::setfill(
'0') << std::setw(8)
1137 <<
" (dist=" << std::distance(
vector_.begin(),
range_.begin() ) <<
")"
1140 << std::hex << std::setfill(
'0') << std::setw(8)
1143 <<
" (dist=" << std::distance(
vector_.begin(),
range_.end() ) <<
")"
1145 <<
" Offsets : " << std::endl
1146 <<
" first : " <<
connsPair().first << std::endl
1147 <<
" second : " <<
connsPair().second << std::endl;
1153 std::stringstream ss;
1171 uint16_t fed_ch )
const {
1173 if ( !conns.empty() && conns.size() == 96 && fed_ch < 96 ) {
1174 return *( conns.begin() + fed_ch );
1186 if (
feds_.empty() ) {
1187 ss <<
"[SiStripFedCabling::" << __func__ <<
"]"
1188 <<
" No FEDs found! Unable to print cabling map!";
1191 ss <<
"[SiStripFedCabling::" << __func__ <<
"]"
1192 <<
" Printing cabling map for " <<
feds_.size()
1193 <<
" FEDs with following ids: ";
1196 std::vector<uint16_t>::const_iterator ii =
feds_.begin();
1197 std::vector<uint16_t>::const_iterator jj =
feds_.end();
1198 for ( ; ii !=
jj; ++ii ) { ss << *ii <<
" "; }
1199 ss << std::endl << std::endl;
1201 std::vector<uint16_t>::const_iterator ifed =
feds_.begin();
1202 std::vector<uint16_t>::const_iterator jfed =
feds_.end();
1203 for ( ; ifed != jfed; ++ifed ) {
1209 ss <<
" Printing cabling information for FED id " << *ifed
1210 <<
" (found " << conns.size()
1211 <<
" FedChannelConnection objects...)"
1215 uint16_t connected = 0;
1218 for ( ; iconn != jconn; ++iconn ) {
1221 ss << *iconn << std::endl;
1223 ss <<
" (FedId/Ch " << *ifed <<
"/" << ichan
1224 <<
": unconnected channel...)" << std::endl;
1230 ss <<
" Found " << connected
1231 <<
" connected channels for FED id " << *ifed << std::endl
1233 if ( connected ) { nfeds++; total += connected; }
1239 float percent = (100.*cntr) / (96.*nfeds);
1240 percent =
static_cast<uint16_t
>( 10.*percent );
1242 ss <<
" Found " << total
1243 <<
" APV pairs that are connected to a total of "
1244 << nfeds <<
" FEDs" << std::endl
1246 <<
" APV pairs have been detected, but are not connected" << std::endl
1248 <<
" APV pairs are undetected (wrt DCU-DetId map)" << std::endl
1250 <<
" FED channels out of a possible " << (96*nfeds)
1251 <<
" (" << nfeds <<
" FEDs) are unconnected ("
1252 << percent <<
"%)" << std::endl
1262 ss <<
"[SiStripFedCabling::" << __func__ <<
"]";
1264 if (
feds_.empty() ) {
1265 ss <<
" No FEDs found! Unable to print cabling map!";
1269 ss <<
" Printing cabling map for " <<
feds_.size()
1270 <<
" FEDs: " << std::endl << std::endl;
1272 std::vector<uint16_t>::const_iterator ifed =
feds_.begin();
1273 std::vector<uint16_t>::const_iterator jfed =
feds_.end();
1274 for ( ; ifed != jfed; ++ifed ) {
1280 ss <<
" Printing cabling information for FED id " << *ifed
1281 <<
" (found " << conns.size()
1282 <<
" FedChannelConnection objects...)"
1285 uint16_t connected = 0;
1288 for ( ; iconn != jconn; ++iconn ) {
1296 ss <<
" Found " << connected
1297 <<
" connected channels for FED id " << *ifed << std::endl
1310 ss <<
"[SiStripFedCabling::" << __func__ <<
"]";
1312 if (
feds_.empty() ) {
1313 ss <<
" No FEDs found!";
1317 ss <<
" Found " <<
feds_.size() <<
" FEDs"
1318 <<
" with number of connected channels per front-end unit: "
1320 <<
" FedId FeUnit1 FeUnit2 FeUnit3 FeUnit4 FeUnit5 FeUnit6 FeUnit7 FeUnit8 Total"
1327 std::vector<uint16_t>::const_iterator ii =
feds_.begin();
1328 std::vector<uint16_t>::const_iterator jj =
feds_.end();
1329 for ( ; ii !=
jj; ++ii ) {
1336 if ( conns.size() < 96 ) {
1338 <<
"[SiStripFedCabling::" << __func__ <<
"]"
1339 <<
" Unexpected size for FedChannelConnection vector! "
1345 std::vector<uint16_t> connected;
1346 connected.resize(8,0);
1347 for ( uint16_t ichan = 0; ichan < 96; ++ichan ) {
1351 if ( unit > 8 ) {
continue; }
1352 connected[unit-1]++;
1358 ss <<
" " << std::setw(5) << *ii;
1359 if ( !connected.empty() ) { nfeds++; }
1361 ss <<
" " << std::setw(7) << connected[
unit];
1362 if ( !connected.empty() ) { tot += connected[
unit]; }
1364 ss <<
" " << std::setw(5) << tot << std::endl;
1372 float percent = (100.*
total) / (96.*nfeds);
1373 percent =
static_cast<uint16_t
>( 10.*percent );
1375 ss <<
" Found: " << std::endl
1376 <<
" " << nfeds <<
" out of " <<
feds_.size()
1377 <<
" FEDs with at least one connected channel " << std::endl
1378 <<
" " <<
feds_.size() - nfeds <<
" out of " <<
feds_.size()
1379 <<
" FEDs with no connected channels." << std::endl
1380 <<
" " << total <<
" connected channels in total" << std::endl
1382 <<
" APV pairs have been detected, but are not connected" << std::endl
1384 <<
" APV pairs are undetected (wrt DCU-DetId map)" << std::endl
1386 <<
"% of FED channels are connected" << std::endl;
1393 std::stringstream ss;
1401 #endif // SISTRIPCABLING_USING_NEW_INTERFACE -----------------------------------
1402 #endif // SISTRIPCABLING_USING_NEW_STRUCTURE -----------------------------------
ConnsConstIterRange vector_
void print(std::stringstream &) const
ConnsConstIterRange range() const
const std::vector< uint16_t > & feds() const
Conns connections_
Container of connection objects.
Feds feds_
"Active" FEDs that have connected FE devices
std::pair< uint32_t, uint32_t > ConnsPair
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
static const uint32_t invalid32_
void terse(std::stringstream &) const
static const uint16_t CMS_FED_ID_MAX
void printSummary(std::stringstream &) const
Builds range of iterators from pair of offsets.
const FedChannelConnection & connection(uint16_t fed_id, uint16_t fed_ch) const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
static const uint16_t valid_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Registry registry_
Container of "ranges" indexed by FED id.
Conns::iterator ConnsIter
Conns undetected_
FE devices that are detected.
U second(std::pair< T, U > const &p)
static const char mlCabling_[]
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
void buildFedCabling(const std::vector< FedChannelConnection > &)
static ConnsPair emptyPair()
ConnsPair connsPair() const
Class containning control, module, detector and connection information, at the level of a FED channel...
Conns detected_
Connections to FE devices that are not detected.
void print(std::stringstream &ss) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTDEBUG.
void summary(std::stringstream &ss) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
ConnsConstIterRange invalid() const
Feds::const_iterator FedsConstIter
const std::vector< FedChannelConnection > & undetected() const
ConnsRange range(ConnsPair) const
Builds range of iterators from pair of offsets.
const uint16_t & feUnit() const
const std::vector< FedChannelConnection > & detected() const
ConnsConstIterRange fedConnections(uint16_t fed_id) const
static const uint16_t invalid_
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
ConnsConstIterRange range_
std::vector< FedChannelConnection > Conns
static const uint16_t FEDCH_PER_FED
Conns::const_iterator ConnsConstIter
void printDebug(std::stringstream &) const
tuple size
Write out results.
const std::vector< FedChannelConnection > & connections(uint16_t fed_id) const