CMS 3D CMS Logo

SiPixelGainCalibrationAnalysis.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelGainCalibrationAnalysis
4 // Class: SiPixelGainCalibrationAnalysis
5 //
13 //
14 // Original Author: Freya Blekman
15 // Created: Wed Nov 14 15:02:06 CET 2007
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
26 
29 
31 
33 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibration.h"
34 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibrationOffline.h"
35 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibrationForHLT.h"
36 
37 //#include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationService.h"
38 
40 #include "TLinearFitter.h"
41 #include "TGraphErrors.h"
42 #include <fstream>
43 //
44 // class decleration
45 //
46 
48 public:
49  explicit SiPixelGainCalibrationAnalysis(const edm::ParameterSet &iConfig);
51 
52  void doSetup(const edm::ParameterSet &);
53  bool doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix) override;
54 
55  bool checkCorrectCalibrationType() override;
56 
57 private:
58  void calibrationSetup(const edm::EventSetup &iSetup) override;
59 
60  void calibrationEnd() override;
61  void newDetID(uint32_t detid) override;
62  void fillDatabase();
63  void printSummary();
64  std::vector<float> CalculateAveragePerColumn(uint32_t detid, std::string label);
65  // ----------member data ---------------------------
67  // more class members used to keep track of the histograms
68  std::map<uint32_t, std::map<std::string, MonitorElement *> > bookkeeper_;
69  std::map<uint32_t, std::map<std::string, MonitorElement *> > bookkeeper_pixels_;
70 
71  // fitter
74  TF1 *func_;
75  TGraphErrors *graph_;
76 
77  std::vector<uint32_t> listofdetids_;
79  // flags
80 
96  bool filldb_;
98 
99  // parameters for database output
102  /*SiPixelGainCalibration *theGainCalibrationDbInput_;
103  SiPixelGainCalibrationOffline *theGainCalibrationDbInputOffline_;
104  SiPixelGainCalibrationForHLT *theGainCalibrationDbInputHLT_;
105  SiPixelGainCalibrationService theGainCalibrationDbInputService_;*/
106 
107  // keep track of lowest and highest vals for range
108  float gainlow_;
109  float gainhi_;
110  float pedlow_;
111  float pedhi_;
112  uint16_t min_nentries_;
115 
116  //Summary
117  std::ofstream summary_;
118  uint32_t currentDetID_;
120 };
std::map< uint32_t, std::map< std::string, MonitorElement * > > bookkeeper_pixels_
bool doFits(uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix) override
SiPixelGainCalibrationAnalysis(const edm::ParameterSet &iConfig)
char const * label
void doSetup(const edm::ParameterSet &)
void calibrationSetup(const edm::EventSetup &iSetup) override
std::map< uint32_t, std::map< std::string, MonitorElement * > > bookkeeper_
std::vector< float > CalculateAveragePerColumn(uint32_t detid, std::string label)