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 //
14 //
15 // Original Author: Evan Klose Friis
16 // Created: Tue Nov 13 13:59:09 CET 2007
17 //
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
35  kChi2s, //2d
38 };
39 
41  errNoDigi, //default value (will actually never get passed to the analyzer, but included for consistency when viewing histograms)
42  errOK, //everything is OK
43  errFlaggedBadByUser, //fit converged, but parameters are outside a user specified range (i.e. noise (sigma) > 6 ADC counts)
44  errBadChi2Prob, //fit converged, but failed user specified chi2 test
45  errFitNonPhysical, //fit converged, but in a nonsensical region (i.e. vCalMax < threshold < 0, sigma > vCalMax, etc)
46  errNoTurnOn, //sCurve never turned on above 90%
47  errAllZeros //sCurve was all zeros. This shouldn't ever happen, (all zeros would prevent a CalibDigi from being produced) but is included as a potential tool for potential future debugging
48 };
49 
50 
51 typedef std::map<sCurveHistogramType, MonitorElement*> sCurveHistogramHolder;
52 typedef std::map<uint32_t, sCurveHistogramHolder> detIDHistogramMap;
53 
54 // class decleration
55 //
56 
58  public:
61  void doSetup(const edm::ParameterSet&);
62 
63  bool doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix) override;
64 
65  static std::vector<float> efficiencies_;
66  static std::vector<float> effErrors_;
67  std::vector<float> vCalPointsAsFloats_; //need to save single histograms
68 
69  sCurveErrorFlag estimateSCurveParameters(const std::vector<float>& eff, float& threshold, float& sigma);
71 
72  void buildACurveHistogram(const uint32_t& detid, const uint32_t& row,
73  const uint32_t& col, sCurveErrorFlag errorFlag,
74  const std::vector<float>& efficiencies, const std::vector<float>& errors);
75 
76  private:
77  //configuration options
80  unsigned int maxCurvesToSave_; //define maximum number of curves to save, to prevent huge memory consumption
81  unsigned int curvesSavedCounter_;
84  std::vector<std::string> plaquettesToSave_;
88  std::map<uint32_t, bool> detIDsToSave_;
89 
90 
91  //parameters that define "bad curves"
95  double minimumSigma_;
96  double maximumSigma_;
99 
100  //parameters that define histogram size/binning
103 
104 
105  //holds histogrms entered
107 
108  void calibrationSetup(const edm::EventSetup& iSetup) override;
109  bool checkCorrectCalibrationType() override;
110  void newDetID(uint32_t detid) override;
111  void makeThresholdSummary(void);
112  void calibrationEnd() override ;
113 
114  // ----------member data ---------------------------
115 };
116 
117 #endif
std::map< uint32_t, sCurveHistogramHolder > detIDHistogramMap
void calibrationSetup(const edm::EventSetup &iSetup) override
std::map< sCurveHistogramType, MonitorElement * > sCurveHistogramHolder
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)