CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Private Attributes

PixelDigi Class Reference

#include <PixelDigi.h>

List of all members.

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 chan, int adc)
 PixelDigi (int row, int col, int adc)
 PixelDigi (int packed_value)
 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 13 of file PixelDigi.h.


Member Typedef Documentation

typedef unsigned int PixelDigi::ChannelType

Definition at line 17 of file PixelDigi.h.

typedef unsigned int PixelDigi::PackedDigiType

Definition at line 16 of file PixelDigi.h.


Constructor & Destructor Documentation

PixelDigi::PixelDigi ( int  packed_value) [inline]

Definition at line 19 of file PixelDigi.h.

: theData(packed_value) {}
PixelDigi::PixelDigi ( int  row,
int  col,
int  adc 
) [inline]

Definition at line 21 of file PixelDigi.h.

References init().

                                        {
    init( row, col, adc);
  }
PixelDigi::PixelDigi ( int  chan,
int  adc 
) [inline]

Definition at line 25 of file PixelDigi.h.

References channelToPixel(), and init().

                                {
    std::pair<int,int> rc = channelToPixel(chan);
    init( rc.first, rc.second, adc);
  }
PixelDigi::PixelDigi ( ) [inline]

Definition at line 30 of file PixelDigi.h.

: theData(0)  {}

Member Function Documentation

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

Definition at line 51 of file PixelDigi.h.

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

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

static std::pair<int,int> PixelDigi::channelToPixel ( int  ch) [inline, static]
int PixelDigi::column ( ) const [inline]
void PixelDigi::init ( int  row,
int  col,
int  adc 
)

Definition at line 7 of file PixelDigi.cc.

References gather_cfg::cout, max(), theData, and PixelChannelIdentifier::thePacking.

Referenced by PixelDigi().

                                               {
  // This check is for the maximal row or col number that can be packed
  // in a PixelDigi. The actual number of rows or columns in a detector
  // may be smaller!
  if ( row < 0 || row > PixelChannelIdentifier::thePacking.max_row || 
       col < 0 || col > PixelChannelIdentifier::thePacking.max_column) {
    std::cout << "PixelDigi constructor: row or column out packing range" << std::endl;
  }

  // Set adc to max_adc in case of overflow
  adc = (adc > PixelChannelIdentifier::thePacking.max_adc) ? PixelChannelIdentifier::thePacking.max_adc : std::max(adc,0);

  theData = (row << PixelChannelIdentifier::thePacking.row_shift) | 
    (col << PixelChannelIdentifier::thePacking.column_shift) | 
    (adc << PixelChannelIdentifier::thePacking.adc_shift);
}
PackedDigiType PixelDigi::packedData ( ) const [inline]

Definition at line 39 of file PixelDigi.h.

References theData.

{return theData;}
static int PixelDigi::pixelToChannel ( int  row,
int  col 
) [inline, static]
int PixelDigi::row ( ) const [inline]

Member Data Documentation

Definition at line 54 of file PixelDigi.h.

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