CMS 3D CMS Logo

SiPixelCPEGenericErrorParm.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiPixelObjects_SiPixelCPEGenericErrorParm_h
2 #define CondFormats_SiPixelObjects_SiPixelCPEGenericErrorParm_h 1
3 
5 
6 #include <vector>
7 #include <iosfwd>
8 
9 //--- Maybe should make this a class const, but that'd be too much work.
10 //--- This usage is not worth it, since in the debugger will be obvious
11 //--- what this is! ;)
12 #define NONSENSE -99999.9
13 #define NONSENSE_I -99999
14 
16 public:
18  struct DbEntry {
19  float sigma;
20  float rms;
21  float bias; // For irradiated pixels
22  float pix_height; // For decapitation
23  float ave_Qclus; // Average cluster charge, For
24  DbEntry() : sigma(NONSENSE), rms(NONSENSE), bias(NONSENSE), pix_height(NONSENSE), ave_Qclus(NONSENSE) {}
25  ~DbEntry() {}
26 
28  };
29  typedef std::vector<DbEntry> DbVector;
30 
32  struct DbEntryBinSize {
38  : partBin_size(NONSENSE_I), sizeBin_size(NONSENSE_I), alphaBin_size(NONSENSE_I), betaBin_size(NONSENSE_I) {}
40 
42  };
43  typedef std::vector<DbEntryBinSize> DbBinSizeVector;
44 
47 
49  friend std::ostream& operator<<(std::ostream& s, const SiPixelCPEGenericErrorParm& genericErrors);
50 
53 
55  inline DbVector& errors() { return errors_; }
56  inline DbBinSizeVector& errorsBin() { return errorsBinSize_; }
57  inline double& version() { return version_; }
58 
60  inline const DbVector& errors() const { return errors_; }
61  inline const DbBinSizeVector& errorsBinSize() const { return errorsBinSize_; }
62  inline const double& version() const { return version_; }
63 
65  inline void reserve() {
66  errors_.reserve(1000);
67  errorsBinSize_.reserve(4);
68  }
69  // &&& Should these sizes be computed on the fly from other
70  // &&& variables (which are currently not stored in this object,
71  // &&& but maybe should be?)
72 
73  //inline void push_back( DbEntry e) {errors_.push_back(e);}
74  // inline void push_back_bin( DbEntryBinSize e) {errorsBinSize_.push_back(e);}
75  inline void set_version(double v) { version_ = v; }
76 
77  // &&& Should we be able to read this from an iostream? See PxCPEdbUploader...
78 
79 private:
80  DbVector errors_;
81  DbBinSizeVector errorsBinSize_;
82  double version_;
83 
85 };
86 
87 #endif
const DbBinSizeVector & errorsBinSize() const
void fillCPEGenericErrorParm(double version, std::string file)
Function to fill the db object given a filename.
#define NONSENSE_I
A struct to hold the binning information for (part, size, alpha, beta)
std::vector< DbEntryBinSize > DbBinSizeVector
DbVector & errors()
Accessors for the vectors – non-const version.
void reserve()
Reserve some reasonable sizes for the vectors.
#define COND_SERIALIZABLE
Definition: Serializable.h:38
#define NONSENSE
const DbVector & errors() const
Accessors for the vectors – const version.
A struct to hold information for a given (alpha,beta,size)
friend std::ostream & operator<<(std::ostream &s, const SiPixelCPEGenericErrorParm &genericErrors)
Function to output the contents of the db object.