Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:44

0001 #include "DQMOffline/PFTau/plugins/MatchMETBenchmarkAnalyzer.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 using namespace reco;
0012 using namespace edm;
0013 using namespace std;
0014 
0015 MatchMETBenchmarkAnalyzer::MatchMETBenchmarkAnalyzer(const edm::ParameterSet &parameterSet)
0016     : BenchmarkAnalyzer(parameterSet), MatchMETBenchmark((Benchmark::Mode)parameterSet.getParameter<int>("mode")) {
0017   matchedInputLabel_ = parameterSet.getParameter<edm::InputTag>("MatchCollection");
0018 
0019   myColl_ = consumes<View<MET>>(inputLabel_);
0020   myMatchColl_ = consumes<View<MET>>(matchedInputLabel_);
0021 }
0022 
0023 void MatchMETBenchmarkAnalyzer::bookHistograms(DQMStore::IBooker &ibooker,
0024                                                edm::Run const &iRun,
0025                                                edm::EventSetup const &iSetup) {
0026   BenchmarkAnalyzer::bookHistograms(ibooker, iRun, iSetup);
0027   setup(ibooker);
0028 }
0029 
0030 void MatchMETBenchmarkAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0031   Handle<View<MET>> collection;
0032   iEvent.getByToken(myColl_, collection);
0033 
0034   Handle<View<MET>> matchedCollection;
0035   iEvent.getByToken(myMatchColl_, matchedCollection);
0036 
0037   fillOne((*collection)[0], (*matchedCollection)[0]);
0038 }