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(bool& errorsInEvent, int fedId, const FEDRawData& data, Collection& digis, Errors& errors);
75 
76  int nDigis() const { return m_DigiCounter; }
77 
78  struct PPSPixelIndex {
79  uint32_t id;
80  unsigned int roc;
81  short unsigned int rocch;
82  short unsigned int fedid;
83  short unsigned int fedch;
84  };
85 
86  void formatRawData(unsigned int lvl1_ID,
88  const Digis& digis,
89  std::vector<PPSPixelIndex> v_iDdet2fed);
90 
91  static bool compare(const PPSPixelIndex& a, const PPSPixelIndex& b) {
92  return a.id < b.id || (a.id == b.id && a.roc < b.roc);
93  }
94 
95 private:
97 
100 
103 
104  int checkError(const Word32& data) const;
105 
106  std::string print(const Word64& word) const;
107 
108  const std::map<CTPPSPixelFramePosition, CTPPSPixelROCInfo>& m_Mapping;
109 
114 };
115 
116 #endif
edm::DetSetVector
Definition: DetSetVector.h:61
CTPPSPixelDataFormatter::nWords
int nWords() const
Definition: CTPPSPixelDataFormatter.h:72
RPixErrorChecker.h
CTPPSPixelDataFormatter::m_ErrorCheck
RPixErrorChecker m_ErrorCheck
Definition: CTPPSPixelDataFormatter.h:99
CTPPSPixelDataFormatter::m_DCOL_shift
int m_DCOL_shift
Definition: CTPPSPixelDataFormatter.h:101
CTPPSPixelDataFormatter::CTPPSPixelDataFormatter
CTPPSPixelDataFormatter(std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > const &mapping)
Definition: CTPPSPixelDataFormatter.cc:33
CTPPSPixelDataFormatter::setErrorStatus
void setErrorStatus(bool theErrorStatus)
Definition: CTPPSPixelDataFormatter.cc:58
CTPPSPixelDataFormatter::checkError
int checkError(const Word32 &data) const
FEDRawData
Definition: FEDRawData.h:19
CTPPSPixelIndices
Definition: CTPPSPixelIndices.h:74
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
CTPPSPixelDataFormatter::Errors
std::map< uint32_t, DetErrors > Errors
Definition: CTPPSPixelDataFormatter.h:61
CTPPSPixelDataFormatter::m_DCOL_mask
Word32 m_DCOL_mask
Definition: CTPPSPixelDataFormatter.h:102
l1t_dqm_sourceclient-live_cfg.fedRawData
fedRawData
Definition: l1t_dqm_sourceclient-live_cfg.py:188
errors
Definition: errors.py:1
CTPPSPixelDataFormatter::m_Indices
CTPPSPixelIndices m_Indices
Definition: CTPPSPixelDataFormatter.h:113
CTPPSPixelIndices.h
typedefs.h
CTPPSPixelDataFormatter::m_ROC_shift
int m_ROC_shift
Definition: CTPPSPixelDataFormatter.h:101
CTPPSPixelDataFormatter::m_WordCounter
int m_WordCounter
Definition: CTPPSPixelDataFormatter.h:96
CTPPSPixelDataFormatter::PPSPixelIndex
Definition: CTPPSPixelDataFormatter.h:78
CTPPSPixelDataError.h
b
double b
Definition: hdecay.h:118
CTPPSPixelDataFormatter::RawData
std::unordered_map< int, FEDRawData > RawData
Definition: CTPPSPixelDataFormatter.h:57
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ElectronicIndex.h
CTPPSPixelDataFormatter::compare
static bool compare(const PPSPixelIndex &a, const PPSPixelIndex &b)
Definition: CTPPSPixelDataFormatter.h:91
CTPPSPixelDataFormatter::m_Mapping
const std::map< CTPPSPixelFramePosition, CTPPSPixelROCInfo > & m_Mapping
Definition: CTPPSPixelDataFormatter.h:108
CTPPSPixelDataFormatter::m_ROC_mask
Word32 m_ROC_mask
Definition: CTPPSPixelDataFormatter.h:102
a
double a
Definition: hdecay.h:119
CTPPSPixelDataFormatter::m_PXID_shift
int m_PXID_shift
Definition: CTPPSPixelDataFormatter.h:101
CTPPSPixelDataFormatter::Digis
std::unordered_map< cms_uint32_t, DetDigis > Digis
Definition: CTPPSPixelDataFormatter.h:66
CTPPSPixelDataFormatter::PPSPixelIndex::roc
unsigned int roc
Definition: CTPPSPixelDataFormatter.h:80
DetSetVector.h
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
CTPPSPixelDataFormatter::m_ADC_mask
Word32 m_ADC_mask
Definition: CTPPSPixelDataFormatter.h:102
CTPPSPixelDataFormatter::m_LINK_shift
int m_LINK_shift
Definition: CTPPSPixelDataFormatter.h:101
RPixErrorChecker
Definition: RPixErrorChecker.h:17
CTPPSPixelDigi.h
CTPPSPixelDataFormatter::nDigis
int nDigis() const
Definition: CTPPSPixelDataFormatter.h:76
CTPPSPixelDataFormatter::m_DigiCounter
int m_DigiCounter
Definition: CTPPSPixelDataFormatter.h:110
CTPPSPixelDataFormatter
Definition: CTPPSPixelDataFormatter.h:53
CTPPSPixelDataFormatter::PPSPixelIndex::fedid
short unsigned int fedid
Definition: CTPPSPixelDataFormatter.h:82
CTPPSPixelDAQMapping.h
CTPPSPixelDataFormatter::m_IncludeErrors
bool m_IncludeErrors
Definition: CTPPSPixelDataFormatter.h:98
CTPPSPixelDataFormatter::PPSPixelIndex::fedch
short unsigned int fedch
Definition: CTPPSPixelDataFormatter.h:83
CTPPSPixelDataFormatter::m_LINK_mask
Word32 m_LINK_mask
Definition: CTPPSPixelDataFormatter.h:102
CTPPSPixelDataFormatter::m_ADC_shift
int m_ADC_shift
Definition: CTPPSPixelDataFormatter.h:101
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
CTPPSPixelDataFormatter::PPSPixelIndex::id
uint32_t id
Definition: CTPPSPixelDataFormatter.h:79
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
CTPPSPixelDataFormatter::DetDigis
std::vector< CTPPSPixelDigi > DetDigis
Definition: CTPPSPixelDataFormatter.h:58
CTPPSPixelDataFormatter::m_hasDetDigis
int m_hasDetDigis
Definition: CTPPSPixelDataFormatter.h:112
CTPPSPixelDataFormatter::m_allDetDigis
int m_allDetDigis
Definition: CTPPSPixelDataFormatter.h:111
CTPPSPixelDataFormatter::print
std::string print(const Word64 &word) const
Definition: CTPPSPixelDataFormatter.cc:282
CTPPSPixelDataFormatter::DetErrors
std::vector< CTPPSPixelDataError > DetErrors
Definition: CTPPSPixelDataFormatter.h:60
CTPPSPixelDataFormatter::Collection
edm::DetSetVector< CTPPSPixelDigi > Collection
Definition: CTPPSPixelDataFormatter.h:55
CTPPSPixelDataFormatter::PPSPixelIndex::rocch
short unsigned int rocch
Definition: CTPPSPixelDataFormatter.h:81
CTPPSPixelDataFormatter::formatRawData
void formatRawData(unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis, std::vector< PPSPixelIndex > v_iDdet2fed)
Definition: CTPPSPixelDataFormatter.cc:190
CTPPSPixelDataFormatter::interpretRawData
void interpretRawData(bool &errorsInEvent, int fedId, const FEDRawData &data, Collection &digis, Errors &errors)
Definition: CTPPSPixelDataFormatter.cc:63
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:28
CTPPSPixelDataFormatter::Word32
uint32_t Word32
Definition: CTPPSPixelDataFormatter.h:63
CTPPSPixelDataFormatter::Word64
uint64_t Word64
Definition: CTPPSPixelDataFormatter.h:64
CTPPSPixelDataFormatter::m_PXID_mask
Word32 m_PXID_mask
Definition: CTPPSPixelDataFormatter.h:102