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 private:
86  mutable int theDigiCounter;
87  mutable int theWordCounter;
88 
92  const std::set<unsigned int> * modulesToUnpack;
93 
96  bool debug;
100 
101  // For the 32bit data format (moved from *.cc namespace, keep uppercase for compatibility)
102  // Add special layer 1 roc for phase1
108  bool phase1;
109 
110  int checkError(const Word32& data) const;
111 
112  int digi2word( cms_uint32_t detId, const PixelDigi& digi,
113  std::map<int, std::vector<Word32> > & words) const;
114  int digi2wordPhase1Layer1( cms_uint32_t detId, const PixelDigi& digi,
115  std::map<int, std::vector<Word32> > & words) const;
116 
117  int word2digi( const int fedId,
119  const bool includeError,
120  const bool useQuality,
121  const Word32& word,
122  Digis & digis) const;
123 
124  std::string print(const PixelDigi & digi) const;
125  std::string print(const Word64 & word) const;
126 
128  int fedId, int errorType, const Word32 & word) const;
129 
130 };
131 
132 #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
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)