CMS 3D CMS Logo

GsfElectronFakeAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: RecoEgamma/Examples
4 // Class: GsfElectronFakeAnalyzer
5 //
13 //
14 // Original Author: Ursula Berthon
15 // Created: Mon Mar 27 13:22:06 CEST 2006
16 //
17 //
18 
19 // user include files
37 
38 #include "CLHEP/Units/GlobalPhysicalConstants.h"
39 #include <iostream>
40 #include "TMath.h"
41 #include "TFile.h"
42 #include "TH1F.h"
43 #include "TH1I.h"
44 #include "TH2F.h"
45 #include "TProfile.h"
46 #include "TTree.h"
47 #include <iostream>
48 
49 using namespace reco;
50 
52  : beamSpot_(conf.getParameter<edm::InputTag>("beamSpot")) {
53  outputFile_ = conf.getParameter<std::string>("outputFile");
54  histfile_ = new TFile(outputFile_.c_str(), "RECREATE");
55  electronCollection_ = conf.getParameter<edm::InputTag>("electronCollection");
56  matchingObjectCollection_ = conf.getParameter<edm::InputTag>("matchingObjectCollection");
57  readAOD_ = conf.getParameter<bool>("readAOD");
58  maxPt_ = conf.getParameter<double>("MaxPt");
59  maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
60  deltaR_ = conf.getParameter<double>("DeltaR");
61 
62  edm::ParameterSet pset = conf.getParameter<edm::ParameterSet>("HistosConfigurationFake");
63 
64  etamin = pset.getParameter<double>("Etamin");
65  etamax = pset.getParameter<double>("Etamax");
66  phimin = pset.getParameter<double>("Phimin");
67  phimax = pset.getParameter<double>("Phimax");
68  ptmax = pset.getParameter<double>("Ptmax");
69  pmax = pset.getParameter<double>("Pmax");
70  eopmax = pset.getParameter<double>("Eopmax");
71  eopmaxsht = pset.getParameter<double>("Eopmaxsht");
72  detamin = pset.getParameter<double>("Detamin");
73  detamax = pset.getParameter<double>("Detamax");
74  dphimin = pset.getParameter<double>("Dphimin");
75  dphimax = pset.getParameter<double>("Dphimax");
76  detamatchmin = pset.getParameter<double>("Detamatchmin");
77  detamatchmax = pset.getParameter<double>("Detamatchmax");
78  dphimatchmin = pset.getParameter<double>("Dphimatchmin");
79  dphimatchmax = pset.getParameter<double>("Dphimatchmax");
80  fhitsmax = pset.getParameter<double>("Fhitsmax");
81  lhitsmax = pset.getParameter<double>("Lhitsmax");
82  nbineta = pset.getParameter<int>("Nbineta");
83  nbineta2D = pset.getParameter<int>("Nbineta2D");
84  nbinp = pset.getParameter<int>("Nbinp");
85  nbinpt = pset.getParameter<int>("Nbinpt");
86  nbinp2D = pset.getParameter<int>("Nbinp2D");
87  nbinpt2D = pset.getParameter<int>("Nbinpt2D");
88  nbinpteff = pset.getParameter<int>("Nbinpteff");
89  nbinphi = pset.getParameter<int>("Nbinphi");
90  nbinphi2D = pset.getParameter<int>("Nbinphi2D");
91  nbineop = pset.getParameter<int>("Nbineop");
92  nbineop2D = pset.getParameter<int>("Nbineop2D");
93  nbinfhits = pset.getParameter<int>("Nbinfhits");
94  nbinlhits = pset.getParameter<int>("Nbinlhits");
95  nbinxyz = pset.getParameter<int>("Nbinxyz");
96  nbindeta = pset.getParameter<int>("Nbindeta");
97  nbindphi = pset.getParameter<int>("Nbindphi");
98  nbindetamatch = pset.getParameter<int>("Nbindetamatch");
99  nbindphimatch = pset.getParameter<int>("Nbindphimatch");
100  nbindetamatch2D = pset.getParameter<int>("Nbindetamatch2D");
101  nbindphimatch2D = pset.getParameter<int>("Nbindphimatch2D");
102  nbinmee = pset.getParameter<int>("Nbinmee");
103  meemin = pset.getParameter<double>("Meemin");
104  meemax = pset.getParameter<double>("Meemax");
105  nbinhoe = pset.getParameter<int>("Nbinhoe");
106  hoemin = pset.getParameter<double>("Hoemin");
107  hoemax = pset.getParameter<double>("Hoemax");
108 }
109 
111  // do anything here that needs to be done at desctruction time
112  // (e.g. close files, deallocate resources etc.)
113  histfile_->Write();
114  histfile_->Close();
115 }
116 
118  histfile_->cd();
119 
120  // matching object
121  std::string::size_type locJet = matchingObjectCollection_.label().find("iterativeCone5CaloJets", 0);
123  if (locJet != std::string::npos) {
124  std::cout << "Matching objects are CaloJets " << std::endl;
125  type_ = "CaloJet";
126  } else {
127  std::cout << "Didn't recognize input matching objects!! " << std::endl;
128  }
129 
130  std::string htitle, hlabel;
131  hlabel = "h_" + type_ + "Num";
132  htitle = "# " + type_ + "s";
133  h_matchingObjectNum = new TH1F(hlabel.c_str(), htitle.c_str(), nbinfhits, 0., fhitsmax);
134 
135  // rec event
136 
137  histNum_ = new TH1F("h_recEleNum", "# rec electrons", 20, 0., 20.);
138 
139  // matching object distributions
140  hlabel = "h_" + type_ + "_eta";
141  htitle = type_ + " #eta";
142  h_matchingObjectEta = new TH1F(hlabel.c_str(), htitle.c_str(), nbineta, etamin, etamax);
143  hlabel = "h_" + type_ + "_abseta";
144  htitle = type_ + " |#eta|";
145  h_matchingObjectAbsEta = new TH1F(hlabel.c_str(), htitle.c_str(), nbineta / 2, 0., etamax);
146  hlabel = "h_" + type_ + "_P";
147  htitle = type_ + " p";
148  h_matchingObjectP = new TH1F(hlabel.c_str(), htitle.c_str(), nbinp, 0., pmax);
149  hlabel = "h_" + type_ + "_Pt";
150  htitle = type_ + " pt";
151  h_matchingObjectPt = new TH1F(hlabel.c_str(), htitle.c_str(), nbinpteff, 5., ptmax);
152  hlabel = "h_" + type_ + "_phi";
153  htitle = type_ + " phi";
154  h_matchingObjectPhi = new TH1F(hlabel.c_str(), htitle.c_str(), nbinphi, phimin, phimax);
155  hlabel = "h_" + type_ + "_z";
156  htitle = type_ + " z";
157  h_matchingObjectZ = new TH1F(hlabel.c_str(), htitle.c_str(), nbinxyz, -25, 25);
158 
159  // all electrons
160  h_ele_EoverP_all = new TH1F("h_ele_EoverP_all", "ele E/P_{vertex}, all reco electrons", nbineop, 0., eopmax);
161  h_ele_EseedOP_all = new TH1F("h_ele_EseedOP_all", "ele E_{seed}/P_{vertex}, all reco electrons", nbineop, 0., eopmax);
162  h_ele_EoPout_all = new TH1F("h_ele_EoPout_all", "ele E_{seed}/P_{out}, all reco electrons", nbineop, 0., eopmax);
163  h_ele_EeleOPout_all = new TH1F("h_ele_EeleOPout_all", "ele E_{ele}/P_{out}, all reco electrons", nbineop, 0., eopmax);
164  h_ele_dEtaSc_propVtx_all = new TH1F("h_ele_dEtaSc_propVtx_all",
165  "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",
167  detamatchmin,
168  detamatchmax);
169  h_ele_dPhiSc_propVtx_all = new TH1F("h_ele_dPhiSc_propVtx_all",
170  "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons",
172  dphimatchmin,
173  dphimatchmax);
174  h_ele_dEtaCl_propOut_all = new TH1F("h_ele_dEtaCl_propOut_all",
175  "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",
177  detamatchmin,
178  detamatchmax);
179  h_ele_dPhiCl_propOut_all = new TH1F("h_ele_dPhiCl_propOut_all",
180  "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons",
182  dphimatchmin,
183  dphimatchmax);
184  h_ele_HoE_all =
185  new TH1F("h_ele_HoE_all", "ele hadronic energy / em energy, all reco electrons", nbinhoe, hoemin, hoemax);
186  h_ele_vertexPt_all = new TH1F("h_ele_vertexPt_all", "ele p_{T}, all reco electrons", nbinpteff, 5., ptmax);
187  h_ele_vertexPt_all->Sumw2();
188  h_ele_vertexEta_all = new TH1F("h_ele_vertexEta_all", "ele eta, all reco electrons", nbineta, etamin, etamax);
189  h_ele_vertexEta_all->Sumw2();
190  h_ele_TIP_all = new TH1F("h_ele_TIP_all", "ele vertex transverse radius, all reco electrons", 100, 0., 0.2);
191  h_ele_mee_all = new TH1F("h_ele_mee_all", "ele pairs invariant mass, all reco electrons", nbinmee, meemin, meemax);
192  h_ele_mee_os = new TH1F("h_ele_mee_os", "ele pairs invariant mass, opp. sign", nbinmee, meemin, meemax);
193 
194  // duplicates
195  h_ele_E2mnE1vsMee_all = new TH2F("h_ele_E2mnE1vsMee_all",
196  "E2 - E1 vs ele pairs invariant mass, all electrons",
197  nbinmee,
198  meemin,
199  meemax,
200  100,
201  -50.,
202  50.);
203  h_ele_E2mnE1vsMee_egeg_all = new TH2F("h_ele_E2mnE1vsMee_egeg_all",
204  "E2 - E1 vs ele pairs invariant mass, ecal driven pairs, all electrons",
205  nbinmee,
206  meemin,
207  meemax,
208  100,
209  -50.,
210  50.);
211 
212  // matched electrons
213  h_ele_charge = new TH1F("h_ele_charge", "ele charge", 5, -2., 2.);
214  h_ele_chargeVsEta = new TH2F("h_ele_chargeVsEta", "ele charge vs eta", nbineta2D, etamin, etamax, 5, -2., 2.);
215  h_ele_chargeVsPhi = new TH2F("h_ele_chargeVsPhi", "ele charge vs phi", nbinphi2D, phimin, phimax, 5, -2., 2.);
216  h_ele_chargeVsPt = new TH2F("h_ele_chargeVsPt", "ele charge vs pt", nbinpt, 0., 100., 5, -2., 2.);
217  h_ele_vertexP = new TH1F("h_ele_vertexP", "ele momentum", nbinp, 0., pmax);
218  h_ele_vertexPt = new TH1F("h_ele_vertexPt", "ele transverse momentum", nbinpt, 0., ptmax);
220  new TH2F("h_ele_vertexPtVsEta", "ele transverse momentum vs eta", nbineta2D, etamin, etamax, nbinpt2D, 0., ptmax);
222  new TH2F("h_ele_vertexPtVsPhi", "ele transverse momentum vs phi", nbinphi2D, phimin, phimax, nbinpt2D, 0., ptmax);
224  new TH1F("h_ele_matchingObjectPt_matched", "Efficiency vs matching jet p_{T}", nbinpteff, 5., ptmax);
226  h_ele_vertexEta = new TH1F("h_ele_vertexEta", "ele momentum eta", nbineta, etamin, etamax);
228  new TH2F("h_ele_vertexEtaVsPhi", "ele momentum eta vs phi", nbineta2D, etamin, etamax, nbinphi2D, phimin, phimax);
230  new TH1F("h_ele_matchingObjectAbsEta_matched", "Efficiency vs matching jet |#eta|", nbineta / 2, 0., 2.5);
233  new TH1F("h_ele_matchingObjectEta_matched", "Efficiency vs matching jet #eta", nbineta, etamin, etamax);
236  new TH1F("h_ele_matchingObjectPhi_matched", "Efficiency vs matching jet phi", nbinphi, phimin, phimax);
238  h_ele_vertexPhi = new TH1F("h_ele_vertexPhi", "ele momentum #phi", nbinphi, phimin, phimax);
239  h_ele_vertexX = new TH1F("h_ele_vertexX", "ele vertex x", nbinxyz, -0.1, 0.1);
240  h_ele_vertexY = new TH1F("h_ele_vertexY", "ele vertex y", nbinxyz, -0.1, 0.1);
241  h_ele_vertexZ = new TH1F("h_ele_vertexZ", "ele vertex z", nbinxyz, -25, 25);
243  new TH1F("h_ele_matchingObjectZ_matched", "Efficiency vs matching jet z", nbinxyz, -25, 25);
245  h_ele_vertexTIP = new TH1F("h_ele_vertexTIP", "ele transverse impact parameter (wrt bs)", 90, 0., 0.15);
246  h_ele_vertexTIPVsEta = new TH2F("h_ele_vertexTIPVsEta",
247  "ele transverse impact parameter (wrt bs) vs eta",
248  nbineta2D,
249  etamin,
250  etamax,
251  45,
252  0.,
253  0.15);
254  h_ele_vertexTIPVsPhi = new TH2F("h_ele_vertexTIPVsPhi",
255  "ele transverse impact parameter (wrt bs) vs phi",
256  nbinphi2D,
257  phimin,
258  phimax,
259  45,
260  0.,
261  0.15);
262  h_ele_vertexTIPVsPt = new TH2F(
263  "h_ele_vertexTIPVsPt", "ele transverse impact parameter (wrt bs) vs Pt", nbinpt2D, 0., ptmax, 45, 0., 0.15);
264  h_ele_PoPmatchingObject = new TH1F("h_ele_PoPmatchingObject", "ele momentum / matching jet momentum", 75, 0., 1.5);
265  h_ele_PoPmatchingObjectVsEta = new TH2F("h_ele_PoPmatchingObjectVsEta",
266  "ele momentum / matching jet momentum vs eta",
267  nbineta2D,
268  etamin,
269  etamax,
270  50,
271  0.,
272  1.5);
273  h_ele_PoPmatchingObjectVsPhi = new TH2F("h_ele_PoPmatchingObjectVsPhi",
274  "ele momentum / matching jet momentum vs phi",
275  nbinphi2D,
276  phimin,
277  phimax,
278  50,
279  0.,
280  1.5);
281  h_ele_PoPmatchingObjectVsPt = new TH2F(
282  "h_ele_PoPmatchingObjectVsPt", "ele momentum / matching jet momentum vs eta", nbinpt2D, 0., ptmax, 50, 0., 1.5);
284  new TH1F("h_ele_PoPmatchingObject_barrel", "ele momentum / matching jet momentum, barrel", 75, 0., 1.5);
286  new TH1F("h_ele_PoPmatchingObject_endcaps", "ele momentum / matching jet momentum, endcaps", 75, 0., 1.5);
288  new TH1F("h_ele_EtaMnEtamatchingObject", "ele momentum eta - matching jet eta", nbindeta, detamin, detamax);
289  h_ele_EtaMnEtamatchingObjectVsEta = new TH2F("h_ele_EtaMnEtamatchingObjectVsEta",
290  "ele momentum eta - matching jet eta vs eta",
291  nbineta2D,
292  etamin,
293  etamax,
294  nbindeta / 2,
295  detamin,
296  detamax);
297  h_ele_EtaMnEtamatchingObjectVsPhi = new TH2F("h_ele_EtaMnEtamatchingObjectVsPhi",
298  "ele momentum eta - matching jet eta vs phi",
299  nbinphi2D,
300  phimin,
301  phimax,
302  nbindeta / 2,
303  detamin,
304  detamax);
305  h_ele_EtaMnEtamatchingObjectVsPt = new TH2F("h_ele_EtaMnEtamatchingObjectVsPt",
306  "ele momentum eta - matching jet eta vs pt",
307  nbinpt,
308  0.,
309  ptmax,
310  nbindeta / 2,
311  detamin,
312  detamax);
314  new TH1F("h_ele_PhiMnPhimatchingObject", "ele momentum phi - matching jet phi", nbindphi, dphimin, dphimax);
315  h_ele_PhiMnPhimatchingObject2 = new TH1F("h_ele_PhiMnPhimatchingObject2",
316  "ele momentum phi - matching jet phi",
318  dphimatchmin,
319  dphimatchmax);
320  h_ele_PhiMnPhimatchingObjectVsEta = new TH2F("h_ele_PhiMnPhimatchingObjectVsEta",
321  "ele momentum phi - matching SC phi vs eta",
322  nbineta2D,
323  etamin,
324  etamax,
325  nbindphi / 2,
326  dphimin,
327  dphimax);
328  h_ele_PhiMnPhimatchingObjectVsPhi = new TH2F("h_ele_PhiMnPhimatchingObjectVsPhi",
329  "ele momentum phi - matching SC phi vs phi",
330  nbinphi2D,
331  phimin,
332  phimax,
333  nbindphi / 2,
334  dphimin,
335  dphimax);
336  h_ele_PhiMnPhimatchingObjectVsPt = new TH2F("h_ele_PhiMnPhimatchingObjectVsPt",
337  "ele momentum phi - matching SC phi vs pt",
338  nbinpt2D,
339  0.,
340  ptmax,
341  nbindphi / 2,
342  dphimin,
343  dphimax);
344 
345  // matched electron, superclusters
346  histSclEn_ = new TH1F("h_scl_energy", "ele supercluster energy", nbinp, 0., pmax);
348  new TH1F("h_scl_EoEmatchingObject_barrel", "ele supercluster energy / matching jet energy, barrel", 50, 0.2, 1.2);
350  "h_scl_EoEmatchingObject_endcaps", "ele supercluster energy / matching jet energy, endcaps", 50, 0.2, 1.2);
351  histSclEt_ = new TH1F("h_scl_et", "ele supercluster transverse energy", nbinpt, 0., ptmax);
352  histSclEtVsEta_ = new TH2F(
353  "h_scl_etVsEta", "ele supercluster transverse energy vs eta", nbineta2D, etamin, etamax, nbinpt, 0., ptmax);
354  histSclEtVsPhi_ = new TH2F(
355  "h_scl_etVsPhi", "ele supercluster transverse energy vs phi", nbinphi2D, phimin, phimax, nbinpt, 0., ptmax);
357  new TH2F("h_scl_etaVsPhi", "ele supercluster eta vs phi", nbinphi2D, phimin, phimax, nbineta2D, etamin, etamax);
358  histSclEta_ = new TH1F("h_scl_eta", "ele supercluster eta", nbineta, etamin, etamax);
359  histSclPhi_ = new TH1F("h_scl_phi", "ele supercluster phi", nbinphi, phimin, phimax);
360 
361  histSclSigIEtaIEta_ = new TH1F("h_scl_sigietaieta", "ele supercluster sigma ieta ieta", 100, 0., 0.05);
363  new TH1F("h_scl_sigietaieta_barrel", "ele supercluster sigma ieta ieta, barrel", 100, 0., 0.05);
365  new TH1F("h_scl_sigietaieta_endcaps", "ele supercluster sigma ieta ieta, endcaps", 100, 0., 0.05);
366  histSclE1x5_ = new TH1F("h_scl_E1x5", "ele supercluster energy in 1x5", nbinp, 0., pmax);
367  histSclE1x5_barrel_ = new TH1F("h_scl_E1x5_barrel", "ele supercluster energy in 1x5 barrel", nbinp, 0., pmax);
368  histSclE1x5_endcaps_ = new TH1F("h_scl_E1x5_endcaps", "ele supercluster energy in 1x5 endcaps", nbinp, 0., pmax);
369  histSclE2x5max_ = new TH1F("h_scl_E2x5max", "ele supercluster energy in 2x5 max", nbinp, 0., pmax);
371  new TH1F("h_scl_E2x5max_barrel", "ele supercluster energy in 2x5 max barrel", nbinp, 0., pmax);
373  new TH1F("h_scl_E2x5max_endcaps", "ele supercluster energy in 2x5 max endcaps", nbinp, 0., pmax);
374  histSclE5x5_ = new TH1F("h_scl_E5x5", "ele supercluster energy in 5x5", nbinp, 0., pmax);
375  histSclE5x5_barrel_ = new TH1F("h_scl_E5x5_barrel", "ele supercluster energy in 5x5 barrel", nbinp, 0., pmax);
376  histSclE5x5_endcaps_ = new TH1F("h_scl_E5x5_endcaps", "ele supercluster energy in 5x5 endcaps", nbinp, 0., pmax);
377 
378  // matched electron, gsf tracks
379  h_ele_ambiguousTracks = new TH1F("h_ele_ambiguousTracks", "ele # ambiguous tracks", 5, 0., 5.);
381  new TH2F("h_ele_ambiguousTracksVsEta", "ele # ambiguous tracks vs eta", nbineta2D, etamin, etamax, 5, 0., 5.);
383  new TH2F("h_ele_ambiguousTracksVsPhi", "ele # ambiguous tracks vs phi", nbinphi2D, phimin, phimax, 5, 0., 5.);
385  new TH2F("h_ele_ambiguousTracksVsPt", "ele # ambiguous tracks vs pt", nbinpt2D, 0., ptmax, 5, 0., 5.);
386  h_ele_foundHits = new TH1F("h_ele_foundHits", "ele track # found hits", nbinfhits, 0., fhitsmax);
387  h_ele_foundHitsVsEta = new TH2F(
388  "h_ele_foundHitsVsEta", "ele track # found hits vs eta", nbineta2D, etamin, etamax, nbinfhits, 0., fhitsmax);
389  h_ele_foundHitsVsPhi = new TH2F(
390  "h_ele_foundHitsVsPhi", "ele track # found hits vs phi", nbinphi2D, phimin, phimax, nbinfhits, 0., fhitsmax);
392  new TH2F("h_ele_foundHitsVsPt", "ele track # found hits vs pt", nbinpt2D, 0., ptmax, nbinfhits, 0., fhitsmax);
393  h_ele_lostHits = new TH1F("h_ele_lostHits", "ele track # lost hits", 5, 0., 5.);
394  h_ele_lostHitsVsEta = new TH2F(
395  "h_ele_lostHitsVsEta", "ele track # lost hits vs eta", nbineta2D, etamin, etamax, nbinlhits, 0., lhitsmax);
396  h_ele_lostHitsVsPhi = new TH2F(
397  "h_ele_lostHitsVsPhi", "ele track # lost hits vs eta", nbinphi2D, phimin, phimax, nbinlhits, 0., lhitsmax);
399  new TH2F("h_ele_lostHitsVsPt", "ele track # lost hits vs eta", nbinpt2D, 0., ptmax, nbinlhits, 0., lhitsmax);
400  h_ele_chi2 = new TH1F("h_ele_chi2", "ele track #chi^{2}", 100, 0., 15.);
401  h_ele_chi2VsEta = new TH2F("h_ele_chi2VsEta", "ele track #chi^{2} vs eta", nbineta2D, etamin, etamax, 50, 0., 15.);
402  h_ele_chi2VsPhi = new TH2F("h_ele_chi2VsPhi", "ele track #chi^{2} vs phi", nbinphi2D, phimin, phimax, 50, 0., 15.);
403  h_ele_chi2VsPt = new TH2F("h_ele_chi2VsPt", "ele track #chi^{2} vs pt", nbinpt2D, 0., ptmax, 50, 0., 15.);
404  h_ele_PinMnPout = new TH1F("h_ele_PinMnPout", "ele track inner p - outer p, mean", nbinp, 0., 200.);
405  h_ele_PinMnPout_mode = new TH1F("h_ele_PinMnPout_mode", "ele track inner p - outer p, mode", nbinp, 0., 100.);
406  h_ele_PinMnPoutVsEta_mode = new TH2F("h_ele_PinMnPoutVsEta_mode",
407  "ele track inner p - outer p vs eta, mode",
408  nbineta2D,
409  etamin,
410  etamax,
411  nbinp2D,
412  0.,
413  100.);
414  h_ele_PinMnPoutVsPhi_mode = new TH2F("h_ele_PinMnPoutVsPhi_mode",
415  "ele track inner p - outer p vs phi, mode",
416  nbinphi2D,
417  phimin,
418  phimax,
419  nbinp2D,
420  0.,
421  100.);
422  h_ele_PinMnPoutVsPt_mode = new TH2F(
423  "h_ele_PinMnPoutVsPt_mode", "ele track inner p - outer p vs pt, mode", nbinpt2D, 0., ptmax, nbinp2D, 0., 100.);
424  h_ele_PinMnPoutVsE_mode = new TH2F(
425  "h_ele_PinMnPoutVsE_mode", "ele track inner p - outer p vs E, mode", nbinp2D, 0., 200., nbinp2D, 0., 100.);
426  h_ele_PinMnPoutVsChi2_mode = new TH2F(
427  "h_ele_PinMnPoutVsChi2_mode", "ele track inner p - outer p vs track chi2, mode", 50, 0., 20., nbinp2D, 0., 100.);
428  h_ele_outerP = new TH1F("h_ele_outerP", "ele track outer p, mean", nbinp, 0., pmax);
429  h_ele_outerP_mode = new TH1F("h_ele_outerP_mode", "ele track outer p, mode", nbinp, 0., pmax);
431  new TH2F("h_ele_outerPVsEta_mode", "ele track outer p vs eta mode", nbineta2D, etamin, etamax, 50, 0., pmax);
432  h_ele_outerPt = new TH1F("h_ele_outerPt", "ele track outer p_{T}, mean", nbinpt, 0., ptmax);
433  h_ele_outerPt_mode = new TH1F("h_ele_outerPt_mode", "ele track outer p_{T}, mode", nbinpt, 0., ptmax);
434  h_ele_outerPtVsEta_mode = new TH2F(
435  "h_ele_outerPtVsEta_mode", "ele track outer p_{T} vs eta, mode", nbineta2D, etamin, etamax, nbinpt2D, 0., ptmax);
436  h_ele_outerPtVsPhi_mode = new TH2F(
437  "h_ele_outerPtVsPhi_mode", "ele track outer p_{T} vs phi, mode", nbinphi2D, phimin, phimax, nbinpt2D, 0., ptmax);
439  new TH2F("h_ele_outerPtVsPt_mode", "ele track outer p_{T} vs pt, mode", nbinpt2D, 0., 100., nbinpt2D, 0., ptmax);
440 
441  // matched electrons,cluster-track matching
442  h_ele_EoP = new TH1F("h_ele_EoP", "ele E/P_{vertex}", nbineop, 0., eopmax);
443  h_ele_EoP->Sumw2();
444  h_ele_EoP_eg = new TH1F("h_ele_EoP_eg", "ele E/P_{vertex}, ecal driven", nbineop, 0., eopmax);
445  h_ele_EoP_eg->Sumw2();
446  h_ele_EoP_barrel = new TH1F("h_ele_EoP_barrel", "ele E/P_{vertex} barrel", nbineop, 0., eopmax);
447  h_ele_EoP_barrel->Sumw2();
448  h_ele_EoP_eg_barrel = new TH1F("h_ele_EoP_eg_barrel", "ele E/P_{vertex}, ecal driven barrel", nbineop, 0., eopmax);
449  h_ele_EoP_eg_barrel->Sumw2();
450  h_ele_EoP_endcaps = new TH1F("h_ele_EoP_endcaps", "ele E/P_{vertex} endcaps", nbineop, 0., eopmax);
451  h_ele_EoP_endcaps->Sumw2();
452  h_ele_EoP_eg_endcaps = new TH1F("h_ele_EoP_eg_endcaps", "ele E/P_{vertex}, ecal driven endcaps", nbineop, 0., eopmax);
453  h_ele_EoP_eg_endcaps->Sumw2();
455  new TH2F("h_ele_EoPVsEta", "ele E/P_{vertex} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
457  new TH2F("h_ele_EoPVsPhi", "ele E/P_{vertex} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
458  h_ele_EoPVsE = new TH2F("h_ele_EoPVsE", "ele E/P_{vertex} vs E", 50, 0., pmax, 50, 0., 5.);
459  h_ele_EseedOP = new TH1F("h_ele_EseedOP", "ele E_{seed}/P_{vertex}", nbineop, 0., eopmax);
460  h_ele_EseedOP->Sumw2();
461  h_ele_EseedOP_eg = new TH1F("h_ele_EseedOP_eg", "ele E_{seed}/P_{vertex}, ecal driven", nbineop, 0., eopmax);
462  h_ele_EseedOP_eg->Sumw2();
463  h_ele_EseedOP_barrel = new TH1F("h_ele_EseedOP_barrel", "ele E_{seed}/P_{vertex} barrel", nbineop, 0., eopmax);
464  h_ele_EseedOP_barrel->Sumw2();
466  new TH1F("h_ele_EseedOP_eg_barrel", "ele E_{seed}/P_{vertex}, ecal driven barrel", nbineop, 0., eopmax);
467  h_ele_EseedOP_eg_barrel->Sumw2();
468  h_ele_EseedOP_endcaps = new TH1F("h_ele_EseedOP_endcaps", "ele E_{seed}/P_{vertex} endcaps", nbineop, 0., eopmax);
469  h_ele_EseedOP_endcaps->Sumw2();
471  new TH1F("h_ele_EseedOP_eg_endcaps", "ele E_{seed}/P_{vertex}, ecal driven, endcaps", nbineop, 0., eopmax);
472  h_ele_EseedOP_eg_endcaps->Sumw2();
473  h_ele_EseedOPVsEta = new TH2F(
474  "h_ele_EseedOPVsEta", "ele E_{seed}/P_{vertex} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
475  h_ele_EseedOPVsPhi = new TH2F(
476  "h_ele_EseedOPVsPhi", "ele E_{seed}/P_{vertex} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
477  h_ele_EseedOPVsE = new TH2F("h_ele_EseedOPVsE", "ele E_{seed}/P_{vertex} vs E", 50, 0., pmax, 50, 0., 5.);
478  h_ele_EoPout = new TH1F("h_ele_EoPout", "ele E_{seed}/P_{out}", nbineop, 0., eopmax);
479  h_ele_EoPout->Sumw2();
480  h_ele_EoPout_eg = new TH1F("h_ele_EoPout_eg", "ele E_{seed}/P_{out}, ecal driven", nbineop, 0., eopmax);
481  h_ele_EoPout_eg->Sumw2();
482  h_ele_EoPout_barrel = new TH1F("h_ele_EoPout_barrel", "ele E_{seed}/P_{out} barrel", nbineop, 0., eopmax);
483  h_ele_EoPout_barrel->Sumw2();
485  new TH1F("h_ele_EoPout_eg_barrel", "ele E_{seed}/P_{out}, ecal driven, barrel", nbineop, 0., eopmax);
486  h_ele_EoPout_eg_barrel->Sumw2();
487  h_ele_EoPout_endcaps = new TH1F("h_ele_EoPout_endcaps", "ele E_{seed}/P_{out} endcaps", nbineop, 0., eopmax);
488  h_ele_EoPout_endcaps->Sumw2();
490  new TH1F("h_ele_EoPout_eg_endcaps", "ele E_{seed}/P_{out}, ecal driven, endcaps", nbineop, 0., eopmax);
491  h_ele_EoPout_eg_endcaps->Sumw2();
493  new TH2F("h_ele_EoPoutVsEta", "ele E/P_{out} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
495  new TH2F("h_ele_EoPoutVsPhi", "ele E/P_{out} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
496  h_ele_EoPoutVsE = new TH2F("h_ele_EoPoutVsE", "ele E/P_{out} vs E", nbinp2D, 0., pmax, nbineop2D, 0., eopmaxsht);
497  h_ele_EeleOPout = new TH1F("h_ele_EeleOPout", "ele E_{ele}/P_{out}", nbineop, 0., eopmax);
498  h_ele_EeleOPout->Sumw2();
499  h_ele_EeleOPout_eg = new TH1F("h_ele_EeleOPout_eg", "ele E_{ele}/P_{out}, ecal driven", nbineop, 0., eopmax);
500  h_ele_EeleOPout_eg->Sumw2();
501  h_ele_EeleOPout_barrel = new TH1F("h_ele_EeleOPout_barrel", "ele E_{ele}/P_{out} barrel", nbineop, 0., eopmax);
502  h_ele_EeleOPout_barrel->Sumw2();
504  new TH1F("h_ele_EeleOPout_eg_barrel", "ele E_{ele}/P_{out}, ecal driven, barrel", nbineop, 0., eopmax);
505  h_ele_EeleOPout_eg_barrel->Sumw2();
506  h_ele_EeleOPout_endcaps = new TH1F("h_ele_EeleOPout_endcaps", "ele E_{ele}/P_{out} endcaps", nbineop, 0., eopmax);
507  h_ele_EeleOPout_endcaps->Sumw2();
509  new TH1F("h_ele_EeleOPout_eg_endcaps", "ele E_{ele}/P_{out}, ecal driven, endcaps", nbineop, 0., eopmax);
511  h_ele_EeleOPoutVsEta = new TH2F(
512  "h_ele_EeleOPoutVsEta", "ele E_{ele}/P_{out} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
513  h_ele_EeleOPoutVsPhi = new TH2F(
514  "h_ele_EeleOPoutVsPhi", "ele E_{ele}/P_{out} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
516  new TH2F("h_ele_EeleOPoutVsE", "ele E_{ele}/P_{out} vs E", nbinp2D, 0., pmax, nbineop2D, 0., eopmaxsht);
517  h_ele_dEtaSc_propVtx = new TH1F(
518  "h_ele_dEtaSc_propVtx", "ele #eta_{sc} - #eta_{tr}, prop from vertex", nbindetamatch, detamatchmin, detamatchmax);
519  h_ele_dEtaSc_propVtx->Sumw2();
520  h_ele_dEtaSc_propVtx_eg = new TH1F("h_ele_dEtaSc_propVtx_eg",
521  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven",
523  detamatchmin,
524  detamatchmax);
525  h_ele_dEtaSc_propVtx_eg->Sumw2();
526  h_ele_dEtaSc_propVtx_barrel = new TH1F("h_ele_dEtaSc_propVtx_barrel",
527  "ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",
529  detamatchmin,
530  detamatchmax);
532  h_ele_dEtaSc_propVtx_eg_barrel = new TH1F("h_ele_dEtaSc_propVtx_eg_barrel",
533  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, barrel",
535  detamatchmin,
536  detamatchmax);
538  h_ele_dEtaSc_propVtx_endcaps = new TH1F("h_ele_dEtaSc_propVtx_endcaps",
539  "ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",
541  detamatchmin,
542  detamatchmax);
544  h_ele_dEtaSc_propVtx_eg_endcaps = new TH1F("h_ele_dEtaSc_propVtx_eg_endcaps",
545  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, endcaps",
547  detamatchmin,
548  detamatchmax);
550  h_ele_dEtaScVsEta_propVtx = new TH2F("h_ele_dEtaScVsEta_propVtx",
551  "ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",
552  nbineta2D,
553  etamin,
554  etamax,
556  detamatchmin,
557  detamatchmax);
558  h_ele_dEtaScVsPhi_propVtx = new TH2F("h_ele_dEtaScVsPhi_propVtx",
559  "ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",
560  nbinphi2D,
561  phimin,
562  phimax,
564  detamatchmin,
565  detamatchmax);
566  h_ele_dEtaScVsPt_propVtx = new TH2F("h_ele_dEtaScVsPt_propVtx",
567  "ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",
568  nbinpt2D,
569  0.,
570  ptmax,
572  detamatchmin,
573  detamatchmax);
574  h_ele_dPhiSc_propVtx = new TH1F(
575  "h_ele_dPhiSc_propVtx", "ele #phi_{sc} - #phi_{tr}, prop from vertex", nbindphimatch, dphimatchmin, dphimatchmax);
576  h_ele_dPhiSc_propVtx->Sumw2();
577  h_ele_dPhiSc_propVtx_eg = new TH1F("h_ele_dPhiSc_propVtx_eg",
578  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven",
580  dphimatchmin,
581  dphimatchmax);
582  h_ele_dPhiSc_propVtx_eg->Sumw2();
583  h_ele_dPhiSc_propVtx_barrel = new TH1F("h_ele_dPhiSc_propVtx_barrel",
584  "ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",
586  dphimatchmin,
587  dphimatchmax);
589  h_ele_dPhiSc_propVtx_eg_barrel = new TH1F("h_ele_dPhiSc_propVtx_eg_barrel",
590  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, barrel",
592  dphimatchmin,
593  dphimatchmax);
595  h_ele_dPhiSc_propVtx_endcaps = new TH1F("h_ele_dPhiSc_propVtx_endcaps",
596  "ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",
598  dphimatchmin,
599  dphimatchmax);
601  h_ele_dPhiSc_propVtx_eg_endcaps = new TH1F("h_ele_dPhiSc_propVtx_eg_endcaps",
602  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, endcaps",
604  dphimatchmin,
605  dphimatchmax);
607  h_ele_dPhiScVsEta_propVtx = new TH2F("h_ele_dPhiScVsEta_propVtx",
608  "ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",
609  nbineta2D,
610  etamin,
611  etamax,
613  dphimatchmin,
614  dphimatchmax);
615  h_ele_dPhiScVsPhi_propVtx = new TH2F("h_ele_dPhiScVsPhi_propVtx",
616  "ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",
617  nbinphi2D,
618  phimin,
619  phimax,
621  dphimatchmin,
622  dphimatchmax);
623  h_ele_dPhiScVsPt_propVtx = new TH2F("h_ele_dPhiScVsPt_propVtx",
624  "ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",
625  nbinpt2D,
626  0.,
627  ptmax,
629  dphimatchmin,
630  dphimatchmax);
631  h_ele_dEtaCl_propOut = new TH1F("h_ele_dEtaCl_propOut",
632  "ele #eta_{cl} - #eta_{tr}, prop from outermost",
634  detamatchmin,
635  detamatchmax);
636  h_ele_dEtaCl_propOut->Sumw2();
637  h_ele_dEtaCl_propOut_eg = new TH1F("h_ele_dEtaCl_propOut_eg",
638  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven",
640  detamatchmin,
641  detamatchmax);
642  h_ele_dEtaCl_propOut_eg->Sumw2();
643  h_ele_dEtaCl_propOut_barrel = new TH1F("h_ele_dEtaCl_propOut_barrel",
644  "ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",
646  detamatchmin,
647  detamatchmax);
649  h_ele_dEtaCl_propOut_eg_barrel = new TH1F("h_ele_dEtaCl_propOut_eg_barrel",
650  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
652  detamatchmin,
653  detamatchmax);
655  h_ele_dEtaCl_propOut_endcaps = new TH1F("h_ele_dEtaCl_propOut_endcaps",
656  "ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",
658  detamatchmin,
659  detamatchmax);
661  h_ele_dEtaCl_propOut_eg_endcaps = new TH1F("h_ele_dEtaCl_propOut_eg_endcaps",
662  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
664  detamatchmin,
665  detamatchmax);
667  h_ele_dEtaClVsEta_propOut = new TH2F("h_ele_dEtaClVsEta_propOut",
668  "ele #eta_{cl} - #eta_{tr} vs eta, prop from out",
669  nbineta2D,
670  etamin,
671  etamax,
673  detamatchmin,
674  detamatchmax);
675  h_ele_dEtaClVsPhi_propOut = new TH2F("h_ele_dEtaClVsPhi_propOut",
676  "ele #eta_{cl} - #eta_{tr} vs phi, prop from out",
677  nbinphi2D,
678  phimin,
679  phimax,
681  detamatchmin,
682  detamatchmax);
683  h_ele_dEtaClVsPt_propOut = new TH2F("h_ele_dEtaScVsPt_propOut",
684  "ele #eta_{cl} - #eta_{tr} vs pt, prop from out",
685  nbinpt2D,
686  0.,
687  ptmax,
689  detamatchmin,
690  detamatchmax);
691  h_ele_dPhiCl_propOut = new TH1F("h_ele_dPhiCl_propOut",
692  "ele #phi_{cl} - #phi_{tr}, prop from outermost",
694  dphimatchmin,
695  dphimatchmax);
696  h_ele_dPhiCl_propOut->Sumw2();
697  h_ele_dPhiCl_propOut_eg = new TH1F("h_ele_dPhiCl_propOut_eg",
698  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven",
700  dphimatchmin,
701  dphimatchmax);
702  h_ele_dPhiCl_propOut_eg->Sumw2();
703  h_ele_dPhiCl_propOut_barrel = new TH1F("h_ele_dPhiCl_propOut_barrel",
704  "ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",
706  dphimatchmin,
707  dphimatchmax);
709  h_ele_dPhiCl_propOut_eg_barrel = new TH1F("h_ele_dPhiCl_propOut_eg_barrel",
710  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
712  dphimatchmin,
713  dphimatchmax);
715  h_ele_dPhiCl_propOut_endcaps = new TH1F("h_ele_dPhiCl_propOut_endcaps",
716  "ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",
718  dphimatchmin,
719  dphimatchmax);
721  h_ele_dPhiCl_propOut_eg_endcaps = new TH1F("h_ele_dPhiCl_propOut_eg_endcaps",
722  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
724  dphimatchmin,
725  dphimatchmax);
727  h_ele_dPhiClVsEta_propOut = new TH2F("h_ele_dPhiClVsEta_propOut",
728  "ele #phi_{cl} - #phi_{tr} vs eta, prop from out",
729  nbineta2D,
730  etamin,
731  etamax,
733  dphimatchmin,
734  dphimatchmax);
735  h_ele_dPhiClVsPhi_propOut = new TH2F("h_ele_dPhiClVsPhi_propOut",
736  "ele #phi_{cl} - #phi_{tr} vs phi, prop from out",
737  nbinphi2D,
738  phimin,
739  phimax,
741  dphimatchmin,
742  dphimatchmax);
743  h_ele_dPhiClVsPt_propOut = new TH2F("h_ele_dPhiSClsPt_propOut",
744  "ele #phi_{cl} - #phi_{tr} vs pt, prop from out",
745  nbinpt2D,
746  0.,
747  ptmax,
749  dphimatchmin,
750  dphimatchmax);
751  h_ele_dEtaEleCl_propOut = new TH1F("h_ele_dEtaEleCl_propOut",
752  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",
754  detamatchmin,
755  detamatchmax);
756  h_ele_dEtaEleCl_propOut->Sumw2();
757  h_ele_dEtaEleCl_propOut_eg = new TH1F("h_ele_dEtaEleCl_propOut_eg",
758  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven",
760  detamatchmin,
761  detamatchmax);
763  h_ele_dEtaEleCl_propOut_barrel = new TH1F("h_ele_dEtaEleCl_propOut_barrel",
764  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",
766  detamatchmin,
767  detamatchmax);
769  h_ele_dEtaEleCl_propOut_eg_barrel = new TH1F("h_ele_dEtaEleCl_propOut_eg_barrel",
770  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
772  detamatchmin,
773  detamatchmax);
775  h_ele_dEtaEleCl_propOut_endcaps = new TH1F("h_ele_dEtaEleCl_propOut_endcaps",
776  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",
778  detamatchmin,
779  detamatchmax);
782  new TH1F("h_ele_dEtaEleCl_propOut_eg_endcaps",
783  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
785  detamatchmin,
786  detamatchmax);
788  h_ele_dEtaEleClVsEta_propOut = new TH2F("h_ele_dEtaEleClVsEta_propOut",
789  "ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",
790  nbineta2D,
791  etamin,
792  etamax,
794  detamatchmin,
795  detamatchmax);
796  h_ele_dEtaEleClVsPhi_propOut = new TH2F("h_ele_dEtaEleClVsPhi_propOut",
797  "ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",
798  nbinphi2D,
799  phimin,
800  phimax,
802  detamatchmin,
803  detamatchmax);
804  h_ele_dEtaEleClVsPt_propOut = new TH2F("h_ele_dEtaScVsPt_propOut",
805  "ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",
806  nbinpt2D,
807  0.,
808  ptmax,
810  detamatchmin,
811  detamatchmax);
812  h_ele_dPhiEleCl_propOut = new TH1F("h_ele_dPhiEleCl_propOut",
813  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",
815  dphimatchmin,
816  dphimatchmax);
817  h_ele_dPhiEleCl_propOut->Sumw2();
818  h_ele_dPhiEleCl_propOut_eg = new TH1F("h_ele_dPhiEleCl_propOut_eg",
819  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven",
821  dphimatchmin,
822  dphimatchmax);
824  h_ele_dPhiEleCl_propOut_barrel = new TH1F("h_ele_dPhiEleCl_propOut_barrel",
825  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",
827  dphimatchmin,
828  dphimatchmax);
830  h_ele_dPhiEleCl_propOut_eg_barrel = new TH1F("h_ele_dPhiEleCl_propOut_eg_barrel",
831  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
833  dphimatchmin,
834  dphimatchmax);
836  h_ele_dPhiEleCl_propOut_endcaps = new TH1F("h_ele_dPhiEleCl_propOut_endcaps",
837  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",
839  dphimatchmin,
840  dphimatchmax);
843  new TH1F("h_ele_dPhiEleCl_propOut_eg_endcaps",
844  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
846  dphimatchmin,
847  dphimatchmax);
849  h_ele_dPhiEleClVsEta_propOut = new TH2F("h_ele_dPhiEleClVsEta_propOut",
850  "ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",
851  nbineta2D,
852  etamin,
853  etamax,
855  dphimatchmin,
856  dphimatchmax);
857  h_ele_dPhiEleClVsPhi_propOut = new TH2F("h_ele_dPhiEleClVsPhi_propOut",
858  "ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",
859  nbinphi2D,
860  phimin,
861  phimax,
863  dphimatchmin,
864  dphimatchmax);
865  h_ele_dPhiEleClVsPt_propOut = new TH2F("h_ele_dPhiSEleClsPt_propOut",
866  "ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",
867  nbinpt2D,
868  0.,
869  ptmax,
871  dphimatchmin,
872  dphimatchmax);
873 
874  h_ele_HoE = new TH1F("h_ele_HoE", "ele hadronic energy / em energy", nbinhoe, hoemin, hoemax);
875  h_ele_HoE->Sumw2();
876  h_ele_HoE_eg = new TH1F("h_ele_HoE_eg", "ele hadronic energy / em energy, ecal driven", nbinhoe, hoemin, hoemax);
877  h_ele_HoE_eg->Sumw2();
878  h_ele_HoE_barrel = new TH1F("h_ele_HoE_barrel", "ele hadronic energy / em energy, barrel", nbinhoe, hoemin, hoemax);
879  h_ele_HoE_barrel->Sumw2();
881  new TH1F("h_ele_HoE_eg_barrel", "ele hadronic energy / em energy, ecal driven, barrel", nbinhoe, hoemin, hoemax);
882  h_ele_HoE_eg_barrel->Sumw2();
884  new TH1F("h_ele_HoE_endcaps", "ele hadronic energy / em energy, endcaps", nbinhoe, hoemin, hoemax);
885  h_ele_HoE_endcaps->Sumw2();
886  h_ele_HoE_eg_endcaps = new TH1F(
887  "h_ele_HoE_eg_endcaps", "ele hadronic energy / em energy, ecal driven, endcaps", nbinhoe, hoemin, hoemax);
888  h_ele_HoE_eg_endcaps->Sumw2();
889  h_ele_HoE_fiducial = new TH1F("h_ele_HoE_fiducial", "ele hadronic energy / em energy", nbinhoe, hoemin, hoemax);
890  h_ele_HoEVsEta = new TH2F(
891  "h_ele_HoEVsEta", "ele hadronic energy / em energy vs eta", nbineta, etamin, etamax, nbinhoe, hoemin, hoemax);
892  h_ele_HoEVsPhi = new TH2F(
893  "h_ele_HoEVsPhi", "ele hadronic energy / em energy vs phi", nbinphi2D, phimin, phimax, nbinhoe, hoemin, hoemax);
894  h_ele_HoEVsE =
895  new TH2F("h_ele_HoEVsE", "ele hadronic energy / em energy vs E", nbinp, 0., 300., nbinhoe, hoemin, hoemax);
896 
897  h_ele_seed_dphi2_ = new TH1F("h_ele_seedDphi2", "ele seed dphi 2nd layer", 50, -0.003, +0.003);
899  new TH2F("h_ele_seedDphi2VsEta", "ele seed dphi 2nd layer vs eta", nbineta2D, etamin, etamax, 50, -0.003, +0.003);
901  new TH2F("h_ele_seedDphi2VsPt", "ele seed dphi 2nd layer vs pt", nbinpt2D, 0., ptmax, 50, -0.003, +0.003);
902  h_ele_seed_drz2_ = new TH1F("h_ele_seedDrz2", "ele seed dr/dz 2nd layer", 50, -0.03, +0.03);
904  new TH2F("h_ele_seedDrz2VsEta", "ele seed dr/dz 2nd layer vs eta", nbineta2D, etamin, etamax, 50, -0.03, +0.03);
906  new TH2F("h_ele_seedDrz2VsPt", "ele seed dr/dz 2nd layer vs pt", nbinpt2D, 0., ptmax, 50, -0.03, +0.03);
907  h_ele_seed_subdet2_ = new TH1F("h_ele_seedSubdet2", "ele seed subdet 2nd layer", 10, 0., 10.);
908 
909  // classes
910  h_ele_classes = new TH1F("h_ele_classes", "electron classes", 20, 0.0, 20.);
911  h_ele_eta = new TH1F("h_ele_eta", "ele electron eta", nbineta / 2, 0.0, etamax);
912  h_ele_eta_golden = new TH1F("h_ele_eta_golden", "ele electron eta golden", nbineta / 2, 0.0, etamax);
913  h_ele_eta_bbrem = new TH1F("h_ele_eta_bbrem", "ele electron eta bbrem", nbineta / 2, 0.0, etamax);
914  h_ele_eta_narrow = new TH1F("h_ele_eta_narrow", "ele electron eta narrow", nbineta / 2, 0.0, etamax);
915  h_ele_eta_shower = new TH1F("h_ele_eta_show", "el, electron eta showering", nbineta / 2, 0.0, etamax);
916  h_ele_PinVsPoutGolden_mode = new TH2F(
917  "h_ele_PinVsPoutGolden_mode", "ele track inner p vs outer p, golden, mode", nbinp2D, 0., pmax, 50, 0., pmax);
918  h_ele_PinVsPoutShowering_mode = new TH2F("h_ele_PinVsPoutShowering_mode",
919  "ele track inner p vs outer p vs eta, showering, mode",
920  nbinp2D,
921  0.,
922  pmax,
923  50,
924  0.,
925  pmax);
926  h_ele_PinVsPoutGolden_mean = new TH2F(
927  "h_ele_PinVsPoutGolden_mean", "ele track inner p vs outer p, golden, mean", nbinp2D, 0., pmax, 50, 0., pmax);
929  "h_ele_PinVsPoutShowering_mean", "ele track inner p vs outer p, showering, mean", nbinp2D, 0., pmax, 50, 0., pmax);
930  h_ele_PtinVsPtoutGolden_mode = new TH2F("h_ele_PtinVsPtoutGolden_mode",
931  "ele track inner pt vs outer pt, golden, mode",
932  nbinpt2D,
933  0.,
934  ptmax,
935  50,
936  0.,
937  ptmax);
938  h_ele_PtinVsPtoutShowering_mode = new TH2F("h_ele_PtinVsPtoutShowering_mode",
939  "ele track inner pt vs outer pt, showering, mode",
940  nbinpt2D,
941  0.,
942  ptmax,
943  50,
944  0.,
945  ptmax);
946  h_ele_PtinVsPtoutGolden_mean = new TH2F("h_ele_PtinVsPtoutGolden_mean",
947  "ele track inner pt vs outer pt, golden, mean",
948  nbinpt2D,
949  0.,
950  ptmax,
951  50,
952  0.,
953  ptmax);
954  h_ele_PtinVsPtoutShowering_mean = new TH2F("h_ele_PtinVsPtoutShowering_mean",
955  "ele track inner pt vs outer pt, showering, mean",
956  nbinpt2D,
957  0.,
958  ptmax,
959  50,
960  0.,
961  ptmax);
963  "h_scl_EoEmatchingObject golden, barrel", "ele SC energy over matching jet energy, golden, barrel", 100, 0.2, 1.2);
964  histSclEoEmatchingObjectGolden_endcaps = new TH1F("h_scl_EoEmatchingObject golden, endcaps",
965  "ele SC energy over matching jet energy, golden, endcaps",
966  100,
967  0.2,
968  1.2);
969  histSclEoEmatchingObjectShowering_barrel = new TH1F("h_scl_EoEmatchingObject showering, barrel",
970  "ele SC energy over matching jet energy, showering, barrel",
971  100,
972  0.2,
973  1.2);
974  histSclEoEmatchingObjectShowering_endcaps = new TH1F("h_scl_EoEmatchingObject showering, endcaps",
975  "ele SC energy over matching jet energy, showering, endcaps",
976  100,
977  0.2,
978  1.2);
979 
980  // isolation
981  h_ele_tkSumPt_dr03 = new TH1F("h_ele_tkSumPt_dr03", "tk isolation sum, dR=0.3", 100, 0.0, 20.);
982  h_ele_ecalRecHitSumEt_dr03 = new TH1F("h_ele_ecalRecHitSumEt_dr03", "ecal isolation sum, dR=0.3", 100, 0.0, 20.);
984  new TH1F("h_ele_hcalDepth1TowerSumEt_dr03", "hcal depth1 isolation sum, dR=0.3", 100, 0.0, 20.);
986  new TH1F("h_ele_hcalDepth2TowerSumEt_dr03", "hcal depth2 isolation sum, dR=0.3", 100, 0.0, 20.);
987  h_ele_tkSumPt_dr04 = new TH1F("h_ele_tkSumPt_dr04", "hcal isolation sum", 100, 0.0, 20.);
988  h_ele_ecalRecHitSumEt_dr04 = new TH1F("h_ele_ecalRecHitSumEt_dr04", "ecal isolation sum, dR=0.4", 100, 0.0, 20.);
990  new TH1F("h_ele_hcalDepth1TowerSumEt_dr04", "hcal depth1 isolation sum, dR=0.4", 100, 0.0, 20.);
992  new TH1F("h_ele_hcalDepth2TowerSumEt_dr04", "hcal depth2 isolation sum, dR=0.4", 100, 0.0, 20.);
993 
994  // fbrem
995  h_ele_fbrem = new TH1F("h_ele_fbrem", "ele brem fraction, mode", 100, 0., 1.);
997  new TProfile("h_ele_fbremvsEtamode", "mean ele brem fraction vs eta, mode", nbineta2D, etamin, etamax, 0., 1.);
999  new TProfile("h_ele_fbremvsEtamean", "mean ele brem fraction vs eta, mean", nbineta2D, etamin, etamax, 0., 1.);
1000 
1001  // e/g et pflow electrons
1002  h_ele_mva = new TH1F("h_ele_mva", "ele mva", 100, -1., 1.);
1003  h_ele_provenance = new TH1F("h_ele_provenance", "ele provenance", 5, -2., 3.);
1004 
1005  // histos titles
1006  h_matchingObjectNum->GetXaxis()->SetTitle("N_{SC}");
1007  h_matchingObjectNum->GetYaxis()->SetTitle("Events");
1008  h_matchingObjectEta->GetXaxis()->SetTitle("#eta_{SC}");
1009  h_matchingObjectEta->GetYaxis()->SetTitle("Events");
1010  h_matchingObjectP->GetXaxis()->SetTitle("E_{SC} (GeV)");
1011  h_matchingObjectP->GetYaxis()->SetTitle("Events");
1012  h_ele_foundHits->GetXaxis()->SetTitle("N_{hits}");
1013  h_ele_foundHits->GetYaxis()->SetTitle("Events");
1014  h_ele_ambiguousTracks->GetXaxis()->SetTitle("N_{ambiguous tracks}");
1015  h_ele_ambiguousTracks->GetYaxis()->SetTitle("Events");
1016  h_ele_lostHits->GetXaxis()->SetTitle("N_{lost hits}");
1017  h_ele_lostHits->GetYaxis()->SetTitle("Events");
1018  h_ele_chi2->GetXaxis()->SetTitle("#Chi^{2}");
1019  h_ele_chi2->GetYaxis()->SetTitle("Events");
1020  h_ele_charge->GetXaxis()->SetTitle("charge");
1021  h_ele_charge->GetYaxis()->SetTitle("Events");
1022  h_ele_vertexP->GetXaxis()->SetTitle("p_{vertex} (GeV/c)");
1023  h_ele_vertexP->GetYaxis()->SetTitle("Events");
1024  h_ele_vertexPt->GetXaxis()->SetTitle("p_{T vertex} (GeV/c)");
1025  h_ele_vertexPt->GetYaxis()->SetTitle("Events");
1026  h_ele_vertexEta->GetXaxis()->SetTitle("#eta");
1027  h_ele_vertexEta->GetYaxis()->SetTitle("Events");
1028  h_ele_vertexPhi->GetXaxis()->SetTitle("#phi (rad)");
1029  h_ele_vertexPhi->GetYaxis()->SetTitle("Events");
1030  h_ele_PoPmatchingObject->GetXaxis()->SetTitle("P/P_{jet}");
1031  h_ele_PoPmatchingObject->GetYaxis()->SetTitle("Events");
1032  h_ele_PoPmatchingObject_barrel->GetXaxis()->SetTitle("P/P_{jet}");
1033  h_ele_PoPmatchingObject_barrel->GetYaxis()->SetTitle("Events");
1034  h_ele_PoPmatchingObject_endcaps->GetXaxis()->SetTitle("P/P_{jet}");
1035  h_ele_PoPmatchingObject_endcaps->GetYaxis()->SetTitle("Events");
1036  histSclSigIEtaIEta_->GetXaxis()->SetTitle("#sigma_{#eta #eta}");
1037  histSclSigIEtaIEta_->GetYaxis()->SetTitle("Events");
1038  histSclSigIEtaIEta_barrel_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1039  histSclSigIEtaIEta_barrel_->GetYaxis()->SetTitle("Events");
1040  histSclSigIEtaIEta_endcaps_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1041  histSclSigIEtaIEta_endcaps_->GetYaxis()->SetTitle("Events");
1042  histSclE1x5_->GetXaxis()->SetTitle("E1x5 (GeV)");
1043  histSclE1x5_->GetYaxis()->SetTitle("Events");
1044  histSclE1x5_barrel_->GetXaxis()->SetTitle("E1x5 (GeV)");
1045  histSclE1x5_barrel_->GetYaxis()->SetTitle("Events");
1046  histSclE1x5_endcaps_->GetXaxis()->SetTitle("E1x5 (GeV)");
1047  histSclE1x5_endcaps_->GetYaxis()->SetTitle("Events");
1048  histSclE2x5max_->GetXaxis()->SetTitle("E2x5 (GeV)");
1049  histSclE2x5max_->GetYaxis()->SetTitle("Events");
1050  histSclE2x5max_barrel_->GetXaxis()->SetTitle("E2x5 (GeV)");
1051  histSclE2x5max_barrel_->GetYaxis()->SetTitle("Events");
1052  histSclE2x5max_endcaps_->GetXaxis()->SetTitle("E2x5 (GeV)");
1053  histSclE2x5max_endcaps_->GetYaxis()->SetTitle("Events");
1054  histSclE5x5_->GetXaxis()->SetTitle("E5x5 (GeV)");
1055  histSclE5x5_->GetYaxis()->SetTitle("Events");
1056  histSclE5x5_barrel_->GetXaxis()->SetTitle("E5x5 (GeV)");
1057  histSclE5x5_barrel_->GetYaxis()->SetTitle("Events");
1058  histSclE5x5_endcaps_->GetXaxis()->SetTitle("E5x5 (GeV)");
1059  histSclE5x5_endcaps_->GetYaxis()->SetTitle("Events");
1060  h_ele_EtaMnEtamatchingObject->GetXaxis()->SetTitle("#eta_{rec} - #eta_{jet}");
1061  h_ele_EtaMnEtamatchingObject->GetYaxis()->SetTitle("Events");
1062  h_ele_PhiMnPhimatchingObject->GetXaxis()->SetTitle("#phi_{rec} - #phi_{jet} (rad)");
1063  h_ele_PhiMnPhimatchingObject->GetYaxis()->SetTitle("Events");
1064  h_ele_PinMnPout->GetXaxis()->SetTitle("P_{vertex} - P_{out} (GeV/c)");
1065  h_ele_PinMnPout->GetYaxis()->SetTitle("Events");
1066  h_ele_PinMnPout_mode->GetXaxis()->SetTitle("P_{vertex} - P_{out}, mode (GeV/c)");
1067  h_ele_PinMnPout_mode->GetYaxis()->SetTitle("Events");
1068  h_ele_outerP->GetXaxis()->SetTitle("P_{out} (GeV/c)");
1069  h_ele_outerP->GetYaxis()->SetTitle("Events");
1070  h_ele_outerP_mode->GetXaxis()->SetTitle("P_{out} (GeV/c)");
1071  h_ele_outerP_mode->GetYaxis()->SetTitle("Events");
1072  h_ele_outerPt->GetXaxis()->SetTitle("P_{T out} (GeV/c)");
1073  h_ele_outerPt->GetYaxis()->SetTitle("Events");
1074  h_ele_outerPt_mode->GetXaxis()->SetTitle("P_{T out} (GeV/c)");
1075  h_ele_outerPt_mode->GetYaxis()->SetTitle("Events");
1076  h_ele_EoP->GetXaxis()->SetTitle("E/P_{vertex}");
1077  h_ele_EoP->GetYaxis()->SetTitle("Events");
1078  h_ele_EseedOP->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1079  h_ele_EseedOP->GetYaxis()->SetTitle("Events");
1080  h_ele_EoPout->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1081  h_ele_EoPout->GetYaxis()->SetTitle("Events");
1082  h_ele_EeleOPout->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1083  h_ele_EeleOPout->GetYaxis()->SetTitle("Events");
1084  h_ele_EoP_barrel->GetXaxis()->SetTitle("E/P_{vertex}");
1085  h_ele_EoP_barrel->GetYaxis()->SetTitle("Events");
1086  h_ele_EseedOP_barrel->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1087  h_ele_EseedOP_barrel->GetYaxis()->SetTitle("Events");
1088  h_ele_EoPout_barrel->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1089  h_ele_EoPout_barrel->GetYaxis()->SetTitle("Events");
1090  h_ele_EeleOPout_barrel->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1091  h_ele_EeleOPout_barrel->GetYaxis()->SetTitle("Events");
1092  h_ele_EoP_endcaps->GetXaxis()->SetTitle("E/P_{vertex}");
1093  h_ele_EoP_endcaps->GetYaxis()->SetTitle("Events");
1094  h_ele_EseedOP_endcaps->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1095  h_ele_EseedOP_endcaps->GetYaxis()->SetTitle("Events");
1096  h_ele_EoPout_endcaps->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1097  h_ele_EoPout_endcaps->GetYaxis()->SetTitle("Events");
1098  h_ele_EeleOPout_endcaps->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1099  h_ele_EeleOPout_endcaps->GetYaxis()->SetTitle("Events");
1100  h_ele_vertexX->GetXaxis()->SetTitle("x (cm)");
1101  h_ele_vertexX->GetYaxis()->SetTitle("Events");
1102  h_ele_vertexY->GetXaxis()->SetTitle("y (cm)");
1103  h_ele_vertexY->GetYaxis()->SetTitle("Events");
1104  h_ele_vertexZ->GetXaxis()->SetTitle("z (cm)");
1105  h_ele_vertexZ->GetYaxis()->SetTitle("Events");
1106  h_ele_vertexTIP->GetXaxis()->SetTitle("TIP (cm)");
1107  h_ele_vertexTIP->GetYaxis()->SetTitle("Events");
1108  h_ele_TIP_all->GetXaxis()->SetTitle("r_{T} (cm)");
1109  h_ele_TIP_all->GetYaxis()->SetTitle("Events");
1110  h_ele_vertexTIPVsEta->GetYaxis()->SetTitle("TIP (cm)");
1111  h_ele_vertexTIPVsEta->GetXaxis()->SetTitle("#eta");
1112  h_ele_vertexTIPVsPhi->GetYaxis()->SetTitle("TIP (cm)");
1113  h_ele_vertexTIPVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1114  h_ele_vertexTIPVsPt->GetYaxis()->SetTitle("TIP (cm)");
1115  h_ele_vertexTIPVsPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1116  h_ele_dEtaSc_propVtx->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1117  h_ele_dEtaSc_propVtx->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1118  h_ele_dEtaSc_propVtx->GetYaxis()->SetTitle("Events");
1119  h_ele_dEtaCl_propOut->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
1120  h_ele_dEtaCl_propOut->GetYaxis()->SetTitle("Events");
1121  h_ele_dEtaEleCl_propOut->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
1122  h_ele_dEtaEleCl_propOut->GetYaxis()->SetTitle("Events");
1123  h_ele_dPhiSc_propVtx->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1124  h_ele_dPhiSc_propVtx->GetYaxis()->SetTitle("Events");
1125  h_ele_dPhiCl_propOut->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
1126  h_ele_dPhiCl_propOut->GetYaxis()->SetTitle("Events");
1127  h_ele_dPhiEleCl_propOut->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
1128  h_ele_dPhiEleCl_propOut->GetYaxis()->SetTitle("Events");
1129  h_ele_dEtaSc_propVtx_barrel->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1130  h_ele_dEtaSc_propVtx_barrel->GetYaxis()->SetTitle("Events");
1131  h_ele_dEtaCl_propOut_barrel->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
1132  h_ele_dEtaCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1133  h_ele_dEtaEleCl_propOut_barrel->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
1134  h_ele_dEtaEleCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1135  h_ele_dPhiSc_propVtx_barrel->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1136  h_ele_dPhiSc_propVtx_barrel->GetYaxis()->SetTitle("Events");
1137  h_ele_dPhiCl_propOut_barrel->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
1138  h_ele_dPhiCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1139  h_ele_dPhiEleCl_propOut_barrel->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
1140  h_ele_dPhiEleCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1141  h_ele_dEtaSc_propVtx_endcaps->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1142  h_ele_dEtaSc_propVtx_endcaps->GetYaxis()->SetTitle("Events");
1143  h_ele_dEtaCl_propOut_endcaps->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
1144  h_ele_dEtaCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1145  h_ele_dEtaEleCl_propOut_endcaps->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
1146  h_ele_dEtaEleCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1147  h_ele_dPhiSc_propVtx_endcaps->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1148  h_ele_dPhiSc_propVtx_endcaps->GetYaxis()->SetTitle("Events");
1149  h_ele_dPhiCl_propOut_endcaps->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
1150  h_ele_dPhiCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1151  h_ele_dPhiEleCl_propOut_endcaps->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
1152  h_ele_dPhiEleCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1153  h_ele_HoE->GetXaxis()->SetTitle("H/E");
1154  h_ele_HoE->GetYaxis()->SetTitle("Events");
1155  h_ele_HoE_barrel->GetXaxis()->SetTitle("H/E");
1156  h_ele_HoE_barrel->GetYaxis()->SetTitle("Events");
1157  h_ele_HoE_endcaps->GetXaxis()->SetTitle("H/E");
1158  h_ele_HoE_endcaps->GetYaxis()->SetTitle("Events");
1159  h_ele_HoE_fiducial->GetXaxis()->SetTitle("H/E");
1160  h_ele_HoE_fiducial->GetYaxis()->SetTitle("Events");
1161  h_ele_fbrem->GetXaxis()->SetTitle("P_{in} - P_{out} / P_{in}");
1162  h_ele_fbrem->GetYaxis()->SetTitle("Events");
1163  h_ele_seed_dphi2_->GetXaxis()->SetTitle("#phi_{hit}-#phi_{pred} (rad)");
1164  h_ele_seed_dphi2_->GetYaxis()->SetTitle("Events");
1165  h_ele_seed_drz2_->GetXaxis()->SetTitle("r(z)_{hit}-r(z)_{pred} (cm)");
1166  h_ele_seed_drz2_->GetYaxis()->SetTitle("Events");
1167  h_ele_seed_subdet2_->GetXaxis()->SetTitle("2nd hit subdet Id");
1168  h_ele_seed_subdet2_->GetYaxis()->SetTitle("Events");
1169  h_ele_classes->GetXaxis()->SetTitle("class Id");
1170  h_ele_classes->GetYaxis()->SetTitle("Events");
1171  h_ele_EoverP_all->GetXaxis()->SetTitle("E/P_{vertex}");
1172  h_ele_EoverP_all->GetYaxis()->SetTitle("Events");
1173  h_ele_EseedOP_all->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1174  h_ele_EseedOP_all->GetYaxis()->SetTitle("Events");
1175  h_ele_EoPout_all->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1176  h_ele_EoPout_all->GetYaxis()->SetTitle("Events");
1177  h_ele_EeleOPout_all->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1178  h_ele_EeleOPout_all->GetYaxis()->SetTitle("Events");
1179  h_ele_dEtaSc_propVtx_all->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1180  h_ele_dEtaSc_propVtx_all->GetYaxis()->SetTitle("Events");
1181  h_ele_dPhiSc_propVtx_all->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1182  h_ele_dPhiSc_propVtx_all->GetYaxis()->SetTitle("Events");
1183  h_ele_dEtaCl_propOut_all->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1184  h_ele_dEtaCl_propOut_all->GetYaxis()->SetTitle("Events");
1185  h_ele_dPhiCl_propOut_all->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1186  h_ele_dPhiCl_propOut_all->GetYaxis()->SetTitle("Events");
1187  h_ele_HoE_all->GetXaxis()->SetTitle("H/E");
1188  h_ele_HoE_all->GetYaxis()->SetTitle("Events");
1189  h_ele_mee_all->GetXaxis()->SetTitle("m_{ee} (GeV/c^{2})");
1190  h_ele_mee_all->GetYaxis()->SetTitle("Events");
1191  h_ele_mee_os->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1192  h_ele_mee_os->GetYaxis()->SetTitle("Events");
1193  h_ele_E2mnE1vsMee_all->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1194  h_ele_E2mnE1vsMee_all->GetYaxis()->SetTitle("E2 - E1 (GeV)");
1195  h_ele_E2mnE1vsMee_egeg_all->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1196  h_ele_E2mnE1vsMee_egeg_all->GetYaxis()->SetTitle("E2 - E1 (GeV)");
1197  histNum_->GetXaxis()->SetTitle("N_{ele}");
1198  histNum_->GetYaxis()->SetTitle("Events");
1199  h_ele_fbremVsEta_mode->GetXaxis()->SetTitle("#eta");
1200  h_ele_fbremVsEta_mean->GetXaxis()->SetTitle("#eta");
1201 }
1202 
1204  histfile_->cd();
1205  std::cout << "efficiency calculation " << std::endl;
1206  // efficiency vs eta
1207  TH1F *h_ele_etaEff = (TH1F *)h_ele_matchingObjectEta_matched->Clone("h_ele_etaEff");
1208  h_ele_etaEff->Reset();
1209  h_ele_etaEff->Divide(h_ele_matchingObjectEta_matched, h_matchingObjectEta, 1, 1, "b");
1210  h_ele_etaEff->Print();
1211  h_ele_etaEff->GetXaxis()->SetTitle("#eta");
1212  h_ele_etaEff->GetYaxis()->SetTitle("Efficiency");
1213 
1214  // efficiency vs z
1215  TH1F *h_ele_zEff = (TH1F *)h_ele_matchingObjectZ_matched->Clone("h_ele_zEff");
1216  h_ele_zEff->Reset();
1217  h_ele_zEff->Divide(h_ele_matchingObjectZ_matched, h_matchingObjectZ, 1, 1, "b");
1218  h_ele_zEff->Print();
1219  h_ele_zEff->GetXaxis()->SetTitle("z (cm)");
1220  h_ele_zEff->GetYaxis()->SetTitle("Efficiency");
1221 
1222  // efficiency vs |eta|
1223  TH1F *h_ele_absetaEff = (TH1F *)h_ele_matchingObjectAbsEta_matched->Clone("h_ele_absetaEff");
1224  h_ele_absetaEff->Reset();
1225  h_ele_absetaEff->Divide(h_ele_matchingObjectAbsEta_matched, h_matchingObjectAbsEta, 1, 1, "b");
1226  h_ele_absetaEff->GetXaxis()->SetTitle("|#eta|");
1227  h_ele_absetaEff->GetYaxis()->SetTitle("Efficiency");
1228 
1229  // efficiency vs pt
1230  TH1F *h_ele_ptEff = (TH1F *)h_ele_matchingObjectPt_matched->Clone("h_ele_ptEff");
1231  h_ele_ptEff->Reset();
1232  h_ele_ptEff->Divide(h_ele_matchingObjectPt_matched, h_matchingObjectPt, 1, 1, "b");
1233  h_ele_ptEff->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1234  h_ele_ptEff->GetYaxis()->SetTitle("Efficiency");
1235 
1236  // efficiency vs phi
1237  TH1F *h_ele_phiEff = (TH1F *)h_ele_matchingObjectPhi_matched->Clone("h_ele_phiEff");
1238  h_ele_phiEff->Reset();
1239  h_ele_phiEff->Divide(h_ele_matchingObjectPhi_matched, h_matchingObjectPhi, 1, 1, "b");
1240  h_ele_phiEff->GetXaxis()->SetTitle("#phi (rad)");
1241  h_ele_phiEff->GetYaxis()->SetTitle("Efficiency");
1242 
1243  // rec/matching objects all electrons
1244  TH1F *h_ele_etaEff_all = (TH1F *)h_ele_vertexEta_all->Clone("h_ele_etaEff_all");
1245  h_ele_etaEff_all->Reset();
1246  h_ele_etaEff_all->Divide(h_ele_vertexEta_all, h_matchingObjectEta, 1, 1, "b");
1247  h_ele_etaEff_all->Print();
1248  h_ele_etaEff_all->GetXaxis()->SetTitle("#eta");
1249  h_ele_etaEff_all->GetYaxis()->SetTitle("N_{rec}/N_{matching jet}");
1250  TH1F *h_ele_ptEff_all = (TH1F *)h_ele_vertexPt_all->Clone("h_ele_ptEff_all");
1251  h_ele_ptEff_all->Reset();
1252  h_ele_ptEff_all->Divide(h_ele_vertexPt_all, h_matchingObjectPt, 1, 1, "b");
1253  h_ele_ptEff_all->Print();
1254  h_ele_ptEff_all->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1255  h_ele_ptEff_all->GetYaxis()->SetTitle("N_{rec}/N_{matching jet}");
1256 
1257  // classes
1258  TH1F *h_ele_eta_goldenFrac = (TH1F *)h_ele_eta_golden->Clone("h_ele_eta_goldenFrac");
1259  h_ele_eta_goldenFrac->Reset();
1260  h_ele_eta_goldenFrac->GetXaxis()->SetTitle("|#eta|");
1261  h_ele_eta_goldenFrac->GetYaxis()->SetTitle("Fraction of electrons");
1262  h_ele_eta_goldenFrac->Divide(h_ele_eta_golden, h_ele_eta, 1, 1);
1263  h_ele_eta_goldenFrac->SetTitle("fraction of golden electrons vs eta");
1264  TH1F *h_ele_eta_bbremFrac = (TH1F *)h_ele_eta_bbrem->Clone("h_ele_eta_bbremFrac");
1265  h_ele_eta_bbremFrac->Reset();
1266  h_ele_eta_bbremFrac->Divide(h_ele_eta_bbrem, h_ele_eta, 1, 1);
1267  h_ele_eta_bbremFrac->GetXaxis()->SetTitle("|#eta|");
1268  h_ele_eta_bbremFrac->GetYaxis()->SetTitle("Fraction of electrons");
1269  h_ele_eta_bbremFrac->SetTitle("fraction of big brem electrons vs eta");
1270  TH1F *h_ele_eta_narrowFrac = (TH1F *)h_ele_eta_narrow->Clone("h_ele_eta_narrowFrac");
1271  h_ele_eta_narrowFrac->Reset();
1272  h_ele_eta_narrowFrac->Divide(h_ele_eta_narrow, h_ele_eta, 1, 1);
1273  h_ele_eta_narrowFrac->GetXaxis()->SetTitle("|#eta|");
1274  h_ele_eta_narrowFrac->GetYaxis()->SetTitle("Fraction of electrons");
1275  h_ele_eta_narrowFrac->SetTitle("fraction of narrow electrons vs eta");
1276  TH1F *h_ele_eta_showerFrac = (TH1F *)h_ele_eta_shower->Clone("h_ele_eta_showerFrac");
1277  h_ele_eta_showerFrac->Reset();
1278  h_ele_eta_showerFrac->Divide(h_ele_eta_shower, h_ele_eta, 1, 1);
1279  h_ele_eta_showerFrac->GetXaxis()->SetTitle("|#eta|");
1280  h_ele_eta_showerFrac->GetYaxis()->SetTitle("Fraction of electrons");
1281  h_ele_eta_showerFrac->SetTitle("fraction of showering electrons vs eta");
1282 
1283  // fbrem
1284  TH1F *h_ele_xOverX0VsEta = new TH1F("h_ele_xOverx0VsEta", "mean X/X_0 vs eta", nbineta / 2, 0.0, 2.5);
1285  for (int ibin = 1; ibin < h_ele_fbremVsEta_mean->GetNbinsX() + 1; ibin++) {
1286  double xOverX0 = 0.;
1287  if (h_ele_fbremVsEta_mean->GetBinContent(ibin) > 0.)
1288  xOverX0 = -log(h_ele_fbremVsEta_mean->GetBinContent(ibin));
1289  h_ele_xOverX0VsEta->SetBinContent(ibin, xOverX0);
1290  }
1291 
1292  //profiles from 2D histos
1293  TProfile *p_ele_PoPmatchingObjectVsEta = h_ele_PoPmatchingObjectVsEta->ProfileX();
1294  p_ele_PoPmatchingObjectVsEta->SetTitle("mean ele momentum / matching SC energy vs eta");
1295  p_ele_PoPmatchingObjectVsEta->GetXaxis()->SetTitle("#eta");
1296  p_ele_PoPmatchingObjectVsEta->GetYaxis()->SetTitle("<P/E_{matching jet}>");
1297  p_ele_PoPmatchingObjectVsEta->Write();
1298  TProfile *p_ele_PoPmatchingObjectVsPhi = h_ele_PoPmatchingObjectVsPhi->ProfileX();
1299  p_ele_PoPmatchingObjectVsPhi->SetTitle("mean ele momentum / gen momentum vs phi");
1300  p_ele_PoPmatchingObjectVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1301  p_ele_PoPmatchingObjectVsPhi->GetYaxis()->SetTitle("<P/E_{matching jet}>");
1302  p_ele_PoPmatchingObjectVsPhi->Write();
1303  TProfile *p_ele_EtaMnEtamatchingObjectVsEta = h_ele_EtaMnEtamatchingObjectVsEta->ProfileX();
1304  p_ele_EtaMnEtamatchingObjectVsEta->GetXaxis()->SetTitle("#eta");
1305  p_ele_EtaMnEtamatchingObjectVsEta->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{matching jet}>");
1306  p_ele_EtaMnEtamatchingObjectVsEta->Write();
1307  TProfile *p_ele_EtaMnEtamatchingObjectVsPhi = h_ele_EtaMnEtamatchingObjectVsPhi->ProfileX();
1308  p_ele_EtaMnEtamatchingObjectVsPhi->GetXaxis()->SetTitle("#phi");
1309  p_ele_EtaMnEtamatchingObjectVsPhi->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{matching jet}>");
1310  p_ele_EtaMnEtamatchingObjectVsPhi->Write();
1311  TProfile *p_ele_PhiMnPhimatchingObjectVsEta = h_ele_PhiMnPhimatchingObjectVsEta->ProfileX();
1312  p_ele_PhiMnPhimatchingObjectVsEta->GetXaxis()->SetTitle("#eta");
1313  p_ele_PhiMnPhimatchingObjectVsEta->GetYaxis()->SetTitle("<#phi_{rec} - #phi_{matching jet}> (rad)");
1314  p_ele_PhiMnPhimatchingObjectVsEta->Write();
1315  TProfile *p_ele_PhiMnPhimatchingObjectVsPhi = h_ele_PhiMnPhimatchingObjectVsPhi->ProfileX();
1316  p_ele_PhiMnPhimatchingObjectVsPhi->GetXaxis()->SetTitle("#phi");
1317  p_ele_PhiMnPhimatchingObjectVsPhi->GetYaxis()->SetTitle("<#phi_{rec} - #phi_{matching jet}> (rad)");
1318  p_ele_PhiMnPhimatchingObjectVsPhi->Write();
1319  TProfile *p_ele_vertexPtVsEta = h_ele_vertexPtVsEta->ProfileX();
1320  p_ele_vertexPtVsEta->GetXaxis()->SetTitle("#eta");
1321  p_ele_vertexPtVsEta->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
1322  p_ele_vertexPtVsEta->Write();
1323  TProfile *p_ele_vertexPtVsPhi = h_ele_vertexPtVsPhi->ProfileX();
1324  p_ele_vertexPtVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1325  p_ele_vertexPtVsPhi->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
1326  p_ele_vertexPtVsPhi->Write();
1327  TProfile *p_ele_EoPVsEta = h_ele_EoPVsEta->ProfileX();
1328  p_ele_EoPVsEta->GetXaxis()->SetTitle("#eta");
1329  p_ele_EoPVsEta->GetYaxis()->SetTitle("<E/P_{vertex}>");
1330  p_ele_EoPVsEta->Write();
1331  TProfile *p_ele_EoPVsPhi = h_ele_EoPVsPhi->ProfileX();
1332  p_ele_EoPVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1333  p_ele_EoPVsPhi->GetYaxis()->SetTitle("<E/P_{vertex}>");
1334  p_ele_EoPVsPhi->Write();
1335  TProfile *p_ele_EoPoutVsEta = h_ele_EoPoutVsEta->ProfileX();
1336  p_ele_EoPoutVsEta->GetXaxis()->SetTitle("#eta");
1337  p_ele_EoPoutVsEta->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
1338  p_ele_EoPoutVsEta->Write();
1339  TProfile *p_ele_EoPoutVsPhi = h_ele_EoPoutVsPhi->ProfileX();
1340  p_ele_EoPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1341  p_ele_EoPoutVsPhi->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
1342  p_ele_EoPoutVsPhi->Write();
1343  TProfile *p_ele_EeleOPoutVsEta = h_ele_EeleOPoutVsEta->ProfileX();
1344  p_ele_EeleOPoutVsEta->SetTitle("mean ele Eele/pout vs eta");
1345  p_ele_EeleOPoutVsEta->GetXaxis()->SetTitle("#eta");
1346  p_ele_EeleOPoutVsEta->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
1347  p_ele_EeleOPoutVsEta->Write();
1348  TProfile *p_ele_EeleOPoutVsPhi = h_ele_EeleOPoutVsPhi->ProfileX();
1349  p_ele_EeleOPoutVsPhi->SetTitle("mean ele Eele/pout vs phi");
1350  p_ele_EeleOPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1351  p_ele_EeleOPoutVsPhi->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
1352  p_ele_EeleOPoutVsPhi->Write();
1353  TProfile *p_ele_HoEVsEta = h_ele_HoEVsEta->ProfileX();
1354  p_ele_HoEVsEta->GetXaxis()->SetTitle("#eta");
1355  p_ele_HoEVsEta->GetYaxis()->SetTitle("<H/E>");
1356  p_ele_HoEVsEta->Write();
1357  TProfile *p_ele_HoEVsPhi = h_ele_HoEVsPhi->ProfileX();
1358  p_ele_HoEVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1359  p_ele_HoEVsPhi->GetYaxis()->SetTitle("<H/E>");
1360  p_ele_HoEVsPhi->Write();
1361  TProfile *p_ele_chi2VsEta = h_ele_chi2VsEta->ProfileX();
1362  p_ele_chi2VsEta->GetXaxis()->SetTitle("#eta");
1363  p_ele_chi2VsEta->GetYaxis()->SetTitle("<#Chi^{2}>");
1364  p_ele_chi2VsEta->Write();
1365  TProfile *p_ele_chi2VsPhi = h_ele_chi2VsPhi->ProfileX();
1366  p_ele_chi2VsPhi->GetXaxis()->SetTitle("#phi (rad)");
1367  p_ele_chi2VsPhi->GetYaxis()->SetTitle("<#Chi^{2}>");
1368  p_ele_chi2VsPhi->Write();
1369  TProfile *p_ele_foundHitsVsEta = h_ele_foundHitsVsEta->ProfileX();
1370  p_ele_foundHitsVsEta->GetXaxis()->SetTitle("#eta");
1371  p_ele_foundHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
1372  p_ele_foundHitsVsEta->Write();
1373  TProfile *p_ele_foundHitsVsPhi = h_ele_foundHitsVsPhi->ProfileX();
1374  p_ele_foundHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1375  p_ele_foundHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
1376  p_ele_foundHitsVsPhi->Write();
1377  TProfile *p_ele_lostHitsVsEta = h_ele_lostHitsVsEta->ProfileX();
1378  p_ele_lostHitsVsEta->GetXaxis()->SetTitle("#eta");
1379  p_ele_lostHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
1380  p_ele_lostHitsVsEta->Write();
1381  TProfile *p_ele_lostHitsVsPhi = h_ele_lostHitsVsPhi->ProfileX();
1382  p_ele_lostHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1383  p_ele_lostHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
1384  p_ele_lostHitsVsPhi->Write();
1385  TProfile *p_ele_vertexTIPVsEta = h_ele_vertexTIPVsEta->ProfileX();
1386  p_ele_vertexTIPVsEta->SetTitle("mean tip (wrt gen vtx) vs eta");
1387  p_ele_vertexTIPVsEta->GetXaxis()->SetTitle("#eta");
1388  p_ele_vertexTIPVsEta->GetYaxis()->SetTitle("<TIP> (cm)");
1389  p_ele_vertexTIPVsEta->Write();
1390  TProfile *p_ele_vertexTIPVsPhi = h_ele_vertexTIPVsPhi->ProfileX();
1391  p_ele_vertexTIPVsPhi->SetTitle("mean tip (wrt gen vtx) vs phi");
1392  p_ele_vertexTIPVsPhi->GetXaxis()->SetTitle("#phi");
1393  p_ele_vertexTIPVsPhi->GetYaxis()->SetTitle("<TIP> (cm)");
1394  p_ele_vertexTIPVsPhi->Write();
1395  TProfile *p_ele_vertexTIPVsPt = h_ele_vertexTIPVsPt->ProfileX();
1396  p_ele_vertexTIPVsPt->SetTitle("mean tip (wrt gen vtx) vs phi");
1397  p_ele_vertexTIPVsPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1398  p_ele_vertexTIPVsPt->GetYaxis()->SetTitle("<TIP> (cm)");
1399  p_ele_vertexTIPVsPt->Write();
1400 
1401  // mc truth
1402 
1403  h_matchingObjectNum->Write();
1404 
1405  // rec event
1406 
1407  histNum_->Write();
1408 
1409  // mc
1410  h_matchingObjectEta->Write();
1411  h_matchingObjectAbsEta->Write();
1412  h_matchingObjectP->Write();
1413  h_matchingObjectPt->Write();
1414  h_matchingObjectPhi->Write();
1415  h_matchingObjectZ->Write();
1416 
1417  // all electrons
1418  h_ele_EoverP_all->Write();
1419  h_ele_EseedOP_all->Write();
1420  h_ele_EoPout_all->Write();
1421  h_ele_EeleOPout_all->Write();
1422  h_ele_dEtaSc_propVtx_all->Write();
1423  h_ele_dPhiSc_propVtx_all->Write();
1424  h_ele_dEtaCl_propOut_all->Write();
1425  h_ele_dPhiCl_propOut_all->Write();
1426  h_ele_HoE_all->Write();
1427  h_ele_TIP_all->Write();
1428  h_ele_vertexPt_all->Write();
1429  h_ele_vertexEta_all->Write();
1430  h_ele_mee_all->Write();
1431  h_ele_mee_os->Write();
1432  h_ele_E2mnE1vsMee_all->Write();
1433  h_ele_E2mnE1vsMee_egeg_all->Write();
1434 
1435  // matched electrons
1436  h_ele_charge->Write();
1437  h_ele_chargeVsEta->Write();
1438  h_ele_chargeVsPhi->Write();
1439  h_ele_chargeVsPt->Write();
1440  h_ele_vertexP->Write();
1441  h_ele_vertexPt->Write();
1442  h_ele_vertexPtVsEta->Write();
1443  h_ele_vertexPtVsPhi->Write();
1445  h_ele_vertexEta->Write();
1446  h_ele_vertexEtaVsPhi->Write();
1449  h_ele_vertexPhi->Write();
1451  h_ele_vertexX->Write();
1452  h_ele_vertexY->Write();
1453  h_ele_vertexZ->Write();
1454  h_ele_vertexTIP->Write();
1456  h_ele_vertexTIPVsEta->Write();
1457  h_ele_vertexTIPVsPhi->Write();
1458  h_ele_vertexTIPVsPt->Write();
1459  h_ele_PoPmatchingObject->Write();
1462  h_ele_PoPmatchingObjectVsPt->Write();
1474 
1475  // matched electron, superclusters
1476  histSclEn_->Write();
1479  histSclEt_->Write();
1480  histSclEtVsEta_->Write();
1481  histSclEtVsPhi_->Write();
1482  histSclEtaVsPhi_->Write();
1483  histSclEta_->Write();
1484  histSclPhi_->Write();
1485  histSclSigIEtaIEta_->Write();
1486  histSclSigIEtaIEta_barrel_->Write();
1487  histSclSigIEtaIEta_endcaps_->Write();
1488  histSclE1x5_->Write();
1489  histSclE1x5_barrel_->Write();
1490  histSclE1x5_endcaps_->Write();
1491  histSclE2x5max_->Write();
1492  histSclE2x5max_barrel_->Write();
1493  histSclE2x5max_endcaps_->Write();
1494  histSclE5x5_->Write();
1495  histSclE5x5_barrel_->Write();
1496  histSclE5x5_endcaps_->Write();
1497 
1498  // matched electron, gsf tracks
1499  h_ele_ambiguousTracks->Write();
1500  h_ele_ambiguousTracksVsEta->Write();
1501  h_ele_ambiguousTracksVsPhi->Write();
1502  h_ele_ambiguousTracksVsPt->Write();
1503  h_ele_foundHits->Write();
1504  h_ele_foundHitsVsEta->Write();
1505  h_ele_foundHitsVsPhi->Write();
1506  h_ele_foundHitsVsPt->Write();
1507  h_ele_lostHits->Write();
1508  h_ele_lostHitsVsEta->Write();
1509  h_ele_lostHitsVsPhi->Write();
1510  h_ele_lostHitsVsPt->Write();
1511  h_ele_chi2->Write();
1512  h_ele_chi2VsEta->Write();
1513  h_ele_chi2VsPhi->Write();
1514  h_ele_chi2VsPt->Write();
1515  h_ele_PinMnPout->Write();
1516  h_ele_PinMnPout_mode->Write();
1517  h_ele_PinMnPoutVsEta_mode->Write();
1518  h_ele_PinMnPoutVsPhi_mode->Write();
1519  h_ele_PinMnPoutVsPt_mode->Write();
1520  h_ele_PinMnPoutVsE_mode->Write();
1521  h_ele_PinMnPoutVsChi2_mode->Write();
1522  h_ele_outerP->Write();
1523  h_ele_outerP_mode->Write();
1524  h_ele_outerPVsEta_mode->Write();
1525  h_ele_outerPt->Write();
1526  h_ele_outerPt_mode->Write();
1527  h_ele_outerPtVsEta_mode->Write();
1528  h_ele_outerPtVsPhi_mode->Write();
1529  h_ele_outerPtVsPt_mode->Write();
1530 
1531  // matched electrons, matching
1532  h_ele_EoP->Write();
1533  h_ele_EoP_eg->Write();
1534  h_ele_EoP_barrel->Write();
1535  h_ele_EoP_eg_barrel->Write();
1536  h_ele_EoP_endcaps->Write();
1537  h_ele_EoP_eg_endcaps->Write();
1538  h_ele_EoPVsEta->Write();
1539  h_ele_EoPVsPhi->Write();
1540  h_ele_EoPVsE->Write();
1541  h_ele_EseedOP->Write();
1542  h_ele_EseedOP_eg->Write();
1543  h_ele_EseedOP_barrel->Write();
1544  h_ele_EseedOP_eg_barrel->Write();
1545  h_ele_EseedOP_endcaps->Write();
1546  h_ele_EseedOP_eg_endcaps->Write();
1547  h_ele_EseedOPVsEta->Write();
1548  h_ele_EseedOPVsPhi->Write();
1549  h_ele_EseedOPVsE->Write();
1550  h_ele_EoPout->Write();
1551  h_ele_EoPout_eg->Write();
1552  h_ele_EoPout_barrel->Write();
1553  h_ele_EoPout_eg_barrel->Write();
1554  h_ele_EoPout_endcaps->Write();
1555  h_ele_EoPout_eg_endcaps->Write();
1556  h_ele_EoPoutVsEta->Write();
1557  h_ele_EoPoutVsPhi->Write();
1558  h_ele_EoPoutVsE->Write();
1559  h_ele_EeleOPout->Write();
1560  h_ele_EeleOPout_eg->Write();
1561  h_ele_EeleOPout_barrel->Write();
1562  h_ele_EeleOPout_eg_barrel->Write();
1563  h_ele_EeleOPout_endcaps->Write();
1564  h_ele_EeleOPout_eg_endcaps->Write();
1565  h_ele_EeleOPoutVsEta->Write();
1566  h_ele_EeleOPoutVsPhi->Write();
1567  h_ele_EeleOPoutVsE->Write();
1568  h_ele_dEtaSc_propVtx->Write();
1569  h_ele_dEtaSc_propVtx_eg->Write();
1570  h_ele_dEtaSc_propVtx_barrel->Write();
1574  h_ele_dEtaScVsEta_propVtx->Write();
1575  h_ele_dEtaScVsPhi_propVtx->Write();
1576  h_ele_dEtaScVsPt_propVtx->Write();
1577  h_ele_dPhiSc_propVtx->Write();
1578  h_ele_dPhiSc_propVtx_eg->Write();
1579  h_ele_dPhiSc_propVtx_barrel->Write();
1583  h_ele_dPhiScVsEta_propVtx->Write();
1584  h_ele_dPhiScVsPhi_propVtx->Write();
1585  h_ele_dPhiScVsPt_propVtx->Write();
1586  h_ele_dEtaCl_propOut->Write();
1587  h_ele_dEtaCl_propOut_eg->Write();
1588  h_ele_dEtaCl_propOut_barrel->Write();
1592  h_ele_dEtaClVsEta_propOut->Write();
1593  h_ele_dEtaClVsPhi_propOut->Write();
1594  h_ele_dEtaClVsPt_propOut->Write();
1595  h_ele_dPhiCl_propOut->Write();
1596  h_ele_dPhiCl_propOut_eg->Write();
1597  h_ele_dPhiCl_propOut_barrel->Write();
1601  h_ele_dPhiClVsEta_propOut->Write();
1602  h_ele_dPhiClVsPhi_propOut->Write();
1603  h_ele_dPhiClVsPt_propOut->Write();
1604  h_ele_dEtaEleCl_propOut->Write();
1605  h_ele_dEtaEleCl_propOut_eg->Write();
1612  h_ele_dEtaEleClVsPt_propOut->Write();
1613  h_ele_dPhiEleCl_propOut->Write();
1614  h_ele_dPhiEleCl_propOut_eg->Write();
1621  h_ele_dPhiEleClVsPt_propOut->Write();
1622  h_ele_HoE->Write();
1623  h_ele_HoE_eg->Write();
1624  h_ele_HoE_barrel->Write();
1625  h_ele_HoE_eg_barrel->Write();
1626  h_ele_HoE_endcaps->Write();
1627  h_ele_HoE_eg_endcaps->Write();
1628  h_ele_HoE_fiducial->Write();
1629  h_ele_HoEVsEta->Write();
1630  h_ele_HoEVsPhi->Write();
1631  h_ele_HoEVsE->Write();
1632 
1633  h_ele_seed_dphi2_->Write();
1634  h_ele_seed_subdet2_->Write();
1635  TProfile *p_ele_seed_dphi2VsEta_ = h_ele_seed_dphi2VsEta_->ProfileX();
1636  p_ele_seed_dphi2VsEta_->SetTitle("mean ele seed dphi 2nd layer vs eta");
1637  p_ele_seed_dphi2VsEta_->GetXaxis()->SetTitle("#eta");
1638  p_ele_seed_dphi2VsEta_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
1639  p_ele_seed_dphi2VsEta_->SetMinimum(-0.004);
1640  p_ele_seed_dphi2VsEta_->SetMaximum(0.004);
1641  p_ele_seed_dphi2VsEta_->Write();
1642  TProfile *p_ele_seed_dphi2VsPt_ = h_ele_seed_dphi2VsPt_->ProfileX();
1643  p_ele_seed_dphi2VsPt_->SetTitle("mean ele seed dphi 2nd layer vs pt");
1644  p_ele_seed_dphi2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1645  p_ele_seed_dphi2VsPt_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
1646  p_ele_seed_dphi2VsPt_->SetMinimum(-0.004);
1647  p_ele_seed_dphi2VsPt_->SetMaximum(0.004);
1648  p_ele_seed_dphi2VsPt_->Write();
1649  h_ele_seed_drz2_->Write();
1650  TProfile *p_ele_seed_drz2VsEta_ = h_ele_seed_drz2VsEta_->ProfileX();
1651  p_ele_seed_drz2VsEta_->SetTitle("mean ele seed dr(dz) 2nd layer vs eta");
1652  p_ele_seed_drz2VsEta_->GetXaxis()->SetTitle("#eta");
1653  p_ele_seed_drz2VsEta_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
1654  p_ele_seed_drz2VsEta_->SetMinimum(-0.15);
1655  p_ele_seed_drz2VsEta_->SetMaximum(0.15);
1656  p_ele_seed_drz2VsEta_->Write();
1657  TProfile *p_ele_seed_drz2VsPt_ = h_ele_seed_drz2VsPt_->ProfileX();
1658  p_ele_seed_drz2VsPt_->SetTitle("mean ele seed dr(dz) 2nd layer vs pt");
1659  p_ele_seed_drz2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1660  p_ele_seed_drz2VsPt_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
1661  p_ele_seed_drz2VsPt_->SetMinimum(-0.15);
1662  p_ele_seed_drz2VsPt_->SetMaximum(0.15);
1663  p_ele_seed_drz2VsPt_->Write();
1664 
1665  // classes
1666  h_ele_classes->Write();
1667  h_ele_eta->Write();
1668  h_ele_eta_golden->Write();
1669  h_ele_eta_bbrem->Write();
1670  h_ele_eta_narrow->Write();
1671  h_ele_eta_shower->Write();
1672  h_ele_PinVsPoutGolden_mode->Write();
1674  h_ele_PinVsPoutGolden_mean->Write();
1684 
1685  // fbrem
1686  h_ele_fbrem->Write();
1687  h_ele_fbremVsEta_mode->Write();
1688  h_ele_fbremVsEta_mean->Write();
1689  h_ele_etaEff->Write();
1690  h_ele_zEff->Write();
1691  h_ele_phiEff->Write();
1692  h_ele_absetaEff->Write();
1693  h_ele_ptEff->Write();
1694  h_ele_etaEff_all->Write();
1695  h_ele_ptEff_all->Write();
1696  h_ele_eta_goldenFrac->Write();
1697  h_ele_eta_bbremFrac->Write();
1698  h_ele_eta_narrowFrac->Write();
1699  h_ele_eta_showerFrac->Write();
1700  h_ele_xOverX0VsEta->Write();
1701 
1702  // e/g et pflow electrons
1703  h_ele_mva->Write();
1704  h_ele_provenance->Write();
1705 
1706  // isolation
1707  h_ele_tkSumPt_dr03->GetXaxis()->SetTitle("TkIsoSum, cone 0.3 (GeV/c)");
1708  h_ele_tkSumPt_dr03->GetYaxis()->SetTitle("Events");
1709  h_ele_tkSumPt_dr03->Write();
1710  h_ele_ecalRecHitSumEt_dr03->GetXaxis()->SetTitle("EcalIsoSum, cone 0.3 (GeV)");
1711  h_ele_ecalRecHitSumEt_dr03->GetYaxis()->SetTitle("Events");
1712  h_ele_ecalRecHitSumEt_dr03->Write();
1713  h_ele_hcalDepth1TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.3 (GeV)");
1714  h_ele_hcalDepth1TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
1716  h_ele_hcalDepth2TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.3 (GeV)");
1717  h_ele_hcalDepth2TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
1719  h_ele_tkSumPt_dr04->GetXaxis()->SetTitle("TkIsoSum, cone 0.4 (GeV/c)");
1720  h_ele_tkSumPt_dr04->GetYaxis()->SetTitle("Events");
1721  h_ele_tkSumPt_dr04->Write();
1722  h_ele_ecalRecHitSumEt_dr04->GetXaxis()->SetTitle("EcalIsoSum, cone 0.4 (GeV)");
1723  h_ele_ecalRecHitSumEt_dr04->GetYaxis()->SetTitle("Events");
1724  h_ele_ecalRecHitSumEt_dr04->Write();
1725  h_ele_hcalDepth1TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.4 (GeV)");
1726  h_ele_hcalDepth1TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
1728  h_ele_hcalDepth2TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.4 (GeV)");
1729  h_ele_hcalDepth2TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
1731 }
1732 
1734  std::cout << "analyzing new event " << std::endl;
1735 
1736  // get reco electrons
1738  iEvent.getByLabel(electronCollection_, gsfElectrons);
1739  edm::LogInfo("") << "\n\n =================> Treating event " << iEvent.id() << " Number of electrons "
1740  << gsfElectrons.product()->size();
1741 
1742  // get reco calojet collection
1744  iEvent.getByLabel(matchingObjectCollection_, recoCaloJets);
1745 
1746  // get the beamspot from the Event:
1747  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
1748  iEvent.getByLabel(beamSpot_, recoBeamSpotHandle);
1749  const BeamSpot bs = *recoBeamSpotHandle;
1750 
1751  histNum_->Fill((*gsfElectrons).size());
1752 
1753  // all rec electrons
1754  for (reco::GsfElectronCollection::const_iterator gsfIter = gsfElectrons->begin(); gsfIter != gsfElectrons->end();
1755  gsfIter++) {
1756  // preselect electrons
1757  if (gsfIter->pt() > maxPt_ || std::abs(gsfIter->eta()) > maxAbsEta_)
1758  continue;
1759  h_ele_EoverP_all->Fill(gsfIter->eSuperClusterOverP());
1760  h_ele_EseedOP_all->Fill(gsfIter->eSeedClusterOverP());
1761  h_ele_EoPout_all->Fill(gsfIter->eSeedClusterOverPout());
1762  h_ele_EeleOPout_all->Fill(gsfIter->eEleClusterOverPout());
1763  h_ele_dEtaSc_propVtx_all->Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx());
1764  h_ele_dPhiSc_propVtx_all->Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx());
1765  h_ele_dEtaCl_propOut_all->Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo());
1766  h_ele_dPhiCl_propOut_all->Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo());
1767  h_ele_HoE_all->Fill(gsfIter->hadronicOverEm());
1768  double d = gsfIter->vertex().x() * gsfIter->vertex().x() + gsfIter->vertex().y() * gsfIter->vertex().y();
1769  h_ele_TIP_all->Fill(sqrt(d));
1770  h_ele_vertexEta_all->Fill(gsfIter->eta());
1771  h_ele_vertexPt_all->Fill(gsfIter->pt());
1772  float enrj1 = gsfIter->superCluster()->energy();
1773  // mee
1774  for (reco::GsfElectronCollection::const_iterator gsfIter2 = gsfIter + 1; gsfIter2 != gsfElectrons->end();
1775  gsfIter2++) {
1776  math::XYZTLorentzVector p12 = (*gsfIter).p4() + (*gsfIter2).p4();
1777  float mee2 = p12.Dot(p12);
1778  h_ele_mee_all->Fill(sqrt(mee2));
1779  float enrj2 = gsfIter2->superCluster()->energy();
1780  h_ele_E2mnE1vsMee_all->Fill(sqrt(mee2), enrj2 - enrj1);
1781  if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
1782  h_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2), enrj2 - enrj1);
1783  if (gsfIter->charge() * gsfIter2->charge() < 0.)
1784  h_ele_mee_os->Fill(sqrt(mee2));
1785  }
1786  }
1787 
1788  // association matching object-reco electrons
1789  int matchingObjectNum = 0;
1790 
1791  for (reco::CaloJetCollection::const_iterator moIter = recoCaloJets->begin(); moIter != recoCaloJets->end();
1792  moIter++) {
1793  // number of matching objects
1794  matchingObjectNum++;
1795 
1796  if (moIter->energy() / cosh(moIter->eta()) > maxPt_ || std::abs(moIter->eta()) > maxAbsEta_)
1797  continue;
1798 
1799  // suppress the endcaps
1800  //if (std::abs(moIter->eta()) > 1.5) continue;
1801  // select central z
1802  //if ( std::abs((*mcIter)->production_vertex()->position().z())>50.) continue;
1803 
1804  h_matchingObjectEta->Fill(moIter->eta());
1805  h_matchingObjectAbsEta->Fill(std::abs(moIter->eta()));
1806  h_matchingObjectP->Fill(moIter->energy());
1807  h_matchingObjectPt->Fill(moIter->energy() / cosh(moIter->eta()));
1808  h_matchingObjectPhi->Fill(moIter->phi());
1809  h_matchingObjectZ->Fill(moIter->vz());
1810 
1811  // looking for the best matching gsf electron
1812  bool okGsfFound = false;
1813  double gsfOkRatio = 999999.;
1814 
1815  // find best matched electron
1816  reco::GsfElectron bestGsfElectron;
1817  for (reco::GsfElectronCollection::const_iterator gsfIter = gsfElectrons->begin(); gsfIter != gsfElectrons->end();
1818  gsfIter++) {
1819  double dphi = gsfIter->phi() - moIter->phi();
1820  if (std::abs(dphi) > CLHEP::pi)
1821  dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
1822  double deltaR = sqrt(std::pow((gsfIter->eta() - moIter->eta()), 2) + std::pow(dphi, 2));
1823  if (deltaR < deltaR_) {
1824  //if ( (genPc->pdg_id() == 11) && (gsfIter->charge() < 0.) || (genPc->pdg_id() == -11) &&
1825  //(gsfIter->charge() > 0.) ){
1826  double tmpGsfRatio = gsfIter->p() / moIter->energy();
1827  if (std::abs(tmpGsfRatio - 1) < std::abs(gsfOkRatio - 1)) {
1828  gsfOkRatio = tmpGsfRatio;
1829  bestGsfElectron = *gsfIter;
1830  okGsfFound = true;
1831  }
1832  //}
1833  }
1834  } // loop over rec ele to look for the best one
1835 
1836  // analysis when the matching object is matched by a rec electron
1837  if (okGsfFound) {
1838  // electron related distributions
1839  h_ele_charge->Fill(bestGsfElectron.charge());
1840  h_ele_chargeVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.charge());
1841  h_ele_chargeVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.charge());
1842  h_ele_chargeVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.charge());
1843  h_ele_vertexP->Fill(bestGsfElectron.p());
1844  h_ele_vertexPt->Fill(bestGsfElectron.pt());
1845  h_ele_vertexPtVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.pt());
1846  h_ele_vertexPtVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.pt());
1847  h_ele_vertexEta->Fill(bestGsfElectron.eta());
1848  // generated distributions for matched electrons
1849  h_ele_matchingObjectPt_matched->Fill(moIter->energy() / cosh(moIter->eta()));
1850  h_ele_matchingObjectPhi_matched->Fill(moIter->phi());
1851  h_ele_matchingObjectAbsEta_matched->Fill(std::abs(moIter->eta()));
1852  h_ele_matchingObjectEta_matched->Fill(moIter->eta());
1853  h_ele_vertexEtaVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta());
1854  h_ele_vertexPhi->Fill(bestGsfElectron.phi());
1855  h_ele_vertexX->Fill(bestGsfElectron.vertex().x());
1856  h_ele_vertexY->Fill(bestGsfElectron.vertex().y());
1857  h_ele_vertexZ->Fill(bestGsfElectron.vertex().z());
1858  h_ele_matchingObjectZ_matched->Fill(moIter->vz());
1859  double d =
1860  (bestGsfElectron.vertex().x() - bs.position().x()) * (bestGsfElectron.vertex().x() - bs.position().x()) +
1861  (bestGsfElectron.vertex().y() - bs.position().y()) * (bestGsfElectron.vertex().y() - bs.position().y());
1862  d = sqrt(d);
1863  h_ele_vertexTIP->Fill(d);
1864  h_ele_vertexTIPVsEta->Fill(bestGsfElectron.eta(), d);
1865  h_ele_vertexTIPVsPhi->Fill(bestGsfElectron.phi(), d);
1866  h_ele_vertexTIPVsPt->Fill(bestGsfElectron.pt(), d);
1867  h_ele_EtaMnEtamatchingObject->Fill(bestGsfElectron.eta() - moIter->eta());
1868  h_ele_EtaMnEtamatchingObjectVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eta() - moIter->eta());
1869  h_ele_EtaMnEtamatchingObjectVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta() - moIter->eta());
1870  h_ele_EtaMnEtamatchingObjectVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.eta() - moIter->eta());
1871  h_ele_PhiMnPhimatchingObject->Fill(bestGsfElectron.phi() - moIter->phi());
1872  h_ele_PhiMnPhimatchingObject2->Fill(bestGsfElectron.phi() - moIter->phi());
1873  h_ele_PhiMnPhimatchingObjectVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.phi() - moIter->phi());
1874  h_ele_PhiMnPhimatchingObjectVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.phi() - moIter->phi());
1875  h_ele_PhiMnPhimatchingObjectVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.phi() - moIter->phi());
1876  h_ele_PoPmatchingObject->Fill(bestGsfElectron.p() / moIter->energy());
1877  h_ele_PoPmatchingObjectVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.p() / moIter->energy());
1878  h_ele_PoPmatchingObjectVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.p() / moIter->energy());
1879  h_ele_PoPmatchingObjectVsPt->Fill(bestGsfElectron.py(), bestGsfElectron.p() / moIter->energy());
1880  if (bestGsfElectron.isEB())
1881  h_ele_PoPmatchingObject_barrel->Fill(bestGsfElectron.p() / moIter->energy());
1882  if (bestGsfElectron.isEE())
1883  h_ele_PoPmatchingObject_endcaps->Fill(bestGsfElectron.p() / moIter->energy());
1884 
1885  // supercluster related distributions
1886  reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
1887  if (!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.trackerDrivenSeed())
1888  sclRef = bestGsfElectron.parentSuperCluster();
1889  histSclEn_->Fill(sclRef->energy());
1890  double R = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
1891  double Rt = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
1892  histSclEt_->Fill(sclRef->energy() * (Rt / R));
1893  histSclEtVsEta_->Fill(sclRef->eta(), sclRef->energy() * (Rt / R));
1894  histSclEtVsPhi_->Fill(sclRef->phi(), sclRef->energy() * (Rt / R));
1895  if (bestGsfElectron.isEB())
1896  histSclEoEmatchingObject_barrel->Fill(sclRef->energy() / moIter->energy());
1897  if (bestGsfElectron.isEE())
1898  histSclEoEmatchingObject_endcaps->Fill(sclRef->energy() / moIter->energy());
1899  histSclEta_->Fill(sclRef->eta());
1900  histSclEtaVsPhi_->Fill(sclRef->phi(), sclRef->eta());
1901  histSclPhi_->Fill(sclRef->phi());
1902  histSclSigIEtaIEta_->Fill(bestGsfElectron.scSigmaIEtaIEta());
1903  if (bestGsfElectron.isEB())
1904  histSclSigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
1905  if (bestGsfElectron.isEE())
1906  histSclSigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
1907  histSclE1x5_->Fill(bestGsfElectron.scE1x5());
1908  if (bestGsfElectron.isEB())
1909  histSclE1x5_barrel_->Fill(bestGsfElectron.scE1x5());
1910  if (bestGsfElectron.isEE())
1911  histSclE1x5_endcaps_->Fill(bestGsfElectron.scE1x5());
1912  histSclE2x5max_->Fill(bestGsfElectron.scE2x5Max());
1913  if (bestGsfElectron.isEB())
1914  histSclE2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max());
1915  if (bestGsfElectron.isEE())
1916  histSclE2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max());
1917  histSclE5x5_->Fill(bestGsfElectron.scE5x5());
1918  if (bestGsfElectron.isEB())
1919  histSclE5x5_barrel_->Fill(bestGsfElectron.scE5x5());
1920  if (bestGsfElectron.isEE())
1921  histSclE5x5_endcaps_->Fill(bestGsfElectron.scE5x5());
1922 
1923  // track related distributions
1924  h_ele_ambiguousTracks->Fill(bestGsfElectron.ambiguousGsfTracksSize());
1925  h_ele_ambiguousTracksVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize());
1926  h_ele_ambiguousTracksVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize());
1927  h_ele_ambiguousTracksVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize());
1928  if (!readAOD_) { // track extra does not exist in AOD
1929  h_ele_foundHits->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits());
1930  h_ele_foundHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits());
1931  h_ele_foundHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits());
1932  h_ele_foundHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits());
1933  h_ele_lostHits->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits());
1934  h_ele_lostHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits());
1935  h_ele_lostHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits());
1936  h_ele_lostHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits());
1937  h_ele_chi2->Fill(bestGsfElectron.gsfTrack()->normalizedChi2());
1938  h_ele_chi2VsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2());
1939  h_ele_chi2VsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2());
1940  h_ele_chi2VsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2());
1941  }
1942  // from gsf track interface, hence using mean
1943  if (!readAOD_) { // track extra does not exist in AOD
1944  h_ele_PinMnPout->Fill(bestGsfElectron.gsfTrack()->innerMomentum().R() -
1945  bestGsfElectron.gsfTrack()->outerMomentum().R());
1946  h_ele_outerP->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R());
1947  h_ele_outerPt->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho());
1948  }
1949  // from electron interface, hence using mode
1950  h_ele_PinMnPout_mode->Fill(bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
1952  bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
1954  bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
1955  h_ele_PinMnPoutVsPt_mode->Fill(bestGsfElectron.pt(),
1956  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
1957  h_ele_PinMnPoutVsE_mode->Fill(bestGsfElectron.caloEnergy(),
1958  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
1959  if (!readAOD_) // track extra does not exist in AOD
1961  bestGsfElectron.gsfTrack()->normalizedChi2(),
1962  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
1963  h_ele_outerP_mode->Fill(bestGsfElectron.trackMomentumOut().R());
1964  h_ele_outerPVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().R());
1965  h_ele_outerPt_mode->Fill(bestGsfElectron.trackMomentumOut().Rho());
1966  h_ele_outerPtVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().Rho());
1967  h_ele_outerPtVsPhi_mode->Fill(bestGsfElectron.phi(), bestGsfElectron.trackMomentumOut().Rho());
1968  h_ele_outerPtVsPt_mode->Fill(bestGsfElectron.pt(), bestGsfElectron.trackMomentumOut().Rho());
1969 
1970  if (!readAOD_) { // track extra does not exist in AOD
1971  edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
1972  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>();
1973  h_ele_seed_dphi2_->Fill(elseed->dPhiNeg(1));
1974  h_ele_seed_dphi2VsEta_->Fill(bestGsfElectron.eta(), elseed->dPhiNeg(1));
1975  h_ele_seed_dphi2VsPt_->Fill(bestGsfElectron.pt(), elseed->dPhiNeg(1));
1976  h_ele_seed_drz2_->Fill(elseed->dRZNeg(1));
1977  h_ele_seed_drz2VsEta_->Fill(bestGsfElectron.eta(), elseed->dRZNeg(1));
1978  h_ele_seed_drz2VsPt_->Fill(bestGsfElectron.pt(), elseed->dRZNeg(1));
1979  h_ele_seed_subdet2_->Fill(elseed->subDet(1));
1980  }
1981  // match distributions
1982  h_ele_EoP->Fill(bestGsfElectron.eSuperClusterOverP());
1983  if (bestGsfElectron.ecalDrivenSeed())
1984  h_ele_EoP_eg->Fill(bestGsfElectron.eSuperClusterOverP());
1985  if (bestGsfElectron.isEB())
1986  h_ele_EoP_barrel->Fill(bestGsfElectron.eSuperClusterOverP());
1987  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
1988  h_ele_EoP_eg_barrel->Fill(bestGsfElectron.eSuperClusterOverP());
1989  if (bestGsfElectron.isEE())
1990  h_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP());
1991  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
1992  h_ele_EoP_eg_endcaps->Fill(bestGsfElectron.eSuperClusterOverP());
1993  h_ele_EoPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSuperClusterOverP());
1994  h_ele_EoPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSuperClusterOverP());
1995  h_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSuperClusterOverP());
1996  h_ele_EseedOP->Fill(bestGsfElectron.eSeedClusterOverP());
1997  if (bestGsfElectron.ecalDrivenSeed())
1998  h_ele_EseedOP_eg->Fill(bestGsfElectron.eSeedClusterOverP());
1999  if (bestGsfElectron.isEB())
2000  h_ele_EseedOP_barrel->Fill(bestGsfElectron.eSeedClusterOverP());
2001  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2002  h_ele_EseedOP_eg_barrel->Fill(bestGsfElectron.eSeedClusterOverP());
2003  if (bestGsfElectron.isEE())
2004  h_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP());
2005  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2006  h_ele_EseedOP_eg_endcaps->Fill(bestGsfElectron.eSeedClusterOverP());
2007  h_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverP());
2008  h_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverP());
2009  h_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverP());
2010  h_ele_EoPout->Fill(bestGsfElectron.eSeedClusterOverPout());
2011  if (bestGsfElectron.ecalDrivenSeed())
2012  h_ele_EoPout_eg->Fill(bestGsfElectron.eSeedClusterOverPout());
2013  if (bestGsfElectron.isEB())
2014  h_ele_EoPout_barrel->Fill(bestGsfElectron.eSeedClusterOverPout());
2015  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2016  h_ele_EoPout_eg_barrel->Fill(bestGsfElectron.eSeedClusterOverPout());
2017  if (bestGsfElectron.isEE())
2018  h_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout());
2019  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2020  h_ele_EoPout_eg_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout());
2021  h_ele_EoPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout());
2022  h_ele_EoPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout());
2023  h_ele_EoPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout());
2024  h_ele_EeleOPout->Fill(bestGsfElectron.eEleClusterOverPout());
2025  if (bestGsfElectron.ecalDrivenSeed())
2026  h_ele_EeleOPout_eg->Fill(bestGsfElectron.eEleClusterOverPout());
2027  if (bestGsfElectron.isEB())
2028  h_ele_EeleOPout_barrel->Fill(bestGsfElectron.eEleClusterOverPout());
2029  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2030  h_ele_EeleOPout_eg_barrel->Fill(bestGsfElectron.eEleClusterOverPout());
2031  if (bestGsfElectron.isEE())
2032  h_ele_EeleOPout_endcaps->Fill(bestGsfElectron.eEleClusterOverPout());
2033  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2034  h_ele_EeleOPout_eg_endcaps->Fill(bestGsfElectron.eEleClusterOverPout());
2035  h_ele_EeleOPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout());
2036  h_ele_EeleOPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout());
2037  h_ele_EeleOPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout());
2038  h_ele_dEtaSc_propVtx->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2039  if (bestGsfElectron.ecalDrivenSeed())
2041  if (bestGsfElectron.isEB())
2043  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2045  if (bestGsfElectron.isEE())
2047  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2049  h_ele_dEtaScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2050  h_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2051  h_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2052  h_ele_dPhiSc_propVtx->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2053  if (bestGsfElectron.ecalDrivenSeed())
2055  if (bestGsfElectron.isEB())
2057  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2059  if (bestGsfElectron.isEE())
2061  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2063  h_ele_dPhiScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2064  h_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2065  h_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2066  h_ele_dEtaCl_propOut->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2067  if (bestGsfElectron.ecalDrivenSeed())
2069  if (bestGsfElectron.isEB())
2071  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2073  if (bestGsfElectron.isEE())
2075  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2077  h_ele_dEtaClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2078  h_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2079  h_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2080  h_ele_dPhiCl_propOut->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2081  if (bestGsfElectron.ecalDrivenSeed())
2083  if (bestGsfElectron.isEB())
2085  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2087  if (bestGsfElectron.isEE())
2089  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2091  h_ele_dPhiClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2092  h_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2093  h_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2094  h_ele_dEtaEleCl_propOut->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2095  if (bestGsfElectron.ecalDrivenSeed())
2097  if (bestGsfElectron.isEB())
2099  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2101  if (bestGsfElectron.isEE())
2103  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2105  h_ele_dEtaEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2106  h_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2107  h_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2108  h_ele_dPhiEleCl_propOut->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2109  if (bestGsfElectron.ecalDrivenSeed())
2111  if (bestGsfElectron.isEB())
2113  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2115  if (bestGsfElectron.isEE())
2117  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2119  h_ele_dPhiEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2120  h_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2121  h_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2122  h_ele_HoE->Fill(bestGsfElectron.hadronicOverEm());
2123  if (bestGsfElectron.ecalDrivenSeed())
2124  h_ele_HoE_eg->Fill(bestGsfElectron.hadronicOverEm());
2125  if (bestGsfElectron.isEB())
2126  h_ele_HoE_barrel->Fill(bestGsfElectron.hadronicOverEm());
2127  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2128  h_ele_HoE_eg_barrel->Fill(bestGsfElectron.hadronicOverEm());
2129  if (bestGsfElectron.isEE())
2130  h_ele_HoE_endcaps->Fill(bestGsfElectron.hadronicOverEm());
2131  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2132  h_ele_HoE_eg_endcaps->Fill(bestGsfElectron.hadronicOverEm());
2133  if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap() && !bestGsfElectron.isEBEEGap() &&
2134  !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap())
2135  h_ele_HoE_fiducial->Fill(bestGsfElectron.hadronicOverEm());
2136  h_ele_HoEVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.hadronicOverEm());
2137  h_ele_HoEVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.hadronicOverEm());
2138  h_ele_HoEVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.hadronicOverEm());
2139 
2140  //classes
2141  int eleClass = bestGsfElectron.classification();
2142  if (bestGsfElectron.isEE())
2143  eleClass += 10;
2144  h_ele_classes->Fill(eleClass);
2145 
2146  h_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
2147  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2148  h_ele_eta_golden->Fill(std::abs(bestGsfElectron.eta()));
2149  if (bestGsfElectron.classification() == GsfElectron::BIGBREM)
2150  h_ele_eta_bbrem->Fill(std::abs(bestGsfElectron.eta()));
2151  //if (bestGsfElectron.classification() == GsfElectron::OLDNARROW) h_ele_eta_narrow ->Fill(std::abs(bestGsfElectron.eta()));
2152  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2153  h_ele_eta_shower->Fill(std::abs(bestGsfElectron.eta()));
2154 
2155  //fbrem
2156  double fbrem_mean = 0.;
2157  if (!readAOD_) // track extra does not exist in AOD
2158  fbrem_mean =
2159  1. - bestGsfElectron.gsfTrack()->outerMomentum().R() / bestGsfElectron.gsfTrack()->innerMomentum().R();
2160  double fbrem_mode = bestGsfElectron.fbrem();
2161  h_ele_fbrem->Fill(fbrem_mode);
2162  h_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(), fbrem_mode);
2163  if (!readAOD_) // track extra does not exist in AOD
2164  h_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(), fbrem_mean);
2165 
2166  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2167  h_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(),
2168  bestGsfElectron.trackMomentumAtVtx().R());
2169  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2170  h_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(),
2171  bestGsfElectron.trackMomentumAtVtx().R());
2172  if (!readAOD_) // track extra does not exist in AOD
2173  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2174  h_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(),
2175  bestGsfElectron.gsfTrack()->innerMomentum().R());
2176  if (!readAOD_) // track extra does not exist in AOD
2177  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2178  h_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(),
2179  bestGsfElectron.gsfTrack()->innerMomentum().R());
2180  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2181  h_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(),
2182  bestGsfElectron.trackMomentumAtVtx().Rho());
2183  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2184  h_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(),
2185  bestGsfElectron.trackMomentumAtVtx().Rho());
2186  if (!readAOD_) // track extra does not exist in AOD
2187  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2188  h_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(),
2189  bestGsfElectron.gsfTrack()->innerMomentum().Rho());
2190  if (!readAOD_) // track extra does not exist in AOD
2191  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2192  h_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(),
2193  bestGsfElectron.gsfTrack()->innerMomentum().Rho());
2194 
2195  h_ele_mva->Fill(bestGsfElectron.mva_e_pi());
2196  if (bestGsfElectron.ecalDrivenSeed())
2197  h_ele_provenance->Fill(1.);
2198  if (bestGsfElectron.trackerDrivenSeed())
2199  h_ele_provenance->Fill(-1.);
2200  if (bestGsfElectron.trackerDrivenSeed() || bestGsfElectron.ecalDrivenSeed())
2201  h_ele_provenance->Fill(0.);
2202  if (bestGsfElectron.trackerDrivenSeed() && !bestGsfElectron.ecalDrivenSeed())
2203  h_ele_provenance->Fill(-2.);
2204  if (!bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.ecalDrivenSeed())
2205  h_ele_provenance->Fill(2.);
2206 
2207  h_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
2208  h_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
2211  h_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
2212  h_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
2215 
2216  } // gsf electron found
2217 
2218  // } // matching object found
2219 
2220  // }
2221 
2222  } // loop overmatching object
2223 
2224  h_matchingObjectNum->Fill(matchingObjectNum);
2225 }
T getParameter(std::string const &) const
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:156
double eta() const final
momentum pseudorapidity
bool isEBEtaGap() const
Definition: GsfElectron.h:333
virtual SuperClusterRef parentSuperCluster() const
Definition: GsfElectron.h:160
float eSuperClusterOverP() const
Definition: GsfElectron.h:221
bool isEBEEGap() const
Definition: GsfElectron.h:331
float dr04HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:536
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:268
float dr04TkSumPt() const
Definition: GsfElectron.h:533
GsfElectronFakeAnalyzer(const edm::ParameterSet &conf)
double pt() const final
transverse momentum
int charge() const final
electric charge
bool isEERingGap() const
Definition: GsfElectron.h:337
float dr03HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:525
float fbrem() const
Definition: GsfElectron.h:726
void analyze(const edm::Event &e, const edm::EventSetup &c) override
float scE2x5Max() const
Definition: GsfElectron.h:466
uint16_t size_type
bool isEEDeeGap() const
Definition: GsfElectron.h:336
bool isEE() const
Definition: GsfElectron.h:329
bool isEB() const
Definition: GsfElectron.h:328
const Double_t pi
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
float dr04HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:537
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:225
int iEvent
Definition: GenABIO.cc:224
float hadronicOverEm() const
Definition: GsfElectron.h:468
float eSeedClusterOverP() const
Definition: GsfElectron.h:222
float dr04EcalRecHitSumEt() const
Definition: GsfElectron.h:535
float deltaPhiSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:229
T sqrt(T t)
Definition: SSEVec.h:19
math::XYZVectorF trackMomentumOut() const
Definition: GsfElectron.h:270
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:228
const Point & vertex() const override
vertex position (overwritten by PF...)
float dr03TkSumPt() const
Definition: GsfElectron.h:521
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float dr03HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:524
float eEleClusterOverPout() const
Definition: GsfElectron.h:224
float eSeedClusterOverPout() const
Definition: GsfElectron.h:223
float scSigmaIEtaIEta() const
Definition: GsfElectron.h:464
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
d
Definition: ztail.py:151
float deltaPhiEleClusterTrackAtCalo() const
Definition: GsfElectron.h:230
double p() const final
magnitude of momentum vector
T const * product() const
Definition: Handle.h:69
float deltaEtaEleClusterTrackAtCalo() const
Definition: GsfElectron.h:227
Classification classification() const
Definition: GsfElectron.h:722
REF castTo() const
Definition: RefToBase.h:257
GsfTrackRefVector::size_type ambiguousGsfTracksSize() const
Definition: GsfElectron.h:682
double py() const final
y coordinate of momentum vector
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:523
float mva_e_pi() const
Definition: GsfElectron.h:665
std::string const & label() const
Definition: InputTag.h:36
edm::EventID id() const
Definition: EventBase.h:59
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:226
fixed size matrix
HLT enums.
bool isEBPhiGap() const
Definition: GsfElectron.h:334
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:155
bool trackerDrivenSeed() const
Definition: GsfElectron.h:159
const Point & position() const
position
Definition: BeamSpot.h:59
float scE5x5() const
Definition: GsfElectron.h:467
float caloEnergy() const
Definition: GsfElectron.h:815
double phi() const final
momentum azimuthal angle
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
float scE1x5() const
Definition: GsfElectron.h:465
bool ecalDrivenSeed() const
Definition: GsfElectron.h:158