CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
CTPPSPixelDigi Class Reference

#include <CTPPSPixelDigi.h>

Inheritance diagram for CTPPSPixelDigi:
RPixCalibDigi

Public Member Functions

unsigned short adc () const
 
int channel () const
 
int column () const
 
 CTPPSPixelDigi (int packed_value)
 
 CTPPSPixelDigi (int row, int col, int adc)
 
 CTPPSPixelDigi (int chan, int adc)
 
 CTPPSPixelDigi ()
 
uint32_t packedData () const
 
int row () const
 Access to digi information. More...
 

Static Public Member Functions

static std::pair< int, int > channelToPixel (int ch)
 
static int pixelToChannel (int row, int col)
 

Static Public Attributes

static const uint32_t adc_mask = 0x3FF
 
static const uint32_t adc_shift = 22
 
static const uint32_t adc_width = 10
 
static const uint32_t column_mask = 0x7FF
 
static const uint32_t column_mask_ch = 0x7FF
 
static const uint32_t column_shift = 11
 
static const uint32_t column_width = 11
 
static const uint32_t column_width_ch = 11
 const values for channel definition with bit structure: row_bits+col_bits More...
 
static const uint32_t max_adc = 0x3FF
 
static const uint32_t max_column = 0x7FF
 
static const uint32_t max_row = 0x7FF
 
static const uint32_t row_mask = 0x7FF
 
static const uint32_t row_mask_ch = 0x7FF
 
static const uint32_t row_shift = 0
 const values for digi packing with bit structure: adc_bits+col_bits+row_bits More...
 
static const uint32_t row_width = 11
 
static const uint32_t rowcol_mask = 0x3FFFFF
 

Private Member Functions

void init (int row, int col, int adc)
 

Private Attributes

uint32_t theData
 

Detailed Description

Persistent digi for CTPPS Pixels. Author: F.Ferro ferro.nosp@m.@ge..nosp@m.infn..nosp@m.it

Definition at line 10 of file CTPPSPixelDigi.h.

Constructor & Destructor Documentation

◆ CTPPSPixelDigi() [1/4]

CTPPSPixelDigi::CTPPSPixelDigi ( int  packed_value)
inline

Definition at line 12 of file CTPPSPixelDigi.h.

12 : theData(packed_value) {}
uint32_t theData

◆ CTPPSPixelDigi() [2/4]

CTPPSPixelDigi::CTPPSPixelDigi ( int  row,
int  col,
int  adc 
)
inline

Definition at line 14 of file CTPPSPixelDigi.h.

References adc(), cuy::col, init(), and row().

14 { init(row, col, adc); }
void init(int row, int col, int adc)
unsigned short adc() const
col
Definition: cuy.py:1009
int row() const
Access to digi information.

◆ CTPPSPixelDigi() [3/4]

CTPPSPixelDigi::CTPPSPixelDigi ( int  chan,
int  adc 
)
inline

Definition at line 16 of file CTPPSPixelDigi.h.

References adc(), officialStyle::chan, channelToPixel(), and init().

16  {
17  std::pair<int, int> rc = channelToPixel(chan);
18  init(rc.first, rc.second, adc);
19  }
static std::pair< int, int > channelToPixel(int ch)
void init(int row, int col, int adc)
unsigned short adc() const
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...

◆ CTPPSPixelDigi() [4/4]

CTPPSPixelDigi::CTPPSPixelDigi ( )
inline

Definition at line 21 of file CTPPSPixelDigi.h.

21 : theData(0) {}
uint32_t theData

Member Function Documentation

◆ adc()

unsigned short CTPPSPixelDigi::adc ( ) const
inline

Definition at line 26 of file CTPPSPixelDigi.h.

References adc_mask, adc_shift, and theData.

Referenced by CTPPSPixelDigi(), init(), and operator<<().

26 { return (theData >> adc_shift) & adc_mask; }
static const uint32_t adc_mask
static const uint32_t adc_shift
uint32_t theData

◆ channel()

int CTPPSPixelDigi::channel ( ) const
inline

Definition at line 37 of file CTPPSPixelDigi.h.

References column(), pixelToChannel(), and row().

37 { return pixelToChannel(row(), column()); }
static int pixelToChannel(int row, int col)
int row() const
Access to digi information.
int column() const

◆ channelToPixel()

static std::pair<int, int> CTPPSPixelDigi::channelToPixel ( int  ch)
inlinestatic

Definition at line 29 of file CTPPSPixelDigi.h.

References cuy::col, column_mask_ch, column_width_ch, row(), and row_mask_ch.

Referenced by CTPPSPixelDigi().

29  {
30  int row = (ch >> column_width_ch) & row_mask_ch;
31  int col = ch & column_mask_ch;
32  return std::pair<int, int>(row, col);
33  }
static const uint32_t row_mask_ch
static const uint32_t column_width_ch
const values for channel definition with bit structure: row_bits+col_bits
static const uint32_t column_mask_ch
col
Definition: cuy.py:1009
int row() const
Access to digi information.

◆ column()

int CTPPSPixelDigi::column ( ) const
inline

Definition at line 25 of file CTPPSPixelDigi.h.

References column_mask, column_shift, and theData.

Referenced by channel(), RPixDetClusterizer::make_cluster(), and operator<<().

25 { return (theData >> column_shift) & column_mask; }
uint32_t theData
static const uint32_t column_shift
static const uint32_t column_mask

◆ init()

void CTPPSPixelDigi::init ( int  row,
int  col,
int  adc 
)
private

Set adc to max_adc in case of overflow

Definition at line 22 of file CTPPSPixelDigi.cc.

References adc(), adc_shift, cuy::col, column_shift, WZElectronSkims53X_cff::max, max_adc, row(), row_shift, and theData.

Referenced by CTPPSPixelDigi().

22  {
24  adc = (uint32_t(adc) > max_adc) ? max_adc : std::max(adc, 0);
25 
26  theData = (row << row_shift) | (col << column_shift) | (adc << adc_shift);
27 }
static const uint32_t adc_shift
static const uint32_t row_shift
const values for digi packing with bit structure: adc_bits+col_bits+row_bits
unsigned short adc() const
uint32_t theData
col
Definition: cuy.py:1009
int row() const
Access to digi information.
static const uint32_t column_shift
static const uint32_t max_adc

◆ packedData()

uint32_t CTPPSPixelDigi::packedData ( ) const
inline

Definition at line 27 of file CTPPSPixelDigi.h.

References theData.

27 { return theData; }
uint32_t theData

◆ pixelToChannel()

static int CTPPSPixelDigi::pixelToChannel ( int  row,
int  col 
)
inlinestatic

Definition at line 35 of file CTPPSPixelDigi.h.

References cuy::col, column_width_ch, and row().

Referenced by channel().

35 { return (row << column_width_ch) | col; }
static const uint32_t column_width_ch
const values for channel definition with bit structure: row_bits+col_bits
col
Definition: cuy.py:1009
int row() const
Access to digi information.

◆ row()

int CTPPSPixelDigi::row ( ) const
inline

Access to digi information.

Definition at line 24 of file CTPPSPixelDigi.h.

References row_mask, row_shift, and theData.

Referenced by channel(), channelToPixel(), CTPPSPixelDigi(), init(), RPixDetClusterizer::make_cluster(), operator<<(), and pixelToChannel().

24 { return (theData >> row_shift) & row_mask; }
static const uint32_t row_mask
static const uint32_t row_shift
const values for digi packing with bit structure: adc_bits+col_bits+row_bits
uint32_t theData

Member Data Documentation

◆ adc_mask

const uint32_t CTPPSPixelDigi::adc_mask = 0x3FF
static

Definition at line 41 of file CTPPSPixelDigi.h.

Referenced by adc().

◆ adc_shift

const uint32_t CTPPSPixelDigi::adc_shift = 22
static

Definition at line 40 of file CTPPSPixelDigi.h.

Referenced by adc(), and init().

◆ adc_width

const uint32_t CTPPSPixelDigi::adc_width = 10
static

Definition at line 42 of file CTPPSPixelDigi.h.

◆ column_mask

const uint32_t CTPPSPixelDigi::column_mask = 0x7FF
static

Definition at line 41 of file CTPPSPixelDigi.h.

Referenced by column().

◆ column_mask_ch

const uint32_t CTPPSPixelDigi::column_mask_ch = 0x7FF
static

Definition at line 47 of file CTPPSPixelDigi.h.

Referenced by channelToPixel().

◆ column_shift

const uint32_t CTPPSPixelDigi::column_shift = 11
static

Definition at line 40 of file CTPPSPixelDigi.h.

Referenced by column(), and init().

◆ column_width

const uint32_t CTPPSPixelDigi::column_width = 11
static

Definition at line 42 of file CTPPSPixelDigi.h.

◆ column_width_ch

const uint32_t CTPPSPixelDigi::column_width_ch = 11
static

const values for channel definition with bit structure: row_bits+col_bits

Definition at line 46 of file CTPPSPixelDigi.h.

Referenced by channelToPixel(), and pixelToChannel().

◆ max_adc

const uint32_t CTPPSPixelDigi::max_adc = 0x3FF
static

Definition at line 43 of file CTPPSPixelDigi.h.

Referenced by init().

◆ max_column

const uint32_t CTPPSPixelDigi::max_column = 0x7FF
static

Definition at line 43 of file CTPPSPixelDigi.h.

◆ max_row

const uint32_t CTPPSPixelDigi::max_row = 0x7FF
static

Definition at line 43 of file CTPPSPixelDigi.h.

◆ row_mask

const uint32_t CTPPSPixelDigi::row_mask = 0x7FF
static

Definition at line 41 of file CTPPSPixelDigi.h.

Referenced by row().

◆ row_mask_ch

const uint32_t CTPPSPixelDigi::row_mask_ch = 0x7FF
static

Definition at line 48 of file CTPPSPixelDigi.h.

Referenced by channelToPixel().

◆ row_shift

const uint32_t CTPPSPixelDigi::row_shift = 0
static

const values for digi packing with bit structure: adc_bits+col_bits+row_bits

row_w 11, column_w 11, adc_w 10 bits

Definition at line 40 of file CTPPSPixelDigi.h.

Referenced by init(), and row().

◆ row_width

const uint32_t CTPPSPixelDigi::row_width = 11
static

Definition at line 42 of file CTPPSPixelDigi.h.

◆ rowcol_mask

const uint32_t CTPPSPixelDigi::rowcol_mask = 0x3FFFFF
static

Definition at line 41 of file CTPPSPixelDigi.h.

Referenced by operator<().

◆ theData

uint32_t CTPPSPixelDigi::theData
private

Definition at line 52 of file CTPPSPixelDigi.h.

Referenced by adc(), column(), init(), packedData(), and row().