Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "DQMOffline/PFTau/plugins/CandidateBenchmarkAnalyzer.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/Candidate.h"
0009 #include "DataFormats/Candidate/interface/CandidateFwd.h"
0010 
0011 #include "DQMServices/Core/interface/DQMStore.h"
0012 
0013 using namespace reco;
0014 using namespace edm;
0015 using namespace std;
0016 
0017 CandidateBenchmarkAnalyzer::CandidateBenchmarkAnalyzer(const edm::ParameterSet &parameterSet)
0018     : BenchmarkAnalyzer(parameterSet), CandidateBenchmark((Benchmark::Mode)parameterSet.getParameter<int>("mode")) {
0019   setRange(parameterSet.getParameter<double>("ptMin"),
0020            parameterSet.getParameter<double>("ptMax"),
0021            parameterSet.getParameter<double>("etaMin"),
0022            parameterSet.getParameter<double>("etaMax"),
0023            parameterSet.getParameter<double>("phiMin"),
0024            parameterSet.getParameter<double>("phiMax"));
0025 
0026   myColl_ = consumes<View<Candidate>>(inputLabel_);
0027 }
0028 
0029 void CandidateBenchmarkAnalyzer::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 CandidateBenchmarkAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0037   Handle<View<Candidate>> collection;
0038   iEvent.getByToken(myColl_, collection);
0039 
0040   fill(*collection);
0041 }