CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFJetAnalyzer.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2010/05/14 00:28:58 $
5  * $Revision: 1.14 $
6  * \author F. Chlebana - Fermilab
7  */
8 
11 
13 
15 
16 #include <string>
17 using namespace edm;
18 
19 
21 
22  parameters = pSet;
23  _leadJetFlag = 0;
24  _JetLoPass = 0;
25  _JetHiPass = 0;
26  _ptThreshold = 5.;
27  _LooseCHFMin = -999.;
28  _LooseNHFMax = -999.;
29  _LooseCEFMax = -999.;
30  _LooseNEFMax = -999.;
31  _TightCHFMin = -999.;
32  _TightNHFMax = -999.;
33  _TightCEFMax = -999.;
34  _TightNEFMax = -999.;
35  _ThisCHFMin = -999.;
36  _ThisNHFMax = -999.;
37  _ThisCEFMax = -999.;
38  _ThisNEFMax = -999.;
39 
40 }
41 
42 
44 
45 
47 
48  metname = "pFJetAnalyzer";
49 
50  LogTrace(metname)<<"[PFJetAnalyzer] Parameters initialization";
51  //dbe->setCurrentFolder("JetMET/Jet/PFJets");//old version, now name set to source, which
52  //can be set for each instance of PFJetAnalyzer called inside JetMETAnalyzer. Useful, e.g., to
53  //name differently the dir for all jets and cleaned jets
54  dbe->setCurrentFolder("JetMET/Jet/"+_source);
55  // dbe->setCurrentFolder("JetMET/Jet/PFJets");
56 
57  jetME = dbe->book1D("jetReco", "jetReco", 3, 1, 4);
58  jetME->setBinLabel(2,"PFJets",1);
59 
60  // monitoring of eta parameter
61  etaBin = parameters.getParameter<int>("etaBin");
62  etaMin = parameters.getParameter<double>("etaMin");
63  etaMax = parameters.getParameter<double>("etaMax");
64 
65  // monitoring of phi paramater
66  phiBin = parameters.getParameter<int>("phiBin");
67  phiMin = parameters.getParameter<double>("phiMin");
68  phiMax = parameters.getParameter<double>("phiMax");
69 
70  // monitoring of the transverse momentum
71  ptBin = parameters.getParameter<int>("ptBin");
72  ptMin = parameters.getParameter<double>("ptMin");
73  ptMax = parameters.getParameter<double>("ptMax");
74 
75  //
76  eBin = parameters.getParameter<int>("eBin");
77  eMin = parameters.getParameter<double>("eMin");
78  eMax = parameters.getParameter<double>("eMax");
79 
80  //
81  pBin = parameters.getParameter<int>("pBin");
82  pMin = parameters.getParameter<double>("pMin");
83  pMax = parameters.getParameter<double>("pMax");
84 
85  _ptThreshold = parameters.getParameter<double>("ptThreshold");
86 
87  _TightCHFMin = parameters.getParameter<double>("TightCHFMin");
88  _TightNHFMax = parameters.getParameter<double>("TightNHFMax");
89  _TightCEFMax = parameters.getParameter<double>("TightCEFMax");
90  _TightNEFMax = parameters.getParameter<double>("TightNEFMax");
91  _LooseCHFMin = parameters.getParameter<double>("LooseCHFMin");
92  _LooseNHFMax = parameters.getParameter<double>("LooseNHFMax");
93  _LooseCEFMax = parameters.getParameter<double>("LooseCEFMax");
94  _LooseNEFMax = parameters.getParameter<double>("LooseNEFMax");
95 
96  fillpfJIDPassFrac = parameters.getParameter<int>("fillpfJIDPassFrac");
97 
98  _ThisCHFMin = parameters.getParameter<double>("ThisCHFMin");
99  _ThisNHFMax = parameters.getParameter<double>("ThisNHFMax");
100  _ThisCEFMax = parameters.getParameter<double>("ThisCEFMax");
101  _ThisNEFMax = parameters.getParameter<double>("ThisNEFMax");
102 
103  // Generic Jet Parameters
104  mPt = dbe->book1D("Pt", "Pt", ptBin, ptMin, ptMax);
105  mPt_1 = dbe->book1D("Pt1", "Pt1", 100, 0, 100);
106  mPt_2 = dbe->book1D("Pt2", "Pt2", 100, 0, 300);
107  mPt_3 = dbe->book1D("Pt3", "Pt3", 100, 0, 5000);
108  mEta = dbe->book1D("Eta", "Eta", etaBin, etaMin, etaMax);
109  mPhi = dbe->book1D("Phi", "Phi", phiBin, phiMin, phiMax);
110  mConstituents = dbe->book1D("Constituents", "# of Constituents", 100, 0, 100);
111  mHFrac = dbe->book1D("HFrac", "HFrac", 120, -0.1, 1.1);
112  mEFrac = dbe->book1D("EFrac", "EFrac", 120, -0.1, 1.1);
113  //
114  mPhiVSEta = dbe->book2D("PhiVSEta", "PhiVSEta", 50, etaMin, etaMax, 24, phiMin, phiMax);
115 
116  // Low and high pt trigger paths
117  mPt_Lo = dbe->book1D("Pt_Lo", "Pt (Pass Low Pt Jet Trigger)", 100, 0, 100);
118  mEta_Lo = dbe->book1D("Eta_Lo", "Eta (Pass Low Pt Jet Trigger)", etaBin, etaMin, etaMax);
119  mPhi_Lo = dbe->book1D("Phi_Lo", "Phi (Pass Low Pt Jet Trigger)", phiBin, phiMin, phiMax);
120 
121  mPt_Hi = dbe->book1D("Pt_Hi", "Pt (Pass Hi Pt Jet Trigger)", 100, 0, 300);
122  mEta_Hi = dbe->book1D("Eta_Hi", "Eta (Pass Hi Pt Jet Trigger)", etaBin, etaMin, etaMax);
123  mPhi_Hi = dbe->book1D("Phi_Hi", "Phi (Pass Hi Pt Jet Trigger)", phiBin, phiMin, phiMax);
124 
125  mE = dbe->book1D("E", "E", eBin, eMin, eMax);
126  mP = dbe->book1D("P", "P", pBin, pMin, pMax);
127  mMass = dbe->book1D("Mass", "Mass", 100, 0, 25);
128  mNJets = dbe->book1D("NJets", "Number of Jets", 100, 0, 100);
129 
130  mPt_Barrel_Lo = dbe->book1D("Pt_Barrel_Lo", "Pt Barrel (Pass Low Pt Jet Trigger)", 100, 0, 100);
131  mPhi_Barrel_Lo = dbe->book1D("Phi_Barrel_Lo", "Phi Barrel (Pass Low Pt Jet Trigger)", phiBin, phiMin, phiMax);
132  mConstituents_Barrel_Lo = dbe->book1D("Constituents_Barrel_Lo", "Constituents Barrel (Pass Low Pt Jet Trigger)", 100, 0, 100);
133  mHFrac_Barrel_Lo = dbe->book1D("HFrac_Barrel_Lo", "HFrac Barrel (Pass Low Pt Jet Trigger)", 100, 0, 1);
134 
135  mPt_EndCap_Lo = dbe->book1D("Pt_EndCap_Lo", "Pt EndCap (Pass Low Pt Jet Trigger)", 100, 0, 100);
136  mPhi_EndCap_Lo = dbe->book1D("Phi_EndCap_Lo", "Phi EndCap (Pass Low Pt Jet Trigger)", phiBin, phiMin, phiMax);
137  mConstituents_EndCap_Lo = dbe->book1D("Constituents_EndCap_Lo", "Constituents EndCap (Pass Low Pt Jet Trigger)", 100, 0, 100);
138  mHFrac_EndCap_Lo = dbe->book1D("HFrac_Endcap_Lo", "HFrac EndCap (Pass Low Pt Jet Trigger)", 100, 0, 1);
139 
140  mPt_Forward_Lo = dbe->book1D("Pt_Forward_Lo", "Pt Forward (Pass Low Pt Jet Trigger)", 100, 0, 100);
141  mPhi_Forward_Lo = dbe->book1D("Phi_Forward_Lo", "Phi Forward (Pass Low Pt Jet Trigger)", phiBin, phiMin, phiMax);
142  mConstituents_Forward_Lo = dbe->book1D("Constituents_Forward_Lo", "Constituents Forward (Pass Low Pt Jet Trigger)", 100, 0, 100);
143  mHFrac_Forward_Lo = dbe->book1D("HFrac_Forward_Lo", "HFrac Forward (Pass Low Pt Jet Trigger)", 100, 0, 1);
144 
145  mPt_Barrel_Hi = dbe->book1D("Pt_Barrel_Hi", "Pt Barrel (Pass Hi Pt Jet Trigger)", 100, 0, 300);
146  mPhi_Barrel_Hi = dbe->book1D("Phi_Barrel_Hi", "Phi Barrel (Pass Hi Pt Jet Trigger)", phiBin, phiMin, phiMax);
147  mConstituents_Barrel_Hi = dbe->book1D("Constituents_Barrel_Hi", "Constituents Barrel (Pass Hi Pt Jet Trigger)", 100, 0, 100);
148  mHFrac_Barrel_Hi = dbe->book1D("HFrac_Barrel_Hi", "HFrac Barrel (Pass Hi Pt Jet Trigger)", 100, 0, 1);
149 
150  mPt_EndCap_Hi = dbe->book1D("Pt_EndCap_Hi", "Pt EndCap (Pass Hi Pt Jet Trigger)", 100, 0, 300);
151  mPhi_EndCap_Hi = dbe->book1D("Phi_EndCap_Hi", "Phi EndCap (Pass Hi Pt Jet Trigger)", phiBin, phiMin, phiMax);
152  mConstituents_EndCap_Hi = dbe->book1D("Constituents_EndCap_Hi", "Constituents EndCap (Pass Hi Pt Jet Trigger)", 100, 0, 100);
153  mHFrac_EndCap_Hi = dbe->book1D("HFrac_EndCap_Hi", "HFrac EndCap (Pass Hi Pt Jet Trigger)", 100, 0, 1);
154 
155  mPt_Forward_Hi = dbe->book1D("Pt_Forward_Hi", "Pt Forward (Pass Hi Pt Jet Trigger)", 100, 0, 300);
156  mPhi_Forward_Hi = dbe->book1D("Phi_Forward_Hi", "Phi Forward (Pass Hi Pt Jet Trigger)", phiBin, phiMin, phiMax);
157  mConstituents_Forward_Hi = dbe->book1D("Constituents_Forward_Hi", "Constituents Forward (Pass Hi Pt Jet Trigger)", 100, 0, 100);
158  mHFrac_Forward_Hi = dbe->book1D("HFrac_Forward_Hi", "HFrac Forward (Pass Hi Pt Jet Trigger)", 100, 0, 1);
159 
160  mPhi_Barrel = dbe->book1D("Phi_Barrel", "Phi_Barrel", phiBin, phiMin, phiMax);
161  mE_Barrel = dbe->book1D("E_Barrel", "E_Barrel", eBin, eMin, eMax);
162  mPt_Barrel = dbe->book1D("Pt_Barrel", "Pt_Barrel", ptBin, ptMin, ptMax);
163 
164  mPhi_EndCap = dbe->book1D("Phi_EndCap", "Phi_EndCap", phiBin, phiMin, phiMax);
165  mE_EndCap = dbe->book1D("E_EndCap", "E_EndCap", eBin, eMin, eMax);
166  mPt_EndCap = dbe->book1D("Pt_EndCap", "Pt_EndCap", ptBin, ptMin, ptMax);
167 
168  mPhi_Forward = dbe->book1D("Phi_Forward", "Phi_Forward", phiBin, phiMin, phiMax);
169  mE_Forward = dbe->book1D("E_Forward", "E_Forward", eBin, eMin, eMax);
170  mPt_Forward = dbe->book1D("Pt_Forward", "Pt_Forward", ptBin, ptMin, ptMax);
171 
172  // Leading Jet Parameters
173  mEtaFirst = dbe->book1D("EtaFirst", "EtaFirst", 100, -5, 5);
174  mPhiFirst = dbe->book1D("PhiFirst", "PhiFirst", 70, -3.5, 3.5);
175  mEFirst = dbe->book1D("EFirst", "EFirst", 100, 0, 1000);
176  mPtFirst = dbe->book1D("PtFirst", "PtFirst", 100, 0, 500);
177 
178  mDPhi = dbe->book1D("DPhi", "dPhi btw the two leading jets", 100, 0., acos(-1.));
179 
180  //
181  mChargedHadronEnergy = dbe->book1D("mChargedHadronEnergy", "mChargedHadronEnergy", 100, 0, 100);
182  mNeutralHadronEnergy = dbe->book1D("mNeutralHadronEnergy", "mNeutralHadronEnergy", 100, 0, 100);
183  mChargedEmEnergy= dbe->book1D("mChargedEmEnergy ", "mChargedEmEnergy ", 100, 0, 100);
184  mChargedMuEnergy = dbe->book1D("mChargedMuEnergy", "mChargedMuEnergy", 100, 0, 100);
185  mNeutralEmEnergy= dbe->book1D("mNeutralEmEnergy", "mNeutralEmEnergy", 100, 0, 100);
186  mChargedMultiplicity= dbe->book1D("mChargedMultiplicity ", "mChargedMultiplicity ", 100, 0, 100);
187  mNeutralMultiplicity = dbe->book1D(" mNeutralMultiplicity", "mNeutralMultiplicity", 100, 0, 100);
188  mMuonMultiplicity= dbe->book1D("mMuonMultiplicity", "mMuonMultiplicity", 100, 0, 100);
189  //__________________________________________________
190  mNeutralFraction = dbe->book1D("NeutralFraction","Neutral Fraction",100,0,1);
191  if(fillpfJIDPassFrac==1) {
192  mLooseJIDPassFractionVSeta= dbe->bookProfile("LooseJIDPassFractionVSeta","LooseJIDPassFractionVSeta",etaBin, etaMin, etaMax,0.,1.2);
193  mLooseJIDPassFractionVSpt= dbe->bookProfile("LooseJIDPassFractionVSpt","LooseJIDPassFractionVSpt",ptBin, ptMin, ptMax,0.,1.2);
194  mTightJIDPassFractionVSeta= dbe->bookProfile("TightJIDPassFractionVSeta","TightJIDPassFractionVSeta",etaBin, etaMin, etaMax,0.,1.2);
195  mTightJIDPassFractionVSpt= dbe->bookProfile("TightJIDPassFractionVSpt","TightJIDPassFractionVSpt",ptBin, ptMin, ptMax,0.,1.2);
196  }
197 
198 
199 }
200 
202 
203  int numofjets=0;
204  double fstPhi=0.;
205  double sndPhi=0.;
206  double diff = 0.;
207  double corr = 0.;
208  double dphi = -999. ;
209 
210  bool Thiscleaned=false;
211  bool Loosecleaned=false;
212  bool Tightcleaned=false;
213  bool ThisCHFcleaned=false;
214  bool LooseCHFcleaned=false;
215  bool TightCHFcleaned=false;
216 
217  for (reco::PFJetCollection::const_iterator jet = pfJets.begin(); jet!=pfJets.end(); ++jet){
218  LogTrace(metname)<<"[JetAnalyzer] Analyze PFJet";
219 
220  Thiscleaned=false;
221  Loosecleaned=false;
222  Tightcleaned=false;
223 
224  if (jet == pfJets.begin()) {
225  fstPhi = jet->phi();
226  _leadJetFlag = 1;
227  } else {
228  _leadJetFlag = 0;
229  }
230 
231  if (jet == (pfJets.begin()+1)) sndPhi = jet->phi();
232  // if (jet->pt() < _ptThreshold) return;
233  if (jet->pt() > _ptThreshold) {
234  numofjets++ ;
235  jetME->Fill(2);
236 
237  //calculate the jetID
238  ThisCHFcleaned=true;
239  LooseCHFcleaned=true;
240  TightCHFcleaned=true;
241  if((jet->chargedHadronEnergy()/jet->energy())<=_ThisCHFMin && fabs(jet->eta())<2.4) ThisCHFcleaned=false; //apply CHF>0 only if |eta|<2.4
242  if((jet->chargedHadronEnergy()/jet->energy())<=_LooseCHFMin && fabs(jet->eta())<2.4) LooseCHFcleaned=false; //apply CHF>0 only if |eta|<2.4
243  if((jet->chargedHadronEnergy()/jet->energy())<=_TightCHFMin && fabs(jet->eta())<2.4) TightCHFcleaned=false; //apply CHF>0 only if |eta|<2.4
244  if(ThisCHFcleaned && (jet->neutralHadronEnergy()/jet->energy())<_ThisNHFMax && (jet->chargedEmEnergy()/jet->energy())<_ThisCEFMax && (jet->neutralEmEnergy()/jet->energy())<_ThisNEFMax) Thiscleaned=true;
245  if(LooseCHFcleaned && (jet->neutralHadronEnergy()/jet->energy())<_LooseNHFMax && (jet->chargedEmEnergy()/jet->energy())<_LooseCEFMax && (jet->neutralEmEnergy()/jet->energy())<_LooseNEFMax) Loosecleaned=true;
246  if(TightCHFcleaned && (jet->neutralHadronEnergy()/jet->energy())<_TightNHFMax && (jet->chargedEmEnergy()/jet->energy())<_TightCEFMax && (jet->neutralEmEnergy()/jet->energy())<_TightNEFMax) Tightcleaned=true;
247 
248  if(fillpfJIDPassFrac==1) {
249  //fill the profile for jid efficiency
250  if(Loosecleaned) {
251  mLooseJIDPassFractionVSeta->Fill(jet->eta(),1.);
252  mLooseJIDPassFractionVSpt->Fill(jet->pt(),1.);
253  } else {
254  mLooseJIDPassFractionVSeta->Fill(jet->eta(),0.);
255  mLooseJIDPassFractionVSpt->Fill(jet->pt(),0.);
256  }
257  if(Tightcleaned) {
258  mTightJIDPassFractionVSeta->Fill(jet->eta(),1.);
259  mTightJIDPassFractionVSpt->Fill(jet->pt(),1.);
260  } else {
261  mTightJIDPassFractionVSeta->Fill(jet->eta(),0.);
262  mTightJIDPassFractionVSpt->Fill(jet->pt(),0.);
263  }
264  }
265 
266  if(!Thiscleaned) continue;
267 
268  // Leading jet
269  // Histograms are filled once per event
270  if (_leadJetFlag == 1) {
271 
272  if (mEtaFirst) mEtaFirst->Fill (jet->eta());
273  if (mPhiFirst) mPhiFirst->Fill (jet->phi());
274  if (mEFirst) mEFirst->Fill (jet->energy());
275  if (mPtFirst) mPtFirst->Fill (jet->pt());
276  }
277 
278  // --- Passed the low pt jet trigger
279  if (_JetLoPass == 1) {
280  if (fabs(jet->eta()) <= 1.3) {
281  if (mPt_Barrel_Lo) mPt_Barrel_Lo->Fill(jet->pt());
282  if (mEta_Lo) mEta_Lo->Fill(jet->eta());
283  if (mPhi_Barrel_Lo) mPhi_Barrel_Lo->Fill(jet->phi());
284  if (mConstituents_Barrel_Lo) mConstituents_Barrel_Lo->Fill(jet->nConstituents());
285  if (mHFrac_Barrel_Lo) mHFrac_Barrel_Lo->Fill(jet->chargedHadronEnergyFraction()+jet->neutralHadronEnergyFraction() );
286  }
287  if ( (fabs(jet->eta()) > 1.3) && (fabs(jet->eta()) <= 3) ) {
288  if (mPt_EndCap_Lo) mPt_EndCap_Lo->Fill(jet->pt());
289  if (mEta_Lo) mEta_Lo->Fill(jet->eta());
290  if (mPhi_EndCap_Lo) mPhi_EndCap_Lo->Fill(jet->phi());
291  if (mConstituents_EndCap_Lo) mConstituents_EndCap_Lo->Fill(jet->nConstituents());
292  if (mHFrac_EndCap_Lo) mHFrac_EndCap_Lo->Fill(jet->chargedHadronEnergyFraction()+jet->neutralHadronEnergyFraction());
293  }
294  if (fabs(jet->eta()) > 3.0) {
295  if (mPt_Forward_Lo) mPt_Forward_Lo->Fill(jet->pt());
296  if (mEta_Lo) mEta_Lo->Fill(jet->eta());
297  if (mPhi_Forward_Lo) mPhi_Forward_Lo->Fill(jet->phi());
298  if (mConstituents_Forward_Lo) mConstituents_Forward_Lo->Fill(jet->nConstituents());
299  if (mHFrac_Forward_Lo) mHFrac_Forward_Lo->Fill(jet->chargedHadronEnergyFraction()+jet->neutralHadronEnergyFraction());
300  }
301  if (mEta_Lo) mEta_Lo->Fill (jet->eta());
302  if (mPhi_Lo) mPhi_Lo->Fill (jet->phi());
303  if (mPt_Lo) mPt_Lo->Fill (jet->pt());
304  }
305 
306  // --- Passed the high pt jet trigger
307  if (_JetHiPass == 1) {
308  if (fabs(jet->eta()) <= 1.3) {
309  if (mPt_Barrel_Hi) mPt_Barrel_Hi->Fill(jet->pt());
310  if (mEta_Hi) mEta_Hi->Fill(jet->eta());
311  if (mPhi_Barrel_Hi) mPhi_Barrel_Hi->Fill(jet->phi());
312  if (mConstituents_Barrel_Hi) mConstituents_Barrel_Hi->Fill(jet->nConstituents());
313  if (mHFrac_Barrel_Hi) mHFrac_Barrel_Hi->Fill(jet->chargedHadronEnergyFraction()+jet->neutralHadronEnergyFraction());
314  }
315  if ( (fabs(jet->eta()) > 1.3) && (fabs(jet->eta()) <= 3) ) {
316  if (mPt_EndCap_Hi) mPt_EndCap_Hi->Fill(jet->pt());
317  if (mEta_Hi) mEta_Hi->Fill(jet->eta());
318  if (mPhi_EndCap_Hi) mPhi_EndCap_Hi->Fill(jet->phi());
319  if (mConstituents_EndCap_Hi) mConstituents_EndCap_Hi->Fill(jet->nConstituents());
320  if (mHFrac_EndCap_Hi) mHFrac_EndCap_Hi->Fill(jet->chargedHadronEnergyFraction()+jet->neutralHadronEnergyFraction());
321  }
322  if (fabs(jet->eta()) > 3.0) {
323  if (mPt_Forward_Hi) mPt_Forward_Hi->Fill(jet->pt());
324  if (mEta_Hi) mEta_Hi->Fill(jet->eta());
325  if (mPhi_Forward_Hi) mPhi_Forward_Hi->Fill(jet->phi());
326  if (mConstituents_Forward_Hi) mConstituents_Forward_Hi->Fill(jet->nConstituents());
327  if (mHFrac_Forward_Hi) mHFrac_Forward_Hi->Fill(jet->chargedHadronEnergyFraction()+jet->neutralHadronEnergyFraction());
328  }
329 
330  if (mEta_Hi) mEta_Hi->Fill (jet->eta());
331  if (mPhi_Hi) mPhi_Hi->Fill (jet->phi());
332  if (mPt_Hi) mPt_Hi->Fill (jet->pt());
333  }
334 
335  if (mPt) mPt->Fill (jet->pt());
336  if (mPt_1) mPt_1->Fill (jet->pt());
337  if (mPt_2) mPt_2->Fill (jet->pt());
338  if (mPt_3) mPt_3->Fill (jet->pt());
339  if (mEta) mEta->Fill (jet->eta());
340  if (mPhi) mPhi->Fill (jet->phi());
341  if (mPhiVSEta) mPhiVSEta->Fill(jet->eta(),jet->phi());
342 
343  if (mConstituents) mConstituents->Fill (jet->nConstituents());
344  if (mHFrac) mHFrac->Fill (jet->chargedHadronEnergyFraction()+jet->neutralHadronEnergyFraction());
345  if (mEFrac) mEFrac->Fill (jet->chargedEmEnergyFraction() +jet->neutralEmEnergyFraction());
346 
347  if (fabs(jet->eta()) <= 1.3) {
348  if (mPt_Barrel) mPt_Barrel->Fill (jet->pt());
349  if (mPhi_Barrel) mPhi_Barrel->Fill (jet->phi());
350  if (mE_Barrel) mE_Barrel->Fill (jet->energy());
351  }
352  if ( (fabs(jet->eta()) > 1.3) && (fabs(jet->eta()) <= 3) ) {
353  if (mPt_EndCap) mPt_EndCap->Fill (jet->pt());
354  if (mPhi_EndCap) mPhi_EndCap->Fill (jet->phi());
355  if (mE_EndCap) mE_EndCap->Fill (jet->energy());
356  }
357  if (fabs(jet->eta()) > 3.0) {
358  if (mPt_Forward) mPt_Forward->Fill (jet->pt());
359  if (mPhi_Forward) mPhi_Forward->Fill (jet->phi());
360  if (mE_Forward) mE_Forward->Fill (jet->energy());
361  }
362 
363  if (mE) mE->Fill (jet->energy());
364  if (mP) mP->Fill (jet->p());
365  if (mMass) mMass->Fill (jet->mass());
366 
367 
368  if (mChargedHadronEnergy) mChargedHadronEnergy->Fill (jet->chargedHadronEnergy());
369  if (mNeutralHadronEnergy) mNeutralHadronEnergy->Fill (jet->neutralHadronEnergy());
370  if (mChargedEmEnergy) mChargedEmEnergy->Fill(jet->chargedEmEnergy());
371  if (mChargedMuEnergy) mChargedMuEnergy->Fill (jet->chargedMuEnergy ());
372  if (mNeutralEmEnergy) mNeutralEmEnergy->Fill(jet->neutralEmEnergy());
373  if (mChargedMultiplicity ) mChargedMultiplicity->Fill(jet->chargedMultiplicity());
374  if (mNeutralMultiplicity ) mNeutralMultiplicity->Fill(jet->neutralMultiplicity());
375  if (mMuonMultiplicity )mMuonMultiplicity->Fill (jet-> muonMultiplicity());
376  //_______________________________________________________
377  if (mNeutralFraction) mNeutralFraction->Fill (jet->neutralMultiplicity()/jet->nConstituents());
378 
379  //calculate correctly the dphi
380  if(numofjets>1) {
381  diff = fabs(fstPhi - sndPhi);
382  corr = 2*acos(-1.) - diff;
383  if(diff < acos(-1.)) {
384  dphi = diff;
385  } else {
386  dphi = corr;
387  }
388  } // numofjets>1
389  } // JetPt>_ptThreshold
390  } // PF jet loop
391  if (mNJets) mNJets->Fill (numofjets);
392  if (mDPhi) mDPhi->Fill (dphi);
393 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
const std::string metname
void analyze(const edm::Event &, const edm::EventSetup &, const reco::PFJetCollection &pfJets)
Get the analysis.
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int iEvent
Definition: GenABIO.cc:243
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:833
PFJetAnalyzer(const edm::ParameterSet &)
Constructor.
#define LogTrace(id)
JetCorrectorParameters corr
Definition: classes.h:9
std::vector< PFJet > PFJetCollection
collection of PFJet objects
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:647
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
virtual ~PFJetAnalyzer()
Destructor.