CMS 3D CMS Logo

PFMuonDQMAnalyzer.cc
Go to the documentation of this file.
2 
4 
9 
13 
16 //
17 // -- Constructor
18 //
20 
21 {
23  inputLabel_ = pSet_.getParameter<edm::InputTag>("InputCollection");
24  matchLabel_ = pSet_.getParameter<edm::InputTag>("MatchCollection");
25  benchmarkLabel_ = pSet_.getParameter<std::string>("BenchmarkLabel");
26  createEfficiencyHistos_ = pSet_.getParameter<bool>("CreateEfficiencyHistos");
27 
29 
30  myCand_ = consumes<edm::View<reco::Muon>>(inputLabel_);
31  myMatchedCand_ = consumes<edm::View<reco::Muon>>(matchLabel_);
32 
34 
35  subsystemname_ = "ParticleFlow";
37 
38  nBadEvents_ = 0;
39 }
40 
41 //
42 // -- BookHistograms
43 //
45  edm::Run const & /* iRun */,
46  edm::EventSetup const & /* iSetup */) {
48 
49  edm::LogInfo("PFMuonDQMAnalyzer") << " PFMuonDQMAnalyzer::bookHistograms "
50  << "Histogram Folder path set to " << eventInfoFolder_;
51 
53 }
54 
55 //
56 // -- Analyze
57 //
59  edm::Handle<edm::View<reco::Muon>> candCollection;
60  edm::Handle<edm::View<reco::Muon>> matchedCandCollection;
62  iEvent.getByToken(myCand_, candCollection);
63  iEvent.getByToken(myMatchedCand_, matchedCandCollection);
64  } else {
65  iEvent.getByToken(myMatchedCand_, candCollection);
66  iEvent.getByToken(myCand_, matchedCandCollection);
67  }
68 
69  float maxRes = 0.0;
70  float minRes = 99.99;
71  if (candCollection.isValid() && matchedCandCollection.isValid()) {
72  pfCandidateMonitor_.fill(*candCollection, *matchedCandCollection, minRes, maxRes, pSet_, *matchedCandCollection);
73  }
74 }
75 
Handle.h
PFMuonDQMAnalyzer::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: PFMuonDQMAnalyzer.cc:44
PFMuonDQMAnalyzer::myCand_
edm::EDGetTokenT< edm::View< reco::Muon > > myCand_
Definition: PFMuonDQMAnalyzer.h:24
Muon.h
MessageLogger.h
PFMuonDQMAnalyzer::inputLabel_
edm::InputTag inputLabel_
Definition: PFMuonDQMAnalyzer.h:27
edm::Run
Definition: Run.h:45
printsummarytable.folder
folder
Definition: printsummarytable.py:7
edm::LogInfo
Definition: MessageLogger.h:254
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
PFMuonDQMAnalyzer::pSet_
edm::ParameterSet pSet_
Definition: PFMuonDQMAnalyzer.h:36
PFCandidateMonitor::setParameters
void setParameters(float dRMax, bool matchCharge, Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool refHistoFlag)
set the parameters locally
Definition: PFCandidateMonitor.cc:62
edm::Handle
Definition: AssociativeIterator.h:50
PFCandidateMonitor::fill
void fill(const T &candidateCollection, const C &matchedCandCollection, float &minVal, float &maxVal, const edm::ParameterSet &parameterSet)
fill histograms with all particle
Definition: PFCandidateMonitor.h:87
PFMuonDQMAnalyzer::pfCandidateMonitor_
PFCandidateMonitor pfCandidateMonitor_
Definition: PFMuonDQMAnalyzer.h:34
CandidateFwd.h
MakerMacros.h
PFMuonDQMAnalyzer::myMatchedCand_
edm::EDGetTokenT< edm::View< reco::Muon > > myMatchedCand_
Definition: PFMuonDQMAnalyzer.h:25
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
PFMuonDQMAnalyzer::eventInfoFolder_
std::string eventInfoFolder_
Definition: PFMuonDQMAnalyzer.h:37
Service.h
PFMuonDQMAnalyzer::subsystemname_
std::string subsystemname_
Definition: PFMuonDQMAnalyzer.h:38
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFMuonDQMAnalyzer::analyze
void analyze(edm::Event const &, edm::EventSetup const &) override
Definition: PFMuonDQMAnalyzer.cc:58
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
PFMuonDQMAnalyzer::PFMuonDQMAnalyzer
PFMuonDQMAnalyzer(const edm::ParameterSet &parameterSet)
Definition: PFMuonDQMAnalyzer.cc:19
PFMuonDQMAnalyzer::benchmarkLabel_
std::string benchmarkLabel_
Definition: PFMuonDQMAnalyzer.h:28
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
PFCandidateMonitor::setup
void setup(DQMStore::IBooker &b)
book histograms
Definition: PFCandidateMonitor.cc:164
PFMuonDQMAnalyzer::matchLabel_
edm::InputTag matchLabel_
Definition: PFMuonDQMAnalyzer.h:26
PFMuonDQMAnalyzer
Definition: PFMuonDQMAnalyzer.h:15
InputTag.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::parameterSet
ParameterSet const & parameterSet(Provenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
dqm::implementation::IBooker
Definition: DQMStore.h:43
PFMuonDQMAnalyzer::nBadEvents_
int nBadEvents_
Definition: PFMuonDQMAnalyzer.h:40
PFMuonDQMAnalyzer.h
Candidate.h
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
PFMuonDQMAnalyzer::createEfficiencyHistos_
bool createEfficiencyHistos_
Definition: PFMuonDQMAnalyzer.h:29