Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "DQMOffline/PFTau/plugins/PFCandidateBenchmarkAnalyzer.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/ParticleFlowCandidate/interface/PFCandidate.h"
0009 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0010 
0011 #include "DQMServices/Core/interface/DQMStore.h"
0012 #include "FWCore/ServiceRegistry/interface/Service.h"
0013 
0014 using namespace reco;
0015 using namespace edm;
0016 using namespace std;
0017 
0018 PFCandidateBenchmarkAnalyzer::PFCandidateBenchmarkAnalyzer(const edm::ParameterSet &parameterSet)
0019     : BenchmarkAnalyzer(parameterSet), PFCandidateBenchmark((Benchmark::Mode)parameterSet.getParameter<int>("mode")) {
0020   setRange(parameterSet.getParameter<double>("ptMin"),
0021            parameterSet.getParameter<double>("ptMax"),
0022            parameterSet.getParameter<double>("etaMin"),
0023            parameterSet.getParameter<double>("etaMax"),
0024            parameterSet.getParameter<double>("phiMin"),
0025            parameterSet.getParameter<double>("phiMax"));
0026 
0027   myColl_ = consumes<PFCandidateCollection>(inputLabel_);
0028 }
0029 
0030 void PFCandidateBenchmarkAnalyzer::bookHistograms(DQMStore::IBooker &ibooker,
0031                                                   edm::Run const &iRun,
0032                                                   edm::EventSetup const &iSetup) {
0033   BenchmarkAnalyzer::bookHistograms(ibooker, iRun, iSetup);
0034   setup(ibooker);
0035 }
0036 
0037 void PFCandidateBenchmarkAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0038   Handle<PFCandidateCollection> collection;
0039   iEvent.getByToken(myColl_, collection);
0040 
0041   fill(*collection);
0042 }