Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:32

0001 #ifndef SiPixelVCal_h
0002 #define SiPixelVCal_h
0003 #include <cstdint>
0004 #include <iostream>
0005 #include <map>
0006 #include <vector>
0007 #include "CondFormats/Serialization/interface/Serializable.h"
0008 
0009 class SiPixelVCal {
0010 public:
0011   SiPixelVCal(){};
0012   ~SiPixelVCal(){};
0013 
0014   using mapToDetId = std::map<uint32_t, float>;
0015 
0016   struct VCal {
0017     float slope = 47.;
0018     float offset = -60.;
0019     COND_SERIALIZABLE;
0020   };
0021 
0022   inline void putSlopeAndOffset(std::map<unsigned int, VCal>& vcal) { m_vcal = vcal; }
0023   inline const std::map<unsigned int, VCal>& getSlopeAndOffset() const { return m_vcal; }
0024   bool putSlopeAndOffset(const uint32_t&, float&, float&);
0025   VCal getSlopeAndOffset(const uint32_t&) const;
0026   float getSlope(const uint32_t&) const;
0027   float getOffset(const uint32_t&) const;
0028   mapToDetId getAllSlopes() const;
0029   mapToDetId getAllOffsets() const;
0030   // uint32_t is pixid, see CondTools/SiPixel/test/SiPixelVCalDB.h
0031 
0032 private:
0033   // Convert VCal to #electrons, which changes with irradiation and varies
0034   // between pixel layers & disks
0035   //     #electrons = slope * VCal + offset
0036   // with
0037   //   slope  ~  47 (50 for L1)
0038   //   offset ~ -60 (-670 for L1)
0039   std::map<unsigned int, VCal> m_vcal;
0040 
0041   COND_SERIALIZABLE;
0042 };
0043 
0044 #endif