13 : feds_(), registry_(), connections_(), detected_(), undetected_() {
15 <<
" Constructing object from connection range...";
23 registry_(
input.registry_),
24 connections_(
input.connections_),
25 detected_(
input.detected_),
26 undetected_(
input.undetected_) {
28 <<
" Copy constructing object...";
35 <<
" Default constructing object...";
42 <<
" Destructing object...";
51 <<
" Input vector of FedChannelConnections is of zero size!" 52 <<
" Unable to populate FED cabling object!";
57 ss <<
"[SiStripFedCabling::" << __func__ <<
"]" 58 <<
" Building FED cabling from " <<
input.size() <<
" connections...";
69 uint16_t nfeds = max_id - min_id + 1;
82 uint16_t fed_id =
ii->fedId();
83 uint16_t fed_ch =
ii->fedCh();
84 uint16_t
index = fed_id - min_id;
86 if (fed_id < min_id || fed_id > max_id) {
92 if (!
ii->isConnected()) {
97 if (iter ==
feds_.end()) {
98 feds_.push_back(fed_id);
121 p.second >
c.size()) {
133 ss <<
"[SiStripFedCabling::ConnsRange::" << __func__ <<
"] Debug info:" << std::endl
134 <<
" Vector : " << std::endl
135 <<
" size : " << vector_.size() << std::endl
136 <<
" begin : " << std::hex << std::setfill(
'0') << std::setw(8) << &*vector_.begin() <<
std::dec << std::endl
137 <<
" end : " << std::hex << std::setfill(
'0') << std::setw(8) << &*vector_.end() <<
std::dec << std::endl
138 <<
" Range : " << std::endl
139 <<
" size : " << range_.size() << std::endl
140 <<
" begin : " << std::hex << std::setfill(
'0') << std::setw(8) << &*range_.begin() <<
std::dec 141 <<
" (dist=" <<
std::distance(vector_.begin(), range_.begin()) <<
")" << std::endl
142 <<
" end : " << std::hex << std::setfill(
'0') << std::setw(8) << &*range_.end() <<
std::dec 143 <<
" (dist=" <<
std::distance(vector_.begin(), range_.end()) <<
")" << std::endl
144 <<
" Offsets : " << std::endl
145 <<
" first : " << connsPair().first << std::endl
146 <<
" second : " << connsPair().second << std::endl;
152 std::stringstream
ss;
173 if (!conns.empty() && conns.size() == 96 && fed_ch < 96) {
174 return *(conns.begin() + fed_ch);
188 ss <<
"[SiStripFedCabling::" << __func__ <<
"]" 189 <<
" No FEDs found! Unable to print cabling map!";
192 ss <<
"[SiStripFedCabling::" << __func__ <<
"]" 193 <<
" Printing cabling map for " <<
feds_.size() <<
" FEDs with following ids: ";
196 std::vector<uint16_t>::const_iterator
ii =
feds_.begin();
197 std::vector<uint16_t>::const_iterator
jj =
feds_.end();
201 ss << std::endl << std::endl;
203 std::vector<uint16_t>::const_iterator ifed =
feds_.begin();
204 std::vector<uint16_t>::const_iterator jfed =
feds_.end();
205 for (; ifed != jfed; ++ifed) {
210 ss <<
" Printing cabling information for FED id " << *ifed <<
" (found " << conns.
size()
211 <<
" FedChannelConnection objects...)" << std::endl;
214 uint16_t connected = 0;
217 for (; iconn != jconn; ++iconn) {
220 ss << *iconn << std::endl;
222 ss <<
" (FedId/Ch " << *ifed <<
"/" << ichan <<
": unconnected channel...)" << std::endl;
228 ss <<
" Found " << connected <<
" connected channels for FED id " << *ifed << std::endl << std::endl;
236 float percent = (100. * cntr) / (96. * nfeds);
237 percent =
static_cast<uint16_t
>(10. * percent);
239 ss <<
" Found " <<
total <<
" APV pairs that are connected to a total of " << nfeds <<
" FEDs" << std::endl
240 <<
" " <<
detected_.size() <<
" APV pairs have been detected, but are not connected" << std::endl
241 <<
" " <<
undetected_.size() <<
" APV pairs are undetected (wrt DCU-DetId map)" << std::endl
242 <<
" " << cntr <<
" FED channels out of a possible " << (96 * nfeds) <<
" (" << nfeds <<
" FEDs) are unconnected (" 243 << percent <<
"%)" << std::endl
250 ss <<
"[SiStripFedCabling::" << __func__ <<
"]";
253 ss <<
" No FEDs found! Unable to print cabling map!";
257 ss <<
" Printing cabling map for " <<
feds_.size() <<
" FEDs: " << std::endl << std::endl;
259 std::vector<uint16_t>::const_iterator ifed =
feds_.begin();
260 std::vector<uint16_t>::const_iterator jfed =
feds_.end();
261 for (; ifed != jfed; ++ifed) {
266 ss <<
" Printing cabling information for FED id " << *ifed <<
" (found " << conns.
size()
267 <<
" FedChannelConnection objects...)" << std::endl;
269 uint16_t connected = 0;
272 for (; iconn != jconn; ++iconn) {
280 ss <<
" Found " << connected <<
" connected channels for FED id " << *ifed << std::endl << std::endl;
288 ss <<
"[SiStripFedCabling::" << __func__ <<
"]";
291 ss <<
" No FEDs found!";
295 ss <<
" Found " <<
feds_.size() <<
" FEDs" 296 <<
" with number of connected channels per front-end unit: " << std::endl
297 <<
" FedId FeUnit1 FeUnit2 FeUnit3 FeUnit4 FeUnit5 FeUnit6 FeUnit7 FeUnit8 Total" << std::endl;
303 std::vector<uint16_t>::const_iterator
ii =
feds_.begin();
304 std::vector<uint16_t>::const_iterator
jj =
feds_.end();
311 if (conns.
size() < 96) {
313 <<
" Unexpected size for FedChannelConnection vector! " << conns.
size();
318 std::vector<uint16_t> connected;
319 connected.resize(8, 0);
320 for (uint16_t ichan = 0; ichan < 96; ++ichan) {
327 connected[
unit - 1]++;
333 ss <<
" " << std::setw(5) << *
ii;
334 if (!connected.empty()) {
338 ss <<
" " << std::setw(7) << connected[
unit];
339 if (!connected.empty()) {
343 ss <<
" " << std::setw(5) <<
tot << std::endl;
349 float percent = (100. *
total) / (96. * nfeds);
350 percent =
static_cast<uint16_t
>(10. * percent);
352 ss <<
" Found: " << std::endl
353 <<
" " << nfeds <<
" out of " <<
feds_.size() <<
" FEDs with at least one connected channel " << std::endl
354 <<
" " <<
feds_.size() - nfeds <<
" out of " <<
feds_.size() <<
" FEDs with no connected channels." << std::endl
355 <<
" " <<
total <<
" connected channels in total" << std::endl
356 <<
" " <<
detected_.size() <<
" APV pairs have been detected, but are not connected" << std::endl
357 <<
" " <<
undetected_.size() <<
" APV pairs are undetected (wrt DCU-DetId map)" << std::endl
358 <<
" " << percent <<
"% of FED channels are connected" << std::endl;
ConnsConstIter begin() const
Conns connections_
Container of connection objects.
Feds feds_
"Active" FEDs that have connected FE devices
const uint16_t & feUnit() const
static const uint32_t invalid32_
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
Builds range of iterators from pair of offsets.
Log< level::Error, false > LogError
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
ConnsConstIter end() const
Conns undetected_
FE devices that are detected.
static std::string const input
U second(std::pair< T, U > const &p)
static const char mlCabling_[]
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
static ConnsPair emptyPair()
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.
std::ostream & operator<<(std::ostream &os, const SiStripFedCabling::ConnsRange &input)
Feds::const_iterator FedsConstIter
void printSummary(std::stringstream &, const TrackerTopology *trackerTopo) const
Basic3DVector unit() const
void buildFedCabling(ConnsConstIterRange connections)
ConnsRange range(ConnsPair) const
Builds range of iterators from pair of offsets.
void printDebug(std::stringstream &, const TrackerTopology *trackerTopo) const
void terse(std::stringstream &) 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
std::pair< uint32_t, uint32_t > ConnsPair
ConnsConstIterRange invalid() const
Conns::const_iterator ConnsConstIter
void print(std::stringstream &) const
ConnsConstIterRange fedConnections(uint16_t fed_id) const
ConnsConstIterRange range() const