CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PFJetDQMAnalyzer.cc
Go to the documentation of this file.
2 
4 
9 
15 
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  pfJetMonitor_.setParameters(parameterSet); // set parameters for booking histograms and validating jet
31 
32  myJet_ = consumes<edm::View<reco::Jet>>(inputLabel_);
33  myMatchedJet_ = consumes<edm::View<reco::Jet>>(matchLabel_);
34 
36 
37  subsystemname_ = "ParticleFlow";
39 
40  nBadEvents_ = 0;
41 }
42 
43 //
44 // -- BookHistograms
45 //
47  edm::Run const & /* iRun */,
48  edm::EventSetup const & /* iSetup */) {
50 
51  edm::LogInfo("PFJetDQMAnalyzer") << " PFJetDQMAnalyzer::bookHistograms "
52  << "Histogram Folder path set to " << eventInfoFolder_;
53 
54  pfJetMonitor_.setup(ibooker, pSet_);
55 }
56 
57 //
58 // -- Analyze
59 //
61  edm::Handle<edm::View<reco::Jet>> jetCollection;
62  iEvent.getByToken(myJet_, jetCollection);
63 
64  edm::Handle<edm::View<reco::Jet>> matchedJetCollection;
65  iEvent.getByToken(myMatchedJet_, matchedJetCollection);
66 
67  float maxRes = 0.0;
68  float minRes = 99.99;
69  float jetpT = 0.0;
70  if (jetCollection.isValid() && matchedJetCollection.isValid()) {
71  pfJetMonitor_.fill(*jetCollection,
72  *matchedJetCollection,
73  minRes,
74  maxRes,
75  jetpT,
76  pSet_); // match collections and fill pt eta phi and charge histos for
77  // candidate jet, fill delta_x_VS_y histos for matched couples,
78  // book and fill delta_frac_VS_frac histos for matched couples
79  }
80 }
81 
void fill(const T &candidateCollection, const C &matchedCandCollection, float &minVal, float &maxVal, float &jetpT, const edm::ParameterSet &parameterSet)
fill histograms with all particle
Definition: PFJetMonitor.h:65
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::InputTag inputLabel_
PFJetMonitor pfJetMonitor_
edm::EDGetTokenT< edm::View< reco::Jet > > myJet_
void analyze(edm::Event const &, edm::EventSetup const &) override
void setup(DQMStore::IBooker &b)
book histograms
int iEvent
Definition: GenABIO.cc:224
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
std::string benchmarkLabel_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< edm::View< reco::Jet > > myMatchedJet_
edm::ParameterSet pSet_
void setParameters(const edm::ParameterSet &parameterSet)
set the parameters accessing them from ParameterSet
Definition: PFJetMonitor.cc:39
Log< level::Info, false > LogInfo
edm::InputTag matchLabel_
std::string eventInfoFolder_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string subsystemname_
PFJetDQMAnalyzer(const edm::ParameterSet &parameterSet)
Definition: Run.h:45