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 
20 // system include files
21 #include <memory>
22 
23 // user include files
27 
30 
32 
34 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibration.h"
35 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibrationOffline.h"
36 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibrationForHLT.h"
37 
38 //#include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationService.h"
39 
41 #include "TLinearFitter.h"
42 #include "TGraphErrors.h"
43 #include <fstream>
44 //
45 // class decleration
46 //
47 
49 public:
50  explicit SiPixelGainCalibrationAnalysis(const edm::ParameterSet& iConfig);
52 
53  void doSetup(const edm::ParameterSet&);
54  virtual bool doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix);
55 
56  virtual bool checkCorrectCalibrationType();
57 
58 private:
59 
60  virtual void calibrationSetup(const edm::EventSetup& iSetup);
61 
62  virtual void calibrationEnd();
63  virtual void newDetID(uint32_t detid);
64  void fillDatabase();
65  void printSummary();
66  std::vector<float> CalculateAveragePerColumn(uint32_t detid, std::string label);
67  // ----------member data ---------------------------
69  // more class members used to keep track of the histograms
70  std::map<uint32_t,std::map<std::string, MonitorElement *> > bookkeeper_;
71  std::map<uint32_t,std::map<std::string, MonitorElement *> > bookkeeper_pixels_;
72 
73  // fitter
76  TF1 *func_;
77  TGraphErrors *graph_;
78 
79  std::vector<uint32_t> listofdetids_;
81  // flags
82 
98  bool filldb_;
100 
101  // parameters for database output
104  /*SiPixelGainCalibration *theGainCalibrationDbInput_;
105  SiPixelGainCalibrationOffline *theGainCalibrationDbInputOffline_;
106  SiPixelGainCalibrationForHLT *theGainCalibrationDbInputHLT_;
107  SiPixelGainCalibrationService theGainCalibrationDbInputService_;*/
108 
109  // keep track of lowest and highest vals for range
110  float gainlow_;
111  float gainhi_;
112  float pedlow_;
113  float pedhi_;
114  uint16_t min_nentries_;
117 
118  //Summary
119  std::ofstream summary_;
120  uint32_t currentDetID_;
122 
123 };
std::map< uint32_t, std::map< std::string, MonitorElement * > > bookkeeper_pixels_
virtual void calibrationSetup(const edm::EventSetup &iSetup)
SiPixelGainCalibrationAnalysis(const edm::ParameterSet &iConfig)
virtual bool doFits(uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix)
void doSetup(const edm::ParameterSet &)
std::map< uint32_t, std::map< std::string, MonitorElement * > > bookkeeper_
std::vector< float > CalculateAveragePerColumn(uint32_t detid, std::string label)