CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/CondFormats/SiPixelObjects/interface/SiPixelCPEGenericErrorParm.h

Go to the documentation of this file.
00001 #ifndef CondFormats_SiPixelObjects_SiPixelCPEGenericErrorParm_h
00002 #define CondFormats_SiPixelObjects_SiPixelCPEGenericErrorParm_h 1
00003 
00004 #include <vector>
00005 #include <iosfwd>
00006 
00007 //--- Maybe should make this a class const, but that'd be too much work.
00008 //--- This usage is not worth it, since in the debugger will be obvious
00009 //--- what this is! ;)
00010 #define NONSENSE -99999.9
00011 #define NONSENSE_I -99999
00012 
00013 class SiPixelCPEGenericErrorParm {
00014  public:
00016         struct DbEntry {
00017                 float sigma;
00018                 float rms;
00019                 float bias;       // For irradiated pixels
00020                 float pix_height; // For decapitation
00021                 float ave_Qclus;  // Average cluster charge, For 
00022           DbEntry() : sigma(NONSENSE), rms(NONSENSE), 
00023                                  bias(NONSENSE), pix_height(NONSENSE), 
00024                                  ave_Qclus(NONSENSE) {}
00025           ~DbEntry() {}
00026         };
00027         typedef std::vector<DbEntry> DbVector;
00028 
00030         struct DbEntryBinSize {
00031                 int partBin_size;
00032                 int sizeBin_size;
00033                 int alphaBin_size;
00034                 int betaBin_size;
00035                 DbEntryBinSize() : partBin_size(NONSENSE_I), sizeBin_size(NONSENSE_I),
00036                                            alphaBin_size(NONSENSE_I), betaBin_size(NONSENSE_I) {}
00037                 ~DbEntryBinSize() {}
00038         };
00039         typedef std::vector<DbEntryBinSize> DbBinSizeVector;
00040 
00041         SiPixelCPEGenericErrorParm() : errors_(), errorsBinSize_() {}
00042         virtual ~SiPixelCPEGenericErrorParm(){}
00043 
00045         friend std::ostream& operator<<(std::ostream& s, const SiPixelCPEGenericErrorParm& genericErrors);
00046         
00048         void fillCPEGenericErrorParm(double version, std::string file);
00049 
00051         inline DbVector & errors() { return errors_ ; }
00052         inline DbBinSizeVector & errorsBin() { return errorsBinSize_ ; }
00053         inline double & version() { return version_;}
00054 
00056         inline const DbVector & errors() const { return errors_ ; }
00057         inline const DbBinSizeVector & errorsBinSize() const { return errorsBinSize_ ; }
00058         inline const double & version() const { return version_;}
00059 
00061         inline void reserve() {
00062           errors_.reserve(1000);
00063                 errorsBinSize_.reserve(4);
00064         }
00065         //  &&& Should these sizes be computed on the fly from other 
00066         //  &&& variables (which are currently not stored in this object,
00067         //  &&& but maybe should be?)
00068 
00069         //inline void push_back( DbEntry e) {errors_.push_back(e);}
00070         //      inline void push_back_bin( DbEntryBinSize e) {errorsBinSize_.push_back(e);}
00071         inline void set_version (double v) {version_ = v;}
00072 
00073         // &&& Should we be able to read this from an iostream?  See PxCPEdbUploader...
00074 
00075  private:
00076         DbVector errors_ ;
00077         DbBinSizeVector errorsBinSize_;
00078         double version_;
00079 };
00080 
00081 #endif