Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:01

0001 #include "DataFormats/CTPPSDigi/interface/CTPPSPixelDigi.h"
0002 
0003 /// row_w 11, column_w 11, adc_w 10 bits
0004 const uint32_t CTPPSPixelDigi::row_shift = 0;
0005 const uint32_t CTPPSPixelDigi::column_shift = 11;
0006 const uint32_t CTPPSPixelDigi::adc_shift = 22;
0007 const uint32_t CTPPSPixelDigi::row_width = 11;
0008 const uint32_t CTPPSPixelDigi::column_width = 11;
0009 const uint32_t CTPPSPixelDigi::adc_width = 10;
0010 const uint32_t CTPPSPixelDigi::row_mask = 0x7FF;
0011 const uint32_t CTPPSPixelDigi::column_mask = 0x7FF;
0012 const uint32_t CTPPSPixelDigi::adc_mask = 0x3FF;
0013 const uint32_t CTPPSPixelDigi::rowcol_mask = 0x3FFFFF;
0014 const uint32_t CTPPSPixelDigi::max_row = 0x7FF;
0015 const uint32_t CTPPSPixelDigi::max_column = 0x7FF;
0016 const uint32_t CTPPSPixelDigi::max_adc = 0x3FF;
0017 
0018 const uint32_t CTPPSPixelDigi::column_width_ch = 11;
0019 const uint32_t CTPPSPixelDigi::column_mask_ch = 0x7FF;
0020 const uint32_t CTPPSPixelDigi::row_mask_ch = 0x7FF;
0021 
0022 void CTPPSPixelDigi::init(int row, int col, int adc) {
0023   /// Set adc to max_adc in case of overflow
0024   adc = (uint32_t(adc) > max_adc) ? max_adc : std::max(adc, 0);
0025 
0026   theData = (row << row_shift) | (col << column_shift) | (adc << adc_shift);
0027 }