CMS 3D CMS Logo

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

#include <PixelDigi.h>

Public Types

typedef unsigned int ChannelType
 
typedef unsigned int PackedDigiType
 

Public Member Functions

unsigned short adc () const
 
int channel () const
 
int column () const
 
void init (int row, int col, int adc)
 
PackedDigiType packedData () const
 
 PixelDigi ()
 
 PixelDigi (int chan, int adc)
 
 PixelDigi (int row, int col, int adc)
 
 PixelDigi (PackedDigiType packed_value)
 
int row () const
 

Static Public Member Functions

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

Private Attributes

PackedDigiType theData
 

Detailed Description

Persistent digi for the Pixels.

Definition at line 14 of file PixelDigi.h.

Member Typedef Documentation

◆ ChannelType

typedef unsigned int PixelDigi::ChannelType

Definition at line 17 of file PixelDigi.h.

◆ PackedDigiType

typedef unsigned int PixelDigi::PackedDigiType

Definition at line 16 of file PixelDigi.h.

Constructor & Destructor Documentation

◆ PixelDigi() [1/4]

PixelDigi::PixelDigi ( PackedDigiType  packed_value)
inlineexplicit

Definition at line 19 of file PixelDigi.h.

19 : theData(packed_value) {}

◆ PixelDigi() [2/4]

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

Definition at line 21 of file PixelDigi.h.

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

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

◆ PixelDigi() [3/4]

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

Definition at line 23 of file PixelDigi.h.

23  {
24  std::pair<int, int> rc = channelToPixel(chan);
25  init(rc.first, rc.second, adc);
26  }

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

◆ PixelDigi() [4/4]

PixelDigi::PixelDigi ( )
inline

Definition at line 28 of file PixelDigi.h.

28 : theData(0) {}

Member Function Documentation

◆ adc()

unsigned short PixelDigi::adc ( ) const
inline

◆ channel()

int PixelDigi::channel ( ) const
inline

Definition at line 73 of file PixelDigi.h.

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

Referenced by operator<<().

◆ channelToPixel()

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

◆ column()

int PixelDigi::column ( ) const
inline

◆ init()

void PixelDigi::init ( int  row,
int  col,
int  adc 
)
inline

Definition at line 30 of file PixelDigi.h.

30  {
31 #ifdef FIXME_DEBUG
32  // This check is for the maximal row or col number that can be packed
33  // in a PixelDigi. The actual number of rows or columns in a detector
34  // may be smaller!
35  // it is done much better in Raw2Digi...
36  if (row < 0 || row > PixelChannelIdentifier::thePacking.max_row || col < 0 ||
38  std::cout << "PixelDigi constructor: row or column out packing range " << row << ' ' << col << std::endl;
39  }
40 #endif
41 
42  // Set adc to max_adc in case of overflow
44  : std::max(adc, 0);
45 
47  (col << PixelChannelIdentifier::thePacking.column_shift) |
49  }

References adc(), pixelchanelidentifierimpl::Packing::adc_shift, cuy::col, gather_cfg::cout, SiStripPI::max, pixelchanelidentifierimpl::Packing::max_adc, row(), pixelchanelidentifierimpl::Packing::row_shift, theData, and PixelChannelIdentifier::thePacking.

Referenced by PixelDigi().

◆ packedData()

PackedDigiType PixelDigi::packedData ( ) const
inline

Definition at line 63 of file PixelDigi.h.

63 { return theData; }

References theData.

◆ pixelToChannel()

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

◆ row()

int PixelDigi::row ( ) const
inline

Member Data Documentation

◆ theData

PackedDigiType PixelDigi::theData
private

Definition at line 76 of file PixelDigi.h.

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

PixelDigi::init
void init(int row, int col, int adc)
Definition: PixelDigi.h:30
pixelchanelidentifierimpl::Packing::row_mask
const PackedDigiType row_mask
Definition: PixelChannelIdentifier.h:42
cuy.col
col
Definition: cuy.py:1010
gather_cfg.cout
cout
Definition: gather_cfg.py:144
PixelChannelIdentifier::thePacking
constexpr static Packing thePacking
Definition: PixelChannelIdentifier.h:72
pixelchanelidentifierimpl::Packing::max_adc
const int max_adc
Definition: PixelChannelIdentifier.h:50
PixelChannelIdentifier::pixelToChannel
static int pixelToChannel(int row, int col)
Definition: PixelChannelIdentifier.h:65
PixelDigi::theData
PackedDigiType theData
Definition: PixelDigi.h:76
pixelchanelidentifierimpl::Packing::adc_shift
const int adc_shift
Definition: PixelChannelIdentifier.h:40
PixelDigi::column
int column() const
Definition: PixelDigi.h:55
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
pixelchanelidentifierimpl::Packing::column_width
const int column_width
Definition: PixelChannelIdentifier.h:34
pixelchanelidentifierimpl::Packing::row_shift
const int row_shift
Definition: PixelChannelIdentifier.h:37
PixelDigi::row
int row() const
Definition: PixelDigi.h:52
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
PixelDigi::adc
unsigned short adc() const
Definition: PixelDigi.h:60
pixelchanelidentifierimpl::Packing::column_mask
const PackedDigiType column_mask
Definition: PixelChannelIdentifier.h:43
pixelchanelidentifierimpl::Packing::adc_mask
const PackedDigiType adc_mask
Definition: PixelChannelIdentifier.h:45
PixelDigi::channelToPixel
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:65