17 <<
"[SiStripFecCabling::" << __func__ <<
"]" 18 <<
" Constructing object...";
27 <<
"[SiStripFecCabling::" << __func__ <<
"]" 28 <<
" Building FEC cabling...";
31 auto feds = fed_cabling.
fedIds();
32 for (
auto ifed = feds.begin(); ifed != feds.end(); ifed++ ) {
36 for (
auto iconn = conns.begin(); iconn != conns.end(); iconn++ ) {
45 for ( std::vector<SiStripFecCrate>::const_iterator icrate = this->
crates().
begin(); icrate != this->
crates().end(); ++icrate ) {
46 for ( std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ++ifec ) {
47 for ( std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); ++iring ) {
48 for ( std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); ++iccu ) {
49 for ( std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); ++imod ) {
57 <<
"[SiStripFecCabling::" << __func__ <<
"]" 58 <<
" Finished building FEC cabling";
65 while ( icrate !=
crates_.end() && (*icrate).fecCrate() != conn.
fecCrate() ) { icrate++; }
66 if ( icrate ==
crates_.end() ) {
69 icrate->addDevices( conn );
77 <<
"[SiStripFecCabling::" << __func__ <<
"]" 78 <<
" Building vector of FedChannelConnection objects...";
80 for ( std::vector<SiStripFecCrate>::const_iterator icrate = this->
crates().
begin(); icrate != this->
crates().end(); ++icrate ) {
81 for ( std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ++ifec ) {
82 for ( std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); ++iring ) {
83 for ( std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); ++iccu ) {
84 for ( std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); ++imod ) {
85 for ( uint16_t ipair = 0; ipair < imod->nApvPairs(); ipair++ ) {
91 imod->activeApvPair( imod->lldChannel(ipair) ).
first,
92 imod->activeApvPair( imod->lldChannel(ipair) ).
second,
96 imod->fedCh(ipair).fedId_,
97 imod->fedCh(ipair).fedCh_,
103 uint16_t fed_crate = imod->fedCh(ipair).fedCrate_;
104 uint16_t fed_slot = imod->fedCh(ipair).fedSlot_;
105 conns.back().fedCrate( fed_crate );
106 conns.back().fedSlot( fed_slot );
121 std::stringstream ss;
122 auto icrate = crates.begin();
123 while ( icrate != crates.end() && icrate->fecCrate() != conn.
fecCrate() ) { icrate++; }
124 if ( icrate != crates.end() ) {
125 auto ifec = icrate->fecs().begin();
126 while ( ifec != icrate->fecs().end() && ifec->fecSlot() != conn.
fecSlot() ) { ifec++; }
127 if ( ifec != icrate->fecs().end() ) {
128 auto iring = ifec->rings().begin();
129 while ( iring != ifec->rings().end() && iring->fecRing() != conn.
fecRing() ) { iring++; }
130 if ( iring != ifec->rings().end() ) {
131 auto iccu = iring->ccus().begin();
132 while ( iccu != iring->ccus().end() && iccu->ccuAddr() != conn.
ccuAddr() ) { iccu++; }
133 if ( iccu != iring->ccus().end() ) {
134 auto imod = iccu->modules().begin();
135 while ( imod != iccu->modules().end() && imod->ccuChan() != conn.
ccuChan() ) { imod++; }
136 if ( imod != iccu->modules().end() ) {
139 ss <<
"[SiStripFecCabling::" << __func__ <<
"]" 140 <<
" CCU channel " << conn.
ccuChan()
143 ss <<
"[SiStripFecCabling::" << __func__ <<
"]" 144 <<
" CCU address " << conn.
ccuAddr()
147 ss <<
"[SiStripFecCabling::" << __func__ <<
"]" 148 <<
" FEC ring " << conn.
fecRing()
151 ss <<
"[SiStripFecCabling::" << __func__ <<
"]" 152 <<
" FEC slot " << conn.
fecSlot()
155 ss <<
"[SiStripFecCabling::" << __func__ <<
"]" 176 return moduleFrom(
crates(), conn);
183 for ( std::vector<SiStripFecCrate>::const_iterator icrate = this->
crates().
begin(); icrate != this->
crates().end(); ++icrate ) {
184 for ( std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ++ifec ) {
185 for ( std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); ++iring ) {
186 for ( std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); ++iccu ) {
187 for ( std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); ++imod ) {
188 if ( (*imod).dcuId() == dcu_id ) {
return *imod; }
204 std::vector<uint16_t> fed_crates;
205 std::vector<uint16_t> fed_slots;
206 std::vector<uint16_t> fed_ids;
207 for ( std::vector<SiStripFecCrate>::const_iterator icrate = this->
crates().
begin(); icrate != this->
crates().end(); ++icrate ) {
208 for ( std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ++ifec ) {
209 for ( std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); ++iring ) {
210 for ( std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); ++iccu ) {
211 for ( std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); ++imod ) {
214 if ( imod->activeApv(32) ) { num_of_devices.
nApvs_++; }
215 if ( imod->activeApv(33) ) { num_of_devices.
nApvs_++; }
216 if ( imod->activeApv(34) ) { num_of_devices.
nApvs_++; }
217 if ( imod->activeApv(35) ) { num_of_devices.
nApvs_++; }
218 if ( imod->activeApv(36) ) { num_of_devices.
nApvs_++; }
219 if ( imod->activeApv(37) ) { num_of_devices.
nApvs_++; }
220 if ( imod->dcuId() ) { num_of_devices.
nDcuIds_++; }
221 if ( imod->detId() ) { num_of_devices.
nDetIds_++; }
224 num_of_devices.
nApvPairs_ += imod->nApvPairs();
225 if ( imod->nApvPairs() == 0 ) { num_of_devices.
nApvPairs0_++; }
226 else if ( imod->nApvPairs() == 1 ) { num_of_devices.
nApvPairs1_++; }
227 else if ( imod->nApvPairs() == 2 ) { num_of_devices.
nApvPairs2_++; }
228 else if ( imod->nApvPairs() == 3 ) { num_of_devices.
nApvPairs3_++; }
232 for ( uint16_t ipair = 0; ipair < imod->nApvPairs(); ipair++ ) {
234 uint16_t fed_crate = imod->fedCh(ipair).fedCrate_;
235 uint16_t fed_slot = imod->fedCh(ipair).fedSlot_;
236 uint16_t fed_id = imod->fedCh(ipair).fedId_;
242 std::vector<uint16_t>::iterator icrate =
find( fed_crates.begin(), fed_crates.end(), fed_crate );
243 if ( icrate == fed_crates.end() ) {
245 fed_crates.push_back(fed_crate);
248 std::vector<uint16_t>::iterator islot =
find( fed_slots.begin(), fed_slots.end(), fed_slot );
249 if ( islot == fed_slots.end() ) {
251 fed_slots.push_back(fed_slot);
254 std::vector<uint16_t>::iterator ifed =
find( fed_ids.begin(), fed_ids.end(), fed_id );
255 if ( ifed == fed_ids.end() ) {
257 fed_ids.push_back(fed_id);
265 if ( imod->dcu() ) { num_of_devices.
nDcus_++; }
266 if ( imod->mux() ) { num_of_devices.
nMuxes_++; }
267 if ( imod->pll() ) { num_of_devices.
nPlls_++; }
268 if ( imod->lld() ) { num_of_devices.
nLlds_++; }
282 return num_of_devices;
291 ss <<
"[SiStripFecCabling::" << __func__ <<
"] Printing FEC cabling:" << std::endl;
292 ss <<
"Printing cabling for " <<
crates().size() <<
" crates" << std::endl;
293 for ( std::vector<SiStripFecCrate>::const_iterator icrate =
crates().
begin(); icrate !=
crates().end(); ++icrate ) {
294 ss <<
"Printing cabling for " << icrate->fecs().size() <<
" FECs for crate " << icrate->fecCrate() << std::endl;
295 for ( std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ++ifec ) {
296 ss <<
"Printing cabling for " << ifec->rings().size() <<
" rings for FEC " << ifec->fecSlot() << std::endl;
297 for ( std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); ++iring ) {
298 ss <<
"Printing cabling for " << iring->ccus().size() <<
" CCUs for ring " << iring->fecRing() << std::endl;
299 for ( std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); ++iccu ) {
300 ss <<
"Printing cabling for " << iccu->modules().size() <<
" modules for CCU " << iccu->ccuAddr() << std::endl;
301 for ( std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); ++imod ) {
304 SiStripModule::FedCabling::const_iterator
ii = conns.begin();
305 SiStripModule::FedCabling::const_iterator
jj = conns.end();
306 for ( ; ii !=
jj; ++
ii ) {
311 ss << *imod << std::endl;
317 ss <<
"Number of connected: " << valid << std::endl
318 <<
"Number of connections: " << total << std::endl;
324 ss <<
"[SiStripFecCabling::" << __func__ <<
"] Printing FEC cabling:" << std::endl;
325 for ( std::vector<SiStripFecCrate>::const_iterator icrate =
crates().
begin(); icrate !=
crates().end(); ++icrate ) {
326 for ( std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ++ifec ) {
327 for ( std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end(); ++iring ) {
328 for ( std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end(); ++iccu ) {
329 for ( std::vector<SiStripModule>::const_iterator imod = iccu->modules().begin(); imod != iccu->modules().end(); ++imod ) {
342 std::stringstream ss;
const uint16_t & fecSlot() const
Device and connection information at the level of a front-end module.
const uint16_t & fecCrate() const
const SiStripModule & module(const FedChannelConnection &conn) const
const std::vector< SiStripFec > & fecs() const
void addDevices(const FedChannelConnection &conn)
std::vector< SiStripFecCrate > crates_
void terse(std::stringstream &) const
std::ostream & operator<<(std::ostream &os, const SiStripFecCabling &cabling)
const std::vector< SiStripFecCrate > & crates() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
U second(std::pair< T, U > const &p)
static const char mlCabling_[]
const uint16_t & fecRing() const
void connections(std::vector< FedChannelConnection > &) const
Class containning control, module, detector and connection information, at the level of a FED channel...
FedsConstIterRange fedIds() const
const uint16_t & ccuChan() const
void print(std::stringstream &) const
const uint16_t & ccuAddr() const
void buildFecCabling(const SiStripFedCabling &)
Simple container class for counting devices.
static const uint16_t invalid_
ConnsConstIterRange fedConnections(uint16_t fed_id) const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
std::map< uint16_t, FedChannel > FedCabling
NumberOfDevices countDevices() const