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>

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::CTPPSPixelDigi ( int  packed_value)
inline

Definition at line 14 of file CTPPSPixelDigi.h.

14 : theData(packed_value) {}
uint32_t theData
CTPPSPixelDigi::CTPPSPixelDigi ( int  row,
int  col,
int  adc 
)
inline

Definition at line 16 of file CTPPSPixelDigi.h.

References init().

16  {
17  init( row, col, adc);
18  }
void init(int row, int col, int adc)
int row() const
Access to digi information.
col
Definition: cuy.py:1008
unsigned short adc() const
CTPPSPixelDigi::CTPPSPixelDigi ( int  chan,
int  adc 
)
inline

Definition at line 20 of file CTPPSPixelDigi.h.

References channelToPixel(), and init().

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

Definition at line 25 of file CTPPSPixelDigi.h.

25 : theData(0) {}
uint32_t theData

Member Function Documentation

unsigned short CTPPSPixelDigi::adc ( ) const
inline

Definition at line 30 of file CTPPSPixelDigi.h.

References adc_mask, adc_shift, and theData.

Referenced by operator<<().

30 {return (theData >> adc_shift) & adc_mask;}
static const uint32_t adc_mask
static const uint32_t adc_shift
uint32_t theData
int CTPPSPixelDigi::channel ( ) const
inline

Definition at line 43 of file CTPPSPixelDigi.h.

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

43 {return pixelToChannel( row(), column());}
int row() const
Access to digi information.
int column() const
static int pixelToChannel(int row, int col)
static std::pair<int,int> CTPPSPixelDigi::channelToPixel ( int  ch)
inlinestatic

Definition at line 33 of file CTPPSPixelDigi.h.

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

Referenced by CTPPSPixelDigi().

33  {
34  int row = ( ch >> column_width_ch) & row_mask_ch;
35  int col = ch & column_mask_ch;
36  return std::pair<int,int>(row,col);
37  }
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
int row() const
Access to digi information.
col
Definition: cuy.py:1008
int CTPPSPixelDigi::column ( ) const
inline

Definition at line 29 of file CTPPSPixelDigi.h.

References column_mask, column_shift, and theData.

Referenced by channel(), and operator<<().

29 {return (theData >> column_shift) & column_mask;}
uint32_t theData
static const uint32_t column_shift
static const uint32_t column_mask
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_shift, column_shift, hpstanc_transforms::max, max_adc, row_shift, and theData.

Referenced by CTPPSPixelDigi().

22  {
23 
25  adc = (uint32_t(adc) > max_adc) ? max_adc : std::max(adc,0);
26 
27  theData = (row << row_shift) |
28  (col << column_shift) |
29  (adc << adc_shift);
30 
31 }
int row() const
Access to digi information.
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
uint32_t theData
col
Definition: cuy.py:1008
static const uint32_t column_shift
unsigned short adc() const
static const uint32_t max_adc
uint32_t CTPPSPixelDigi::packedData ( ) const
inline

Definition at line 31 of file CTPPSPixelDigi.h.

References theData.

Referenced by operator<().

31 {return theData;}
uint32_t theData
static int CTPPSPixelDigi::pixelToChannel ( int  row,
int  col 
)
inlinestatic

Definition at line 39 of file CTPPSPixelDigi.h.

References cuy::col, and column_width_ch.

Referenced by channel().

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

Access to digi information.

Definition at line 28 of file CTPPSPixelDigi.h.

References row_mask, row_shift, and theData.

Referenced by channel(), channelToPixel(), and operator<<().

28 {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

const uint32_t CTPPSPixelDigi::adc_mask = 0x3FF
static

Definition at line 47 of file CTPPSPixelDigi.h.

Referenced by adc().

const uint32_t CTPPSPixelDigi::adc_shift = 22
static

Definition at line 46 of file CTPPSPixelDigi.h.

Referenced by adc(), and init().

const uint32_t CTPPSPixelDigi::adc_width = 10
static

Definition at line 48 of file CTPPSPixelDigi.h.

const uint32_t CTPPSPixelDigi::column_mask = 0x7FF
static

Definition at line 47 of file CTPPSPixelDigi.h.

Referenced by column().

const uint32_t CTPPSPixelDigi::column_mask_ch = 0x7FF
static

Definition at line 53 of file CTPPSPixelDigi.h.

Referenced by channelToPixel().

const uint32_t CTPPSPixelDigi::column_shift = 11
static

Definition at line 46 of file CTPPSPixelDigi.h.

Referenced by column(), and init().

const uint32_t CTPPSPixelDigi::column_width = 11
static

Definition at line 48 of file CTPPSPixelDigi.h.

const uint32_t CTPPSPixelDigi::column_width_ch = 11
static

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

Definition at line 52 of file CTPPSPixelDigi.h.

Referenced by channelToPixel(), and pixelToChannel().

const uint32_t CTPPSPixelDigi::max_adc = 0x3FF
static

Definition at line 49 of file CTPPSPixelDigi.h.

Referenced by init().

const uint32_t CTPPSPixelDigi::max_column = 0x7FF
static

Definition at line 49 of file CTPPSPixelDigi.h.

const uint32_t CTPPSPixelDigi::max_row = 0x7FF
static

Definition at line 49 of file CTPPSPixelDigi.h.

const uint32_t CTPPSPixelDigi::row_mask = 0x7FF
static

Definition at line 47 of file CTPPSPixelDigi.h.

Referenced by row().

const uint32_t CTPPSPixelDigi::row_mask_ch = 0x7FF
static

Definition at line 54 of file CTPPSPixelDigi.h.

Referenced by channelToPixel().

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 46 of file CTPPSPixelDigi.h.

Referenced by init(), and row().

const uint32_t CTPPSPixelDigi::row_width = 11
static

Definition at line 48 of file CTPPSPixelDigi.h.

const uint32_t CTPPSPixelDigi::rowcol_mask = 0x3FFFFF
static

Definition at line 47 of file CTPPSPixelDigi.h.

Referenced by operator<().

uint32_t CTPPSPixelDigi::theData
private

Definition at line 59 of file CTPPSPixelDigi.h.

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