CMS 3D CMS Logo

PFMETDQMAnalyzer.cc
Go to the documentation of this file.
2 
4 
9 
13 
17 
18 //
19 // -- Constructor
20 //
22 
23 {
25  inputLabel_ = pSet_.getParameter<edm::InputTag>("InputCollection");
26  matchLabel_ = pSet_.getParameter<edm::InputTag>("MatchCollection");
27  benchmarkLabel_ = pSet_.getParameter<std::string>("BenchmarkLabel");
28 
29  pfMETMonitor_.setParameters(parameterSet);
30 
31  myMET_ = consumes<edm::View<reco::MET>>(inputLabel_);
32  myMatchedMET_ = consumes<edm::View<reco::MET>>(matchLabel_);
33 
35 
36  subsystemname_ = "ParticleFlow";
38 
39  nBadEvents_ = 0;
40 }
41 
42 //
43 // -- BookHistograms
44 //
46  edm::Run const & /* iRun */,
47  edm::EventSetup const & /* iSetup */) {
49 
50  edm::LogInfo("PFMETDQMAnalyzer") << " PFMETDQMAnalyzer::bookHistograms "
51  << "Histogram Folder path set to " << eventInfoFolder_;
52 
53  pfMETMonitor_.setup(ibooker, pSet_);
54 }
55 
56 //
57 // -- Analyze
58 //
61  iEvent.getByToken(myMET_, metCollection);
62 
63  edm::Handle<edm::View<reco::MET>> matchedMetCollection;
64  iEvent.getByToken(myMatchedMET_, matchedMetCollection);
65 
66  if (metCollection.isValid() && matchedMetCollection.isValid()) {
67  float maxRes = 0.0;
68  float minRes = 99.99;
69  pfMETMonitor_.fillOne((*metCollection)[0], (*matchedMetCollection)[0], minRes, maxRes);
70  }
71 }
72 
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:517
edm::InputTag matchLabel_
PFMETMonitor pfMETMonitor_
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::string subsystemname_
bool isValid() const
Definition: HandleBase.h:74
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_