CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 // $Id: SiPixelGainCalibrationAnalysis.h,v 1.23 2009/07/07 15:52:36 rougny Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 
24 // user include files
28 
31 
33 
35 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibration.h"
36 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibrationOffline.h"
37 //#include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibrationForHLT.h"
38 
39 //#include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationService.h"
40 
42 #include "TLinearFitter.h"
43 #include "TGraphErrors.h"
44 #include <fstream>
45 //
46 // class decleration
47 //
48 
50 public:
51  explicit SiPixelGainCalibrationAnalysis(const edm::ParameterSet& iConfig);
53 
54  void doSetup(const edm::ParameterSet&);
55  virtual bool doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix);
56 
57  virtual bool checkCorrectCalibrationType();
58 
59 private:
60 
61  virtual void calibrationSetup(const edm::EventSetup& iSetup);
62 
63  virtual void calibrationEnd();
64  virtual void newDetID(uint32_t detid);
65  void fillDatabase();
66  void printSummary();
67  std::vector<float> CalculateAveragePerColumn(uint32_t detid, std::string label);
68  // ----------member data ---------------------------
70  // more class members used to keep track of the histograms
71  std::map<uint32_t,std::map<std::string, MonitorElement *> > bookkeeper_;
72  std::map<uint32_t,std::map<std::string, MonitorElement *> > bookkeeper_pixels_;
73 
74  // fitter
76  std::string fitfunction_;
77  TF1 *func_;
78  TGraphErrors *graph_;
79 
80  std::vector<uint32_t> listofdetids_;
82  // flags
83 
99  bool filldb_;
101 
102  // parameters for database output
103  std::string recordName_;
105  /*SiPixelGainCalibration *theGainCalibrationDbInput_;
106  SiPixelGainCalibrationOffline *theGainCalibrationDbInputOffline_;
107  SiPixelGainCalibrationForHLT *theGainCalibrationDbInputHLT_;
108  SiPixelGainCalibrationService theGainCalibrationDbInputService_;*/
109 
110  // keep track of lowest and highest vals for range
111  float gainlow_;
112  float gainhi_;
113  float pedlow_;
114  float pedhi_;
115  uint16_t min_nentries_;
118 
119  //Summary
120  ofstream summary_;
121  uint32_t currentDetID_;
123 
124 };
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)