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, CTPPSPixelErrorSummary&);
71 
72  void setErrorStatus(bool theErrorStatus);
73 
74  int nWords() const { return m_WordCounter; }
75 
76  void interpretRawData(
77  const bool& isRun3, bool& errorsInEvent, int fedId, const FEDRawData& data, Collection& digis, Errors& errors);
78 
79  int nDigis() const { return m_DigiCounter; }
80 
81  struct PPSPixelIndex {
82  uint32_t id;
83  unsigned int roc;
84  short unsigned int rocch;
85  short unsigned int fedid;
86  short unsigned int fedch;
87  };
88 
89  void formatRawData(const bool& isRun3,
90  unsigned int lvl1_ID,
92  const Digis& digis,
93  std::vector<PPSPixelIndex> v_iDdet2fed);
94 
95  static bool compare(const PPSPixelIndex& a, const PPSPixelIndex& b) {
96  return a.id < b.id || (a.id == b.id && a.roc < b.roc);
97  }
98 
100 
101 private:
103 
106 
109 
110  int checkError(const Word32& data) const;
111 
112  std::string print(const Word64& word) const;
113 
114  const std::map<CTPPSPixelFramePosition, CTPPSPixelROCInfo>& m_Mapping;
115 
121 };
122 
123 #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
CTPPSPixelErrorSummary & m_ErrorSummary
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
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
unsigned long long uint64_t
Definition: Time.h:13
std::vector< CTPPSPixelDigi > DetDigis
double b
Definition: hdecay.h:118
CTPPSPixelDataFormatter(std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > const &mapping, CTPPSPixelErrorSummary &)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
double a
Definition: hdecay.h:119
Definition: errors.py:1