CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PixelChannelIdentifier.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_PIXELCHANMNELIDENTIFIER_H
2 #define DATAFORMATS_PIXELCHANMNELIDENTIFIER_H
3 
4 #include <utility>
5 
7  public:
8 
9  typedef unsigned int PackedDigiType;
10  typedef unsigned int ChannelType;
11 
12  static std::pair<int,int> channelToPixel( int ch) {
13  int row = ( ch >> thePacking.column_width) & thePacking.row_mask;
14  int col = ch & thePacking.column_mask;
15  return std::pair<int,int>(row,col);
16  }
17 
18  static int pixelToChannel( int row, int col) {
19  return (row << thePacking.column_width) | col;
20  }
21 
22  private:
27  class Packing {
28  public:
29 
30  // Constructor: pre-computes masks and shifts from field widths
31  Packing(const int row_w, const int column_w,
32  const int time_w, const int adc_w);
33 
34  // public data:
35  int adc_shift;
37  int row_shift;
39 
44 
45  int row_width;
47  int adc_width;
48 
49  int max_row;
51  int max_adc;
52  };
53 
54  public:
56 };
57 
58 
59 #endif
static std::pair< int, int > channelToPixel(int ch)
Packing(const int row_w, const int column_w, const int time_w, const int adc_w)
static int pixelToChannel(int row, int col)
int col
Definition: cuy.py:1008