Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:18

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