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 
45 #include <cstdint>
46 #include <vector>
47 #include <map>
48 #include <unordered_map>
49 
50 class FEDRawData;
51 class RPixErrorChecker;
52 
54 public:
56 
57  typedef std::unordered_map<int, FEDRawData> RawData;
58  typedef std::vector<CTPPSPixelDigi> DetDigis;
59 
60  typedef std::vector<CTPPSPixelDataError> DetErrors;
61  typedef std::map<uint32_t, DetErrors> Errors;
62 
63  typedef uint32_t Word32;
64  typedef uint64_t Word64;
65 
66  typedef std::unordered_map<cms_uint32_t, DetDigis> Digis;
67 
68  CTPPSPixelDataFormatter(std::map<CTPPSPixelFramePosition, CTPPSPixelROCInfo> const& mapping);
69 
70  void setErrorStatus(bool theErrorStatus);
71 
72  int nWords() const { return m_WordCounter; }
73 
74  void interpretRawData(
75  const bool& isRun3, bool& errorsInEvent, int fedId, const FEDRawData& data, Collection& digis, Errors& errors);
76 
77  int nDigis() const { return m_DigiCounter; }
78 
79  struct PPSPixelIndex {
80  uint32_t id;
81  unsigned int roc;
82  short unsigned int rocch;
83  short unsigned int fedid;
84  short unsigned int fedch;
85  };
86 
87  void formatRawData(const bool& isRun3,
88  unsigned int lvl1_ID,
90  const Digis& digis,
91  std::vector<PPSPixelIndex> v_iDdet2fed);
92 
93  static bool compare(const PPSPixelIndex& a, const PPSPixelIndex& b) {
94  return a.id < b.id || (a.id == b.id && a.roc < b.roc);
95  }
96 
97 private:
99 
102 
105 
106  int checkError(const Word32& data) const;
107 
108  std::string print(const Word64& word) const;
109 
110  const std::map<CTPPSPixelFramePosition, CTPPSPixelROCInfo>& m_Mapping;
111 
116 };
117 
118 #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
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
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
double a
Definition: hdecay.h:119
Definition: errors.py:1
CTPPSPixelDataFormatter(std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > const &mapping)