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
SiPixelDbItem::Packing::pedestal_shift
int pedestal_shift
Definition: SiPixelDbItem.h:56
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
SiPixelDbItem::packing_
static Packing packing_
Definition: SiPixelDbItem.h:65
SiPixelDbItem::Packing::status_mask
PackedPixDbType status_mask
Definition: SiPixelDbItem.h:57
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SiPixelDbItem::SiPixelDbItem
SiPixelDbItem()
Definition: SiPixelDbItem.h:25
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
alignCSCRings.s
s
Definition: alignCSCRings.py:92
SiPixelDbItem::pedestal
short pedestal()
Definition: SiPixelDbItem.h:28
SiPixelDbItem::Packing::pedestal_width
int pedestal_width
Definition: SiPixelDbItem.h:62
SiPixelDbItem::status
char status()
Definition: SiPixelDbItem.h:30
SiPixelDbItem::Packing::pedestal_mask
PackedPixDbType pedestal_mask
Definition: SiPixelDbItem.h:60
SiPixelDbItem::setNoise
void setNoise(short n)
Definition: SiPixelDbItem.cc:26
SiPixelDbItem::set
void set(short noise, short pedestal, float gain, char status)
A fast version which sets all in one go.
Definition: SiPixelDbItem.cc:55
SiPixelDbItem::Packing::status_shift
int status_shift
Definition: SiPixelDbItem.h:53
SiPixelDbItem::setGain
void setGain(float g)
Definition: SiPixelDbItem.cc:38
SiPixelDbItem
Definition: SiPixelDbItem.h:21
SiPixelDbItem::Packing::noise_mask
PackedPixDbType noise_mask
Definition: SiPixelDbItem.h:59
SiPixelDbItem::setPedestal
void setPedestal(short p)
Definition: SiPixelDbItem.cc:32
SiPixelDbItem::gain
float gain()
Definition: SiPixelDbItem.h:29
Serializable.h
SiPixelDbItem::~SiPixelDbItem
~SiPixelDbItem()
Definition: SiPixelDbItem.h:26
SiPixelDbItem::Packing
Pack the pixel information to use less memory.
Definition: SiPixelDbItem.h:47
SiPixelDbItem::noise
short noise()
Definition: SiPixelDbItem.h:27
SiPixelDbItem::setPackedVal
void setPackedVal(PackedPixDbType p)
Definition: SiPixelDbItem.h:33
SiPixelDbItem::Packing::gain_shift
int gain_shift
Definition: SiPixelDbItem.h:54
SiPixelDbItem::packedVal_
PackedPixDbType packedVal_
Definition: SiPixelDbItem.h:43
SiPixelDbItem::Packing::Packing
Packing(int noise_w, int pedestal_w, int gain_w, int status_w)
Definition: SiPixelDbItem.cc:64
SiPixelDbItem::setStatus
void setStatus(char s)
Definition: SiPixelDbItem.cc:48
SiPixelDbItem::packedValue
PackedPixDbType packedValue()
Definition: SiPixelDbItem.h:31
SiPixelDbItem::Packing::noise_width
int noise_width
Definition: SiPixelDbItem.h:61
SiPixelDbItem::Packing::status_width
int status_width
Definition: SiPixelDbItem.h:63
SiPixelDbItem::PackedPixDbType
uint32_t PackedPixDbType
Definition: SiPixelDbItem.h:22
SiPixelDbItem::Packing::gain_mask
PackedPixDbType gain_mask
Definition: SiPixelDbItem.h:58
g
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
SiPixelDbItem::Packing::noise_shift
int noise_shift
Definition: SiPixelDbItem.h:55