CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CalibTracker/SiStripESProducers/interface/SiStripFedCablingESProducer.h

Go to the documentation of this file.
00001 #ifndef CalibTracker_SiStripESProducers_SiStripFedCablingESProducer_H
00002 #define CalibTracker_SiStripESProducers_SiStripFedCablingESProducer_H
00003 
00004 #include "FWCore/Framework/interface/ESProducer.h"
00005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00006 #include "boost/cstdint.hpp"
00007 #include <memory>
00008 
00009 class SiStripFedCabling;
00010 class SiStripFedCablingRcd;
00011 
00017 class SiStripFedCablingESProducer : public edm::ESProducer {
00018   
00019  public:
00020   
00021   SiStripFedCablingESProducer( const edm::ParameterSet& );
00022   virtual ~SiStripFedCablingESProducer();
00023   
00025   virtual std::auto_ptr<SiStripFedCabling> produce( const SiStripFedCablingRcd& );
00026   
00027  private:
00028   
00029   SiStripFedCablingESProducer( const SiStripFedCablingESProducer& );
00030   const SiStripFedCablingESProducer& operator=( const SiStripFedCablingESProducer& );
00031   
00032   virtual SiStripFedCabling* make( const SiStripFedCablingRcd& ) = 0; 
00033   
00034  public:
00035   
00036   // Utility methods that generate "fake" control structure numbering
00037   static uint16_t fecCrate( const uint16_t& nth_module ); // 4 crates within system
00038   static uint16_t fecSlot( const uint16_t& nth_module );  // 11 FECs per crate
00039   static uint16_t fecRing( const uint16_t& nth_module );  // 8 control rings per FEC
00040   static uint16_t ccuAddr( const uint16_t& nth_module );  // 8 CCU modules per control ring
00041   static uint16_t ccuChan( const uint16_t& nth_module );  // 8 modules per CCU
00042   
00043 };
00044 
00045 // ---------- inline methods ----------
00046 
00047 inline uint16_t SiStripFedCablingESProducer::fecCrate( const uint16_t& module ) { return (module/(8*8*8*11)) % 4 + 1; } 
00048 inline uint16_t SiStripFedCablingESProducer::fecSlot( const uint16_t& module ) { return (module/(8*8*8)) % 11 + 2; }
00049 inline uint16_t SiStripFedCablingESProducer::fecRing( const uint16_t& module ) { return (module/(8*8)) % 8 + 1; }
00050 inline uint16_t SiStripFedCablingESProducer::ccuAddr( const uint16_t& module ) { return (module/8) % 8 + 1; }
00051 inline uint16_t SiStripFedCablingESProducer::ccuChan( const uint16_t& module ) { return (module/1) % 8 + 16; }
00052 
00053 #endif // CalibTracker_SiStripESProducers_SiStripFedCablingESProducer_H
00054