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 
19 
20 #include <boost/cstdint.hpp>
21 
23 {
24  typedef uint32_t PackedPixDbType;
25 
26  public:
27  SiPixelDbItem() : packedVal_(0) { set(2, 0, 1.0, 0); } // TO DO: is noise==2 in shifted rep or not???
29  inline short noise() { return (packedVal_ >> packing_.noise_shift ) & packing_.noise_mask ; }
30  inline short pedestal() { return (packedVal_ >> packing_.pedestal_shift ) & packing_.pedestal_mask; }
31  inline float gain() { return (packedVal_ >> packing_.gain_shift ) & packing_.gain_mask ; }
32  inline char status() { return (packedVal_ >> packing_.status_shift ) & packing_.status_mask ; }
33  inline PackedPixDbType packedValue() { return packedVal_; }
34 
35  inline void setPackedVal( PackedPixDbType p ) { packedVal_ = p; }
36 
37  // The following setters are not inline since they are more complicated:
38  void setNoise (short n);
39  void setPedestal(short p);
40  void setGain (float g);
41  void setStatus (char s);
42  void set( short noise, short pedestal, float gain, char status);
43 
44 
45  private:
47 
49 
50  class Packing {
51  public:
52  //--- Constructor: pre-computes masks and shifts from field widths
53  Packing(int noise_w, int pedestal_w, int gain_w, int status_w);
54 
55  //--- Public data:
67  };
68  static Packing packing_;
69 
70 
72 };
73 
74 #endif
static Packing packing_
Definition: SiPixelDbItem.h:68
short pedestal()
Definition: SiPixelDbItem.h:30
PackedPixDbType packedValue()
Definition: SiPixelDbItem.h:33
Pack the pixel information to use less memory.
Definition: SiPixelDbItem.h:50
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:24
PackedPixDbType pedestal_mask
Definition: SiPixelDbItem.h:63
PackedPixDbType status_mask
Definition: SiPixelDbItem.h:60
PackedPixDbType gain_mask
Definition: SiPixelDbItem.h:61
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:62
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:46
#define COND_SERIALIZABLE
Definition: Serializable.h:30
void setGain(float g)
void setPackedVal(PackedPixDbType p)
Definition: SiPixelDbItem.h:35