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  mInputGenCollection (iConfig.getParameter<edm::InputTag> ("srcGen")),
15 // rhoTag (iConfig.getParameter<edm::InputTag> ("srcRho")),
16  mOutputFile (iConfig.getUntrackedParameter<std::string>("OutputFile","")),
17  JetType (iConfig.getUntrackedParameter<std::string>("JetType")),
18  mRecoJetPtThreshold (iConfig.getParameter<double> ("recoJetPtThreshold")),
19  mMatchGenPtThreshold (iConfig.getParameter<double> ("matchGenPtThreshold")),
20  mGenEnergyFractionThreshold (iConfig.getParameter<double> ("genEnergyFractionThreshold")),
21  mRThreshold (iConfig.getParameter<double> ("RThreshold")),
22  JetCorrectionService (iConfig.getParameter<std::string> ("JetCorrections"))
23 {
24  std::string inputCollectionLabel(mInputCollection.label());
25 
26  isCaloJet = (std::string("calo")==JetType);
27  isPFJet = (std::string("pf") ==JetType);
28 
29  //consumes
30  pvToken_ = consumes<std::vector<reco::Vertex> >(edm::InputTag("offlinePrimaryVertices"));
31  caloTowersToken_ = consumes<CaloTowerCollection>(edm::InputTag("towerMaker"));
32  if (isCaloJet) caloJetsToken_ = consumes<reco::CaloJetCollection>(mInputCollection);
33  if (isPFJet) pfJetsToken_ = consumes<reco::PFJetCollection>(mInputCollection);
34  genJetsToken_ = consumes<reco::GenJetCollection>(edm::InputTag(mInputGenCollection));
35  evtToken_ = consumes<edm::HepMCProduct>(edm::InputTag("generator"));
36 
37 
38  // Events variables
39  mNvtx = 0;
40 
41  // Jet parameters
42  mEta = 0;
43  mPhi = 0;
44  mEnergy = 0;
45  mP = 0;
46  mPt = 0;
47  mMass = 0;
48  mConstituents = 0;
49  mHadTiming = 0;
50  mEmTiming = 0;
51  mJetArea = 0;
52 // mRho = 0;
53 
54  // Corrected jets
55  mCorrJetPt = 0;
56  mCorrJetEta = 0;
57  mCorrJetPhi = 0;
58  mCorrJetEta_Pt40 = 0;
59  mCorrJetPhi_Pt40 = 0;
60 
61  // Corrected jets profiles
78 
79  // Generation
80  mGenEta = 0;
81  mGenPhi = 0;
82  mGenPt = 0;
83  mGenEtaFirst = 0;
84  mGenPhiFirst = 0;
85  mPtHat = 0;
86  mDeltaEta = 0;
87  mDeltaPhi = 0;
88  mDeltaPt = 0;
89 
105 
106  // Generation profiles
118 
119  // Some jet algebra
120  mEtaFirst = 0;
121  mPhiFirst = 0;
122  mPtFirst = 0;
123  mMjj = 0;
124  mNJetsEta_B_20_40 = 0;
125  mNJetsEta_E_20_40 = 0;
126  mNJetsEta_B_40 = 0;
127  mNJetsEta_E_40 = 0;
128  mNJets1 = 0;
129  mNJets2 = 0;
130 
131 // // PFJet specific
132 // mHadEnergyInHF = 0;
133 // mEmEnergyInHF = 0;
134 // mChargedEmEnergy = 0;
135 // mChargedHadronEnergy = 0;
136 // mNeutralEmEnergy = 0;
137 // mNeutralHadronEnergy = 0;
138 
139  // ---- Calo Jet specific information ----
141  maxEInEmTowers = 0;
143  maxEInHadTowers = 0;
147  emEnergyFraction = 0;
149  hadEnergyInHB = 0;
151  hadEnergyInHO = 0;
153  hadEnergyInHE = 0;
155  hadEnergyInHF = 0;
157  emEnergyInEB = 0;
159  emEnergyInEE = 0;
161  emEnergyInHF = 0;
163  towersArea = 0;
165  n90 = 0;
167  n60 = 0;
168 
169  // ---- JPT Jet specific information ----
171 // elecMultiplicity = 0;
172 
173  // ---- JPT or PF Jet specific information ----
175  muonMultiplicity = 0;
179  chargedEmEnergy = 0;
181  neutralEmEnergy = 0;
194 
195  // ---- PF Jet specific information ----
197  photonEnergy = 0;
201  electronEnergy = 0;
205  muonEnergy = 0;
207  muonEnergyFraction = 0;
209  HFHadronEnergy = 0;
213  HFEMEnergy = 0;
215  HFEMEnergyFraction = 0;
221  photonMultiplicity = 0;
227  HFEMMultiplicity = 0;
229  chargedMuEnergy = 0;
234 
235 }
236 
238  edm::Run const & iRun,
239  edm::EventSetup const & ) {
240 
241  ibooker.setCurrentFolder("JetMET/JetValidation/"+mInputCollection.label());
242 
243  double log10PtMin = 0.50;
244  double log10PtMax = 3.75;
245  int log10PtBins = 26;
246 
247  double etaRange[91] = {-6.0, -5.8, -5.6, -5.4, -5.2, -5.0, -4.8, -4.6, -4.4, -4.2,
248  -4.0, -3.8, -3.6, -3.4, -3.2, -3.0, -2.9, -2.8, -2.7, -2.6,
249  -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6,
250  -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6,
251  -0.5, -0.4, -0.3, -0.2, -0.1,
252  0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
253  1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
254  2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
255  3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8,
256  5.0, 5.2, 5.4, 5.6, 5.8, 6.0};
257 
258  // Event variables
259  mNvtx = ibooker.book1D("Nvtx", "number of vertices", 60, 0, 60);
260 
261  // Jet parameters
262  mEta = ibooker.book1D("Eta", "Eta", 120, -6, 6);
263  mPhi = ibooker.book1D("Phi", "Phi", 70, -3.5, 3.5);
264  mPt = ibooker.book1D("Pt", "Pt", 100, 0, 1000);
265  mP = ibooker.book1D("P", "P", 100, 0, 1000);
266  mEnergy = ibooker.book1D("Energy", "Energy", 100, 0, 1000);
267  mMass = ibooker.book1D("Mass", "Mass", 100, 0, 200);
268  mConstituents = ibooker.book1D("Constituents", "Constituents", 100, 0, 100);
269  mHadTiming = ibooker.book1D("HadTiming", "HadTiming", 75, -50, 100);
270  mEmTiming = ibooker.book1D("EmTiming", "EmTiming", 75, -50, 100);
271  mJetArea = ibooker.book1D("JetArea", "JetArea", 100, 0, 4);
272 
273  // Corrected jets
274  if (!JetCorrectionService.empty()) {
275  mCorrJetPt = ibooker.book1D("CorrJetPt", "CorrJetPt", 150, 0, 1500);
276  mCorrJetEta = ibooker.book1D("CorrJetEta", "CorrJetEta Pt>20", 60, -6, 6);
277  mCorrJetPhi = ibooker.book1D("CorrJetPhi", "CorrJetPhi Pt>20", 70, -3.5, 3.5);
278  mCorrJetEta_Pt40 = ibooker.book1D("CorrJetEta_Pt40", "CorrJetEta Pt>40", 60, -6, 6);
279  mCorrJetPhi_Pt40 = ibooker.book1D("CorrJetPhi_Pt40", "CorrJetPhi Pt>40", 70, -3.5, 3.5);
280 
281  // Corrected jets profiles
282  mPtCorrOverReco_Pt_B = ibooker.bookProfile("PtCorrOverReco_Pt_B", "0<|eta|<1.5", log10PtBins, log10PtMin, log10PtMax, 0, 5, " ");
283  mPtCorrOverReco_Pt_E = ibooker.bookProfile("PtCorrOverReco_Pt_E", "1.5<|eta|<3", log10PtBins, log10PtMin, log10PtMax, 0, 5, " ");
284  mPtCorrOverReco_Pt_F = ibooker.bookProfile("PtCorrOverReco_Pt_F", "3<|eta|<6", log10PtBins, log10PtMin, log10PtMax, 0, 5, " ");
285 
286  mPtCorrOverReco_Eta_20_40 = ibooker.bookProfile("PtCorrOverReco_Eta_20_40", "20<genPt<40", 90, etaRange, 0, 5, " ");
287  mPtCorrOverReco_Eta_40_200 = ibooker.bookProfile("PtCorrOverReco_Eta_40_200", "40<genPt<200", 90, etaRange, 0, 5, " ");
288  mPtCorrOverReco_Eta_200_600 = ibooker.bookProfile("PtCorrOverReco_Eta_200_600", "200<genPt<600", 90, etaRange, 0, 5, " ");
289  mPtCorrOverReco_Eta_600_1500 = ibooker.bookProfile("PtCorrOverReco_Eta_600_1500", "600<genPt<1500", 90, etaRange, 0, 5, " ");
290  mPtCorrOverReco_Eta_1500_3500 = ibooker.bookProfile("PtCorrOverReco_Eta_1500_3500", "1500<genPt<3500", 90, etaRange, 0, 5, " ");
291 
292  mPtCorrOverGen_GenPt_B = ibooker.bookProfile("PtCorrOverGen_GenPt_B", "0<|eta|<1.5", log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2, " ");
293  mPtCorrOverGen_GenPt_E = ibooker.bookProfile("PtCorrOverGen_GenPt_E", "1.5<|eta|<3", log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2, " ");
294  mPtCorrOverGen_GenPt_F = ibooker.bookProfile("PtCorrOverGen_GenPt_F", "3<|eta|<6", log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2, " ");
295 
296  mPtCorrOverGen_GenEta_20_40 = ibooker.bookProfile("PtCorrOverGen_GenEta_20_40", "20<genPt<40;#eta", 90, etaRange, 0.8, 1.2, " ");
297  mPtCorrOverGen_GenEta_40_200 = ibooker.bookProfile("PtCorrOverGen_GenEta_40_200", "40<genPt<200;#eta", 90, etaRange, 0.8, 1.2, " ");
298  mPtCorrOverGen_GenEta_200_600 = ibooker.bookProfile("PtCorrOverGen_GenEta_200_600", "200<genPt<600;#eta", 90, etaRange, 0.8, 1.2, " ");
299  mPtCorrOverGen_GenEta_600_1500 = ibooker.bookProfile("PtCorrOverGen_GenEta_600_1500", "600<genPt<1500;#eta", 90, etaRange, 0.8, 1.2, " ");
300  mPtCorrOverGen_GenEta_1500_3500 = ibooker.bookProfile("PtCorrOverGen_GenEta_1500_3500", "1500<genPt<3500;#eta", 90, etaRange, 0.8, 1.2, " ");
301  }
302 
303  mGenEta = ibooker.book1D("GenEta", "GenEta", 120, -6, 6);
304  mGenPhi = ibooker.book1D("GenPhi", "GenPhi", 70, -3.5, 3.5);
305  mGenPt = ibooker.book1D("GenPt", "GenPt", 100, 0, 1000);
306  mGenEtaFirst = ibooker.book1D("GenEtaFirst", "GenEtaFirst", 120, -6, 6);
307  mGenPhiFirst = ibooker.book1D("GenPhiFirst", "GenPhiFirst", 70, -3.5, 3.5);
308  mPtHat = ibooker.book1D("PtHat", "PtHat", 100, 0, 1000);
309  mDeltaEta = ibooker.book1D("DeltaEta", "DeltaEta", 100, -0.5, 0.5);
310  mDeltaPhi = ibooker.book1D("DeltaPhi", "DeltaPhi", 100, -0.5, 0.5);
311  mDeltaPt = ibooker.book1D("DeltaPt", "DeltaPt", 100, -1.0, 1.0);
312 
313  mPtRecoOverGen_B_20_40 = ibooker.book1D("PtRecoOverGen_B_20_40", "20<genpt<40", 50, 0, 2);
314  mPtRecoOverGen_E_20_40 = ibooker.book1D("PtRecoOverGen_E_20_40", "20<genpt<40", 50, 0, 2);
315  mPtRecoOverGen_F_20_40 = ibooker.book1D("PtRecoOverGen_F_20_40", "20<genpt<40", 50, 0, 2);
316  mPtRecoOverGen_B_40_200 = ibooker.book1D("PtRecoOverGen_B_40_200", "40<genpt<200", 50, 0, 2);
317  mPtRecoOverGen_E_40_200 = ibooker.book1D("PtRecoOverGen_E_40_200", "40<genpt<200", 50, 0, 2);
318  mPtRecoOverGen_F_40_200 = ibooker.book1D("PtRecoOverGen_F_40_200", "40<genpt<200", 50, 0, 2);
319  mPtRecoOverGen_B_200_600 = ibooker.book1D("PtRecoOverGen_B_200_600", "200<genpt<600", 50, 0, 2);
320  mPtRecoOverGen_E_200_600 = ibooker.book1D("PtRecoOverGen_E_200_600", "200<genpt<600", 50, 0, 2);
321  mPtRecoOverGen_F_200_600 = ibooker.book1D("PtRecoOverGen_F_200_600", "200<genpt<600", 50, 0, 2);
322  mPtRecoOverGen_B_600_1500 = ibooker.book1D("PtRecoOverGen_B_600_1500", "600<genpt<1500", 50, 0, 2);
323  mPtRecoOverGen_E_600_1500 = ibooker.book1D("PtRecoOverGen_E_600_1500", "600<genpt<1500", 50, 0, 2);
324  mPtRecoOverGen_F_600_1500 = ibooker.book1D("PtRecoOverGen_F_600_1500", "600<genpt<1500", 50, 0, 2);
325  mPtRecoOverGen_B_1500_3500 = ibooker.book1D("PtRecoOverGen_B_1500_3500", "1500<genpt<3500", 50, 0, 2);
326  mPtRecoOverGen_E_1500_3500 = ibooker.book1D("PtRecoOverGen_E_1500_3500", "1500<genpt<3500", 50, 0, 2);
327  mPtRecoOverGen_F_1500_3500 = ibooker.book1D("PtRecoOverGen_F_1500_3500", "1500<genpt<3500", 50, 0, 2);
328 
329  // Generation profiles
330  mPtRecoOverGen_GenPt_B = ibooker.bookProfile("PtRecoOverGen_GenPt_B", "0<|eta|<1.5", log10PtBins, log10PtMin, log10PtMax, 0, 2, " ");
331  mPtRecoOverGen_GenPt_E = ibooker.bookProfile("PtRecoOverGen_GenPt_E", "1.5<|eta|<3", log10PtBins, log10PtMin, log10PtMax, 0, 2, " ");
332  mPtRecoOverGen_GenPt_F = ibooker.bookProfile("PtRecoOverGen_GenPt_F", "3<|eta|<6", log10PtBins, log10PtMin, log10PtMax, 0, 2, " ");
333  mPtRecoOverGen_GenPhi_B = ibooker.bookProfile("PtRecoOverGen_GenPhi_B", "0<|eta|<1.5", 70, -3.5, 3.5, 0, 2, " ");
334  mPtRecoOverGen_GenPhi_E = ibooker.bookProfile("PtRecoOverGen_GenPhi_E", "1.5<|eta|<3", 70, -3.5, 3.5, 0, 2, " ");
335  mPtRecoOverGen_GenPhi_F = ibooker.bookProfile("PtRecoOverGen_GenPhi_F", "3<|eta|<6", 70, -3.5, 3.5, 0, 2, " ");
336  mPtRecoOverGen_GenEta_20_40 = ibooker.bookProfile("PtRecoOverGen_GenEta_20_40", "20<genpt<40", 50, etaRange, 0, 2, " ");
337  mPtRecoOverGen_GenEta_40_200 = ibooker.bookProfile("PtRecoOverGen_GenEta_40_200", "40<genpt<200", 50, etaRange, 0, 2, " ");
338  mPtRecoOverGen_GenEta_200_600 = ibooker.bookProfile("PtRecoOverGen_GenEta_200_600", "200<genpt<600", 50, etaRange, 0, 2, " ");
339  mPtRecoOverGen_GenEta_600_1500 = ibooker.bookProfile("PtRecoOverGen_GenEta_600_1500", "600<genpt<1500", 50, etaRange, 0, 2, " ");
340  mPtRecoOverGen_GenEta_1500_3500 = ibooker.bookProfile("PtRecoOverGen_GenEta_1500_3500", "1500<genpt<3500", 50, etaRange, 0, 2, " ");
341 
342  // Some jet algebra
343  //------------------------------------------------------------------------
344  mEtaFirst = ibooker.book1D("EtaFirst", "EtaFirst", 120, -6, 6);
345  mPhiFirst = ibooker.book1D("PhiFirst", "PhiFirst", 70, -3.5, 3.5);
346  mPtFirst = ibooker.book1D("PtFirst", "PtFirst", 50, 0, 1000);
347  mMjj = ibooker.book1D("Mjj", "Mjj", 100, 0, 2000);
348  mNJetsEta_B_20_40 = ibooker.book1D("NJetsEta_B_20_40", "NJetsEta_B 20<Pt<40", 15, 0, 15);
349  mNJetsEta_E_20_40 = ibooker.book1D("NJetsEta_E_20_40", "NJetsEta_E 20<Pt<40", 15, 0, 15);
350  mNJetsEta_B_40 = ibooker.book1D("NJetsEta_B", "NJetsEta_B 40<Pt", 15, 0, 15);
351  mNJetsEta_E_40 = ibooker.book1D("NJetsEta_E", "NJetsEta_E 40<Pt", 15, 0, 15);
352  mNJets_40 = ibooker.book1D("NJets", "NJets 40>Pt", 15, 0, 15);
353  mNJets1 = ibooker.bookProfile("NJets1", "Number of jets above Pt threshold", 100, 0, 200, 100, 0, 50, "s");
354  mNJets2 = ibooker.bookProfile("NJets2", "Number of jets above Pt threshold", 100, 0, 4000, 100, 0, 50, "s");
355 
356 
357  if (isCaloJet) {
358  maxEInEmTowers = ibooker.book1D("maxEInEmTowers", "maxEInEmTowers", 50,0,500);
359  maxEInHadTowers = ibooker.book1D("maxEInHadTowers", "maxEInHadTowers", 50,0,500);
360  energyFractionHadronic = ibooker.book1D("energyFractionHadronic", "energyFractionHadronic", 50,0,1);
361  emEnergyFraction = ibooker.book1D("emEnergyFraction", "emEnergyFraction", 50,0,1);
362  hadEnergyInHB = ibooker.book1D("hadEnergyInHB", "hadEnergyInHB", 50,0,500);
363  hadEnergyInHO = ibooker.book1D("hadEnergyInHO", "hadEnergyInHO", 50,0,500);
364  hadEnergyInHE = ibooker.book1D("hadEnergyInHE", "hadEnergyInHE", 50,0,500);
365  hadEnergyInHF = ibooker.book1D("hadEnergyInHF", "hadEnergyInHF", 50,0,500);
366  emEnergyInEB = ibooker.book1D("emEnergyInEB", "emEnergyInEB", 50,0,500);
367  emEnergyInEE = ibooker.book1D("emEnergyInEE", "emEnergyInEE", 50,0,500);
368  emEnergyInHF = ibooker.book1D("emEnergyInHF", "emEnergyInHF", 50,0,500);
369  towersArea = ibooker.book1D("towersArea", "towersArea", 50,0,1);
370  n90 = ibooker.book1D("n90", "n90", 30,0,30);
371  n60 = ibooker.book1D("n60", "n60", 30,0,30);
372  }
373 
374  if (isPFJet) {
375  muonMultiplicity = ibooker.book1D("muonMultiplicity", "muonMultiplicity", 10,0,10);
376  chargedMultiplicity = ibooker.book1D("chargedMultiplicity", "chargedMultiplicity", 100,0,100);
377  chargedEmEnergy = ibooker.book1D("chargedEmEnergy", "chargedEmEnergy", 100,0,500);
378  neutralEmEnergy = ibooker.book1D("neutralEmEnergy", "neutralEmEnergy", 100,0,500);
379  chargedHadronEnergy = ibooker.book1D("chargedHadronEnergy", "chargedHadronEnergy", 100,0,500);
380  neutralHadronEnergy = ibooker.book1D("neutralHadronEnergy", "neutralHadronEnergy", 100,0,500);
381  chargedHadronEnergyFraction = ibooker.book1D("chargedHadronEnergyFraction", "chargedHadronEnergyFraction", 50,0,1);
382  neutralHadronEnergyFraction = ibooker.book1D("neutralHadronEnergyFraction", "neutralHadronEnergyFraction", 50,0,1);
383  chargedEmEnergyFraction = ibooker.book1D("chargedEmEnergyFraction", "chargedEmEnergyFraction", 50,0,1);
384  neutralEmEnergyFraction = ibooker.book1D("neutralEmEnergyFraction", "neutralEmEnergyFraction", 50,0,1);
385  photonEnergy = ibooker.book1D("photonEnergy", "photonEnergy", 50,0,500);
386  photonEnergyFraction = ibooker.book1D("photonEnergyFraction", "photonEnergyFraction", 50,0,1);
387  electronEnergy = ibooker.book1D("electronEnergy", "electronEnergy", 50,0,500);
388  electronEnergyFraction = ibooker.book1D("electronEnergyFraction", "electronEnergyFraction", 50,0,1);
389  muonEnergy = ibooker.book1D("muonEnergy", "muonEnergy", 50,0,500);
390  muonEnergyFraction = ibooker.book1D("muonEnergyFraction", "muonEnergyFraction", 50,0,1);
391  HFHadronEnergy = ibooker.book1D("HFHadronEnergy", "HFHadronEnergy", 50,0,500);
392  HFHadronEnergyFraction = ibooker.book1D("HFHadronEnergyFraction", "HFHadronEnergyFraction", 50,0,1);
393  HFEMEnergy = ibooker.book1D("HFEMEnergy", "HFEMEnergy", 50,0,500);
394  HFEMEnergyFraction = ibooker.book1D("HFEMEnergyFraction", "HFEMEnergyFraction", 50,0,1);
395  chargedHadronMultiplicity = ibooker.book1D("chargedHadronMultiplicity", "chargedHadronMultiplicity", 50,0,50);
396  neutralHadronMultiplicity = ibooker.book1D("neutralHadronMultiplicity", "neutralHadronMultiplicity", 50,0,50);
397  photonMultiplicity = ibooker.book1D("photonMultiplicity", "photonMultiplicity", 10,0,10);
398  electronMultiplicity = ibooker.book1D("electronMultiplicity", "electronMultiplicity", 10,0,10);
399  HFHadronMultiplicity = ibooker.book1D("HFHadronMultiplicity", "HFHadronMultiplicity", 50,0,50);
400  HFEMMultiplicity = ibooker.book1D("HFEMMultiplicity", "HFEMMultiplicity", 50,0,50);
401  chargedMuEnergy = ibooker.book1D("chargedMuEnergy", "chargedMuEnergy", 50,0,500);
402  chargedMuEnergyFraction = ibooker.book1D("chargedMuEnergyFraction", "chargedMuEnergyFraction", 50,0,1);
403  neutralMultiplicity = ibooker.book1D("neutralMultiplicity", "neutralMultiplicity", 50,0,50);
404  }
405 
406  if (mOutputFile.empty ())
407  {
408  LogInfo("OutputInfo") << " Histograms will NOT be saved";
409  }
410  else
411  {
412  LogInfo("OutputInfo") << " Histograms will be saved to file:" << mOutputFile;
413  }
414 }
415 
416 
417 //------------------------------------------------------------------------------
418 // ~JetTester
419 //------------------------------------------------------------------------------
421 
422 
423 //------------------------------------------------------------------------------
424 // analyze
425 //------------------------------------------------------------------------------
426 void JetTester::analyze(const edm::Event& mEvent, const edm::EventSetup& mSetup)
427 {
428  // Get the primary vertices
429  //----------------------------------------------------------------------------
431  mEvent.getByToken(pvToken_, pvHandle);
432 
433  int nGoodVertices = 0;
434 
435  if (pvHandle.isValid())
436  {
437  for (unsigned i=0; i<pvHandle->size(); i++)
438  {
439  if ((*pvHandle)[i].ndof() > 4 &&
440  (fabs((*pvHandle)[i].z()) <= 24) &&
441  (fabs((*pvHandle)[i].position().rho()) <= 2))
442  nGoodVertices++;
443  }
444  }
445 
446  mNvtx->Fill(nGoodVertices);
447 
448 
449  // Get the CaloTower collection
450  //----------------------------------------------------------------------------
452  mEvent.getByToken(caloTowersToken_, caloTowers);
453 
454  if (caloTowers.isValid())
455  {
456  for (CaloTowerCollection::const_iterator cal=caloTowers->begin();
457  cal!=caloTowers->end(); ++cal)
458  {
459  mHadTiming->Fill(cal->hcalTime());
460  mEmTiming ->Fill(cal->ecalTime());
461  }
462  }
463 
464 
465 // // Get the jet rho
466 // //----------------------------------------------------------------------------
467 // edm::Handle<double> pRho;
468 // mEvent.getByToken(rhoTag, pRho);
469 //
470 // if (pRho.isValid())
471 // {
472 // double jetRho = *pRho;
473 //
474 // if (mRho) mRho->Fill(jetRho);
475 // }
476 
477 
478  // Get the Jet collection
479  //----------------------------------------------------------------------------
480  math::XYZTLorentzVector p4tmp[2];
481 
482  std::vector<Jet> recoJets;
483  recoJets.clear();
484 
487 // edm::Handle<JPTJetCollection> jptJets;
488 
489  if (isCaloJet) mEvent.getByToken(caloJetsToken_, caloJets);
490  if (isPFJet) mEvent.getByToken(pfJetsToken_, pfJets);
491 // if (isJPTJet) mEvent.getByToken(jptJetsToken_, jptJets);
492 
493  if (isCaloJet && !caloJets.isValid()) return;
494  if (isPFJet && !pfJets.isValid()) return;
495 // if (isJPTJet && !jptJets.isValid()) return;
496 
497 
498  if (isCaloJet)
499  {
500  for (unsigned ijet=0; ijet<caloJets->size(); ijet++)
501  recoJets.push_back((*caloJets)[ijet]);
502  }
503 
504 /* if (isJPTJet)
505  {
506  for (unsigned ijet=0; ijet<jptJets->size(); ijet++)
507  recoJets.push_back((*jptJets)[ijet]);
508  }*/
509 
510  if (isPFJet) {
511  for (unsigned ijet=0; ijet<pfJets->size(); ijet++)
512  recoJets.push_back((*pfJets)[ijet]);
513  }
514 
515  int nJet = 0;
516  int nJet_E_20_40 = 0;
517  int nJet_B_20_40 = 0;
518  int nJet_E_40 = 0;
519  int nJet_B_40 = 0;
520  int nJet_40 = 0;
521 
522  for (unsigned ijet=0; ijet<recoJets.size(); ijet++) {
523  if ( (recoJets[ijet].pt() > 20.) and (recoJets[ijet].pt() < mRecoJetPtThreshold)) {
524  if (fabs(recoJets[ijet].eta()) > 1.5)
525  nJet_E_20_40++;
526  else
527  nJet_B_20_40++;
528  }
529  if (recoJets[ijet].pt() > mRecoJetPtThreshold) {
530  //counting forward and barrel jets
531  if (fabs(recoJets[ijet].eta()) > 1.5)
532  nJet_E_40++;
533  else
534  nJet_B_40++;
535  nJet_40++;
536 
537  if (mEta) mEta->Fill(recoJets[ijet].eta());
538 
539  if (mJetArea) mJetArea ->Fill(recoJets[ijet].jetArea());
540  if (mPhi) mPhi ->Fill(recoJets[ijet].phi());
541  if (mEnergy) mEnergy ->Fill(recoJets[ijet].energy());
542  if (mP) mP ->Fill(recoJets[ijet].p());
543  if (mPt) mPt ->Fill(recoJets[ijet].pt());
544  if (mMass) mMass ->Fill(recoJets[ijet].mass());
545  if (mConstituents) mConstituents->Fill(recoJets[ijet].nConstituents());
546 
547  if (ijet == 0) {
548  if (mEtaFirst) mEtaFirst->Fill(recoJets[ijet].eta());
549  if (mPhiFirst) mPhiFirst->Fill(recoJets[ijet].phi());
550  if (mPtFirst) mPtFirst ->Fill(recoJets[ijet].pt());
551  }
552 
553  if (ijet == 0) {nJet++; p4tmp[0] = recoJets[ijet].p4();}
554  if (ijet == 1) {nJet++; p4tmp[1] = recoJets[ijet].p4();}
555 
556  // if (isPFJet || isCaloJet) {
557  // if (mHadEnergyInHF) mHadEnergyInHF ->Fill((*pfJets)[ijet].HFHadronEnergy());
558  // if (mEmEnergyInHF) mEmEnergyInHF ->Fill((*pfJets)[ijet].HFEMEnergy());
559  // if (mChargedEmEnergy) mChargedEmEnergy ->Fill((*pfJets)[ijet].chargedEmEnergy());
560  // if (mChargedHadronEnergy) mChargedHadronEnergy->Fill((*pfJets)[ijet].chargedHadronEnergy());
561  // if (mNeutralEmEnergy) mNeutralEmEnergy ->Fill((*pfJets)[ijet].neutralEmEnergy());
562  // if (mNeutralHadronEnergy) mNeutralHadronEnergy->Fill((*pfJets)[ijet].neutralHadronEnergy());
563  // }
564 
565 
566  // ---- Calo Jet specific information ----
567  if (isCaloJet) {
568  maxEInEmTowers ->Fill((*caloJets)[ijet].maxEInEmTowers());
569  maxEInHadTowers ->Fill((*caloJets)[ijet].maxEInHadTowers());
570  energyFractionHadronic ->Fill((*caloJets)[ijet].energyFractionHadronic());
571  emEnergyFraction ->Fill((*caloJets)[ijet].emEnergyFraction());
572  hadEnergyInHB ->Fill((*caloJets)[ijet].hadEnergyInHB());
573  hadEnergyInHO ->Fill((*caloJets)[ijet].hadEnergyInHO());
574  hadEnergyInHE ->Fill((*caloJets)[ijet].hadEnergyInHE());
575  hadEnergyInHF ->Fill((*caloJets)[ijet].hadEnergyInHF());
576  emEnergyInEB ->Fill((*caloJets)[ijet].emEnergyInEB());
577  emEnergyInEE ->Fill((*caloJets)[ijet].emEnergyInEE());
578  emEnergyInHF ->Fill((*caloJets)[ijet].emEnergyInHF());
579  towersArea ->Fill((*caloJets)[ijet].towersArea());
580  n90 ->Fill((*caloJets)[ijet].n90());
581  n60 ->Fill((*caloJets)[ijet].n60());
582  }
583  // ---- PF Jet specific information ----
584  if (isPFJet) {
585  muonMultiplicity ->Fill((*pfJets)[ijet].muonMultiplicity());
586  chargedMultiplicity ->Fill((*pfJets)[ijet].chargedMultiplicity());
587  chargedEmEnergy ->Fill((*pfJets)[ijet].chargedEmEnergy());
588  neutralEmEnergy ->Fill((*pfJets)[ijet].neutralEmEnergy());
589  chargedHadronEnergy ->Fill((*pfJets)[ijet].chargedHadronEnergy());
590  neutralHadronEnergy ->Fill((*pfJets)[ijet].neutralHadronEnergy());
595  photonEnergy ->Fill((*pfJets)[ijet].photonEnergy());
596  photonEnergyFraction ->Fill((*pfJets)[ijet].photonEnergyFraction());
597  electronEnergy ->Fill((*pfJets)[ijet].electronEnergy());
599  muonEnergy ->Fill((*pfJets)[ijet].muonEnergy());
600  muonEnergyFraction ->Fill((*pfJets)[ijet].muonEnergyFraction());
601  HFHadronEnergy ->Fill((*pfJets)[ijet].HFHadronEnergy());
603  HFEMEnergy ->Fill((*pfJets)[ijet].HFEMEnergy());
604  HFEMEnergyFraction ->Fill((*pfJets)[ijet].HFEMEnergyFraction());
607  photonMultiplicity ->Fill((*pfJets)[ijet].photonMultiplicity());
608  electronMultiplicity ->Fill((*pfJets)[ijet].electronMultiplicity());
609  HFHadronMultiplicity ->Fill((*pfJets)[ijet].HFHadronMultiplicity());
610  HFEMMultiplicity ->Fill((*pfJets)[ijet].HFEMMultiplicity());
611  chargedMuEnergy ->Fill((*pfJets)[ijet].chargedMuEnergy());
613  neutralMultiplicity ->Fill((*pfJets)[ijet].neutralMultiplicity());
614  }
615  // ---- JPT Jet specific information ----
616  /* if (isJPTJet) {
617  elecMultiplicity ->Fill((*jptJets)[ijet].elecMultiplicity());
618  muonMultiplicity ->Fill((*jptJets)[ijet].muonMultiplicity());
619  chargedMultiplicity ->Fill((*jptJets)[ijet].chargedMultiplicity());
620  chargedEmEnergy ->Fill((*jptJets)[ijet].chargedEmEnergy());
621  neutralEmEnergy ->Fill((*jptJets)[ijet].neutralEmEnergy());
622  chargedHadronEnergy ->Fill((*jptJets)[ijet].chargedHadronEnergy());
623  neutralHadronEnergy ->Fill((*jptJets)[ijet].neutralHadronEnergy());
624  chargedHadronEnergyFraction ->Fill((*jptJets)[ijet].chargedHadronEnergyFraction());
625  neutralHadronEnergyFraction ->Fill((*jptJets)[ijet].neutralHadronEnergyFraction());
626  chargedEmEnergyFraction ->Fill((*jptJets)[ijet].chargedEmEnergyFraction());
627  neutralEmEnergyFraction ->Fill((*jptJets)[ijet].neutralEmEnergyFraction());
628  }*/
629  }
630  }
631 
632  if (mNJetsEta_B_20_40) mNJetsEta_B_20_40->Fill(nJet_B_20_40);
633  if (mNJetsEta_E_20_40) mNJetsEta_E_20_40->Fill(nJet_E_20_40);
634  if (mNJetsEta_B_40) mNJetsEta_B_40->Fill(nJet_B_40);
635  if (mNJetsEta_E_40) mNJetsEta_E_40->Fill(nJet_E_40);
636  if (mNJets_40) mNJets_40->Fill(nJet_40);
637  if (nJet >= 2)
638  {
639  if (mMjj) mMjj->Fill((p4tmp[0]+p4tmp[1]).mass());
640  }
641 
642 
643  // Count jets above pt cut
644  //----------------------------------------------------------------------------
645  for (int istep=0; istep<100; ++istep)
646  {
647  int njets1 = 0;
648  int njets2 = 0;
649 
650  float ptStep1 = (istep * ( 200. / 100.));
651  float ptStep2 = (istep * (4000. / 100.));
652 
653  for (unsigned ijet=0; ijet<recoJets.size(); ijet++) {
654  if (recoJets[ijet].pt() > ptStep1) njets1++;
655  if (recoJets[ijet].pt() > ptStep2) njets2++;
656  }
657  mNJets1->Fill(ptStep1, njets1);
658  mNJets2->Fill(ptStep2, njets2);
659  }
660 
661 
662  // Corrected jets
663  //----------------------------------------------------------------------------
664  double scale = -999;
665 
666  if (!JetCorrectionService.empty())
667  {
669  for (unsigned ijet=0; ijet<recoJets.size(); ijet++) {
670  Jet correctedJet = recoJets[ijet];
671 
672  if (isCaloJet) scale = corrector->correction((*caloJets)[ijet], mEvent, mSetup);
673  if (isPFJet) scale = corrector->correction((*pfJets)[ijet], mEvent, mSetup);
674  //if (isJPTJet) scale = corrector->correction((*jptJets)[ijet], mEvent, mSetup);
675 
676  correctedJet.scaleEnergy(scale);
677 
678  if (correctedJet.pt() < 20) continue;
679 
680  mCorrJetEta->Fill(correctedJet.eta());
681  mCorrJetPhi->Fill(correctedJet.phi());
682  mCorrJetPt ->Fill(correctedJet.pt());
683  if (correctedJet.pt() >= 40) {
684  mCorrJetEta_Pt40->Fill(correctedJet.eta());
685  mCorrJetPhi_Pt40->Fill(correctedJet.phi());
686  }
687 
688  double ijetEta = recoJets[ijet].eta();
689  double ijetPt = recoJets[ijet].pt();
690  double ratio = correctedJet.pt() / ijetPt;
691 
692  if (fabs(ijetEta) < 1.5) mPtCorrOverReco_Pt_B->Fill(log10(ijetPt), ratio);
693  else if (fabs(ijetEta) < 3.0) mPtCorrOverReco_Pt_E->Fill(log10(ijetPt), ratio);
694  else if (fabs(ijetEta) < 6.0) mPtCorrOverReco_Pt_F->Fill(log10(ijetPt), ratio);
695 
696  if (ijetPt < 40) mPtCorrOverReco_Eta_20_40 ->Fill(ijetEta, ratio);
697  else if (ijetPt < 200) mPtCorrOverReco_Eta_40_200 ->Fill(ijetEta, ratio);
698  else if (ijetPt < 600) mPtCorrOverReco_Eta_200_600 ->Fill(ijetEta, ratio);
699  else if (ijetPt < 1500) mPtCorrOverReco_Eta_600_1500 ->Fill(ijetEta, ratio);
700  else if (ijetPt < 3500) mPtCorrOverReco_Eta_1500_3500->Fill(ijetEta, ratio);
701  }
702  }
703 
704 
705  //----------------------------------------------------------------------------
706  //
707  // Generation
708  //
709  //----------------------------------------------------------------------------
710  if (!mEvent.isRealData())
711  {
712  // Get ptHat
713  //------------------------------------------------------------------------
715  mEvent.getByToken(evtToken_, evt);
716 
717  if (evt.isValid()) {
718  HepMC::GenEvent* myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
719  double ptHat = myGenEvent->event_scale();
720  if (mPtHat) mPtHat->Fill(ptHat);
721  delete myGenEvent;
722  }
723  // Gen jets
724  //------------------------------------------------------------------------
726  mEvent.getByToken(genJetsToken_, genJets);
727 
728  if (!genJets.isValid()) return;
729 
730  for (GenJetCollection::const_iterator gjet=genJets->begin(); gjet!=genJets->end(); gjet++) {
731  if (mGenEta) mGenEta->Fill(gjet->eta());
732  if (mGenPhi) mGenPhi->Fill(gjet->phi());
733  if (mGenPt) mGenPt ->Fill(gjet->pt());
734  if (gjet == genJets->begin()) {
735  if (mGenEtaFirst) mGenEtaFirst->Fill(gjet->eta());
736  if (mGenPhiFirst) mGenPhiFirst->Fill(gjet->phi());
737  }
738  }
739 
740  if (!(mInputGenCollection.label().empty())) {
741  for (GenJetCollection::const_iterator gjet=genJets->begin(); gjet!=genJets->end(); gjet++) {
742  if (fabs(gjet->eta()) > 6.) continue; // Out of the detector
743  if (gjet->pt() < mMatchGenPtThreshold) continue;
744  if (recoJets.size() <= 0) continue;
745  // pt response
746  //------------------------------------------------------------
747  if (!JetCorrectionService.empty()) {
748  int iMatch = -1;
749  double CorrdeltaRBest = 999;
750  double CorrJetPtBest = 0;
751  for (unsigned ijet=0; ijet<recoJets.size(); ++ijet) {
752  Jet correctedJet = recoJets[ijet];
753  correctedJet.scaleEnergy(scale);
754  double CorrJetPt = correctedJet.pt();
755  if (CorrJetPt > 10) {
756  double CorrdR = deltaR(gjet->eta(), gjet->phi(), correctedJet.eta(), correctedJet.phi());
757  if (CorrdR < CorrdeltaRBest) {
758  CorrdeltaRBest = CorrdR;
759  CorrJetPtBest = CorrJetPt;
760  iMatch = ijet;
761  }
762  }
763  }
764  if (iMatch<0) continue;
765  fillMatchHists(gjet->eta(), gjet->phi(), gjet->pt(), recoJets[iMatch].eta(), recoJets[iMatch].phi(), recoJets[iMatch].pt());
766 
767  if (CorrdeltaRBest < mRThreshold) {
768  double response = CorrJetPtBest / gjet->pt();
769 
770  if (fabs(gjet->eta()) < 1.5) mPtCorrOverGen_GenPt_B->Fill(log10(gjet->pt()), response);
771  else if (fabs(gjet->eta()) < 3.0) mPtCorrOverGen_GenPt_E->Fill(log10(gjet->pt()), response);
772  else if (fabs(gjet->eta()) < 6.0) mPtCorrOverGen_GenPt_F->Fill(log10(gjet->pt()), response);
773 
774  if (gjet->pt() > 20) {
775  if (gjet->pt() < 40) mPtCorrOverGen_GenEta_20_40 ->Fill(gjet->eta(), response);
776  else if (gjet->pt() < 200) mPtCorrOverGen_GenEta_40_200 ->Fill(gjet->eta(), response);
777  else if (gjet->pt() < 600) mPtCorrOverGen_GenEta_200_600 ->Fill(gjet->eta(), response);
778  else if (gjet->pt() < 1500) mPtCorrOverGen_GenEta_600_1500 ->Fill(gjet->eta(), response);
779  else if (gjet->pt() < 3500) mPtCorrOverGen_GenEta_1500_3500->Fill(gjet->eta(), response);
780  }
781  }
782  }
783  }
784  }
785  }
786 }
787 
788 
789 //------------------------------------------------------------------------------
790 // fillMatchHists
791 //------------------------------------------------------------------------------
792 void JetTester::fillMatchHists(const double GenEta,
793  const double GenPhi,
794  const double GenPt,
795  const double RecoEta,
796  const double RecoPhi,
797  const double RecoPt)
798 {
799  if (GenPt > mMatchGenPtThreshold) {
800  mDeltaEta->Fill(GenEta - RecoEta);
801  mDeltaPhi->Fill(GenPhi - RecoPhi);
802  mDeltaPt ->Fill((GenPt - RecoPt) / GenPt);
803  }
804 
805  if (fabs(GenEta) < 1.5)
806  {
807  mPtRecoOverGen_GenPt_B ->Fill(log10(GenPt), RecoPt / GenPt);
808  mPtRecoOverGen_GenPhi_B->Fill(GenPhi, RecoPt / GenPt);
809 
810  if (GenPt > 20 && GenPt < 40) mPtRecoOverGen_B_20_40 ->Fill(RecoPt / GenPt);
811  else if (GenPt < 200) mPtRecoOverGen_B_40_200 ->Fill(RecoPt / GenPt);
812  else if (GenPt < 600) mPtRecoOverGen_B_200_600 ->Fill(RecoPt / GenPt);
813  else if (GenPt < 1500) mPtRecoOverGen_B_600_1500 ->Fill(RecoPt / GenPt);
814  else if (GenPt < 3500) mPtRecoOverGen_B_1500_3500->Fill(RecoPt / GenPt);
815  }
816  else if (fabs(GenEta) < 3.0)
817  {
818  mPtRecoOverGen_GenPt_E ->Fill(log10(GenPt), RecoPt / GenPt);
819  mPtRecoOverGen_GenPhi_E->Fill(GenPhi, RecoPt / GenPt);
820 
821  if (GenPt > 20 && GenPt < 40) mPtRecoOverGen_E_20_40 ->Fill(RecoPt / GenPt);
822  else if (GenPt < 200) mPtRecoOverGen_E_40_200 ->Fill(RecoPt / GenPt);
823  else if (GenPt < 600) mPtRecoOverGen_E_200_600 ->Fill(RecoPt / GenPt);
824  else if (GenPt < 1500) mPtRecoOverGen_E_600_1500 ->Fill(RecoPt / GenPt);
825  else if (GenPt < 3500) mPtRecoOverGen_E_1500_3500->Fill(RecoPt / GenPt);
826  }
827  else if (fabs(GenEta) < 6.0)
828  {
829  mPtRecoOverGen_GenPt_F ->Fill (log10(GenPt), RecoPt / GenPt);
830  mPtRecoOverGen_GenPhi_F->Fill (GenPhi, RecoPt / GenPt);
831 
832  if (GenPt > 20 && GenPt < 40) mPtRecoOverGen_F_20_40 ->Fill(RecoPt / GenPt);
833  else if (GenPt < 200) mPtRecoOverGen_F_40_200 ->Fill(RecoPt / GenPt);
834  else if (GenPt < 600) mPtRecoOverGen_F_200_600 ->Fill(RecoPt / GenPt);
835  else if (GenPt < 1500) mPtRecoOverGen_F_600_1500 ->Fill(RecoPt / GenPt);
836  else if (GenPt < 3500) mPtRecoOverGen_F_1500_3500->Fill(RecoPt / GenPt);
837  }
838 
839  if (GenPt > 20 && GenPt < 40) mPtRecoOverGen_GenEta_20_40 ->Fill(GenEta, RecoPt / GenPt);
840  else if (GenPt < 200) mPtRecoOverGen_GenEta_40_200 ->Fill(GenEta, RecoPt / GenPt);
841  else if (GenPt < 600) mPtRecoOverGen_GenEta_200_600 ->Fill(GenEta, RecoPt / GenPt);
842  else if (GenPt < 1500) mPtRecoOverGen_GenEta_600_1500 ->Fill(GenEta, RecoPt / GenPt);
843  else if (GenPt < 3500) mPtRecoOverGen_GenEta_1500_3500->Fill(GenEta, RecoPt / GenPt);
844 }
MonitorElement * mNJetsEta_B_40
Definition: JetTester.h:156
MonitorElement * mPtRecoOverGen_E_20_40
Definition: JetTester.h:121
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
Definition: JetTester.h:62
MonitorElement * mPtCorrOverGen_GenEta_40_200
Definition: JetTester.h:104
MonitorElement * mPtCorrOverReco_Pt_E
Definition: JetTester.h:93
MonitorElement * hadEnergyInHE
Definition: JetTester.h:169
MonitorElement * mNvtx
Definition: JetTester.h:70
MonitorElement * HFHadronEnergyFraction
Definition: JetTester.h:198
MonitorElement * mPtRecoOverGen_B_20_40
Definition: JetTester.h:120
MonitorElement * mPtCorrOverGen_GenPt_F
Definition: JetTester.h:102
MonitorElement * mPtRecoOverGen_F_40_200
Definition: JetTester.h:125
edm::EDGetTokenT< reco::GenJetCollection > genJetsToken_
Definition: JetTester.h:66
MonitorElement * neutralHadronEnergy
Definition: JetTester.h:184
MonitorElement * electronEnergyFraction
Definition: JetTester.h:194
MonitorElement * mPtRecoOverGen_B_200_600
Definition: JetTester.h:126
virtual float pt() const
transverse momentum
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: JetTester.cc:237
MonitorElement * HFEMEnergyFraction
Definition: JetTester.h:200
bool isPFJet
Definition: JetTester.h:217
MonitorElement * mPtRecoOverGen_GenPt_F
Definition: JetTester.h:139
MonitorElement * mMjj
Definition: JetTester.h:153
edm::InputTag mInputGenCollection
Definition: JetTester.h:57
MonitorElement * mPtFirst
Definition: JetTester.h:152
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:155
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< reco::CaloJetCollection > caloJetsToken_
Definition: JetTester.h:64
MonitorElement * photonEnergyFraction
Definition: JetTester.h:192
MonitorElement * neutralMultiplicity
Definition: JetTester.h:209
MonitorElement * mDeltaPhi
Definition: JetTester.h:117
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
virtual float phi() const
momentum azimuthal angle
Base class for all types of Jets.
Definition: Jet.h:20
bool isCaloJet
Definition: JetTester.h:216
Definition: DDAxes.h:10
MonitorElement * mPtRecoOverGen_GenPhi_E
Definition: JetTester.h:141
MonitorElement * mPtRecoOverGen_GenEta_20_40
Definition: JetTester.h:143
MonitorElement * hadEnergyInHB
Definition: JetTester.h:167
std::vector< CaloTower >::const_iterator const_iterator
MonitorElement * mPtCorrOverReco_Eta_40_200
Definition: JetTester.h:96
MonitorElement * photonMultiplicity
Definition: JetTester.h:203
MonitorElement * mCorrJetPhi
Definition: JetTester.h:88
MonitorElement * energyFractionHadronic
Definition: JetTester.h:165
double mMatchGenPtThreshold
Definition: JetTester.h:213
MonitorElement * mPtRecoOverGen_E_40_200
Definition: JetTester.h:124
virtual void scaleEnergy(double fScale)
scale energy of the jet
Definition: Jet.cc:444
MonitorElement * mNJets2
Definition: JetTester.h:160
MonitorElement * mPtCorrOverReco_Eta_200_600
Definition: JetTester.h:97
MonitorElement * muonEnergyFraction
Definition: JetTester.h:196
MonitorElement * n90
Definition: JetTester.h:175
MonitorElement * mPtRecoOverGen_GenPhi_B
Definition: JetTester.h:140
T eta() const
MonitorElement * mEtaFirst
Definition: JetTester.h:150
bool isRealData() const
Definition: EventBase.h:60
float float float z
MonitorElement * emEnergyFraction
Definition: JetTester.h:166
std::string JetCorrectionService
Definition: JetTester.h:220
MonitorElement * mCorrJetEta
Definition: JetTester.h:87
MonitorElement * photonEnergy
Definition: JetTester.h:191
MonitorElement * towersArea
Definition: JetTester.h:174
void Fill(long long x)
MonitorElement * hadEnergyInHF
Definition: JetTester.h:170
MonitorElement * HFHadronMultiplicity
Definition: JetTester.h:205
MonitorElement * mGenPt
Definition: JetTester.h:112
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
MonitorElement * muonEnergy
Definition: JetTester.h:195
MonitorElement * electronMultiplicity
Definition: JetTester.h:204
MonitorElement * mPtRecoOverGen_B_600_1500
Definition: JetTester.h:129
MonitorElement * mEnergy
Definition: JetTester.h:77
MonitorElement * mPtRecoOverGen_GenPt_E
Definition: JetTester.h:138
MonitorElement * mNJetsEta_E_40
Definition: JetTester.h:157
MonitorElement * mEta
Definition: JetTester.h:73
MonitorElement * mGenEtaFirst
Definition: JetTester.h:113
MonitorElement * mNJetsEta_B_20_40
Definition: JetTester.h:154
MonitorElement * chargedMuEnergy
Definition: JetTester.h:207
MonitorElement * mPtRecoOverGen_F_1500_3500
Definition: JetTester.h:134
MonitorElement * mDeltaEta
Definition: JetTester.h:116
MonitorElement * mNJets_40
Definition: JetTester.h:158
MonitorElement * HFHadronEnergy
Definition: JetTester.h:197
MonitorElement * mNJetsEta_E_20_40
Definition: JetTester.h:155
MonitorElement * mDeltaPt
Definition: JetTester.h:118
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * mPtRecoOverGen_B_40_200
Definition: JetTester.h:123
MonitorElement * mPtRecoOverGen_B_1500_3500
Definition: JetTester.h:132
MonitorElement * mPtRecoOverGen_F_200_600
Definition: JetTester.h:128
MonitorElement * mPhiFirst
Definition: JetTester.h:151
virtual float eta() const
momentum pseudorapidity
MonitorElement * mP
Definition: JetTester.h:76
void fillMatchHists(const double GenEta, const double GenPhi, const double GenPt, const double RecoEta, const double RecoPhi, const double RecoPt)
Definition: JetTester.cc:792
MonitorElement * mEmTiming
Definition: JetTester.h:81
MonitorElement * mPtCorrOverGen_GenPt_B
Definition: JetTester.h:100
MonitorElement * mPtCorrOverReco_Eta_600_1500
Definition: JetTester.h:98
MonitorElement * n60
Definition: JetTester.h:176
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:113
MonitorElement * mGenEta
Definition: JetTester.h:110
MonitorElement * hadEnergyInHO
Definition: JetTester.h:168
MonitorElement * mPhi
Definition: JetTester.h:74
MonitorElement * mPtCorrOverGen_GenEta_200_600
Definition: JetTester.h:105
MonitorElement * mPt
Definition: JetTester.h:75
edm::InputTag mInputCollection
Definition: JetTester.h:56
MonitorElement * emEnergyInHF
Definition: JetTester.h:173
MonitorElement * mPtRecoOverGen_E_200_600
Definition: JetTester.h:127
JetTester(const edm::ParameterSet &)
Definition: JetTester.cc:12
MonitorElement * mPtRecoOverGen_GenPhi_F
Definition: JetTester.h:142
MonitorElement * chargedHadronEnergyFraction
Definition: JetTester.h:185
MonitorElement * mPtRecoOverGen_E_600_1500
Definition: JetTester.h:130
bool isValid() const
Definition: HandleBase.h:76
MonitorElement * mPtHat
Definition: JetTester.h:115
MonitorElement * chargedHadronEnergy
Definition: JetTester.h:183
MonitorElement * mPtCorrOverReco_Pt_B
Definition: JetTester.h:92
edm::EDGetTokenT< CaloTowerCollection > caloTowersToken_
Definition: JetTester.h:63
MonitorElement * mPtRecoOverGen_GenPt_B
Definition: JetTester.h:137
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
MonitorElement * mPtCorrOverReco_Eta_1500_3500
Definition: JetTester.h:99
MonitorElement * mJetArea
Definition: JetTester.h:82
edm::EDGetTokenT< edm::HepMCProduct > evtToken_
Definition: JetTester.h:67
MonitorElement * mMass
Definition: JetTester.h:78
MonitorElement * HFEMMultiplicity
Definition: JetTester.h:206
MonitorElement * chargedEmEnergy
Definition: JetTester.h:181
MonitorElement * mPtRecoOverGen_GenEta_40_200
Definition: JetTester.h:144
MonitorElement * mPtRecoOverGen_E_1500_3500
Definition: JetTester.h:133
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * mPtRecoOverGen_F_600_1500
Definition: JetTester.h:131
std::string mOutputFile
Definition: JetTester.h:58
MonitorElement * chargedMuEnergyFraction
Definition: JetTester.h:208
MonitorElement * electronEnergy
Definition: JetTester.h:193
MonitorElement * emEnergyInEE
Definition: JetTester.h:172
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
Definition: JetCorrector.cc:50
tuple recoJets
Definition: RecoJets_cff.py:56
MonitorElement * mPtCorrOverGen_GenEta_20_40
Definition: JetTester.h:103
double mRecoJetPtThreshold
Definition: JetTester.h:212
MonitorElement * mPtCorrOverGen_GenEta_1500_3500
Definition: JetTester.h:107
MonitorElement * mGenPhi
Definition: JetTester.h:111
MonitorElement * maxEInHadTowers
Definition: JetTester.h:164
MonitorElement * mCorrJetEta_Pt40
Definition: JetTester.h:89
std::string const & label() const
Definition: InputTag.h:42
MonitorElement * emEnergyInEB
Definition: JetTester.h:171
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
Definition: JetTester.h:65
MonitorElement * mConstituents
Definition: JetTester.h:79
MonitorElement * maxEInEmTowers
Definition: JetTester.h:163
MonitorElement * mPtRecoOverGen_F_20_40
Definition: JetTester.h:122
MonitorElement * mGenPhiFirst
Definition: JetTester.h:114
MonitorElement * mCorrJetPt
Definition: JetTester.h:86
MonitorElement * mPtCorrOverGen_GenPt_E
Definition: JetTester.h:101
MonitorElement * mPtRecoOverGen_GenEta_600_1500
Definition: JetTester.h:146
static int position[264][3]
Definition: ReadPGInfo.cc:509
MonitorElement * mHadTiming
Definition: JetTester.h:80
MonitorElement * mPtRecoOverGen_GenEta_200_600
Definition: JetTester.h:145
MonitorElement * mPtCorrOverReco_Eta_20_40
Definition: JetTester.h:95
MonitorElement * chargedEmEnergyFraction
Definition: JetTester.h:187
MonitorElement * mPtCorrOverReco_Pt_F
Definition: JetTester.h:94
MonitorElement * muonMultiplicity
Definition: JetTester.h:179
MonitorElement * neutralHadronEnergyFraction
Definition: JetTester.h:186
double mRThreshold
Definition: JetTester.h:215
MonitorElement * neutralEmEnergy
Definition: JetTester.h:182
MonitorElement * chargedHadronMultiplicity
Definition: JetTester.h:201
std::string JetType
Definition: JetTester.h:59
MonitorElement * mPtRecoOverGen_GenEta_1500_3500
Definition: JetTester.h:147
MonitorElement * mNJets1
Definition: JetTester.h:159
MonitorElement * mPtCorrOverGen_GenEta_600_1500
Definition: JetTester.h:106
MonitorElement * chargedMultiplicity
Definition: JetTester.h:180
tuple pfJets
Definition: pfJets_cff.py:8
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: JetTester.cc:426
MonitorElement * HFEMEnergy
Definition: JetTester.h:199
MonitorElement * mCorrJetPhi_Pt40
Definition: JetTester.h:90
MonitorElement * neutralHadronMultiplicity
Definition: JetTester.h:202
Definition: Run.h:41
MonitorElement * neutralEmEnergyFraction
Definition: JetTester.h:188
Definition: DDAxes.h:10