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 //
45 
46 #include <vector>
47 #include <map>
48 #include <set>
49 
50 class FEDRawData;
51 class SiPixelFedCabling;
52 class SiPixelQuality;
56 
58 public:
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  typedef std::vector<PixelFEDChannel> DetBadChannels;
68  typedef std::map<cms_uint32_t, DetBadChannels> BadChannels;
69 
72 
73  PixelDataFormatter(const SiPixelFedCabling* map, bool phase1 = false);
74 
75  void setErrorStatus(bool ErrorStatus);
76  void setQualityStatus(bool QualityStatus, const SiPixelQuality* QualityInfo);
77  void setModulesToUnpack(const std::set<unsigned int>* moduleIds);
78  void passFrameReverter(const SiPixelFrameReverter* reverter);
79 
80  int nDigis() const { return theDigiCounter; }
81  int nWords() const { return theWordCounter; }
82 
83  void interpretRawData(bool& errorsInEvent, int fedId, const FEDRawData& data, Collection& digis, Errors& errors);
84 
85  void formatRawData(unsigned int lvl1_ID, RawData& fedRawData, const Digis& digis, const BadChannels& badChannels);
86 
87  cms_uint32_t linkId(cms_uint32_t word32) { return (word32 >> LINK_shift) & LINK_mask; }
88 
89 private:
90  mutable int theDigiCounter;
91  mutable int theWordCounter;
92 
96  const std::set<unsigned int>* modulesToUnpack;
97 
100  bool debug;
103  std::unique_ptr<ErrorCheckerBase> errorcheck;
104 
105  // For the 32bit data format (moved from *.cc namespace, keep uppercase for compatibility)
106  // Add special layer 1 roc for phase1
110  bool phase1;
111 
112  int checkError(const Word32& data) const;
113 
114  int digi2word(cms_uint32_t detId, const PixelDigi& digi, std::map<int, std::vector<Word32> >& words) const;
116  const PixelDigi& digi,
117  std::map<int, std::vector<Word32> >& words) const;
118 
119  int word2digi(const int fedId,
121  const bool includeError,
122  const bool useQuality,
123  const Word32& word,
124  Digis& digis) const;
125 
126  std::string print(const PixelDigi& digi) const;
127  std::string print(const Word64& word) const;
128 
129  cms_uint32_t errorDetId(const SiPixelFrameConverter* converter, int fedId, int errorType, const Word32& word) const;
130 };
131 
132 #endif
edm::DetSetVector
Definition: DetSetVector.h:61
cms_uint32_t
unsigned int cms_uint32_t
Definition: typedefs.h:15
SiPixelFrameReverter
Definition: SiPixelFrameReverter.h:17
PixelDataFormatter::nWords
int nWords() const
Definition: PixelDataFormatter.h:81
PixelDataFormatter::ADC_mask
Word32 ADC_mask
Definition: PixelDataFormatter.h:108
PixelDataFormatter::digi2word
int digi2word(cms_uint32_t detId, const PixelDigi &digi, std::map< int, std::vector< Word32 > > &words) const
Definition: PixelDataFormatter.cc:405
converter
Definition: CandidateProducer.h:25
PixelDataFormatter::Range
std::pair< DetDigis::const_iterator, DetDigis::const_iterator > Range
Definition: PixelDataFormatter.h:64
PixelDataFormatter::setModulesToUnpack
void setModulesToUnpack(const std::set< unsigned int > *moduleIds)
Definition: PixelDataFormatter.cc:121
PixelDataFormatter::DCOL_shift
int DCOL_shift
Definition: PixelDataFormatter.h:107
PixelDataFormatter::theDigiCounter
int theDigiCounter
Definition: PixelDataFormatter.h:90
PixelFEDChannel.h
PixelDataFormatter::interpretRawData
void interpretRawData(bool &errorsInEvent, int fedId, const FEDRawData &data, Collection &digis, Errors &errors)
Definition: PixelDataFormatter.cc:125
PixelDigi
Definition: PixelDigi.h:14
PixelDataFormatter::Digis
std::map< cms_uint32_t, DetDigis > Digis
Definition: PixelDataFormatter.h:63
PixelDataFormatter::theFrameReverter
const SiPixelFrameReverter * theFrameReverter
Definition: PixelDataFormatter.h:94
PixelDataFormatter::RawData
std::map< int, FEDRawData > RawData
Definition: PixelDataFormatter.h:61
PixelDataFormatter::DetDigis
std::vector< PixelDigi > DetDigis
Definition: PixelDataFormatter.h:62
PixelDigi.h
SiPixelFedCabling
Definition: SiPixelFedCabling.h:10
PixelDataFormatter::hasDetDigis
int hasDetDigis
Definition: PixelDataFormatter.h:102
PixelDataFormatter::ADC_shift
int ADC_shift
Definition: PixelDataFormatter.h:107
PixelDataFormatter::DetBadChannels
std::vector< PixelFEDChannel > DetBadChannels
Definition: PixelDataFormatter.h:67
ErrorChecker.h
PixelDataFormatter::phase1
bool phase1
Definition: PixelDataFormatter.h:110
FEDRawData
Definition: FEDRawData.h:19
PixelDataFormatter
Definition: PixelDataFormatter.h:57
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
PixelDataFormatter::errorcheck
std::unique_ptr< ErrorCheckerBase > errorcheck
Definition: PixelDataFormatter.h:103
bysipixelclustmulteventfilter_cfi.useQuality
useQuality
Definition: bysipixelclustmulteventfilter_cfi.py:7
PixelDataFormatter::DCOL_mask
Word32 DCOL_mask
Definition: PixelDataFormatter.h:108
l1t_dqm_sourceclient-live_cfg.fedRawData
fedRawData
Definition: l1t_dqm_sourceclient-live_cfg.py:188
errors
Definition: errors.py:1
PixelDataFormatter::ROW_shift
int ROW_shift
Definition: PixelDataFormatter.h:107
PixelDataFormatter::nDigis
int nDigis() const
Definition: PixelDataFormatter.h:80
PixelDataFormatter::useQualityInfo
bool useQualityInfo
Definition: PixelDataFormatter.h:99
PixelDataFormatter::Collection
edm::DetSetVector< PixelDigi > Collection
Definition: PixelDataFormatter.h:59
PixelDataFormatter::ROC_mask
Word32 ROC_mask
Definition: PixelDataFormatter.h:108
typedefs.h
PixelDataFormatter::errorDetId
cms_uint32_t errorDetId(const SiPixelFrameConverter *converter, int fedId, int errorType, const Word32 &word) const
PixelDataFormatter::badPixelInfo
const SiPixelQuality * badPixelInfo
Definition: PixelDataFormatter.h:95
PixelDataFormatter::LINK_mask
Word32 LINK_mask
Definition: PixelDataFormatter.h:108
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelQuality
Definition: SiPixelQuality.h:27
PixelDataFormatter::DetErrors
std::vector< SiPixelRawDataError > DetErrors
Definition: PixelDataFormatter.h:65
PixelDataFormatter::ROW_mask
Word32 ROW_mask
Definition: PixelDataFormatter.h:108
PixelDataFormatter::maxROCIndex
int maxROCIndex
Definition: PixelDataFormatter.h:109
PixelDataFormatter::theWordCounter
int theWordCounter
Definition: PixelDataFormatter.h:91
PixelDataFormatter::print
std::string print(const PixelDigi &digi) const
Definition: PixelDataFormatter.cc:516
cms_uint64_t
unsigned long long cms_uint64_t
Definition: typedefs.h:17
PixelDataFormatter::PXID_mask
Word32 PXID_mask
Definition: PixelDataFormatter.h:108
SiPixelFrameConverter
Definition: SiPixelFrameConverter.h:15
PixelDataFormatter::PixelDataFormatter
PixelDataFormatter(const SiPixelFedCabling *map, bool phase1=false)
Definition: PixelDataFormatter.cc:57
DetSetVector.h
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
PixelDataFormatter::linkId
cms_uint32_t linkId(cms_uint32_t word32)
Definition: PixelDataFormatter.h:87
PixelDataFormatter::LINK_shift
int LINK_shift
Definition: PixelDataFormatter.h:107
PixelDataFormatter::theCablingTree
SiPixelFedCabling const * theCablingTree
Definition: PixelDataFormatter.h:93
PixelDataFormatter::checkError
int checkError(const Word32 &data) const
PixelDataFormatter::digi2wordPhase1Layer1
int digi2wordPhase1Layer1(cms_uint32_t detId, const PixelDigi &digi, std::map< int, std::vector< Word32 > > &words) const
Definition: PixelDataFormatter.cc:428
ErrorCheckerPhase0.h
PixelDataFormatter::debug
bool debug
Definition: PixelDataFormatter.h:100
PixelDataFormatter::passFrameReverter
void passFrameReverter(const SiPixelFrameReverter *reverter)
Definition: PixelDataFormatter.cc:123
PixelDataFormatter::formatRawData
void formatRawData(unsigned int lvl1_ID, RawData &fedRawData, const Digis &digis, const BadChannels &badChannels)
Definition: PixelDataFormatter.cc:301
PixelDataFormatter::COL_mask
Word32 COL_mask
Definition: PixelDataFormatter.h:108
PixelDataFormatter::setErrorStatus
void setErrorStatus(bool ErrorStatus)
Definition: PixelDataFormatter.cc:111
SiPixelRawDataError.h
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
genParticles_cff.map
map
Definition: genParticles_cff.py:11
PixelDataFormatter::BadChannels
std::map< cms_uint32_t, DetBadChannels > BadChannels
Definition: PixelDataFormatter.h:68
PixelDataFormatter::includeErrors
bool includeErrors
Definition: PixelDataFormatter.h:98
PixelDataFormatter::PXID_shift
int PXID_shift
Definition: PixelDataFormatter.h:107
SiPixelFedCablingTree
Definition: SiPixelFedCablingTree.h:13
PixelDataFormatter::setQualityStatus
void setQualityStatus(bool QualityStatus, const SiPixelQuality *QualityInfo)
Definition: PixelDataFormatter.cc:116
PixelDataFormatter::Word32
cms_uint32_t Word32
Definition: PixelDataFormatter.h:70
PixelDataFormatter::allDetDigis
int allDetDigis
Definition: PixelDataFormatter.h:101
PixelDataFormatter::COL_shift
int COL_shift
Definition: PixelDataFormatter.h:107
PixelDataFormatter::Word64
cms_uint64_t Word64
Definition: PixelDataFormatter.h:71
PixelDataFormatter::Errors
std::map< cms_uint32_t, DetErrors > Errors
Definition: PixelDataFormatter.h:66
PixelDataFormatter::modulesToUnpack
const std::set< unsigned int > * modulesToUnpack
Definition: PixelDataFormatter.h:96
PixelDataFormatter::ROC_shift
int ROC_shift
Definition: PixelDataFormatter.h:107
SiPixelFrameReverter.h
PixelDataFormatter::word2digi
int word2digi(const int fedId, const SiPixelFrameConverter *converter, const bool includeError, const bool useQuality, const Word32 &word, Digis &digis) const
Definition: PixelDataFormatter.cc:457