CMS 3D CMS Logo

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

#include <MTDChannelIdentifier.h>

Public Types

typedef unsigned int ChannelType
 
typedef unsigned int PackedDigiType
 

Static Public Member Functions

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

Private Member Functions

 MTDChannelIdentifier (unsigned int row_w, unsigned int column_w, unsigned int time_w, unsigned int adc_w)
 
 MTDChannelIdentifier (const MTDChannelIdentifier &)=delete
 
 MTDChannelIdentifier (MTDChannelIdentifier &&)=delete
 
MTDChannelIdentifieroperator= (const MTDChannelIdentifier &)=delete
 
MTDChannelIdentifieroperator= (MTDChannelIdentifier &&)=delete
 
 ~MTDChannelIdentifier ()=default
 

Private Attributes

const PackedDigiType adc_mask
 
const int adc_shift
 
const int adc_width
 
const PackedDigiType column_mask
 
const int column_shift
 
const int column_width
 
const int max_adc
 
const int max_column
 
const int max_row
 
const PackedDigiType row_mask
 
const int row_shift
 
const int row_width
 
const PackedDigiType rowcol_mask
 
const PackedDigiType time_mask
 
const int time_shift
 

Detailed Description

Definition at line 7 of file MTDChannelIdentifier.h.

Member Typedef Documentation

typedef unsigned int MTDChannelIdentifier::ChannelType

Definition at line 15 of file MTDChannelIdentifier.h.

Definition at line 14 of file MTDChannelIdentifier.h.

Constructor & Destructor Documentation

MTDChannelIdentifier::MTDChannelIdentifier ( unsigned int  row_w,
unsigned int  column_w,
unsigned int  time_w,
unsigned int  adc_w 
)
inlineprivate

Definition at line 26 of file MTDChannelIdentifier.h.

References operator=(), and ~MTDChannelIdentifier().

27  : row_width(row_w),
28  column_width(column_w),
29  adc_width(adc_w),
30  row_shift(0),
31  column_shift(row_shift + row_w),
32  time_shift(column_shift + column_w),
33  adc_shift(time_shift + time_w),
34  row_mask(~(~0U << row_w)),
35  column_mask(~(~0U << column_w)),
36  time_mask(~(~0U << time_w)),
37  adc_mask(~(~0U << adc_w)),
38  rowcol_mask(~(~0U << (column_w + row_w))),
41  max_adc(adc_mask) {}
const PackedDigiType time_mask
const PackedDigiType column_mask
const PackedDigiType adc_mask
const PackedDigiType row_mask
const PackedDigiType rowcol_mask
MTDChannelIdentifier::~MTDChannelIdentifier ( )
privatedefault

Referenced by MTDChannelIdentifier().

MTDChannelIdentifier::MTDChannelIdentifier ( const MTDChannelIdentifier )
privatedelete
MTDChannelIdentifier::MTDChannelIdentifier ( MTDChannelIdentifier &&  )
privatedelete

Member Function Documentation

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

Definition at line 17 of file MTDChannelIdentifier.h.

References cuy::col, column_mask, column_width, GetInstance(), and row_mask.

Referenced by RectangularMTDTopology::pixelToModuleLocalPoint().

17  {
18  int row = (ch >> GetInstance().column_width) & GetInstance().row_mask;
19  int col = ch & GetInstance().column_mask;
20  return std::pair<int, int>(row, col);
21  }
const PackedDigiType column_mask
const PackedDigiType row_mask
col
Definition: cuy.py:1010
static const MTDChannelIdentifier & GetInstance()
static const MTDChannelIdentifier& MTDChannelIdentifier::GetInstance ( )
inlinestatic

Definition at line 9 of file MTDChannelIdentifier.h.

References instance.

Referenced by channelToPixel(), and pixelToChannel().

9  {
10  static const MTDChannelIdentifier instance(6, 5, 12, 9);
11  return instance;
12  }
static PFTauRenderPlugin instance
MTDChannelIdentifier& MTDChannelIdentifier::operator= ( const MTDChannelIdentifier )
privatedelete

Referenced by MTDChannelIdentifier().

MTDChannelIdentifier& MTDChannelIdentifier::operator= ( MTDChannelIdentifier &&  )
privatedelete
static int MTDChannelIdentifier::pixelToChannel ( int  row,
int  col 
)
inlinestatic

Definition at line 23 of file MTDChannelIdentifier.h.

References cuy::col, column_width, and GetInstance().

Referenced by RectangularMTDTopology::channel().

23 { return (row << GetInstance().column_width) | col; }
col
Definition: cuy.py:1010
static const MTDChannelIdentifier & GetInstance()

Member Data Documentation

const PackedDigiType MTDChannelIdentifier::adc_mask
private

Definition at line 62 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::adc_shift
private

Definition at line 57 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::adc_width
private

Definition at line 52 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::column_mask
private

Definition at line 60 of file MTDChannelIdentifier.h.

Referenced by channelToPixel().

const int MTDChannelIdentifier::column_shift
private

Definition at line 55 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::column_width
private

Definition at line 51 of file MTDChannelIdentifier.h.

Referenced by channelToPixel(), and pixelToChannel().

const int MTDChannelIdentifier::max_adc
private

Definition at line 67 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::max_column
private

Definition at line 66 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::max_row
private

Definition at line 65 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::row_mask
private

Definition at line 59 of file MTDChannelIdentifier.h.

Referenced by channelToPixel().

const int MTDChannelIdentifier::row_shift
private

Definition at line 54 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::row_width
private

Definition at line 50 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::rowcol_mask
private

Definition at line 63 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::time_mask
private

Definition at line 61 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::time_shift
private

Definition at line 56 of file MTDChannelIdentifier.h.