|
1 | | -#include "ElectronEfficiencyPlotter.h" |
2 | | - |
3 | | -// Framework |
| 1 | +// system includes |
4 | 2 | #include <cmath> |
5 | 3 | #include <string> |
6 | 4 |
|
| 5 | +// user includes |
| 6 | +#include "DQMServices/Core/interface/DQMEDHarvester.h" |
7 | 7 | #include "DQMServices/Core/interface/DQMStore.h" |
8 | 8 | #include "DataFormats/Common/interface/Handle.h" |
9 | 9 | #include "FWCore/Framework/interface/ESHandle.h" |
10 | 10 | #include "FWCore/Framework/interface/Event.h" |
11 | 11 | #include "FWCore/Framework/interface/EventSetup.h" |
| 12 | +#include "FWCore/Framework/interface/Frameworkfwd.h" |
| 13 | +#include "FWCore/Framework/interface/LuminosityBlock.h" |
12 | 14 | #include "FWCore/Framework/interface/MakerMacros.h" |
13 | 15 | #include "FWCore/MessageLogger/interface/MessageLogger.h" |
14 | 16 | #include "FWCore/ParameterSet/interface/ParameterSet.h" |
| 17 | +#include "FWCore/ServiceRegistry/interface/Service.h" |
| 18 | + |
| 19 | +// ROOT includes |
15 | 20 | #include "TF1.h" |
16 | 21 | #include "TH1F.h" |
17 | 22 |
|
| 23 | +class ElectronEfficiencyPlotter : public DQMEDHarvester { |
| 24 | +public: |
| 25 | + // Constructor |
| 26 | + ElectronEfficiencyPlotter(const edm::ParameterSet &ps); |
| 27 | + // Destructor |
| 28 | + ~ElectronEfficiencyPlotter() override = default; |
| 29 | + |
| 30 | + static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); |
| 31 | + |
| 32 | +protected: |
| 33 | + // DQM Client Diagnostic |
| 34 | + void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override; |
| 35 | + |
| 36 | +private: |
| 37 | + // counters |
| 38 | + const int ptBin_; |
| 39 | + const double ptMin_; |
| 40 | + const double ptMax_; |
| 41 | + const std::string ID_; |
| 42 | + const std::string theFolder_; |
| 43 | + const std::string sourceFolder_; |
| 44 | + |
| 45 | + MonitorElement *h_eff_pt_EB_doubleEG_HLT; |
| 46 | + MonitorElement *h_eff_pt_EE_doubleEG_HLT; |
| 47 | + MonitorElement *h_eff_pt_EB_singlePhoton_HLT; |
| 48 | + MonitorElement *h_eff_pt_EE_singlePhoton_HLT; |
| 49 | + |
| 50 | + void calculateEfficiency(MonitorElement *Numerator, MonitorElement *Denominator, MonitorElement *Efficiency); |
| 51 | +}; |
| 52 | + |
18 | 53 | using namespace edm; |
19 | 54 | using namespace std; |
20 | 55 |
|
21 | 56 | // Constructor |
22 | | -ElectronEfficiencyPlotter::ElectronEfficiencyPlotter(const edm::ParameterSet &ps) { |
23 | | - ptBin_ = ps.getParameter<int>("ptBin"); |
24 | | - ptMin_ = ps.getParameter<double>("ptMin"); |
25 | | - ptMax_ = ps.getParameter<double>("ptMax"); |
26 | | - |
27 | | - ID_ = ps.getParameter<string>("sctElectronID"); |
28 | | - theFolder_ = ps.getParameter<string>("folder"); |
29 | | - sourceFolder_ = ps.getParameter<string>("srcFolder"); |
| 57 | +ElectronEfficiencyPlotter::ElectronEfficiencyPlotter(const edm::ParameterSet &ps) |
| 58 | + : ptBin_{ps.getParameter<int>("ptBin")}, |
| 59 | + ptMin_{ps.getParameter<double>("ptMin")}, |
| 60 | + ptMax_{ps.getParameter<double>("ptMax")}, |
| 61 | + ID_{ps.getParameter<string>("sctElectronID")}, |
| 62 | + theFolder_{ps.getParameter<string>("folder")}, |
| 63 | + sourceFolder_{ps.getParameter<string>("srcFolder")} {} |
| 64 | + |
| 65 | +void ElectronEfficiencyPlotter::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { |
| 66 | + edm::ParameterSetDescription desc; |
| 67 | + desc.add<int>("ptBin", 5); |
| 68 | + desc.add<double>("ptMin", 0); |
| 69 | + desc.add<double>("ptMax", 100); |
| 70 | + desc.add<string>("sctElectronID", {}); |
| 71 | + desc.add<string>("folder", {}); |
| 72 | + desc.add<string>("srcFolder", {}); |
| 73 | + descriptions.addWithDefaultLabel(desc); |
30 | 74 | } |
31 | 75 |
|
32 | 76 | void ElectronEfficiencyPlotter::dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) { |
|
0 commit comments