CMS 3D CMS Logo

CTPPSPixelDataFormatter.h
Go to the documentation of this file.
1 #ifndef CTPPS_CTPPSRawToDigi_CTPPSPixelDataFormatter_h
2 #define CTPPS_CTPPSRawToDigi_CTPPSPixelDataFormatter_h
3 
38 
40 
44 
46 
47 #include <cstdint>
48 #include <vector>
49 #include <map>
50 #include <unordered_map>
51 
52 class FEDRawData;
53 class RPixErrorChecker;
54 
56 public:
58 
59  typedef std::unordered_map<int, FEDRawData> RawData;
60  typedef std::vector<CTPPSPixelDigi> DetDigis;
61 
62  typedef std::vector<CTPPSPixelDataError> DetErrors;
63  typedef std::map<uint32_t, DetErrors> Errors;
64 
65  typedef uint32_t Word32;
66  typedef uint64_t Word64;
67 
68  typedef std::unordered_map<cms_uint32_t, DetDigis> Digis;
69 
70  CTPPSPixelDataFormatter(std::map<CTPPSPixelFramePosition, CTPPSPixelROCInfo> const& mapping,
72 
73  void setErrorStatus(bool theErrorStatus);
74 
75  int nWords() const { return m_WordCounter; }
76 
77  void interpretRawData(
78  const bool& isRun3, bool& errorsInEvent, int fedId, const FEDRawData& data, Collection& digis, Errors& errors);
79 
80  int nDigis() const { return m_DigiCounter; }
81 
82  struct PPSPixelIndex {
83  uint32_t id;
84  unsigned int roc;
85  short unsigned int rocch;
86  short unsigned int fedid;
87  short unsigned int fedch;
88  };
89 
90  void formatRawData(const bool& isRun3,
91  unsigned int lvl1_ID,
93  const Digis& digis,
94  std::vector<PPSPixelIndex> v_iDdet2fed);
95 
96  static bool compare(const PPSPixelIndex& a, const PPSPixelIndex& b) {
97  return a.id < b.id || (a.id == b.id && a.roc < b.roc);
98  }
99 
101 
102 private:
104 
107 
110 
111  int checkError(const Word32& data) const;
112 
113  std::string print(const Word64& word) const;
114 
115  const std::map<CTPPSPixelFramePosition, CTPPSPixelROCInfo>& m_Mapping;
116 
122 };
123 
124 #endif
void setErrorStatus(bool theErrorStatus)
void interpretRawData(const bool &isRun3, bool &errorsInEvent, int fedId, const FEDRawData &data, Collection &digis, Errors &errors)
std::string print(const Word64 &word) const
edm::DetSetVector< CTPPSPixelDigi > Collection
std::map< uint32_t, DetErrors > Errors
std::unordered_map< int, FEDRawData > RawData
static bool compare(const PPSPixelIndex &a, const PPSPixelIndex &b)
const std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > & m_Mapping
CTPPSRawToDigiErrorSummary & m_ErrorSummary
uint64_t word
std::unordered_map< cms_uint32_t, DetDigis > Digis
int checkError(const Word32 &data) const
void formatRawData(const bool &isRun3, unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis, std::vector< PPSPixelIndex > v_iDdet2fed)
std::vector< CTPPSPixelDataError > DetErrors
CTPPSPixelDataFormatter(std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > const &mapping, CTPPSRawToDigiErrorSummary &)
unsigned long long uint64_t
Definition: Time.h:13
std::vector< CTPPSPixelDigi > DetDigis
double b
Definition: hdecay.h:120
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
double a
Definition: hdecay.h:121
Definition: errors.py:1