CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

typedef unsigned int MTDChannelIdentifier::ChannelType

Definition at line 14 of file MTDChannelIdentifier.h.

Definition at line 13 of file MTDChannelIdentifier.h.

Constructor & Destructor Documentation

MTDChannelIdentifier::MTDChannelIdentifier ( const MTDChannelIdentifier )
delete
MTDChannelIdentifier::MTDChannelIdentifier ( MTDChannelIdentifier &&  )
delete
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 ( )
privatedefault

Member Function Documentation

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
static const MTDChannelIdentifier & GetInstance()
int col
Definition: cuy.py:1009
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
MTDChannelIdentifier& MTDChannelIdentifier::operator= ( const MTDChannelIdentifier )
delete
MTDChannelIdentifier& MTDChannelIdentifier::operator= ( MTDChannelIdentifier &&  )
delete
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; }
static const MTDChannelIdentifier & GetInstance()
int col
Definition: cuy.py:1009

Member Data Documentation

const PackedDigiType MTDChannelIdentifier::adc_mask
private

Definition at line 61 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::adc_shift
private

Definition at line 56 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::adc_width
private

Definition at line 51 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::column_mask
private

Definition at line 59 of file MTDChannelIdentifier.h.

Referenced by channelToPixel().

const int MTDChannelIdentifier::column_shift
private

Definition at line 54 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::column_width
private

Definition at line 50 of file MTDChannelIdentifier.h.

Referenced by channelToPixel(), and pixelToChannel().

const int MTDChannelIdentifier::max_adc
private

Definition at line 66 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::max_column
private

Definition at line 65 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::max_row
private

Definition at line 64 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::row_mask
private

Definition at line 58 of file MTDChannelIdentifier.h.

Referenced by channelToPixel().

const int MTDChannelIdentifier::row_shift
private

Definition at line 53 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::row_width
private

Definition at line 49 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::rowcol_mask
private

Definition at line 62 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::time_mask
private

Definition at line 60 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::time_shift
private

Definition at line 55 of file MTDChannelIdentifier.h.