CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
25 
28 
30 
32 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibration.h"
33 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibrationOffline.h"
34 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibrationForHLT.h"
35 
36 //#include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationService.h"
37 
39 #include "TLinearFitter.h"
40 #include "TGraphErrors.h"
41 #include <fstream>
42 //
43 // class decleration
44 //
45 
47 public:
50 
51  void doSetup(const edm::ParameterSet &);
52  bool doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix) override;
53 
54  bool checkCorrectCalibrationType() override;
55 
56 private:
57  void calibrationSetup(const edm::EventSetup &iSetup) override;
58 
59  void calibrationEnd() override;
60  void newDetID(uint32_t detid) override;
61  void fillDatabase();
62  void printSummary();
63  std::vector<float> CalculateAveragePerColumn(uint32_t detid, std::string label);
64  // ----------member data ---------------------------
66  // more class members used to keep track of the histograms
67  std::map<uint32_t, std::map<std::string, MonitorElement *> > bookkeeper_;
68  std::map<uint32_t, std::map<std::string, MonitorElement *> > bookkeeper_pixels_;
69 
70  // fitter
73  TF1 *func_;
74  TGraphErrors *graph_;
75 
76  std::vector<uint32_t> listofdetids_;
78  // flags
79 
95  bool filldb_;
97 
98  // parameters for database output
101  /*SiPixelGainCalibration *theGainCalibrationDbInput_;
102  SiPixelGainCalibrationOffline *theGainCalibrationDbInputOffline_;
103  SiPixelGainCalibrationForHLT *theGainCalibrationDbInputHLT_;
104  SiPixelGainCalibrationService theGainCalibrationDbInputService_;*/
105 
106  // keep track of lowest and highest vals for range
107  float gainlow_;
108  float gainhi_;
109  float pedlow_;
110  float pedhi_;
111  uint16_t min_nentries_;
114 
115  //Summary
116  std::ofstream summary_;
117  uint32_t currentDetID_;
119 };
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)