CMS 3D CMS Logo

SiPixelOfflineCalibAnalysisBase.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelOfflineCalibAnalysisBase
4 // Class: SiPixelOfflineCalibAnalysisBase
5 //
13 //
14 // Original Author: Evan Klose Friis
15 // additions by: Freya Blekman
16 // Created: Tue Nov 6 17:27:19 CET 2007
17 //
18 //
19 
20 // system include files
21 #include <memory>
22 
23 // user include files
26 
29 //#include "FWCore/Framework/interface/EventSetup.h"
32 
35 
38 
41 
45 
48 
49 #include "TF1.h"
50 
56 
57 #include <map>
58 #include <vector>
59 #include <iostream>
60 #include <string>
61 //
62 // class decleration
63 //
64 
66 public:
71 
72  //no argument constructor only used to throw exception in the case of derived
73  //class constructor not calling SiPixelOfflineCalibAnalysisBase(const edm::ParameterSet&)
75 
76  //pure virtual function, called after each DetID loaded
77  virtual bool doFits(uint32_t detid, std::vector<SiPixelCalibDigi>::const_iterator ipix);
78 
79  //translate DetID to human readable string
80  std::string translateDetIdToString(uint32_t detid);
81 
82  //booking DQM histograms (for dynamic histogram creation)
83 
85  uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX);
87  uint32_t detid, std::string name, std::string title, int nchX, float* xbinsize); //variable size bins
88  MonitorElement* bookDQMHistogram2D(uint32_t detid,
91  int nchX,
92  double lowX,
93  double highX,
94  int nchY,
95  double lowY,
96  double highY);
97 
99  uint32_t detid,
102  title); // take the detid to determine the size of rows and columns, this saves looking up everything in the cabling map by the user.
104 
106  bool setDQMDirectory(uint32_t detID); //automatically create directory hierachy based on DetID
107  static TF1* fitFunction_;
108  static const std::vector<short>* getVcalValues();
109  std::vector<uint32_t>& getRunNumbers() { return runnumbers_; }
110 
111 protected:
112  //calibration parameters from calib.dat/DB
116 
118  short nTriggers_;
119  static std::vector<short> vCalValues_;
120  uint32_t& EventNumber() { return eventCounter_; }
121 
122 private:
128 
129  std::vector<uint32_t> runnumbers_;
130  uint32_t eventCounter_;
131 
132  //store set of detIDs that have been encountered
133  //second int argument can be a derived class result flag
134  std::map<uint32_t, int> detIdsEntered_;
135  std::map<uint32_t, std::string> detIdNames_;
136 
138 
140 
141  //the beginJob is used to load the calib database. It then calls the pure
142  //virtual calibrationSetup() function. Derived classes should put beginJob functionality there.
143  void beginRun(const edm::Run&, const edm::EventSetup&) override;
144  void beginRun(const edm::EventSetup& iSetup);
145  void beginJob() override;
146 
147  //calibrationSetup will be used by derived classes
148  virtual void calibrationSetup(const edm::EventSetup& iSetup);
149 
150  // pure virtual function, checks if the calibration analyzer is of the right type wrt the calibration information in the database (as defined in the calibrationMode_ variable). Should be implemented in each analyzer, if false will not do anything in analyze loop. default returns true.
151  virtual bool checkCorrectCalibrationType();
152 
153  //called when new DetID discovered
154  virtual void newDetID(uint32_t detid);
155 
156  void analyze(const edm::Event&, const edm::EventSetup&) override;
157  // the endJob method is used to save things like histograms etc.
158  // for additional actions derived classes should use the calibrationEnd() method for endJob functionality.
159  void endJob() override;
160  // calibrationEnd() will be used by derived classes
161  virtual void calibrationEnd();
162 
163  // checkPixel returns whether a particular pixel is to be expected during the entire run..
164  bool checkPixel(uint32_t detid, short row, short column);
165 };
SiPixelOfflineCalibAnalysisBase::tPixelCalibDigi
edm::EDGetTokenT< edm::DetSetVector< SiPixelCalibDigi > > tPixelCalibDigi
Definition: SiPixelOfflineCalibAnalysisBase.h:139
SiPixelOfflineCalibAnalysisBase::outputFileName_
std::string outputFileName_
Definition: SiPixelOfflineCalibAnalysisBase.h:126
SiPixelOfflineCalibAnalysisBase::nTriggers_
short nTriggers_
Definition: SiPixelOfflineCalibAnalysisBase.h:118
SiPixelOfflineCalibAnalysisBase::addTF1ToDQMMonitoringElement
void addTF1ToDQMMonitoringElement(MonitorElement *ele, TF1 *func)
Definition: SiPixelOfflineCalibAnalysisBase.cc:297
SiPixelOfflineCalibAnalysisBase::translateDetIdToString
std::string translateDetIdToString(uint32_t detid)
Definition: SiPixelOfflineCalibAnalysisBase.cc:146
SiPixelOfflineCalibAnalysisBase::doFits
virtual bool doFits(uint32_t detid, std::vector< SiPixelCalibDigi >::const_iterator ipix)
Definition: SiPixelOfflineCalibAnalysisBase.cc:221
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
PixelBarrelName.h
SiPixelOfflineCalibAnalysisBase::calib_
edm::ESHandle< SiPixelCalibConfiguration > calib_
Definition: SiPixelOfflineCalibAnalysisBase.h:113
TrackerGeometry.h
SiPixelOfflineCalibAnalysisBase::calibrationMode_
std::string calibrationMode_
Definition: SiPixelOfflineCalibAnalysisBase.h:117
ESHandle.h
SiPixelOfflineCalibAnalysisBase::beginJob
void beginJob() override
Definition: SiPixelOfflineCalibAnalysisBase.cc:129
edm::Run
Definition: Run.h:45
edm::EDGetTokenT
Definition: EDGetToken.h:33
SiPixelOfflineCalibAnalysisBase::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: SiPixelOfflineCalibAnalysisBase.h:68
SiPixelOfflineCalibAnalysisBase::fitFunction_
static TF1 * fitFunction_
Definition: SiPixelOfflineCalibAnalysisBase.h:107
SiPixelOfflineCalibAnalysisBase::detIdNames_
std::map< uint32_t, std::string > detIdNames_
Definition: SiPixelOfflineCalibAnalysisBase.h:135
SiPixelOfflineCalibAnalysisBase::getRunNumbers
std::vector< uint32_t > & getRunNumbers()
Definition: SiPixelOfflineCalibAnalysisBase.h:109
SiPixelOfflineCalibAnalysisBase::SiPixelOfflineCalibAnalysisBase
SiPixelOfflineCalibAnalysisBase()
Definition: SiPixelOfflineCalibAnalysisBase.cc:46
SiPixelFedCablingMap.h
DQMStore.h
SiPixelHistogramId.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
SiPixelOfflineCalibAnalysisBase::bookDQMHistogram1D
MonitorElement * bookDQMHistogram1D(uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX)
Definition: SiPixelOfflineCalibAnalysisBase.cc:172
EDAnalyzer.h
tools.TF1
TF1
Definition: tools.py:23
SiPixelOfflineCalibAnalysisBase::calibrationSetup
virtual void calibrationSetup(const edm::EventSetup &iSetup)
Definition: SiPixelOfflineCalibAnalysisBase.cc:239
SiPixelCalibDigifwd.h
SiPixelOfflineCalibAnalysisBase::folderMaker_
SiPixelFolderOrganizer * folderMaker_
Definition: SiPixelOfflineCalibAnalysisBase.h:123
SiPixelOfflineCalibAnalysisBase::vCalValues_
static std::vector< short > vCalValues_
Definition: SiPixelOfflineCalibAnalysisBase.h:119
SiPixelCalibConfiguration.h
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
MakerMacros.h
SiPixelOfflineCalibAnalysisBase::daqBE_
DQMStore * daqBE_
Definition: SiPixelOfflineCalibAnalysisBase.h:124
dqm::legacy::DQMStore
Definition: DQMStore.h:727
Service.h
edm::ESHandle< SiPixelCalibConfiguration >
SiPixelOfflineCalibAnalysisBase::geom_
edm::ESHandle< TrackerGeometry > geom_
Definition: SiPixelOfflineCalibAnalysisBase.h:114
SiPixelOfflineCalibAnalysisBase::bookDQMHistoPlaquetteSummary2D
MonitorElement * bookDQMHistoPlaquetteSummary2D(uint32_t detid, std::string name, std::string title)
Definition: SiPixelOfflineCalibAnalysisBase.cc:197
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelOfflineCalibAnalysisBase::eventCounter_
uint32_t eventCounter_
Definition: SiPixelOfflineCalibAnalysisBase.h:130
SiPixelHistogramId
Definition: SiPixelHistogramId.h:25
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
SiPixelCalibConfigurationRcd.h
SiPixelFedCablingMapRcd.h
SiPixelOfflineCalibAnalysisBase::calibrationEnd
virtual void calibrationEnd()
Definition: SiPixelOfflineCalibAnalysisBase.cc:243
SiPixelOfflineCalibAnalysisBase::setDQMDirectory
bool setDQMDirectory(std::string dirName)
Definition: SiPixelOfflineCalibAnalysisBase.cc:209
SiPixelCalibDigi.h
SiPixelOfflineCalibAnalysisBase::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: SiPixelOfflineCalibAnalysisBase.cc:60
edm::EventSetup
Definition: EventSetup.h:57
DetSetVector.h
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
InputTag.h
SiPixelOfflineCalibAnalysisBase::createOutputFile_
bool createOutputFile_
Definition: SiPixelOfflineCalibAnalysisBase.h:127
SiPixelOfflineCalibAnalysisBase::runnumbers_
std::vector< uint32_t > runnumbers_
Definition: SiPixelOfflineCalibAnalysisBase.h:129
SiPixelOfflineCalibAnalysisBase::siPixelCalibDigiProducer_
edm::InputTag siPixelCalibDigiProducer_
Definition: SiPixelOfflineCalibAnalysisBase.h:137
DetId.h
Frameworkfwd.h
SiPixelOfflineCalibAnalysisBase::newDetID
virtual void newDetID(uint32_t detid)
Definition: SiPixelOfflineCalibAnalysisBase.cc:246
SiPixelOfflineCalibAnalysisBase
Definition: SiPixelOfflineCalibAnalysisBase.h:65
SiPixelFolderOrganizer
Definition: SiPixelFolderOrganizer.h:26
SiPixelOfflineCalibAnalysisBase::MonitorElement
dqm::legacy::MonitorElement MonitorElement
Definition: SiPixelOfflineCalibAnalysisBase.h:67
TrackerOfflineValidation_Dqm_cff.dirName
dirName
Definition: TrackerOfflineValidation_Dqm_cff.py:55
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
SiPixelOfflineCalibAnalysisBase::checkCorrectCalibrationType
virtual bool checkCorrectCalibrationType()
Definition: SiPixelOfflineCalibAnalysisBase.cc:219
SiPixelOfflineCalibAnalysisBase::theCablingMap_
edm::ESHandle< SiPixelFedCablingMap > theCablingMap_
Definition: SiPixelOfflineCalibAnalysisBase.h:115
SiPixelFolderOrganizer.h
ParameterSet.h
SiPixelOfflineCalibAnalysisBase::getVcalValues
static const std::vector< short > * getVcalValues()
Definition: SiPixelOfflineCalibAnalysisBase.cc:144
SiPixelOfflineCalibAnalysisBase::checkPixel
bool checkPixel(uint32_t detid, short row, short column)
Definition: SiPixelOfflineCalibAnalysisBase.cc:252
SiPixelOfflineCalibAnalysisBase::detIdsEntered_
std::map< uint32_t, int > detIdsEntered_
Definition: SiPixelOfflineCalibAnalysisBase.h:134
edm::Event
Definition: Event.h:73
SiPixelOfflineCalibAnalysisBase::bookDQMHistogram2D
MonitorElement * bookDQMHistogram2D(uint32_t detid, std::string name, std::string title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Definition: SiPixelOfflineCalibAnalysisBase.cc:184
edm::InputTag
Definition: InputTag.h:15
SiPixelOfflineCalibAnalysisBase::EventNumber
uint32_t & EventNumber()
Definition: SiPixelOfflineCalibAnalysisBase.h:120
SiPixelOfflineCalibAnalysisBase::endJob
void endJob() override
Definition: SiPixelOfflineCalibAnalysisBase.cc:133
SiPixelOfflineCalibAnalysisBase::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: SiPixelOfflineCalibAnalysisBase.cc:112
SiPixelOfflineCalibAnalysisBase::theHistogramIdWorker_
SiPixelHistogramId * theHistogramIdWorker_
Definition: SiPixelOfflineCalibAnalysisBase.h:125
PixelEndcapName.h
SiPixelOfflineCalibAnalysisBase::~SiPixelOfflineCalibAnalysisBase
~SiPixelOfflineCalibAnalysisBase() override
Definition: SiPixelOfflineCalibAnalysisBase.cc:53