CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelDbItem.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiPixelObjects_SiPixelDbItem_h
2 #define CondFormats_SiPixelObjects_SiPixelDbItem_h
3 
4 //----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
17 
18 #include <boost/cstdint.hpp>
19 
21 {
22  typedef uint32_t PackedPixDbType;
23 
24  public:
25  SiPixelDbItem() : packedVal_(0) { set(2, 0, 1.0, 0); } // TO DO: is noise==2 in shifted rep or not???
27  inline short noise() { return (packedVal_ >> packing_.noise_shift ) & packing_.noise_mask ; }
28  inline short pedestal() { return (packedVal_ >> packing_.pedestal_shift ) & packing_.pedestal_mask; }
29  inline float gain() { return (packedVal_ >> packing_.gain_shift ) & packing_.gain_mask ; }
30  inline char status() { return (packedVal_ >> packing_.status_shift ) & packing_.status_mask ; }
31  inline PackedPixDbType packedValue() { return packedVal_; }
32 
33  inline void setPackedVal( PackedPixDbType p ) { packedVal_ = p; }
34 
35  // The following setters are not inline since they are more complicated:
36  void setNoise (short n);
37  void setPedestal(short p);
38  void setGain (float g);
39  void setStatus (char s);
40  void set( short noise, short pedestal, float gain, char status);
41 
42 
43  private:
45 
47 
48  class Packing {
49  public:
50  //--- Constructor: pre-computes masks and shifts from field widths
51  Packing(int noise_w, int pedestal_w, int gain_w, int status_w);
52 
53  //--- Public data:
65  };
66  static Packing packing_;
67 
68 };
69 
70 #endif
static Packing packing_
Definition: SiPixelDbItem.h:66
short pedestal()
Definition: SiPixelDbItem.h:28
PackedPixDbType packedValue()
Definition: SiPixelDbItem.h:31
Pack the pixel information to use less memory.
Definition: SiPixelDbItem.h:48
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
void setStatus(char s)
uint32_t PackedPixDbType
Definition: SiPixelDbItem.h:22
PackedPixDbType pedestal_mask
Definition: SiPixelDbItem.h:61
PackedPixDbType status_mask
Definition: SiPixelDbItem.h:58
PackedPixDbType gain_mask
Definition: SiPixelDbItem.h:59
void set(short noise, short pedestal, float gain, char status)
A fast version which sets all in one go.
PackedPixDbType noise_mask
Definition: SiPixelDbItem.h:60
void setNoise(short n)
Packing(int noise_w, int pedestal_w, int gain_w, int status_w)
void setPedestal(short p)
PackedPixDbType packedVal_
Definition: SiPixelDbItem.h:44
void setGain(float g)
void setPackedVal(PackedPixDbType p)
Definition: SiPixelDbItem.h:33