File indexing completed on 2024-04-06 12:08:37
0001 #ifndef DQM_SiStripCommissioningSummary_ViewTranslator_H
0002 #define DQM_SiStripCommissioningSummary_ViewTranslator_H
0003
0004 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
0005 #include <vector>
0006 #include <string>
0007 #include <map>
0008 #include <cstdint>
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 class ViewTranslator {
0019 public:
0020
0021 typedef std::map<uint32_t, uint32_t> Mapping;
0022
0023
0024
0025
0026 static void buildMaps(const SiStripFedCabling&, Mapping& det_to_fec, Mapping& fed_to_fec);
0027
0028
0029 uint32_t fedToFec(const uint32_t& fed_key_mask, const Mapping& input, Mapping& output);
0030
0031
0032 uint32_t detToFec(const uint32_t& det_key_mask, const Mapping& input, Mapping& output);
0033
0034
0035
0036
0037
0038 void detToFec(std::string root_filename, uint32_t& det_key_mask, Mapping& det_to_fec) { ; }
0039
0040
0041
0042 void fedToFec(std::string root_filename, uint32_t& fed_key_mask, Mapping& fed_to_fec) { ; }
0043
0044
0045
0046 void writeMapsToFile(std::string root_filename, Mapping& det_to_fec, Mapping& fed_to_fec);
0047
0048 private:
0049
0050 std::string rootfile_;
0051
0052
0053 static const uint16_t fedIdMask_ = 0xFFF;
0054 static const uint16_t fedFeMask_ = 0xF;
0055 static const uint16_t fedChMask_ = 0xFF;
0056 };
0057
0058 #endif