#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 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 |
Persistent digi for the Pixels.
Definition at line 13 of file PixelDigi.h.
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.
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] |
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) {}
unsigned short PixelDigi::adc | ( | ) | const [inline] |
Definition at line 38 of file PixelDigi.h.
References theData, and PixelChannelIdentifier::thePacking.
Referenced by PixelDataFormatter::digi2word(), operator<<(), and PixelDataFormatter::print().
{return (theData >> PixelChannelIdentifier::thePacking.adc_shift) & PixelChannelIdentifier::thePacking.adc_mask;}
int PixelDigi::channel | ( | ) | const [inline] |
Definition at line 51 of file PixelDigi.h.
References column(), pixelToChannel(), and row().
Referenced by operator<(), and operator<<().
{return PixelChannelIdentifier::pixelToChannel( row(), column());}
static std::pair<int,int> PixelDigi::channelToPixel | ( | int | ch | ) | [inline, static] |
Definition at line 41 of file PixelDigi.h.
References row(), and PixelChannelIdentifier::thePacking.
Referenced by TrackerHitAssociator::associatePixelRecHit(), SiPixelDigitizerAlgorithm::induce_signal(), SiPixelDigitizerAlgorithm::make_digis(), SiPixelDigitizerAlgorithm::module_killing_conf(), SiPixelDigitizerAlgorithm::module_killing_DB(), SiPixelDigitizerAlgorithm::pixel_inefficiency(), SiPixelDigitizerAlgorithm::pixel_inefficiency_db(), and PixelDigi().
{ int row = ( ch >> PixelChannelIdentifier::thePacking.column_width) & PixelChannelIdentifier::thePacking.row_mask; int col = ch & PixelChannelIdentifier::thePacking.column_mask; return std::pair<int,int>(row,col); }
int PixelDigi::column | ( | ) | const [inline] |
Definition at line 36 of file PixelDigi.h.
References theData, and PixelChannelIdentifier::thePacking.
Referenced by channel(), PixelDataFormatter::digi2word(), and PixelDataFormatter::print().
{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 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] |
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(), channel(), and SiPixelDigitizerAlgorithm::induce_signal().
{ return (row << PixelChannelIdentifier::thePacking.column_width) | col; }
int PixelDigi::row | ( | ) | const [inline] |
Definition at line 35 of file PixelDigi.h.
References theData, and PixelChannelIdentifier::thePacking.
Referenced by channel(), channelToPixel(), PixelDataFormatter::digi2word(), and PixelDataFormatter::print().
{return (theData >> PixelChannelIdentifier::thePacking.row_shift) & PixelChannelIdentifier::thePacking.row_mask;}
PackedDigiType PixelDigi::theData [private] |
Definition at line 54 of file PixelDigi.h.
Referenced by adc(), column(), init(), packedData(), and row().