00001 #ifndef EfficiencyPlotter_H 00002 #define EfficiencyPlotter_H 00003 00004 00005 #include "FWCore/Framework/interface/Frameworkfwd.h" 00006 #include <FWCore/Framework/interface/EDAnalyzer.h> 00007 #include "DataFormats/Common/interface/Handle.h" 00008 #include <FWCore/Framework/interface/ESHandle.h> 00009 #include <FWCore/Framework/interface/Event.h> 00010 #include <FWCore/Framework/interface/MakerMacros.h> 00011 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00012 #include <FWCore/Framework/interface/LuminosityBlock.h> 00013 00014 #include "DQMServices/Core/interface/DQMStore.h" 00015 #include "DQMServices/Core/interface/MonitorElement.h" 00016 #include "FWCore/ServiceRegistry/interface/Service.h" 00017 #include "FWCore/Framework/interface/Run.h" 00018 00019 #include <memory> 00020 #include <iostream> 00021 #include <string> 00022 #include <vector> 00023 #include <map> 00024 #include "TH1F.h" 00025 00026 class EfficiencyPlotter: public edm::EDAnalyzer{ 00027 00028 public: 00029 00031 EfficiencyPlotter(const edm::ParameterSet& ps); 00032 00034 virtual ~EfficiencyPlotter(); 00035 00036 protected: 00037 00039 void beginJob(void); 00040 00042 void analyze(const edm::Event& e, const edm::EventSetup& c); 00043 00045 void endJob(); 00046 00047 void beginRun(edm::Run const& run, edm::EventSetup const& eSetup); 00048 void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) ; 00049 00051 void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& c); 00052 void endRun(edm::Run const& run, edm::EventSetup const& eSetup); 00053 00054 00055 private: 00056 00057 // counters 00058 int nevents; 00059 unsigned int nLumiSegs; 00060 int prescaleFactor; 00061 int run; 00062 // Switch for verbosity 00063 std::string metname; 00064 00065 DQMStore* theDbe; 00066 edm::ParameterSet parameters; 00067 00068 //histo binning parameters 00069 int etaBin; 00070 double etaMin; 00071 double etaMax; 00072 00073 int ptBin; 00074 double ptMin; 00075 double ptMax; 00076 00077 int phiBin; 00078 double phiMin; 00079 double phiMax; 00080 00081 // efficiency histograms 00082 MonitorElement* h_eff_pt_TightMu; 00083 MonitorElement* h_eff_pt_barrel_TightMu; 00084 MonitorElement* h_eff_pt_endcap_TightMu; 00085 MonitorElement* h_eff_eta_TightMu; 00086 MonitorElement* h_eff_hp_eta_TightMu; 00087 MonitorElement* h_eff_phi_TightMu; 00088 00089 }; 00090 00091 #endif