CMS 3D CMS Logo

SiStripFedCablingESProducer.h
Go to the documentation of this file.
1 #ifndef CalibTracker_SiStripESProducers_SiStripFedCablingESProducer_H
2 #define CalibTracker_SiStripESProducers_SiStripFedCablingESProducer_H
3 
6 #include <memory>
7 #include <cstdint>
8 
11 
18 public:
21 
23  virtual std::unique_ptr<SiStripFedCabling> produce(const SiStripFedCablingRcd&);
24 
27 
28 private:
29  virtual SiStripFedCabling* make(const SiStripFedCablingRcd&) = 0;
30 
31 public:
32  // Utility methods that generate "fake" control structure numbering
33  static uint16_t fecCrate(const uint16_t& nth_module); // 4 crates within system
34  static uint16_t fecSlot(const uint16_t& nth_module); // 11 FECs per crate
35  static uint16_t fecRing(const uint16_t& nth_module); // 8 control rings per FEC
36  static uint16_t ccuAddr(const uint16_t& nth_module); // 8 CCU modules per control ring
37  static uint16_t ccuChan(const uint16_t& nth_module); // 8 modules per CCU
38 };
39 
40 // ---------- inline methods ----------
41 
42 inline uint16_t SiStripFedCablingESProducer::fecCrate(const uint16_t& module) {
43  return (module / (8 * 8 * 8 * 11)) % 4 + 1;
44 }
45 inline uint16_t SiStripFedCablingESProducer::fecSlot(const uint16_t& module) { return (module / (8 * 8 * 8)) % 11 + 2; }
46 inline uint16_t SiStripFedCablingESProducer::fecRing(const uint16_t& module) { return (module / (8 * 8)) % 8 + 1; }
47 inline uint16_t SiStripFedCablingESProducer::ccuAddr(const uint16_t& module) { return (module / 8) % 8 + 1; }
48 inline uint16_t SiStripFedCablingESProducer::ccuChan(const uint16_t& module) { return (module / 1) % 8 + 16; }
49 
50 #endif // CalibTracker_SiStripESProducers_SiStripFedCablingESProducer_H
static uint16_t ccuAddr(const uint16_t &nth_module)
static uint16_t fecCrate(const uint16_t &nth_module)
virtual std::unique_ptr< SiStripFedCabling > produce(const SiStripFedCablingRcd &)
static uint16_t fecSlot(const uint16_t &nth_module)
virtual SiStripFedCabling * make(const SiStripFedCablingRcd &)=0
static uint16_t fecRing(const uint16_t &nth_module)
const SiStripFedCablingESProducer & operator=(const SiStripFedCablingESProducer &)=delete
SiStripFedCablingESProducer(const edm::ParameterSet &)
Abstract base class for producer of SiStripFedCabling record.
static uint16_t ccuChan(const uint16_t &nth_module)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...