CMS 3D CMS Logo

PFMETDQMAnalyzer.cc
Go to the documentation of this file.
2 
4 
9 
13 
16 
17 //
18 // -- Constructor
19 //
21 
22 {
24  inputLabel_ = pSet_.getParameter<edm::InputTag>("InputCollection");
25  matchLabel_ = pSet_.getParameter<edm::InputTag>("MatchCollection");
26  benchmarkLabel_ = pSet_.getParameter<std::string>("BenchmarkLabel");
27 
28  pfMETMonitor_.setParameters(parameterSet);
29 
30  myMET_ = consumes<edm::View<reco::MET>>(inputLabel_);
31  myMatchedMET_ = consumes<edm::View<reco::MET>>(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("PFMETDQMAnalyzer") << " PFMETDQMAnalyzer::bookHistograms "
50  << "Histogram Folder path set to " << eventInfoFolder_;
51 
52  pfMETMonitor_.setup(ibooker, pSet_);
53 }
54 
55 //
56 // -- Analyze
57 //
60  iEvent.getByToken(myMET_, metCollection);
61 
62  edm::Handle<edm::View<reco::MET>> matchedMetCollection;
63  iEvent.getByToken(myMatchedMET_, matchedMetCollection);
64 
65  if (metCollection.isValid() && matchedMetCollection.isValid()) {
66  float maxRes = 0.0;
67  float minRes = 99.99;
68  pfMETMonitor_.fillOne((*metCollection)[0], (*matchedMetCollection)[0], minRes, maxRes);
69  }
70 }
71 
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getParameter(std::string const &) const
void setParameters(Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool metSpHistos)
set the parameters locally
Definition: PFMETMonitor.cc:63
void analyze(edm::Event const &, edm::EventSetup const &) override
edm::InputTag inputLabel_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:418
edm::InputTag matchLabel_
PFMETMonitor pfMETMonitor_
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::string subsystemname_
bool isValid() const
Definition: HandleBase.h:70
void fillOne(const reco::MET &met, const reco::MET &matchedMet, float &minVal, float &maxVal)
std::string benchmarkLabel_
edm::ParameterSet pSet_
PFMETDQMAnalyzer(const edm::ParameterSet &parameterSet)
void setup(DQMStore::IBooker &b)
book histograms
edm::EDGetTokenT< edm::View< reco::MET > > myMET_
std::string eventInfoFolder_
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11
Definition: Run.h:45
edm::EDGetTokenT< edm::View< reco::MET > > myMatchedMET_