File indexing completed on 2024-04-06 11:59:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include <memory>
0021
0022
0023 #include "FWCore/Framework/interface/Frameworkfwd.h"
0024 #include "CalibTracker/SiPixelTools/interface/SiPixelOfflineCalibAnalysisBase.h"
0025
0026 #include "FWCore/Framework/interface/Event.h"
0027 #include "FWCore/Framework/interface/MakerMacros.h"
0028
0029 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0030
0031 #include "CondFormats/SiPixelObjects/interface/SiPixelCalibConfiguration.h"
0032
0033
0034
0035
0036
0037
0038 #include "DQMServices/Core/interface/DQMStore.h"
0039 #include "TLinearFitter.h"
0040 #include "TGraphErrors.h"
0041 #include <fstream>
0042
0043
0044
0045
0046 class SiPixelGainCalibrationAnalysis : public SiPixelOfflineCalibAnalysisBase {
0047 public:
0048 explicit SiPixelGainCalibrationAnalysis(const edm::ParameterSet &iConfig);
0049 ~SiPixelGainCalibrationAnalysis() override;
0050
0051 void doSetup(const edm::ParameterSet &);
0052 bool doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix) override;
0053
0054 bool checkCorrectCalibrationType() override;
0055
0056 private:
0057 void calibrationSetup(const edm::EventSetup &iSetup) override;
0058
0059 void calibrationEnd() override;
0060 void newDetID(uint32_t detid) override;
0061 void fillDatabase();
0062 void printSummary();
0063 std::vector<float> CalculateAveragePerColumn(uint32_t detid, std::string label);
0064
0065 edm::ParameterSet conf_;
0066
0067 std::map<uint32_t, std::map<std::string, MonitorElement *> > bookkeeper_;
0068 std::map<uint32_t, std::map<std::string, MonitorElement *> > bookkeeper_pixels_;
0069
0070
0071 int nfitparameters_;
0072 std::string fitfunction_;
0073 TF1 *func_;
0074 TGraphErrors *graph_;
0075
0076 std::vector<uint32_t> listofdetids_;
0077 bool ignoreMode_;
0078
0079
0080 bool reject_badpoints_;
0081 bool reject_plateaupoints_;
0082 bool reject_single_entries_;
0083 double plateau_max_slope_;
0084 bool reject_first_point_;
0085 double reject_badpoints_frac_;
0086 bool bookBIGCalibPayload_;
0087 bool savePixelHists_;
0088 double chi2Threshold_;
0089 double chi2ProbThreshold_;
0090 double maxGainInHist_;
0091 double maxChi2InHist_;
0092 bool saveALLHistograms_;
0093 bool sum_ped_cols_;
0094 bool sum_gain_cols_;
0095 bool filldb_;
0096 bool writeSummary_;
0097
0098
0099 std::string recordName_;
0100 bool appendMode_;
0101
0102
0103
0104
0105
0106
0107 float gainlow_;
0108 float gainhi_;
0109 float pedlow_;
0110 float pedhi_;
0111 uint16_t min_nentries_;
0112 bool useVcalHigh_;
0113 double scalarVcalHigh_VcalLow_;
0114
0115
0116 std::ofstream summary_;
0117 uint32_t currentDetID_;
0118 int *statusNumbers_;
0119 };