CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (int packed_value)
 
 PixelDigi (int row, int col, int adc)
 
 PixelDigi (int chan, int adc)
 
 PixelDigi ()
 
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

typedef unsigned int PixelDigi::ChannelType

Definition at line 18 of file PixelDigi.h.

typedef unsigned int PixelDigi::PackedDigiType

Definition at line 17 of file PixelDigi.h.

Constructor & Destructor Documentation

PixelDigi::PixelDigi ( int  packed_value)
inline

Definition at line 20 of file PixelDigi.h.

20 : theData(packed_value) {}
PackedDigiType theData
Definition: PixelDigi.h:75
PixelDigi::PixelDigi ( int  row,
int  col,
int  adc 
)
inline

Definition at line 22 of file PixelDigi.h.

References init().

22  {
23  init( row, col, adc);
24  }
int row() const
Definition: PixelDigi.h:56
void init(int row, int col, int adc)
Definition: PixelDigi.h:33
unsigned short adc() const
Definition: PixelDigi.h:59
int col
Definition: cuy.py:1008
PixelDigi::PixelDigi ( int  chan,
int  adc 
)
inline

Definition at line 26 of file PixelDigi.h.

References channelToPixel(), and init().

26  {
27  std::pair<int,int> rc = channelToPixel(chan);
28  init( rc.first, rc.second, adc);
29  }
void init(int row, int col, int adc)
Definition: PixelDigi.h:33
unsigned short adc() const
Definition: PixelDigi.h:59
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:62
PixelDigi::PixelDigi ( )
inline

Definition at line 31 of file PixelDigi.h.

31 : theData(0) {}
PackedDigiType theData
Definition: PixelDigi.h:75

Member Function Documentation

unsigned short PixelDigi::adc ( ) const
inline
int PixelDigi::channel ( ) const
inline

Definition at line 72 of file PixelDigi.h.

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

Referenced by operator<<().

int row() const
Definition: PixelDigi.h:56
static int pixelToChannel(int row, int col)
int column() const
Definition: PixelDigi.h:57
static std::pair<int,int> PixelDigi::channelToPixel ( int  ch)
inlinestatic
int PixelDigi::column ( ) const
inline
void PixelDigi::init ( int  row,
int  col,
int  adc 
)
inline

Definition at line 33 of file PixelDigi.h.

References PixelChannelIdentifier::Packing::adc_shift, gather_cfg::cout, bookConverter::max, PixelChannelIdentifier::Packing::max_adc, PixelChannelIdentifier::Packing::row_shift, theData, and PixelChannelIdentifier::thePacking.

Referenced by PixelDigi().

33  {
34 #ifdef FIXME_DEBUG
35  // This check is for the maximal row or col number that can be packed
36  // in a PixelDigi. The actual number of rows or columns in a detector
37  // may be smaller!
38  // it is done much better in Raw2Digi...
39  if ( row < 0 || row > PixelChannelIdentifier::thePacking.max_row ||
40  col < 0 || col > PixelChannelIdentifier::thePacking.max_column) {
41  std::cout << "PixelDigi constructor: row or column out packing range "
42  << row << ' ' << col << std::endl;
43  }
44 #endif
45 
46  // Set adc to max_adc in case of overflow
48 
50  (col << PixelChannelIdentifier::thePacking.column_shift) |
52 
53  }
int row() const
Definition: PixelDigi.h:56
static const Packing thePacking
unsigned short adc() const
Definition: PixelDigi.h:59
tuple cout
Definition: gather_cfg.py:145
int col
Definition: cuy.py:1008
PackedDigiType theData
Definition: PixelDigi.h:75
PackedDigiType PixelDigi::packedData ( ) const
inline

Definition at line 60 of file PixelDigi.h.

References theData.

Referenced by operator<().

60 {return theData;}
PackedDigiType theData
Definition: PixelDigi.h:75
static int PixelDigi::pixelToChannel ( int  row,
int  col 
)
inlinestatic

Definition at line 68 of file PixelDigi.h.

References cuy::col, and PixelChannelIdentifier::thePacking.

68  {
69  return (row << PixelChannelIdentifier::thePacking.column_width) | col;
70  }
int row() const
Definition: PixelDigi.h:56
static const Packing thePacking
int col
Definition: cuy.py:1008
int PixelDigi::row ( ) const
inline

Member Data Documentation

PackedDigiType PixelDigi::theData
private

Definition at line 75 of file PixelDigi.h.

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