Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "DQMOffline/PFTau/plugins/PFCandidateManagerAnalyzer.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 PFCandidateManagerAnalyzer::PFCandidateManagerAnalyzer(const edm::ParameterSet &parameterSet)
0019     : BenchmarkAnalyzer(parameterSet),
0020       PFCandidateManager(parameterSet.getParameter<double>("dRMax"),
0021                          parameterSet.getParameter<bool>("matchCharge"),
0022                          (Benchmark::Mode)parameterSet.getParameter<int>("mode")),
0023       matchLabel_(parameterSet.getParameter<InputTag>("MatchCollection")) {
0024   setRange(parameterSet.getParameter<double>("ptMin"),
0025            parameterSet.getParameter<double>("ptMax"),
0026            parameterSet.getParameter<double>("etaMin"),
0027            parameterSet.getParameter<double>("etaMax"),
0028            parameterSet.getParameter<double>("phiMin"),
0029            parameterSet.getParameter<double>("phiMax"));
0030 
0031   myColl_ = consumes<PFCandidateCollection>(inputLabel_);
0032   myMatchColl_ = consumes<View<Candidate>>(matchLabel_);
0033 }
0034 
0035 void PFCandidateManagerAnalyzer::bookHistograms(DQMStore::IBooker &ibooker,
0036                                                 edm::Run const &iRun,
0037                                                 edm::EventSetup const &iSetup) {
0038   BenchmarkAnalyzer::bookHistograms(ibooker, iRun, iSetup);
0039   setup(ibooker);
0040 }
0041 
0042 void PFCandidateManagerAnalyzer::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0043   Handle<PFCandidateCollection> collection;
0044   iEvent.getByToken(myColl_, collection);
0045 
0046   Handle<View<Candidate>> matchCollection;
0047   iEvent.getByToken(myMatchColl_, matchCollection);
0048 
0049   fill(*collection, *matchCollection);
0050 }