CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | 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
 

Public Member Functions

 MTDChannelIdentifier (const MTDChannelIdentifier &)=delete
 
 MTDChannelIdentifier (MTDChannelIdentifier &&)=delete
 
MTDChannelIdentifieroperator= (const MTDChannelIdentifier &)=delete
 
MTDChannelIdentifieroperator= (MTDChannelIdentifier &&)=delete
 

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 ()=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 6 of file MTDChannelIdentifier.h.

Member Typedef Documentation

◆ ChannelType

typedef unsigned int MTDChannelIdentifier::ChannelType

Definition at line 14 of file MTDChannelIdentifier.h.

◆ PackedDigiType

Definition at line 13 of file MTDChannelIdentifier.h.

Constructor & Destructor Documentation

◆ MTDChannelIdentifier() [1/3]

MTDChannelIdentifier::MTDChannelIdentifier ( const MTDChannelIdentifier )
delete

◆ MTDChannelIdentifier() [2/3]

MTDChannelIdentifier::MTDChannelIdentifier ( MTDChannelIdentifier &&  )
delete

◆ MTDChannelIdentifier() [3/3]

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

Definition at line 30 of file MTDChannelIdentifier.h.

31  : row_width(row_w),
32  column_width(column_w),
33  adc_width(adc_w),
34  row_shift(0),
35  column_shift(row_shift + row_w),
36  time_shift(column_shift + column_w),
37  adc_shift(time_shift + time_w),
38  row_mask(~(~0U << row_w)),
39  column_mask(~(~0U << column_w)),
40  time_mask(~(~0U << time_w)),
41  adc_mask(~(~0U << adc_w)),
42  rowcol_mask(~(~0U << (column_w + row_w))),
45  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::~MTDChannelIdentifier ( )
privatedefault

Member Function Documentation

◆ channelToPixel()

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

Definition at line 16 of file MTDChannelIdentifier.h.

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

Referenced by RectangularMTDTopology::pixelToModuleLocalPoint().

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

◆ GetInstance()

static const MTDChannelIdentifier& MTDChannelIdentifier::GetInstance ( )
inlinestatic

Definition at line 8 of file MTDChannelIdentifier.h.

References instance.

Referenced by channelToPixel(), and pixelToChannel().

8  {
9  static const MTDChannelIdentifier instance(6, 5, 12, 9);
10  return instance;
11  }
static PFTauRenderPlugin instance

◆ operator=() [1/2]

MTDChannelIdentifier& MTDChannelIdentifier::operator= ( const MTDChannelIdentifier )
delete

◆ operator=() [2/2]

MTDChannelIdentifier& MTDChannelIdentifier::operator= ( MTDChannelIdentifier &&  )
delete

◆ pixelToChannel()

static int MTDChannelIdentifier::pixelToChannel ( int  row,
int  col 
)
inlinestatic

Definition at line 22 of file MTDChannelIdentifier.h.

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

Referenced by RectangularMTDTopology::channel().

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

Member Data Documentation

◆ adc_mask

const PackedDigiType MTDChannelIdentifier::adc_mask
private

Definition at line 61 of file MTDChannelIdentifier.h.

◆ adc_shift

const int MTDChannelIdentifier::adc_shift
private

Definition at line 56 of file MTDChannelIdentifier.h.

◆ adc_width

const int MTDChannelIdentifier::adc_width
private

Definition at line 51 of file MTDChannelIdentifier.h.

◆ column_mask

const PackedDigiType MTDChannelIdentifier::column_mask
private

Definition at line 59 of file MTDChannelIdentifier.h.

Referenced by channelToPixel().

◆ column_shift

const int MTDChannelIdentifier::column_shift
private

Definition at line 54 of file MTDChannelIdentifier.h.

◆ column_width

const int MTDChannelIdentifier::column_width
private

Definition at line 50 of file MTDChannelIdentifier.h.

Referenced by channelToPixel(), and pixelToChannel().

◆ max_adc

const int MTDChannelIdentifier::max_adc
private

Definition at line 66 of file MTDChannelIdentifier.h.

◆ max_column

const int MTDChannelIdentifier::max_column
private

Definition at line 65 of file MTDChannelIdentifier.h.

◆ max_row

const int MTDChannelIdentifier::max_row
private

Definition at line 64 of file MTDChannelIdentifier.h.

◆ row_mask

const PackedDigiType MTDChannelIdentifier::row_mask
private

Definition at line 58 of file MTDChannelIdentifier.h.

Referenced by channelToPixel().

◆ row_shift

const int MTDChannelIdentifier::row_shift
private

Definition at line 53 of file MTDChannelIdentifier.h.

◆ row_width

const int MTDChannelIdentifier::row_width
private

Definition at line 49 of file MTDChannelIdentifier.h.

◆ rowcol_mask

const PackedDigiType MTDChannelIdentifier::rowcol_mask
private

Definition at line 62 of file MTDChannelIdentifier.h.

◆ time_mask

const PackedDigiType MTDChannelIdentifier::time_mask
private

Definition at line 60 of file MTDChannelIdentifier.h.

◆ time_shift

const int MTDChannelIdentifier::time_shift
private

Definition at line 55 of file MTDChannelIdentifier.h.