CMS 3D CMS Logo

PFMETDQMAnalyzer.cc
Go to the documentation of this file.
2 
4 
9 
13 
15 
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 
28 
29  myMET_ = consumes<edm::View<reco::MET>>(inputLabel_);
30  myMatchedMET_ = consumes<edm::View<reco::MET>>(matchLabel_);
31 
33 
34  subsystemname_ = "ParticleFlow";
36 
37  nBadEvents_ = 0;
38 }
39 
40 //
41 // -- BookHistograms
42 //
44  edm::Run const & /* iRun */,
45  edm::EventSetup const & /* iSetup */) {
47 
48  edm::LogInfo("PFMETDQMAnalyzer") << " PFMETDQMAnalyzer::bookHistograms "
49  << "Histogram Folder path set to " << eventInfoFolder_;
50 
51  pfMETMonitor_.setup(ibooker, pSet_);
52 }
53 
54 //
55 // -- Analyze
56 //
59  iEvent.getByToken(myMET_, metCollection);
60 
61  edm::Handle<edm::View<reco::MET>> matchedMetCollection;
62  iEvent.getByToken(myMatchedMET_, matchedMetCollection);
63 
64  if (metCollection.isValid() && matchedMetCollection.isValid()) {
65  float maxRes = 0.0;
66  float minRes = 99.99;
67  pfMETMonitor_.fillOne((*metCollection)[0], (*matchedMetCollection)[0], minRes, maxRes);
68  }
69 }
70 
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void analyze(edm::Event const &, edm::EventSetup const &) override
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::InputTag inputLabel_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::InputTag matchLabel_
PFMETMonitor pfMETMonitor_
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
int iEvent
Definition: GenABIO.cc:224
std::string subsystemname_
Log< level::Info, false > LogInfo
void fillOne(const reco::MET &met, const reco::MET &matchedMet, float &minVal, float &maxVal)
std::string benchmarkLabel_
bool isValid() const
Definition: HandleBase.h:70
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_
Definition: Run.h:45
edm::EDGetTokenT< edm::View< reco::MET > > myMatchedMET_