CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/DQM/SiStripCommissioningSummary/interface/ViewTranslator.h

Go to the documentation of this file.
00001 #ifndef DQM_SiStripCommissioningSummary_ViewTranslator_H
00002 #define DQM_SiStripCommissioningSummary_ViewTranslator_H
00003 
00004 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
00005 #include <boost/cstdint.hpp>
00006 #include <vector>
00007 #include <string>
00008 #include <map>
00009 
00020 class ViewTranslator {
00021 
00022  public:
00023 
00025   typedef std::map<uint32_t,uint32_t> Mapping;
00026   
00027   // -------------------- Build maps --------------------
00028   
00030   static void buildMaps( const SiStripFedCabling&, 
00031                          Mapping& det_to_fec, 
00032                          Mapping& fed_to_fec );
00033   
00035   uint32_t fedToFec( const uint32_t& fed_key_mask, 
00036                      const Mapping& input,
00037                      Mapping& output );
00038   
00040   uint32_t detToFec( const uint32_t& det_key_mask, 
00041                      const Mapping& input,
00042                      Mapping& output );
00043   
00044   // -------------------- Root IO --------------------
00045 
00046   //arguments are the root file name, the uint32_t det key to be unpacked, and the map to be filled with
00047   //the matching complete fed and fec keys
00048   void detToFec(std::string root_filename, 
00049                 uint32_t& det_key_mask, 
00050                 Mapping& det_to_fec ) {;}
00051   
00052   //arguments are the root file name, the uint32_t fed key to be unpacked, and the map to be filled with
00053   //the matching complete fed and fec keys
00054   void fedToFec( std::string root_filename, 
00055                  uint32_t& fed_key_mask, 
00056                  Mapping& fed_to_fec ) {;}
00057   
00058   //arguments are the root file name, the det to fec translation map and the fed to fec translational
00059   //maps (from makemaps)
00060   void writeMapsToFile( std::string root_filename, 
00061                         Mapping& det_to_fec, 
00062                         Mapping& fed_to_fec );
00063 
00064  private:
00065   
00067   std::string rootfile_;
00068 
00069   // Some constants
00070   static const uint16_t fedIdMask_ = 0xFFF;
00071   static const uint16_t fedFeMask_ = 0xF;
00072   static const uint16_t fedChMask_ = 0xFF;
00073 
00074 };
00075 
00076 #endif // DQM_SiStripCommissioningSummary_ViewTranslator_H