CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: SiPixelSCurveCalibrationAnalysis.h,v 1.18 2008/08/29 14:57:27 fblekman Exp $
18 //
19 //
20 
21 
22 // system include files
23 #include <memory>
24 
25 // user include files
27 #include "TMinuit.h"
28 #include <iomanip>
29 //
32  kSigmas, //2d
36  kChi2s, //2d
39 };
40 
42  errNoDigi, //default value (will actually never get passed to the analyzer, but included for consistency when viewing histograms)
43  errOK, //everything is OK
44  errFlaggedBadByUser, //fit converged, but parameters are outside a user specified range (i.e. noise (sigma) > 6 ADC counts)
45  errBadChi2Prob, //fit converged, but failed user specified chi2 test
46  errFitNonPhysical, //fit converged, but in a nonsensical region (i.e. vCalMax < threshold < 0, sigma > vCalMax, etc)
47  errNoTurnOn, //sCurve never turned on above 90%
48  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
49 };
50 
51 
52 typedef std::map<sCurveHistogramType, MonitorElement*> sCurveHistogramHolder;
53 typedef std::map<uint32_t, sCurveHistogramHolder> detIDHistogramMap;
54 
55 // class decleration
56 //
57 
59  public:
62  void doSetup(const edm::ParameterSet&);
63 
64  virtual bool doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix);
65 
66  static std::vector<float> efficiencies_;
67  static std::vector<float> effErrors_;
68  std::vector<float> vCalPointsAsFloats_; //need to save single histograms
69 
70  sCurveErrorFlag estimateSCurveParameters(const std::vector<float>& eff, float& threshold, float& sigma);
71  sCurveErrorFlag fittedSCurveSanityCheck(float threshold, float sigma, float amplitude);
72 
73  void buildACurveHistogram(const uint32_t& detid, const uint32_t& row,
74  const uint32_t& col, sCurveErrorFlag errorFlag,
75  const std::vector<float>& efficiencies, const std::vector<float>& errors);
76 
77  private:
78  //configuration options
81  unsigned int maxCurvesToSave_; //define maximum number of curves to save, to prevent huge memory consumption
82  unsigned int curvesSavedCounter_;
85  std::vector<std::string> plaquettesToSave_;
89  std::map<uint32_t, bool> detIDsToSave_;
90 
91 
92  //parameters that define "bad curves"
96  double minimumSigma_;
97  double maximumSigma_;
100 
101  //parameters that define histogram size/binning
104 
105 
106  //holds histogrms entered
108 
109  virtual void calibrationSetup(const edm::EventSetup& iSetup);
110  virtual bool checkCorrectCalibrationType();
111  virtual void newDetID(uint32_t detid);
112  void makeThresholdSummary(void);
113  virtual void calibrationEnd() ;
114 
115  // ----------member data ---------------------------
116 };
117 
118 #endif
virtual bool doFits(uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix)
std::map< uint32_t, sCurveHistogramHolder > detIDHistogramMap
std::map< sCurveHistogramType, MonitorElement * > sCurveHistogramHolder
SiPixelSCurveCalibrationAnalysis(const edm::ParameterSet &iConfig)
sCurveErrorFlag estimateSCurveParameters(const std::vector< float > &eff, float &threshold, float &sigma)
sCurveErrorFlag fittedSCurveSanityCheck(float threshold, float sigma, float amplitude)
int col
Definition: cuy.py:1008
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)
virtual void calibrationSetup(const edm::EventSetup &iSetup)