CMS 3D CMS Logo

PixelDigi Class Reference

Persistent digi for the Pixels. More...

#include <DataFormats/SiPixelDigi/interface/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 ()
 PixelDigi (int chan, int adc)
 PixelDigi (int row, int col, int adc)
 PixelDigi (int packed_value)
int row () const

Static Public Member Functions

static std::pair< int, intchannelToPixel (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.

00019 : theData(packed_value) {}

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

Definition at line 21 of file PixelDigi.h.

References init().

00021                                         {
00022     init( row, col, adc);
00023   }

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

Definition at line 25 of file PixelDigi.h.

References channelToPixel(), and init().

00025                                 {
00026     std::pair<int,int> rc = channelToPixel(chan);
00027     init( rc.first, rc.second, adc);
00028   }

PixelDigi::PixelDigi (  )  [inline]

Definition at line 30 of file PixelDigi.h.

00030 : theData(0)  {}


Member Function Documentation

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

Definition at line 38 of file PixelDigi.h.

References theData, and PixelChannelIdentifier::thePacking.

Referenced by PixelDataFormatter::digi2word(), operator<<(), PixelDataFormatter::print(), and VisPixelDigiTwig::update().

int PixelDigi::channel (  )  const [inline]

Definition at line 51 of file PixelDigi.h.

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

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

static std::pair<int,int> PixelDigi::channelToPixel ( int  ch  )  [inline, static]

Definition at line 41 of file PixelDigi.h.

References parsecf::pyparsing::col(), row(), and PixelChannelIdentifier::thePacking.

Referenced by TrackerHitAssociator::associatePixelRecHit(), SiPixelDigitizerAlgorithm::induce_signal(), SiPixelDigitizerAlgorithm::make_digis(), SiPixelDigitizerAlgorithm::module_killing_conf(), SiPixelDigitizerAlgorithm::pixel_inefficiency(), SiPixelDigitizerAlgorithm::pixel_inefficiency_db(), and PixelDigi().

00041                                                   {
00042     int row = ( ch >> PixelChannelIdentifier::thePacking.column_width) & PixelChannelIdentifier::thePacking.row_mask;
00043     int col = ch & PixelChannelIdentifier::thePacking.column_mask;
00044     return std::pair<int,int>(row,col);
00045   }

int PixelDigi::column (  )  const [inline]

Definition at line 36 of file PixelDigi.h.

References theData, and PixelChannelIdentifier::thePacking.

Referenced by channel(), PixelDataFormatter::digi2word(), PixelDataFormatter::print(), and VisPixelDigiTwig::update().

00036 {return (theData >> PixelChannelIdentifier::thePacking.column_shift) & PixelChannelIdentifier::thePacking.column_mask;}

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

Definition at line 7 of file PixelDigi.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), max, theData, and PixelChannelIdentifier::thePacking.

Referenced by PixelDigi().

00007                                                {
00008   // This check is for the maximal row or col number that can be packed
00009   // in a PixelDigi. The actual number of rows or columns in a detector
00010   // may be smaller!
00011   if ( row < 0 || row > PixelChannelIdentifier::thePacking.max_row || 
00012        col < 0 || col > PixelChannelIdentifier::thePacking.max_column) {
00013     std::cout << "PixelDigi constructor: row or column out packing range" << std::endl;
00014   }
00015 
00016   // Set adc to max_adc in case of overflow
00017   adc = (adc > PixelChannelIdentifier::thePacking.max_adc) ? PixelChannelIdentifier::thePacking.max_adc : std::max(adc,0);
00018 
00019   theData = (row << PixelChannelIdentifier::thePacking.row_shift) | 
00020     (col << PixelChannelIdentifier::thePacking.column_shift) | 
00021     (adc << PixelChannelIdentifier::thePacking.adc_shift);
00022 }

PackedDigiType PixelDigi::packedData (  )  const [inline]

Definition at line 39 of file PixelDigi.h.

References theData.

00039 {return theData;}

static int PixelDigi::pixelToChannel ( int  row,
int  col 
) [inline, static]

Definition at line 47 of file PixelDigi.h.

References PixelChannelIdentifier::thePacking.

Referenced by SiPixelDigitizerAlgorithm::add_noise(), and SiPixelDigitizerAlgorithm::induce_signal().

00047                                                {
00048     return (row << PixelChannelIdentifier::thePacking.column_width) | col;
00049   }

int PixelDigi::row (  )  const [inline]

Definition at line 35 of file PixelDigi.h.

References theData, and PixelChannelIdentifier::thePacking.

Referenced by channel(), channelToPixel(), PixelDataFormatter::digi2word(), PixelDataFormatter::print(), and VisPixelDigiTwig::update().


Member Data Documentation

PackedDigiType PixelDigi::theData [private]

Definition at line 54 of file PixelDigi.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:01 2009 for CMSSW by  doxygen 1.5.4