CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetTester.cc
Go to the documentation of this file.
1 // Producer for validation histograms for Calo, JPT and PF jet objects
2 // F. Ratnikov, Sept. 7, 2006
3 // Modified by Chiyoung Jeong, Feb. 2, 2010
4 // Modified by J. Piedra, Sept. 11, 2013
5 
6 #include "JetTester.h"
7 
8 using namespace edm;
9 using namespace reco;
10 using namespace std;
11 
13  mInputCollection (iConfig.getParameter<edm::InputTag> ("src")),
14 // rhoTag (iConfig.getParameter<edm::InputTag> ("srcRho")),
15  JetType (iConfig.getUntrackedParameter<std::string>("JetType")),
16  mRecoJetPtThreshold (iConfig.getParameter<double> ("recoJetPtThreshold")),
17  mMatchGenPtThreshold (iConfig.getParameter<double> ("matchGenPtThreshold")),
18  mRThreshold (iConfig.getParameter<double> ("RThreshold"))
19 {
20  std::string inputCollectionLabel(mInputCollection.label());
21 
22  isCaloJet = (std::string("calo")==JetType);
23  isPFJet = (std::string("pf") ==JetType);
24  isMiniAODJet = (std::string("miniaod") ==JetType);
25  if(!isMiniAODJet){
26  mJetCorrector =iConfig.getParameter<edm::InputTag>("JetCorrections");
27  }
28 
29  //consumes
30  pvToken_ = consumes<std::vector<reco::Vertex> >(iConfig.getParameter<edm::InputTag>("primVertex"));
31  if (isCaloJet) caloJetsToken_ = consumes<reco::CaloJetCollection>(mInputCollection);
32  if (isPFJet) pfJetsToken_ = consumes<reco::PFJetCollection>(mInputCollection);
33  if(isMiniAODJet)patJetsToken_ = consumes<pat::JetCollection>(mInputCollection);
35  genJetsToken_ = consumes<reco::GenJetCollection>(edm::InputTag(mInputGenCollection));
36  evtToken_ = consumes<GenEventInfoProduct>(edm::InputTag("generator"));
37  if(!isMiniAODJet && !mJetCorrector.label().empty()){
38  jetCorrectorToken_ = consumes<reco::JetCorrector>(mJetCorrector);
39  }
40 
41  // Events variables
42  mNvtx = 0;
43 
44  // Jet parameters
45  mEta = 0;
46  mPhi = 0;
47  mEnergy = 0;
48  mP = 0;
49  mPt = 0;
50  mMass = 0;
51  mConstituents = 0;
52  mJetArea = 0;
53 // mRho = 0;
54 
55  // Corrected jets
56  mCorrJetPt = 0;
57  mCorrJetEta = 0;
58  mCorrJetPhi = 0;
59  mCorrJetEta_Pt40 = 0;
60  mCorrJetPhi_Pt40 = 0;
61 
62  // Corrected jets profiles
85 
86  // Generation
87  mGenEta = 0;
88  mGenPhi = 0;
89  mGenPt = 0;
90  mGenEtaFirst = 0;
91  mGenPhiFirst = 0;
92  mPtHat = 0;
93  mDeltaEta = 0;
94  mDeltaPhi = 0;
95  mDeltaPt = 0;
96 
119 
120  // Generation profiles
135 
136  // Some jet algebra
137  mEtaFirst = 0;
138  mPhiFirst = 0;
139  mPtFirst = 0;
140  mMjj = 0;
141  mNJetsEta_B_20_40 = 0;
142  mNJetsEta_E_20_40 = 0;
143  mNJetsEta_B_40 = 0;
144  mNJetsEta_E_40 = 0;
145  mNJets1 = 0;
146  mNJets2 = 0;
147 
148 // // PFJet specific
149 // mHadEnergyInHF = 0;
150 // mEmEnergyInHF = 0;
151 // mChargedEmEnergy = 0;
152 // mChargedHadronEnergy = 0;
153 // mNeutralEmEnergy = 0;
154 // mNeutralHadronEnergy = 0;
155 
156  // ---- Calo Jet specific information ----
158  maxEInEmTowers = 0;
160  maxEInHadTowers = 0;
164  emEnergyFraction = 0;
166  hadEnergyInHB = 0;
168  hadEnergyInHO = 0;
170  hadEnergyInHE = 0;
172  hadEnergyInHF = 0;
174  emEnergyInEB = 0;
176  emEnergyInEE = 0;
178  emEnergyInHF = 0;
180  towersArea = 0;
182  n90 = 0;
184  n60 = 0;
185 
186  // ---- JPT Jet specific information ----
188 // elecMultiplicity = 0;
189 
190  // ---- JPT or PF Jet specific information ----
192  muonMultiplicity = 0;
196  chargedEmEnergy = 0;
198  neutralEmEnergy = 0;
211 
212  // ---- PF Jet specific information ----
214  photonEnergy = 0;
218  electronEnergy = 0;
222  muonEnergy = 0;
224  muonEnergyFraction = 0;
226  HFHadronEnergy = 0;
230  HFEMEnergy = 0;
232  HFEMEnergyFraction = 0;
238  photonMultiplicity = 0;
244  HFEMMultiplicity = 0;
246  chargedMuEnergy = 0;
251 
253  HOEnergy = 0;
255  HOEnergyFraction = 0;
256 
257  hadronFlavor=0;
258  partonFlavor=0;
259  genPartonPDGID=0;
260 
261 }
262 
264  edm::Run const & iRun,
265  edm::EventSetup const & ) {
266 
267  ibooker.setCurrentFolder("JetMET/JetValidation/"+mInputCollection.label());
268 
269  double log10PtMin = 0.50;
270  double log10PtMax = 3.75;
271  int log10PtBins = 26;
272 
273  //if eta range changed here need change in JetTesterPostProcessor as well
274  double etaRange[91] = {-6.0, -5.8, -5.6, -5.4, -5.2, -5.0, -4.8, -4.6, -4.4, -4.2,
275  -4.0, -3.8, -3.6, -3.4, -3.2, -3.0, -2.9, -2.8, -2.7, -2.6,
276  -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6,
277  -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6,
278  -0.5, -0.4, -0.3, -0.2, -0.1,
279  0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
280  1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
281  2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
282  3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8,
283  5.0, 5.2, 5.4, 5.6, 5.8, 6.0};
284 
285  // Event variables
286  mNvtx = ibooker.book1D("Nvtx", "number of vertices", 60, 0, 60);
287 
288  // Jet parameters
289  mEta = ibooker.book1D("Eta", "Eta", 120, -6, 6);
290  mPhi = ibooker.book1D("Phi", "Phi", 70, -3.5, 3.5);
291  mPt = ibooker.book1D("Pt", "Pt", 100, 0, 1000);
292  mP = ibooker.book1D("P", "P", 100, 0, 1000);
293  mEnergy = ibooker.book1D("Energy", "Energy", 100, 0, 1000);
294  mMass = ibooker.book1D("Mass", "Mass", 100, 0, 200);
295  mConstituents = ibooker.book1D("Constituents", "Constituents", 100, 0, 100);
296  mJetArea = ibooker.book1D("JetArea", "JetArea", 100, 0, 4);
297  //jet flavors contained in MiniAOD
298  if (isMiniAODJet){
299  hadronFlavor=ibooker.book1D("HadronFlavor", "HadronFlavor", 44, -22, 22);
300  partonFlavor=ibooker.book1D("PartonFlavor", "PartonFlavor", 44, -22, 22);
301  genPartonPDGID=ibooker.book1D("genPartonPDGID", "genPartonPDGID", 44, -22, 22);
302  }
303  // Corrected jets
304  if (isMiniAODJet || !mJetCorrector.label().empty()) {//if correction label is filled, but fill also for MiniAOD though
305  mCorrJetPt = ibooker.book1D("CorrJetPt", "CorrJetPt", 150, 0, 1500);
306  mCorrJetEta = ibooker.book1D("CorrJetEta", "CorrJetEta Pt>20", 60, -6, 6);
307  mCorrJetPhi = ibooker.book1D("CorrJetPhi", "CorrJetPhi Pt>20", 70, -3.5, 3.5);
308  mCorrJetEta_Pt40 = ibooker.book1D("CorrJetEta_Pt40", "CorrJetEta Pt>40", 60, -6, 6);
309  mCorrJetPhi_Pt40 = ibooker.book1D("CorrJetPhi_Pt40", "CorrJetPhi Pt>40", 70, -3.5, 3.5);
310 
311  // Corrected jets profiles
312  mPtCorrOverReco_Pt_B = ibooker.bookProfile("PtCorrOverReco_Pt_B", "0<|eta|<1.5", log10PtBins, log10PtMin, log10PtMax, 0, 5, " ");
313  mPtCorrOverReco_Pt_E = ibooker.bookProfile("PtCorrOverReco_Pt_E", "1.5<|eta|<3", log10PtBins, log10PtMin, log10PtMax, 0, 5, " ");
314  mPtCorrOverReco_Pt_F = ibooker.bookProfile("PtCorrOverReco_Pt_F", "3<|eta|<6", log10PtBins, log10PtMin, log10PtMax, 0, 5, " ");
315 
316  mPtCorrOverReco_Eta_20_40 = ibooker.bookProfile("PtCorrOverReco_Eta_20_40", "20<genPt<40", 90, etaRange, 0, 5, " ");
317  mPtCorrOverReco_Eta_40_200 = ibooker.bookProfile("PtCorrOverReco_Eta_40_200", "40<genPt<200", 90, etaRange, 0, 5, " ");
318  mPtCorrOverReco_Eta_200_600 = ibooker.bookProfile("PtCorrOverReco_Eta_200_600", "200<genPt<600", 90, etaRange, 0, 5, " ");
319  mPtCorrOverReco_Eta_600_1500 = ibooker.bookProfile("PtCorrOverReco_Eta_600_1500", "600<genPt<1500", 90, etaRange, 0, 5, " ");
320  mPtCorrOverReco_Eta_1500_3500 = ibooker.bookProfile("PtCorrOverReco_Eta_1500_3500", "1500<genPt<3500", 90, etaRange, 0, 5, " ");
321  mPtCorrOverReco_Eta_3500_5000 = ibooker.bookProfile("PtCorrOverReco_Eta_3500_5000", "3500<genPt<5000", 90, etaRange, 0, 5, " ");
322  mPtCorrOverReco_Eta_5000_6500 = ibooker.bookProfile("PtCorrOverReco_Eta_5000_6500", "5000<genPt<6500", 90, etaRange, 0, 5, " ");
323  mPtCorrOverReco_Eta_3500 = ibooker.bookProfile("PtCorrOverReco_Eta_3500", "genPt>3500", 90, etaRange, 0, 5, " ");
324 
325  mPtCorrOverGen_GenPt_B = ibooker.bookProfile("PtCorrOverGen_GenPt_B", "0<|eta|<1.5", log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2, " ");
326  mPtCorrOverGen_GenPt_E = ibooker.bookProfile("PtCorrOverGen_GenPt_E", "1.5<|eta|<3", log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2, " ");
327  mPtCorrOverGen_GenPt_F = ibooker.bookProfile("PtCorrOverGen_GenPt_F", "3<|eta|<6", log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2, " ");
328  //if eta range changed here need change in JetTesterPostProcessor as well
329  mPtCorrOverGen_GenEta_20_40 = ibooker.bookProfile("PtCorrOverGen_GenEta_20_40", "20<genPt<40;#eta", 90, etaRange, 0.8, 1.2, " ");
330  mPtCorrOverGen_GenEta_40_200 = ibooker.bookProfile("PtCorrOverGen_GenEta_40_200", "40<genPt<200;#eta", 90, etaRange, 0.8, 1.2, " ");
331  mPtCorrOverGen_GenEta_200_600 = ibooker.bookProfile("PtCorrOverGen_GenEta_200_600", "200<genPt<600;#eta", 90, etaRange, 0.8, 1.2, " ");
332  mPtCorrOverGen_GenEta_600_1500 = ibooker.bookProfile("PtCorrOverGen_GenEta_600_1500", "600<genPt<1500;#eta", 90, etaRange, 0.8, 1.2, " ");
333  mPtCorrOverGen_GenEta_1500_3500 = ibooker.bookProfile("PtCorrOverGen_GenEta_1500_3500", "1500<genPt<3500;#eta", 90, etaRange, 0.8, 1.2, " ");
334  mPtCorrOverGen_GenEta_3500_5000 = ibooker.bookProfile("PtCorrOverGen_GenEta_3500_5000", "3500<genPt<5000;#eta", 90, etaRange, 0.8, 1.2, " ");
335  mPtCorrOverGen_GenEta_5000_6500 = ibooker.bookProfile("PtCorrOverGen_GenEta_5000_6500", "5000<genPt<6500;#eta", 90, etaRange, 0.8, 1.2, " ");
336  mPtCorrOverGen_GenEta_3500 = ibooker.bookProfile("PtCorrOverGen_GenEta_3500", "genPt>3500;#eta", 90, etaRange, 0.8, 1.2, " ");
337  }
338 
339  mGenEta = ibooker.book1D("GenEta", "GenEta", 120, -6, 6);
340  mGenPhi = ibooker.book1D("GenPhi", "GenPhi", 70, -3.5, 3.5);
341  mGenPt = ibooker.book1D("GenPt", "GenPt", 100, 0, 1000);
342  mGenEtaFirst = ibooker.book1D("GenEtaFirst", "GenEtaFirst", 120, -6, 6);
343  mGenPhiFirst = ibooker.book1D("GenPhiFirst", "GenPhiFirst", 70, -3.5, 3.5);
344  mPtHat = ibooker.book1D("PtHat", "PtHat", 100, 0, 1000);
345  mDeltaEta = ibooker.book1D("DeltaEta", "DeltaEta", 100, -0.5, 0.5);
346  mDeltaPhi = ibooker.book1D("DeltaPhi", "DeltaPhi", 100, -0.5, 0.5);
347  mDeltaPt = ibooker.book1D("DeltaPt", "DeltaPt", 100, -1.0, 1.0);
348 
349  mPtRecoOverGen_B_20_40 = ibooker.book1D("PtRecoOverGen_B_20_40", "20<genpt<40", 90, 0, 2);
350  mPtRecoOverGen_E_20_40 = ibooker.book1D("PtRecoOverGen_E_20_40", "20<genpt<40", 90, 0, 2);
351  mPtRecoOverGen_F_20_40 = ibooker.book1D("PtRecoOverGen_F_20_40", "20<genpt<40", 90, 0, 2);
352  mPtRecoOverGen_B_40_200 = ibooker.book1D("PtRecoOverGen_B_40_200", "40<genpt<200", 90, 0, 2);
353  mPtRecoOverGen_E_40_200 = ibooker.book1D("PtRecoOverGen_E_40_200", "40<genpt<200", 90, 0, 2);
354  mPtRecoOverGen_F_40_200 = ibooker.book1D("PtRecoOverGen_F_40_200", "40<genpt<200", 90, 0, 2);
355  mPtRecoOverGen_B_200_600 = ibooker.book1D("PtRecoOverGen_B_200_600", "200<genpt<600", 90, 0, 2);
356  mPtRecoOverGen_E_200_600 = ibooker.book1D("PtRecoOverGen_E_200_600", "200<genpt<600", 90, 0, 2);
357  mPtRecoOverGen_F_200_600 = ibooker.book1D("PtRecoOverGen_F_200_600", "200<genpt<600", 90, 0, 2);
358  mPtRecoOverGen_B_600_1500 = ibooker.book1D("PtRecoOverGen_B_600_1500", "600<genpt<1500", 90, 0, 2);
359  mPtRecoOverGen_E_600_1500 = ibooker.book1D("PtRecoOverGen_E_600_1500", "600<genpt<1500", 90, 0, 2);
360  mPtRecoOverGen_F_600_1500 = ibooker.book1D("PtRecoOverGen_F_600_1500", "600<genpt<1500", 90, 0, 2);
361  mPtRecoOverGen_B_1500_3500 = ibooker.book1D("PtRecoOverGen_B_1500_3500", "1500<genpt<3500", 90, 0, 2);
362  mPtRecoOverGen_E_1500_3500 = ibooker.book1D("PtRecoOverGen_E_1500_3500", "1500<genpt<3500", 90, 0, 2);
363  mPtRecoOverGen_F_1500_3500 = ibooker.book1D("PtRecoOverGen_F_1500_3500", "1500<genpt<3500", 90, 0, 2);
364  mPtRecoOverGen_B_3500_5000 = ibooker.book1D("PtRecoOverGen_B_3500_5000", "3500<genpt<5000", 90, 0, 2);
365  mPtRecoOverGen_E_3500_5000 = ibooker.book1D("PtRecoOverGen_E_3500_5000", "3500<genpt<5000", 90, 0, 2);
366  mPtRecoOverGen_B_5000_6500 = ibooker.book1D("PtRecoOverGen_B_5000_6500", "5000<genpt<6500", 90, 0, 2);
367  mPtRecoOverGen_E_5000_6500 = ibooker.book1D("PtRecoOverGen_E_5000_6500", "5000<genpt<6500", 90, 0, 2);
368  mPtRecoOverGen_B_3500 = ibooker.book1D("PtRecoOverGen_B_3500", "genpt>3500", 90, 0, 2);
369  mPtRecoOverGen_E_3500 = ibooker.book1D("PtRecoOverGen_E_3500", "genpt>3500", 90, 0, 2);
370  mPtRecoOverGen_F_3500 = ibooker.book1D("PtRecoOverGen_F_3500", "genpt>3500", 90, 0, 2);
371 
372  mMassRecoOverGen_B_20_40 = ibooker.book1D("MassRecoOverGen_B_20_40", "20<genpt<40", 90, 0, 3);
373  mMassRecoOverGen_E_20_40 = ibooker.book1D("MassRecoOverGen_E_20_40", "20<genpt<40", 90, 0, 3);
374  mMassRecoOverGen_F_20_40 = ibooker.book1D("MassRecoOverGen_F_20_40", "20<genpt<40", 90, 0, 3);
375  mMassRecoOverGen_B_40_200 = ibooker.book1D("MassRecoOverGen_B_40_200", "40<genpt<200", 90, 0, 3);
376  mMassRecoOverGen_E_40_200 = ibooker.book1D("MassRecoOverGen_E_40_200", "40<genpt<200", 90, 0, 3);
377  mMassRecoOverGen_F_40_200 = ibooker.book1D("MassRecoOverGen_F_40_200", "40<genpt<200", 90, 0, 3);
378  mMassRecoOverGen_B_200_500 = ibooker.book1D("MassRecoOverGen_B_200_500", "200<genpt<500", 90, 0, 3);
379  mMassRecoOverGen_E_200_500 = ibooker.book1D("MassRecoOverGen_E_200_500", "200<genpt<500", 90, 0, 3);
380  mMassRecoOverGen_F_200_500 = ibooker.book1D("MassRecoOverGen_F_200_500", "200<genpt<500", 90, 0, 3);
381  mMassRecoOverGen_B_500_750 = ibooker.book1D("MassRecoOverGen_B_500_750", "500<genpt<750", 90, 0, 3);
382  mMassRecoOverGen_E_500_750 = ibooker.book1D("MassRecoOverGen_E_500_750", "500<genpt<750", 90, 0, 3);
383  mMassRecoOverGen_F_500_750 = ibooker.book1D("MassRecoOverGen_F_500_750", "500<genpt<750", 90, 0, 3);
384  mMassRecoOverGen_B_750_1000 = ibooker.book1D("MassRecoOverGen_B_750_1000", "750<genpt<1000", 90, 0, 3);
385  mMassRecoOverGen_E_750_1000 = ibooker.book1D("MassRecoOverGen_E_750_1000", "750<genpt<1000", 90, 0, 3);
386  mMassRecoOverGen_F_750_1000 = ibooker.book1D("MassRecoOverGen_F_750_1000", "750<genpt<1000", 90, 0, 3);
387  mMassRecoOverGen_B_1000_1500 = ibooker.book1D("MassRecoOverGen_B_1000_1500", "1000<genpt<1500", 90, 0, 3);
388  mMassRecoOverGen_E_1000_1500 = ibooker.book1D("MassRecoOverGen_E_1000_1500", "1000<genpt<1500", 90, 0, 3);
389  mMassRecoOverGen_F_1000_1500 = ibooker.book1D("MassRecoOverGen_F_1000_1500", "1000<genpt<1500", 90, 0, 3);
390  mMassRecoOverGen_B_1500_3500 = ibooker.book1D("MassRecoOverGen_B_1500_3500", "1500<genpt<3500", 90, 0, 3);
391  mMassRecoOverGen_E_1500_3500 = ibooker.book1D("MassRecoOverGen_E_1500_3500", "1500<genpt<3500", 90, 0, 3);
392  mMassRecoOverGen_F_1500 = ibooker.book1D("MassRecoOverGen_F_1500", "genpt>1500", 90, 0, 3);
393  mMassRecoOverGen_B_3500_5000 = ibooker.book1D("MassRecoOverGen_B_3500_5000", "3500<genpt<5000", 90, 0, 3);
394  mMassRecoOverGen_E_3500_5000 = ibooker.book1D("MassRecoOverGen_E_3500_5000", "3500<genpt<5000", 90, 0, 3);
395  mMassRecoOverGen_B_5000 = ibooker.book1D("MassRecoOverGen_B_5000", "genpt>5000", 90, 0, 3);
396  mMassRecoOverGen_E_5000 = ibooker.book1D("MassRecoOverGen_E_5000", "genpt>5000", 90, 0, 3);
397 
398  // Generation profiles
399  mPtRecoOverGen_GenPt_B = ibooker.bookProfile("PtRecoOverGen_GenPt_B", "0<|eta|<1.5", log10PtBins, log10PtMin, log10PtMax, 0, 2, " ");
400  mPtRecoOverGen_GenPt_E = ibooker.bookProfile("PtRecoOverGen_GenPt_E", "1.5<|eta|<3", log10PtBins, log10PtMin, log10PtMax, 0, 2, " ");
401  mPtRecoOverGen_GenPt_F = ibooker.bookProfile("PtRecoOverGen_GenPt_F", "3<|eta|<6", log10PtBins, log10PtMin, log10PtMax, 0, 2, " ");
402  mPtRecoOverGen_GenPhi_B = ibooker.bookProfile("PtRecoOverGen_GenPhi_B", "0<|eta|<1.5", 70, -3.5, 3.5, 0, 2, " ");
403  mPtRecoOverGen_GenPhi_E = ibooker.bookProfile("PtRecoOverGen_GenPhi_E", "1.5<|eta|<3", 70, -3.5, 3.5, 0, 2, " ");
404  mPtRecoOverGen_GenPhi_F = ibooker.bookProfile("PtRecoOverGen_GenPhi_F", "3<|eta|<6", 70, -3.5, 3.5, 0, 2, " ");
405  //if eta range changed here need change in JetTesterPostProcessor as well
406  mPtRecoOverGen_GenEta_20_40 = ibooker.bookProfile("PtRecoOverGen_GenEta_20_40", "20<genpt<40", 90, etaRange, 0, 2, " ");
407  mPtRecoOverGen_GenEta_40_200 = ibooker.bookProfile("PtRecoOverGen_GenEta_40_200", "40<genpt<200", 90, etaRange, 0, 2, " ");
408  mPtRecoOverGen_GenEta_200_600 = ibooker.bookProfile("PtRecoOverGen_GenEta_200_600", "200<genpt<600", 90, etaRange, 0, 2, " ");
409  mPtRecoOverGen_GenEta_600_1500 = ibooker.bookProfile("PtRecoOverGen_GenEta_600_1500", "600<genpt<1500", 90, etaRange, 0, 2, " ");
410  mPtRecoOverGen_GenEta_1500_3500 = ibooker.bookProfile("PtRecoOverGen_GenEta_1500_3500", "1500<genpt<3500", 90, etaRange, 0, 2, " ");
411  mPtRecoOverGen_GenEta_3500_5000 = ibooker.bookProfile("PtRecoOverGen_GenEta_3500_5000", "3500<genpt<5000", 90, etaRange, 0, 2, " ");
412  mPtRecoOverGen_GenEta_5000_6500 = ibooker.bookProfile("PtRecoOverGen_GenEta_5000_6500", "5000<genpt<6500", 90, etaRange, 0, 2, " ");
413  mPtRecoOverGen_GenEta_3500 = ibooker.bookProfile("PtRecoOverGen_GenEta_3500", "genpt>3500", 90, etaRange, 0, 2, " ");
414 
415  // Some jet algebra
416  //------------------------------------------------------------------------
417  mEtaFirst = ibooker.book1D("EtaFirst", "EtaFirst", 120, -6, 6);
418  mPhiFirst = ibooker.book1D("PhiFirst", "PhiFirst", 70, -3.5, 3.5);
419  mPtFirst = ibooker.book1D("PtFirst", "PtFirst", 50, 0, 1000);
420  mMjj = ibooker.book1D("Mjj", "Mjj", 100, 0, 2000);
421  mNJetsEta_B_20_40 = ibooker.book1D("NJetsEta_B_20_40", "NJetsEta_B 20<Pt<40", 15, 0, 15);
422  mNJetsEta_E_20_40 = ibooker.book1D("NJetsEta_E_20_40", "NJetsEta_E 20<Pt<40", 15, 0, 15);
423  mNJetsEta_B_40 = ibooker.book1D("NJetsEta_B", "NJetsEta_B 40<Pt", 15, 0, 15);
424  mNJetsEta_E_40 = ibooker.book1D("NJetsEta_E", "NJetsEta_E 40<Pt", 15, 0, 15);
425  mNJets_40 = ibooker.book1D("NJets", "NJets 40>Pt", 15, 0, 15);
426  mNJets1 = ibooker.bookProfile("NJets1", "Number of jets above Pt threshold", 100, 0, 200, 100, 0, 50, "s");
427  mNJets2 = ibooker.bookProfile("NJets2", "Number of jets above Pt threshold", 100, 0, 4000, 100, 0, 50, "s");
428 
429 
430  if (isCaloJet) {
431  maxEInEmTowers = ibooker.book1D("maxEInEmTowers", "maxEInEmTowers", 50,0,500);
432  maxEInHadTowers = ibooker.book1D("maxEInHadTowers", "maxEInHadTowers", 50,0,500);
433  energyFractionHadronic = ibooker.book1D("energyFractionHadronic", "energyFractionHadronic", 50,0,1);
434  emEnergyFraction = ibooker.book1D("emEnergyFraction", "emEnergyFraction", 50,0,1);
435  hadEnergyInHB = ibooker.book1D("hadEnergyInHB", "hadEnergyInHB", 50,0,500);
436  hadEnergyInHO = ibooker.book1D("hadEnergyInHO", "hadEnergyInHO", 50,0,500);
437  hadEnergyInHE = ibooker.book1D("hadEnergyInHE", "hadEnergyInHE", 50,0,500);
438  hadEnergyInHF = ibooker.book1D("hadEnergyInHF", "hadEnergyInHF", 50,0,500);
439  emEnergyInEB = ibooker.book1D("emEnergyInEB", "emEnergyInEB", 50,0,500);
440  emEnergyInEE = ibooker.book1D("emEnergyInEE", "emEnergyInEE", 50,0,500);
441  emEnergyInHF = ibooker.book1D("emEnergyInHF", "emEnergyInHF", 50,0,500);
442  towersArea = ibooker.book1D("towersArea", "towersArea", 50,0,1);
443  n90 = ibooker.book1D("n90", "n90", 30,0,30);
444  n60 = ibooker.book1D("n60", "n60", 30,0,30);
445  }
446 
447  if (isPFJet || isMiniAODJet) {
448  muonMultiplicity = ibooker.book1D("muonMultiplicity", "muonMultiplicity", 10,0,10);
449  chargedMultiplicity = ibooker.book1D("chargedMultiplicity", "chargedMultiplicity", 100,0,100);
450  chargedEmEnergy = ibooker.book1D("chargedEmEnergy", "chargedEmEnergy", 100,0,500);
451  neutralEmEnergy = ibooker.book1D("neutralEmEnergy", "neutralEmEnergy", 100,0,500);
452  chargedHadronEnergy = ibooker.book1D("chargedHadronEnergy", "chargedHadronEnergy", 100,0,500);
453  neutralHadronEnergy = ibooker.book1D("neutralHadronEnergy", "neutralHadronEnergy", 100,0,500);
454  chargedHadronEnergyFraction = ibooker.book1D("chargedHadronEnergyFraction", "chargedHadronEnergyFraction", 50,0,1);
455  neutralHadronEnergyFraction = ibooker.book1D("neutralHadronEnergyFraction", "neutralHadronEnergyFraction", 50,0,1);
456  chargedEmEnergyFraction = ibooker.book1D("chargedEmEnergyFraction", "chargedEmEnergyFraction", 50,0,1);
457  neutralEmEnergyFraction = ibooker.book1D("neutralEmEnergyFraction", "neutralEmEnergyFraction", 50,0,1);
458  photonEnergy = ibooker.book1D("photonEnergy", "photonEnergy", 50,0,500);
459  photonEnergyFraction = ibooker.book1D("photonEnergyFraction", "photonEnergyFraction", 50,0,1);
460  electronEnergy = ibooker.book1D("electronEnergy", "electronEnergy", 50,0,500);
461  electronEnergyFraction = ibooker.book1D("electronEnergyFraction", "electronEnergyFraction", 50,0,1);
462  muonEnergy = ibooker.book1D("muonEnergy", "muonEnergy", 50,0,500);
463  muonEnergyFraction = ibooker.book1D("muonEnergyFraction", "muonEnergyFraction", 50,0,1);
464  HFHadronEnergy = ibooker.book1D("HFHadronEnergy", "HFHadronEnergy", 50,0,500);
465  HFHadronEnergyFraction = ibooker.book1D("HFHadronEnergyFraction", "HFHadronEnergyFraction", 50,0,1);
466  HFEMEnergy = ibooker.book1D("HFEMEnergy", "HFEMEnergy", 50,0,500);
467  HFEMEnergyFraction = ibooker.book1D("HFEMEnergyFraction", "HFEMEnergyFraction", 50,0,1);
468  chargedHadronMultiplicity = ibooker.book1D("chargedHadronMultiplicity", "chargedHadronMultiplicity", 50,0,50);
469  neutralHadronMultiplicity = ibooker.book1D("neutralHadronMultiplicity", "neutralHadronMultiplicity", 50,0,50);
470  photonMultiplicity = ibooker.book1D("photonMultiplicity", "photonMultiplicity", 10,0,10);
471  electronMultiplicity = ibooker.book1D("electronMultiplicity", "electronMultiplicity", 10,0,10);
472  HFHadronMultiplicity = ibooker.book1D("HFHadronMultiplicity", "HFHadronMultiplicity", 50,0,50);
473  HFEMMultiplicity = ibooker.book1D("HFEMMultiplicity", "HFEMMultiplicity", 50,0,50);
474  chargedMuEnergy = ibooker.book1D("chargedMuEnergy", "chargedMuEnergy", 50,0,500);
475  chargedMuEnergyFraction = ibooker.book1D("chargedMuEnergyFraction", "chargedMuEnergyFraction", 50,0,1);
476  neutralMultiplicity = ibooker.book1D("neutralMultiplicity", "neutralMultiplicity", 50,0,50);
477  HOEnergy = ibooker.book1D("HOEnergy", "HOEnergy", 50,0,500);
478  HOEnergyFraction = ibooker.book1D("HOEnergyFraction", "HOEnergyFraction", 50,0,1);
479  }
480 }
481 
482 
483 //------------------------------------------------------------------------------
484 // ~JetTester
485 //------------------------------------------------------------------------------
487 
488 
489 //------------------------------------------------------------------------------
490 // analyze
491 //------------------------------------------------------------------------------
492 void JetTester::analyze(const edm::Event& mEvent, const edm::EventSetup& mSetup)
493 {
494  // Get the primary vertices
495  //----------------------------------------------------------------------------
497  mEvent.getByToken(pvToken_, pvHandle);
498 
499  int nGoodVertices = 0;
500 
501  if (pvHandle.isValid())
502  {
503  for (unsigned i=0; i<pvHandle->size(); i++)
504  {
505  if ((*pvHandle)[i].ndof() > 4 &&
506  (fabs((*pvHandle)[i].z()) <= 24) &&
507  (fabs((*pvHandle)[i].position().rho()) <= 2))
508  nGoodVertices++;
509  }
510  }
511 
512  mNvtx->Fill(nGoodVertices);
513 
514 // // Get the jet rho
515 // //----------------------------------------------------------------------------
516 // edm::Handle<double> pRho;
517 // mEvent.getByToken(rhoTag, pRho);
518 //
519 // if (pRho.isValid())
520 // {
521 // double jetRho = *pRho;
522 //
523 // if (mRho) mRho->Fill(jetRho);
524 // }
525 
526 
527  // Get the Jet collection
528  //----------------------------------------------------------------------------
529  math::XYZTLorentzVector p4tmp[2];
530 
531  std::vector<Jet> recoJets;
532  recoJets.clear();
533 
536 // edm::Handle<JPTJetCollection> jptJets;
538 
539  if (isCaloJet) mEvent.getByToken(caloJetsToken_, caloJets);
540  if (isPFJet) mEvent.getByToken(pfJetsToken_, pfJets);
541 // if (isJPTJet) mEvent.getByToken(jptJetsToken_, jptJets);
542  if (isMiniAODJet) mEvent.getByToken(patJetsToken_, patJets);
543 
544  if (isCaloJet && !caloJets.isValid()) return;
545  if (isPFJet && !pfJets.isValid()) return;
546 // if (isJPTJet && !jptJets.isValid()) return;
547  if (isMiniAODJet && !patJets.isValid()) return;
548 
549 
550  if (isCaloJet)
551  {
552  for (unsigned ijet=0; ijet<caloJets->size(); ijet++)
553  recoJets.push_back((*caloJets)[ijet]);
554  }
555 
556 /* if (isJPTJet)
557  {
558  for (unsigned ijet=0; ijet<jptJets->size(); ijet++)
559  recoJets.push_back((*jptJets)[ijet]);
560  }*/
561 
562  if (isPFJet) {
563  for (unsigned ijet=0; ijet<pfJets->size(); ijet++)
564  recoJets.push_back((*pfJets)[ijet]);
565  }
566  if (isMiniAODJet) {
567  for (unsigned ijet=0; ijet<patJets->size(); ijet++)
568  recoJets.push_back((*patJets)[ijet]);
569  }
570 
571  int nJet = 0;
572  int nJet_E_20_40 = 0;
573  int nJet_B_20_40 = 0;
574  int nJet_E_40 = 0;
575  int nJet_B_40 = 0;
576  int nJet_40 = 0;
577 
578  int index_first_jet=-1;
579  double pt_first=-1;
580 
581  int index_second_jet=-1;
582  double pt_second=-1;
583 
584  for (unsigned ijet=0; ijet<recoJets.size(); ijet++) {
585  bool pass_lowjet=false;
586  bool pass_mediumjet = false;
587  if(!isMiniAODJet){
588  if ( (recoJets[ijet].pt() > 20.) && (recoJets[ijet].pt() < mRecoJetPtThreshold)) {
589  pass_lowjet=true;
590  }
591  }
592  if(isMiniAODJet){
593  if((recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected"))>20. && ((recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected")) < mRecoJetPtThreshold)){
594  pass_lowjet=true;
595  }
596  }
597  if (pass_lowjet) {
598  if (fabs(recoJets[ijet].eta()) > 1.5)
599  nJet_E_20_40++;
600  else
601  nJet_B_20_40++;
602  }
603  if(!isMiniAODJet){
604  if (recoJets[ijet].pt() > mRecoJetPtThreshold) {
605  pass_mediumjet = true;
606  }
607  }
608  if(isMiniAODJet){
609  if((recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected")) > mRecoJetPtThreshold){
610  pass_mediumjet=true;
611  }
612  }
613  if (pass_mediumjet) {
614  if(isMiniAODJet){
615  if( (recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected"))>pt_first){
616  pt_second=pt_first;
617  pt_first=recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected");
618  index_second_jet=index_first_jet;
619  index_first_jet=ijet;
620  }else if( (recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected"))>pt_second){
621  index_second_jet=ijet;
622  pt_second=recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected");
623  }
624  }
625  //counting forward and barrel jets
626  if (fabs(recoJets[ijet].eta()) > 1.5)
627  nJet_E_40++;
628  else
629  nJet_B_40++;
630  nJet_40++;
631 
632  if (mEta) mEta->Fill(recoJets[ijet].eta());
633 
634  if (mJetArea) mJetArea ->Fill(recoJets[ijet].jetArea());
635  if (mPhi) mPhi ->Fill(recoJets[ijet].phi());
636  if(!isMiniAODJet){
637  if (mEnergy) mEnergy ->Fill(recoJets[ijet].energy());
638  if (mP) mP ->Fill(recoJets[ijet].p());
639  if (mPt) mPt ->Fill(recoJets[ijet].pt());
640  if (mMass) mMass ->Fill(recoJets[ijet].mass());
641  }else{
642  if (mEnergy) mEnergy ->Fill(recoJets[ijet].energy()*(*patJets)[ijet].jecFactor("Uncorrected"));
643  if (mP) mP ->Fill(recoJets[ijet].p()*(*patJets)[ijet].jecFactor("Uncorrected"));
644  if (mPt) mPt ->Fill(recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected"));
645  if (mMass) mMass ->Fill(recoJets[ijet].mass()*(*patJets)[ijet].jecFactor("Uncorrected"));
646  }
647  if (mConstituents) mConstituents->Fill(recoJets[ijet].nConstituents());
648  if(!isMiniAODJet){
649  if (ijet == 0) {
650  if (mEtaFirst) mEtaFirst->Fill(recoJets[ijet].eta());
651  if (mPhiFirst) mPhiFirst->Fill(recoJets[ijet].phi());
652  if (mPtFirst) mPtFirst ->Fill(recoJets[ijet].pt());
653  }
654 
655  if (ijet == 0) {nJet++; p4tmp[0] = recoJets[ijet].p4();}
656  if (ijet == 1) {nJet++; p4tmp[1] = recoJets[ijet].p4();}
657  }
658  // if (isPFJet || isCaloJet) {
659  // if (mHadEnergyInHF) mHadEnergyInHF ->Fill((*pfJets)[ijet].HFHadronEnergy());
660  // if (mEmEnergyInHF) mEmEnergyInHF ->Fill((*pfJets)[ijet].HFEMEnergy());
661  // if (mChargedEmEnergy) mChargedEmEnergy ->Fill((*pfJets)[ijet].chargedEmEnergy());
662  // if (mChargedHadronEnergy) mChargedHadronEnergy->Fill((*pfJets)[ijet].chargedHadronEnergy());
663  // if (mNeutralEmEnergy) mNeutralEmEnergy ->Fill((*pfJets)[ijet].neutralEmEnergy());
664  // if (mNeutralHadronEnergy) mNeutralHadronEnergy->Fill((*pfJets)[ijet].neutralHadronEnergy());
665  // }
666 
667 
668  // ---- Calo Jet specific information ----
669  if (isCaloJet) {
670  maxEInEmTowers ->Fill((*caloJets)[ijet].maxEInEmTowers());
671  maxEInHadTowers ->Fill((*caloJets)[ijet].maxEInHadTowers());
672  energyFractionHadronic ->Fill((*caloJets)[ijet].energyFractionHadronic());
673  emEnergyFraction ->Fill((*caloJets)[ijet].emEnergyFraction());
674  hadEnergyInHB ->Fill((*caloJets)[ijet].hadEnergyInHB());
675  hadEnergyInHO ->Fill((*caloJets)[ijet].hadEnergyInHO());
676  hadEnergyInHE ->Fill((*caloJets)[ijet].hadEnergyInHE());
677  hadEnergyInHF ->Fill((*caloJets)[ijet].hadEnergyInHF());
678  emEnergyInEB ->Fill((*caloJets)[ijet].emEnergyInEB());
679  emEnergyInEE ->Fill((*caloJets)[ijet].emEnergyInEE());
680  emEnergyInHF ->Fill((*caloJets)[ijet].emEnergyInHF());
681  towersArea ->Fill((*caloJets)[ijet].towersArea());
682  n90 ->Fill((*caloJets)[ijet].n90());
683  n60 ->Fill((*caloJets)[ijet].n60());
684  }
685  // ---- PF Jet specific information ----
686  if (isPFJet) {
687  muonMultiplicity ->Fill((*pfJets)[ijet].muonMultiplicity());
688  chargedMultiplicity ->Fill((*pfJets)[ijet].chargedMultiplicity());
689  chargedEmEnergy ->Fill((*pfJets)[ijet].chargedEmEnergy());
690  neutralEmEnergy ->Fill((*pfJets)[ijet].neutralEmEnergy());
691  chargedHadronEnergy ->Fill((*pfJets)[ijet].chargedHadronEnergy());
692  neutralHadronEnergy ->Fill((*pfJets)[ijet].neutralHadronEnergy());
697  photonEnergy ->Fill((*pfJets)[ijet].photonEnergy());
698  photonEnergyFraction ->Fill((*pfJets)[ijet].photonEnergyFraction());
699  electronEnergy ->Fill((*pfJets)[ijet].electronEnergy());
701  muonEnergy ->Fill((*pfJets)[ijet].muonEnergy());
702  muonEnergyFraction ->Fill((*pfJets)[ijet].muonEnergyFraction());
703  HFHadronEnergy ->Fill((*pfJets)[ijet].HFHadronEnergy());
705  HFEMEnergy ->Fill((*pfJets)[ijet].HFEMEnergy());
706  HFEMEnergyFraction ->Fill((*pfJets)[ijet].HFEMEnergyFraction());
709  photonMultiplicity ->Fill((*pfJets)[ijet].photonMultiplicity());
710  electronMultiplicity ->Fill((*pfJets)[ijet].electronMultiplicity());
711  HFHadronMultiplicity ->Fill((*pfJets)[ijet].HFHadronMultiplicity());
712  HFEMMultiplicity ->Fill((*pfJets)[ijet].HFEMMultiplicity());
713  chargedMuEnergy ->Fill((*pfJets)[ijet].chargedMuEnergy());
715  neutralMultiplicity ->Fill((*pfJets)[ijet].neutralMultiplicity());
716  HOEnergy ->Fill((*pfJets)[ijet].hoEnergy());
717  HOEnergyFraction ->Fill((*pfJets)[ijet].hoEnergyFraction());
718  }
719  if (isMiniAODJet && (*patJets)[ijet].isPFJet()) {
720  muonMultiplicity ->Fill((*patJets)[ijet].muonMultiplicity());
721  chargedMultiplicity ->Fill((*patJets)[ijet].chargedMultiplicity());
722  chargedEmEnergy ->Fill((*patJets)[ijet].chargedEmEnergy());
723  neutralEmEnergy ->Fill((*patJets)[ijet].neutralEmEnergy());
724  chargedHadronEnergy ->Fill((*patJets)[ijet].chargedHadronEnergy());
725  neutralHadronEnergy ->Fill((*patJets)[ijet].neutralHadronEnergy());
730  photonEnergy ->Fill((*patJets)[ijet].photonEnergy());
731  photonEnergyFraction ->Fill((*patJets)[ijet].photonEnergyFraction());
732  electronEnergy ->Fill((*patJets)[ijet].electronEnergy());
733  electronEnergyFraction ->Fill((*patJets)[ijet].electronEnergyFraction());
734  muonEnergy ->Fill((*patJets)[ijet].muonEnergy());
735  muonEnergyFraction ->Fill((*patJets)[ijet].muonEnergyFraction());
736  HFHadronEnergy ->Fill((*patJets)[ijet].HFHadronEnergy());
737  HFHadronEnergyFraction ->Fill((*patJets)[ijet].HFHadronEnergyFraction());
738  HFEMEnergy ->Fill((*patJets)[ijet].HFEMEnergy());
739  HFEMEnergyFraction ->Fill((*patJets)[ijet].HFEMEnergyFraction());
742  photonMultiplicity ->Fill((*patJets)[ijet].photonMultiplicity());
743  electronMultiplicity ->Fill((*patJets)[ijet].electronMultiplicity());
744  HFHadronMultiplicity ->Fill((*patJets)[ijet].HFHadronMultiplicity());
745  HFEMMultiplicity ->Fill((*patJets)[ijet].HFEMMultiplicity());
746  chargedMuEnergy ->Fill((*patJets)[ijet].chargedMuEnergy());
748  neutralMultiplicity ->Fill((*patJets)[ijet].neutralMultiplicity());
749  HOEnergy ->Fill((*patJets)[ijet].hoEnergy());
750  HOEnergyFraction ->Fill((*patJets)[ijet].hoEnergyFraction());
751  }
752  }//fill quantities for medium jets
753  }
754 
755  if (mNJetsEta_B_20_40) mNJetsEta_B_20_40->Fill(nJet_B_20_40);
756  if (mNJetsEta_E_20_40) mNJetsEta_E_20_40->Fill(nJet_E_20_40);
757  if (mNJetsEta_B_40) mNJetsEta_B_40->Fill(nJet_B_40);
758  if (mNJetsEta_E_40) mNJetsEta_E_40->Fill(nJet_E_40);
759  if (mNJets_40) mNJets_40->Fill(nJet_40);
760  if(!isMiniAODJet){
761  if (nJet >= 2)
762  {
763  if (mMjj) mMjj->Fill((p4tmp[0]+p4tmp[1]).mass());
764  }
765  }else{
766  if(index_first_jet>-1){
767  if (mEtaFirst) mEtaFirst->Fill(recoJets[index_first_jet].eta());
768  if (mPhiFirst) mPhiFirst->Fill(recoJets[index_first_jet].phi());
769  if (mPtFirst) mPtFirst ->Fill(recoJets[index_first_jet].pt()*(*patJets)[index_first_jet].jecFactor("Uncorrected"));
770  nJet++; p4tmp[0] = recoJets[index_first_jet].p4()*(*patJets)[index_first_jet].jecFactor("Uncorrected");
771  }
772  if(index_second_jet>-1){
773  nJet++; p4tmp[1] = recoJets[index_second_jet].p4()*(*patJets)[index_second_jet].jecFactor("Uncorrected");
774  }
775  if (nJet >= 2)
776  {
777  if (mMjj) mMjj->Fill((p4tmp[0]+p4tmp[1]).mass());
778  }
779  }
780 
781  // Count jets above pt cut
782  //----------------------------------------------------------------------------
783  for (int istep=0; istep<100; ++istep)
784  {
785  int njets1 = 0;
786  int njets2 = 0;
787 
788  float ptStep1 = (istep * ( 200. / 100.));
789  float ptStep2 = (istep * (4000. / 100.));
790 
791  for (unsigned ijet=0; ijet<recoJets.size(); ijet++) {
792  if(!isMiniAODJet){
793  if (recoJets[ijet].pt() > ptStep1) njets1++;
794  if (recoJets[ijet].pt() > ptStep2) njets2++;
795  }else{
796  if ((recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected")) > ptStep1) njets1++;
797  if ((recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected")) > ptStep2) njets2++;
798  }
799  mNJets1->Fill(ptStep1, njets1);
800  mNJets2->Fill(ptStep2, njets2);
801  }
802  }
803 
804 
805  // Corrected jets
806  //----------------------------------------------------------------------------
807  double scale = -999;
809  bool pass_correction_flag =false;
810  if(!isMiniAODJet && !mJetCorrector.label().empty()){
811  mEvent.getByToken(jetCorrectorToken_, jetCorr);
812  if (jetCorr.isValid()){
813  pass_correction_flag=true;
814  }
815  }
816  if(isMiniAODJet){
817  pass_correction_flag =true;
818  }
819  for (unsigned ijet=0; ijet<recoJets.size(); ijet++) {
820  Jet correctedJet = recoJets[ijet];
821  if(pass_correction_flag){
822  if (isCaloJet) scale = jetCorr->correction((*caloJets)[ijet]);
823  if (isPFJet) scale = jetCorr->correction((*pfJets)[ijet]);
824  //if (isJPTJet) scale = jetCorr->correction((*jptJets)[ijet]);
825  if(!isMiniAODJet){
826  correctedJet.scaleEnergy(scale);
827  }
828 
829  if (correctedJet.pt() < 20) continue;
830 
831  if (isMiniAODJet){
832  if(hadronFlavor)hadronFlavor->Fill((*patJets)[ijet].hadronFlavour());
833  if(partonFlavor)partonFlavor->Fill((*patJets)[ijet].partonFlavour());
834  if(genPartonPDGID && (*patJets)[ijet].genParton()!=NULL)genPartonPDGID->Fill((*patJets)[ijet].genParton()->pdgId());
835  }
836 
837 
838  mCorrJetEta->Fill(correctedJet.eta());
839  mCorrJetPhi->Fill(correctedJet.phi());
840  mCorrJetPt ->Fill(correctedJet.pt());
841  if (correctedJet.pt() >= 40) {
842  mCorrJetEta_Pt40->Fill(correctedJet.eta());
843  mCorrJetPhi_Pt40->Fill(correctedJet.phi());
844  }
845 
846  double ijetEta = recoJets[ijet].eta();
847  double ijetPt = recoJets[ijet].pt();
848  if(isMiniAODJet){
849  ijetPt=recoJets[ijet].pt()*(*patJets)[ijet].jecFactor("Uncorrected");
850  }
851  double ratio = correctedJet.pt() / ijetPt;
852  if(isMiniAODJet){
853  ratio =1./(*patJets)[ijet].jecFactor("Uncorrected");
854  }
855 
856  if (fabs(ijetEta) < 1.5) mPtCorrOverReco_Pt_B->Fill(log10(ijetPt), ratio);
857  else if (fabs(ijetEta) < 3.0) mPtCorrOverReco_Pt_E->Fill(log10(ijetPt), ratio);
858  else if (fabs(ijetEta) < 6.0) mPtCorrOverReco_Pt_F->Fill(log10(ijetPt), ratio);
859 
860  if (ijetPt < 40) mPtCorrOverReco_Eta_20_40 ->Fill(ijetEta, ratio);
861  else if (ijetPt < 200) mPtCorrOverReco_Eta_40_200 ->Fill(ijetEta, ratio);
862  else if (ijetPt < 600) mPtCorrOverReco_Eta_200_600 ->Fill(ijetEta, ratio);
863  else if (ijetPt < 1500) mPtCorrOverReco_Eta_600_1500 ->Fill(ijetEta, ratio);
864  else if (ijetPt < 3500) mPtCorrOverReco_Eta_1500_3500->Fill(ijetEta, ratio);
865  else if (ijetPt < 5000) mPtCorrOverReco_Eta_3500_5000->Fill(ijetEta, ratio);
866  else if (ijetPt < 6500) mPtCorrOverReco_Eta_5000_6500->Fill(ijetEta, ratio);
867  if (ijetPt > 3500) mPtCorrOverReco_Eta_3500->Fill(ijetEta, ratio);
868  }
869  }
870 
871  //----------------------------------------------------------------------------
872  //
873  // Generation
874  //
875  //----------------------------------------------------------------------------
876  if (!mEvent.isRealData())
877  {
878  // Get ptHat
879  //------------------------------------------------------------------------
881  mEvent.getByToken(evtToken_, myGenEvt);
882 
883  if (myGenEvt.isValid()) {
884  if(myGenEvt->hasBinningValues()){
885  double ptHat = myGenEvt->binningValues()[0];
886  if (mPtHat) mPtHat->Fill(ptHat);
887  }
888  }
889  // Gen jets
890  //------------------------------------------------------------------------
892  mEvent.getByToken(genJetsToken_, genJets);
893 
894  if (!genJets.isValid()) return;
895 
896  for (GenJetCollection::const_iterator gjet=genJets->begin(); gjet!=genJets->end(); gjet++) {
897  //for MiniAOD we have here intrinsic thresholds, introduce also threshold for RECO
898  if(gjet->pt() > mMatchGenPtThreshold){
899  if (mGenEta) mGenEta->Fill(gjet->eta());
900  if (mGenPhi) mGenPhi->Fill(gjet->phi());
901  if (mGenPt) mGenPt ->Fill(gjet->pt());
902  if (gjet == genJets->begin()) {
903  if (mGenEtaFirst) mGenEtaFirst->Fill(gjet->eta());
904  if (mGenPhiFirst) mGenPhiFirst->Fill(gjet->phi());
905  }
906  }
907  }
908 
909  if (!(mInputGenCollection.label().empty())) {
910  for (GenJetCollection::const_iterator gjet=genJets->begin(); gjet!=genJets->end(); gjet++) {
911  if (fabs(gjet->eta()) > 6.) continue; // Out of the detector
912  if (gjet->pt() < mMatchGenPtThreshold) continue;
913  if (recoJets.size() <= 0) continue;
914  // pt response
915  //------------------------------------------------------------
916  int iMatch = -1;
917  double CorrdeltaRBest = 999;
918  double CorrJetPtBest = 0;
919  double CorrJetMassBest = 0;
920  for (unsigned ijet=0; ijet<recoJets.size(); ++ijet) {
921  Jet correctedJet = recoJets[ijet];
922  if(pass_correction_flag && !isMiniAODJet){
923  if (isCaloJet) scale = jetCorr->correction((*caloJets)[ijet]);
924  if (isPFJet) scale = jetCorr->correction((*pfJets)[ijet]);
925  correctedJet.scaleEnergy(scale);
926  }
927  double CorrJetPt = correctedJet.pt();
928  if (CorrJetPt > 10) {
929  double CorrdR = deltaR(gjet->eta(), gjet->phi(), correctedJet.eta(), correctedJet.phi());
930  if (CorrdR < CorrdeltaRBest) {
931  CorrJetMassBest = correctedJet.mass();
932  CorrdeltaRBest = CorrdR;
933  CorrJetPtBest = CorrJetPt;
934  iMatch = ijet;
935  }
936  }
937  }
938  if (iMatch<0) continue;
939  //use mass after jet energy correction -> for MiniAOD that is the case per default
940  if(!isMiniAODJet){
941  fillMatchHists(gjet->eta(), gjet->phi(), gjet->pt(), gjet->mass(), recoJets[iMatch].eta(), recoJets[iMatch].phi(), recoJets[iMatch].pt(),CorrJetMassBest);
942  }else{
943  fillMatchHists(gjet->eta(), gjet->phi(), gjet->pt(), gjet->mass(), (*patJets)[iMatch].eta(), (*patJets)[iMatch].phi(),(*patJets)[iMatch].pt()*(*patJets)[iMatch].jecFactor("Uncorrected"),recoJets[iMatch].mass());
944  }
945  if (pass_correction_flag) {//fill only for corrected jets
946  if (CorrdeltaRBest < mRThreshold) {
947  double response = CorrJetPtBest / gjet->pt();
948 
949  if (fabs(gjet->eta()) < 1.5) mPtCorrOverGen_GenPt_B->Fill(log10(gjet->pt()), response);
950  else if (fabs(gjet->eta()) < 3.0) mPtCorrOverGen_GenPt_E->Fill(log10(gjet->pt()), response);
951  else if (fabs(gjet->eta()) < 6.0) mPtCorrOverGen_GenPt_F->Fill(log10(gjet->pt()), response);
952 
953  if (gjet->pt() > 20) {
954  if (gjet->pt() < 40) mPtCorrOverGen_GenEta_20_40 ->Fill(gjet->eta(), response);
955  else if (gjet->pt() < 200) mPtCorrOverGen_GenEta_40_200 ->Fill(gjet->eta(), response);
956  else if (gjet->pt() < 600) mPtCorrOverGen_GenEta_200_600 ->Fill(gjet->eta(), response);
957  else if (gjet->pt() < 1500) mPtCorrOverGen_GenEta_600_1500 ->Fill(gjet->eta(), response);
958  else if (gjet->pt() < 3500) mPtCorrOverGen_GenEta_1500_3500->Fill(gjet->eta(), response);
959  else if (gjet->pt() < 5000) mPtCorrOverGen_GenEta_3500_5000->Fill(gjet->eta(), response);
960  else if (gjet->pt() < 6500) mPtCorrOverGen_GenEta_5000_6500->Fill(gjet->eta(), response);
961  if (gjet->pt() > 3500) mPtCorrOverGen_GenEta_3500->Fill(gjet->eta(), response);
962  }
963  }
964  }
965  }
966  }
967  }
968 }
969 
970 
971 //------------------------------------------------------------------------------
972 // fillMatchHists
973 //------------------------------------------------------------------------------
974 void JetTester::fillMatchHists(const double GenEta,
975  const double GenPhi,
976  const double GenPt,
977  const double GenMass,
978  const double RecoEta,
979  const double RecoPhi,
980  const double RecoPt,
981  const double RecoMass)
982 {
983  if (GenPt > mMatchGenPtThreshold) {
984  mDeltaEta->Fill(GenEta - RecoEta);
985  mDeltaPhi->Fill(GenPhi - RecoPhi);
986  mDeltaPt ->Fill((GenPt - RecoPt) / GenPt);
987  }
988 
989  if (fabs(GenEta) < 1.5)
990  {
991  mPtRecoOverGen_GenPt_B ->Fill(log10(GenPt), RecoPt / GenPt);
992  mPtRecoOverGen_GenPhi_B->Fill(GenPhi, RecoPt / GenPt);
993 
994  if (GenPt > 20 && GenPt < 40) mMassRecoOverGen_B_20_40 ->Fill(RecoMass / GenMass);
995  else if (GenPt < 200) mMassRecoOverGen_B_40_200 ->Fill(RecoMass / GenMass);
996  else if (GenPt < 500) mMassRecoOverGen_B_200_500 ->Fill(RecoMass / GenMass);
997  else if (GenPt < 750) mMassRecoOverGen_B_500_750 ->Fill(RecoMass / GenMass);
998  else if (GenPt < 1000) mMassRecoOverGen_B_750_1000 ->Fill(RecoMass / GenMass);
999  else if (GenPt < 1500) mMassRecoOverGen_B_1000_1500 ->Fill(RecoMass / GenMass);
1000  else if (GenPt < 3500) mMassRecoOverGen_B_1500_3500 ->Fill(RecoMass / GenMass);
1001  else if (GenPt < 5000) mMassRecoOverGen_B_3500_5000 ->Fill(RecoMass / GenMass);
1002  else if (GenPt >= 5000) mMassRecoOverGen_B_5000 ->Fill(RecoMass / GenMass);
1003 
1004  if (GenPt > 20 && GenPt < 40) mPtRecoOverGen_B_20_40 ->Fill(RecoPt / GenPt);
1005  else if (GenPt < 200) mPtRecoOverGen_B_40_200 ->Fill(RecoPt / GenPt);
1006  else if (GenPt < 600) mPtRecoOverGen_B_200_600 ->Fill(RecoPt / GenPt);
1007  else if (GenPt < 1500) mPtRecoOverGen_B_600_1500 ->Fill(RecoPt / GenPt);
1008  else if (GenPt < 3500) mPtRecoOverGen_B_1500_3500->Fill(RecoPt / GenPt);
1009  else if (GenPt < 5000) mPtRecoOverGen_B_3500_5000->Fill(RecoPt / GenPt);
1010  else if (GenPt < 6500) mPtRecoOverGen_B_5000_6500->Fill(RecoPt / GenPt);
1011  if (GenPt>3500) mPtRecoOverGen_B_3500->Fill(RecoPt / GenPt);
1012  }
1013  else if (fabs(GenEta) < 3.0)
1014  {
1015  mPtRecoOverGen_GenPt_E ->Fill(log10(GenPt), RecoPt / GenPt);
1016  mPtRecoOverGen_GenPhi_E->Fill(GenPhi, RecoPt / GenPt);
1017 
1018  if (GenPt > 20 && GenPt < 40) mPtRecoOverGen_E_20_40 ->Fill(RecoPt / GenPt);
1019  else if (GenPt < 200) mPtRecoOverGen_E_40_200 ->Fill(RecoPt / GenPt);
1020  else if (GenPt < 600) mPtRecoOverGen_E_200_600 ->Fill(RecoPt / GenPt);
1021  else if (GenPt < 1500) mPtRecoOverGen_E_600_1500 ->Fill(RecoPt / GenPt);
1022  else if (GenPt < 3500) mPtRecoOverGen_E_1500_3500->Fill(RecoPt / GenPt);
1023  else if (GenPt < 5000) mPtRecoOverGen_E_3500_5000->Fill(RecoPt / GenPt);
1024  else if (GenPt < 6500) mPtRecoOverGen_E_5000_6500->Fill(RecoPt / GenPt);
1025  if (GenPt>3500) mPtRecoOverGen_E_3500->Fill(RecoPt / GenPt);
1026 
1027  if (GenPt > 20 && GenPt < 40) mMassRecoOverGen_E_20_40 ->Fill(RecoMass / GenMass);
1028  else if (GenPt < 200) mMassRecoOverGen_E_40_200 ->Fill(RecoMass / GenMass);
1029  else if (GenPt < 500) mMassRecoOverGen_E_200_500 ->Fill(RecoMass / GenMass);
1030  else if (GenPt < 750) mMassRecoOverGen_E_500_750 ->Fill(RecoMass / GenMass);
1031  else if (GenPt < 1000) mMassRecoOverGen_E_750_1000 ->Fill(RecoMass / GenMass);
1032  else if (GenPt < 1500) mMassRecoOverGen_E_1000_1500 ->Fill(RecoMass / GenMass);
1033  else if (GenPt < 3500) mMassRecoOverGen_E_1500_3500 ->Fill(RecoMass / GenMass);
1034  else if (GenPt < 5000) mMassRecoOverGen_E_3500_5000 ->Fill(RecoMass / GenMass);
1035  else if (GenPt >= 5000) mMassRecoOverGen_E_5000 ->Fill(RecoMass / GenMass);
1036 
1037  }
1038  else if (fabs(GenEta) < 6.0)
1039  {
1040  mPtRecoOverGen_GenPt_F ->Fill (log10(GenPt), RecoPt / GenPt);
1041  mPtRecoOverGen_GenPhi_F->Fill (GenPhi, RecoPt / GenPt);
1042 
1043  if (GenPt > 20 && GenPt < 40) mPtRecoOverGen_F_20_40 ->Fill(RecoPt / GenPt);
1044  else if (GenPt < 200) mPtRecoOverGen_F_40_200 ->Fill(RecoPt / GenPt);
1045  else if (GenPt < 600) mPtRecoOverGen_F_200_600 ->Fill(RecoPt / GenPt);
1046  else if (GenPt < 1500) mPtRecoOverGen_F_600_1500 ->Fill(RecoPt / GenPt);
1047  else if (GenPt < 3500) mPtRecoOverGen_F_1500_3500->Fill(RecoPt / GenPt);
1048  if (GenPt>3500) mPtRecoOverGen_F_3500->Fill(RecoPt / GenPt);
1049 
1050  if (GenPt > 20 && GenPt < 40) mMassRecoOverGen_F_20_40 ->Fill(RecoMass / GenMass);
1051  else if (GenPt < 200) mMassRecoOverGen_F_40_200 ->Fill(RecoMass / GenMass);
1052  else if (GenPt < 500) mMassRecoOverGen_F_200_500 ->Fill(RecoMass / GenMass);
1053  else if (GenPt < 750) mMassRecoOverGen_F_500_750 ->Fill(RecoMass / GenMass);
1054  else if (GenPt < 1000) mMassRecoOverGen_F_750_1000 ->Fill(RecoMass / GenMass);
1055  else if (GenPt < 1500) mMassRecoOverGen_F_1000_1500 ->Fill(RecoMass / GenMass);
1056  else if (GenPt >=1500) mMassRecoOverGen_F_1500 ->Fill(RecoMass / GenMass);
1057  }
1058 
1059  if (GenPt > 20 && GenPt < 40) mPtRecoOverGen_GenEta_20_40 ->Fill(GenEta, RecoPt / GenPt);
1060  else if (GenPt < 200) mPtRecoOverGen_GenEta_40_200 ->Fill(GenEta, RecoPt / GenPt);
1061  else if (GenPt < 600) mPtRecoOverGen_GenEta_200_600 ->Fill(GenEta, RecoPt / GenPt);
1062  else if (GenPt < 1500) mPtRecoOverGen_GenEta_600_1500 ->Fill(GenEta, RecoPt / GenPt);
1063  else if (GenPt < 3500) mPtRecoOverGen_GenEta_1500_3500->Fill(GenEta, RecoPt / GenPt);
1064  else if (GenPt < 5000) mPtRecoOverGen_GenEta_3500_5000->Fill(GenEta, RecoPt / GenPt);
1065  else if (GenPt < 6500) mPtRecoOverGen_GenEta_5000_6500->Fill(GenEta, RecoPt / GenPt);
1066  if (GenPt > 3500) mPtRecoOverGen_GenEta_3500->Fill(GenEta, RecoPt / GenPt);
1067 }
MonitorElement * mMassRecoOverGen_F_1500
Definition: JetTester.h:167
T getParameter(std::string const &) const
MonitorElement * mNJetsEta_B_40
Definition: JetTester.h:202
MonitorElement * mPtRecoOverGen_E_20_40
Definition: JetTester.h:127
int i
Definition: DBlmapReader.cc:9
MonitorElement * mPtRecoOverGen_B_5000_6500
Definition: JetTester.h:143
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
Definition: JetTester.h:63
MonitorElement * mPtCorrOverGen_GenEta_40_200
Definition: JetTester.h:107
MonitorElement * mPtCorrOverReco_Pt_E
Definition: JetTester.h:93
MonitorElement * genPartonPDGID
Definition: JetTester.h:262
MonitorElement * hadEnergyInHE
Definition: JetTester.h:215
MonitorElement * mNvtx
Definition: JetTester.h:72
MonitorElement * HFHadronEnergyFraction
Definition: JetTester.h:244
MonitorElement * mPtRecoOverGen_B_20_40
Definition: JetTester.h:126
MonitorElement * mPtCorrOverGen_GenPt_F
Definition: JetTester.h:105
MonitorElement * mPtRecoOverGen_F_40_200
Definition: JetTester.h:131
edm::EDGetTokenT< reco::GenJetCollection > genJetsToken_
Definition: JetTester.h:66
bool isMiniAODJet
Definition: JetTester.h:270
MonitorElement * mMassRecoOverGen_F_750_1000
Definition: JetTester.h:161
MonitorElement * mPtRecoOverGen_GenEta_3500
Definition: JetTester.h:192
MonitorElement * HOEnergy
Definition: JetTester.h:256
virtual void scaleEnergy(double fScale)
scale energy of the jet
MonitorElement * mMassRecoOverGen_E_1500_3500
Definition: JetTester.h:166
MonitorElement * neutralHadronEnergy
Definition: JetTester.h:230
MonitorElement * electronEnergyFraction
Definition: JetTester.h:240
MonitorElement * mPtRecoOverGen_B_200_600
Definition: JetTester.h:132
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: JetTester.cc:263
MonitorElement * HFEMEnergyFraction
Definition: JetTester.h:246
bool isPFJet
Definition: JetTester.h:269
MonitorElement * mPtRecoOverGen_E_3500_5000
Definition: JetTester.h:142
MonitorElement * mPtRecoOverGen_GenPt_F
Definition: JetTester.h:181
MonitorElement * mMjj
Definition: JetTester.h:199
edm::InputTag mInputGenCollection
Definition: JetTester.h:58
MonitorElement * mPtFirst
Definition: JetTester.h:198
MonitorElement * mMassRecoOverGen_B_3500_5000
Definition: JetTester.h:168
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< reco::CaloJetCollection > caloJetsToken_
Definition: JetTester.h:64
MonitorElement * photonEnergyFraction
Definition: JetTester.h:238
edm::EDGetTokenT< pat::JetCollection > patJetsToken_
Definition: JetTester.h:68
MonitorElement * neutralMultiplicity
Definition: JetTester.h:255
MonitorElement * mPtRecoOverGen_F_3500
Definition: JetTester.h:176
MonitorElement * mDeltaPhi
Definition: JetTester.h:123
MonitorElement * mPtRecoOverGen_GenEta_3500_5000
Definition: JetTester.h:190
Base class for all types of Jets.
Definition: Jet.h:20
MonitorElement * mMassRecoOverGen_B_1500_3500
Definition: JetTester.h:165
bool isCaloJet
Definition: JetTester.h:268
MonitorElement * mMassRecoOverGen_E_500_750
Definition: JetTester.h:157
edm::InputTag mJetCorrector
Definition: JetTester.h:59
MonitorElement * mMassRecoOverGen_F_40_200
Definition: JetTester.h:152
MonitorElement * mPtRecoOverGen_GenPhi_E
Definition: JetTester.h:183
MonitorElement * mPtRecoOverGen_GenEta_20_40
Definition: JetTester.h:185
MonitorElement * hadEnergyInHB
Definition: JetTester.h:213
MonitorElement * mPtCorrOverReco_Eta_40_200
Definition: JetTester.h:96
MonitorElement * photonMultiplicity
Definition: JetTester.h:249
MonitorElement * mCorrJetPhi
Definition: JetTester.h:88
virtual double phi() const final
momentum azimuthal angle
MonitorElement * mMassRecoOverGen_B_200_500
Definition: JetTester.h:153
MonitorElement * energyFractionHadronic
Definition: JetTester.h:211
#define NULL
Definition: scimark2.h:8
double mMatchGenPtThreshold
Definition: JetTester.h:266
MonitorElement * mMassRecoOverGen_F_20_40
Definition: JetTester.h:149
MonitorElement * mPtRecoOverGen_E_40_200
Definition: JetTester.h:130
edm::EDGetTokenT< reco::JetCorrector > jetCorrectorToken_
Definition: JetTester.h:69
MonitorElement * mNJets2
Definition: JetTester.h:206
MonitorElement * mPtCorrOverReco_Eta_200_600
Definition: JetTester.h:97
MonitorElement * muonEnergyFraction
Definition: JetTester.h:242
MonitorElement * n90
Definition: JetTester.h:221
MonitorElement * mPtRecoOverGen_GenPhi_B
Definition: JetTester.h:182
MonitorElement * mEtaFirst
Definition: JetTester.h:196
MonitorElement * mPtRecoOverGen_E_5000_6500
Definition: JetTester.h:144
MonitorElement * mMassRecoOverGen_B_5000
Definition: JetTester.h:170
MonitorElement * mPtCorrOverGen_GenEta_3500_5000
Definition: JetTester.h:111
bool isRealData() const
Definition: EventBase.h:63
void fillMatchHists(const double GenEta, const double GenPhi, const double GenPt, const double GenMass, const double RecoEta, const double RecoPhi, const double RecoPt, const double RecoMass)
Definition: JetTester.cc:974
MonitorElement * emEnergyFraction
Definition: JetTester.h:212
MonitorElement * mMassRecoOverGen_B_40_200
Definition: JetTester.h:150
MonitorElement * mCorrJetEta
Definition: JetTester.h:87
MonitorElement * mPtCorrOverReco_Eta_3500
Definition: JetTester.h:102
MonitorElement * photonEnergy
Definition: JetTester.h:237
MonitorElement * towersArea
Definition: JetTester.h:220
void Fill(long long x)
MonitorElement * hadEnergyInHF
Definition: JetTester.h:216
MonitorElement * HFHadronMultiplicity
Definition: JetTester.h:251
MonitorElement * mGenPt
Definition: JetTester.h:118
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
MonitorElement * muonEnergy
Definition: JetTester.h:241
MonitorElement * electronMultiplicity
Definition: JetTester.h:250
MonitorElement * mPtRecoOverGen_B_600_1500
Definition: JetTester.h:135
MonitorElement * mEnergy
Definition: JetTester.h:79
MonitorElement * mMassRecoOverGen_F_500_750
Definition: JetTester.h:158
MonitorElement * mPtRecoOverGen_GenPt_E
Definition: JetTester.h:180
MonitorElement * mNJetsEta_E_40
Definition: JetTester.h:203
MonitorElement * mEta
Definition: JetTester.h:75
MonitorElement * mGenEtaFirst
Definition: JetTester.h:119
MonitorElement * mNJetsEta_B_20_40
Definition: JetTester.h:200
MonitorElement * mPtRecoOverGen_B_3500
Definition: JetTester.h:174
MonitorElement * chargedMuEnergy
Definition: JetTester.h:253
MonitorElement * mPtRecoOverGen_F_1500_3500
Definition: JetTester.h:140
MonitorElement * mDeltaEta
Definition: JetTester.h:122
MonitorElement * mNJets_40
Definition: JetTester.h:204
MonitorElement * HFHadronEnergy
Definition: JetTester.h:243
MonitorElement * mNJetsEta_E_20_40
Definition: JetTester.h:201
MonitorElement * hadronFlavor
Definition: JetTester.h:260
MonitorElement * mDeltaPt
Definition: JetTester.h:124
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * mPtRecoOverGen_B_40_200
Definition: JetTester.h:129
MonitorElement * mPtRecoOverGen_B_1500_3500
Definition: JetTester.h:138
MonitorElement * mPtRecoOverGen_F_200_600
Definition: JetTester.h:134
MonitorElement * mPhiFirst
Definition: JetTester.h:197
MonitorElement * mP
Definition: JetTester.h:78
MonitorElement * mMassRecoOverGen_B_500_750
Definition: JetTester.h:156
edm::EDGetTokenT< GenEventInfoProduct > evtToken_
Definition: JetTester.h:67
MonitorElement * mPtCorrOverGen_GenPt_B
Definition: JetTester.h:103
MonitorElement * mPtCorrOverReco_Eta_600_1500
Definition: JetTester.h:98
MonitorElement * n60
Definition: JetTester.h:222
MonitorElement * mPtCorrOverReco_Eta_5000_6500
Definition: JetTester.h:101
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * mPtCorrOverReco_Eta_3500_5000
Definition: JetTester.h:100
MonitorElement * HOEnergyFraction
Definition: JetTester.h:257
MonitorElement * mGenEta
Definition: JetTester.h:116
MonitorElement * hadEnergyInHO
Definition: JetTester.h:214
MonitorElement * mPhi
Definition: JetTester.h:76
MonitorElement * mPtRecoOverGen_E_3500
Definition: JetTester.h:175
MonitorElement * mMassRecoOverGen_F_1000_1500
Definition: JetTester.h:164
MonitorElement * mPtCorrOverGen_GenEta_3500
Definition: JetTester.h:113
MonitorElement * mPtCorrOverGen_GenEta_200_600
Definition: JetTester.h:108
MonitorElement * mPt
Definition: JetTester.h:77
edm::InputTag mInputCollection
Definition: JetTester.h:57
MonitorElement * emEnergyInHF
Definition: JetTester.h:219
MonitorElement * mPtRecoOverGen_E_200_600
Definition: JetTester.h:133
MonitorElement * mMassRecoOverGen_E_750_1000
Definition: JetTester.h:160
JetTester(const edm::ParameterSet &)
Definition: JetTester.cc:12
MonitorElement * mPtRecoOverGen_GenPhi_F
Definition: JetTester.h:184
MonitorElement * chargedHadronEnergyFraction
Definition: JetTester.h:231
MonitorElement * mPtRecoOverGen_E_600_1500
Definition: JetTester.h:136
MonitorElement * mMassRecoOverGen_E_40_200
Definition: JetTester.h:151
bool isValid() const
Definition: HandleBase.h:75
MonitorElement * mPtHat
Definition: JetTester.h:121
MonitorElement * chargedHadronEnergy
Definition: JetTester.h:229
virtual double mass() const final
mass
MonitorElement * mPtCorrOverReco_Pt_B
Definition: JetTester.h:92
MonitorElement * mPtRecoOverGen_GenPt_B
Definition: JetTester.h:179
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
MonitorElement * mMassRecoOverGen_B_20_40
Definition: JetTester.h:147
MonitorElement * mPtCorrOverReco_Eta_1500_3500
Definition: JetTester.h:99
MonitorElement * mJetArea
Definition: JetTester.h:82
MonitorElement * mMassRecoOverGen_B_750_1000
Definition: JetTester.h:159
MonitorElement * mMass
Definition: JetTester.h:80
MonitorElement * HFEMMultiplicity
Definition: JetTester.h:252
MonitorElement * chargedEmEnergy
Definition: JetTester.h:227
MonitorElement * mPtRecoOverGen_GenEta_40_200
Definition: JetTester.h:186
MonitorElement * mPtRecoOverGen_E_1500_3500
Definition: JetTester.h:139
MonitorElement * mMassRecoOverGen_B_1000_1500
Definition: JetTester.h:162
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * mMassRecoOverGen_E_200_500
Definition: JetTester.h:154
MonitorElement * mPtRecoOverGen_F_600_1500
Definition: JetTester.h:137
MonitorElement * mMassRecoOverGen_E_5000
Definition: JetTester.h:171
MonitorElement * chargedMuEnergyFraction
Definition: JetTester.h:254
MonitorElement * electronEnergy
Definition: JetTester.h:239
MonitorElement * emEnergyInEE
Definition: JetTester.h:218
tuple recoJets
Definition: RecoJets_cff.py:56
MonitorElement * mPtCorrOverGen_GenEta_20_40
Definition: JetTester.h:106
double mRecoJetPtThreshold
Definition: JetTester.h:265
MonitorElement * mPtCorrOverGen_GenEta_1500_3500
Definition: JetTester.h:110
MonitorElement * mGenPhi
Definition: JetTester.h:117
MonitorElement * maxEInHadTowers
Definition: JetTester.h:210
MonitorElement * mCorrJetEta_Pt40
Definition: JetTester.h:89
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * emEnergyInEB
Definition: JetTester.h:217
MonitorElement * mMassRecoOverGen_E_1000_1500
Definition: JetTester.h:163
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
Definition: JetTester.h:65
MonitorElement * mConstituents
Definition: JetTester.h:81
MonitorElement * maxEInEmTowers
Definition: JetTester.h:209
MonitorElement * mPtRecoOverGen_F_20_40
Definition: JetTester.h:128
MonitorElement * mGenPhiFirst
Definition: JetTester.h:120
MonitorElement * mCorrJetPt
Definition: JetTester.h:86
MonitorElement * mMassRecoOverGen_E_3500_5000
Definition: JetTester.h:169
MonitorElement * mPtCorrOverGen_GenPt_E
Definition: JetTester.h:104
MonitorElement * mPtRecoOverGen_GenEta_600_1500
Definition: JetTester.h:188
static int position[264][3]
Definition: ReadPGInfo.cc:509
MonitorElement * mPtRecoOverGen_GenEta_200_600
Definition: JetTester.h:187
MonitorElement * mMassRecoOverGen_F_200_500
Definition: JetTester.h:155
MonitorElement * mPtCorrOverReco_Eta_20_40
Definition: JetTester.h:95
MonitorElement * chargedEmEnergyFraction
Definition: JetTester.h:233
MonitorElement * mPtCorrOverReco_Pt_F
Definition: JetTester.h:94
MonitorElement * muonMultiplicity
Definition: JetTester.h:225
MonitorElement * neutralHadronEnergyFraction
Definition: JetTester.h:232
virtual double eta() const final
momentum pseudorapidity
double mRThreshold
Definition: JetTester.h:267
MonitorElement * neutralEmEnergy
Definition: JetTester.h:228
MonitorElement * chargedHadronMultiplicity
Definition: JetTester.h:247
MonitorElement * mPtRecoOverGen_B_3500_5000
Definition: JetTester.h:141
std::string JetType
Definition: JetTester.h:60
MonitorElement * mPtRecoOverGen_GenEta_1500_3500
Definition: JetTester.h:189
MonitorElement * mNJets1
Definition: JetTester.h:205
MonitorElement * mPtCorrOverGen_GenEta_600_1500
Definition: JetTester.h:109
MonitorElement * chargedMultiplicity
Definition: JetTester.h:226
MonitorElement * partonFlavor
Definition: JetTester.h:261
tuple pfJets
Definition: pfJets_cff.py:8
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: JetTester.cc:492
MonitorElement * HFEMEnergy
Definition: JetTester.h:245
MonitorElement * mMassRecoOverGen_E_20_40
Definition: JetTester.h:148
MonitorElement * mCorrJetPhi_Pt40
Definition: JetTester.h:90
MonitorElement * neutralHadronMultiplicity
Definition: JetTester.h:248
Definition: Run.h:43
MonitorElement * neutralEmEnergyFraction
Definition: JetTester.h:234
MonitorElement * mPtRecoOverGen_GenEta_5000_6500
Definition: JetTester.h:191
virtual double pt() const final
transverse momentum
MonitorElement * mPtCorrOverGen_GenEta_5000_6500
Definition: JetTester.h:112