CMS 3D CMS Logo

PixelDataFormatter.h
Go to the documentation of this file.
1 #ifndef PixelDataFormatter_H
2 #define PixelDataFormatter_H
3 
33 //
34 // Add the phase1 format
35 //
43 
44 #include <vector>
45 #include <map>
46 #include <set>
47 
48 class FEDRawData;
49 class SiPixelFedCabling;
50 class SiPixelQuality;
54 
56 
57 public:
58 
60 
61  typedef std::map<int, FEDRawData> RawData;
62  typedef std::vector<PixelDigi> DetDigis;
63  typedef std::map<cms_uint32_t, DetDigis> Digis;
64  typedef std::pair<DetDigis::const_iterator, DetDigis::const_iterator> Range;
65  typedef std::vector<SiPixelRawDataError> DetErrors;
66  typedef std::map<cms_uint32_t, DetErrors> Errors;
67 
70 
71  PixelDataFormatter(const SiPixelFedCabling* map, bool phase1=false);
72 
73  void setErrorStatus(bool ErrorStatus);
74  void setQualityStatus(bool QualityStatus, const SiPixelQuality* QualityInfo);
75  void setModulesToUnpack(const std::set<unsigned int> * moduleIds);
76  void passFrameReverter(const SiPixelFrameReverter* reverter);
77 
78  int nDigis() const { return theDigiCounter; }
79  int nWords() const { return theWordCounter; }
80 
81  void interpretRawData(bool& errorsInEvent, int fedId, const FEDRawData & data, Collection & digis, Errors & errors);
82 
83  void formatRawData( unsigned int lvl1_ID, RawData & fedRawData, const Digis & digis);
84 
85  cms_uint32_t linkId(cms_uint32_t word32) { return (word32 >> LINK_shift) & LINK_mask; }
86 
87 private:
88  mutable int theDigiCounter;
89  mutable int theWordCounter;
90 
94  const std::set<unsigned int> * modulesToUnpack;
95 
98  bool debug;
102 
103  // For the 32bit data format (moved from *.cc namespace, keep uppercase for compatibility)
104  // Add special layer 1 roc for phase1
110  bool phase1;
111 
112 
113  int checkError(const Word32& data) const;
114 
115  int digi2word( cms_uint32_t detId, const PixelDigi& digi,
116  std::map<int, std::vector<Word32> > & words) const;
117  int digi2wordPhase1Layer1( cms_uint32_t detId, const PixelDigi& digi,
118  std::map<int, std::vector<Word32> > & words) const;
119 
120  int word2digi( const int fedId,
122  const bool includeError,
123  const bool useQuality,
124  const Word32& word,
125  Digis & digis) const;
126 
127  std::string print(const PixelDigi & digi) const;
128  std::string print(const Word64 & word) const;
129 
131  int fedId, int errorType, const Word32 & word) const;
132 
133 };
134 
135 #endif
int checkError(const Word32 &data) const
std::map< cms_uint32_t, DetDigis > Digis
void passFrameReverter(const SiPixelFrameReverter *reverter)
cms_uint32_t errorDetId(const SiPixelFrameConverter *converter, int fedId, int errorType, const Word32 &word) const
void setErrorStatus(bool ErrorStatus)
int digi2wordPhase1Layer1(cms_uint32_t detId, const PixelDigi &digi, std::map< int, std::vector< Word32 > > &words) const
std::vector< SiPixelRawDataError > DetErrors
std::string print(const PixelDigi &digi) const
void formatRawData(unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis)
void setQualityStatus(bool QualityStatus, const SiPixelQuality *QualityInfo)
const std::set< unsigned int > * modulesToUnpack
const SiPixelQuality * badPixelInfo
unsigned int cms_uint32_t
Definition: typedefs.h:15
std::map< cms_uint32_t, DetErrors > Errors
std::pair< DetDigis::const_iterator, DetDigis::const_iterator > Range
void interpretRawData(bool &errorsInEvent, int fedId, const FEDRawData &data, Collection &digis, Errors &errors)
void setModulesToUnpack(const std::set< unsigned int > *moduleIds)
const SiPixelFrameReverter * theFrameReverter
std::map< int, FEDRawData > RawData
std::vector< PixelDigi > DetDigis
int digi2word(cms_uint32_t detId, const PixelDigi &digi, std::map< int, std::vector< Word32 > > &words) const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
edm::DetSetVector< PixelDigi > Collection
cms_uint32_t linkId(cms_uint32_t word32)
int word2digi(const int fedId, const SiPixelFrameConverter *converter, const bool includeError, const bool useQuality, const Word32 &word, Digis &digis) const
Definition: errors.py:1
unsigned long long cms_uint64_t
Definition: typedefs.h:17
SiPixelFedCabling const * theCablingTree
PixelDataFormatter(const SiPixelFedCabling *map, bool phase1=false)