Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:09

0001 #include "DQMOffline/PFTau/plugins/METBenchmarkAnalyzer.h"
0002 
0003 #include "DataFormats/Common/interface/Handle.h"
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/Utilities/interface/InputTag.h"
0007 
0008 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0009 #include "DataFormats/METReco/interface/MET.h"
0010 
0011 #include "DQMServices/Core/interface/DQMStore.h"
0012 
0013 using namespace reco;
0014 using namespace edm;
0015 using namespace std;
0016 
0017 METBenchmarkAnalyzer::METBenchmarkAnalyzer(const edm::ParameterSet &parameterSet)
0018     : BenchmarkAnalyzer(parameterSet), METBenchmark((Benchmark::Mode)parameterSet.getParameter<int>("mode")) {
0019   setRange(parameterSet.getParameter<double>("ptMin"),
0020            parameterSet.getParameter<double>("ptMax"),
0021            -0.1,
0022            0.1,  // range in eta for MET.
0023            parameterSet.getParameter<double>("phiMin"),
0024            parameterSet.getParameter<double>("phiMax"));
0025 
0026   myColl_ = consumes<View<MET>>(inputLabel_);
0027 }
0028 
0029 void METBenchmarkAnalyzer::bookHistograms(DQMStore::IBooker &ibooker,
0030                                           edm::Run const &iRun,
0031                                           edm::EventSetup const &iSetup) {
0032   BenchmarkAnalyzer::bookHistograms(ibooker, iRun, iSetup);
0033   setup(ibooker);
0034 }
0035 
0036 void METBenchmarkAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0037   Handle<View<MET>> collection;
0038   iEvent.getByToken(myColl_, collection);
0039 
0040   fill(*collection);
0041 }