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 (const MTDChannelIdentifier &)=delete
 
 MTDChannelIdentifier (MTDChannelIdentifier &&)=delete
 
 MTDChannelIdentifier (unsigned int row_w, unsigned int column_w, unsigned int time_w, unsigned int adc_w)
 
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 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 ( unsigned int  row_w,
unsigned int  column_w,
unsigned int  time_w,
unsigned int  adc_w 
)
inlineprivate

Definition at line 25 of file MTDChannelIdentifier.h.

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

◆ ~MTDChannelIdentifier()

MTDChannelIdentifier::~MTDChannelIdentifier ( )
privatedefault

◆ MTDChannelIdentifier() [2/3]

MTDChannelIdentifier::MTDChannelIdentifier ( const MTDChannelIdentifier )
privatedelete

◆ MTDChannelIdentifier() [3/3]

MTDChannelIdentifier::MTDChannelIdentifier ( MTDChannelIdentifier &&  )
privatedelete

Member Function Documentation

◆ channelToPixel()

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

Definition at line 16 of file MTDChannelIdentifier.h.

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  }

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

Referenced by RectangularMTDTopology::pixelToModuleLocalPoint().

◆ GetInstance()

static const MTDChannelIdentifier& MTDChannelIdentifier::GetInstance ( )
inlinestatic

Definition at line 8 of file MTDChannelIdentifier.h.

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

References instance.

Referenced by channelToPixel(), and pixelToChannel().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

MTDChannelIdentifier& MTDChannelIdentifier::operator= ( MTDChannelIdentifier &&  )
privatedelete

◆ pixelToChannel()

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

Definition at line 22 of file MTDChannelIdentifier.h.

22 { return (row << GetInstance().column_width) | col; }

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

Referenced by RectangularMTDTopology::channel().

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.

MTDChannelIdentifier::max_row
const int max_row
Definition: MTDChannelIdentifier.h:64
MTDChannelIdentifier
Definition: MTDChannelIdentifier.h:6
MTDChannelIdentifier::column_shift
const int column_shift
Definition: MTDChannelIdentifier.h:54
MTDChannelIdentifier::time_shift
const int time_shift
Definition: MTDChannelIdentifier.h:55
cuy.col
col
Definition: cuy.py:1010
MTDChannelIdentifier::row_mask
const PackedDigiType row_mask
Definition: MTDChannelIdentifier.h:58
MTDChannelIdentifier::time_mask
const PackedDigiType time_mask
Definition: MTDChannelIdentifier.h:60
MTDChannelIdentifier::adc_mask
const PackedDigiType adc_mask
Definition: MTDChannelIdentifier.h:61
MTDChannelIdentifier::column_width
const int column_width
Definition: MTDChannelIdentifier.h:50
MTDChannelIdentifier::adc_width
const int adc_width
Definition: MTDChannelIdentifier.h:51
MTDChannelIdentifier::row_shift
const int row_shift
Definition: MTDChannelIdentifier.h:53
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
MTDChannelIdentifier::GetInstance
static const MTDChannelIdentifier & GetInstance()
Definition: MTDChannelIdentifier.h:8
MTDChannelIdentifier::rowcol_mask
const PackedDigiType rowcol_mask
Definition: MTDChannelIdentifier.h:62
MTDChannelIdentifier::adc_shift
const int adc_shift
Definition: MTDChannelIdentifier.h:56
MTDChannelIdentifier::row_width
const int row_width
Definition: MTDChannelIdentifier.h:49
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
MTDChannelIdentifier::max_adc
const int max_adc
Definition: MTDChannelIdentifier.h:66
MTDChannelIdentifier::max_column
const int max_column
Definition: MTDChannelIdentifier.h:65
MTDChannelIdentifier::column_mask
const PackedDigiType column_mask
Definition: MTDChannelIdentifier.h:59