test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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),
40  fecCrate_(sistrip::invalid_),
41  fecSlot_(sistrip::invalid_),
42  fecRing_(sistrip::invalid_),
43  ccuAddr_(sistrip::invalid_),
44  ccuChan_(sistrip::invalid_),
45  lldChan_(sistrip::invalid_),
46  i2cAddr_(sistrip::invalid_)
47 {
48  // order is important!
49  initFromKey();
50  initFromValue();
51  initFromPath();
53 }
54 
55 // -----------------------------------------------------------------------------
56 //
58  SiStripKey(path),
59  fecCrate_(sistrip::invalid_),
60  fecSlot_(sistrip::invalid_),
61  fecRing_(sistrip::invalid_),
62  ccuAddr_(sistrip::invalid_),
63  ccuChan_(sistrip::invalid_),
64  lldChan_(sistrip::invalid_),
65  i2cAddr_(sistrip::invalid_)
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(),
95  fecCrate_(sistrip::invalid_),
96  fecSlot_(sistrip::invalid_),
97  fecRing_(sistrip::invalid_),
98  ccuAddr_(sistrip::invalid_),
99  ccuChan_(sistrip::invalid_),
100  lldChan_(sistrip::invalid_),
101  i2cAddr_(sistrip::invalid_)
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(),
177  fecCrate_(sistrip::invalid_),
178  fecSlot_(sistrip::invalid_),
179  fecRing_(sistrip::invalid_),
180  ccuAddr_(sistrip::invalid_),
181  ccuChan_(sistrip::invalid_),
182  lldChan_(sistrip::invalid_),
183  i2cAddr_(sistrip::invalid_)
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
352  } else if ( fecCrate_ == 0 ) {
353  fecCrate_ = 0;
354  } else { fecCrate_ = sistrip::invalid_; }
355 
356  // FEC slot
359  fecSlot_ = fecSlot_;
360  } else if ( fecSlot_ == 0 ) {
361  fecSlot_ = 0;
362  } else { fecSlot_ = sistrip::invalid_; }
363 
364  // FEC ring
367  fecRing_ = fecRing_;
368  } else if ( fecRing_ == 0 ) {
369  fecRing_ = 0;
370  } else { fecRing_ = sistrip::invalid_; }
371 
372  // CCU addr
375  ccuAddr_ = ccuAddr_;
376  } else if ( ccuAddr_ == 0 ) {
377  ccuAddr_ = 0;
378  } else { ccuAddr_ = sistrip::invalid_; }
379 
380  // CCU chan
383  ccuChan_ = ccuChan_;
384  } else if ( ccuChan_ == 0 ) {
385  ccuChan_ = 0;
386  } else { ccuChan_ = sistrip::invalid_; }
387 
388  // LLD channel
391  lldChan_ = lldChan_;
392  } else if ( lldChan_ == 0 ) {
393  lldChan_ = 0;
394  } else { lldChan_ = sistrip::invalid_; }
395 
396  // APV I2C address
397  if ( i2cAddr_ >= sistrip::APV_I2C_MIN &&
399  i2cAddr_ = i2cAddr_;
400  if ( lldChan_ && lldChan( i2cAddr_ ) != lldChan_ ) {
402  key( key() | (i2cAddrMask_<<i2cAddrOffset_) );
403  }
404  } else if ( i2cAddr_ == 0 ) {
405  i2cAddr_ = 0;
406  } else { i2cAddr_ = sistrip::invalid_; }
407 
408 }
409 
410 // -----------------------------------------------------------------------------
411 //
413 
414  if ( key() == sistrip::invalid32_ ) {
415 
416  // ---------- Set FecKey based on member data ----------
417 
418  // Initialise to null value
419  key(0);
420 
421  // Extract FEC crate
424  key( key() | (fecCrate_<<fecCrateOffset_) );
425  } else if ( fecCrate_ == 0 ) {
426  key( key() | (fecCrate_<<fecCrateOffset_) );
427  } else {
429  }
430 
431  // Extract FEC slot
434  key( key() | (fecSlot_<<fecSlotOffset_) );
435  } else if ( fecSlot_ == 0 ) {
436  key( key() | (fecSlot_<<fecSlotOffset_) );
437  } else {
438  key( key() | (fecSlotMask_<<fecSlotOffset_) );
439  }
440 
441  // Extract FEC ring
444  key( key() | (fecRing_<<fecRingOffset_) );
445  } else if ( fecRing_ == 0 ) {
446  key( key() | (fecRing_<<fecRingOffset_) );
447  } else {
448  key( key() | (fecRingMask_<<fecRingOffset_) );
449  }
450 
451  // Extract CCU addr
454  key( key() | (ccuAddr_<<ccuAddrOffset_) );
455  } else if ( ccuAddr_ == 0 ) {
456  key( key() | (ccuAddr_<<ccuAddrOffset_) );
457  } else {
458  key( key() | (ccuAddrMask_<<ccuAddrOffset_) );
459  }
460 
461  // Extract CCU chan
464  key( key() | ( (ccuChan_-(sistrip::CCU_CHAN_MIN-1)) << ccuChanOffset_ ) );
465  } else if ( ccuChan_ == 0 ) {
466  key( key() | (ccuChan_<<ccuChanOffset_) );
467  } else {
468  key( key() | (ccuChanMask_<<ccuChanOffset_) );
469  }
470 
471  // Extract LLD channel
474  key( key() | (lldChan_<<lldChanOffset_) );
475  } else if ( lldChan_ == 0 ) {
476  key( key() | (lldChan_<<lldChanOffset_) );
477  } else {
478  key( key() | (lldChanMask_<<lldChanOffset_) );
479  }
480 
481  // Extract APV I2C address
482  if ( i2cAddr_ >= sistrip::APV_I2C_MIN &&
484  key( key() | ( ( firstApvOfPair( i2cAddr_ ) ? 1 : 2 ) << i2cAddrOffset_ ) ); // key encodes APV number (1 or 2)
485  if ( lldChan_ && lldChan( i2cAddr_ ) != lldChan_ ) {
487  key( key() | (i2cAddrMask_<<i2cAddrOffset_) );
488  }
489  } else if ( i2cAddr_ == 0 ) {
490  key( key() | (i2cAddr_<<i2cAddrOffset_) );
491  } else {
492  key( key() | (i2cAddrMask_<<i2cAddrOffset_) );
493  }
494 
495  } else {
496 
497  // ---------- Set member data based on FEC key ----------
498 
506 
512  else if ( ccuChan_ ) { ccuChan_ += (sistrip::CCU_CHAN_MIN-1); }
515  else if ( i2cAddr_ && lldChan_ != lldChanMask_ ) { i2cAddr_ = i2cAddr( lldChan_, 2-i2cAddr_ ); }
516 
517  }
518 
519 }
520 
521 // -----------------------------------------------------------------------------
522 //
524 
525  if ( path() == sistrip::null_ ) {
526 
527  // ---------- Set directory path based on member data ----------
528 
529  std::stringstream dir;
530 
531  dir << sistrip::root_ << sistrip::dir_
533 
534  // Add FEC crate
535  if ( fecCrate_ ) {
537 
538  // Add FEC slot
539  if ( fecSlot_ ) {
541 
542  // Add FEC ring
543  if ( fecRing_ ) {
545 
546  // Add CCU address
547  if ( ccuAddr_ ) {
549 
550  // Add CCU channel
551  if ( ccuChan_ ) {
553 
554  // Add LLD channel
555  if ( lldChan_ ) {
557 
558  // Add APV I2C address
559  if ( i2cAddr_ ) {
560  dir << sistrip::apv_ << i2cAddr_ << sistrip::dir_;
561  }
562  }
563  }
564  }
565  }
566  }
567  }
568 
569  std::string temp( dir.str() );
570  path( temp );
571 
572  } else {
573 
574  // ---------- Set member data based on directory path ----------
575 
576  fecCrate_ = 0;
577  fecSlot_ = 0;
578  fecRing_ = 0;
579  ccuAddr_ = 0;
580  ccuChan_ = 0;
581  lldChan_ = 0;
582  i2cAddr_ = 0;
583 
584  // Check if root is found
585  if ( path().find( sistrip::root_ ) == std::string::npos ) {
586  std::string temp = path();
588  }
589 
590  size_t curr = 0; // current string position
591  size_t next = 0; // next string position
592  next = path().find( sistrip::controlView_, curr );
593 
594  // Extract view
595  curr = next;
596  if ( curr != std::string::npos ) {
597  next = path().find( sistrip::fecCrate_, curr );
598  std::string control_view( path(),
599  curr+(sizeof(sistrip::controlView_) - 1),
600  next-(sizeof(sistrip::dir_) - 1)-curr );
601 
602  // Extract FEC crate
603  curr = next;
604  if ( curr != std::string::npos ) {
605  next = path().find( sistrip::fecSlot_, curr );
606  std::string fec_crate( path(),
607  curr+(sizeof(sistrip::fecCrate_) - 1),
608  next-(sizeof(sistrip::dir_) - 1)-curr );
609  fecCrate_ = std::atoi( fec_crate.c_str() );
610 
611  // Extract FEC slot
612  curr = next;
613  if ( curr != std::string::npos ) {
614  next = path().find( sistrip::fecRing_, curr );
615  std::string fec_slot( path(),
616  curr+(sizeof(sistrip::fecSlot_) - 1),
617  next-(sizeof(sistrip::dir_) - 1)-curr );
618  fecSlot_ = std::atoi( fec_slot.c_str() );
619 
620  // Extract FEC ring
621  curr = next;
622  if ( curr != std::string::npos ) {
623  next = path().find( sistrip::ccuAddr_, curr );
624  std::string fec_ring( path(),
625  curr+(sizeof(sistrip::fecRing_) - 1),
626  next-(sizeof(sistrip::dir_) - 1)-curr );
627  fecRing_ = std::atoi( fec_ring.c_str() );
628 
629  // Extract CCU address
630  curr = next;
631  if ( curr != std::string::npos ) {
632  next = path().find( sistrip::ccuChan_, curr );
633  std::string ccu_addr( path(),
634  curr+(sizeof(sistrip::ccuAddr_) - 1),
635  next-(sizeof(sistrip::dir_) - 1)-curr );
636  ccuAddr_ = std::atoi( ccu_addr.c_str() );
637 
638  // Extract CCU channel
639  curr = next;
640  if ( curr != std::string::npos ) {
641  next = path().find( sistrip::lldChan_, curr );
642  std::string ccu_chan( path(),
643  curr+(sizeof(sistrip::ccuChan_) - 1),
644  next-(sizeof(sistrip::dir_) - 1)-curr );
645  ccuChan_ = std::atoi( ccu_chan.c_str() );
646 
647  // Extract LLD channel
648  curr = next;
649  if ( curr != std::string::npos ) {
650  next = path().find( sistrip::apv_, curr );
651  std::string lld_chan( path(),
652  curr+(sizeof(sistrip::lldChan_) - 1),
653  next-(sizeof(sistrip::dir_) - 1)-curr );
654  lldChan_ = std::atoi( lld_chan.c_str() );
655 
656  // Extract I2C address
657  curr = next;
658  if ( curr != std::string::npos ) {
659  next = std::string::npos;
660  std::string i2c_addr( path(),
661  curr+(sizeof(sistrip::apv_) - 1),
662  next-curr );
663  i2cAddr_ = std::atoi( i2c_addr.c_str() );
664  }
665  }
666  }
667  }
668  }
669  }
670  }
671  } else {
672  std::stringstream ss;
673  ss << sistrip::root_ << sistrip::dir_;
674  //ss << sistrip::root_ << sistrip::dir_
675  //<< sistrip::unknownView_ << sistrip::dir_;
676  std::string temp( ss.str() );
677  path( temp );
678  }
679 
680  }
681 
682 }
683 
684 // -----------------------------------------------------------------------------
685 //
687 
689  channel(0);
690  if ( fecCrate_ && fecCrate_ != sistrip::invalid_ ) {
693  if ( fecSlot_ && fecSlot_ != sistrip::invalid_ ) {
695  channel(fecSlot_);
696  if ( fecRing_ && fecRing_ != sistrip::invalid_ ) {
698  channel(fecRing_);
699  if ( ccuAddr_ && ccuAddr_ != sistrip::invalid_ ) {
701  channel(ccuAddr_);
702  if ( ccuChan_ && ccuChan_ != sistrip::invalid_ ) {
704  channel(ccuChan_);
705  if ( lldChan_ && lldChan_ != sistrip::invalid_ ) {
707  channel(lldChan_);
708  if ( i2cAddr_ && i2cAddr_ != sistrip::invalid_ ) {
710  channel(i2cAddr_);
711  } else if ( i2cAddr_ == sistrip::invalid_ ) {
714  }
715  } else if ( lldChan_ == sistrip::invalid_ ) {
718  }
719  } else if ( ccuChan_ == sistrip::invalid_ ) {
722  }
723  } else if ( ccuAddr_ == sistrip::invalid_ ) {
726  }
727  } else if ( fecRing_ == sistrip::invalid_ ) {
730  }
731  } else if ( fecSlot_ == sistrip::invalid_ ) {
734  }
735  } else if ( fecCrate_ == sistrip::invalid_ ) {
738  }
739 
740 }
741 
742 // -----------------------------------------------------------------------------
743 //
744 void SiStripFecKey::terse( std::stringstream& ss ) const {
745  ss << "FEC:crate/slot/ring/CCU/module/LLD/I2C= "
746  << fecCrate() << "/"
747  << fecSlot() << "/"
748  << fecRing() << "/"
749  << ccuAddr() << "/"
750  << ccuChan() << "/"
751  << lldChan() << "/"
752  << i2cAddr();
753 // ss << " FecKey"
754 // //<< "=0x"
755 // //<< std::hex
756 // //<< std::setfill('0') << std::setw(8) << key() << std::setfill(' ')
757 // //<< std::dec
758 // //<< ", " << ( isValid() ? "Valid" : "Invalid" )
759 // << ", Crate=" << fecCrate()
760 // << ", Slot=" << fecSlot()
761 // << ", Ring=" << fecRing()
762 // << ", CCU=" << ccuAddr()
763 // << ", module=" << ccuChan()
764 // << ", LLD=" << lldChan()
765 // << ", I2C=" << i2cAddr();
766 }
767 
768 // -----------------------------------------------------------------------------
769 //
770 void SiStripFecKey::print( std::stringstream& ss ) const {
771  ss << " [SiStripFecKey::print]" << std::endl
772  << std::hex
773  << " FEC key : 0x"
774  << std::setfill('0')
775  << std::setw(8) << key() << std::endl
776  << std::setfill(' ')
777  << std::dec
778  << " FEC VME crate : " << fecCrate() << std::endl
779  << " FEC VME slot : " << fecSlot() << std::endl
780  << " FEC control ring : " << fecRing() << std::endl
781  << " CCU I2C address : " << ccuAddr() << std::endl
782  << " CCU chan (FE module) : " << ccuChan() << std::endl
783  << " LaserDriver channel : " << lldChan() << std::endl
784  << " APV I2C address : " << i2cAddr() << std::endl
785  << " Directory : " << path() << std::endl
786  << " Granularity : "
788  << " Channel : " << channel() << std::endl
789  << " isValid : " << isValid();
790 }
791 
792 // -----------------------------------------------------------------------------
793 //
794 std::ostream& operator<< ( std::ostream& os, const SiStripFecKey& input ) {
795  std::stringstream ss;
796  input.print(ss);
797  os << ss.str();
798  return os;
799 }
800 
801 // -----------------------------------------------------------------------------
802 //
804  : mask_( key.fecCrate() ? sistrip::invalid_ : 0,
805  key.fecSlot() ? sistrip::invalid_ : 0,
806  key.fecRing() ? sistrip::invalid_ : 0,
807  key.ccuAddr() ? sistrip::invalid_ : 0,
808  key.ccuChan() ? sistrip::invalid_ : 0,
809  key.lldChan() ? sistrip::invalid_ : 0,
810  key.i2cAddr() ? sistrip::invalid_ : 0 ) {;}
811 
812 // -----------------------------------------------------------------------------
813 //
815  : mask_(SiStripNullKey()) {;}
816 
817 // -----------------------------------------------------------------------------
818 //
819 bool ConsistentWithKey::operator() ( const uint32_t& a, const uint32_t& b ) const {
820  return ( ( a & mask_.key() ) < ( b & mask_.key() ) );
821 }
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_[]
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
uint16_t ccuChan_
static const uint16_t LLD_CHAN_MIN
static const uint16_t LLD_CHAN_MAX
static const uint16_t fecSlotMask_
uint16_t lldChan_
static const uint16_t fecRingOffset_
uint16_t fecCrate_
virtual void print(std::stringstream &ss) const
static const uint16_t FEC_CRATE_MIN
static std::string granularity(const sistrip::Granularity &)
uint16_t fecRing_
const uint16_t & lldChan() const
static const uint16_t CRATE_SLOT_MAX
const uint16_t & fecSlot() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const uint16_t & i2cAddr() const
static const uint16_t fecCrateMask_
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
static bool firstApvOfPair(const uint16_t &i2c_addr)
static const uint16_t lldChanOffset_
static const char lldChan_[]
static const uint16_t CCU_ADDR_MIN
static uint16_t hybridPos(const uint16_t &i2c_addr)
void initFromValue()
static const char controlView_[]
bool isInvalid() const
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
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
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
bool isEqual(const SiStripKey &) const
const uint16_t & channel() const
Definition: SiStripKey.h:128
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_
bool isValid() const
static const uint16_t APV_I2C_MAX
double a
Definition: hdecay.h:121
Concrete implementation of abstract base, signifying null values or an &quot;unknown&quot; position or view...
static const char root_[]
static const uint16_t i2cAddrMask_
const uint16_t & ccuChan() const
static const uint16_t fecRingMask_
dbl *** dir
Definition: mlp_gen.cc:35
static const uint16_t fecCrateOffset_
void initGranularity()
bool isConsistent(const SiStripKey &) const
static const uint16_t ccuAddrOffset_
static const char null_[]
Definition: Constants.h:22
virtual void terse(std::stringstream &ss) const