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 //
23 
24 #include<vector>
25 #include<map>
26 #include<iostream>
27 #include<boost/cstdint.hpp>
28 
30 
31  public:
32 
34  unsigned int datum :8;
35  };
36 
37  struct DetRegistry{
38  uint32_t detid;
39  uint32_t ibegin;
40  uint32_t iend;
41  int ncols;
42 
44 };
45 
47  public:
48  bool operator() (const DetRegistry& p,const uint32_t& i) const {return p.detid < i;}
49  };
50 
51  typedef std::vector<char>::const_iterator ContainerIterator;
52  typedef std::pair<ContainerIterator, ContainerIterator> Range;
53  typedef std::vector<DetRegistry> Registry;
54  typedef Registry::const_iterator RegistryIterator;
55 
56  // Constructors
58  SiPixelGainCalibrationOffline(float minPed, float maxPed, float minGain, float maxGain);
60 
61  void initialize(){}
62 
63 
64  bool put(const uint32_t& detID,Range input, const int& nCols);
65  const Range getRange(const uint32_t& detID) const;
66  void getDetIds(std::vector<uint32_t>& DetIds_) const;
67  const int getNCols(const uint32_t& detID) const;
68  const std::pair<const Range, const int> getRangeAndNCols(const uint32_t& detID) const;
69 
70  // Set and get public methods
71  void setDataGain ( float gain, const int& nRows, std::vector<char>& vped , bool thisColumnIsDead = false , bool thisColumnIsNoisy = false);
72  void setDataPedestal ( float pedestal, std::vector<char>& vped , bool thisPixelIsDead = false , bool thisPixelIsNoisy = false);
73 
75  double getGainLow() const { return minGain_; }
76  double getGainHigh() const { return maxGain_; }
77  double getPedLow() const { return minPed_; }
78  double getPedHigh() const { return maxPed_; }
79 
80  // Set dead pixels
81  void setDeadPixel(std::vector<char>& vped) { setDataPedestal(0 /*dummy value, not used*/, vped, true ); }
82  void setDeadColumn(const int& nRows, std::vector<char>& vped) { setDataGain(0 /*dummy value, not used*/, nRows, vped, true ); }
83 
84  // Set noisy pixels
85  void setNoisyPixel(std::vector<char>& vped) { setDataPedestal(0 /*dummy value, not used*/, vped, false, true ); }
86  void setNoisyColumn(const int& nRows, std::vector<char>& vped) { setDataGain(0 /*dummy value, not used*/, nRows, vped, false, true ); }
87 
88  // these methods SHOULD NEVER BE ACESSED BY THE USER - use the services in CondTools/SiPixel!!!!
89  float getPed (const int& col, const int& row, const Range& range, const int& nCols, bool& isDead, bool& isNoisy) const;
90  float getGain (const int& col, const int& row, const Range& range, const int& nCols, bool& isDeadColumn, bool& isNoisyColumn) const;
91 
92 
93  private:
94 
95  float encodeGain(const float& gain);
96  float encodePed (const float& ped);
97  float decodeGain(unsigned int gain) const;
98  float decodePed (unsigned int ped) const;
99 
100  std::vector<char> v_pedestals; //@@@ blob streaming doesn't work with uint16_t and with classes
101  std::vector<DetRegistry> indexes;
103 
104  unsigned int numberOfRowsToAverageOver_; //THIS WILL BE HARDCODED TO 80 (all rows in a ROC) DON'T CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING!
106  unsigned int deadFlag_;
107  unsigned int noisyFlag_;
108 
109 
111 };
112 
113 #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:43
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
#define COND_SERIALIZABLE
Definition: Serializable.h:37
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)