CMS 3D CMS Logo

SiStripFecKey.cc
Go to the documentation of this file.
1 
9 #include <iomanip>
10 
11 // -----------------------------------------------------------------------------
12 //
13 SiStripFecKey::SiStripFecKey( const uint16_t& fec_crate,
14  const uint16_t& fec_slot,
15  const uint16_t& fec_ring,
16  const uint16_t& ccu_addr,
17  const uint16_t& ccu_chan,
18  const uint16_t& lld_chan,
19  const uint16_t& i2c_addr ) :
20  SiStripKey(),
21  fecCrate_(fec_crate),
22  fecSlot_(fec_slot),
23  fecRing_(fec_ring),
24  ccuAddr_(ccu_addr),
25  ccuChan_(ccu_chan),
26  lldChan_(lld_chan),
27  i2cAddr_(i2c_addr)
28 {
29  // order is important!
30  initFromValue();
31  initFromKey();
32  initFromPath();
34 }
35 
36 // -----------------------------------------------------------------------------
37 //
38 SiStripFecKey::SiStripFecKey( const uint32_t& fec_key ) :
39  SiStripKey(fec_key),
47 {
48  // order is important!
49  initFromKey();
50  initFromValue();
51  initFromPath();
53 }
54 
55 // -----------------------------------------------------------------------------
56 //
58  SiStripKey(path),
66 {
67  // order is important!
68  initFromPath();
69  initFromValue();
70  initFromKey();
72 }
73 
74 // -----------------------------------------------------------------------------
75 //
77  SiStripKey(),
78  fecCrate_(input.fecCrate()),
79  fecSlot_(input.fecSlot()),
80  fecRing_(input.fecRing()),
81  ccuAddr_(input.ccuAddr()),
82  ccuChan_(input.ccuChan()),
83  lldChan_(input.lldChan()),
84  i2cAddr_(input.i2cAddr())
85 {
86  key(input.key());
87  path(input.path());
88  granularity(input.granularity());
89 }
90 
91 // -----------------------------------------------------------------------------
92 //
94  SiStripKey(),
102 {
103  const SiStripFecKey& fec_key = dynamic_cast<const SiStripFecKey&>(input);
104  key(fec_key.key());
105  path(fec_key.path());
106  granularity(fec_key.granularity());
107  fecCrate_ = fec_key.fecCrate();
108  fecSlot_ = fec_key.fecSlot();
109  fecRing_ = fec_key.fecRing();
110  ccuAddr_ = fec_key.ccuAddr();
111  ccuChan_ = fec_key.ccuChan();
112  lldChan_ = fec_key.lldChan();
113  i2cAddr_ = fec_key.i2cAddr();
114 }
115 
116 // -----------------------------------------------------------------------------
117 //
119  const sistrip::Granularity& gran ) :
120  SiStripKey(),
121  fecCrate_(0),
122  fecSlot_(0),
123  fecRing_(0),
124  ccuAddr_(0),
125  ccuChan_(0),
126  lldChan_(0),
127  i2cAddr_(0)
128 {
129  const SiStripFecKey& fec_key = dynamic_cast<const SiStripFecKey&>(input);
130  if ( gran == sistrip::FEC_CRATE || gran == sistrip::FEC_SLOT ||
131  gran == sistrip::FEC_RING || gran == sistrip::CCU_ADDR ||
132  gran == sistrip::CCU_CHAN || gran == sistrip::LLD_CHAN ||
133  gran == sistrip::APV ) {
134  fecCrate_ = fec_key.fecCrate();
135  }
136 
137  if ( gran == sistrip::FEC_SLOT || gran == sistrip::FEC_RING ||
138  gran == sistrip::CCU_ADDR || gran == sistrip::CCU_CHAN ||
139  gran == sistrip::LLD_CHAN || gran == sistrip::APV ) {
140  fecSlot_ = fec_key.fecSlot();
141  }
142 
143  if ( gran == sistrip::FEC_RING || gran == sistrip::CCU_ADDR ||
144  gran == sistrip::CCU_CHAN || gran == sistrip::LLD_CHAN ||
145  gran == sistrip::APV ) {
146  fecRing_ = fec_key.fecRing();
147  }
148 
149  if ( gran == sistrip::CCU_ADDR || gran == sistrip::CCU_CHAN ||
150  gran == sistrip::LLD_CHAN || gran == sistrip::APV ) {
151  ccuAddr_ = fec_key.ccuAddr();
152  }
153 
154  if ( gran == sistrip::CCU_CHAN || gran == sistrip::LLD_CHAN ||
155  gran == sistrip::APV ) {
156  ccuChan_ = fec_key.ccuChan();
157  }
158 
159  if ( gran == sistrip::LLD_CHAN || gran == sistrip::APV ) {
160  lldChan_ = fec_key.lldChan();
161  }
162 
163  if ( gran == sistrip::APV ) {
164  i2cAddr_ = fec_key.i2cAddr();
165  }
166 
167  initFromValue();
168  initFromKey();
169  initFromPath();
170  initGranularity();
171 }
172 
173 // -----------------------------------------------------------------------------
174 //
176  SiStripKey(),
184 {;}
185 
186 // -----------------------------------------------------------------------------
187 //
188 uint16_t SiStripFecKey::hybridPos( const uint16_t& i2c_addr ) {
189  if ( i2c_addr < sistrip::APV_I2C_MIN ||
190  i2c_addr > sistrip::APV_I2C_MAX ) {
191  return sistrip::invalid_;
192  }
193  return ( i2c_addr - sistrip::APV_I2C_MIN + 1 );
194 }
195 
196 // -----------------------------------------------------------------------------
197 //
198 uint16_t SiStripFecKey::i2cAddr( const uint16_t& hybrid_pos ) {
199  if ( !hybrid_pos ||
200  hybrid_pos >
202  sistrip::APV_I2C_MIN + 1 ) ) {
203  return sistrip::invalid_;
204  }
205  return ( hybrid_pos + sistrip::APV_I2C_MIN - 1 );
206 }
207 
208 // -----------------------------------------------------------------------------
209 //
210 uint16_t SiStripFecKey::i2cAddr( const uint16_t& lld_chan,
211  const bool& first_apv ) {
212  if ( lld_chan < sistrip::LLD_CHAN_MIN ||
213  lld_chan > sistrip::LLD_CHAN_MAX ) {
214  return sistrip::invalid_;
215  }
216  return ( sistrip::APV_I2C_MIN + lld_chan * sistrip::APVS_PER_CHAN - (first_apv?2:1) );
217 }
218 
219 // -----------------------------------------------------------------------------
220 //
221 uint16_t SiStripFecKey::lldChan( const uint16_t& i2c_addr ) {
222  if ( i2c_addr == 0 ) { return 0; }
223  else if ( i2c_addr < sistrip::APV_I2C_MIN ||
224  i2c_addr > sistrip::APV_I2C_MAX ) {
225  return sistrip::invalid_;
226  }
227  return ( ( i2c_addr - sistrip::APV_I2C_MIN ) / 2 + 1 );
228 }
229 
230 // -----------------------------------------------------------------------------
231 //
232 bool SiStripFecKey::firstApvOfPair( const uint16_t& i2c_addr ) {
233  if ( i2c_addr < sistrip::APV_I2C_MIN ||
234  i2c_addr > sistrip::APV_I2C_MAX ) {
235  return sistrip::invalid_;
236  }
237  return ( ( ( i2c_addr - sistrip::APV_I2C_MIN ) % 2 ) == 0 );
238 }
239 
240 // -----------------------------------------------------------------------------
241 //
242 bool SiStripFecKey::isEqual( const SiStripKey& key ) const {
243  const SiStripFecKey& input = dynamic_cast<const SiStripFecKey&>(key);
244  if ( fecCrate_ == input.fecCrate() &&
245  fecSlot_ == input.fecSlot() &&
246  fecRing_ == input.fecRing() &&
247  ccuAddr_ == input.ccuAddr() &&
248  ccuChan_ == input.ccuChan() &&
249  lldChan_ == input.lldChan() &&
250  i2cAddr_ == input.i2cAddr() ) {
251  return true;
252  } else { return false; }
253 }
254 
255 // -----------------------------------------------------------------------------
256 //
258  const SiStripFecKey& input = dynamic_cast<const SiStripFecKey&>(key);
259  if ( isEqual(input) ) { return true; }
260  else if ( ( fecCrate_ == 0 || input.fecCrate() == 0 ) &&
261  ( fecSlot_ == 0 || input.fecSlot() == 0 ) &&
262  ( fecRing_ == 0 || input.fecRing() == 0 ) &&
263  ( ccuAddr_ == 0 || input.ccuAddr() == 0 ) &&
264  ( lldChan_ == 0 || input.lldChan() == 0 ) &&
265  ( i2cAddr_ == 0 || input.i2cAddr() == 0 ) ) {
266  return true;
267  } else { return false; }
268 }
269 
270 // -----------------------------------------------------------------------------
271 //
272 bool SiStripFecKey::isValid() const {
273  return isValid(sistrip::APV);
274 }
275 
276 // -----------------------------------------------------------------------------
277 //
278 bool SiStripFecKey::isValid( const sistrip::Granularity& gran ) const {
279  if ( gran == sistrip::FEC_SYSTEM ) { return true; }
280  else if ( gran == sistrip::UNDEFINED_GRAN ||
281  gran == sistrip::UNKNOWN_GRAN ) { return false; }
282 
283  if ( fecCrate_ != sistrip::invalid_ ) {
284  if ( gran == sistrip::FEC_CRATE ) { return true; }
285  if ( fecSlot_ != sistrip::invalid_ ) {
286  if ( gran == sistrip::FEC_RING ) { return true; }
287  if ( fecRing_ != sistrip::invalid_ ) {
288  if ( gran == sistrip::FEC_RING ) { return true; }
289  if ( ccuAddr_ != sistrip::invalid_ ) {
290  if ( gran == sistrip::CCU_ADDR ) { return true; }
291  if ( ccuChan_ != sistrip::invalid_ ) {
292  if ( gran == sistrip::CCU_CHAN ) { return true; }
293  if ( lldChan_ != sistrip::invalid_ ) {
294  if ( gran == sistrip::LLD_CHAN ) { return true; }
295  if ( i2cAddr_ != sistrip::invalid_ ) {
296  if ( gran == sistrip::APV ) { return true; }
297  }
298  }
299  }
300  }
301  }
302  }
303  }
304  return false;
305 }
306 
307 // -----------------------------------------------------------------------------
308 //
310  return isInvalid(sistrip::APV);
311 }
312 
313 // -----------------------------------------------------------------------------
314 //
316  if ( gran == sistrip::FEC_SYSTEM ) { return false; }
317  else if ( gran == sistrip::UNDEFINED_GRAN ||
318  gran == sistrip::UNKNOWN_GRAN ) { return false; }
319 
320  if ( fecCrate_ == sistrip::invalid_ ) {
321  if ( gran == sistrip::FEC_CRATE ) { return true; }
322  if ( fecSlot_ == sistrip::invalid_ ) {
323  if ( gran == sistrip::FEC_RING ) { return true; }
324  if ( fecRing_ == sistrip::invalid_ ) {
325  if ( gran == sistrip::FEC_RING ) { return true; }
326  if ( ccuAddr_ == sistrip::invalid_ ) {
327  if ( gran == sistrip::CCU_ADDR ) { return true; }
328  if ( ccuChan_ == sistrip::invalid_ ) {
329  if ( gran == sistrip::CCU_CHAN ) { return true; }
330  if ( lldChan_ == sistrip::invalid_ ) {
331  if ( gran == sistrip::LLD_CHAN ) { return true; }
332  if ( i2cAddr_ == sistrip::invalid_ ) {
333  if ( gran == sistrip::APV ) { return true; }
334  }
335  }
336  }
337  }
338  }
339  }
340  }
341  return false;
342 }
343 
344 // -----------------------------------------------------------------------------
345 //
347 
348  // FEC crate
349  if ( not ( (fecCrate_ >= sistrip::FEC_CRATE_MIN &&
351  (fecCrate_ == 0) ) ) {
353 
354  // FEC slot
355  if ( not ( (fecSlot_ >= sistrip::CRATE_SLOT_MIN &&
357  ( fecSlot_ == 0 ) ) ) {
359 
360  // FEC ring
361  if ( not ( (fecRing_ >= sistrip::FEC_RING_MIN &&
363  ( fecRing_ == 0 ) ) ) {
365 
366  // CCU addr
367  if ( not ( (ccuAddr_ >= sistrip::CCU_ADDR_MIN &&
369  ( ccuAddr_ == 0 ) ) ) {
371 
372  // CCU chan
373  if ( not ( (ccuChan_ >= sistrip::CCU_CHAN_MIN &&
375  ( ccuChan_ == 0 ) ) ) {
377 
378  // LLD channel
379  if ( not ( (lldChan_ >= sistrip::LLD_CHAN_MIN &&
381  ( lldChan_ == 0 ) ) ) {
383 
384  // APV I2C address
385  if ( i2cAddr_ >= sistrip::APV_I2C_MIN &&
387  if ( lldChan_ && lldChan( i2cAddr_ ) != lldChan_ ) {
389  key( key() | (i2cAddrMask_<<i2cAddrOffset_) );
390  }
391  } else if ( i2cAddr_ != 0 ) {
393 
394 }
395 
396 // -----------------------------------------------------------------------------
397 //
399 
400  if ( key() == sistrip::invalid32_ ) {
401 
402  // ---------- Set FecKey based on member data ----------
403 
404  // Initialise to null value
405  key(0);
406 
407  // Extract FEC crate
410  key( key() | (fecCrate_<<fecCrateOffset_) );
411  } else if ( fecCrate_ == 0 ) {
412  key( key() | (fecCrate_<<fecCrateOffset_) );
413  } else {
415  }
416 
417  // Extract FEC slot
420  key( key() | (fecSlot_<<fecSlotOffset_) );
421  } else if ( fecSlot_ == 0 ) {
422  key( key() | (fecSlot_<<fecSlotOffset_) );
423  } else {
424  key( key() | (fecSlotMask_<<fecSlotOffset_) );
425  }
426 
427  // Extract FEC ring
430  key( key() | (fecRing_<<fecRingOffset_) );
431  } else if ( fecRing_ == 0 ) {
432  key( key() | (fecRing_<<fecRingOffset_) );
433  } else {
434  key( key() | (fecRingMask_<<fecRingOffset_) );
435  }
436 
437  // Extract CCU addr
440  key( key() | (ccuAddr_<<ccuAddrOffset_) );
441  } else if ( ccuAddr_ == 0 ) {
442  key( key() | (ccuAddr_<<ccuAddrOffset_) );
443  } else {
444  key( key() | (ccuAddrMask_<<ccuAddrOffset_) );
445  }
446 
447  // Extract CCU chan
450  key( key() | ( (ccuChan_-(sistrip::CCU_CHAN_MIN-1)) << ccuChanOffset_ ) );
451  } else if ( ccuChan_ == 0 ) {
452  key( key() | (ccuChan_<<ccuChanOffset_) );
453  } else {
454  key( key() | (ccuChanMask_<<ccuChanOffset_) );
455  }
456 
457  // Extract LLD channel
460  key( key() | (lldChan_<<lldChanOffset_) );
461  } else if ( lldChan_ == 0 ) {
462  key( key() | (lldChan_<<lldChanOffset_) );
463  } else {
464  key( key() | (lldChanMask_<<lldChanOffset_) );
465  }
466 
467  // Extract APV I2C address
468  if ( i2cAddr_ >= sistrip::APV_I2C_MIN &&
470  key( key() | ( ( firstApvOfPair( i2cAddr_ ) ? 1 : 2 ) << i2cAddrOffset_ ) ); // key encodes APV number (1 or 2)
471  if ( lldChan_ && lldChan( i2cAddr_ ) != lldChan_ ) {
473  key( key() | (i2cAddrMask_<<i2cAddrOffset_) );
474  }
475  } else if ( i2cAddr_ == 0 ) {
476  key( key() | (i2cAddr_<<i2cAddrOffset_) );
477  } else {
478  key( key() | (i2cAddrMask_<<i2cAddrOffset_) );
479  }
480 
481  } else {
482 
483  // ---------- Set member data based on FEC key ----------
484 
492 
498  else if ( ccuChan_ ) { ccuChan_ += (sistrip::CCU_CHAN_MIN-1); }
501  else if ( i2cAddr_ && lldChan_ != lldChanMask_ ) { i2cAddr_ = i2cAddr( lldChan_, 2-i2cAddr_ ); }
502 
503  }
504 
505 }
506 
507 // -----------------------------------------------------------------------------
508 //
510 
511  if ( path() == sistrip::null_ ) {
512 
513  // ---------- Set directory path based on member data ----------
514 
515  std::stringstream dir;
516 
517  dir << sistrip::root_ << sistrip::dir_
519 
520  // Add FEC crate
521  if ( fecCrate_ ) {
523 
524  // Add FEC slot
525  if ( fecSlot_ ) {
527 
528  // Add FEC ring
529  if ( fecRing_ ) {
531 
532  // Add CCU address
533  if ( ccuAddr_ ) {
535 
536  // Add CCU channel
537  if ( ccuChan_ ) {
539 
540  // Add LLD channel
541  if ( lldChan_ ) {
543 
544  // Add APV I2C address
545  if ( i2cAddr_ ) {
546  dir << sistrip::apv_ << i2cAddr_ << sistrip::dir_;
547  }
548  }
549  }
550  }
551  }
552  }
553  }
554 
555  std::string temp( dir.str() );
556  path( temp );
557 
558  } else {
559 
560  // ---------- Set member data based on directory path ----------
561 
562  fecCrate_ = 0;
563  fecSlot_ = 0;
564  fecRing_ = 0;
565  ccuAddr_ = 0;
566  ccuChan_ = 0;
567  lldChan_ = 0;
568  i2cAddr_ = 0;
569 
570  // Check if root is found
571  if ( path().find( sistrip::root_ ) == std::string::npos ) {
572  std::string temp = path();
574  }
575 
576  size_t curr = 0; // current string position
577  size_t next = 0; // next string position
578  next = path().find( sistrip::controlView_, curr );
579 
580  // Extract view
581  curr = next;
582  if ( curr != std::string::npos ) {
583  next = path().find( sistrip::fecCrate_, curr );
584  std::string control_view( path(),
585  curr+(sizeof(sistrip::controlView_) - 1),
586  next-(sizeof(sistrip::dir_) - 1)-curr );
587 
588  // Extract FEC crate
589  curr = next;
590  if ( curr != std::string::npos ) {
591  next = path().find( sistrip::fecSlot_, curr );
592  std::string fec_crate( path(),
593  curr+(sizeof(sistrip::fecCrate_) - 1),
594  next-(sizeof(sistrip::dir_) - 1)-curr );
595  fecCrate_ = std::atoi( fec_crate.c_str() );
596 
597  // Extract FEC slot
598  curr = next;
599  if ( curr != std::string::npos ) {
600  next = path().find( sistrip::fecRing_, curr );
601  std::string fec_slot( path(),
602  curr+(sizeof(sistrip::fecSlot_) - 1),
603  next-(sizeof(sistrip::dir_) - 1)-curr );
604  fecSlot_ = std::atoi( fec_slot.c_str() );
605 
606  // Extract FEC ring
607  curr = next;
608  if ( curr != std::string::npos ) {
609  next = path().find( sistrip::ccuAddr_, curr );
610  std::string fec_ring( path(),
611  curr+(sizeof(sistrip::fecRing_) - 1),
612  next-(sizeof(sistrip::dir_) - 1)-curr );
613  fecRing_ = std::atoi( fec_ring.c_str() );
614 
615  // Extract CCU address
616  curr = next;
617  if ( curr != std::string::npos ) {
618  next = path().find( sistrip::ccuChan_, curr );
619  std::string ccu_addr( path(),
620  curr+(sizeof(sistrip::ccuAddr_) - 1),
621  next-(sizeof(sistrip::dir_) - 1)-curr );
622  ccuAddr_ = std::atoi( ccu_addr.c_str() );
623 
624  // Extract CCU channel
625  curr = next;
626  if ( curr != std::string::npos ) {
627  next = path().find( sistrip::lldChan_, curr );
628  std::string ccu_chan( path(),
629  curr+(sizeof(sistrip::ccuChan_) - 1),
630  next-(sizeof(sistrip::dir_) - 1)-curr );
631  ccuChan_ = std::atoi( ccu_chan.c_str() );
632 
633  // Extract LLD channel
634  curr = next;
635  if ( curr != std::string::npos ) {
636  next = path().find( sistrip::apv_, curr );
637  std::string lld_chan( path(),
638  curr+(sizeof(sistrip::lldChan_) - 1),
639  next-(sizeof(sistrip::dir_) - 1)-curr );
640  lldChan_ = std::atoi( lld_chan.c_str() );
641 
642  // Extract I2C address
643  curr = next;
644  if ( curr != std::string::npos ) {
645  next = std::string::npos;
646  std::string i2c_addr( path(),
647  curr+(sizeof(sistrip::apv_) - 1),
648  next-curr );
649  i2cAddr_ = std::atoi( i2c_addr.c_str() );
650  }
651  }
652  }
653  }
654  }
655  }
656  }
657  } else {
658  std::stringstream ss;
659  ss << sistrip::root_ << sistrip::dir_;
660  //ss << sistrip::root_ << sistrip::dir_
661  //<< sistrip::unknownView_ << sistrip::dir_;
662  std::string temp( ss.str() );
663  path( temp );
664  }
665 
666  }
667 
668 }
669 
670 // -----------------------------------------------------------------------------
671 //
673 
675  channel(0);
676  if ( fecCrate_ && fecCrate_ != sistrip::invalid_ ) {
679  if ( fecSlot_ && fecSlot_ != sistrip::invalid_ ) {
681  channel(fecSlot_);
682  if ( fecRing_ && fecRing_ != sistrip::invalid_ ) {
684  channel(fecRing_);
685  if ( ccuAddr_ && ccuAddr_ != sistrip::invalid_ ) {
687  channel(ccuAddr_);
688  if ( ccuChan_ && ccuChan_ != sistrip::invalid_ ) {
690  channel(ccuChan_);
691  if ( lldChan_ && lldChan_ != sistrip::invalid_ ) {
693  channel(lldChan_);
694  if ( i2cAddr_ && i2cAddr_ != sistrip::invalid_ ) {
696  channel(i2cAddr_);
697  } else if ( i2cAddr_ == sistrip::invalid_ ) {
700  }
701  } else if ( lldChan_ == sistrip::invalid_ ) {
704  }
705  } else if ( ccuChan_ == sistrip::invalid_ ) {
708  }
709  } else if ( ccuAddr_ == sistrip::invalid_ ) {
712  }
713  } else if ( fecRing_ == sistrip::invalid_ ) {
716  }
717  } else if ( fecSlot_ == sistrip::invalid_ ) {
720  }
721  } else if ( fecCrate_ == sistrip::invalid_ ) {
724  }
725 
726 }
727 
728 // -----------------------------------------------------------------------------
729 //
730 void SiStripFecKey::terse( std::stringstream& ss ) const {
731  ss << "FEC:crate/slot/ring/CCU/module/LLD/I2C= "
732  << fecCrate() << "/"
733  << fecSlot() << "/"
734  << fecRing() << "/"
735  << ccuAddr() << "/"
736  << ccuChan() << "/"
737  << lldChan() << "/"
738  << i2cAddr();
739 // ss << " FecKey"
740 // //<< "=0x"
741 // //<< std::hex
742 // //<< std::setfill('0') << std::setw(8) << key() << std::setfill(' ')
743 // //<< std::dec
744 // //<< ", " << ( isValid() ? "Valid" : "Invalid" )
745 // << ", Crate=" << fecCrate()
746 // << ", Slot=" << fecSlot()
747 // << ", Ring=" << fecRing()
748 // << ", CCU=" << ccuAddr()
749 // << ", module=" << ccuChan()
750 // << ", LLD=" << lldChan()
751 // << ", I2C=" << i2cAddr();
752 }
753 
754 // -----------------------------------------------------------------------------
755 //
756 void SiStripFecKey::print( std::stringstream& ss ) const {
757  ss << " [SiStripFecKey::print]" << std::endl
758  << std::hex
759  << " FEC key : 0x"
760  << std::setfill('0')
761  << std::setw(8) << key() << std::endl
762  << std::setfill(' ')
763  << std::dec
764  << " FEC VME crate : " << fecCrate() << std::endl
765  << " FEC VME slot : " << fecSlot() << std::endl
766  << " FEC control ring : " << fecRing() << std::endl
767  << " CCU I2C address : " << ccuAddr() << std::endl
768  << " CCU chan (FE module) : " << ccuChan() << std::endl
769  << " LaserDriver channel : " << lldChan() << std::endl
770  << " APV I2C address : " << i2cAddr() << std::endl
771  << " Directory : " << path() << std::endl
772  << " Granularity : "
774  << " Channel : " << channel() << std::endl
775  << " isValid : " << isValid();
776 }
777 
778 // -----------------------------------------------------------------------------
779 //
780 std::ostream& operator<< ( std::ostream& os, const SiStripFecKey& input ) {
781  std::stringstream ss;
782  input.print(ss);
783  os << ss.str();
784  return os;
785 }
786 
787 // -----------------------------------------------------------------------------
788 //
790  : mask_( key.fecCrate() ? sistrip::invalid_ : 0,
791  key.fecSlot() ? sistrip::invalid_ : 0,
792  key.fecRing() ? sistrip::invalid_ : 0,
793  key.ccuAddr() ? sistrip::invalid_ : 0,
794  key.ccuChan() ? sistrip::invalid_ : 0,
795  key.lldChan() ? sistrip::invalid_ : 0,
796  key.i2cAddr() ? sistrip::invalid_ : 0 ) {;}
797 
798 // -----------------------------------------------------------------------------
799 //
801  : mask_(SiStripNullKey()) {;}
802 
803 // -----------------------------------------------------------------------------
804 //
805 bool ConsistentWithKey::operator() ( const uint32_t& a, const uint32_t& b ) const {
806  return ( ( a & mask_.key() ) < ( b & mask_.key() ) );
807 }
uint16_t ccuAddr_
static const uint16_t ccuChanOffset_
static const uint16_t APV_I2C_MIN
static const uint16_t ccuChanMask_
static const uint16_t i2cAddrOffset_
const uint16_t & fecRing() const
static const char dir_[]
void print(std::stringstream &ss) const override
static const uint16_t CCU_ADDR_MAX
static const uint16_t CCU_CHAN_MAX
uint16_t fecSlot_
Various generic constants used by DQM.
static const uint16_t CCU_CHAN_MIN
static const uint32_t invalid32_
Definition: Constants.h:15
std::ostream & operator<<(std::ostream &os, const SiStripFecKey &input)
uint16_t ccuChan_
static const uint16_t LLD_CHAN_MIN
void initGranularity() override
static const uint16_t LLD_CHAN_MAX
static const uint16_t fecSlotMask_
uint16_t lldChan_
static const uint16_t fecRingOffset_
uint16_t fecCrate_
static const uint16_t FEC_CRATE_MIN
static std::string granularity(const sistrip::Granularity &)
uint16_t fecRing_
const uint16_t & lldChan() const
bool isEqual(const SiStripKey &) const override
static const uint16_t CRATE_SLOT_MAX
const uint16_t & fecSlot() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
const uint16_t & i2cAddr() const
sistrip classes
static const uint16_t fecCrateMask_
void terse(std::stringstream &ss) const override
static const uint16_t FEC_RING_MAX
static const char fecSlot_[]
Constants and enumerated types for sistrip::View.
static std::string const input
Definition: EdmProvDump.cc:44
const uint32_t & key() const
Definition: SiStripKey.h:125
static const char ccuChan_[]
static const char ccuAddr_[]
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
static const uint16_t FEC_CRATE_MAX
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:127
bool isInvalid() const override
static bool firstApvOfPair(const uint16_t &i2c_addr)
static const uint16_t lldChanOffset_
static const char lldChan_[]
static const uint16_t CCU_ADDR_MIN
void initFromPath() override
static uint16_t hybridPos(const uint16_t &i2c_addr)
static const char controlView_[]
static const char fecCrate_[]
Base utility class that identifies a position within a logical structure of the strip tracker...
Definition: SiStripKey.h:23
const std::string & path() const
Definition: SiStripKey.h:126
static const char apv_[]
const uint16_t & fecCrate() const
static const uint16_t FEC_RING_MIN
static const uint16_t lldChanMask_
static const uint16_t CRATE_SLOT_MIN
const uint16_t & channel() const
Definition: SiStripKey.h:128
bool isConsistent(const SiStripKey &) const override
static const uint16_t fecSlotOffset_
Constants and enumerated types for FED/FEC systems.
uint16_t i2cAddr_
static const char fecRing_[]
const uint16_t & ccuAddr() const
static const uint16_t invalid_
Definition: Constants.h:16
double b
Definition: hdecay.h:120
bool operator()(const uint32_t &, const uint32_t &) const
static const uint16_t APVS_PER_CHAN
static const uint16_t ccuAddrMask_
SiStripFecKey mask_
static const uint16_t APV_I2C_MAX
void initFromValue() override
double a
Definition: hdecay.h:121
Concrete implementation of abstract base, signifying null values or an "unknown" position or view...
void initFromKey() override
static const char root_[]
static const uint16_t i2cAddrMask_
bool isValid() const override
const uint16_t & ccuChan() const
static const uint16_t fecRingMask_
dbl *** dir
Definition: mlp_gen.cc:35
static const uint16_t fecCrateOffset_
static const uint16_t ccuAddrOffset_
static const char null_[]
Definition: Constants.h:22