36 int s8 =
sizeof(char);
37 if ( s8 != 1 || s32 != 4*s8 || s64 != 2*s32) {
39 <<
" unexpected sizes: " 40 <<
" size of char is: " << s8
41 <<
", size of Word32 is: " << s32
42 <<
", size of Word64 is: " << s64
43 <<
", send exception" ;
77 if (nWords==0)
return;
80 const Word64* trailer =
reinterpret_cast<const Word64*
>(rawData.
data())+(nWords-1);
85 bool moreHeaders =
true;
90 moreHeaders = headerStatus;
94 bool moreTrailers =
true;
96 while (moreTrailers) {
100 moreTrailers = trailerStatus;
105 LogTrace(
"")<<
"data words: "<< (trailer-header-1);
117 for (
auto word = bw; word < ew; ++word) {
127 int convroc = nroc-1;
129 std::map<CTPPSPixelFramePosition, CTPPSPixelROCInfo>::const_iterator mit;
133 if(nlink >= maxLinkIndex){
136 else if((nroc-1)>=maxRocIndex){
148 if ( (nlink!=link) | (nroc!=roc) ) {
149 link = nlink; roc=nroc;
152 if (skipROC)
continue;
154 auto rawId = rocp.
rawId();
157 if ( (*detDigis).empty() ) (*detDigis).
data.reserve(32);
166 if(dcol<min_Dcol || dcol>max_Dcol || pxid<min_Pixid || pxid>max_Pixid){
167 edm::LogError(
"CTPPSPixelDataFormatter")<<
" unphysical dcol and/or pxid " <<
" nllink=" << nlink
168 <<
" nroc="<< nroc <<
" adc=" << adc <<
" dcol=" << dcol <<
" pxid=" << pxid;
175 std::pair<int,int> rocPixel;
176 std::pair<int,int> modPixel;
178 rocPixel = std::make_pair(dcol,pxid);
185 (*detDigis).data.emplace_back( modPixel.first, modPixel.second, adc);
194 std::ostringstream
str;
195 str <<
"word64: " <<
reinterpret_cast<const std::bitset<64>&
> (word);
Contains mappind data related to a ROC.
void conversionError(int fedId, uint32_t iD, const State &state, const Word32 &errorWord, Errors &errors) const
bool checkCRC(bool &errorsInEvent, int fedId, const Word64 *trailer, Errors &errors) const
bool checkHeader(bool &errorsInEvent, int fedId, const Word64 *header, Errors &errors) 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
static constexpr Word32 dummyDetId
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
void setErrorStatus(bool errorStatus)
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.
bool checkTrailer(bool &errorsInEvent, int fedId, unsigned int nWords, const Word64 *trailer, Errors &errors) const
bool checkROC(bool &errorsInEvent, int fedId, uint32_t iD, const Word32 &errorWord, Errors &errors) const