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
SiPixelSCurveCalibrationAnalysis::~SiPixelSCurveCalibrationAnalysis
~SiPixelSCurveCalibrationAnalysis() override
Definition: SiPixelSCurveCalibrationAnalysis.cc:137
SiPixelSCurveCalibrationAnalysis::useDetectorHierarchyFolders_
bool useDetectorHierarchyFolders_
Definition: SiPixelSCurveCalibrationAnalysis.h:89
kChi2s
Definition: SiPixelSCurveCalibrationAnalysis.h:35
SiPixelSCurveCalibrationAnalysis::calibrationSetup
void calibrationSetup(const edm::EventSetup &iSetup) override
Definition: SiPixelSCurveCalibrationAnalysis.cc:184
SiPixelSCurveCalibrationAnalysis::writeZeroes_
bool writeZeroes_
Definition: SiPixelSCurveCalibrationAnalysis.h:98
CustomPhysics_cfi.amplitude
amplitude
Definition: CustomPhysics_cfi.py:12
sCurveErrorFlag
sCurveErrorFlag
Definition: SiPixelSCurveCalibrationAnalysis.h:40
SiPixelSCurveCalibrationAnalysis::minimumChi2prob_
double minimumChi2prob_
Definition: SiPixelSCurveCalibrationAnalysis.h:103
kFitResults
Definition: SiPixelSCurveCalibrationAnalysis.h:36
cuy.col
col
Definition: cuy.py:1010
SiPixelSCurveCalibrationAnalysis::thresholdfilename_
std::string thresholdfilename_
Definition: SiPixelSCurveCalibrationAnalysis.h:99
SiPixelSCurveCalibrationAnalysis::detIDsToSave_
std::map< uint32_t, bool > detIDsToSave_
Definition: SiPixelSCurveCalibrationAnalysis.h:100
errFitNonPhysical
Definition: SiPixelSCurveCalibrationAnalysis.h:47
kChi2Summary
Definition: SiPixelSCurveCalibrationAnalysis.h:34
SiPixelSCurveCalibrationAnalysis::estimateSCurveParameters
sCurveErrorFlag estimateSCurveParameters(const std::vector< float > &eff, float &threshold, float &sigma)
Definition: SiPixelSCurveCalibrationAnalysis.cc:226
SiPixelSCurveCalibrationAnalysis::SiPixelSCurveCalibrationAnalysis
SiPixelSCurveCalibrationAnalysis(const edm::ParameterSet &iConfig)
Definition: SiPixelSCurveCalibrationAnalysis.h:64
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
sCurveHistogramType
sCurveHistogramType
Definition: SiPixelSCurveCalibrationAnalysis.h:29
kSigmas
Definition: SiPixelSCurveCalibrationAnalysis.h:31
SiPixelSCurveCalibrationAnalysis::maximumEffAsymptote_
double maximumEffAsymptote_
Definition: SiPixelSCurveCalibrationAnalysis.h:109
SiPixelSCurveCalibrationAnalysis::minimumSigma_
double minimumSigma_
Definition: SiPixelSCurveCalibrationAnalysis.h:106
SiPixelSCurveCalibrationAnalysis::maximumSigma_
double maximumSigma_
Definition: SiPixelSCurveCalibrationAnalysis.h:107
SiPixelSCurveCalibrationAnalysis::efficiencies_
static std::vector< float > efficiencies_
Definition: SiPixelSCurveCalibrationAnalysis.h:73
detIDHistogramMap
std::map< uint32_t, sCurveHistogramHolder > detIDHistogramMap
Definition: SiPixelSCurveCalibrationAnalysis.h:57
SiPixelSCurveCalibrationAnalysis::histograms_
detIDHistogramMap histograms_
Definition: SiPixelSCurveCalibrationAnalysis.h:116
errors
Definition: errors.py:1
SiPixelSCurveCalibrationAnalysis
Definition: SiPixelSCurveCalibrationAnalysis.h:62
SiPixelSCurveCalibrationAnalysis::vCalPointsAsFloats_
std::vector< float > vCalPointsAsFloats_
Definition: SiPixelSCurveCalibrationAnalysis.h:75
SiPixelSCurveCalibrationAnalysis::minimumEffAsymptote_
double minimumEffAsymptote_
Definition: SiPixelSCurveCalibrationAnalysis.h:108
errNoDigi
Definition: SiPixelSCurveCalibrationAnalysis.h:41
SiPixelOfflineCalibAnalysisBase.h
SiPixelSCurveCalibrationAnalysis::curvesSavedCounter_
unsigned int curvesSavedCounter_
Definition: SiPixelSCurveCalibrationAnalysis.h:93
errAllZeros
Definition: SiPixelSCurveCalibrationAnalysis.h:50
SiPixelSCurveCalibrationAnalysis::effErrors_
static std::vector< float > effErrors_
Definition: SiPixelSCurveCalibrationAnalysis.h:74
SiPixelSCurveCalibrationAnalysis::calibrationEnd
void calibrationEnd() override
Definition: SiPixelSCurveCalibrationAnalysis.cc:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelSCurveCalibrationAnalysis::checkCorrectCalibrationType
bool checkCorrectCalibrationType() override
Definition: SiPixelSCurveCalibrationAnalysis.cc:211
edm::ParameterSet
Definition: ParameterSet.h:36
electronProducer_cfi.efficiencies
efficiencies
Definition: electronProducer_cfi.py:76
kFitResultSummary
Definition: SiPixelSCurveCalibrationAnalysis.h:37
kThresholdSummary
Definition: SiPixelSCurveCalibrationAnalysis.h:32
SiPixelSCurveCalibrationAnalysis::write2dHistograms_
bool write2dHistograms_
Definition: SiPixelSCurveCalibrationAnalysis.h:94
kSigmaSummary
Definition: SiPixelSCurveCalibrationAnalysis.h:30
edm::EventSetup
Definition: EventSetup.h:57
SiPixelSCurveCalibrationAnalysis::maximumSigmaBin_
double maximumSigmaBin_
Definition: SiPixelSCurveCalibrationAnalysis.h:113
SiPixelSCurveCalibrationAnalysis::maxCurvesToSave_
unsigned int maxCurvesToSave_
Definition: SiPixelSCurveCalibrationAnalysis.h:91
errBadChi2Prob
Definition: SiPixelSCurveCalibrationAnalysis.h:46
kThresholds
Definition: SiPixelSCurveCalibrationAnalysis.h:33
SiPixelSCurveCalibrationAnalysis::doFits
bool doFits(uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix) override
Definition: SiPixelSCurveCalibrationAnalysis.cc:323
SiPixelSCurveCalibrationAnalysis::maximumThresholdBin_
double maximumThresholdBin_
Definition: SiPixelSCurveCalibrationAnalysis.h:112
SiPixelSCurveCalibrationAnalysis::printoutthresholds_
bool printoutthresholds_
Definition: SiPixelSCurveCalibrationAnalysis.h:97
SiPixelSCurveCalibrationAnalysis::plaquettesToSave_
std::vector< std::string > plaquettesToSave_
Definition: SiPixelSCurveCalibrationAnalysis.h:96
errFlaggedBadByUser
Definition: SiPixelSCurveCalibrationAnalysis.h:44
errNoTurnOn
Definition: SiPixelSCurveCalibrationAnalysis.h:49
SiPixelSCurveCalibrationAnalysis::buildACurveHistogram
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)
Definition: SiPixelSCurveCalibrationAnalysis.cc:141
SiPixelOfflineCalibAnalysisBase
Definition: SiPixelOfflineCalibAnalysisBase.h:65
MonitorElement
dqm::legacy::MonitorElement MonitorElement
Definition: SiPixelSCurveCalibrationAnalysis.h:55
SiPixelSCurveCalibrationAnalysis::makeThresholdSummary
void makeThresholdSummary(void)
Definition: SiPixelSCurveCalibrationAnalysis.cc:24
SiPixelSCurveCalibrationAnalysis::newDetID
void newDetID(uint32_t detid) override
Definition: SiPixelSCurveCalibrationAnalysis.cc:278
SiPixelSCurveCalibrationAnalysis::minimumThreshold_
double minimumThreshold_
Definition: SiPixelSCurveCalibrationAnalysis.h:104
SiPixelSCurveCalibrationAnalysis::fittedSCurveSanityCheck
sCurveErrorFlag fittedSCurveSanityCheck(float threshold, float sigma, float amplitude)
Definition: SiPixelSCurveCalibrationAnalysis.cc:254
errOK
Definition: SiPixelSCurveCalibrationAnalysis.h:43
SiPixelSCurveCalibrationAnalysis::maximumThreshold_
double maximumThreshold_
Definition: SiPixelSCurveCalibrationAnalysis.h:105
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
SiPixelSCurveCalibrationAnalysis::saveCurvesThatFlaggedBad_
bool saveCurvesThatFlaggedBad_
Definition: SiPixelSCurveCalibrationAnalysis.h:90
SiPixelSCurveCalibrationAnalysis::write2dFitResult_
bool write2dFitResult_
Definition: SiPixelSCurveCalibrationAnalysis.h:95
sCurveHistogramHolder
std::map< sCurveHistogramType, MonitorElement * > sCurveHistogramHolder
Definition: SiPixelSCurveCalibrationAnalysis.h:56
SiPixelSCurveCalibrationAnalysis::doSetup
void doSetup(const edm::ParameterSet &)
Definition: SiPixelSCurveCalibrationAnalysis.cc:107