test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFMETDQMAnalyzer.cc
Go to the documentation of this file.
2 
4 
9 
13 
17 
18 
19 //
20 // -- Constructor
21 //
23 
24 {
26  inputLabel_ = pSet_.getParameter<edm::InputTag>("InputCollection");
27  matchLabel_ = pSet_.getParameter<edm::InputTag>("MatchCollection");
28  benchmarkLabel_ = pSet_.getParameter<std::string>("BenchmarkLabel");
29 
30  pfMETMonitor_.setParameters(parameterSet);
31 
32  myMET_ = consumes< edm::View<reco::MET> >(inputLabel_);
33  myMatchedMET_ = consumes< edm::View<reco::MET> >(matchLabel_);
34 
35 
36  std::string folder = benchmarkLabel_ ;
37 
38  subsystemname_ = "ParticleFlow" ;
39  eventInfoFolder_ = subsystemname_ + "/" + folder ;
40 
41  nBadEvents_ = 0;
42 
43 }
44 
45 
46 //
47 // -- BookHistograms
48 //
50  edm::Run const & /* iRun */,
51  edm::EventSetup const & /* iSetup */ )
52 {
54 
55  edm::LogInfo("PFMETDQMAnalyzer") << " PFMETDQMAnalyzer::bookHistograms " << "Histogram Folder path set to " << eventInfoFolder_;
56 
57  pfMETMonitor_.setup(ibooker, pSet_);
58 }
59 
60 
61 //
62 // -- Analyze
63 //
65  edm::EventSetup const& iSetup) {
67  iEvent.getByToken(myMET_, metCollection);
68 
69  edm::Handle< edm::View<reco::MET> > matchedMetCollection;
70  iEvent.getByToken(myMatchedMET_, matchedMetCollection);
71 
72  if (metCollection.isValid() && matchedMetCollection.isValid()) {
73  float maxRes = 0.0;
74  float minRes = 99.99;
75  pfMETMonitor_.fillOne( (*metCollection)[0], (*matchedMetCollection)[0], minRes, maxRes);
76 
77  }
78 }
79 
80 
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getParameter(std::string const &) const
void analyze(edm::Event const &, edm::EventSetup 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:73
edm::EDGetTokenT< edm::View< reco::MET > > myMET_
edm::EDGetTokenT< edm::View< reco::MET > > myMatchedMET_
edm::InputTag inputLabel_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::InputTag matchLabel_
PFMETMonitor pfMETMonitor_
int iEvent
Definition: GenABIO.cc:230
std::string subsystemname_
bool isValid() const
Definition: HandleBase.h:75
void fillOne(const reco::MET &met, const reco::MET &matchedMet, float &minVal, float &maxVal)
std::string benchmarkLabel_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
edm::ParameterSet pSet_
PFMETDQMAnalyzer(const edm::ParameterSet &parameterSet)
string metCollection
Definition: MT2Analyzer.py:460
void setup(DQMStore::IBooker &b)
book histograms
std::string eventInfoFolder_
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11
Definition: Run.h:43