CMS 3D CMS Logo

SiPixelGainCalibration.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiPixelObjects_SiPixelGainCalibration_h
2 #define CondFormats_SiPixelObjects_SiPixelGainCalibration_h
3 // -*- C++ -*-
4 //
5 // Package: SiPixelObjects
6 // Class: SiPixelGainCalibration
7 //
15 //
16 // Original Author: Vincenzo Chiochia
17 // Created: Tue 8 12:31:25 CEST 2007
18 // Modified: Evan Friis
19 // $Id: SiPixelGainCalibration.h,v 1.8 2009/02/10 17:25:42 rougny Exp $
20 //
21 //
23 
24 #include <vector>
25 #include <map>
26 #include <iostream>
27 #include <cstdint>
28 
30 public:
32  unsigned int gain : 8;
33  unsigned int ped : 8;
34  };
35 
36  struct DetRegistry {
37  uint32_t detid;
38  uint32_t ibegin;
39  uint32_t iend;
40  int ncols;
41 
43  };
44 
46  public:
47  bool operator()(const DetRegistry& p, const uint32_t& i) const { return p.detid < i; }
48  };
49 
50  typedef std::vector<char>::const_iterator ContainerIterator;
51  typedef std::pair<ContainerIterator, ContainerIterator> Range;
52  typedef std::vector<DetRegistry> Registry;
53  typedef Registry::const_iterator RegistryIterator;
54 
55  // Constructors
57  SiPixelGainCalibration(float minPed, float maxPed, float minGain, float maxGain);
59 
60  void initialize() {}
61 
62  bool put(const uint32_t& detID, Range input, const int& nCols);
63  const Range getRange(const uint32_t& detID) const;
64  void getDetIds(std::vector<uint32_t>& DetIds_) const;
65  const int getNCols(const uint32_t& detID) const;
66  const std::pair<const Range, const int> getRangeAndNCols(const uint32_t& detID) const;
67 
69  double getGainLow() const { return minGain_; }
70  double getGainHigh() const { return maxGain_; }
71  double getPedLow() const { return minPed_; }
72  double getPedHigh() const { return maxPed_; }
73 
74  // Set and get public methods
75  void setData(
76  float ped, float gain, std::vector<char>& vped, bool thisPixelIsDead = false, bool thisPixelIsNoisy = false);
77 
78  void setDeadPixel(std::vector<char>& vped) { setData(0, 0, /*dummy values, not used*/ vped, true, false); }
79  void setNoisyPixel(std::vector<char>& vped) { setData(0, 0, /*dummy values, not used*/ vped, false, true); }
80 
81  float getPed(const int& col, const int& row, const Range& range, const int& nCols, bool& isDead, bool& isNoisy) const;
82  float getGain(const int& col, const int& row, const Range& range, const int& nCols, bool& isDead, bool& isNoisy) const;
83 
84 private:
85  float encodeGain(const float& gain);
86  float encodePed(const float& ped);
87  float decodeGain(unsigned int gain) const;
88  float decodePed(unsigned int ped) const;
89 
90  std::vector<char> v_pedestals; //@@@ blob streaming doesn't work with uint16_t and with classes
91  std::vector<DetRegistry> indexes;
93 
94  //THIS WILL BE HARDCODED TO 1 (no averaging) DON'T CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING!
96 
97  unsigned int nBinsToUseForEncoding_;
98  unsigned int deadFlag_;
99  unsigned int noisyFlag_;
100 
102 };
103 
104 #endif
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
SiPixelGainCalibration::DecodingStructure::ped
unsigned int ped
Definition: SiPixelGainCalibration.h:33
mps_fire.i
i
Definition: mps_fire.py:428
input
static const std::string input
Definition: EdmProvDump.cc:48
SiPixelGainCalibration::decodePed
float decodePed(unsigned int ped) const
Definition: SiPixelGainCalibration.cc:178
SiPixelGainCalibration::encodePed
float encodePed(const float &ped)
Definition: SiPixelGainCalibration.cc:167
SiPixelGainCalibration::getNumberOfRowsToAverageOver
unsigned int getNumberOfRowsToAverageOver() const
Definition: SiPixelGainCalibration.h:68
SiPixelGainCalibration::getPedHigh
double getPedHigh() const
Definition: SiPixelGainCalibration.h:72
SiPixelGainCalibration::getRange
const Range getRange(const uint32_t &detID) const
Definition: SiPixelGainCalibration.cc:69
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SiPixelGainCalibration::DetRegistry::ibegin
uint32_t ibegin
Definition: SiPixelGainCalibration.h:38
SiPixelGainCalibration::getNCols
const int getNCols(const uint32_t &detID) const
Definition: SiPixelGainCalibration.cc:59
cuy.col
col
Definition: cuy.py:1010
SiPixelGainCalibration::DetRegistry::ncols
int ncols
Definition: SiPixelGainCalibration.h:40
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
SiPixelGainCalibration::RegistryIterator
Registry::const_iterator RegistryIterator
Definition: SiPixelGainCalibration.h:53
SiPixelGainCalibration::getDetIds
void getDetIds(std::vector< uint32_t > &DetIds_) const
Definition: SiPixelGainCalibration.cc:91
SiPixelGainCalibration::minGain_
float minGain_
Definition: SiPixelGainCalibration.h:92
SiPixelGainCalibration::getGainHigh
double getGainHigh() const
Definition: SiPixelGainCalibration.h:70
SiPixelGainCalibration::getGainLow
double getGainLow() const
Definition: SiPixelGainCalibration.h:69
SiPixelGainCalibration::initialize
void initialize()
Definition: SiPixelGainCalibration.h:60
SiPixelGainCalibration::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiPixelGainCalibration.h:51
SiPixelGainCalibration::SiPixelGainCalibration
SiPixelGainCalibration()
Definition: SiPixelGainCalibration.cc:9
SiPixelGainCalibration::setData
void setData(float ped, float gain, std::vector< char > &vped, bool thisPixelIsDead=false, bool thisPixelIsNoisy=false)
Definition: SiPixelGainCalibration.cc:100
SiPixelGainCalibration::DecodingStructure::gain
unsigned int gain
Definition: SiPixelGainCalibration.h:32
SiPixelGainCalibration::decodeGain
float decodeGain(unsigned int gain) const
Definition: SiPixelGainCalibration.cc:184
SiPixelGainCalibration::getPed
float getPed(const int &col, const int &row, const Range &range, const int &nCols, bool &isDead, bool &isNoisy) const
Definition: SiPixelGainCalibration.cc:126
SiPixelGainCalibration::~SiPixelGainCalibration
~SiPixelGainCalibration()
Definition: SiPixelGainCalibration.h:58
SiPixelGainCalibration::v_pedestals
std::vector< char > v_pedestals
Definition: SiPixelGainCalibration.h:90
SiPixelGainCalibration::noisyFlag_
unsigned int noisyFlag_
Definition: SiPixelGainCalibration.h:99
SiPixelGainCalibration::nBinsToUseForEncoding_
unsigned int nBinsToUseForEncoding_
Definition: SiPixelGainCalibration.h:97
SiPixelGainCalibration::getPedLow
double getPedLow() const
Definition: SiPixelGainCalibration.h:71
SiPixelGainCalibration::encodeGain
float encodeGain(const float &gain)
Definition: SiPixelGainCalibration.cc:156
SiPixelGainCalibration::DetRegistry::iend
uint32_t iend
Definition: SiPixelGainCalibration.h:39
SiPixelGainCalibration::put
bool put(const uint32_t &detID, Range input, const int &nCols)
Definition: SiPixelGainCalibration.cc:39
SiPixelGainCalibration::indexes
std::vector< DetRegistry > indexes
Definition: SiPixelGainCalibration.h:91
SiPixelGainCalibration::ContainerIterator
std::vector< char >::const_iterator ContainerIterator
Definition: SiPixelGainCalibration.h:50
SiPixelGainCalibration::DetRegistry
Definition: SiPixelGainCalibration.h:36
Serializable.h
SiPixelGainCalibration::maxPed_
float maxPed_
Definition: SiPixelGainCalibration.h:92
SiPixelGainCalibration::setDeadPixel
void setDeadPixel(std::vector< char > &vped)
Definition: SiPixelGainCalibration.h:78
SiPixelGainCalibration::setNoisyPixel
void setNoisyPixel(std::vector< char > &vped)
Definition: SiPixelGainCalibration.h:79
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
SiPixelGainCalibration::Registry
std::vector< DetRegistry > Registry
Definition: SiPixelGainCalibration.h:52
SiPixelGainCalibration::maxGain_
float maxGain_
Definition: SiPixelGainCalibration.h:92
SiPixelGainCalibration::getRangeAndNCols
const std::pair< const Range, const int > getRangeAndNCols(const uint32_t &detID) const
Definition: SiPixelGainCalibration.cc:80
SiPixelGainCalibration::DecodingStructure
Definition: SiPixelGainCalibration.h:31
SiPixelGainCalibration::DetRegistry::detid
uint32_t detid
Definition: SiPixelGainCalibration.h:37
SiPixelGainCalibration::deadFlag_
unsigned int deadFlag_
Definition: SiPixelGainCalibration.h:98
SiPixelGainCalibration::minPed_
float minPed_
Definition: SiPixelGainCalibration.h:92
SiPixelGainCalibration::numberOfRowsToAverageOver_
unsigned int numberOfRowsToAverageOver_
Definition: SiPixelGainCalibration.h:95
SiPixelGainCalibration::StrictWeakOrdering::operator()
bool operator()(const DetRegistry &p, const uint32_t &i) const
Definition: SiPixelGainCalibration.h:47
SiPixelGainCalibration::StrictWeakOrdering
Definition: SiPixelGainCalibration.h:45
SiPixelGainCalibration::getGain
float getGain(const int &col, const int &row, const Range &range, const int &nCols, bool &isDead, bool &isNoisy) const
Definition: SiPixelGainCalibration.cc:141
SiPixelGainCalibration
Definition: SiPixelGainCalibration.h:29