CMS 3D CMS Logo

SiPixelGainCalibrationForHLT.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiPixelObjects_SiPixelGainCalibrationForHLT_h
2 #define CondFormats_SiPixelObjects_SiPixelGainCalibrationForHLT_h
3 // -*- C++ -*-
4 //
5 // Package: SiPixelObjects
6 // Class: SiPixelGainCalibrationForHLT
7 //
15 //
16 // Original Author: Vincenzo Chiochia
17 // Created: Tue 8 12:31:25 CEST 2007
18 // Modified: Evan Friis
19 // $Id: SiPixelGainCalibrationForHLT.h,v 1.5 2009/02/10 17:25:58 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  SiPixelGainCalibrationForHLT(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  float getGainLow() const { return minGain_; }
70  float getGainHigh() const { return maxGain_; }
71  float getPedLow() const { return minPed_; }
72  float getPedHigh() const { return maxPed_; }
73 
74  std::vector<char> const& data() const { return v_pedestals; }
75  std::vector<DetRegistry> const& getIndexes() const { return indexes; }
76 
77  // Set and get public methods
78  void setData(
79  float ped, float gain, std::vector<char>& vped, bool thisColumnIsDead = false, bool thisColumnIsNoisy = false);
80  void setDeadColumn(const int& nRows, std::vector<char>& vped) {
81  setData(0, 0 /*dummy values, not used*/, vped, true, false);
82  }
83  void setNoisyColumn(const int& nRows, std::vector<char>& vped) {
84  setData(0, 0 /*dummy values, not used*/, vped, false, true);
85  }
86 
87  std::pair<float, float> getPedAndGain(const int& col,
88  const int& row,
89  const Range& range,
90  const int& nCols,
91  bool& isDeadColumn,
92  bool& isNoisyColumn) const;
93 
94  float getPed(const int& col,
95  const int& row,
96  const Range& range,
97  const int& nCols,
98  bool& isDeadColumn,
99  bool& isNoisyColumn) const;
100  float getGain(const int& col,
101  const int& row,
102  const Range& range,
103  const int& nCols,
104  bool& isDeadColumn,
105  bool& isNoisyColumn) const;
106 
107 private:
108  float encodeGain(const float& gain);
109  float encodePed(const float& ped);
110  float decodeGain(unsigned int gain) const { return gain * gainPrecision + minGain_; }
111  float decodePed(unsigned int ped) const { return ped * pedPrecision + minPed_; }
112 
113  std::vector<char> v_pedestals; //@@@ blob streaming doesn't work with uint16_t and with classes
114  std::vector<DetRegistry> indexes;
116 
118 
119  //THIS WILL BE HARDCODED TO 80 (all rows in a ROC) DON'T CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING!
121 
123  unsigned int deadFlag_;
124  unsigned int noisyFlag_;
125 
127 };
128 
129 #endif
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
mps_fire.i
i
Definition: mps_fire.py:355
input
static const std::string input
Definition: EdmProvDump.cc:48
SiPixelGainCalibrationForHLT::getPedAndGain
std::pair< float, float > getPedAndGain(const int &col, const int &row, const Range &range, const int &nCols, bool &isDeadColumn, bool &isNoisyColumn) const
Definition: SiPixelGainCalibrationForHLT.cc:134
SiPixelGainCalibrationForHLT::decodePed
float decodePed(unsigned int ped) const
Definition: SiPixelGainCalibrationForHLT.h:111
SiPixelGainCalibrationForHLT::SiPixelGainCalibrationForHLT
SiPixelGainCalibrationForHLT()
Definition: SiPixelGainCalibrationForHLT.cc:9
SiPixelGainCalibrationForHLT::getPedHigh
float getPedHigh() const
Definition: SiPixelGainCalibrationForHLT.h:72
SiPixelGainCalibrationForHLT::minPed_
float minPed_
Definition: SiPixelGainCalibrationForHLT.h:115
SiPixelGainCalibrationForHLT::DetRegistry::ibegin
uint32_t ibegin
Definition: SiPixelGainCalibrationForHLT.h:38
SiPixelGainCalibrationForHLT::getPed
float getPed(const int &col, const int &row, const Range &range, const int &nCols, bool &isDeadColumn, bool &isNoisyColumn) const
Definition: SiPixelGainCalibrationForHLT.cc:162
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
cuy.col
col
Definition: cuy.py:1010
SiPixelGainCalibrationForHLT::getPedLow
float getPedLow() const
Definition: SiPixelGainCalibrationForHLT.h:71
SiPixelGainCalibrationForHLT::StrictWeakOrdering::operator()
bool operator()(const DetRegistry &p, const uint32_t &i) const
Definition: SiPixelGainCalibrationForHLT.h:47
SiPixelGainCalibrationForHLT::v_pedestals
std::vector< char > v_pedestals
Definition: SiPixelGainCalibrationForHLT.h:113
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
SiPixelGainCalibrationForHLT::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiPixelGainCalibrationForHLT.h:51
SiPixelGainCalibrationForHLT::numberOfRowsToAverageOver_
unsigned int numberOfRowsToAverageOver_
Definition: SiPixelGainCalibrationForHLT.h:120
SiPixelGainCalibrationForHLT::getNumberOfRowsToAverageOver
unsigned int getNumberOfRowsToAverageOver() const
Definition: SiPixelGainCalibrationForHLT.h:68
SiPixelGainCalibrationForHLT::minGain_
float minGain_
Definition: SiPixelGainCalibrationForHLT.h:115
SiPixelGainCalibrationForHLT::maxPed_
float maxPed_
Definition: SiPixelGainCalibrationForHLT.h:115
SiPixelGainCalibrationForHLT::put
bool put(const uint32_t &detID, Range input, const int &nCols)
Definition: SiPixelGainCalibrationForHLT.cc:46
SiPixelGainCalibrationForHLT::getGainHigh
float getGainHigh() const
Definition: SiPixelGainCalibrationForHLT.h:70
SiPixelGainCalibrationForHLT::setData
void setData(float ped, float gain, std::vector< char > &vped, bool thisColumnIsDead=false, bool thisColumnIsNoisy=false)
Definition: SiPixelGainCalibrationForHLT.cc:108
SiPixelGainCalibrationForHLT
Definition: SiPixelGainCalibrationForHLT.h:29
SiPixelGainCalibrationForHLT::encodeGain
float encodeGain(const float &gain)
Definition: SiPixelGainCalibrationForHLT.cc:217
SiPixelGainCalibrationForHLT::getNCols
const int getNCols(const uint32_t &detID) const
Definition: SiPixelGainCalibrationForHLT.cc:66
SiPixelGainCalibrationForHLT::noisyFlag_
unsigned int noisyFlag_
Definition: SiPixelGainCalibrationForHLT.h:124
SiPixelGainCalibrationForHLT::getGainLow
float getGainLow() const
Definition: SiPixelGainCalibrationForHLT.h:69
SiPixelGainCalibrationForHLT::getDetIds
void getDetIds(std::vector< uint32_t > &DetIds_) const
Definition: SiPixelGainCalibrationForHLT.cc:99
SiPixelGainCalibrationForHLT::DecodingStructure
Definition: SiPixelGainCalibrationForHLT.h:31
SiPixelGainCalibrationForHLT::decodeGain
float decodeGain(unsigned int gain) const
Definition: SiPixelGainCalibrationForHLT.h:110
SiPixelGainCalibrationForHLT::DetRegistry
Definition: SiPixelGainCalibrationForHLT.h:36
SiPixelGainCalibrationForHLT::setDeadColumn
void setDeadColumn(const int &nRows, std::vector< char > &vped)
Definition: SiPixelGainCalibrationForHLT.h:80
SiPixelGainCalibrationForHLT::gainPrecision
float gainPrecision
Definition: SiPixelGainCalibrationForHLT.h:117
SiPixelGainCalibrationForHLT::encodePed
float encodePed(const float &ped)
Definition: SiPixelGainCalibrationForHLT.cc:228
SiPixelGainCalibrationForHLT::DecodingStructure::ped
unsigned int ped
Definition: SiPixelGainCalibrationForHLT.h:33
SiPixelGainCalibrationForHLT::pedPrecision
float pedPrecision
Definition: SiPixelGainCalibrationForHLT.h:117
SiPixelGainCalibrationForHLT::DetRegistry::detid
uint32_t detid
Definition: SiPixelGainCalibrationForHLT.h:37
SiPixelGainCalibrationForHLT::Registry
std::vector< DetRegistry > Registry
Definition: SiPixelGainCalibrationForHLT.h:52
Serializable.h
SiPixelGainCalibrationForHLT::maxGain_
float maxGain_
Definition: SiPixelGainCalibrationForHLT.h:115
SiPixelGainCalibrationForHLT::indexes
std::vector< DetRegistry > indexes
Definition: SiPixelGainCalibrationForHLT.h:114
SiPixelGainCalibrationForHLT::initialize
void initialize()
Definition: SiPixelGainCalibrationForHLT.cc:41
SiPixelGainCalibrationForHLT::DetRegistry::ncols
int ncols
Definition: SiPixelGainCalibrationForHLT.h:40
SiPixelGainCalibrationForHLT::getRangeAndNCols
const std::pair< const Range, const int > getRangeAndNCols(const uint32_t &detID) const
Definition: SiPixelGainCalibrationForHLT.cc:88
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
SiPixelGainCalibrationForHLT::RegistryIterator
Registry::const_iterator RegistryIterator
Definition: SiPixelGainCalibrationForHLT.h:53
SiPixelGainCalibrationForHLT::deadFlag_
unsigned int deadFlag_
Definition: SiPixelGainCalibrationForHLT.h:123
SiPixelGainCalibrationForHLT::setNoisyColumn
void setNoisyColumn(const int &nRows, std::vector< char > &vped)
Definition: SiPixelGainCalibrationForHLT.h:83
SiPixelGainCalibrationForHLT::getGain
float getGain(const int &col, const int &row, const Range &range, const int &nCols, bool &isDeadColumn, bool &isNoisyColumn) const
Definition: SiPixelGainCalibrationForHLT.cc:191
SiPixelGainCalibrationForHLT::~SiPixelGainCalibrationForHLT
~SiPixelGainCalibrationForHLT()
Definition: SiPixelGainCalibrationForHLT.h:58
SiPixelGainCalibrationForHLT::getRange
const Range getRange(const uint32_t &detID) const
Definition: SiPixelGainCalibrationForHLT.cc:77
SiPixelGainCalibrationForHLT::StrictWeakOrdering
Definition: SiPixelGainCalibrationForHLT.h:45
SiPixelGainCalibrationForHLT::DetRegistry::iend
uint32_t iend
Definition: SiPixelGainCalibrationForHLT.h:39
SiPixelGainCalibrationForHLT::data
std::vector< char > const & data() const
Definition: SiPixelGainCalibrationForHLT.h:74
SiPixelGainCalibrationForHLT::ContainerIterator
std::vector< char >::const_iterator ContainerIterator
Definition: SiPixelGainCalibrationForHLT.h:50
SiPixelGainCalibrationForHLT::getIndexes
std::vector< DetRegistry > const & getIndexes() const
Definition: SiPixelGainCalibrationForHLT.h:75
SiPixelGainCalibrationForHLT::DecodingStructure::gain
unsigned int gain
Definition: SiPixelGainCalibrationForHLT.h:32
SiPixelGainCalibrationForHLT::nBinsToUseForEncoding_
unsigned int nBinsToUseForEncoding_
Definition: SiPixelGainCalibrationForHLT.h:122