CMS 3D CMS Logo

SiPixelVCal.h
Go to the documentation of this file.
1 #ifndef SiPixelVCal_h
2 #define SiPixelVCal_h
3 #include <cstdint>
4 #include <iostream>
5 #include <map>
6 #include <vector>
8 
9 class SiPixelVCal {
10 public:
13 
14  using mapToDetId = std::map<uint32_t, float>;
15 
16  struct VCal {
17  float slope = 47.;
18  float offset = -60.;
20  };
21 
22  inline void putSlopeAndOffset(std::map<unsigned int, VCal>& vcal) { m_vcal = vcal; }
23  inline const std::map<unsigned int, VCal>& getSlopeAndOffset() const { return m_vcal; }
24  bool putSlopeAndOffset(const uint32_t&, float&, float&);
25  VCal getSlopeAndOffset(const uint32_t&) const;
26  float getSlope(const uint32_t&) const;
27  float getOffset(const uint32_t&) const;
28  mapToDetId getAllSlopes() const;
29  mapToDetId getAllOffsets() const;
30  // uint32_t is pixid, see CondTools/SiPixel/test/SiPixelVCalDB.h
31 
32 private:
33  // Convert VCal to #electrons, which changes with irradiation and varies
34  // between pixel layers & disks
35  // #electrons = slope * VCal + offset
36  // with
37  // slope ~ 47 (50 for L1)
38  // offset ~ -60 (-670 for L1)
39  std::map<unsigned int, VCal> m_vcal;
40 
42 };
43 
44 #endif
SiPixelVCal::putSlopeAndOffset
void putSlopeAndOffset(std::map< unsigned int, VCal > &vcal)
Definition: SiPixelVCal.h:22
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
SiPixelVCal::getSlope
float getSlope(const uint32_t &) const
Definition: SiPixelVCal.cc:26
SiPixelVCal::getAllOffsets
mapToDetId getAllOffsets() const
Definition: SiPixelVCal.cc:55
SiPixelVCal::SiPixelVCal
SiPixelVCal()
Definition: SiPixelVCal.h:11
SiPixelVCal
Definition: SiPixelVCal.h:9
SiPixelVCal::getAllSlopes
mapToDetId getAllSlopes() const
Definition: SiPixelVCal.cc:44
SiPixelVCal::m_vcal
std::map< unsigned int, VCal > m_vcal
Definition: SiPixelVCal.h:39
SiPixelVCal::VCal
Definition: SiPixelVCal.h:16
SiPixelVCal::getSlopeAndOffset
const std::map< unsigned int, VCal > & getSlopeAndOffset() const
Definition: SiPixelVCal.h:23
Serializable.h
SiPixelVCal::getOffset
float getOffset(const uint32_t &) const
Definition: SiPixelVCal.cc:35
SiPixelVCal::mapToDetId
std::map< uint32_t, float > mapToDetId
Definition: SiPixelVCal.h:14
SiPixelVCal::~SiPixelVCal
~SiPixelVCal()
Definition: SiPixelVCal.h:12
SiPixelVCal::VCal::slope
float slope
Definition: SiPixelVCal.h:17
SiPixelVCal::VCal::offset
float offset
Definition: SiPixelVCal.h:18