CMS 3D CMS Logo

PFJetDQMAnalyzer.cc
Go to the documentation of this file.
2 
4 
9 
15 
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  pfJetMonitor_.setParameters(parameterSet); // set parameters for booking histograms and validating jet
30 
31  myJet_ = consumes<edm::View<reco::Jet>>(inputLabel_);
32  myMatchedJet_ = consumes<edm::View<reco::Jet>>(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("PFJetDQMAnalyzer") << " PFJetDQMAnalyzer::bookHistograms "
51  << "Histogram Folder path set to " << eventInfoFolder_;
52 
53  pfJetMonitor_.setup(ibooker, pSet_);
54 }
55 
56 //
57 // -- Analyze
58 //
61  iEvent.getByToken(myJet_, jetCollection);
62 
63  edm::Handle<edm::View<reco::Jet>> matchedJetCollection;
64  iEvent.getByToken(myMatchedJet_, matchedJetCollection);
65 
66  float maxRes = 0.0;
67  float minRes = 99.99;
68  float jetpT = 0.0;
69  if (jetCollection.isValid() && matchedJetCollection.isValid()) {
71  *matchedJetCollection,
72  minRes,
73  maxRes,
74  jetpT,
75  pSet_); // match collections and fill pt eta phi and charge histos for
76  // candidate jet, fill delta_x_VS_y histos for matched couples,
77  // book and fill delta_frac_VS_frac histos for matched couples
78  }
79 }
80 
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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
edm::InputTag inputLabel_
PFJetMonitor pfJetMonitor_
edm::EDGetTokenT< edm::View< reco::Jet > > myJet_
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
void analyze(edm::Event const &, edm::EventSetup const &) override
void setup(DQMStore::IBooker &b)
book histograms
int iEvent
Definition: GenABIO.cc:224
std::string benchmarkLabel_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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_
bool isValid() const
Definition: HandleBase.h:70
std::string subsystemname_
PFJetDQMAnalyzer(const edm::ParameterSet &parameterSet)
Definition: Run.h:45