CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
PFCandidateDQMAnalyzer Class Reference

#include <PFCandidateDQMAnalyzer.h>

Inheritance diagram for PFCandidateDQMAnalyzer:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 PFCandidateDQMAnalyzer (const edm::ParameterSet &parameterSet)
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Private Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

std::string benchmarkLabel_
 
bool createEfficiencyHistos_
 
MonitorElementeventId_
 
std::string eventInfoFolder_
 
edm::InputTag inputLabel_
 
edm::InputTag matchLabel_
 
edm::EDGetTokenT< edm::View< reco::Candidate > > myCand_
 
edm::EDGetTokenT< edm::View< reco::Candidate > > myMatchedCand_
 
int nBadEvents_
 
PFCandidateMonitor pfCandidateMonitor_
 
edm::ParameterSet pSet_
 
std::string subsystemname_
 

Detailed Description

Definition at line 15 of file PFCandidateDQMAnalyzer.h.

Constructor & Destructor Documentation

PFCandidateDQMAnalyzer::PFCandidateDQMAnalyzer ( const edm::ParameterSet parameterSet)

Definition at line 21 of file PFCandidateDQMAnalyzer.cc.

References benchmarkLabel_, createEfficiencyHistos_, eventInfoFolder_, printsummarytable::folder, edm::ParameterSet::getParameter(), inputLabel_, matchLabel_, myCand_, myMatchedCand_, nBadEvents_, edm::parameterSet(), pfCandidateMonitor_, pSet_, PFCandidateMonitor::setParameters(), AlCaHLTBitMon_QueryRunRegistry::string, and subsystemname_.

23 {
25  inputLabel_ = pSet_.getParameter<edm::InputTag>("InputCollection");
26  matchLabel_ = pSet_.getParameter<edm::InputTag>("MatchCollection");
27  benchmarkLabel_ = pSet_.getParameter<std::string>("BenchmarkLabel");
28  createEfficiencyHistos_ = pSet_.getParameter<bool>( "CreateEfficiencyHistos" );
29 
30  pfCandidateMonitor_.setParameters(parameterSet);
31 
32  myCand_ = consumes< edm::View<reco::Candidate> >(inputLabel_);
33  myMatchedCand_ = consumes< edm::View<reco::Candidate> >(matchLabel_);
34 
35 
37 
38  subsystemname_ = "ParticleFlow" ;
40 
41  nBadEvents_ = 0;
42 
43 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::Candidate > > myMatchedCand_
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
edm::EDGetTokenT< edm::View< reco::Candidate > > myCand_
PFCandidateMonitor pfCandidateMonitor_
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11

Member Function Documentation

void PFCandidateDQMAnalyzer::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 64 of file PFCandidateDQMAnalyzer.cc.

References createEfficiencyHistos_, DEFINE_FWK_MODULE, PFCandidateMonitor::fill(), edm::Event::getByToken(), edm::HandleBase::isValid(), myCand_, myMatchedCand_, pfCandidateMonitor_, and pSet_.

65  {
66 
68  edm::Handle< edm::View<reco::Candidate> > matchedCandCollection;
69  if ( !createEfficiencyHistos_ ) {
70  iEvent.getByToken( myCand_, candCollection);
71  iEvent.getByToken( myMatchedCand_, matchedCandCollection);
72  } else {
73  iEvent.getByToken( myMatchedCand_, candCollection);
74  iEvent.getByToken( myCand_, matchedCandCollection);
75  }
76 
77  float maxRes = 0.0;
78  float minRes = 99.99;
79  if (candCollection.isValid() && matchedCandCollection.isValid()) {
80  pfCandidateMonitor_.fill( *candCollection, *matchedCandCollection, minRes, maxRes, pSet_);
81 
82  }
83 }
edm::EDGetTokenT< edm::View< reco::Candidate > > myMatchedCand_
void fill(const T &candidateCollection, const C &matchedCandCollection, float &minVal, float &maxVal, const edm::ParameterSet &parameterSet)
fill histograms with all particle
int iEvent
Definition: GenABIO.cc:230
edm::EDGetTokenT< edm::View< reco::Candidate > > myCand_
bool isValid() const
Definition: HandleBase.h:74
PFCandidateMonitor pfCandidateMonitor_
void PFCandidateDQMAnalyzer::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 49 of file PFCandidateDQMAnalyzer.cc.

References eventInfoFolder_, pfCandidateMonitor_, pSet_, DQMStore::IBooker::setCurrentFolder(), and PFCandidateMonitor::setup().

52 {
54 
55  edm::LogInfo("PFCandidateDQMAnalyzer") << " PFCandidateDQMAnalyzer::bookHistograms " << "Histogram Folder path set to " << eventInfoFolder_;
56 
58 }
void setup(DQMStore::IBooker &b)
book histograms
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
PFCandidateMonitor pfCandidateMonitor_

Member Data Documentation

std::string PFCandidateDQMAnalyzer::benchmarkLabel_
private

Definition at line 31 of file PFCandidateDQMAnalyzer.h.

Referenced by PFCandidateDQMAnalyzer().

bool PFCandidateDQMAnalyzer::createEfficiencyHistos_
private

Definition at line 32 of file PFCandidateDQMAnalyzer.h.

Referenced by analyze(), and PFCandidateDQMAnalyzer().

MonitorElement* PFCandidateDQMAnalyzer::eventId_
private

Definition at line 25 of file PFCandidateDQMAnalyzer.h.

std::string PFCandidateDQMAnalyzer::eventInfoFolder_
private

Definition at line 37 of file PFCandidateDQMAnalyzer.h.

Referenced by bookHistograms(), and PFCandidateDQMAnalyzer().

edm::InputTag PFCandidateDQMAnalyzer::inputLabel_
private

Definition at line 30 of file PFCandidateDQMAnalyzer.h.

Referenced by PFCandidateDQMAnalyzer().

edm::InputTag PFCandidateDQMAnalyzer::matchLabel_
private

Definition at line 29 of file PFCandidateDQMAnalyzer.h.

Referenced by PFCandidateDQMAnalyzer().

edm::EDGetTokenT< edm::View<reco::Candidate> > PFCandidateDQMAnalyzer::myCand_
private

Definition at line 27 of file PFCandidateDQMAnalyzer.h.

Referenced by analyze(), and PFCandidateDQMAnalyzer().

edm::EDGetTokenT< edm::View<reco::Candidate> > PFCandidateDQMAnalyzer::myMatchedCand_
private

Definition at line 28 of file PFCandidateDQMAnalyzer.h.

Referenced by analyze(), and PFCandidateDQMAnalyzer().

int PFCandidateDQMAnalyzer::nBadEvents_
private

Definition at line 40 of file PFCandidateDQMAnalyzer.h.

Referenced by PFCandidateDQMAnalyzer().

PFCandidateMonitor PFCandidateDQMAnalyzer::pfCandidateMonitor_
private

Definition at line 34 of file PFCandidateDQMAnalyzer.h.

Referenced by analyze(), bookHistograms(), and PFCandidateDQMAnalyzer().

edm::ParameterSet PFCandidateDQMAnalyzer::pSet_
private

Definition at line 36 of file PFCandidateDQMAnalyzer.h.

Referenced by analyze(), bookHistograms(), and PFCandidateDQMAnalyzer().

std::string PFCandidateDQMAnalyzer::subsystemname_
private

Definition at line 38 of file PFCandidateDQMAnalyzer.h.

Referenced by PFCandidateDQMAnalyzer().