CMS 3D CMS Logo

ViewTranslator.h
Go to the documentation of this file.
1 #ifndef DQM_SiStripCommissioningSummary_ViewTranslator_H
2 #define DQM_SiStripCommissioningSummary_ViewTranslator_H
3 
5 #include <vector>
6 #include <string>
7 #include <map>
8 #include <cstdint>
9 
19 public:
21  typedef std::map<uint32_t, uint32_t> Mapping;
22 
23  // -------------------- Build maps --------------------
24 
26  static void buildMaps(const SiStripFedCabling&, Mapping& det_to_fec, Mapping& fed_to_fec);
27 
29  uint32_t fedToFec(const uint32_t& fed_key_mask, const Mapping& input, Mapping& output);
30 
32  uint32_t detToFec(const uint32_t& det_key_mask, const Mapping& input, Mapping& output);
33 
34  // -------------------- Root IO --------------------
35 
36  //arguments are the root file name, the uint32_t det key to be unpacked, and the map to be filled with
37  //the matching complete fed and fec keys
38  void detToFec(std::string root_filename, uint32_t& det_key_mask, Mapping& det_to_fec) { ; }
39 
40  //arguments are the root file name, the uint32_t fed key to be unpacked, and the map to be filled with
41  //the matching complete fed and fec keys
42  void fedToFec(std::string root_filename, uint32_t& fed_key_mask, Mapping& fed_to_fec) { ; }
43 
44  //arguments are the root file name, the det to fec translation map and the fed to fec translational
45  //maps (from makemaps)
46  void writeMapsToFile(std::string root_filename, Mapping& det_to_fec, Mapping& fed_to_fec);
47 
48 private:
51 
52  // Some constants
53  static const uint16_t fedIdMask_ = 0xFFF;
54  static const uint16_t fedFeMask_ = 0xF;
55  static const uint16_t fedChMask_ = 0xFF;
56 };
57 
58 #endif // DQM_SiStripCommissioningSummary_ViewTranslator_H
std::string rootfile_
static const uint16_t fedFeMask_
void detToFec(std::string root_filename, uint32_t &det_key_mask, Mapping &det_to_fec)
static const uint16_t fedIdMask_
uint32_t fedToFec(const uint32_t &fed_key_mask, const Mapping &input, Mapping &output)
uint32_t detToFec(const uint32_t &det_key_mask, const Mapping &input, Mapping &output)
static std::string const input
Definition: EdmProvDump.cc:50
static void buildMaps(const SiStripFedCabling &, Mapping &det_to_fec, Mapping &fed_to_fec)
std::map< uint32_t, uint32_t > Mapping
void fedToFec(std::string root_filename, uint32_t &fed_key_mask, Mapping &fed_to_fec)
void writeMapsToFile(std::string root_filename, Mapping &det_to_fec, Mapping &fed_to_fec)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
static const uint16_t fedChMask_