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 
55 typedef std::map<sCurveHistogramType, MonitorElement *> sCurveHistogramHolder;
56 typedef std::map<uint32_t, sCurveHistogramHolder> detIDHistogramMap;
57 
58 // class decleration
59 //
60 
62 public:
65  doSetup(iConfig);
66  };
68  void doSetup(const edm::ParameterSet &);
69 
70  bool doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix) override;
71 
72  static std::vector<float> efficiencies_;
73  static std::vector<float> effErrors_;
74  std::vector<float> vCalPointsAsFloats_; // need to save single histograms
75 
76  sCurveErrorFlag estimateSCurveParameters(const std::vector<float> &eff, float &threshold, float &sigma);
78 
79  void buildACurveHistogram(const uint32_t &detid,
80  const uint32_t &row,
81  const uint32_t &col,
82  sCurveErrorFlag errorFlag,
83  const std::vector<float> &efficiencies,
84  const std::vector<float> &errors);
85 
86 private:
87  // configuration options
90  unsigned int maxCurvesToSave_; // define maximum number of curves to save, to
91  // prevent huge memory consumption
92  unsigned int curvesSavedCounter_;
95  std::vector<std::string> plaquettesToSave_;
99  std::map<uint32_t, bool> detIDsToSave_;
100 
101  // parameters that define "bad curves"
109 
110  // parameters that define histogram size/binning
113 
114  // holds histogrms entered
116 
117  void calibrationSetup(const edm::EventSetup &iSetup) override;
118  bool checkCorrectCalibrationType() override;
119  void newDetID(uint32_t detid) override;
120  void makeThresholdSummary(void);
121  void calibrationEnd() override;
122 
123  // ----------member data ---------------------------
124 };
125 
126 #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)
sCurveErrorFlag fittedSCurveSanityCheck(float threshold, float sigma, float amplitude)
col
Definition: cuy.py:1010
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)