CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelGainCalibrationOffline.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiPixelObjects_SiPixelGainCalibrationOffline_h
2 #define CondFormats_SiPixelObjects_SiPixelGainCalibrationOffline_h
3 // -*- C++ -*-
4 //
5 // Package: SiPixelObjects
6 // Class: SiPixelGainCalibrationOffline
7 //
15 //
16 // Original Author: Vincenzo Chiochia
17 // Modified: Evan Friis
18 // Created: Tue 8 12:31:25 CEST 2007
19 // $Id: SiPixelGainCalibrationOffline.h,v 1.5 2009/02/10 17:26:50 rougny Exp $
20 //
21 //
22 #include<vector>
23 #include<map>
24 #include<iostream>
25 #include<boost/cstdint.hpp>
26 
28 
29  public:
30 
32  unsigned int datum :8;
33  };
34 
35  struct DetRegistry{
36  uint32_t detid;
37  uint32_t ibegin;
38  uint32_t iend;
39  int ncols;
40  };
41 
43  public:
44  bool operator() (const DetRegistry& p,const uint32_t& i) const {return p.detid < i;}
45  };
46 
47  typedef std::vector<char>::const_iterator ContainerIterator;
48  typedef std::pair<ContainerIterator, ContainerIterator> Range;
49  typedef std::vector<DetRegistry> Registry;
50  typedef Registry::const_iterator RegistryIterator;
51 
52  // Constructors
54  SiPixelGainCalibrationOffline(float minPed, float maxPed, float minGain, float maxGain);
56 
57  void initialize() const{}
58 
59 
60  bool put(const uint32_t& detID,Range input, const int& nCols);
61  const Range getRange(const uint32_t& detID) const;
62  void getDetIds(std::vector<uint32_t>& DetIds_) const;
63  const int getNCols(const uint32_t& detID) const;
64  const std::pair<const Range, const int> getRangeAndNCols(const uint32_t& detID) const;
65 
66  // Set and get public methods
67  void setDataGain ( float gain, const int& nRows, std::vector<char>& vped , bool thisColumnIsDead = false , bool thisColumnIsNoisy = false);
68  void setDataPedestal ( float pedestal, std::vector<char>& vped , bool thisPixelIsDead = false , bool thisPixelIsNoisy = false);
69 
71  double getGainLow() const { return minGain_; }
72  double getGainHigh() const { return maxGain_; }
73  double getPedLow() const { return minPed_; }
74  double getPedHigh() const { return maxPed_; }
75 
76  // Set dead pixels
77  void setDeadPixel(std::vector<char>& vped) { setDataPedestal(0 /*dummy value, not used*/, vped, true ); }
78  void setDeadColumn(const int& nRows, std::vector<char>& vped) { setDataGain(0 /*dummy value, not used*/, nRows, vped, true ); }
79 
80  // Set noisy pixels
81  void setNoisyPixel(std::vector<char>& vped) { setDataPedestal(0 /*dummy value, not used*/, vped, false, true ); }
82  void setNoisyColumn(const int& nRows, std::vector<char>& vped) { setDataGain(0 /*dummy value, not used*/, nRows, vped, false, true ); }
83 
84  // these methods SHOULD NEVER BE ACESSED BY THE USER - use the services in CondTools/SiPixel!!!!
85  float getPed (const int& col, const int& row, const Range& range, const int& nCols, bool& isDead, bool& isNoisy) const;
86  float getGain (const int& col, const int& row, const Range& range, const int& nCols, bool& isDeadColumn, bool& isNoisyColumn) const;
87 
88 
89  private:
90 
91  float encodeGain(const float& gain);
92  float encodePed (const float& ped);
93  float decodeGain(unsigned int gain) const;
94  float decodePed (unsigned int ped) const;
95 
96  std::vector<char> v_pedestals; //@@@ blob streaming doesn't work with uint16_t and with classes
97  std::vector<DetRegistry> indexes;
99 
100  unsigned int numberOfRowsToAverageOver_; //THIS WILL BE HARDCODED TO 80 (all rows in a ROC) DON'T CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING!
102  unsigned int deadFlag_;
103  unsigned int noisyFlag_;
104 
105 };
106 
107 #endif
int i
Definition: DBlmapReader.cc:9
float getGain(const int &col, const int &row, const Range &range, const int &nCols, bool &isDeadColumn, bool &isNoisyColumn) const
bool operator()(const DetRegistry &p, const uint32_t &i) const
void setDataPedestal(float pedestal, std::vector< char > &vped, bool thisPixelIsDead=false, bool thisPixelIsNoisy=false)
float getPed(const int &col, const int &row, const Range &range, const int &nCols, bool &isDead, bool &isNoisy) const
std::pair< ContainerIterator, ContainerIterator > Range
const int getNCols(const uint32_t &detID) const
void setDataGain(float gain, const int &nRows, std::vector< char > &vped, bool thisColumnIsDead=false, bool thisColumnIsNoisy=false)
static std::string const input
Definition: EdmProvDump.cc:44
std::vector< char >::const_iterator ContainerIterator
void setNoisyColumn(const int &nRows, std::vector< char > &vped)
void setDeadPixel(std::vector< char > &vped)
void setNoisyPixel(std::vector< char > &vped)
const Range getRange(const uint32_t &detID) const
float decodeGain(unsigned int gain) const
const std::pair< const Range, const int > getRangeAndNCols(const uint32_t &detID) const
void getDetIds(std::vector< uint32_t > &DetIds_) const
int col
Definition: cuy.py:1008
bool put(const uint32_t &detID, Range input, const int &nCols)
float decodePed(unsigned int ped) const
unsigned int getNumberOfRowsToAverageOver() const
void setDeadColumn(const int &nRows, std::vector< char > &vped)