CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
105 
106  int checkError(const Word32& data) const;
107 
108  int digi2word( cms_uint32_t detId, const PixelDigi& digi,
109  std::map<int, std::vector<Word32> > & words) const;
110 
111  int word2digi( const int fedId,
112  const SiPixelFrameConverter* converter,
113  const bool includeError,
114  const bool useQuality,
115  const Word32& word,
116  Digis & digis) const;
117 
118  std::string print(const PixelDigi & digi) const;
119  std::string print(const Word64 & word) const;
120 
122  int fedId, int errorType, const Word32 & word) const;
123 
124 };
125 
126 #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)
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
unsigned long long cms_uint64_t
Definition: typedefs.h:17
SiPixelFedCabling const * theCablingTree
PixelDataFormatter(const SiPixelFedCabling *map, bool phase1=false)