CMS 3D CMS Logo

SiPixelSCurveCalibrationAnalysis.h
Go to the documentation of this file.
1 #ifndef CALIBTRACKER_SIPIXELSCURVECALIBRATION_SIPIXELSCURVE_CALIBRATION_H
2 #define CALIBTRACKER_SIPIXELSCURVECALIBRATION_SIPIXELSCURVE_CALIBRATION_H
3 //
4 // Package: SiPixelSCurveCalibrationAnalysis
5 // Class: SiPixelSCurveCalibrationAnalysis
6 //
15 //
16 // Original Author: Evan Klose Friis
17 // Created: Tue Nov 13 13:59:09 CET 2007
18 //
19 //
20 
21 // system include files
22 #include <memory>
23 
24 // user include files
26 #include "TMinuit.h"
27 #include <iomanip>
28 //
31  kSigmas, // 2d
33  kThresholds, // 2d
34  kChi2Summary, // 1d
35  kChi2s, // 2d
36  kFitResults, // 2d
38 };
39 
41  errNoDigi, // default value (will actually never get passed to the analyzer,
42  // but included for consistency when viewing histograms)
43  errOK, // everything is OK
44  errFlaggedBadByUser, // fit converged, but parameters are outside a user
45  // specified range (i.e. noise (sigma) > 6 ADC counts)
46  errBadChi2Prob, // fit converged, but failed user specified chi2 test
47  errFitNonPhysical, // fit converged, but in a nonsensical region (i.e. vCalMax
48  // < threshold < 0, sigma > vCalMax, etc)
49  errNoTurnOn, // sCurve never turned on above 90%
50  errAllZeros // sCurve was all zeros. This shouldn't ever happen, (all zeros
51  // would prevent a CalibDigi from being produced) but is included
52  // as a potential tool for potential future debugging
53 };
54 
56 typedef std::map<sCurveHistogramType, MonitorElement *> sCurveHistogramHolder;
57 typedef std::map<uint32_t, sCurveHistogramHolder> detIDHistogramMap;
58 
59 // class decleration
60 //
61 
63 public:
66  doSetup(iConfig);
67  };
69  void doSetup(const edm::ParameterSet &);
70 
71  bool doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix) override;
72 
73  static std::vector<float> efficiencies_;
74  static std::vector<float> effErrors_;
75  std::vector<float> vCalPointsAsFloats_; // need to save single histograms
76 
77  sCurveErrorFlag estimateSCurveParameters(const std::vector<float> &eff, float &threshold, float &sigma);
79 
80  void buildACurveHistogram(const uint32_t &detid,
81  const uint32_t &row,
82  const uint32_t &col,
83  sCurveErrorFlag errorFlag,
84  const std::vector<float> &efficiencies,
85  const std::vector<float> &errors);
86 
87 private:
88  // configuration options
91  unsigned int maxCurvesToSave_; // define maximum number of curves to save, to
92  // prevent huge memory consumption
93  unsigned int curvesSavedCounter_;
96  std::vector<std::string> plaquettesToSave_;
100  std::map<uint32_t, bool> detIDsToSave_;
101 
102  // parameters that define "bad curves"
110 
111  // parameters that define histogram size/binning
114 
115  // holds histogrms entered
117 
118  void calibrationSetup(const edm::EventSetup &iSetup) override;
119  bool checkCorrectCalibrationType() override;
120  void newDetID(uint32_t detid) override;
121  void makeThresholdSummary(void);
122  void calibrationEnd() override;
123 
124  // ----------member data ---------------------------
125 };
126 
127 #endif
std::map< sCurveHistogramType, MonitorElement * > sCurveHistogramHolder
std::map< uint32_t, sCurveHistogramHolder > detIDHistogramMap
void calibrationSetup(const edm::EventSetup &iSetup) override
bool doFits(uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix) override
SiPixelSCurveCalibrationAnalysis(const edm::ParameterSet &iConfig)
sCurveErrorFlag estimateSCurveParameters(const std::vector< float > &eff, float &threshold, float &sigma)
dqm::legacy::MonitorElement MonitorElement
sCurveErrorFlag fittedSCurveSanityCheck(float threshold, float sigma, float amplitude)
col
Definition: cuy.py:1009
Definition: errors.py:1
void buildACurveHistogram(const uint32_t &detid, const uint32_t &row, const uint32_t &col, sCurveErrorFlag errorFlag, const std::vector< float > &efficiencies, const std::vector< float > &errors)