35 int s8 =
sizeof(char);
36 if ( s8 != 1 || s32 != 4*s8 || s64 != 2*s32) {
38 <<
" unexpected sizes: " 39 <<
" size of char is: " << s8
40 <<
", size of Word32 is: " << s32
41 <<
", size of Word64 is: " << s64
42 <<
", send exception" ;
68 if (nWords==0)
return;
71 const Word64* trailer =
reinterpret_cast<const Word64*
>(rawData.
data())+(nWords-1);
76 bool moreHeaders =
true;
81 moreHeaders = headerStatus;
85 bool moreTrailers =
true;
87 while (moreTrailers) {
91 moreTrailers = trailerStatus;
96 LogTrace(
"")<<
"data words: "<< (trailer-header-1);
108 for (
auto word = bw; word < ew; ++word) {
118 int convroc = nroc-1;
120 std::map<CTPPSPixelFramePosition, CTPPSPixelROCInfo>::const_iterator mit;
136 if ( (nlink!=link) | (nroc!=roc) ) {
137 link = nlink; roc=nroc;
140 if (skipROC)
continue;
142 auto rawId = rocp.
rawId();
145 if ( (*detDigis).empty() ) (*detDigis).
data.reserve(32);
155 if(dcol<min_Dcol || dcol>max_Dcol || pxid<min_Pixid || pxid>max_Pixid){
156 edm::LogError(
"CTPPSPixelDataFormatter")<<
" unphysical dcol and/or pxid " <<
" nllink=" << nlink
157 <<
" nroc="<< nroc <<
" adc=" << adc <<
" dcol=" << dcol <<
" pxid=" << pxid;
161 std::pair<int,int> rocPixel;
162 std::pair<int,int> modPixel;
164 rocPixel = std::make_pair(dcol,pxid);
171 (*detDigis).data.emplace_back( modPixel.first, modPixel.second, adc);
181 str <<
"word64: " <<
reinterpret_cast<const bitset<64>&
> (word);
int adc(sample_type sample)
get the ADC sample (12 bits)
Contains mappind data related to a ROC.
bool checkCRC(bool &errorsInEvent, int fedId, const Word64 *trailer) const
bool checkHeader(bool &errorsInEvent, int fedId, const Word64 *header) const
size_t size() const
Lenght of the data buffer in bytes.
reference find_or_insert(det_id_type id)
uint32_t iD
the symbolic id
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
bool checkTrailer(bool &errorsInEvent, int fedId, unsigned int nWords, const Word64 *trailer) const
bool checkROC(bool &errorsInEvent, int fedId, Word32 &errorWord) const
std::pair< int, int > toGlobalfromDcol(const std::pair< int, int > &rocPixel) const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.