CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PixelDigi.h
Go to the documentation of this file.
1 #ifndef TRACKINGOBJECTS_PIXELDIGI_H
2 #define TRACKINGOBJECTS_PIXELDIGI_H
3 
4 // 25/06/06 - get rid of time(), change adc() from int to undigned short. d.k.
5 
6 #include <utility>
8 
13 class PixelDigi {
14 public:
15 
16  typedef unsigned int PackedDigiType;
17  typedef unsigned int ChannelType;
18 
19  PixelDigi( int packed_value) : theData(packed_value) {}
20 
21  PixelDigi( int row, int col, int adc) {
22  init( row, col, adc);
23  }
24 
25  PixelDigi( int chan, int adc) {
26  std::pair<int,int> rc = channelToPixel(chan);
27  init( rc.first, rc.second, adc);
28  }
29 
30  PixelDigi() : theData(0) {}
31 
32  void init( int row, int col, int adc);
33 
34  // Access to digi information
37  //int time() const {return (theData >> PixelChannelIdentifier::thePacking.time_shift) & PixelChannelIdentifier::thePacking.time_mask;}
39  PackedDigiType packedData() const {return theData;}
40 
41  static std::pair<int,int> channelToPixel( int ch) {
44  return std::pair<int,int>(row,col);
45  }
46 
47  static int pixelToChannel( int row, int col) {
48  return (row << PixelChannelIdentifier::thePacking.column_width) | col;
49  }
50 
52 
53  private:
55 };
56 
57 // Comparison operators
58 
59 //inline bool operator<( const PixelDigi& one, const PixelDigi& other) {
60 // return one.channel() < other.channel();
61 //}
62 
63 inline bool operator<( const PixelDigi& one, const PixelDigi& other) {
65 }
66 
67 #include<iostream>
68 inline std::ostream & operator<<(std::ostream & o, const PixelDigi& digi) {
69  return o << " " << digi.channel()
70  << " " << digi.adc();
71 }
72 
73 #endif
int row() const
Definition: PixelDigi.h:35
PixelDigi(int chan, int adc)
Definition: PixelDigi.h:25
unsigned int ChannelType
Definition: PixelDigi.h:17
PixelDigi(int row, int col, int adc)
Definition: PixelDigi.h:21
PackedDigiType packedData() const
Definition: PixelDigi.h:39
int channel() const
Definition: PixelDigi.h:51
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
static const Packing thePacking
static int pixelToChannel(int row, int col)
Definition: PixelDigi.h:47
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
unsigned int PackedDigiType
Definition: PixelDigi.h:16
void init(int row, int col, int adc)
Definition: PixelDigi.cc:7
unsigned short adc() const
Definition: PixelDigi.h:38
PixelDigi(int packed_value)
Definition: PixelDigi.h:19
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:41
PixelDigi()
Definition: PixelDigi.h:30
static int pixelToChannel(int row, int col)
int column() const
Definition: PixelDigi.h:36
int col
Definition: cuy.py:1008
PackedDigiType theData
Definition: PixelDigi.h:54