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 8 of file MTDChannelIdentifier.h.

Member Typedef Documentation

typedef unsigned int MTDChannelIdentifier::ChannelType

Definition at line 18 of file MTDChannelIdentifier.h.

Definition at line 17 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 33 of file MTDChannelIdentifier.h.

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

34  :
35  row_width(row_w), column_width(column_w), adc_width(adc_w)
36  ,row_shift(0)
37  ,column_shift(row_shift + row_w)
38  ,time_shift(column_shift + column_w)
39  ,adc_shift(time_shift + time_w)
40  ,row_mask(~(~0U << row_w))
41  ,column_mask( ~(~0U << column_w))
42  ,time_mask(~(~0U << time_w))
43  ,adc_mask(~(~0U << adc_w))
44  ,rowcol_mask(~(~0U << (column_w+row_w)))
47  ,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 20 of file MTDChannelIdentifier.h.

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

Referenced by RectangularMTDTopology::pixelToModuleLocalPoint().

20  {
21  int row = ( ch >> GetInstance().column_width) & GetInstance().row_mask;
22  int col = ch & GetInstance().column_mask;
23  return std::pair<int,int>(row,col);
24  }
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 12 of file MTDChannelIdentifier.h.

References instance.

Referenced by channelToPixel(), and pixelToChannel().

12  {
13  static const MTDChannelIdentifier instance(6, 5, 12, 9);
14  return instance;
15  }
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 26 of file MTDChannelIdentifier.h.

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

Referenced by RectangularMTDTopology::channel().

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

Member Data Documentation

const PackedDigiType MTDChannelIdentifier::adc_mask
private

Definition at line 68 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::adc_shift
private

Definition at line 63 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::adc_width
private

Definition at line 58 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::column_mask
private

Definition at line 66 of file MTDChannelIdentifier.h.

Referenced by channelToPixel().

const int MTDChannelIdentifier::column_shift
private

Definition at line 61 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::column_width
private

Definition at line 57 of file MTDChannelIdentifier.h.

Referenced by channelToPixel(), and pixelToChannel().

const int MTDChannelIdentifier::max_adc
private

Definition at line 73 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::max_column
private

Definition at line 72 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::max_row
private

Definition at line 71 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::row_mask
private

Definition at line 65 of file MTDChannelIdentifier.h.

Referenced by channelToPixel().

const int MTDChannelIdentifier::row_shift
private

Definition at line 60 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::row_width
private

Definition at line 56 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::rowcol_mask
private

Definition at line 69 of file MTDChannelIdentifier.h.

const PackedDigiType MTDChannelIdentifier::time_mask
private

Definition at line 67 of file MTDChannelIdentifier.h.

const int MTDChannelIdentifier::time_shift
private

Definition at line 62 of file MTDChannelIdentifier.h.