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 ()
 
 CTPPSPixelDigi (int chan, int adc)
 
 CTPPSPixelDigi (int packed_value)
 
 CTPPSPixelDigi (int row, int col, int adc)
 
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) {}

◆ CTPPSPixelDigi() [2/4]

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

Definition at line 14 of file CTPPSPixelDigi.h.

14 { init(row, col, adc); }

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

◆ CTPPSPixelDigi() [3/4]

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

Definition at line 16 of file CTPPSPixelDigi.h.

16  {
17  std::pair<int, int> rc = channelToPixel(chan);
18  init(rc.first, rc.second, adc);
19  }

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

◆ CTPPSPixelDigi() [4/4]

CTPPSPixelDigi::CTPPSPixelDigi ( )
inline

Definition at line 21 of file CTPPSPixelDigi.h.

21 : theData(0) {}

Member Function Documentation

◆ adc()

unsigned short CTPPSPixelDigi::adc ( ) const
inline

Definition at line 26 of file CTPPSPixelDigi.h.

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

References adc_mask, adc_shift, and theData.

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

◆ channel()

int CTPPSPixelDigi::channel ( ) const
inline

Definition at line 37 of file CTPPSPixelDigi.h.

37 { return pixelToChannel(row(), column()); }

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

◆ channelToPixel()

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

Definition at line 29 of file CTPPSPixelDigi.h.

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  }

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

Referenced by CTPPSPixelDigi().

◆ column()

int CTPPSPixelDigi::column ( ) const
inline

Definition at line 25 of file CTPPSPixelDigi.h.

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

References column_mask, column_shift, and theData.

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

◆ 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.

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 }

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

Referenced by CTPPSPixelDigi().

◆ packedData()

uint32_t CTPPSPixelDigi::packedData ( ) const
inline

Definition at line 27 of file CTPPSPixelDigi.h.

27 { return theData; }

References theData.

Referenced by operator<().

◆ pixelToChannel()

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

Definition at line 35 of file CTPPSPixelDigi.h.

35 { return (row << column_width_ch) | col; }

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

Referenced by channel().

◆ row()

int CTPPSPixelDigi::row ( ) const
inline

Access to digi information.

Definition at line 24 of file CTPPSPixelDigi.h.

24 { return (theData >> row_shift) & row_mask; }

References row_mask, row_shift, and theData.

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

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().

CTPPSPixelDigi::row_mask
static const uint32_t row_mask
Definition: CTPPSPixelDigi.h:41
CTPPSPixelDigi::column_shift
static const uint32_t column_shift
Definition: CTPPSPixelDigi.h:40
cuy.col
col
Definition: cuy.py:1010
CTPPSPixelDigi::column
int column() const
Definition: CTPPSPixelDigi.h:25
CTPPSPixelDigi::row_shift
static const uint32_t row_shift
const values for digi packing with bit structure: adc_bits+col_bits+row_bits
Definition: CTPPSPixelDigi.h:40
CTPPSPixelDigi::max_adc
static const uint32_t max_adc
Definition: CTPPSPixelDigi.h:43
CTPPSPixelDigi::init
void init(int row, int col, int adc)
Definition: CTPPSPixelDigi.cc:22
CTPPSPixelDigi::column_mask
static const uint32_t column_mask
Definition: CTPPSPixelDigi.h:41
CTPPSPixelDigi::row
int row() const
Access to digi information.
Definition: CTPPSPixelDigi.h:24
CTPPSPixelDigi::column_mask_ch
static const uint32_t column_mask_ch
Definition: CTPPSPixelDigi.h:47
CTPPSPixelDigi::adc
unsigned short adc() const
Definition: CTPPSPixelDigi.h:26
CTPPSPixelDigi::row_mask_ch
static const uint32_t row_mask_ch
Definition: CTPPSPixelDigi.h:48
CTPPSPixelDigi::adc_shift
static const uint32_t adc_shift
Definition: CTPPSPixelDigi.h:40
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
CTPPSPixelDigi::theData
uint32_t theData
Definition: CTPPSPixelDigi.h:52
CTPPSPixelDigi::channelToPixel
static std::pair< int, int > channelToPixel(int ch)
Definition: CTPPSPixelDigi.h:29
CTPPSPixelDigi::pixelToChannel
static int pixelToChannel(int row, int col)
Definition: CTPPSPixelDigi.h:35
officialStyle.chan
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi....
Definition: officialStyle.py:106
CTPPSPixelDigi::column_width_ch
static const uint32_t column_width_ch
const values for channel definition with bit structure: row_bits+col_bits
Definition: CTPPSPixelDigi.h:46
CTPPSPixelDigi::adc_mask
static const uint32_t adc_mask
Definition: CTPPSPixelDigi.h:41