CMS 3D CMS Logo

CTPPSPixelGainCalibration.h
Go to the documentation of this file.
1 #ifndef CondFormats_PPSObjects_CTPPSPixelGainCalibration_h
2 #define CondFormats_PPSObjects_CTPPSPixelGainCalibration_h
3 // -*- C++ -*-
4 //
5 // Package: PPSObjects
6 // Class: CTPPSPixelGainCalibration
7 //
15 // Loosely based on SiPixelObjects/SiPixelGainCalibration
16 // Original Author: Vincenzo Chiochia
17 // Created: Tue 8 12:31:25 CEST 2007
18 // Modified: Evan Friis
19 // $Id: CTPPSPixelGainCalibration.h,v 1.8 2009/02/10 17:25:42 rougny Exp $
20 // Adapted for CTPPS : Clemencia Mora Herrera November 2016
21 //
22 
25 #include <vector>
26 
29 
30 public:
31  struct DetRegistry { //to index the channels in each sensor
32  uint32_t detid;
33  uint32_t ibegin;
34  uint32_t iend;
35  uint32_t ncols;
36  uint32_t nrows;
38  };
39 
40  // Constructors
42  CTPPSPixelGainCalibration(const uint32_t& detId, const uint32_t& sensorSize, const uint32_t& nCols);
43  CTPPSPixelGainCalibration(float minPed, float maxPed, float minGain, float maxGain);
44  CTPPSPixelGainCalibration(const uint32_t& detid,
45  const std::vector<float>& peds,
46  const std::vector<float>& gains,
47  float minPed = 0.,
48  float maxPed = 255.,
49  float minGain = 0.,
50  float maxGain = 255.);
52 
53  void initialize() {}
54 
55  void setGainsPeds(const uint32_t& detId, const std::vector<float>& peds, const std::vector<float>& gains);
56 
57  double getGainLow() const { return minGain_; }
58  double getGainHigh() const { return maxGain_; }
59  double getPedLow() const { return minPed_; }
60  double getPedHigh() const { return maxPed_; }
61 
62  // Set and get public methods
63 
64  void setDeadPixel(int ipix) { putData(ipix, -9999., 0.); } // dead flag is pedestal = -9999.
65  void setNoisyPixel(int ipix) { putData(ipix, 0., -9999.); } // noisy flat is gain= -9999.
66 
67  void putData(uint32_t ipix, float ped, float gain);
68 
69  float getPed(const int& col, const int& row) const;
70  float getGain(const int& col, const int& row) const;
71  float getPed(const uint32_t ipix) const { return v_pedestals[ipix]; }
72  float getGain(const uint32_t ipix) const { return v_gains[ipix]; }
73  bool isDead(const uint32_t ipix) const { return (v_pedestals[ipix] == -9999.); }
74  bool isNoisy(const uint32_t ipix) const { return (v_gains[ipix] == -9999.); }
75  //get information related to indexes
76  uint32_t getDetId() const { return indexes.detid; }
77  uint32_t getNCols() const { return indexes.ncols; }
78  uint32_t getIBegin() const { return indexes.ibegin; }
79  uint32_t getIEnd() const { return indexes.iend; }
80  uint32_t getNRows() const { return indexes.nrows; }
81 
82 private:
83  void setIndexes(const uint32_t& detId);
84  void resetPixData(uint32_t ipix, float ped, float gain);
85 
86  std::vector<float> v_pedestals;
87  std::vector<float> v_gains;
89  // a single detRegistry w/ detID and collection of indices
90  float minPed_, maxPed_, minGain_, maxGain_; //not really used yet
91 
93 };
94 
95 #endif
CTPPSPixelGainCalibration::getIBegin
uint32_t getIBegin() const
Definition: CTPPSPixelGainCalibration.h:78
CTPPSPixelGainCalibration::getGain
float getGain(const uint32_t ipix) const
Definition: CTPPSPixelGainCalibration.h:72
CTPPSPixelGainCalibration::getNCols
uint32_t getNCols() const
Definition: CTPPSPixelGainCalibration.h:77
MessageLogger.h
CTPPSPixelGainCalibration::v_pedestals
std::vector< float > v_pedestals
Definition: CTPPSPixelGainCalibration.h:86
CTPPSPixelGainCalibration::getDetId
uint32_t getDetId() const
Definition: CTPPSPixelGainCalibration.h:76
CTPPSPixelGainCalibration::DetRegistry::iend
uint32_t iend
Definition: CTPPSPixelGainCalibration.h:34
cuy.col
col
Definition: cuy.py:1010
CTPPSPixelGainCalibration::setIndexes
void setIndexes(const uint32_t &detId)
Definition: CTPPSPixelGainCalibration.cc:105
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
CTPPSPixelGainCalibration::setDeadPixel
void setDeadPixel(int ipix)
Definition: CTPPSPixelGainCalibration.h:64
CTPPSPixelGainCalibration::isDead
bool isDead(const uint32_t ipix) const
Definition: CTPPSPixelGainCalibration.h:73
CTPPSPixelGainCalibration::getPedHigh
double getPedHigh() const
Definition: CTPPSPixelGainCalibration.h:60
CTPPSPixelGainCalibration::minPed_
float minPed_
Definition: CTPPSPixelGainCalibration.h:90
CTPPSPixelGainCalibration::initialize
void initialize()
Definition: CTPPSPixelGainCalibration.h:53
CTPPSPixelGainCalibration::getPedLow
double getPedLow() const
Definition: CTPPSPixelGainCalibration.h:59
CTPPSPixelGainCalibration
Definition: CTPPSPixelGainCalibration.h:27
CTPPSPixelGainCalibration::getGainHigh
double getGainHigh() const
Definition: CTPPSPixelGainCalibration.h:58
CTPPSPixelGainCalibration::getGainLow
double getGainLow() const
Definition: CTPPSPixelGainCalibration.h:57
CTPPSPixelGainCalibration::getGain
float getGain(const int &col, const int &row) const
Definition: CTPPSPixelGainCalibration.cc:136
CTPPSPixelGainCalibration::maxGain_
float maxGain_
Definition: CTPPSPixelGainCalibration.h:90
CTPPSPixelGainCalibration::v_gains
std::vector< float > v_gains
Definition: CTPPSPixelGainCalibration.h:87
CTPPSPixelGainCalibration::~CTPPSPixelGainCalibration
~CTPPSPixelGainCalibration()
Definition: CTPPSPixelGainCalibration.h:51
CTPPSPixelGainCalibration::getNRows
uint32_t getNRows() const
Definition: CTPPSPixelGainCalibration.h:80
CTPPSPixelGainCalibration::indexes
DetRegistry indexes
Definition: CTPPSPixelGainCalibration.h:88
CTPPSPixelGainCalibration::maxPed_
float maxPed_
Definition: CTPPSPixelGainCalibration.h:90
CTPPSPixelGainCalibration::CTPPSPixelGainCalibration
CTPPSPixelGainCalibration()
Definition: CTPPSPixelGainCalibration.cc:9
CTPPSPixelGainCalibration::getPed
float getPed(const int &col, const int &row) const
Definition: CTPPSPixelGainCalibration.cc:122
CTPPSPixelGainCalibration::minGain_
float minGain_
Definition: CTPPSPixelGainCalibration.h:90
CTPPSPixelGainCalibrations
Definition: CTPPSPixelGainCalibrations.h:8
CTPPSPixelGainCalibration::DetRegistry::ibegin
uint32_t ibegin
Definition: CTPPSPixelGainCalibration.h:33
Serializable.h
CTPPSPixelGainCalibration::setGainsPeds
void setGainsPeds(const uint32_t &detId, const std::vector< float > &peds, const std::vector< float > &gains)
Definition: CTPPSPixelGainCalibration.cc:62
CTPPSPixelGainCalibration::getPed
float getPed(const uint32_t ipix) const
Definition: CTPPSPixelGainCalibration.h:71
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
CTPPSPixelGainCalibration::resetPixData
void resetPixData(uint32_t ipix, float ped, float gain)
Definition: CTPPSPixelGainCalibration.cc:113
CTPPSPixelGainCalibration::DetRegistry::ncols
uint32_t ncols
Definition: CTPPSPixelGainCalibration.h:35
CTPPSPixelGainCalibration::DetRegistry
Definition: CTPPSPixelGainCalibration.h:31
CTPPSPixelGainCalibration::getIEnd
uint32_t getIEnd() const
Definition: CTPPSPixelGainCalibration.h:79
CTPPSPixelGainCalibration::DetRegistry::nrows
uint32_t nrows
Definition: CTPPSPixelGainCalibration.h:36
CTPPSPixelGainCalibration::DetRegistry::detid
uint32_t detid
Definition: CTPPSPixelGainCalibration.h:32
CTPPSPixelGainCalibration::setNoisyPixel
void setNoisyPixel(int ipix)
Definition: CTPPSPixelGainCalibration.h:65
CTPPSPixelGainCalibration::putData
void putData(uint32_t ipix, float ped, float gain)
Definition: CTPPSPixelGainCalibration.cc:84
CTPPSPixelGainCalibration::isNoisy
bool isNoisy(const uint32_t ipix) const
Definition: CTPPSPixelGainCalibration.h:74