CMS 3D CMS Logo

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 #include <cstdint>
20 
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; }
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 
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 private:
44 
46 
47  class Packing {
48  public:
49  //--- Constructor: pre-computes masks and shifts from field widths
50  Packing(int noise_w, int pedestal_w, int gain_w, int status_w);
51 
52  //--- Public data:
64  };
65  static Packing packing_;
66 
68 };
69 
70 #endif
static Packing packing_
Definition: SiPixelDbItem.h:65
short pedestal()
Definition: SiPixelDbItem.h:28
PackedPixDbType packedValue()
Definition: SiPixelDbItem.h:31
Pack the pixel information to use less memory.
Definition: SiPixelDbItem.h:47
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:60
PackedPixDbType status_mask
Definition: SiPixelDbItem.h:57
PackedPixDbType gain_mask
Definition: SiPixelDbItem.h:58
PackedPixDbType noise_mask
Definition: SiPixelDbItem.h:59
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:43
#define COND_SERIALIZABLE
Definition: Serializable.h:39
void setGain(float g)
void setPackedVal(PackedPixDbType p)
Definition: SiPixelDbItem.h:33