Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:20:06

0001 // @file PixelData.cxx
0002 // @brief Implementation for transient data of single pixel and set of pixels
0003 // from current chip
0004 // @sa <O2/Detectors/ITSMFT/common/reconstruction/src/PixelData.cxx>
0005 //     <d44292025>
0006 
0007 #include "PixelData.h"
0008 
0009 #include <sstream>
0010 
0011 using namespace mvtx;
0012 
0013 //________________________________________________________________________________
0014 void ChipPixelData::print() const
0015 {
0016   // print chip data
0017   printf("Chip %d | %4lu hits\n", mChipID, mPixels.size());
0018   for (std::size_t i = 0; i < mPixels.size(); i++)
0019   {
0020     printf("#%4ld C:%4d R: %3d\n", i, mPixels[i].getCol(), mPixels[i].getRow());
0021   }
0022 }
0023 
0024 //________________________________________________________________________________
0025 std::string ChipPixelData::getErrorDetails(int pos) const
0026 {
0027   // if possible, extract more detailed info about the error
0028   if (pos == int(ChipStat::RepeatingPixel))
0029   {
0030     std::stringstream ss;
0031     ss << ": " << (mErrorInfo & 0xffff) << "/" << ((mErrorInfo >> 16) & 0xffff);
0032     return ss.str();
0033   }
0034   if (pos == int(ChipStat::UnknownWord))
0035   {
0036     std::string rbuf = ": 0x<";
0037     int nc = getNBytesInRawBuff();
0038     for (int i = 0; i < nc; i++)
0039     {
0040       std::stringstream ss;
0041       ss << (i ? " " : "") << std::hex << (int) getRawErrBuff()[i];
0042     }
0043     rbuf += '>';
0044     return rbuf;
0045   }
0046   return {};
0047 }