CMS 3D CMS Logo

GsfElectronMCAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: RecoEgamma/Examples
4 // Class: GsfElectronMCAnalyzer
5 //
13 //
14 // Original Author: Ursula Berthon
15 // Created: Mon Mar 27 13:22:06 CEST 2006
16 //
17 //
18 
19 // user include files
36 
37 #include "CLHEP/Units/GlobalPhysicalConstants.h"
38 #include <iostream>
39 #include <vector>
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  outputFile_ = conf.getParameter<std::string>("outputFile");
53  histfile_ = new TFile(outputFile_.c_str(), "RECREATE");
54  electronCollection_ = conf.getParameter<edm::InputTag>("electronCollection");
55  mcTruthCollection_ = conf.getParameter<edm::InputTag>("mcTruthCollection");
56  readAOD_ = conf.getParameter<bool>("readAOD");
57  maxPt_ = conf.getParameter<double>("MaxPt");
58  maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
59  deltaR_ = conf.getParameter<double>("DeltaR");
60  matchingIDs_ = conf.getParameter<std::vector<int> >("MatchingID");
61  matchingMotherIDs_ = conf.getParameter<std::vector<int> >("MatchingMotherID");
62  edm::ParameterSet pset = conf.getParameter<edm::ParameterSet>("HistosConfigurationMC");
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  nbinpoptrue = pset.getParameter<int>("Nbinpoptrue");
103  poptruemin = pset.getParameter<double>("Poptruemin");
104  poptruemax = pset.getParameter<double>("Poptruemax");
105  nbinmee = pset.getParameter<int>("Nbinmee");
106  meemin = pset.getParameter<double>("Meemin");
107  meemax = pset.getParameter<double>("Meemax");
108  nbinhoe = pset.getParameter<int>("Nbinhoe");
109  hoemin = pset.getParameter<double>("Hoemin");
110  hoemax = pset.getParameter<double>("Hoemax");
111 }
112 
114  histfile_->cd();
115 
116  // mc truth
117  h_mcNum = new TH1F("h_mcNum", "# mc particles", nbinfhits, 0., fhitsmax);
118  h_mcNum->Sumw2();
119  h_eleNum = new TH1F("h_mcNum_ele", "# mc electrons", nbinfhits, 0., fhitsmax);
120  h_eleNum->Sumw2();
121  h_gamNum = new TH1F("h_mcNum_gam", "# mc gammas", nbinfhits, 0., fhitsmax);
122  h_gamNum->Sumw2();
123 
124  // rec event
125  histNum_ = new TH1F("h_recEleNum", "# rec electrons", 20, 0., 20.);
126 
127  // mc
128  h_simEta = new TH1F("h_mc_eta", "gen #eta", nbineta, etamin, etamax);
129  h_simEta->Sumw2();
130  h_simAbsEta = new TH1F("h_mc_abseta", "gen |#eta|", nbineta / 2, 0., etamax);
131  h_simAbsEta->Sumw2();
132  h_simP = new TH1F("h_mc_P", "gen p", nbinp, 0., pmax);
133  h_simP->Sumw2();
134  h_simPt = new TH1F("h_mc_Pt", "gen pt", nbinpteff, 5., ptmax);
135  h_simPt->Sumw2();
136  h_simPhi = new TH1F("h_mc_phi", "gen phi", nbinphi, phimin, phimax);
137  h_simPhi->Sumw2();
138  h_simZ = new TH1F("h_mc_z", "gen z ", nbinxyz, -25, 25);
139  h_simZ->Sumw2();
140  h_simPtEta = new TH2F("h_mc_pteta", "gen pt vs #eta", nbineta2D, etamin, etamax, nbinpt2D, 5., ptmax);
141  h_simPtEta->Sumw2();
142 
143  // all electrons
144  h_ele_EoverP_all = new TH1F("h_ele_EoverP_all", "ele E/P_{vertex}, all reco electrons", nbineop, 0., eopmax);
145  h_ele_EoverP_all->Sumw2();
146  h_ele_EoverP_all_barrel =
147  new TH1F("h_ele_EoverP_all_barrel", "ele E/P_{vertex}, all reco electrons, barrel", nbineop, 0., eopmax);
148  h_ele_EoverP_all_barrel->Sumw2();
149  h_ele_EoverP_all_endcaps =
150  new TH1F("h_ele_EoverP_all_endcaps", "ele E/P_{vertex}, all reco electrons, endcaps", nbineop, 0., eopmax);
151  h_ele_EoverP_all_endcaps->Sumw2();
152  h_ele_EseedOP_all = new TH1F("h_ele_EseedOP_all", "ele E_{seed}/P_{vertex}, all reco electrons", nbineop, 0., eopmax);
153  h_ele_EseedOP_all->Sumw2();
154  h_ele_EseedOP_all_barrel =
155  new TH1F("h_ele_EseedOP_all_barrel", "ele E_{seed}/P_{vertex}, all reco electrons, barrel", nbineop, 0., eopmax);
156  h_ele_EseedOP_all_barrel->Sumw2();
157  h_ele_EseedOP_all_endcaps = new TH1F(
158  "h_ele_EseedOP_all_endcaps", "ele E_{seed}/P_{vertex}, all reco electrons, endcaps", nbineop, 0., eopmax);
159  h_ele_EseedOP_all_endcaps->Sumw2();
160  h_ele_EoPout_all = new TH1F("h_ele_EoPout_all", "ele E_{seed}/P_{out}, all reco electrons", nbineop, 0., eopmax);
161  h_ele_EoPout_all->Sumw2();
162  h_ele_EoPout_all_barrel =
163  new TH1F("h_ele_EoPout_all_barrel", "ele E_{seed}/P_{out}, all reco electrons barrel", nbineop, 0., eopmax);
164  h_ele_EoPout_all_barrel->Sumw2();
165  h_ele_EoPout_all_endcaps =
166  new TH1F("h_ele_EoPout_all_endcaps", "ele E_{seed}/P_{out}, all reco electrons endcaps", nbineop, 0., eopmax);
167  h_ele_EoPout_all_endcaps->Sumw2();
168  h_ele_EeleOPout_all = new TH1F("h_ele_EeleOPout_all", "ele E_{ele}/P_{out}, all reco electrons", nbineop, 0., eopmax);
169  h_ele_EeleOPout_all->Sumw2();
170  h_ele_EeleOPout_all_barrel =
171  new TH1F("h_ele_EeleOPout_all_barrel", "ele E_{ele}/P_{out}, all reco electrons barrel", nbineop, 0., eopmax);
172  h_ele_EeleOPout_all_barrel->Sumw2();
173  h_ele_EeleOPout_all_endcaps =
174  new TH1F("h_ele_EeleOPout_all_endcaps", "ele E_{ele}/P_{out}, all reco electrons endcaps", nbineop, 0., eopmax);
175  h_ele_EeleOPout_all_endcaps->Sumw2();
176  h_ele_dEtaSc_propVtx_all = new TH1F("h_ele_dEtaSc_propVtx_all",
177  "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",
178  nbindetamatch,
179  detamatchmin,
180  detamatchmax);
181  h_ele_dEtaSc_propVtx_all->Sumw2();
182  h_ele_dEtaSc_propVtx_all_barrel = new TH1F("h_ele_dEtaSc_propVtx_all_barrel",
183  "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons barrel",
184  nbindetamatch,
185  detamatchmin,
186  detamatchmax);
187  h_ele_dEtaSc_propVtx_all_barrel->Sumw2();
188  h_ele_dEtaSc_propVtx_all_endcaps = new TH1F("h_ele_dEtaSc_propVtx_all_endcaps",
189  "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons endcaps",
190  nbindetamatch,
191  detamatchmin,
192  detamatchmax);
193  h_ele_dEtaSc_propVtx_all_endcaps->Sumw2();
194  h_ele_dPhiSc_propVtx_all = new TH1F("h_ele_dPhiSc_propVtx_all",
195  "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons",
196  nbindphimatch,
197  dphimatchmin,
198  dphimatchmax);
199  h_ele_dPhiSc_propVtx_all->Sumw2();
200  h_ele_dPhiSc_propVtx_all_barrel = new TH1F("h_ele_dPhiSc_propVtx_all_barrel",
201  "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons barrel",
202  nbindphimatch,
203  dphimatchmin,
204  dphimatchmax);
205  h_ele_dPhiSc_propVtx_all_barrel->Sumw2();
206  h_ele_dPhiSc_propVtx_all_endcaps = new TH1F("h_ele_dPhiSc_propVtx_all_endcaps",
207  "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons endcaps",
208  nbindphimatch,
209  dphimatchmin,
210  dphimatchmax);
211  h_ele_dPhiSc_propVtx_all_endcaps->Sumw2();
212  h_ele_dEtaCl_propOut_all = new TH1F("h_ele_dEtaCl_propOut_all",
213  "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",
214  nbindetamatch,
215  detamatchmin,
216  detamatchmax);
217  h_ele_dEtaCl_propOut_all->Sumw2();
218  h_ele_dEtaCl_propOut_all_barrel =
219  new TH1F("h_ele_dEtaCl_propOut_all_barrel",
220  "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons barrel",
221  nbindetamatch,
222  detamatchmin,
223  detamatchmax);
224  h_ele_dEtaCl_propOut_all_barrel->Sumw2();
225  h_ele_dEtaCl_propOut_all_endcaps =
226  new TH1F("h_ele_dEtaCl_propOut_all_endcaps",
227  "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons endcaps",
228  nbindetamatch,
229  detamatchmin,
230  detamatchmax);
231  h_ele_dEtaCl_propOut_all_endcaps->Sumw2();
232  h_ele_dPhiCl_propOut_all = new TH1F("h_ele_dPhiCl_propOut_all",
233  "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons",
234  nbindphimatch,
235  dphimatchmin,
236  dphimatchmax);
237  h_ele_dPhiCl_propOut_all->Sumw2();
238  h_ele_dPhiCl_propOut_all_barrel =
239  new TH1F("h_ele_dPhiCl_propOut_all_barrel",
240  "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons barrel",
241  nbindphimatch,
242  dphimatchmin,
243  dphimatchmax);
244  h_ele_dPhiCl_propOut_all_endcaps =
245  new TH1F("h_ele_dPhiCl_propOut_all_endcaps",
246  "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons endcaps",
247  nbindphimatch,
248  dphimatchmin,
249  dphimatchmax);
250  h_ele_dPhiCl_propOut_all_barrel->Sumw2();
251  h_ele_dPhiCl_propOut_all_endcaps->Sumw2();
252  h_ele_HoE_all =
253  new TH1F("h_ele_HoE_all", "ele hadronic energy / em energy, all reco electrons", nbinhoe, hoemin, hoemax);
254  h_ele_HoE_all->Sumw2();
255  h_ele_HoE_all_barrel = new TH1F(
256  "h_ele_HoE_all_barrel", "ele hadronic energy / em energy, all reco electrons barrel", nbinhoe, hoemin, hoemax);
257  h_ele_HoE_all_barrel->Sumw2();
258  h_ele_HoE_all_endcaps = new TH1F(
259  "h_ele_HoE_all_endcaps", "ele hadronic energy / em energy, all reco electrons endcaps", nbinhoe, hoemin, hoemax);
260  h_ele_HoE_all_endcaps->Sumw2();
261  h_ele_vertexPt_all = new TH1F("h_ele_vertexPt_all", "ele p_{T}, all reco electrons", nbinpteff, 5., ptmax);
262  h_ele_vertexPt_all->Sumw2();
263  h_ele_Et_all = new TH1F("h_ele_Et_all", "ele SC E_{T}, all reco electrons", nbinpteff, 5., ptmax);
264  h_ele_Et_all->Sumw2();
265  h_ele_vertexEta_all = new TH1F("h_ele_vertexEta_all", "ele eta, all reco electrons", nbineta, etamin, etamax);
266  h_ele_vertexEta_all->Sumw2();
267  h_ele_TIP_all = new TH1F("h_ele_TIP_all", "ele vertex transverse radius, all reco electrons", 100, 0., 0.2);
268  h_ele_TIP_all->Sumw2();
269  h_ele_TIP_all_barrel =
270  new TH1F("h_ele_TIP_all_barrel", "ele vertex transverse radius, all reco electrons barrel", 100, 0., 0.2);
271  h_ele_TIP_all_barrel->Sumw2();
272  h_ele_TIP_all_endcaps =
273  new TH1F("h_ele_TIP_all_endcaps", "ele vertex transverse radius, all reco electrons endcaps", 100, 0., 0.2);
274  h_ele_TIP_all_endcaps->Sumw2();
275  h_ele_mee_all = new TH1F("h_ele_mee_all", "ele pairs invariant mass, all reco electrons", nbinmee, meemin, meemax);
276  h_ele_mee_all->Sumw2();
277  h_ele_mee_os = new TH1F("h_ele_mee_os", "ele pairs invariant mass, opp. sign", nbinmee, meemin, meemax);
278  h_ele_mee_os->Sumw2();
279  h_ele_mee_os_ebeb =
280  new TH1F("h_ele_mee_os_ebeb", "ele pairs invariant mass, opp. sign, EB-EB", nbinmee, meemin, meemax);
281  h_ele_mee_os_ebeb->Sumw2();
282  h_ele_mee_os_ebee =
283  new TH1F("h_ele_mee_os_ebee", "ele pairs invariant mass, opp. sign, EB-EE", nbinmee, meemin, meemax);
284  h_ele_mee_os_ebee->Sumw2();
285  h_ele_mee_os_eeee =
286  new TH1F("h_ele_mee_os_eeee", "ele pairs invariant mass, opp. sign, EE-EE", nbinmee, meemin, meemax);
287  h_ele_mee_os_eeee->Sumw2();
288  h_ele_mee_os_gg =
289  new TH1F("h_ele_mee_os_gg", "ele pairs invariant mass, opp. sign, good-good", nbinmee, meemin, meemax);
290  h_ele_mee_os_gg->Sumw2();
291  h_ele_mee_os_gb =
292  new TH1F("h_ele_mee_os_gb", "ele pairs invariant mass, opp. sign, good-bad", nbinmee, meemin, meemax);
293  h_ele_mee_os_gb->Sumw2();
294  h_ele_mee_os_bb =
295  new TH1F("h_ele_mee_os_bb", "ele pairs invariant mass, opp. sign, bad-bad", nbinmee, meemin, meemax);
296  h_ele_mee_os_bb->Sumw2();
297 
298  // duplicates
299  h_ele_E2mnE1vsMee_all = new TH2F("h_ele_E2mnE1vsMee_all",
300  "E2 - E1 vs ele pairs invariant mass, all electrons",
301  nbinmee,
302  meemin,
303  meemax,
304  100,
305  -50.,
306  50.);
307  h_ele_E2mnE1vsMee_egeg_all = new TH2F("h_ele_E2mnE1vsMee_egeg_all",
308  "E2 - E1 vs ele pairs invariant mass, ecal driven pairs, all electrons",
309  nbinmee,
310  meemin,
311  meemax,
312  100,
313  -50.,
314  50.);
315 
316  // charge ID
317  h_ele_ChargeMnChargeTrue = new TH1F("h_ele_ChargeMnChargeTrue", "ele charge - gen charge ", 5, -1., 4.);
318  h_ele_ChargeMnChargeTrue->Sumw2();
319  h_ele_simEta_matched_qmisid =
320  new TH1F("h_ele_eta_matched_qmisid", "charge misid vs gen eta", nbineta, etamin, etamax);
321  h_ele_simEta_matched_qmisid->Sumw2();
322  h_ele_simAbsEta_matched_qmisid =
323  new TH1F("h_ele_abseta_matched_qmisid", "charge misid vs gen |eta|", nbineta / 2, 0., etamax);
324  h_ele_simAbsEta_matched_qmisid->Sumw2();
325  h_ele_simPt_matched_qmisid =
326  new TH1F("h_ele_Pt_matched_qmisid", "charge misid vs gen transverse momentum", nbinpteff, 5., ptmax);
327  h_ele_simPt_matched_qmisid->Sumw2();
328  h_ele_simPhi_matched_qmisid =
329  new TH1F("h_ele_phi_matched_qmisid", "charge misid vs gen phi", nbinphi, phimin, phimax);
330  h_ele_simPhi_matched_qmisid->Sumw2();
331  h_ele_simZ_matched_qmisid = new TH1F("h_ele_z_matched_qmisid", "charge misid vs gen z", nbinxyz, -25, 25);
332  h_ele_simZ_matched_qmisid->Sumw2();
333 
334  // matched electrons
335  h_ele_charge = new TH1F("h_ele_charge", "ele charge", 5, -2., 2.);
336  h_ele_charge->Sumw2();
337  h_ele_chargeVsEta = new TH2F("h_ele_chargeVsEta", "ele charge vs eta", nbineta2D, etamin, etamax, 5, -2., 2.);
338  h_ele_chargeVsPhi = new TH2F("h_ele_chargeVsPhi", "ele charge vs phi", nbinphi2D, phimin, phimax, 5, -2., 2.);
339  h_ele_chargeVsPt = new TH2F("h_ele_chargeVsPt", "ele charge vs pt", nbinpt, 0., 100., 5, -2., 2.);
340  h_ele_vertexP = new TH1F("h_ele_vertexP", "ele momentum", nbinp, 0., pmax);
341  h_ele_vertexP->Sumw2();
342  h_ele_vertexPt = new TH1F("h_ele_vertexPt", "ele transverse momentum", nbinpt, 0., ptmax);
343  h_ele_vertexPt->Sumw2();
344  h_ele_Et = new TH1F("h_ele_Et", "ele transverse energy", nbinpt, 0., ptmax);
345  h_ele_Et->Sumw2();
346  h_ele_vertexPtVsEta =
347  new TH2F("h_ele_vertexPtVsEta", "ele transverse momentum vs eta", nbineta2D, etamin, etamax, nbinpt2D, 0., ptmax);
348  h_ele_vertexPtVsPhi =
349  new TH2F("h_ele_vertexPtVsPhi", "ele transverse momentum vs phi", nbinphi2D, phimin, phimax, nbinpt2D, 0., ptmax);
350  h_ele_simPt_matched = new TH1F("h_ele_simPt_matched", "Efficiency vs gen transverse momentum", nbinpteff, 5., ptmax);
351  h_ele_vertexEta = new TH1F("h_ele_vertexEta", "ele momentum eta", nbineta, etamin, etamax);
352  h_ele_vertexEta->Sumw2();
353  h_ele_vertexEtaVsPhi =
354  new TH2F("h_ele_vertexEtaVsPhi", "ele momentum eta vs phi", nbineta2D, etamin, etamax, nbinphi2D, phimin, phimax);
355  h_ele_simAbsEta_matched = new TH1F("h_ele_simAbsEta_matched", "Efficiency vs gen |eta|", nbineta / 2, 0., 2.5);
356  h_ele_simAbsEta_matched->Sumw2();
357  h_ele_simEta_matched = new TH1F("h_ele_simEta_matched", "Efficiency vs gen eta", nbineta, etamin, etamax);
358  h_ele_simEta_matched->Sumw2();
359  h_ele_simPtEta_matched =
360  new TH2F("h_ele_simPtEta_matched", "Efficiency vs pt #eta", nbineta2D, etamin, etamax, nbinpt2D, 5., ptmax);
361  h_ele_simPtEta_matched->Sumw2();
362  h_ele_simPhi_matched = new TH1F("h_ele_simPhi_matched", "Efficiency vs gen phi", nbinphi, phimin, phimax);
363  h_ele_simPhi_matched->Sumw2();
364  h_ele_vertexPhi = new TH1F("h_ele_vertexPhi", "ele momentum #phi", nbinphi, phimin, phimax);
365  h_ele_vertexPhi->Sumw2();
366  h_ele_vertexX = new TH1F("h_ele_vertexX", "ele vertex x", nbinxyz, -0.1, 0.1);
367  h_ele_vertexX->Sumw2();
368  h_ele_vertexY = new TH1F("h_ele_vertexY", "ele vertex y", nbinxyz, -0.1, 0.1);
369  h_ele_vertexY->Sumw2();
370  h_ele_vertexZ = new TH1F("h_ele_vertexZ", "ele vertex z", nbinxyz, -25, 25);
371  h_ele_vertexZ->Sumw2();
372  h_ele_simZ_matched = new TH1F("h_ele_simZ_matched", "Efficiency vs gen vertex z", nbinxyz, -25, 25);
373  h_ele_simZ_matched->Sumw2();
374  h_ele_vertexTIP = new TH1F("h_ele_vertexTIP", "ele transverse impact parameter (wrt gen vtx)", 90, 0., 0.15);
375  h_ele_vertexTIP->Sumw2();
376  h_ele_vertexTIPVsEta = new TH2F("h_ele_vertexTIPVsEta",
377  "ele transverse impact parameter (wrt gen vtx) vs eta",
378  nbineta2D,
379  etamin,
380  etamax,
381  45,
382  0.,
383  0.15);
384  h_ele_vertexTIPVsPhi = new TH2F("h_ele_vertexTIPVsPhi",
385  "ele transverse impact parameter (wrt gen vtx) vs phi",
386  nbinphi2D,
387  phimin,
388  phimax,
389  45,
390  0.,
391  0.15);
392  h_ele_vertexTIPVsPt = new TH2F("h_ele_vertexTIPVsPt",
393  "ele transverse impact parameter (wrt gen vtx) vs transverse momentum",
394  nbinpt2D,
395  0.,
396  ptmax,
397  45,
398  0.,
399  0.15);
400  h_ele_PoPtrue = new TH1F("h_ele_PoPtrue", "ele momentum / gen momentum", nbinpoptrue, poptruemin, poptruemax);
401  h_ele_PoPtrue->Sumw2();
402  h_ele_PtoPttrue = new TH1F(
403  "h_ele_PtoPttrue", "ele transverse momentum / gen transverse momentum", nbinpoptrue, poptruemin, poptruemax);
404  h_ele_PtoPttrue->Sumw2();
405  h_ele_PoPtrueVsEta = new TH2F(
406  "h_ele_PoPtrueVsEta", "ele momentum / gen momentum vs eta", nbineta2D, etamin, etamax, 50, poptruemin, poptruemax);
407  h_ele_PoPtrueVsPhi = new TH2F(
408  "h_ele_PoPtrueVsPhi", "ele momentum / gen momentum vs phi", nbinphi2D, phimin, phimax, 50, poptruemin, poptruemax);
409  h_ele_PoPtrueVsPt = new TH2F(
410  "h_ele_PoPtrueVsPt", "ele momentum / gen momentum vs eta", nbinpt2D, 0., ptmax, 50, poptruemin, poptruemax);
411  h_ele_PoPtrue_barrel =
412  new TH1F("h_ele_PoPtrue_barrel", "ele momentum / gen momentum, barrel", nbinpoptrue, poptruemin, poptruemax);
413  h_ele_PoPtrue_barrel->Sumw2();
414  h_ele_PoPtrue_endcaps =
415  new TH1F("h_ele_PoPtrue_endcaps", "ele momentum / gen momentum, endcaps", nbinpoptrue, poptruemin, poptruemax);
416  h_ele_PoPtrue_endcaps->Sumw2();
417  h_ele_PoPtrue_golden_barrel = new TH1F(
418  "h_ele_PoPtrue_golden_barrel", "ele momentum / gen momentum, golden, barrel", nbinpoptrue, poptruemin, poptruemax);
419  h_ele_PoPtrue_golden_barrel->Sumw2();
420  h_ele_PoPtrue_golden_endcaps = new TH1F("h_ele_PoPtrue_golden_endcaps",
421  "ele momentum / gen momentum, golden, endcaps",
422  nbinpoptrue,
423  poptruemin,
424  poptruemax);
425  h_ele_PoPtrue_golden_endcaps->Sumw2();
426  h_ele_PoPtrue_showering_barrel = new TH1F("h_ele_PoPtrue_showering_barrel",
427  "ele momentum / gen momentum, showering, barrel",
428  nbinpoptrue,
429  poptruemin,
430  poptruemax);
431  h_ele_PoPtrue_showering_barrel->Sumw2();
432  h_ele_PoPtrue_showering_endcaps = new TH1F("h_ele_PoPtrue_showering_endcaps",
433  "ele momentum / gen momentum, showering, endcaps",
434  nbinpoptrue,
435  poptruemin,
436  poptruemax);
437  h_ele_PoPtrue_showering_endcaps->Sumw2();
438  h_ele_PtoPttrue_barrel = new TH1F("h_ele_PtoPttrue_barrel",
439  "ele transverse momentum / gen transverse momentum, barrel",
440  nbinpoptrue,
441  poptruemin,
442  poptruemax);
443  h_ele_PtoPttrue_barrel->Sumw2();
444  h_ele_PtoPttrue_endcaps = new TH1F("h_ele_PtoPttrue_endcaps",
445  "ele transverse momentum / gen transverse momentum, endcaps",
446  nbinpoptrue,
447  poptruemin,
448  poptruemax);
449  h_ele_PtoPttrue_endcaps->Sumw2();
450  h_ele_EtaMnEtaTrue = new TH1F("h_ele_EtaMnEtaTrue", "ele momentum eta - gen eta", nbindeta, detamin, detamax);
451  h_ele_EtaMnEtaTrue->Sumw2();
452  h_ele_EtaMnEtaTrue_barrel =
453  new TH1F("h_ele_EtaMnEtaTrue_barrel", "ele momentum eta - gen eta barrel", nbindeta, detamin, detamax);
454  h_ele_EtaMnEtaTrue_barrel->Sumw2();
455  h_ele_EtaMnEtaTrue_endcaps =
456  new TH1F("h_ele_EtaMnEtaTrue_endcaps", "ele momentum eta - gen eta endcaps", nbindeta, detamin, detamax);
457  h_ele_EtaMnEtaTrue_endcaps->Sumw2();
458  h_ele_EtaMnEtaTrueVsEta = new TH2F("h_ele_EtaMnEtaTrueVsEta",
459  "ele momentum eta - gen eta vs eta",
460  nbineta2D,
461  etamin,
462  etamax,
463  nbindeta / 2,
464  detamin,
465  detamax);
466  h_ele_EtaMnEtaTrueVsPhi = new TH2F("h_ele_EtaMnEtaTrueVsPhi",
467  "ele momentum eta - gen eta vs phi",
468  nbinphi2D,
469  phimin,
470  phimax,
471  nbindeta / 2,
472  detamin,
473  detamax);
474  h_ele_EtaMnEtaTrueVsPt = new TH2F(
475  "h_ele_EtaMnEtaTrueVsPt", "ele momentum eta - gen eta vs pt", nbinpt, 0., ptmax, nbindeta / 2, detamin, detamax);
476  h_ele_PhiMnPhiTrue = new TH1F("h_ele_PhiMnPhiTrue", "ele momentum phi - gen phi", nbindphi, dphimin, dphimax);
477  h_ele_PhiMnPhiTrue->Sumw2();
478  h_ele_PhiMnPhiTrue_barrel =
479  new TH1F("h_ele_PhiMnPhiTrue_barrel", "ele momentum phi - gen phi barrel", nbindphi, dphimin, dphimax);
480  h_ele_PhiMnPhiTrue_barrel->Sumw2();
481  h_ele_PhiMnPhiTrue_endcaps =
482  new TH1F("h_ele_PhiMnPhiTrue_endcaps", "ele momentum phi - gen phi endcaps", nbindphi, dphimin, dphimax);
483  h_ele_PhiMnPhiTrue_endcaps->Sumw2();
484  h_ele_PhiMnPhiTrue2 =
485  new TH1F("h_ele_PhiMnPhiTrue2", "ele momentum phi - gen phi", nbindphimatch2D, dphimatchmin, dphimatchmax);
486  h_ele_PhiMnPhiTrueVsEta = new TH2F("h_ele_PhiMnPhiTrueVsEta",
487  "ele momentum phi - gen phi vs eta",
488  nbineta2D,
489  etamin,
490  etamax,
491  nbindphi / 2,
492  dphimin,
493  dphimax);
494  h_ele_PhiMnPhiTrueVsPhi = new TH2F("h_ele_PhiMnPhiTrueVsPhi",
495  "ele momentum phi - gen phi vs phi",
496  nbinphi2D,
497  phimin,
498  phimax,
499  nbindphi / 2,
500  dphimin,
501  dphimax);
502  h_ele_PhiMnPhiTrueVsPt = new TH2F("h_ele_PhiMnPhiTrueVsPt",
503  "ele momentum phi - gen phi vs pt",
504  nbinpt2D,
505  0.,
506  ptmax,
507  nbindphi / 2,
508  dphimin,
509  dphimax);
510 
511  // matched electron, superclusters
512  histSclEn_ = new TH1F("h_scl_energy", "ele supercluster energy", nbinp, 0., pmax);
513  histSclEn_->Sumw2();
514  histSclEoEtrue_barrel =
515  new TH1F("h_scl_EoEtrue_barrel", "ele supercluster energy / gen energy, barrel", 50, 0.2, 1.2);
516  histSclEoEtrue_barrel->Sumw2();
517  histSclEoEtrue_barrel_eg =
518  new TH1F("h_scl_EoEtrue_barrel_eg", "ele supercluster energy / gen energy, barrel, ecal driven", 50, 0.2, 1.2);
519  histSclEoEtrue_barrel_eg->Sumw2();
520  histSclEoEtrue_barrel_etagap =
521  new TH1F("h_scl_EoEtrue_barrel_etagap", "ele supercluster energy / gen energy, barrel, etagap", 50, 0.2, 1.2);
522  histSclEoEtrue_barrel_etagap->Sumw2();
523  histSclEoEtrue_barrel_phigap =
524  new TH1F("h_scl_EoEtrue_barrel_phigap", "ele supercluster energy / gen energy, barrel, phigap", 50, 0.2, 1.2);
525  histSclEoEtrue_barrel_phigap->Sumw2();
526  histSclEoEtrue_ebeegap =
527  new TH1F("h_scl_EoEtrue_ebeegap", "ele supercluster energy / gen energy, ebeegap", 50, 0.2, 1.2);
528  histSclEoEtrue_ebeegap->Sumw2();
529  histSclEoEtrue_endcaps =
530  new TH1F("h_scl_EoEtrue_endcaps", "ele supercluster energy / gen energy, endcaps", 50, 0.2, 1.2);
531  histSclEoEtrue_endcaps->Sumw2();
532  histSclEoEtrue_endcaps_eg =
533  new TH1F("h_scl_EoEtrue_endcaps_eg", "ele supercluster energy / gen energy, endcaps, ecal driven", 50, 0.2, 1.2);
534  histSclEoEtrue_endcaps_eg->Sumw2();
535  histSclEoEtrue_endcaps_deegap =
536  new TH1F("h_scl_EoEtrue_endcaps_deegap", "ele supercluster energy / gen energy, endcaps, deegap", 50, 0.2, 1.2);
537  histSclEoEtrue_endcaps_deegap->Sumw2();
538  histSclEoEtrue_endcaps_ringgap =
539  new TH1F("h_scl_EoEtrue_endcaps_ringgap", "ele supercluster energy / gen energy, endcaps, ringgap", 50, 0.2, 1.2);
540  histSclEoEtrue_endcaps_ringgap->Sumw2();
541  histSclEoEtrue_barrel_new = new TH1F(
542  "h_scl_EoEtrue_barrel_new", "ele supercluster energy / gen energy, barrel", nbinpoptrue, poptruemin, poptruemax);
543  histSclEoEtrue_barrel_new->Sumw2();
544  histSclEoEtrue_barrel_eg_new = new TH1F("h_scl_EoEtrue_barrel_eg_new",
545  "ele supercluster energy / gen energy, barrel, ecal driven",
546  nbinpoptrue,
547  poptruemin,
548  poptruemax);
549  histSclEoEtrue_barrel_eg_new->Sumw2();
550  histSclEoEtrue_barrel_etagap_new = new TH1F("h_scl_EoEtrue_barrel_etagap_new",
551  "ele supercluster energy / gen energy, barrel, etagap",
552  nbinpoptrue,
553  poptruemin,
554  poptruemax);
555  histSclEoEtrue_barrel_etagap_new->Sumw2();
556  histSclEoEtrue_barrel_phigap_new = new TH1F("h_scl_EoEtrue_barrel_phigap_new",
557  "ele supercluster energy / gen energy, barrel, phigap",
558  nbinpoptrue,
559  poptruemin,
560  poptruemax);
561  histSclEoEtrue_barrel_phigap_new->Sumw2();
562  histSclEoEtrue_ebeegap_new = new TH1F(
563  "h_scl_EoEtrue_ebeegap_new", "ele supercluster energy / gen energy, ebeegap", nbinpoptrue, poptruemin, poptruemax);
564  histSclEoEtrue_ebeegap_new->Sumw2();
565  histSclEoEtrue_endcaps_new = new TH1F(
566  "h_scl_EoEtrue_endcaps_new", "ele supercluster energy / gen energy, endcaps", nbinpoptrue, poptruemin, poptruemax);
567  histSclEoEtrue_endcaps_new->Sumw2();
568  histSclEoEtrue_endcaps_eg_new = new TH1F("h_scl_EoEtrue_endcaps_eg_new",
569  "ele supercluster energy / gen energy, endcaps, ecal driven",
570  nbinpoptrue,
571  poptruemin,
572  poptruemax);
573  histSclEoEtrue_endcaps_eg_new->Sumw2();
574  histSclEoEtrue_endcaps_deegap_new = new TH1F("h_scl_EoEtrue_endcaps_deegap_new",
575  "ele supercluster energy / gen energy, endcaps, deegap",
576  nbinpoptrue,
577  poptruemin,
578  poptruemax);
579  histSclEoEtrue_endcaps_deegap_new->Sumw2();
580  histSclEoEtrue_endcaps_ringgap_new = new TH1F("h_scl_EoEtrue_endcaps_ringgap_new",
581  "ele supercluster energy / gen energy, endcaps, ringgap",
582  nbinpoptrue,
583  poptruemin,
584  poptruemax);
585  histSclEoEtrue_endcaps_ringgap_new->Sumw2();
586  histSclEt_ = new TH1F("h_scl_et", "ele supercluster transverse energy", nbinpt, 0., ptmax);
587  histSclEt_->Sumw2();
588  histSclEtVsEta_ = new TH2F(
589  "h_scl_etVsEta", "ele supercluster transverse energy vs eta", nbineta2D, etamin, etamax, nbinpt, 0., ptmax);
590  histSclEtVsPhi_ = new TH2F(
591  "h_scl_etVsPhi", "ele supercluster transverse energy vs phi", nbinphi2D, phimin, phimax, nbinpt, 0., ptmax);
592  histSclEtaVsPhi_ =
593  new TH2F("h_scl_etaVsPhi", "ele supercluster eta vs phi", nbinphi2D, phimin, phimax, nbineta2D, etamin, etamax);
594  histSclEta_ = new TH1F("h_scl_eta", "ele supercluster eta", nbineta, etamin, etamax);
595  histSclEta_->Sumw2();
596  histSclPhi_ = new TH1F("h_scl_phi", "ele supercluster phi", nbinphi, phimin, phimax);
597  histSclPhi_->Sumw2();
598 
599  histSclSigEtaEta_ = new TH1F("h_scl_sigetaeta", "ele supercluster sigma eta eta", 100, 0., 0.05);
600  histSclSigEtaEta_->Sumw2();
601  histSclSigEtaEta_barrel_ = new TH1F("h_scl_sigetaeta_barrel", "ele supercluster sigma eta eta barrel", 100, 0., 0.05);
602  histSclSigEtaEta_barrel_->Sumw2();
603  histSclSigEtaEta_endcaps_ =
604  new TH1F("h_scl_sigetaeta_endcaps", "ele supercluster sigma eta eta endcaps", 100, 0., 0.05);
605  histSclSigEtaEta_endcaps_->Sumw2();
606  histSclSigIEtaIEta_ = new TH1F("h_scl_sigietaieta", "ele supercluster sigma ieta ieta", 100, 0., 0.05);
607  histSclSigIEtaIEta_->Sumw2();
608  histSclSigIEtaIEta_barrel_ =
609  new TH1F("h_scl_sigietaieta_barrel", "ele supercluster sigma ieta ieta, barrel", 100, 0., 0.05);
610  histSclSigIEtaIEta_barrel_->Sumw2();
611  histSclSigIEtaIEta_endcaps_ =
612  new TH1F("h_scl_sigietaieta_endcaps", "ele supercluster sigma ieta ieta, endcaps", 100, 0., 0.05);
613  histSclSigIEtaIEta_endcaps_->Sumw2();
614  histSclE1x5_ = new TH1F("h_scl_E1x5", "ele supercluster energy in 1x5", nbinp, 0., pmax);
615  histSclE1x5_->Sumw2();
616  histSclE1x5_barrel_ = new TH1F("h_scl_E1x5_barrel", "ele supercluster energy in 1x5 barrel", nbinp, 0., pmax);
617  histSclE1x5_barrel_->Sumw2();
618  histSclE1x5_endcaps_ = new TH1F("h_scl_E1x5_endcaps", "ele supercluster energy in 1x5 endcaps", nbinp, 0., pmax);
619  histSclE1x5_endcaps_->Sumw2();
620  histSclE2x5max_ = new TH1F("h_scl_E2x5max", "ele supercluster energy in 2x5 max", nbinp, 0., pmax);
621  histSclE2x5max_->Sumw2();
622  histSclE2x5max_barrel_ =
623  new TH1F("h_scl_E2x5max_barrel", "ele supercluster energy in 2x5 max barrel", nbinp, 0., pmax);
624  histSclE2x5max_barrel_->Sumw2();
625  histSclE2x5max_endcaps_ =
626  new TH1F("h_scl_E2x5max_endcaps", "ele supercluster energy in 2x5 max endcaps", nbinp, 0., pmax);
627  histSclE2x5max_endcaps_->Sumw2();
628  histSclE5x5_ = new TH1F("h_scl_E5x5", "ele supercluster energy in 5x5", nbinp, 0., pmax);
629  histSclE5x5_->Sumw2();
630  histSclE5x5_barrel_ = new TH1F("h_scl_E5x5_barrel", "ele supercluster energy in 5x5 barrel", nbinp, 0., pmax);
631  histSclE5x5_barrel_->Sumw2();
632  histSclE5x5_endcaps_ = new TH1F("h_scl_E5x5_endcaps", "ele supercluster energy in 5x5 endcaps", nbinp, 0., pmax);
633  histSclE5x5_endcaps_->Sumw2();
634  histSclSigEtaEta_eg_ = new TH1F("h_scl_sigetaeta_eg", "ele supercluster sigma eta eta, ecal driven", 100, 0., 0.05);
635  histSclSigEtaEta_eg_->Sumw2();
636  histSclSigEtaEta_eg_barrel_ =
637  new TH1F("h_scl_sigetaeta_eg_barrel", "ele supercluster sigma eta eta, ecal driven barrel", 100, 0., 0.05);
638  histSclSigEtaEta_eg_barrel_->Sumw2();
639  histSclSigEtaEta_eg_endcaps_ =
640  new TH1F("h_scl_sigetaeta_eg_endcaps", "ele supercluster sigma eta eta, ecal driven endcaps", 100, 0., 0.05);
641  histSclSigEtaEta_eg_endcaps_->Sumw2();
642  histSclSigIEtaIEta_eg_ =
643  new TH1F("h_scl_sigietaieta_eg", "ele supercluster sigma ieta ieta, ecal driven", 100, 0., 0.05);
644  histSclSigIEtaIEta_eg_->Sumw2();
645  histSclSigIEtaIEta_eg_barrel_ =
646  new TH1F("h_scl_sigietaieta_barrel_eg", "ele supercluster sigma ieta ieta, barrel, ecal driven", 100, 0., 0.05);
647  histSclSigIEtaIEta_eg_barrel_->Sumw2();
648  histSclSigIEtaIEta_eg_endcaps_ =
649  new TH1F("h_scl_sigietaieta_endcaps_eg", "ele supercluster sigma ieta ieta, endcaps, ecal driven", 100, 0., 0.05);
650  histSclSigIEtaIEta_eg_endcaps_->Sumw2();
651  histSclE1x5_eg_ = new TH1F("h_scl_E1x5_eg", "ele supercluster energy in 1x5, ecal driven", nbinp, 0., pmax);
652  histSclE1x5_eg_->Sumw2();
653  histSclE1x5_eg_barrel_ =
654  new TH1F("h_scl_E1x5_eg_barrel", "ele supercluster energy in 1x5, ecal driven barrel", nbinp, 0., pmax);
655  histSclE1x5_eg_barrel_->Sumw2();
656  histSclE1x5_eg_endcaps_ =
657  new TH1F("h_scl_E1x5_eg_endcaps", "ele supercluster energy in 1x5, ecal driven endcaps", nbinp, 0., pmax);
658  histSclE1x5_eg_endcaps_->Sumw2();
659  histSclE2x5max_eg_ = new TH1F("h_scl_E2x5max_eg", "ele supercluster energy in 2x5 max, ecal driven", nbinp, 0., pmax);
660  histSclE2x5max_eg_->Sumw2();
661  histSclE2x5max_eg_barrel_ =
662  new TH1F("h_scl_E2x5max_eg_barrel", "ele supercluster energy in 2x5 max, ecal driven barrel", nbinp, 0., pmax);
663  histSclE2x5max_eg_barrel_->Sumw2();
664  histSclE2x5max_eg_endcaps_ =
665  new TH1F("h_scl_E2x5max_eg_endcaps", "ele supercluster energy in 2x5 max, ecal driven endcaps", nbinp, 0., pmax);
666  histSclE2x5max_eg_endcaps_->Sumw2();
667  histSclE5x5_eg_ = new TH1F("h_scl_E5x5_eg", "ele supercluster energy in 5x5, ecal driven", nbinp, 0., pmax);
668  histSclE5x5_eg_->Sumw2();
669  histSclE5x5_eg_barrel_ =
670  new TH1F("h_scl_E5x5_eg_barrel", "ele supercluster energy in 5x5, ecal driven barrel", nbinp, 0., pmax);
671  histSclE5x5_eg_barrel_->Sumw2();
672  histSclE5x5_eg_endcaps_ =
673  new TH1F("h_scl_E5x5_eg_endcaps", "ele supercluster energy in 5x5, ecal driven endcaps", nbinp, 0., pmax);
674  histSclE5x5_eg_endcaps_->Sumw2();
675 
676  histSclEoEtruePfVsEg =
677  new TH2F("h_scl_EoEtruePfVsEg", "ele supercluster energy / gen energy pflow vs eg", 75, -0.1, 1.4, 75, -0.1, 1.4);
678 
679  // matched electron, gsf tracks
680  h_ele_ambiguousTracks = new TH1F("h_ele_ambiguousTracks", "ele # ambiguous tracks", 5, 0., 5.);
681  h_ele_ambiguousTracks->Sumw2();
682  h_ele_ambiguousTracksVsEta =
683  new TH2F("h_ele_ambiguousTracksVsEta", "ele # ambiguous tracks vs eta", nbineta2D, etamin, etamax, 5, 0., 5.);
684  h_ele_ambiguousTracksVsPhi =
685  new TH2F("h_ele_ambiguousTracksVsPhi", "ele # ambiguous tracks vs phi", nbinphi2D, phimin, phimax, 5, 0., 5.);
686  h_ele_ambiguousTracksVsPt =
687  new TH2F("h_ele_ambiguousTracksVsPt", "ele # ambiguous tracks vs pt", nbinpt2D, 0., ptmax, 5, 0., 5.);
688  h_ele_foundHits = new TH1F("h_ele_foundHits", "ele track # found hits", nbinfhits, 0., fhitsmax);
689  h_ele_foundHits->Sumw2();
690  h_ele_foundHits_barrel =
691  new TH1F("h_ele_foundHits_barrel", "ele track # found hits, barrel", nbinfhits, 0., fhitsmax);
692  h_ele_foundHits_barrel->Sumw2();
693  h_ele_foundHits_endcaps =
694  new TH1F("h_ele_foundHits_endcaps", "ele track # found hits, endcaps", nbinfhits, 0., fhitsmax);
695  h_ele_foundHits_endcaps->Sumw2();
696  h_ele_foundHitsVsEta = new TH2F(
697  "h_ele_foundHitsVsEta", "ele track # found hits vs eta", nbineta2D, etamin, etamax, nbinfhits, 0., fhitsmax);
698  h_ele_foundHitsVsPhi = new TH2F(
699  "h_ele_foundHitsVsPhi", "ele track # found hits vs phi", nbinphi2D, phimin, phimax, nbinfhits, 0., fhitsmax);
700  h_ele_foundHitsVsPt =
701  new TH2F("h_ele_foundHitsVsPt", "ele track # found hits vs pt", nbinpt2D, 0., ptmax, nbinfhits, 0., fhitsmax);
702  h_ele_lostHits = new TH1F("h_ele_lostHits", "ele track # lost hits", 5, 0., 5.);
703  h_ele_lostHits->Sumw2();
704  h_ele_lostHits_barrel = new TH1F("h_ele_lostHits_barrel", "ele track # lost hits, barrel", 5, 0., 5.);
705  h_ele_lostHits_barrel->Sumw2();
706  h_ele_lostHits_endcaps = new TH1F("h_ele_lostHits_endcaps", "ele track # lost hits, endcaps", 5, 0., 5.);
707  h_ele_lostHits_endcaps->Sumw2();
708  h_ele_lostHitsVsEta = new TH2F(
709  "h_ele_lostHitsVsEta", "ele track # lost hits vs eta", nbineta2D, etamin, etamax, nbinlhits, 0., lhitsmax);
710  h_ele_lostHitsVsPhi = new TH2F(
711  "h_ele_lostHitsVsPhi", "ele track # lost hits vs eta", nbinphi2D, phimin, phimax, nbinlhits, 0., lhitsmax);
712  h_ele_lostHitsVsPt =
713  new TH2F("h_ele_lostHitsVsPt", "ele track # lost hits vs eta", nbinpt2D, 0., ptmax, nbinlhits, 0., lhitsmax);
714  h_ele_chi2 = new TH1F("h_ele_chi2", "ele track #chi^{2}", 100, 0., 15.);
715  h_ele_chi2->Sumw2();
716  h_ele_chi2_barrel = new TH1F("h_ele_chi2_barrel", "ele track #chi^{2}, barrel", 100, 0., 15.);
717  h_ele_chi2_barrel->Sumw2();
718  h_ele_chi2_endcaps = new TH1F("h_ele_chi2_endcaps", "ele track #chi^{2}, endcaps", 100, 0., 15.);
719  h_ele_chi2_endcaps->Sumw2();
720  h_ele_chi2VsEta = new TH2F("h_ele_chi2VsEta", "ele track #chi^{2} vs eta", nbineta2D, etamin, etamax, 50, 0., 15.);
721  h_ele_chi2VsPhi = new TH2F("h_ele_chi2VsPhi", "ele track #chi^{2} vs phi", nbinphi2D, phimin, phimax, 50, 0., 15.);
722  h_ele_chi2VsPt = new TH2F("h_ele_chi2VsPt", "ele track #chi^{2} vs pt", nbinpt2D, 0., ptmax, 50, 0., 15.);
723  h_ele_PinMnPout = new TH1F("h_ele_PinMnPout", "ele track inner p - outer p, mean of GSF components", nbinp, 0., 200.);
724  h_ele_PinMnPout->Sumw2();
725  h_ele_PinMnPout_mode =
726  new TH1F("h_ele_PinMnPout_mode", "ele track inner p - outer p, mode of GSF components", nbinp, 0., 100.);
727  h_ele_PinMnPout_mode->Sumw2();
728  h_ele_PinMnPoutVsEta_mode = new TH2F("h_ele_PinMnPoutVsEta_mode",
729  "ele track inner p - outer p vs eta, mode of GSF components",
730  nbineta2D,
731  etamin,
732  etamax,
733  nbinp2D,
734  0.,
735  100.);
736  h_ele_PinMnPoutVsPhi_mode = new TH2F("h_ele_PinMnPoutVsPhi_mode",
737  "ele track inner p - outer p vs phi, mode of GSF components",
738  nbinphi2D,
739  phimin,
740  phimax,
741  nbinp2D,
742  0.,
743  100.);
744  h_ele_PinMnPoutVsPt_mode = new TH2F("h_ele_PinMnPoutVsPt_mode",
745  "ele track inner p - outer p vs pt, mode of GSF components",
746  nbinpt2D,
747  0.,
748  ptmax,
749  nbinp2D,
750  0.,
751  100.);
752  h_ele_PinMnPoutVsE_mode = new TH2F("h_ele_PinMnPoutVsE_mode",
753  "ele track inner p - outer p vs E, mode of GSF components",
754  nbinp2D,
755  0.,
756  200.,
757  nbinp2D,
758  0.,
759  100.);
760  h_ele_PinMnPoutVsChi2_mode = new TH2F("h_ele_PinMnPoutVsChi2_mode",
761  "ele track inner p - outer p vs track chi2, mode of GSF components",
762  50,
763  0.,
764  20.,
765  nbinp2D,
766  0.,
767  100.);
768  h_ele_outerP = new TH1F("h_ele_outerP", "ele track outer p, mean of GSF components", nbinp, 0., pmax);
769  h_ele_outerP->Sumw2();
770  h_ele_outerP_mode = new TH1F("h_ele_outerP_mode", "ele track outer p, mode of GSF components", nbinp, 0., pmax);
771  h_ele_outerP_mode->Sumw2();
772  h_ele_outerPVsEta_mode =
773  new TH2F("h_ele_outerPVsEta_mode", "ele track outer p vs eta mode", nbineta2D, etamin, etamax, 50, 0., pmax);
774  h_ele_outerPt = new TH1F("h_ele_outerPt", "ele track outer p_{T}, mean of GSF components", nbinpt, 0., ptmax);
775  h_ele_outerPt->Sumw2();
776  h_ele_outerPt_mode =
777  new TH1F("h_ele_outerPt_mode", "ele track outer p_{T}, mode of GSF components", nbinpt, 0., ptmax);
778  h_ele_outerPt_mode->Sumw2();
779  h_ele_outerPtVsEta_mode = new TH2F("h_ele_outerPtVsEta_mode",
780  "ele track outer p_{T} vs eta, mode of GSF components",
781  nbineta2D,
782  etamin,
783  etamax,
784  nbinpt2D,
785  0.,
786  ptmax);
787  h_ele_outerPtVsPhi_mode = new TH2F("h_ele_outerPtVsPhi_mode",
788  "ele track outer p_{T} vs phi, mode of GSF components",
789  nbinphi2D,
790  phimin,
791  phimax,
792  nbinpt2D,
793  0.,
794  ptmax);
795  h_ele_outerPtVsPt_mode = new TH2F("h_ele_outerPtVsPt_mode",
796  "ele track outer p_{T} vs pt, mode of GSF components",
797  nbinpt2D,
798  0.,
799  100.,
800  nbinpt2D,
801  0.,
802  ptmax);
803 
804  // matched electrons, matching
805  h_ele_EoP = new TH1F("h_ele_EoP", "ele E/P_{vertex}", nbineop, 0., eopmax);
806  h_ele_EoP->Sumw2();
807  h_ele_EoP_eg = new TH1F("h_ele_EoP_eg", "ele E/P_{vertex}, ecal driven", nbineop, 0., eopmax);
808  h_ele_EoP_eg->Sumw2();
809  h_ele_EoP_barrel = new TH1F("h_ele_EoP_barrel", "ele E/P_{vertex} barrel", nbineop, 0., eopmax);
810  h_ele_EoP_barrel->Sumw2();
811  h_ele_EoP_eg_barrel = new TH1F("h_ele_EoP_eg_barrel", "ele E/P_{vertex}, ecal driven barrel", nbineop, 0., eopmax);
812  h_ele_EoP_eg_barrel->Sumw2();
813  h_ele_EoP_endcaps = new TH1F("h_ele_EoP_endcaps", "ele E/P_{vertex} endcaps", nbineop, 0., eopmax);
814  h_ele_EoP_endcaps->Sumw2();
815  h_ele_EoP_eg_endcaps = new TH1F("h_ele_EoP_eg_endcaps", "ele E/P_{vertex}, ecal driven endcaps", nbineop, 0., eopmax);
816  h_ele_EoP_eg_endcaps->Sumw2();
817  h_ele_EoPVsEta =
818  new TH2F("h_ele_EoPVsEta", "ele E/P_{vertex} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
819  h_ele_EoPVsPhi =
820  new TH2F("h_ele_EoPVsPhi", "ele E/P_{vertex} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
821  h_ele_EoPVsE = new TH2F("h_ele_EoPVsE", "ele E/P_{vertex} vs E", 50, 0., pmax, 50, 0., 5.);
822  h_ele_EseedOP = new TH1F("h_ele_EseedOP", "ele E_{seed}/P_{vertex}", nbineop, 0., eopmax);
823  h_ele_EseedOP->Sumw2();
824  h_ele_EseedOP_eg = new TH1F("h_ele_EseedOP_eg", "ele E_{seed}/P_{vertex}, ecal driven", nbineop, 0., eopmax);
825  h_ele_EseedOP_eg->Sumw2();
826  h_ele_EseedOP_barrel = new TH1F("h_ele_EseedOP_barrel", "ele E_{seed}/P_{vertex} barrel", nbineop, 0., eopmax);
827  h_ele_EseedOP_barrel->Sumw2();
828  h_ele_EseedOP_eg_barrel =
829  new TH1F("h_ele_EseedOP_eg_barrel", "ele E_{seed}/P_{vertex}, ecal driven barrel", nbineop, 0., eopmax);
830  h_ele_EseedOP_eg_barrel->Sumw2();
831  h_ele_EseedOP_endcaps = new TH1F("h_ele_EseedOP_endcaps", "ele E_{seed}/P_{vertex} endcaps", nbineop, 0., eopmax);
832  h_ele_EseedOP_endcaps->Sumw2();
833  h_ele_EseedOP_eg_endcaps =
834  new TH1F("h_ele_EseedOP_eg_endcaps", "ele E_{seed}/P_{vertex}, ecal driven, endcaps", nbineop, 0., eopmax);
835  h_ele_EseedOP_eg_endcaps->Sumw2();
836  h_ele_EseedOPVsEta = new TH2F(
837  "h_ele_EseedOPVsEta", "ele E_{seed}/P_{vertex} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
838  h_ele_EseedOPVsPhi = new TH2F(
839  "h_ele_EseedOPVsPhi", "ele E_{seed}/P_{vertex} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
840  h_ele_EseedOPVsE = new TH2F("h_ele_EseedOPVsE", "ele E_{seed}/P_{vertex} vs E", 50, 0., pmax, 50, 0., 5.);
841  h_ele_EoPout = new TH1F("h_ele_EoPout", "ele E_{seed}/P_{out}", nbineop, 0., eopmax);
842  h_ele_EoPout->Sumw2();
843  h_ele_EoPout_eg = new TH1F("h_ele_EoPout_eg", "ele E_{seed}/P_{out}, ecal driven", nbineop, 0., eopmax);
844  h_ele_EoPout_eg->Sumw2();
845  h_ele_EoPout_barrel = new TH1F("h_ele_EoPout_barrel", "ele E_{seed}/P_{out} barrel", nbineop, 0., eopmax);
846  h_ele_EoPout_barrel->Sumw2();
847  h_ele_EoPout_eg_barrel =
848  new TH1F("h_ele_EoPout_eg_barrel", "ele E_{seed}/P_{out}, ecal driven, barrel", nbineop, 0., eopmax);
849  h_ele_EoPout_eg_barrel->Sumw2();
850  h_ele_EoPout_endcaps = new TH1F("h_ele_EoPout_endcaps", "ele E_{seed}/P_{out} endcaps", nbineop, 0., eopmax);
851  h_ele_EoPout_endcaps->Sumw2();
852  h_ele_EoPout_eg_endcaps =
853  new TH1F("h_ele_EoPout_eg_endcaps", "ele E_{seed}/P_{out}, ecal driven, endcaps", nbineop, 0., eopmax);
854  h_ele_EoPout_eg_endcaps->Sumw2();
855  h_ele_EoPoutVsEta =
856  new TH2F("h_ele_EoPoutVsEta", "ele E_{seed}/P_{out} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
857  h_ele_EoPoutVsPhi =
858  new TH2F("h_ele_EoPoutVsPhi", "ele E_{seed}/P_{out} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
859  h_ele_EoPoutVsE =
860  new TH2F("h_ele_EoPoutVsE", "ele E_{seed}/P_{out} vs E", nbinp2D, 0., pmax, nbineop2D, 0., eopmaxsht);
861  h_ele_EeleOPout = new TH1F("h_ele_EeleOPout", "ele E_{ele}/P_{out}", nbineop, 0., eopmax);
862  h_ele_EeleOPout->Sumw2();
863  h_ele_EeleOPout_eg = new TH1F("h_ele_EeleOPout_eg", "ele E_{ele}/P_{out}, ecal driven", nbineop, 0., eopmax);
864  h_ele_EeleOPout_eg->Sumw2();
865  h_ele_EeleOPout_barrel = new TH1F("h_ele_EeleOPout_barrel", "ele E_{ele}/P_{out} barrel", nbineop, 0., eopmax);
866  h_ele_EeleOPout_barrel->Sumw2();
867  h_ele_EeleOPout_eg_barrel =
868  new TH1F("h_ele_EeleOPout_eg_barrel", "ele E_{ele}/P_{out}, ecal driven, barrel", nbineop, 0., eopmax);
869  h_ele_EeleOPout_eg_barrel->Sumw2();
870  h_ele_EeleOPout_endcaps = new TH1F("h_ele_EeleOPout_endcaps", "ele E_{ele}/P_{out} endcaps", nbineop, 0., eopmax);
871  h_ele_EeleOPout_endcaps->Sumw2();
872  h_ele_EeleOPout_eg_endcaps =
873  new TH1F("h_ele_EeleOPout_eg_endcaps", "ele E_{ele}/P_{out}, ecal driven, endcaps", nbineop, 0., eopmax);
874  h_ele_EeleOPout_eg_endcaps->Sumw2();
875  h_ele_EeleOPoutVsEta = new TH2F(
876  "h_ele_EeleOPoutVsEta", "ele E_{ele}/P_{out} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
877  h_ele_EeleOPoutVsPhi = new TH2F(
878  "h_ele_EeleOPoutVsPhi", "ele E_{ele}/P_{out} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
879  h_ele_EeleOPoutVsE =
880  new TH2F("h_ele_EeleOPoutVsE", "ele E_{ele}/P_{out} vs E", nbinp2D, 0., pmax, nbineop2D, 0., eopmaxsht);
881  h_ele_dEtaSc_propVtx = new TH1F(
882  "h_ele_dEtaSc_propVtx", "ele #eta_{sc} - #eta_{tr}, prop from vertex", nbindetamatch, detamatchmin, detamatchmax);
883  h_ele_dEtaSc_propVtx->Sumw2();
884  h_ele_dEtaSc_propVtx_eg = new TH1F("h_ele_dEtaSc_propVtx_eg",
885  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven",
886  nbindetamatch,
887  detamatchmin,
888  detamatchmax);
889  h_ele_dEtaSc_propVtx_eg->Sumw2();
890  h_ele_dEtaSc_propVtx_barrel = new TH1F("h_ele_dEtaSc_propVtx_barrel",
891  "ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",
892  nbindetamatch,
893  detamatchmin,
894  detamatchmax);
895  h_ele_dEtaSc_propVtx_barrel->Sumw2();
896  h_ele_dEtaSc_propVtx_eg_barrel = new TH1F("h_ele_dEtaSc_propVtx_eg_barrel",
897  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, barrel",
898  nbindetamatch,
899  detamatchmin,
900  detamatchmax);
901  h_ele_dEtaSc_propVtx_eg_barrel->Sumw2();
902  h_ele_dEtaSc_propVtx_endcaps = new TH1F("h_ele_dEtaSc_propVtx_endcaps",
903  "ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",
904  nbindetamatch,
905  detamatchmin,
906  detamatchmax);
907  h_ele_dEtaSc_propVtx_endcaps->Sumw2();
908  h_ele_dEtaSc_propVtx_eg_endcaps = new TH1F("h_ele_dEtaSc_propVtx_eg_endcaps",
909  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, endcaps",
910  nbindetamatch,
911  detamatchmin,
912  detamatchmax);
913  h_ele_dEtaSc_propVtx_eg_endcaps->Sumw2();
914  h_ele_dEtaScVsEta_propVtx = new TH2F("h_ele_dEtaScVsEta_propVtx",
915  "ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",
916  nbineta2D,
917  etamin,
918  etamax,
919  nbindetamatch2D,
920  detamatchmin,
921  detamatchmax);
922  h_ele_dEtaScVsPhi_propVtx = new TH2F("h_ele_dEtaScVsPhi_propVtx",
923  "ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",
924  nbinphi2D,
925  phimin,
926  phimax,
927  nbindetamatch2D,
928  detamatchmin,
929  detamatchmax);
930  h_ele_dEtaScVsPt_propVtx = new TH2F("h_ele_dEtaScVsPt_propVtx",
931  "ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",
932  nbinpt2D,
933  0.,
934  ptmax,
935  nbindetamatch2D,
936  detamatchmin,
937  detamatchmax);
938  h_ele_dPhiSc_propVtx = new TH1F(
939  "h_ele_dPhiSc_propVtx", "ele #phi_{sc} - #phi_{tr}, prop from vertex", nbindphimatch, dphimatchmin, dphimatchmax);
940  h_ele_dPhiSc_propVtx->Sumw2();
941  h_ele_dPhiSc_propVtx_eg = new TH1F("h_ele_dPhiSc_propVtx_eg",
942  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven",
943  nbindphimatch,
944  dphimatchmin,
945  dphimatchmax);
946  h_ele_dPhiSc_propVtx_eg->Sumw2();
947  h_ele_dPhiSc_propVtx_barrel = new TH1F("h_ele_dPhiSc_propVtx_barrel",
948  "ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",
949  nbindphimatch,
950  dphimatchmin,
951  dphimatchmax);
952  h_ele_dPhiSc_propVtx_barrel->Sumw2();
953  h_ele_dPhiSc_propVtx_eg_barrel = new TH1F("h_ele_dPhiSc_propVtx_eg_barrel",
954  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, barrel",
955  nbindphimatch,
956  dphimatchmin,
957  dphimatchmax);
958  h_ele_dPhiSc_propVtx_eg_barrel->Sumw2();
959  h_ele_dPhiSc_propVtx_endcaps = new TH1F("h_ele_dPhiSc_propVtx_endcaps",
960  "ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",
961  nbindphimatch,
962  dphimatchmin,
963  dphimatchmax);
964  h_ele_dPhiSc_propVtx_endcaps->Sumw2();
965  h_ele_dPhiSc_propVtx_eg_endcaps = new TH1F("h_ele_dPhiSc_propVtx_eg_endcaps",
966  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, endcaps",
967  nbindphimatch,
968  dphimatchmin,
969  dphimatchmax);
970  h_ele_dPhiSc_propVtx_eg_endcaps->Sumw2();
971  h_ele_dPhiScVsEta_propVtx = new TH2F("h_ele_dPhiScVsEta_propVtx",
972  "ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",
973  nbineta2D,
974  etamin,
975  etamax,
976  nbindphimatch2D,
977  dphimatchmin,
978  dphimatchmax);
979  h_ele_dPhiScVsPhi_propVtx = new TH2F("h_ele_dPhiScVsPhi_propVtx",
980  "ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",
981  nbinphi2D,
982  phimin,
983  phimax,
984  nbindphimatch2D,
985  dphimatchmin,
986  dphimatchmax);
987  h_ele_dPhiScVsPt_propVtx = new TH2F("h_ele_dPhiScVsPt_propVtx",
988  "ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",
989  nbinpt2D,
990  0.,
991  ptmax,
992  nbindphimatch2D,
993  dphimatchmin,
994  dphimatchmax);
995  h_ele_dEtaCl_propOut = new TH1F("h_ele_dEtaCl_propOut",
996  "ele #eta_{cl} - #eta_{tr}, prop from outermost",
997  nbindetamatch,
998  detamatchmin,
999  detamatchmax);
1000  h_ele_dEtaCl_propOut->Sumw2();
1001  h_ele_dEtaCl_propOut_eg = new TH1F("h_ele_dEtaCl_propOut_eg",
1002  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven",
1003  nbindetamatch,
1004  detamatchmin,
1005  detamatchmax);
1006  h_ele_dEtaCl_propOut_eg->Sumw2();
1007  h_ele_dEtaCl_propOut_barrel = new TH1F("h_ele_dEtaCl_propOut_barrel",
1008  "ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",
1009  nbindetamatch,
1010  detamatchmin,
1011  detamatchmax);
1012  h_ele_dEtaCl_propOut_barrel->Sumw2();
1013  h_ele_dEtaCl_propOut_eg_barrel = new TH1F("h_ele_dEtaCl_propOut_eg_barrel",
1014  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
1015  nbindetamatch,
1016  detamatchmin,
1017  detamatchmax);
1018  h_ele_dEtaCl_propOut_eg_barrel->Sumw2();
1019  h_ele_dEtaCl_propOut_endcaps = new TH1F("h_ele_dEtaCl_propOut_endcaps",
1020  "ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",
1021  nbindetamatch,
1022  detamatchmin,
1023  detamatchmax);
1024  h_ele_dEtaCl_propOut_endcaps->Sumw2();
1025  h_ele_dEtaCl_propOut_eg_endcaps = new TH1F("h_ele_dEtaCl_propOut_eg_endcaps",
1026  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
1027  nbindetamatch,
1028  detamatchmin,
1029  detamatchmax);
1030  h_ele_dEtaCl_propOut_eg_endcaps->Sumw2();
1031  h_ele_dEtaClVsEta_propOut = new TH2F("h_ele_dEtaClVsEta_propOut",
1032  "ele #eta_{cl} - #eta_{tr} vs eta, prop from out",
1033  nbineta2D,
1034  etamin,
1035  etamax,
1036  nbindetamatch2D,
1037  detamatchmin,
1038  detamatchmax);
1039  h_ele_dEtaClVsPhi_propOut = new TH2F("h_ele_dEtaClVsPhi_propOut",
1040  "ele #eta_{cl} - #eta_{tr} vs phi, prop from out",
1041  nbinphi2D,
1042  phimin,
1043  phimax,
1044  nbindetamatch2D,
1045  detamatchmin,
1046  detamatchmax);
1047  h_ele_dEtaClVsPt_propOut = new TH2F("h_ele_dEtaScVsPt_propOut",
1048  "ele #eta_{cl} - #eta_{tr} vs pt, prop from out",
1049  nbinpt2D,
1050  0.,
1051  ptmax,
1052  nbindetamatch2D,
1053  detamatchmin,
1054  detamatchmax);
1055  h_ele_dPhiCl_propOut = new TH1F("h_ele_dPhiCl_propOut",
1056  "ele #phi_{cl} - #phi_{tr}, prop from outermost",
1057  nbindphimatch,
1058  dphimatchmin,
1059  dphimatchmax);
1060  h_ele_dPhiCl_propOut->Sumw2();
1061  h_ele_dPhiCl_propOut_eg = new TH1F("h_ele_dPhiCl_propOut_eg",
1062  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven",
1063  nbindphimatch,
1064  dphimatchmin,
1065  dphimatchmax);
1066  h_ele_dPhiCl_propOut_eg->Sumw2();
1067  h_ele_dPhiCl_propOut_barrel = new TH1F("h_ele_dPhiCl_propOut_barrel",
1068  "ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",
1069  nbindphimatch,
1070  dphimatchmin,
1071  dphimatchmax);
1072  h_ele_dPhiCl_propOut_barrel->Sumw2();
1073  h_ele_dPhiCl_propOut_eg_barrel = new TH1F("h_ele_dPhiCl_propOut_eg_barrel",
1074  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
1075  nbindphimatch,
1076  dphimatchmin,
1077  dphimatchmax);
1078  h_ele_dPhiCl_propOut_eg_barrel->Sumw2();
1079  h_ele_dPhiCl_propOut_endcaps = new TH1F("h_ele_dPhiCl_propOut_endcaps",
1080  "ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",
1081  nbindphimatch,
1082  dphimatchmin,
1083  dphimatchmax);
1084  h_ele_dPhiCl_propOut_endcaps->Sumw2();
1085  h_ele_dPhiCl_propOut_eg_endcaps = new TH1F("h_ele_dPhiCl_propOut_eg_endcaps",
1086  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
1087  nbindphimatch,
1088  dphimatchmin,
1089  dphimatchmax);
1090  h_ele_dPhiCl_propOut_eg_endcaps->Sumw2();
1091  h_ele_dPhiClVsEta_propOut = new TH2F("h_ele_dPhiClVsEta_propOut",
1092  "ele #phi_{cl} - #phi_{tr} vs eta, prop from out",
1093  nbineta2D,
1094  etamin,
1095  etamax,
1096  nbindphimatch2D,
1097  dphimatchmin,
1098  dphimatchmax);
1099  h_ele_dPhiClVsPhi_propOut = new TH2F("h_ele_dPhiClVsPhi_propOut",
1100  "ele #phi_{cl} - #phi_{tr} vs phi, prop from out",
1101  nbinphi2D,
1102  phimin,
1103  phimax,
1104  nbindphimatch2D,
1105  dphimatchmin,
1106  dphimatchmax);
1107  h_ele_dPhiClVsPt_propOut = new TH2F("h_ele_dPhiSClsPt_propOut",
1108  "ele #phi_{cl} - #phi_{tr} vs pt, prop from out",
1109  nbinpt2D,
1110  0.,
1111  ptmax,
1112  nbindphimatch2D,
1113  dphimatchmin,
1114  dphimatchmax);
1115  h_ele_dEtaEleCl_propOut = new TH1F("h_ele_dEtaEleCl_propOut",
1116  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",
1117  nbindetamatch,
1118  detamatchmin,
1119  detamatchmax);
1120  h_ele_dEtaEleCl_propOut->Sumw2();
1121  h_ele_dEtaEleCl_propOut_eg = new TH1F("h_ele_dEtaEleCl_propOut_eg",
1122  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven",
1123  nbindetamatch,
1124  detamatchmin,
1125  detamatchmax);
1126  h_ele_dEtaEleCl_propOut_eg->Sumw2();
1127  h_ele_dEtaEleCl_propOut_barrel = new TH1F("h_ele_dEtaEleCl_propOut_barrel",
1128  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",
1129  nbindetamatch,
1130  detamatchmin,
1131  detamatchmax);
1132  h_ele_dEtaEleCl_propOut_barrel->Sumw2();
1133  h_ele_dEtaEleCl_propOut_eg_barrel = new TH1F("h_ele_dEtaEleCl_propOut_eg_barrel",
1134  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
1135  nbindetamatch,
1136  detamatchmin,
1137  detamatchmax);
1138  h_ele_dEtaEleCl_propOut_eg_barrel->Sumw2();
1139  h_ele_dEtaEleCl_propOut_endcaps = new TH1F("h_ele_dEtaEleCl_propOut_endcaps",
1140  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",
1141  nbindetamatch,
1142  detamatchmin,
1143  detamatchmax);
1144  h_ele_dEtaEleCl_propOut_endcaps->Sumw2();
1145  h_ele_dEtaEleCl_propOut_eg_endcaps =
1146  new TH1F("h_ele_dEtaEleCl_propOut_eg_endcaps",
1147  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
1148  nbindetamatch,
1149  detamatchmin,
1150  detamatchmax);
1151  h_ele_dEtaEleCl_propOut_eg_endcaps->Sumw2();
1152  h_ele_dEtaEleClVsEta_propOut = new TH2F("h_ele_dEtaEleClVsEta_propOut",
1153  "ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",
1154  nbineta2D,
1155  etamin,
1156  etamax,
1157  nbindetamatch2D,
1158  detamatchmin,
1159  detamatchmax);
1160  h_ele_dEtaEleClVsPhi_propOut = new TH2F("h_ele_dEtaEleClVsPhi_propOut",
1161  "ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",
1162  nbinphi2D,
1163  phimin,
1164  phimax,
1165  nbindetamatch2D,
1166  detamatchmin,
1167  detamatchmax);
1168  h_ele_dEtaEleClVsPt_propOut = new TH2F("h_ele_dEtaScVsPt_propOut",
1169  "ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",
1170  nbinpt2D,
1171  0.,
1172  ptmax,
1173  nbindetamatch2D,
1174  detamatchmin,
1175  detamatchmax);
1176  h_ele_dPhiEleCl_propOut = new TH1F("h_ele_dPhiEleCl_propOut",
1177  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",
1178  nbindphimatch,
1179  dphimatchmin,
1180  dphimatchmax);
1181  h_ele_dPhiEleCl_propOut->Sumw2();
1182  h_ele_dPhiEleCl_propOut_eg = new TH1F("h_ele_dPhiEleCl_propOut_eg",
1183  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven",
1184  nbindphimatch,
1185  dphimatchmin,
1186  dphimatchmax);
1187  h_ele_dPhiEleCl_propOut_eg->Sumw2();
1188  h_ele_dPhiEleCl_propOut_barrel = new TH1F("h_ele_dPhiEleCl_propOut_barrel",
1189  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",
1190  nbindphimatch,
1191  dphimatchmin,
1192  dphimatchmax);
1193  h_ele_dPhiEleCl_propOut_barrel->Sumw2();
1194  h_ele_dPhiEleCl_propOut_eg_barrel = new TH1F("h_ele_dPhiEleCl_propOut_eg_barrel",
1195  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
1196  nbindphimatch,
1197  dphimatchmin,
1198  dphimatchmax);
1199  h_ele_dPhiEleCl_propOut_eg_barrel->Sumw2();
1200  h_ele_dPhiEleCl_propOut_endcaps = new TH1F("h_ele_dPhiEleCl_propOut_endcaps",
1201  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",
1202  nbindphimatch,
1203  dphimatchmin,
1204  dphimatchmax);
1205  h_ele_dPhiEleCl_propOut_endcaps->Sumw2();
1206  h_ele_dPhiEleCl_propOut_eg_endcaps =
1207  new TH1F("h_ele_dPhiEleCl_propOut_eg_endcaps",
1208  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
1209  nbindphimatch,
1210  dphimatchmin,
1211  dphimatchmax);
1212  h_ele_dPhiEleCl_propOut_eg_endcaps->Sumw2();
1213  h_ele_dPhiEleClVsEta_propOut = new TH2F("h_ele_dPhiEleClVsEta_propOut",
1214  "ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",
1215  nbineta2D,
1216  etamin,
1217  etamax,
1218  nbindphimatch2D,
1219  dphimatchmin,
1220  dphimatchmax);
1221  h_ele_dPhiEleClVsPhi_propOut = new TH2F("h_ele_dPhiEleClVsPhi_propOut",
1222  "ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",
1223  nbinphi2D,
1224  phimin,
1225  phimax,
1226  nbindphimatch2D,
1227  dphimatchmin,
1228  dphimatchmax);
1229  h_ele_dPhiEleClVsPt_propOut = new TH2F("h_ele_dPhiSEleClsPt_propOut",
1230  "ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",
1231  nbinpt2D,
1232  0.,
1233  ptmax,
1234  nbindphimatch2D,
1235  dphimatchmin,
1236  dphimatchmax);
1237 
1238  h_ele_HoE = new TH1F("h_ele_HoE", "ele hadronic energy / em energy", nbinhoe, hoemin, hoemax);
1239  h_ele_HoE->Sumw2();
1240  h_ele_HoE_eg = new TH1F("h_ele_HoE_eg", "ele hadronic energy / em energy, ecal driven", nbinhoe, hoemin, hoemax);
1241  h_ele_HoE_eg->Sumw2();
1242  h_ele_HoE_barrel = new TH1F("h_ele_HoE_barrel", "ele hadronic energy / em energy, barrel", nbinhoe, hoemin, hoemax);
1243  h_ele_HoE_barrel->Sumw2();
1244  h_ele_HoE_eg_barrel =
1245  new TH1F("h_ele_HoE_eg_barrel", "ele hadronic energy / em energy, ecal driven, barrel", nbinhoe, hoemin, hoemax);
1246  h_ele_HoE_eg_barrel->Sumw2();
1247  h_ele_HoE_endcaps =
1248  new TH1F("h_ele_HoE_endcaps", "ele hadronic energy / em energy, endcaps", nbinhoe, hoemin, hoemax);
1249  h_ele_HoE_endcaps->Sumw2();
1250  h_ele_HoE_eg_endcaps = new TH1F(
1251  "h_ele_HoE_eg_endcaps", "ele hadronic energy / em energy, ecal driven, endcaps", nbinhoe, hoemin, hoemax);
1252  h_ele_HoE_eg_endcaps->Sumw2();
1253  h_ele_HoE_fiducial =
1254  new TH1F("h_ele_HoE_fiducial", "ele hadronic energy / em energy, fiducial region", nbinhoe, hoemin, hoemax);
1255  h_ele_HoE_fiducial->Sumw2();
1256  h_ele_HoEVsEta = new TH2F(
1257  "h_ele_HoEVsEta", "ele hadronic energy / em energy vs eta", nbineta, etamin, etamax, nbinhoe, hoemin, hoemax);
1258  h_ele_HoEVsPhi = new TH2F(
1259  "h_ele_HoEVsPhi", "ele hadronic energy / em energy vs phi", nbinphi2D, phimin, phimax, nbinhoe, hoemin, hoemax);
1260  h_ele_HoEVsE =
1261  new TH2F("h_ele_HoEVsE", "ele hadronic energy / em energy vs E", nbinp, 0., 300., nbinhoe, hoemin, hoemax);
1262 
1263  h_ele_seed_dphi2_ = new TH1F("h_ele_seedDphi2", "ele seed dphi 2nd layer", 50, -0.003, +0.003);
1264  h_ele_seed_dphi2_->Sumw2();
1265  h_ele_seed_dphi2VsEta_ =
1266  new TH2F("h_ele_seedDphi2VsEta", "ele seed dphi 2nd layer vs eta", nbineta2D, etamin, etamax, 50, -0.003, +0.003);
1267  h_ele_seed_dphi2VsPt_ =
1268  new TH2F("h_ele_seedDphi2VsPt", "ele seed dphi 2nd layer vs pt", nbinpt2D, 0., ptmax, 50, -0.003, +0.003);
1269  h_ele_seed_drz2_ = new TH1F("h_ele_seedDrz2", "ele seed dr (dz) 2nd layer", 50, -0.03, +0.03);
1270  h_ele_seed_drz2_->Sumw2();
1271  h_ele_seed_drz2VsEta_ =
1272  new TH2F("h_ele_seedDrz2VsEta", "ele seed dr/dz 2nd layer vs eta", nbineta2D, etamin, etamax, 50, -0.03, +0.03);
1273  h_ele_seed_drz2VsPt_ =
1274  new TH2F("h_ele_seedDrz2VsPt", "ele seed dr/dz 2nd layer vs pt", nbinpt2D, 0., ptmax, 50, -0.03, +0.03);
1275  h_ele_seed_subdet2_ = new TH1F("h_ele_seedSubdet2", "ele seed subdet 2nd layer", 10, 0., 10.);
1276  h_ele_seed_subdet2_->Sumw2();
1277 
1278  // classes
1279  h_ele_classes = new TH1F("h_ele_classes", "ele classes", 20, 0.0, 20.);
1280  h_ele_classes->Sumw2();
1281  h_ele_eta = new TH1F("h_ele_eta", "ele electron eta", nbineta / 2, 0.0, etamax);
1282  h_ele_eta->Sumw2();
1283  h_ele_eta_golden = new TH1F("h_ele_eta_golden", "ele electron eta golden", nbineta / 2, 0.0, etamax);
1284  h_ele_eta_golden->Sumw2();
1285  h_ele_eta_bbrem = new TH1F("h_ele_eta_bbrem", "ele electron eta bbrem", nbineta / 2, 0.0, etamax);
1286  h_ele_eta_bbrem->Sumw2();
1287  h_ele_eta_narrow = new TH1F("h_ele_eta_narrow", "ele electron eta narrow", nbineta / 2, 0.0, etamax);
1288  h_ele_eta_narrow->Sumw2();
1289  h_ele_eta_shower = new TH1F("h_ele_eta_show", "ele electron eta showering", nbineta / 2, 0.0, etamax);
1290  h_ele_eta_shower->Sumw2();
1291  h_ele_PinVsPoutGolden_mode = new TH2F("h_ele_PinVsPoutGolden_mode",
1292  "ele track inner p vs outer p vs eta, golden, mode of GSF components",
1293  nbinp2D,
1294  0.,
1295  pmax,
1296  50,
1297  0.,
1298  pmax);
1299  h_ele_PinVsPoutShowering_mode = new TH2F("h_ele_PinVsPoutShowering_mode",
1300  "ele track inner p vs outer p vs eta, showering, mode of GSF components",
1301  nbinp2D,
1302  0.,
1303  pmax,
1304  50,
1305  0.,
1306  pmax);
1307  h_ele_PinVsPoutGolden_mean = new TH2F("h_ele_PinVsPoutGolden_mean",
1308  "ele track inner p vs outer p vs eta, golden, mean of GSF components",
1309  nbinp2D,
1310  0.,
1311  pmax,
1312  50,
1313  0.,
1314  pmax);
1315  h_ele_PinVsPoutShowering_mean = new TH2F("h_ele_PinVsPoutShowering_mean",
1316  "ele track inner p vs outer p vs eta, showering, mean of GSF components",
1317  nbinp2D,
1318  0.,
1319  pmax,
1320  50,
1321  0.,
1322  pmax);
1323  h_ele_PtinVsPtoutGolden_mode = new TH2F("h_ele_PtinVsPtoutGolden_mode",
1324  "ele track inner pt vs outer pt vs eta, golden, mode of GSF components",
1325  nbinpt2D,
1326  0.,
1327  ptmax,
1328  50,
1329  0.,
1330  ptmax);
1331  h_ele_PtinVsPtoutShowering_mode = new TH2F("h_ele_PtinVsPtoutShowering_mode",
1332  "ele track inner pt vs outer pt vs eta, showering, mode of GSF components",
1333  nbinpt2D,
1334  0.,
1335  ptmax,
1336  50,
1337  0.,
1338  ptmax);
1339  h_ele_PtinVsPtoutGolden_mean = new TH2F("h_ele_PtinVsPtoutGolden_mean",
1340  "ele track inner pt vs outer pt vs eta, golden, mean of GSF components",
1341  nbinpt2D,
1342  0.,
1343  ptmax,
1344  50,
1345  0.,
1346  ptmax);
1347  h_ele_PtinVsPtoutShowering_mean = new TH2F("h_ele_PtinVsPtoutShowering_mean",
1348  "ele track inner pt vs outer pt vs eta, showering, mean of GSF components",
1349  nbinpt2D,
1350  0.,
1351  ptmax,
1352  50,
1353  0.,
1354  ptmax);
1355  histSclEoEtrueGolden_barrel = new TH1F("h_scl_EoEtrue_golden_barrel",
1356  "ele supercluster energy / gen energy, golden, barrel",
1357  nbinpoptrue,
1358  poptruemin,
1359  poptruemax);
1360  histSclEoEtrueGolden_barrel->Sumw2();
1361  histSclEoEtrueGolden_endcaps = new TH1F("h_scl_EoEtrue_golden_endcaps",
1362  "ele supercluster energy / gen energy, golden, endcaps",
1363  nbinpoptrue,
1364  poptruemin,
1365  poptruemax);
1366  histSclEoEtrueGolden_endcaps->Sumw2();
1367  histSclEoEtrueShowering_barrel = new TH1F("h_scl_EoEtrue_showering_barrel",
1368  "ele supercluster energy / gen energy, showering, barrel",
1369  nbinpoptrue,
1370  poptruemin,
1371  poptruemax);
1372  histSclEoEtrueShowering_barrel->Sumw2();
1373  histSclEoEtrueShowering_endcaps = new TH1F("h_scl_EoEtrue_showering_endcaps",
1374  "ele supercluster energy / gen energy, showering, endcaps",
1375  nbinpoptrue,
1376  poptruemin,
1377  poptruemax);
1378  histSclEoEtrueShowering_endcaps->Sumw2();
1379 
1380  // isolation
1381  h_ele_tkSumPt_dr03 = new TH1F("h_ele_tkSumPt_dr03", "tk isolation sum, dR=0.3", 100, 0.0, 20.);
1382  h_ele_tkSumPt_dr03->Sumw2();
1383  h_ele_ecalRecHitSumEt_dr03 = new TH1F("h_ele_ecalRecHitSumEt_dr03", "ecal isolation sum, dR=0.3", 100, 0.0, 20.);
1384  h_ele_ecalRecHitSumEt_dr03->Sumw2();
1385  h_ele_hcalDepth1TowerSumEt_dr03 =
1386  new TH1F("h_ele_hcalDepth1TowerSumEt_dr03", "hcal depth1 isolation sum, dR=0.3", 100, 0.0, 20.);
1387  h_ele_hcalDepth1TowerSumEt_dr03->Sumw2();
1388  h_ele_hcalDepth2TowerSumEt_dr03 =
1389  new TH1F("h_ele_hcalDepth2TowerSumEt_dr03", "hcal depth2 isolation sum, dR=0.3", 100, 0.0, 20.);
1390  h_ele_hcalDepth2TowerSumEt_dr03->Sumw2();
1391  h_ele_tkSumPt_dr04 = new TH1F("h_ele_tkSumPt_dr04", "tk isolation sum, dR=0.4", 100, 0.0, 20.);
1392  h_ele_tkSumPt_dr04->Sumw2();
1393  h_ele_ecalRecHitSumEt_dr04 = new TH1F("h_ele_ecalRecHitSumEt_dr04", "ecal isolation sum, dR=0.4", 100, 0.0, 20.);
1394  h_ele_ecalRecHitSumEt_dr04->Sumw2();
1395  h_ele_hcalDepth1TowerSumEt_dr04 =
1396  new TH1F("h_ele_hcalDepth1TowerSumEt_dr04", "hcal depth1 isolation sum, dR=0.4", 100, 0.0, 20.);
1397  h_ele_hcalDepth1TowerSumEt_dr04->Sumw2();
1398  h_ele_hcalDepth2TowerSumEt_dr04 =
1399  new TH1F("h_ele_hcalDepth2TowerSumEt_dr04", "hcal depth2 isolation sum, dR=0.4", 100, 0.0, 20.);
1400  h_ele_hcalDepth2TowerSumEt_dr04->Sumw2();
1401 
1402  // fbrem
1403  h_ele_fbrem = new TH1F("h_ele_fbrem", "ele brem fraction, mode of GSF components", 100, 0., 1.);
1404  h_ele_fbrem->Sumw2();
1405  h_ele_fbrem_eg = new TH1F("h_ele_fbrem_eg", "ele brem fraction, mode of GSF components, ecal driven", 100, 0., 1.);
1406  h_ele_fbrem_eg->Sumw2();
1407  h_ele_fbremVsEta_mode = new TProfile("h_ele_fbremvsEtamode",
1408  "mean ele brem fraction vs eta, mode of GSF components",
1409  nbineta2D,
1410  etamin,
1411  etamax,
1412  0.,
1413  1.);
1414  h_ele_fbremVsEta_mean = new TProfile("h_ele_fbremvsEtamean",
1415  "mean ele brem fraction vs eta, mean of GSF components",
1416  nbineta2D,
1417  etamin,
1418  etamax,
1419  0.,
1420  1.);
1421 
1422  // e/g et pflow electrons
1423  h_ele_mva = new TH1F("h_ele_mva", "ele identification mva", 100, -1., 1.);
1424  h_ele_mva->Sumw2();
1425  h_ele_mva_eg = new TH1F("h_ele_mva_eg", "ele identification mva, ecal driven", 100, -1., 1.);
1426  h_ele_mva_eg->Sumw2();
1427  h_ele_provenance = new TH1F("h_ele_provenance", "ele provenance", 5, -2., 3.);
1428  h_ele_provenance->Sumw2();
1429 
1430  // histos titles
1431  h_mcNum->GetXaxis()->SetTitle("N_{gen}");
1432  h_mcNum->GetYaxis()->SetTitle("Events");
1433  h_eleNum->GetXaxis()->SetTitle("# gen ele");
1434  h_eleNum->GetYaxis()->SetTitle("Events");
1435  h_gamNum->GetXaxis()->SetTitle("N_{gen #gamma}");
1436  h_gamNum->GetYaxis()->SetTitle("Events");
1437  h_simEta->GetXaxis()->SetTitle("#eta");
1438  h_simEta->GetYaxis()->SetTitle("Events");
1439  h_simP->GetXaxis()->SetTitle("p (GeV/c)");
1440  h_simP->GetYaxis()->SetTitle("Events");
1441  h_ele_foundHits->GetXaxis()->SetTitle("N_{hits}");
1442  h_ele_foundHits->GetYaxis()->SetTitle("Events");
1443  h_ele_foundHits_barrel->GetXaxis()->SetTitle("N_{hits}");
1444  h_ele_foundHits_barrel->GetYaxis()->SetTitle("Events");
1445  h_ele_foundHits_endcaps->GetXaxis()->SetTitle("N_{hits}");
1446  h_ele_foundHits_endcaps->GetYaxis()->SetTitle("Events");
1447  h_ele_ambiguousTracks->GetXaxis()->SetTitle("N_{ambiguous tracks}");
1448  h_ele_ambiguousTracks->GetYaxis()->SetTitle("Events");
1449  h_ele_lostHits->GetXaxis()->SetTitle("N_{lost hits}");
1450  h_ele_lostHits->GetYaxis()->SetTitle("Events");
1451  h_ele_lostHits_barrel->GetXaxis()->SetTitle("N_{lost hits}");
1452  h_ele_lostHits_barrel->GetYaxis()->SetTitle("Events");
1453  h_ele_lostHits_endcaps->GetXaxis()->SetTitle("N_{lost hits}");
1454  h_ele_lostHits_endcaps->GetYaxis()->SetTitle("Events");
1455  h_ele_chi2->GetXaxis()->SetTitle("#Chi^{2}");
1456  h_ele_chi2->GetYaxis()->SetTitle("Events");
1457  h_ele_chi2_barrel->GetXaxis()->SetTitle("#Chi^{2}");
1458  h_ele_chi2_barrel->GetYaxis()->SetTitle("Events");
1459  h_ele_chi2_endcaps->GetXaxis()->SetTitle("#Chi^{2}");
1460  h_ele_chi2_endcaps->GetYaxis()->SetTitle("Events");
1461  h_ele_charge->GetXaxis()->SetTitle("charge");
1462  h_ele_charge->GetYaxis()->SetTitle("Events");
1463  h_ele_vertexP->GetXaxis()->SetTitle("p_{vertex} (GeV/c)");
1464  h_ele_vertexP->GetYaxis()->SetTitle("Events");
1465  h_ele_vertexPt->GetXaxis()->SetTitle("p_{T vertex} (GeV/c)");
1466  h_ele_vertexPt->GetYaxis()->SetTitle("Events");
1467  h_ele_Et->GetXaxis()->SetTitle("E_{T} (GeV)");
1468  h_ele_Et->GetYaxis()->SetTitle("Events");
1469  h_ele_Et_all->GetXaxis()->SetTitle("E_{T} (GeV)");
1470  h_ele_Et_all->GetYaxis()->SetTitle("Events");
1471  h_ele_vertexEta->GetXaxis()->SetTitle("#eta");
1472  h_ele_vertexEta->GetYaxis()->SetTitle("Events");
1473  h_ele_vertexPhi->GetXaxis()->SetTitle("#phi (rad)");
1474  h_ele_vertexPhi->GetYaxis()->SetTitle("Events");
1475  h_ele_PoPtrue->GetXaxis()->SetTitle("P/P_{gen}");
1476  h_ele_PoPtrue->GetYaxis()->SetTitle("Events");
1477  h_ele_PoPtrue_barrel->GetXaxis()->SetTitle("P/P_{gen}");
1478  h_ele_PoPtrue_barrel->GetYaxis()->SetTitle("Events");
1479  h_ele_PoPtrue_endcaps->GetXaxis()->SetTitle("P/P_{gen}");
1480  h_ele_PoPtrue_endcaps->GetYaxis()->SetTitle("Events");
1481  h_ele_PoPtrue_golden_barrel->GetXaxis()->SetTitle("P/P_{gen}");
1482  h_ele_PoPtrue_golden_barrel->GetYaxis()->SetTitle("Events");
1483  h_ele_PoPtrue_showering_barrel->GetXaxis()->SetTitle("P/P_{gen}");
1484  h_ele_PoPtrue_showering_barrel->GetYaxis()->SetTitle("Events");
1485  h_ele_PoPtrue_golden_endcaps->GetXaxis()->SetTitle("P/P_{gen}");
1486  h_ele_PoPtrue_golden_endcaps->GetYaxis()->SetTitle("Events");
1487  h_ele_PoPtrue_showering_endcaps->GetXaxis()->SetTitle("P/P_{gen}");
1488  h_ele_PoPtrue_showering_endcaps->GetYaxis()->SetTitle("Events");
1489  h_ele_PtoPttrue->GetXaxis()->SetTitle("P_{T}/P_{T}^{gen}");
1490  h_ele_PtoPttrue->GetYaxis()->SetTitle("Events");
1491  h_ele_PtoPttrue_barrel->GetXaxis()->SetTitle("P_{T}/P_{T}^{gen}");
1492  h_ele_PtoPttrue_barrel->GetYaxis()->SetTitle("Events");
1493  h_ele_PtoPttrue_endcaps->GetXaxis()->SetTitle("P_{T}/P_{T}^{gen}");
1494  h_ele_PtoPttrue_endcaps->GetYaxis()->SetTitle("Events");
1495  histSclEoEtrue_barrel->GetXaxis()->SetTitle("E/E_{gen}");
1496  histSclEoEtrue_barrel->GetYaxis()->SetTitle("Events");
1497  histSclEoEtrue_endcaps->GetXaxis()->SetTitle("E/E_{gen}");
1498  histSclEoEtrue_endcaps->GetYaxis()->SetTitle("Events");
1499  histSclEoEtrueGolden_barrel->GetXaxis()->SetTitle("E/E_{gen}");
1500  histSclEoEtrueGolden_barrel->GetYaxis()->SetTitle("Events");
1501  histSclEoEtrueShowering_barrel->GetXaxis()->SetTitle("E/E_{gen}");
1502  histSclEoEtrueShowering_barrel->GetYaxis()->SetTitle("Events");
1503  histSclEoEtrueGolden_endcaps->GetXaxis()->SetTitle("E/E_{gen}");
1504  histSclEoEtrueGolden_endcaps->GetYaxis()->SetTitle("Events");
1505  histSclEoEtrueShowering_endcaps->GetXaxis()->SetTitle("E/E_{gen}");
1506  histSclEoEtrueShowering_endcaps->GetYaxis()->SetTitle("Events");
1507  histSclEoEtrue_barrel_etagap->GetXaxis()->SetTitle("E/E_{gen}");
1508  histSclEoEtrue_barrel_etagap->GetYaxis()->SetTitle("Events");
1509  histSclEoEtrue_barrel_phigap->GetXaxis()->SetTitle("E/E_{gen}");
1510  histSclEoEtrue_barrel_phigap->GetYaxis()->SetTitle("Events");
1511  histSclEoEtrue_ebeegap->GetXaxis()->SetTitle("E/E_{gen}");
1512  histSclEoEtrue_ebeegap->GetYaxis()->SetTitle("Events");
1513  histSclEoEtrue_endcaps_deegap->GetXaxis()->SetTitle("E/E_{gen}");
1514  histSclEoEtrue_endcaps_deegap->GetYaxis()->SetTitle("Events");
1515  histSclEoEtrue_endcaps_ringgap->GetXaxis()->SetTitle("E/E_{gen}");
1516  histSclEoEtrue_endcaps_ringgap->GetYaxis()->SetTitle("Events");
1517  histSclEoEtrue_barrel_new->GetXaxis()->SetTitle("E/E_{gen}");
1518  histSclEoEtrue_barrel_new->GetYaxis()->SetTitle("Events");
1519  histSclEoEtrue_endcaps_new->GetXaxis()->SetTitle("E/E_{gen}");
1520  histSclEoEtrue_endcaps_new->GetYaxis()->SetTitle("Events");
1521  histSclEoEtrue_barrel_etagap_new->GetXaxis()->SetTitle("E/E_{gen}");
1522  histSclEoEtrue_barrel_etagap_new->GetYaxis()->SetTitle("Events");
1523  histSclEoEtrue_barrel_phigap_new->GetXaxis()->SetTitle("E/E_{gen}");
1524  histSclEoEtrue_barrel_phigap_new->GetYaxis()->SetTitle("Events");
1525  histSclEoEtrue_ebeegap_new->GetXaxis()->SetTitle("E/E_{gen}");
1526  histSclEoEtrue_ebeegap_new->GetYaxis()->SetTitle("Events");
1527  histSclEoEtrue_endcaps_deegap_new->GetXaxis()->SetTitle("E/E_{gen}");
1528  histSclEoEtrue_endcaps_deegap_new->GetYaxis()->SetTitle("Events");
1529  histSclEoEtrue_endcaps_ringgap_new->GetXaxis()->SetTitle("E/E_{gen}");
1530  histSclEoEtrue_endcaps_ringgap_new->GetYaxis()->SetTitle("Events");
1531  histSclSigEtaEta_->GetXaxis()->SetTitle("#sigma_{#eta #eta}");
1532  histSclSigEtaEta_->GetYaxis()->SetTitle("Events");
1533  histSclSigEtaEta_barrel_->GetXaxis()->SetTitle("#sigma_{#eta #eta}");
1534  histSclSigEtaEta_barrel_->GetYaxis()->SetTitle("Events");
1535  histSclSigEtaEta_endcaps_->GetXaxis()->SetTitle("#sigma_{#eta #eta}");
1536  histSclSigEtaEta_endcaps_->GetYaxis()->SetTitle("Events");
1537  histSclSigIEtaIEta_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1538  histSclSigIEtaIEta_->GetYaxis()->SetTitle("Events");
1539  histSclSigIEtaIEta_barrel_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1540  histSclSigIEtaIEta_barrel_->GetYaxis()->SetTitle("Events");
1541  histSclSigIEtaIEta_endcaps_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1542  histSclSigIEtaIEta_endcaps_->GetYaxis()->SetTitle("Events");
1543  histSclE1x5_->GetXaxis()->SetTitle("E1x5 (GeV)");
1544  histSclE1x5_->GetYaxis()->SetTitle("Events");
1545  histSclE1x5_barrel_->GetXaxis()->SetTitle("E1x5 (GeV)");
1546  histSclE1x5_barrel_->GetYaxis()->SetTitle("Events");
1547  histSclE1x5_endcaps_->GetXaxis()->SetTitle("E1x5 (GeV)");
1548  histSclE1x5_endcaps_->GetYaxis()->SetTitle("Events");
1549  histSclE2x5max_->GetXaxis()->SetTitle("E2x5 (GeV)");
1550  histSclE2x5max_->GetYaxis()->SetTitle("Events");
1551  histSclE2x5max_barrel_->GetXaxis()->SetTitle("E2x5 (GeV)");
1552  histSclE2x5max_barrel_->GetYaxis()->SetTitle("Events");
1553  histSclE2x5max_endcaps_->GetXaxis()->SetTitle("E2x5 (GeV)");
1554  histSclE2x5max_endcaps_->GetYaxis()->SetTitle("Events");
1555  histSclE5x5_->GetXaxis()->SetTitle("E5x5 (GeV)");
1556  histSclE5x5_->GetYaxis()->SetTitle("Events");
1557  histSclE5x5_barrel_->GetXaxis()->SetTitle("E5x5 (GeV)");
1558  histSclE5x5_barrel_->GetYaxis()->SetTitle("Events");
1559  histSclE5x5_endcaps_->GetXaxis()->SetTitle("E5x5 (GeV)");
1560  histSclE5x5_endcaps_->GetYaxis()->SetTitle("Events");
1561  histSclEoEtruePfVsEg->GetXaxis()->SetTitle("E/E_{gen} (e/g)");
1562  histSclEoEtruePfVsEg->GetYaxis()->SetTitle("E/E_{gen} (pflow)");
1563  h_ele_ChargeMnChargeTrue->GetXaxis()->SetTitle("q_{rec} - q_{gen}");
1564  h_ele_ChargeMnChargeTrue->GetYaxis()->SetTitle("Events");
1565  h_ele_EtaMnEtaTrue->GetXaxis()->SetTitle("#eta_{rec} - #eta_{gen}");
1566  h_ele_EtaMnEtaTrue->GetYaxis()->SetTitle("Events");
1567  h_ele_EtaMnEtaTrue_barrel->GetXaxis()->SetTitle("#eta_{rec} - #eta_{gen}");
1568  h_ele_EtaMnEtaTrue_barrel->GetYaxis()->SetTitle("Events");
1569  h_ele_EtaMnEtaTrue_endcaps->GetXaxis()->SetTitle("#eta_{rec} - #eta_{gen}");
1570  h_ele_EtaMnEtaTrue_endcaps->GetYaxis()->SetTitle("Events");
1571  h_ele_PhiMnPhiTrue->GetXaxis()->SetTitle("#phi_{rec} - #phi_{gen} (rad)");
1572  h_ele_PhiMnPhiTrue->GetYaxis()->SetTitle("Events");
1573  h_ele_PhiMnPhiTrue_barrel->GetXaxis()->SetTitle("#phi_{rec} - #phi_{gen} (rad)");
1574  h_ele_PhiMnPhiTrue_barrel->GetYaxis()->SetTitle("Events");
1575  h_ele_PhiMnPhiTrue_endcaps->GetXaxis()->SetTitle("#phi_{rec} - #phi_{gen} (rad)");
1576  h_ele_PhiMnPhiTrue_endcaps->GetYaxis()->SetTitle("Events");
1577  h_ele_PinMnPout->GetXaxis()->SetTitle("P_{vertex} - P_{out} (GeV/c)");
1578  h_ele_PinMnPout->GetYaxis()->SetTitle("Events");
1579  h_ele_PinMnPout_mode->GetXaxis()->SetTitle("P_{vertex} - P_{out}, mode of GSF components (GeV/c)");
1580  h_ele_PinMnPout_mode->GetYaxis()->SetTitle("Events");
1581  h_ele_outerP->GetXaxis()->SetTitle("P_{out} (GeV/c)");
1582  h_ele_outerP->GetYaxis()->SetTitle("Events");
1583  h_ele_outerP_mode->GetXaxis()->SetTitle("P_{out} (GeV/c)");
1584  h_ele_outerP_mode->GetYaxis()->SetTitle("Events");
1585  h_ele_outerPt->GetXaxis()->SetTitle("P_{T out} (GeV/c)");
1586  h_ele_outerPt->GetYaxis()->SetTitle("Events");
1587  h_ele_outerPt_mode->GetXaxis()->SetTitle("P_{T out} (GeV/c)");
1588  h_ele_outerPt_mode->GetYaxis()->SetTitle("Events");
1589  h_ele_EoP->GetXaxis()->SetTitle("E/P_{vertex}");
1590  h_ele_EoP->GetYaxis()->SetTitle("Events");
1591  h_ele_EseedOP->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1592  h_ele_EseedOP->GetYaxis()->SetTitle("Events");
1593  h_ele_EoPout->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1594  h_ele_EoPout->GetYaxis()->SetTitle("Events");
1595  h_ele_EeleOPout->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1596  h_ele_EeleOPout->GetYaxis()->SetTitle("Events");
1597  h_ele_EoP_barrel->GetXaxis()->SetTitle("E/P_{vertex}");
1598  h_ele_EoP_barrel->GetYaxis()->SetTitle("Events");
1599  h_ele_EseedOP_barrel->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1600  h_ele_EseedOP_barrel->GetYaxis()->SetTitle("Events");
1601  h_ele_EoPout_barrel->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1602  h_ele_EoPout_barrel->GetYaxis()->SetTitle("Events");
1603  h_ele_EeleOPout_barrel->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1604  h_ele_EeleOPout_barrel->GetYaxis()->SetTitle("Events");
1605  h_ele_EoP_endcaps->GetXaxis()->SetTitle("E/P_{vertex}");
1606  h_ele_EoP_endcaps->GetYaxis()->SetTitle("Events");
1607  h_ele_EseedOP_endcaps->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1608  h_ele_EseedOP_endcaps->GetYaxis()->SetTitle("Events");
1609  h_ele_EoPout_endcaps->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1610  h_ele_EoPout_endcaps->GetYaxis()->SetTitle("Events");
1611  h_ele_EeleOPout_endcaps->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1612  h_ele_EeleOPout_endcaps->GetYaxis()->SetTitle("Events");
1613  h_ele_vertexX->GetXaxis()->SetTitle("x (cm)");
1614  h_ele_vertexX->GetYaxis()->SetTitle("Events");
1615  h_ele_vertexY->GetXaxis()->SetTitle("y (cm)");
1616  h_ele_vertexY->GetYaxis()->SetTitle("Events");
1617  h_ele_vertexZ->GetXaxis()->SetTitle("z (cm)");
1618  h_ele_vertexZ->GetYaxis()->SetTitle("Events");
1619  h_ele_vertexTIP->GetXaxis()->SetTitle("TIP (cm)");
1620  h_ele_vertexTIP->GetYaxis()->SetTitle("Events");
1621  h_ele_TIP_all->GetXaxis()->SetTitle("r_{T} (cm)");
1622  h_ele_TIP_all->GetYaxis()->SetTitle("Events");
1623  h_ele_vertexTIPVsEta->GetYaxis()->SetTitle("TIP (cm)");
1624  h_ele_vertexTIPVsEta->GetXaxis()->SetTitle("#eta");
1625  h_ele_vertexTIPVsPhi->GetYaxis()->SetTitle("TIP (cm)");
1626  h_ele_vertexTIPVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1627  h_ele_vertexTIPVsPt->GetYaxis()->SetTitle("TIP (cm)");
1628  h_ele_vertexTIPVsPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1629  h_ele_dEtaSc_propVtx->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1630  h_ele_dEtaSc_propVtx->GetYaxis()->SetTitle("Events");
1631  h_ele_dEtaCl_propOut->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
1632  h_ele_dEtaCl_propOut->GetYaxis()->SetTitle("Events");
1633  h_ele_dEtaEleCl_propOut->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
1634  h_ele_dEtaEleCl_propOut->GetYaxis()->SetTitle("Events");
1635  h_ele_dPhiSc_propVtx->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1636  h_ele_dPhiSc_propVtx->GetYaxis()->SetTitle("Events");
1637  h_ele_dPhiCl_propOut->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
1638  h_ele_dPhiCl_propOut->GetYaxis()->SetTitle("Events");
1639  h_ele_dPhiEleCl_propOut->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
1640  h_ele_dPhiEleCl_propOut->GetYaxis()->SetTitle("Events");
1641  h_ele_dEtaSc_propVtx_barrel->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1642  h_ele_dEtaSc_propVtx_barrel->GetYaxis()->SetTitle("Events");
1643  h_ele_dEtaCl_propOut_barrel->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
1644  h_ele_dEtaCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1645  h_ele_dEtaEleCl_propOut_barrel->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
1646  h_ele_dEtaEleCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1647  h_ele_dPhiSc_propVtx_barrel->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1648  h_ele_dPhiSc_propVtx_barrel->GetYaxis()->SetTitle("Events");
1649  h_ele_dPhiCl_propOut_barrel->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
1650  h_ele_dPhiCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1651  h_ele_dPhiEleCl_propOut_barrel->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
1652  h_ele_dPhiEleCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1653  h_ele_dEtaSc_propVtx_endcaps->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1654  h_ele_dEtaSc_propVtx_endcaps->GetYaxis()->SetTitle("Events");
1655  h_ele_dEtaCl_propOut_endcaps->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
1656  h_ele_dEtaCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1657  h_ele_dEtaEleCl_propOut_endcaps->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
1658  h_ele_dEtaEleCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1659  h_ele_dPhiSc_propVtx_endcaps->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1660  h_ele_dPhiSc_propVtx_endcaps->GetYaxis()->SetTitle("Events");
1661  h_ele_dPhiCl_propOut_endcaps->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
1662  h_ele_dPhiCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1663  h_ele_dPhiEleCl_propOut_endcaps->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
1664  h_ele_dPhiEleCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1665  h_ele_HoE->GetXaxis()->SetTitle("H/E");
1666  h_ele_HoE->GetYaxis()->SetTitle("Events");
1667  h_ele_HoE_barrel->GetXaxis()->SetTitle("H/E");
1668  h_ele_HoE_barrel->GetYaxis()->SetTitle("Events");
1669  h_ele_HoE_endcaps->GetXaxis()->SetTitle("H/E");
1670  h_ele_HoE_endcaps->GetYaxis()->SetTitle("Events");
1671  h_ele_HoE_fiducial->GetXaxis()->SetTitle("H/E");
1672  h_ele_HoE_fiducial->GetYaxis()->SetTitle("Events");
1673  h_ele_fbrem->GetXaxis()->SetTitle("P_{in} - P_{out} / P_{in}");
1674  h_ele_fbrem->GetYaxis()->SetTitle("Events");
1675  h_ele_seed_dphi2_->GetXaxis()->SetTitle("#phi_{hit}-#phi_{pred} (rad)");
1676  h_ele_seed_dphi2_->GetYaxis()->SetTitle("Events");
1677  h_ele_seed_drz2_->GetXaxis()->SetTitle("r(z)_{hit}-r(z)_{pred} (cm)");
1678  h_ele_seed_drz2_->GetYaxis()->SetTitle("Events");
1679  h_ele_seed_subdet2_->GetXaxis()->SetTitle("2nd hit subdet Id");
1680  h_ele_seed_subdet2_->GetYaxis()->SetTitle("Events");
1681  h_ele_classes->GetXaxis()->SetTitle("class Id");
1682  h_ele_classes->GetYaxis()->SetTitle("Events");
1683  h_ele_EoverP_all->GetXaxis()->SetTitle("E/P_{vertex}");
1684  h_ele_EoverP_all->GetYaxis()->SetTitle("Events");
1685  h_ele_EseedOP_all->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1686  h_ele_EseedOP_all->GetYaxis()->SetTitle("Events");
1687  h_ele_EoPout_all->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1688  h_ele_EoPout_all->GetYaxis()->SetTitle("Events");
1689  h_ele_EeleOPout_all->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1690  h_ele_EeleOPout_all->GetYaxis()->SetTitle("Events");
1691  h_ele_dEtaSc_propVtx_all->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1692  h_ele_dEtaSc_propVtx_all->GetYaxis()->SetTitle("Events");
1693  h_ele_dPhiSc_propVtx_all->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1694  h_ele_dPhiSc_propVtx_all->GetYaxis()->SetTitle("Events");
1695  h_ele_dEtaCl_propOut_all->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1696  h_ele_dEtaCl_propOut_all->GetYaxis()->SetTitle("Events");
1697  h_ele_dPhiCl_propOut_all->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1698  h_ele_dPhiCl_propOut_all->GetYaxis()->SetTitle("Events");
1699  h_ele_HoE_all->GetXaxis()->SetTitle("H/E");
1700  h_ele_HoE_all->GetYaxis()->SetTitle("Events");
1701  h_ele_mee_all->GetXaxis()->SetTitle("m_{ee} (GeV/c^{2})");
1702  h_ele_mee_all->GetYaxis()->SetTitle("Events");
1703  h_ele_mee_os->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1704  h_ele_mee_os->GetYaxis()->SetTitle("Events");
1705  h_ele_mee_os_ebeb->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1706  h_ele_mee_os_ebeb->GetYaxis()->SetTitle("Events");
1707  h_ele_mee_os_ebee->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1708  h_ele_mee_os_ebee->GetYaxis()->SetTitle("Events");
1709  h_ele_mee_os_eeee->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1710  h_ele_mee_os_eeee->GetYaxis()->SetTitle("Events");
1711  h_ele_mee_os_gg->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1712  h_ele_mee_os_gg->GetYaxis()->SetTitle("Events");
1713  h_ele_mee_os_gb->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1714  h_ele_mee_os_gb->GetYaxis()->SetTitle("Events");
1715  h_ele_mee_os_bb->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1716  h_ele_mee_os_bb->GetYaxis()->SetTitle("Events");
1717  h_ele_E2mnE1vsMee_all->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1718  h_ele_E2mnE1vsMee_all->GetYaxis()->SetTitle("E2 - E1 (GeV)");
1719  h_ele_E2mnE1vsMee_egeg_all->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1720  h_ele_E2mnE1vsMee_egeg_all->GetYaxis()->SetTitle("E2 - E1 (GeV)");
1721  histNum_->GetXaxis()->SetTitle("N_{ele}");
1722  histNum_->GetYaxis()->SetTitle("Events");
1723  h_ele_fbremVsEta_mode->GetXaxis()->SetTitle("#eta");
1724  h_ele_fbremVsEta_mean->GetXaxis()->SetTitle("#eta");
1725 }
1726 
1728  histfile_->cd();
1729 
1730  std::cout << "[GsfElectronMCAnalyzer] efficiency calculation " << std::endl;
1731  // efficiency vs eta
1732  TH1F *h_ele_etaEff = (TH1F *)h_ele_simEta_matched->Clone("h_ele_etaEff");
1733  h_ele_etaEff->Reset();
1734  h_ele_etaEff->Divide(h_ele_simEta_matched, h_simEta, 1, 1, "b");
1735  h_ele_etaEff->Print();
1736  h_ele_etaEff->GetXaxis()->SetTitle("#eta");
1737  h_ele_etaEff->GetYaxis()->SetTitle("Efficiency");
1738 
1739  // efficiency vs z
1740  TH1F *h_ele_zEff = (TH1F *)h_ele_simZ_matched->Clone("h_ele_zEff");
1741  h_ele_zEff->Reset();
1742  h_ele_zEff->Divide(h_ele_simZ_matched, h_simZ, 1, 1, "b");
1743  h_ele_zEff->Print();
1744  h_ele_zEff->GetXaxis()->SetTitle("z (cm)");
1745  h_ele_zEff->GetYaxis()->SetTitle("Efficiency");
1746 
1747  // efficiency vs |eta|
1748  TH1F *h_ele_absetaEff = (TH1F *)h_ele_simAbsEta_matched->Clone("h_ele_absetaEff");
1749  h_ele_absetaEff->Reset();
1750  h_ele_absetaEff->Divide(h_ele_simAbsEta_matched, h_simAbsEta, 1, 1, "b");
1751  h_ele_absetaEff->GetXaxis()->SetTitle("|#eta|");
1752  h_ele_absetaEff->GetYaxis()->SetTitle("Efficiency");
1753 
1754  // efficiency vs pt
1755  TH1F *h_ele_ptEff = (TH1F *)h_ele_simPt_matched->Clone("h_ele_ptEff");
1756  h_ele_ptEff->Reset();
1757  h_ele_ptEff->Divide(h_ele_simPt_matched, h_simPt, 1, 1, "b");
1758  h_ele_ptEff->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1759  h_ele_ptEff->GetYaxis()->SetTitle("Efficiency");
1760 
1761  // efficiency vs phi
1762  TH1F *h_ele_phiEff = (TH1F *)h_ele_simPhi_matched->Clone("h_ele_phiEff");
1763  h_ele_phiEff->Reset();
1764  h_ele_phiEff->Divide(h_ele_simPhi_matched, h_simPhi, 1, 1, "b");
1765  h_ele_phiEff->GetXaxis()->SetTitle("#phi (rad)");
1766  h_ele_phiEff->GetYaxis()->SetTitle("Efficiency");
1767 
1768  // efficiency vs pt eta
1769  TH2F *h_ele_ptEtaEff = (TH2F *)h_ele_simPtEta_matched->Clone("h_ele_ptEtaEff");
1770  h_ele_ptEtaEff->Reset();
1771  h_ele_ptEtaEff->Divide(h_ele_simPtEta_matched, h_simPtEta, 1, 1, "b");
1772  h_ele_ptEtaEff->GetYaxis()->SetTitle("p_{T} (GeV/c)");
1773  h_ele_ptEtaEff->GetXaxis()->SetTitle("#eta");
1774 
1775  std::cout << "[GsfElectronMCAnalyzer] q-misid calculation " << std::endl;
1776  // misid vs eta
1777  TH1F *h_ele_etaQmisid = (TH1F *)h_ele_simEta_matched_qmisid->Clone("h_ele_etaQmisid");
1778  h_ele_etaQmisid->Reset();
1779  h_ele_etaQmisid->Divide(h_ele_simEta_matched_qmisid, h_simEta, 1, 1, "b");
1780  h_ele_etaQmisid->Print();
1781  h_ele_etaQmisid->GetXaxis()->SetTitle("#eta");
1782  h_ele_etaQmisid->GetYaxis()->SetTitle("q misId");
1783 
1784  // misid vs z
1785  TH1F *h_ele_zQmisid = (TH1F *)h_ele_simZ_matched_qmisid->Clone("h_ele_zQmisid");
1786  h_ele_zQmisid->Reset();
1787  h_ele_zQmisid->Divide(h_ele_simZ_matched_qmisid, h_simZ, 1, 1, "b");
1788  h_ele_zQmisid->Print();
1789  h_ele_zQmisid->GetXaxis()->SetTitle("z (cm)");
1790  h_ele_zQmisid->GetYaxis()->SetTitle("q misId");
1791 
1792  // misid vs |eta|
1793  TH1F *h_ele_absetaQmisid = (TH1F *)h_ele_simAbsEta_matched_qmisid->Clone("h_ele_absetaQmisid");
1794  h_ele_absetaQmisid->Reset();
1795  h_ele_absetaQmisid->Divide(h_ele_simAbsEta_matched_qmisid, h_simAbsEta, 1, 1, "b");
1796  h_ele_absetaQmisid->GetXaxis()->SetTitle("|#eta|");
1797  h_ele_absetaQmisid->GetYaxis()->SetTitle("q misId");
1798 
1799  // misid vs pt
1800  TH1F *h_ele_ptQmisid = (TH1F *)h_ele_simPt_matched_qmisid->Clone("h_ele_ptQmisid");
1801  h_ele_ptQmisid->Reset();
1802  h_ele_ptQmisid->Divide(h_ele_simPt_matched_qmisid, h_simPt, 1, 1, "b");
1803  h_ele_ptQmisid->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1804  h_ele_ptQmisid->GetYaxis()->SetTitle("q misId");
1805 
1806  std::cout << "[GsfElectronMCAnalyzer] all reco electrons " << std::endl;
1807  // rec/gen all electrons
1808  TH1F *h_ele_etaEff_all = (TH1F *)h_ele_vertexEta_all->Clone("h_ele_etaEff_all");
1809  h_ele_etaEff_all->Reset();
1810  h_ele_etaEff_all->Divide(h_ele_vertexEta_all, h_simEta, 1, 1, "b");
1811  h_ele_etaEff_all->Print();
1812  h_ele_etaEff_all->GetXaxis()->SetTitle("#eta");
1813  h_ele_etaEff_all->GetYaxis()->SetTitle("N_{rec}/N_{gen}");
1814  TH1F *h_ele_ptEff_all = (TH1F *)h_ele_vertexPt_all->Clone("h_ele_ptEff_all");
1815  h_ele_ptEff_all->Reset();
1816  h_ele_ptEff_all->Divide(h_ele_vertexPt_all, h_simPt, 1, 1, "b");
1817  h_ele_ptEff_all->Print();
1818  h_ele_ptEff_all->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1819  h_ele_ptEff_all->GetYaxis()->SetTitle("N_{rec}/N_{gen}");
1820 
1821  // classes
1822  TH1F *h_ele_eta_goldenFrac = (TH1F *)h_ele_eta_golden->Clone("h_ele_eta_goldenFrac");
1823  h_ele_eta_goldenFrac->Reset();
1824  h_ele_eta_goldenFrac->Divide(h_ele_eta_golden, h_ele_eta, 1, 1, "b");
1825  h_ele_eta_goldenFrac->GetXaxis()->SetTitle("|#eta|");
1826  h_ele_eta_goldenFrac->GetYaxis()->SetTitle("Fraction of electrons");
1827  h_ele_eta_goldenFrac->SetTitle("fraction of golden electrons vs eta");
1828  TH1F *h_ele_eta_bbremFrac = (TH1F *)h_ele_eta_bbrem->Clone("h_ele_eta_bbremFrac");
1829  h_ele_eta_bbremFrac->Reset();
1830  h_ele_eta_bbremFrac->GetXaxis()->SetTitle("|#eta|");
1831  h_ele_eta_bbremFrac->GetYaxis()->SetTitle("Fraction of electrons");
1832  h_ele_eta_bbremFrac->Divide(h_ele_eta_bbrem, h_ele_eta, 1, 1, "b");
1833  h_ele_eta_bbremFrac->SetTitle("fraction of big brem electrons vs eta");
1834  TH1F *h_ele_eta_narrowFrac = (TH1F *)h_ele_eta_narrow->Clone("h_ele_eta_narrowFrac");
1835  h_ele_eta_narrowFrac->Reset();
1836  h_ele_eta_narrowFrac->Divide(h_ele_eta_narrow, h_ele_eta, 1, 1, "b");
1837  h_ele_eta_narrowFrac->GetXaxis()->SetTitle("|#eta|");
1838  h_ele_eta_narrowFrac->GetYaxis()->SetTitle("Fraction of electrons");
1839  h_ele_eta_narrowFrac->SetTitle("fraction of narrow electrons vs eta");
1840  TH1F *h_ele_eta_showerFrac = (TH1F *)h_ele_eta_shower->Clone("h_ele_eta_showerFrac");
1841  h_ele_eta_showerFrac->Reset();
1842  h_ele_eta_showerFrac->Divide(h_ele_eta_shower, h_ele_eta, 1, 1, "b");
1843  h_ele_eta_showerFrac->GetXaxis()->SetTitle("|#eta|");
1844  h_ele_eta_showerFrac->GetYaxis()->SetTitle("Fraction of electrons");
1845  h_ele_eta_showerFrac->SetTitle("fraction of showering electrons vs eta");
1846 
1847  // fbrem
1848  TH1F *h_ele_xOverX0VsEta = new TH1F("h_ele_xOverx0VsEta", "mean X/X_0 vs eta", nbineta / 2, 0.0, 2.5);
1849  for (int ibin = 1; ibin < h_ele_fbremVsEta_mean->GetNbinsX() + 1; ibin++) {
1850  double xOverX0 = 0.;
1851  if (h_ele_fbremVsEta_mean->GetBinContent(ibin) > 0.)
1852  xOverX0 = -log(h_ele_fbremVsEta_mean->GetBinContent(ibin));
1853  h_ele_xOverX0VsEta->SetBinContent(ibin, xOverX0);
1854  }
1855 
1856  //profiles from 2D histos
1857  TProfile *p_ele_PoPtrueVsEta = h_ele_PoPtrueVsEta->ProfileX();
1858  p_ele_PoPtrueVsEta->SetTitle("mean ele momentum / gen momentum vs eta");
1859  p_ele_PoPtrueVsEta->GetXaxis()->SetTitle("#eta");
1860  p_ele_PoPtrueVsEta->GetYaxis()->SetTitle("<P/P_{gen}>");
1861  p_ele_PoPtrueVsEta->Write();
1862  TProfile *p_ele_PoPtrueVsPhi = h_ele_PoPtrueVsPhi->ProfileX();
1863  p_ele_PoPtrueVsPhi->SetTitle("mean ele momentum / gen momentum vs phi");
1864  p_ele_PoPtrueVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1865  p_ele_PoPtrueVsPhi->GetYaxis()->SetTitle("<P/P_{gen}>");
1866  p_ele_PoPtrueVsPhi->Write();
1867  TProfile *p_ele_EoEtruePfVsEg_x = histSclEoEtruePfVsEg->ProfileX();
1868  p_ele_EoEtruePfVsEg_x->SetTitle("mean pflow sc energy / true energy vs e/g sc energy");
1869  p_ele_EoEtruePfVsEg_x->GetXaxis()->SetTitle("E/E_{gen} (e/g)");
1870  p_ele_EoEtruePfVsEg_x->GetYaxis()->SetTitle("<E/E_{gen}> (pflow)");
1871  p_ele_EoEtruePfVsEg_x->Write();
1872  TProfile *p_ele_EoEtruePfVsEg_y = histSclEoEtruePfVsEg->ProfileY();
1873  p_ele_EoEtruePfVsEg_y->SetTitle("mean e/g sc energy / true energy vs pflow sc energy");
1874  p_ele_EoEtruePfVsEg_y->GetXaxis()->SetTitle("E/E_{gen} (pflow)");
1875  p_ele_EoEtruePfVsEg_y->GetYaxis()->SetTitle("<E/E_{gen}> (eg)");
1876  p_ele_EoEtruePfVsEg_y->Write();
1877  TProfile *p_ele_EtaMnEtaTrueVsEta = h_ele_EtaMnEtaTrueVsEta->ProfileX();
1878  p_ele_EtaMnEtaTrueVsEta->SetTitle("mean ele eta - gen eta vs eta");
1879  p_ele_EtaMnEtaTrueVsEta->GetXaxis()->SetTitle("#eta");
1880  p_ele_EtaMnEtaTrueVsEta->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{gen}>");
1881  p_ele_EtaMnEtaTrueVsEta->Write();
1882  TProfile *p_ele_EtaMnEtaTrueVsPhi = h_ele_EtaMnEtaTrueVsPhi->ProfileX();
1883  p_ele_EtaMnEtaTrueVsPhi->SetTitle("mean ele eta - gen eta vs phi");
1884  p_ele_EtaMnEtaTrueVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1885  p_ele_EtaMnEtaTrueVsPhi->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{gen}>");
1886  p_ele_EtaMnEtaTrueVsPhi->Write();
1887  TProfile *p_ele_PhiMnPhiTrueVsEta = h_ele_PhiMnPhiTrueVsEta->ProfileX();
1888  p_ele_PhiMnPhiTrueVsEta->SetTitle("mean ele phi - gen phi vs eta");
1889  p_ele_PhiMnPhiTrueVsEta->GetXaxis()->SetTitle("#eta");
1890  p_ele_PhiMnPhiTrueVsEta->GetYaxis()->SetTitle("<#phi_{rec} - #phi_{gen}> (rad)");
1891  p_ele_PhiMnPhiTrueVsEta->Write();
1892  TProfile *p_ele_PhiMnPhiTrueVsPhi = h_ele_PhiMnPhiTrueVsPhi->ProfileX();
1893  p_ele_PhiMnPhiTrueVsPhi->SetTitle("mean ele phi - gen phi vs phi");
1894  p_ele_PhiMnPhiTrueVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1895  p_ele_PhiMnPhiTrueVsPhi->Write();
1896  TProfile *p_ele_vertexPtVsEta = h_ele_vertexPtVsEta->ProfileX();
1897  p_ele_vertexPtVsEta->SetTitle("mean ele transverse momentum vs eta");
1898  p_ele_vertexPtVsEta->GetXaxis()->SetTitle("#eta");
1899  p_ele_vertexPtVsEta->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
1900  p_ele_vertexPtVsEta->Write();
1901  TProfile *p_ele_vertexPtVsPhi = h_ele_vertexPtVsPhi->ProfileX();
1902  p_ele_vertexPtVsPhi->SetTitle("mean ele transverse momentum vs phi");
1903  p_ele_vertexPtVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1904  p_ele_vertexPtVsPhi->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
1905  p_ele_vertexPtVsPhi->Write();
1906  TProfile *p_ele_EoPVsEta = h_ele_EoPVsEta->ProfileX();
1907  p_ele_EoPVsEta->SetTitle("mean ele E/p vs eta");
1908  p_ele_EoPVsEta->GetXaxis()->SetTitle("#eta");
1909  p_ele_EoPVsEta->GetYaxis()->SetTitle("<E/P_{vertex}>");
1910  p_ele_EoPVsEta->Write();
1911  TProfile *p_ele_EoPVsPhi = h_ele_EoPVsPhi->ProfileX();
1912  p_ele_EoPVsPhi->SetTitle("mean ele E/p vs phi");
1913  p_ele_EoPVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1914  p_ele_EoPVsPhi->GetYaxis()->SetTitle("<E/P_{vertex}>");
1915  p_ele_EoPVsPhi->Write();
1916  TProfile *p_ele_EoPoutVsEta = h_ele_EoPoutVsEta->ProfileX();
1917  p_ele_EoPoutVsEta->SetTitle("mean ele E/pout vs eta");
1918  p_ele_EoPoutVsEta->GetXaxis()->SetTitle("#eta");
1919  p_ele_EoPoutVsEta->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
1920  p_ele_EoPoutVsEta->Write();
1921  TProfile *p_ele_EoPoutVsPhi = h_ele_EoPoutVsPhi->ProfileX();
1922  p_ele_EoPoutVsPhi->SetTitle("mean ele E/pout vs phi");
1923  p_ele_EoPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1924  p_ele_EoPoutVsPhi->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
1925  p_ele_EoPoutVsPhi->Write();
1926  TProfile *p_ele_EeleOPoutVsEta = h_ele_EeleOPoutVsEta->ProfileX();
1927  p_ele_EeleOPoutVsEta->SetTitle("mean ele Eele/pout vs eta");
1928  p_ele_EeleOPoutVsEta->GetXaxis()->SetTitle("#eta");
1929  p_ele_EeleOPoutVsEta->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
1930  p_ele_EeleOPoutVsEta->Write();
1931  TProfile *p_ele_EeleOPoutVsPhi = h_ele_EeleOPoutVsPhi->ProfileX();
1932  p_ele_EeleOPoutVsPhi->SetTitle("mean ele Eele/pout vs phi");
1933  p_ele_EeleOPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1934  p_ele_EeleOPoutVsPhi->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
1935  p_ele_EeleOPoutVsPhi->Write();
1936  TProfile *p_ele_HoEVsEta = h_ele_HoEVsEta->ProfileX();
1937  p_ele_HoEVsEta->SetTitle("mean ele H/E vs eta");
1938  p_ele_HoEVsEta->GetXaxis()->SetTitle("#eta");
1939  p_ele_HoEVsEta->GetYaxis()->SetTitle("<H/E>");
1940  p_ele_HoEVsEta->Write();
1941  TProfile *p_ele_HoEVsPhi = h_ele_HoEVsPhi->ProfileX();
1942  p_ele_HoEVsPhi->SetTitle("mean ele H/E vs phi");
1943  p_ele_HoEVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1944  p_ele_HoEVsPhi->GetYaxis()->SetTitle("<H/E>");
1945  p_ele_HoEVsPhi->Write();
1946  TProfile *p_ele_chi2VsEta = h_ele_chi2VsEta->ProfileX();
1947  p_ele_chi2VsEta->SetTitle("mean ele track chi2 vs eta");
1948  p_ele_chi2VsEta->GetXaxis()->SetTitle("#eta");
1949  p_ele_chi2VsEta->GetYaxis()->SetTitle("<#Chi^{2}>");
1950  p_ele_chi2VsEta->Write();
1951  TProfile *p_ele_chi2VsPhi = h_ele_chi2VsPhi->ProfileX();
1952  p_ele_chi2VsPhi->SetTitle("mean ele track chi2 vs phi");
1953  p_ele_chi2VsPhi->GetXaxis()->SetTitle("#phi (rad)");
1954  p_ele_chi2VsPhi->GetYaxis()->SetTitle("<#Chi^{2}>");
1955  p_ele_chi2VsPhi->Write();
1956  TProfile *p_ele_foundHitsVsEta = h_ele_foundHitsVsEta->ProfileX();
1957  p_ele_foundHitsVsEta->SetTitle("mean ele track # found hits vs eta");
1958  p_ele_foundHitsVsEta->GetXaxis()->SetTitle("#eta");
1959  p_ele_foundHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
1960  p_ele_foundHitsVsEta->Write();
1961  TProfile *p_ele_foundHitsVsPhi = h_ele_foundHitsVsPhi->ProfileX();
1962  p_ele_foundHitsVsPhi->SetTitle("mean ele track # found hits vs phi");
1963  p_ele_foundHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1964  p_ele_foundHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
1965  p_ele_foundHitsVsPhi->Write();
1966  TProfile *p_ele_lostHitsVsEta = h_ele_lostHitsVsEta->ProfileX();
1967  p_ele_lostHitsVsEta->SetTitle("mean ele track # lost hits vs eta");
1968  p_ele_lostHitsVsEta->GetXaxis()->SetTitle("#eta");
1969  p_ele_lostHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
1970  p_ele_lostHitsVsEta->Write();
1971  TProfile *p_ele_lostHitsVsPhi = h_ele_lostHitsVsPhi->ProfileX();
1972  p_ele_lostHitsVsPhi->SetTitle("mean ele track # lost hits vs phi");
1973  p_ele_lostHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1974  p_ele_lostHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
1975  p_ele_lostHitsVsPhi->Write();
1976  TProfile *p_ele_vertexTIPVsEta = h_ele_vertexTIPVsEta->ProfileX();
1977  p_ele_vertexTIPVsEta->SetTitle("mean tip (wrt gen vtx) vs eta");
1978  p_ele_vertexTIPVsEta->GetXaxis()->SetTitle("#eta");
1979  p_ele_vertexTIPVsEta->GetYaxis()->SetTitle("<TIP> (cm)");
1980  p_ele_vertexTIPVsEta->Write();
1981  TProfile *p_ele_vertexTIPVsPhi = h_ele_vertexTIPVsPhi->ProfileX();
1982  p_ele_vertexTIPVsPhi->SetTitle("mean tip (wrt gen vtx) vs phi");
1983  p_ele_vertexTIPVsPhi->GetXaxis()->SetTitle("#phi");
1984  p_ele_vertexTIPVsPhi->GetYaxis()->SetTitle("<TIP> (cm)");
1985  p_ele_vertexTIPVsPhi->Write();
1986  TProfile *p_ele_vertexTIPVsPt = h_ele_vertexTIPVsPt->ProfileX();
1987  p_ele_vertexTIPVsPt->SetTitle("mean tip (wrt gen vtx) vs phi");
1988  p_ele_vertexTIPVsPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1989  p_ele_vertexTIPVsPt->GetYaxis()->SetTitle("<TIP> (cm)");
1990  p_ele_vertexTIPVsPt->Write();
1991 
1992  // mc truth
1993  h_mcNum->Write();
1994  h_eleNum->Write();
1995  h_gamNum->Write();
1996 
1997  // rec event
1998  histNum_->Write();
1999 
2000  // mc
2001  h_simEta->Write();
2002  h_simAbsEta->Write();
2003  h_simP->Write();
2004  h_simPt->Write();
2005  h_simZ->Write();
2006  h_simPhi->Write();
2007  h_simPtEta->Write();
2008 
2009  // all electrons
2010  h_ele_EoverP_all->Write();
2011  h_ele_EseedOP_all->Write();
2012  h_ele_EoPout_all->Write();
2013  h_ele_EeleOPout_all->Write();
2014  h_ele_dEtaSc_propVtx_all->Write();
2015  h_ele_dPhiSc_propVtx_all->Write();
2016  h_ele_dEtaCl_propOut_all->Write();
2017  h_ele_dPhiCl_propOut_all->Write();
2018  h_ele_HoE_all->Write();
2019  h_ele_TIP_all->Write();
2020  h_ele_vertexPt_all->Write();
2021  h_ele_Et_all->Write();
2022  h_ele_vertexEta_all->Write();
2023  h_ele_mee_all->Write();
2024  h_ele_mee_os->Write();
2025  h_ele_mee_os_ebeb->Write();
2026  h_ele_mee_os_ebee->Write();
2027  h_ele_mee_os_eeee->Write();
2028  h_ele_mee_os_gg->Write();
2029  h_ele_mee_os_gb->Write();
2030  h_ele_mee_os_bb->Write();
2031  h_ele_E2mnE1vsMee_all->Write();
2032  h_ele_E2mnE1vsMee_egeg_all->Write();
2033 
2034  // charge ID
2035  h_ele_charge->Write();
2036  h_ele_simEta_matched_qmisid->Write();
2037  h_ele_simAbsEta_matched_qmisid->Write();
2038  h_ele_simPt_matched_qmisid->Write();
2039  h_ele_simPhi_matched_qmisid->Write();
2040  h_ele_simZ_matched_qmisid->Write();
2041 
2042  // matched electrons
2043  h_ele_vertexP->Write();
2044  h_ele_vertexPt->Write();
2045  h_ele_Et->Write();
2046  h_ele_vertexPtVsEta->Write();
2047  h_ele_vertexPtVsPhi->Write();
2048  h_ele_simPt_matched->Write();
2049  h_ele_vertexEta->Write();
2050  h_ele_vertexEtaVsPhi->Write();
2051  h_ele_simAbsEta_matched->Write();
2052  h_ele_simEta_matched->Write();
2053  h_ele_simPhi_matched->Write();
2054  h_ele_simPtEta_matched->Write();
2055  h_ele_vertexPhi->Write();
2056  h_ele_vertexX->Write();
2057  h_ele_vertexY->Write();
2058  h_ele_vertexZ->Write();
2059  h_ele_vertexTIP->Write();
2060  h_ele_simZ_matched->Write();
2061  h_ele_vertexTIPVsEta->Write();
2062  h_ele_vertexTIPVsPhi->Write();
2063  h_ele_vertexTIPVsPt->Write();
2064  h_ele_PoPtrue->Write();
2065  h_ele_PoPtrueVsEta->Write();
2066  h_ele_PoPtrueVsPhi->Write();
2067  h_ele_PoPtrueVsPt->Write();
2068  h_ele_PoPtrue_barrel->Write();
2069  h_ele_PoPtrue_endcaps->Write();
2070  h_ele_PoPtrue_golden_barrel->Write();
2071  h_ele_PoPtrue_golden_endcaps->Write();
2072  h_ele_PoPtrue_showering_barrel->Write();
2073  h_ele_PoPtrue_showering_endcaps->Write();
2074  h_ele_PtoPttrue->Write();
2075  h_ele_PtoPttrue_barrel->Write();
2076  h_ele_PtoPttrue_endcaps->Write();
2077  h_ele_ChargeMnChargeTrue->Write();
2078  h_ele_EtaMnEtaTrue->Write();
2079  h_ele_EtaMnEtaTrue_barrel->Write();
2080  h_ele_EtaMnEtaTrue_endcaps->Write();
2081  h_ele_EtaMnEtaTrueVsEta->Write();
2082  h_ele_EtaMnEtaTrueVsPhi->Write();
2083  h_ele_EtaMnEtaTrueVsPt->Write();
2084  h_ele_PhiMnPhiTrue->Write();
2085  h_ele_PhiMnPhiTrue_barrel->Write();
2086  h_ele_PhiMnPhiTrue_endcaps->Write();
2087  h_ele_PhiMnPhiTrue2->Write();
2088  h_ele_PhiMnPhiTrueVsEta->Write();
2089  h_ele_PhiMnPhiTrueVsPhi->Write();
2090  h_ele_PhiMnPhiTrueVsPt->Write();
2091 
2092  // matched electron, superclusters
2093  histSclEn_->Write();
2094  histSclEoEtrue_barrel->Write();
2095  histSclEoEtrue_endcaps->Write();
2096  histSclEoEtrue_barrel_eg->Write();
2097  histSclEoEtrue_endcaps_eg->Write();
2098  histSclEoEtrue_barrel_etagap->Write();
2099  histSclEoEtrue_barrel_phigap->Write();
2100  histSclEoEtrue_ebeegap->Write();
2101  histSclEoEtrue_endcaps->Write();
2102  histSclEoEtrue_endcaps_deegap->Write();
2103  histSclEoEtrue_endcaps_ringgap->Write();
2104  histSclEoEtruePfVsEg->Write();
2105  histSclEoEtrue_barrel_new->Write();
2106  histSclEoEtrue_endcaps_new->Write();
2107  histSclEoEtrue_barrel_eg_new->Write();
2108  histSclEoEtrue_endcaps_eg_new->Write();
2109  histSclEoEtrue_barrel_etagap_new->Write();
2110  histSclEoEtrue_barrel_phigap_new->Write();
2111  histSclEoEtrue_ebeegap_new->Write();
2112  histSclEoEtrue_endcaps_new->Write();
2113  histSclEoEtrue_endcaps_deegap_new->Write();
2114  histSclEoEtrue_endcaps_ringgap_new->Write();
2115  histSclEoEtruePfVsEg->Write();
2116  histSclEt_->Write();
2117  histSclEtVsEta_->Write();
2118  histSclEtVsPhi_->Write();
2119  histSclEtaVsPhi_->Write();
2120  histSclEta_->Write();
2121  histSclPhi_->Write();
2122  histSclSigEtaEta_->Write();
2123  histSclSigEtaEta_barrel_->Write();
2124  histSclSigEtaEta_endcaps_->Write();
2125  histSclSigIEtaIEta_->Write();
2126  histSclSigIEtaIEta_barrel_->Write();
2127  histSclSigIEtaIEta_endcaps_->Write();
2128  histSclE1x5_->Write();
2129  histSclE1x5_barrel_->Write();
2130  histSclE1x5_endcaps_->Write();
2131  histSclE2x5max_->Write();
2132  histSclE2x5max_barrel_->Write();
2133  histSclE2x5max_endcaps_->Write();
2134  histSclE5x5_->Write();
2135  histSclE5x5_barrel_->Write();
2136  histSclE5x5_endcaps_->Write();
2137  histSclSigEtaEta_eg_->Write();
2138  histSclSigEtaEta_eg_barrel_->Write();
2139  histSclSigEtaEta_eg_endcaps_->Write();
2140  histSclSigIEtaIEta_eg_->Write();
2141  histSclSigIEtaIEta_eg_barrel_->Write();
2142  histSclSigIEtaIEta_eg_endcaps_->Write();
2143  histSclE1x5_eg_->Write();
2144  histSclE1x5_eg_barrel_->Write();
2145  histSclE1x5_eg_endcaps_->Write();
2146  histSclE2x5max_eg_->Write();
2147  histSclE2x5max_eg_barrel_->Write();
2148  histSclE2x5max_eg_endcaps_->Write();
2149  histSclE5x5_eg_->Write();
2150  histSclE5x5_eg_barrel_->Write();
2151  histSclE5x5_eg_endcaps_->Write();
2152 
2153  // matched electron, gsf tracks
2154  h_ele_ambiguousTracks->Write();
2155  h_ele_ambiguousTracksVsEta->Write();
2156  h_ele_ambiguousTracksVsPhi->Write();
2157  h_ele_ambiguousTracksVsPt->Write();
2158  h_ele_foundHits->Write();
2159  h_ele_foundHits_barrel->Write();
2160  h_ele_foundHits_endcaps->Write();
2161  h_ele_foundHitsVsEta->Write();
2162  h_ele_foundHitsVsPhi->Write();
2163  h_ele_foundHitsVsPt->Write();
2164  h_ele_lostHits->Write();
2165  h_ele_lostHits_barrel->Write();
2166  h_ele_lostHits_endcaps->Write();
2167  h_ele_lostHitsVsEta->Write();
2168  h_ele_lostHitsVsPhi->Write();
2169  h_ele_lostHitsVsPt->Write();
2170  h_ele_chi2->Write();
2171  h_ele_chi2_barrel->Write();
2172  h_ele_chi2_endcaps->Write();
2173  h_ele_chi2VsEta->Write();
2174  h_ele_chi2VsPhi->Write();
2175  h_ele_chi2VsPt->Write();
2176  h_ele_PinMnPout->Write();
2177  h_ele_PinMnPout_mode->Write();
2178  h_ele_PinMnPoutVsEta_mode->Write();
2179  h_ele_PinMnPoutVsPhi_mode->Write();
2180  h_ele_PinMnPoutVsPt_mode->Write();
2181  h_ele_PinMnPoutVsE_mode->Write();
2182  h_ele_PinMnPoutVsChi2_mode->Write();
2183  h_ele_outerP->Write();
2184  h_ele_outerP_mode->Write();
2185  h_ele_outerPVsEta_mode->Write();
2186  h_ele_outerPt->Write();
2187  h_ele_outerPt_mode->Write();
2188  h_ele_outerPtVsEta_mode->Write();
2189  h_ele_outerPtVsPhi_mode->Write();
2190  h_ele_outerPtVsPt_mode->Write();
2191 
2192  // matched electrons, matching
2193  h_ele_EoP->Write();
2194  h_ele_EoP_eg->Write();
2195  h_ele_EoP_barrel->Write();
2196  h_ele_EoP_eg_barrel->Write();
2197  h_ele_EoP_endcaps->Write();
2198  h_ele_EoP_eg_endcaps->Write();
2199  h_ele_EoPVsEta->Write();
2200  h_ele_EoPVsPhi->Write();
2201  h_ele_EoPVsE->Write();
2202  h_ele_EseedOP->Write();
2203  h_ele_EseedOP_eg->Write();
2204  h_ele_EseedOP_barrel->Write();
2205  h_ele_EseedOP_eg_barrel->Write();
2206  h_ele_EseedOP_endcaps->Write();
2207  h_ele_EseedOP_eg_endcaps->Write();
2208  h_ele_EseedOPVsEta->Write();
2209  h_ele_EseedOPVsPhi->Write();
2210  h_ele_EseedOPVsE->Write();
2211  h_ele_EoPout->Write();
2212  h_ele_EoPout_eg->Write();
2213  h_ele_EoPout_barrel->Write();
2214  h_ele_EoPout_eg_barrel->Write();
2215  h_ele_EoPout_endcaps->Write();
2216  h_ele_EoPout_eg_endcaps->Write();
2217  h_ele_EoPoutVsEta->Write();
2218  h_ele_EoPoutVsPhi->Write();
2219  h_ele_EoPoutVsE->Write();
2220  h_ele_EeleOPout->Write();
2221  h_ele_EeleOPout_eg->Write();
2222  h_ele_EeleOPout_barrel->Write();
2223  h_ele_EeleOPout_eg_barrel->Write();
2224  h_ele_EeleOPout_endcaps->Write();
2225  h_ele_EeleOPout_eg_endcaps->Write();
2226  h_ele_EeleOPoutVsEta->Write();
2227  h_ele_EeleOPoutVsPhi->Write();
2228  h_ele_EeleOPoutVsE->Write();
2229  h_ele_dEtaSc_propVtx->Write();
2230  h_ele_dEtaSc_propVtx_eg->Write();
2231  h_ele_dEtaSc_propVtx_barrel->Write();
2232  h_ele_dEtaSc_propVtx_eg_barrel->Write();
2233  h_ele_dEtaSc_propVtx_endcaps->Write();
2234  h_ele_dEtaSc_propVtx_eg_endcaps->Write();
2235  h_ele_dEtaScVsEta_propVtx->Write();
2236  h_ele_dEtaScVsPhi_propVtx->Write();
2237  h_ele_dEtaScVsPt_propVtx->Write();
2238  h_ele_dPhiSc_propVtx->Write();
2239  h_ele_dPhiSc_propVtx_eg->Write();
2240  h_ele_dPhiSc_propVtx_barrel->Write();
2241  h_ele_dPhiSc_propVtx_eg_barrel->Write();
2242  h_ele_dPhiSc_propVtx_endcaps->Write();
2243  h_ele_dPhiSc_propVtx_eg_endcaps->Write();
2244  h_ele_dPhiScVsEta_propVtx->Write();
2245  h_ele_dPhiScVsPhi_propVtx->Write();
2246  h_ele_dPhiScVsPt_propVtx->Write();
2247  h_ele_dEtaCl_propOut->Write();
2248  h_ele_dEtaCl_propOut_eg->Write();
2249  h_ele_dEtaCl_propOut_barrel->Write();
2250  h_ele_dEtaCl_propOut_eg_barrel->Write();
2251  h_ele_dEtaCl_propOut_endcaps->Write();
2252  h_ele_dEtaCl_propOut_eg_endcaps->Write();
2253  h_ele_dEtaClVsEta_propOut->Write();
2254  h_ele_dEtaClVsPhi_propOut->Write();
2255  h_ele_dEtaClVsPt_propOut->Write();
2256  h_ele_dPhiCl_propOut->Write();
2257  h_ele_dPhiCl_propOut_eg->Write();
2258  h_ele_dPhiCl_propOut_barrel->Write();
2259  h_ele_dPhiCl_propOut_eg_barrel->Write();
2260  h_ele_dPhiCl_propOut_endcaps->Write();
2261  h_ele_dPhiCl_propOut_eg_endcaps->Write();
2262  h_ele_dPhiClVsEta_propOut->Write();
2263  h_ele_dPhiClVsPhi_propOut->Write();
2264  h_ele_dPhiClVsPt_propOut->Write();
2265  h_ele_dEtaEleCl_propOut->Write();
2266  h_ele_dEtaEleCl_propOut_eg->Write();
2267  h_ele_dEtaEleCl_propOut_barrel->Write();
2268  h_ele_dEtaEleCl_propOut_eg_barrel->Write();
2269  h_ele_dEtaEleCl_propOut_endcaps->Write();
2270  h_ele_dEtaEleCl_propOut_eg_endcaps->Write();
2271  h_ele_dEtaEleClVsEta_propOut->Write();
2272  h_ele_dEtaEleClVsPhi_propOut->Write();
2273  h_ele_dEtaEleClVsPt_propOut->Write();
2274  h_ele_dPhiEleCl_propOut->Write();
2275  h_ele_dPhiEleCl_propOut_eg->Write();
2276  h_ele_dPhiEleCl_propOut_barrel->Write();
2277  h_ele_dPhiEleCl_propOut_eg_barrel->Write();
2278  h_ele_dPhiEleCl_propOut_endcaps->Write();
2279  h_ele_dPhiEleCl_propOut_eg_endcaps->Write();
2280  h_ele_dPhiEleClVsEta_propOut->Write();
2281  h_ele_dPhiEleClVsPhi_propOut->Write();
2282  h_ele_dPhiEleClVsPt_propOut->Write();
2283  h_ele_HoE->Write();
2284  h_ele_HoE_eg->Write();
2285  h_ele_HoE_barrel->Write();
2286  h_ele_HoE_eg_barrel->Write();
2287  h_ele_HoE_endcaps->Write();
2288  h_ele_HoE_eg_endcaps->Write();
2289  h_ele_HoE_fiducial->Write();
2290  h_ele_HoEVsEta->Write();
2291  h_ele_HoEVsPhi->Write();
2292  h_ele_HoEVsE->Write();
2293 
2294  h_ele_seed_dphi2_->Write();
2295  h_ele_seed_subdet2_->Write();
2296  TProfile *p_ele_seed_dphi2VsEta_ = h_ele_seed_dphi2VsEta_->ProfileX();
2297  p_ele_seed_dphi2VsEta_->SetTitle("mean ele seed dphi 2nd layer vs eta");
2298  p_ele_seed_dphi2VsEta_->GetXaxis()->SetTitle("#eta");
2299  p_ele_seed_dphi2VsEta_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
2300  p_ele_seed_dphi2VsEta_->SetMinimum(-0.004);
2301  p_ele_seed_dphi2VsEta_->SetMaximum(0.004);
2302  p_ele_seed_dphi2VsEta_->Write();
2303  TProfile *p_ele_seed_dphi2VsPt_ = h_ele_seed_dphi2VsPt_->ProfileX();
2304  p_ele_seed_dphi2VsPt_->SetTitle("mean ele seed dphi 2nd layer vs pt");
2305  p_ele_seed_dphi2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2306  p_ele_seed_dphi2VsPt_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
2307  p_ele_seed_dphi2VsPt_->SetMinimum(-0.004);
2308  p_ele_seed_dphi2VsPt_->SetMaximum(0.004);
2309  p_ele_seed_dphi2VsPt_->Write();
2310  h_ele_seed_drz2_->Write();
2311  TProfile *p_ele_seed_drz2VsEta_ = h_ele_seed_drz2VsEta_->ProfileX();
2312  p_ele_seed_drz2VsEta_->SetTitle("mean ele seed dr(dz) 2nd layer vs eta");
2313  p_ele_seed_drz2VsEta_->GetXaxis()->SetTitle("#eta");
2314  p_ele_seed_drz2VsEta_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
2315  p_ele_seed_drz2VsEta_->SetMinimum(-0.15);
2316  p_ele_seed_drz2VsEta_->SetMaximum(0.15);
2317  p_ele_seed_drz2VsEta_->Write();
2318  TProfile *p_ele_seed_drz2VsPt_ = h_ele_seed_drz2VsPt_->ProfileX();
2319  p_ele_seed_drz2VsPt_->SetTitle("mean ele seed dr(dz) 2nd layer vs pt");
2320  p_ele_seed_drz2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2321  p_ele_seed_drz2VsPt_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
2322  p_ele_seed_drz2VsPt_->SetMinimum(-0.15);
2323  p_ele_seed_drz2VsPt_->SetMaximum(0.15);
2324  p_ele_seed_drz2VsPt_->Write();
2325 
2326  // classes
2327  h_ele_classes->Write();
2328  h_ele_eta->Write();
2329  h_ele_eta_golden->Write();
2330  h_ele_eta_bbrem->Write();
2331  h_ele_eta_narrow->Write();
2332  h_ele_eta_shower->Write();
2333  h_ele_PinVsPoutGolden_mode->Write();
2334  h_ele_PinVsPoutShowering_mode->Write();
2335  h_ele_PinVsPoutGolden_mean->Write();
2336  h_ele_PinVsPoutShowering_mean->Write();
2337  h_ele_PtinVsPtoutGolden_mode->Write();
2338  h_ele_PtinVsPtoutShowering_mode->Write();
2339  h_ele_PtinVsPtoutGolden_mean->Write();
2340  h_ele_PtinVsPtoutShowering_mean->Write();
2341  histSclEoEtrueGolden_barrel->Write();
2342  histSclEoEtrueGolden_endcaps->Write();
2343  histSclEoEtrueShowering_barrel->Write();
2344  histSclEoEtrueShowering_endcaps->Write();
2345 
2346  // fbrem
2347  h_ele_fbrem->Write();
2348  h_ele_fbrem_eg->Write();
2349  h_ele_fbremVsEta_mode->GetXaxis()->SetTitle("#eta");
2350  h_ele_fbremVsEta_mode->GetYaxis()->SetTitle("<P_{in} - P_{out} / P_{in}>");
2351  h_ele_fbremVsEta_mode->Write();
2352  h_ele_fbremVsEta_mean->GetXaxis()->SetTitle("#eta");
2353  h_ele_fbremVsEta_mean->GetYaxis()->SetTitle("<P_{in} - P_{out} / P_{in}>");
2354  h_ele_fbremVsEta_mean->Write();
2355  h_ele_eta_goldenFrac->Write();
2356  h_ele_eta_bbremFrac->Write();
2357  h_ele_eta_narrowFrac->Write();
2358  h_ele_eta_showerFrac->Write();
2359  h_ele_xOverX0VsEta->Write();
2360 
2361  // efficiencies
2362  h_ele_etaEff->Write();
2363  h_ele_zEff->Write();
2364  h_ele_phiEff->Write();
2365  h_ele_absetaEff->Write();
2366  h_ele_ptEff->Write();
2367  h_ele_ptEtaEff->Write();
2368  h_ele_etaEff_all->Write();
2369  h_ele_ptEff_all->Write();
2370 
2371  // q misid
2372  h_ele_etaQmisid->Write();
2373  h_ele_zQmisid->Write();
2374  h_ele_absetaQmisid->Write();
2375  h_ele_ptQmisid->Write();
2376 
2377  // e/g et pflow electrons
2378  h_ele_mva->Write();
2379  h_ele_mva_eg->Write();
2380  h_ele_provenance->Write();
2381 
2382  // isolation
2383  h_ele_tkSumPt_dr03->GetXaxis()->SetTitle("TkIsoSum, cone 0.3 (GeV/c)");
2384  h_ele_tkSumPt_dr03->GetYaxis()->SetTitle("Events");
2385  h_ele_tkSumPt_dr03->Write();
2386  h_ele_ecalRecHitSumEt_dr03->GetXaxis()->SetTitle("EcalIsoSum, cone 0.3 (GeV)");
2387  h_ele_ecalRecHitSumEt_dr03->GetYaxis()->SetTitle("Events");
2388  h_ele_ecalRecHitSumEt_dr03->Write();
2389  h_ele_hcalDepth1TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.3 (GeV)");
2390  h_ele_hcalDepth1TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
2391  h_ele_hcalDepth1TowerSumEt_dr03->Write();
2392  h_ele_hcalDepth2TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.3 (GeV)");
2393  h_ele_hcalDepth2TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
2394  h_ele_hcalDepth2TowerSumEt_dr03->Write();
2395  h_ele_tkSumPt_dr04->GetXaxis()->SetTitle("TkIsoSum, cone 0.4 (GeV/c)");
2396  h_ele_tkSumPt_dr04->GetYaxis()->SetTitle("Events");
2397  h_ele_tkSumPt_dr04->Write();
2398  h_ele_ecalRecHitSumEt_dr04->GetXaxis()->SetTitle("EcalIsoSum, cone 0.4 (GeV)");
2399  h_ele_ecalRecHitSumEt_dr04->GetYaxis()->SetTitle("Events");
2400  h_ele_ecalRecHitSumEt_dr04->Write();
2401  h_ele_hcalDepth1TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.4 (GeV)");
2402  h_ele_hcalDepth1TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
2403  h_ele_hcalDepth1TowerSumEt_dr04->Write();
2404  h_ele_hcalDepth2TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.4 (GeV)");
2405  h_ele_hcalDepth2TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
2406  h_ele_hcalDepth2TowerSumEt_dr04->Write();
2407 }
2408 
2410  // do anything here that needs to be done at desctruction time
2411  // (e.g. close files, deallocate resources etc.)
2412  histfile_->Write();
2413  histfile_->Close();
2414 }
2415 
2416 //=========================================================================
2417 // Main method
2418 //=========================================================================
2419 
2421  std::cout << "analyzing new event " << std::endl;
2422  // get electrons
2423 
2425  iEvent.getByLabel(electronCollection_, gsfElectrons);
2426  edm::LogInfo("") << "\n\n =================> Treating event " << iEvent.id() << " Number of electrons "
2427  << gsfElectrons.product()->size();
2428 
2430  iEvent.getByLabel(mcTruthCollection_, genParticles);
2431 
2432  histNum_->Fill((*gsfElectrons).size());
2433 
2434  // all rec electrons
2435  for (reco::GsfElectronCollection::const_iterator gsfIter = gsfElectrons->begin(); gsfIter != gsfElectrons->end();
2436  gsfIter++) {
2437  // preselect electrons
2438  if (gsfIter->pt() > maxPt_ || std::abs(gsfIter->eta()) > maxAbsEta_)
2439  continue;
2440  h_ele_EoverP_all->Fill(gsfIter->eSuperClusterOverP());
2441  h_ele_EseedOP_all->Fill(gsfIter->eSeedClusterOverP());
2442  h_ele_EoPout_all->Fill(gsfIter->eSeedClusterOverPout());
2443  h_ele_EeleOPout_all->Fill(gsfIter->eEleClusterOverPout());
2444  h_ele_dEtaSc_propVtx_all->Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx());
2445  h_ele_dPhiSc_propVtx_all->Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx());
2446  h_ele_dEtaCl_propOut_all->Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo());
2447  h_ele_dPhiCl_propOut_all->Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo());
2448  h_ele_HoE_all->Fill(gsfIter->hadronicOverEm());
2449  double d = gsfIter->vertex().x() * gsfIter->vertex().x() + gsfIter->vertex().y() * gsfIter->vertex().y();
2450  h_ele_TIP_all->Fill(sqrt(d));
2451  h_ele_vertexEta_all->Fill(gsfIter->eta());
2452  h_ele_vertexPt_all->Fill(gsfIter->pt());
2453  h_ele_Et_all->Fill(gsfIter->superCluster()->energy() / cosh(gsfIter->superCluster()->eta()));
2454  float enrj1 = gsfIter->superCluster()->energy();
2455  // mee
2456  for (reco::GsfElectronCollection::const_iterator gsfIter2 = gsfIter + 1; gsfIter2 != gsfElectrons->end();
2457  gsfIter2++) {
2458  math::XYZTLorentzVector p12 = (*gsfIter).p4() + (*gsfIter2).p4();
2459  float mee2 = p12.Dot(p12);
2460  float enrj2 = gsfIter2->superCluster()->energy();
2461  h_ele_mee_all->Fill(sqrt(mee2));
2462  h_ele_E2mnE1vsMee_all->Fill(sqrt(mee2), enrj2 - enrj1);
2463  if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
2464  h_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2), enrj2 - enrj1);
2465  if (gsfIter->charge() * gsfIter2->charge() < 0.) {
2466  h_ele_mee_os->Fill(sqrt(mee2));
2467  if (gsfIter->isEB() && gsfIter2->isEB())
2468  h_ele_mee_os_ebeb->Fill(sqrt(mee2));
2469  if ((gsfIter->isEB() && gsfIter2->isEE()) || (gsfIter->isEE() && gsfIter2->isEB()))
2470  h_ele_mee_os_ebee->Fill(sqrt(mee2));
2471  if (gsfIter->isEE() && gsfIter2->isEE())
2472  h_ele_mee_os_eeee->Fill(sqrt(mee2));
2473  if ((gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::GOLDEN) ||
2474  (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::BIGBREM) ||
2475  //(gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::OLDNARROW) ||
2476  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::GOLDEN) ||
2477  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::BIGBREM)/* ||
2478  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::OLDNARROW) ||
2479  (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::GOLDEN) ||
2480  (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::BIGBREM) ||
2481  (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::OLDNARROW)*/ )
2482  {
2483  h_ele_mee_os_gg->Fill(sqrt(mee2));
2484  } else if ((gsfIter->classification() == GsfElectron::SHOWERING &&
2485  gsfIter2->classification() == GsfElectron::SHOWERING) ||
2486  (gsfIter->classification() == GsfElectron::SHOWERING && gsfIter2->isGap()) ||
2487  (gsfIter->isGap() && gsfIter2->classification() == GsfElectron::SHOWERING) ||
2488  (gsfIter->isGap() && gsfIter2->isGap())) {
2489  h_ele_mee_os_bb->Fill(sqrt(mee2));
2490  } else {
2491  h_ele_mee_os_gb->Fill(sqrt(mee2));
2492  }
2493  }
2494  }
2495  }
2496 
2497  int mcNum = 0, gamNum = 0, eleNum = 0;
2498  bool matchingID, matchingMotherID;
2499 
2500  // charge mis-ID
2501  for (reco::GenParticleCollection::const_iterator mcIter = genParticles->begin(); mcIter != genParticles->end();
2502  mcIter++) {
2503  // select requested matching gen particle
2504  matchingID = false;
2505  for (unsigned int i = 0; i < matchingIDs_.size(); i++)
2506  if (mcIter->pdgId() == matchingIDs_[i])
2507  matchingID = true;
2508 
2509  if (matchingID) {
2510  // select requested mother matching gen particle
2511  // always include single particle with no mother
2512  const Candidate *mother = mcIter->mother();
2513  matchingMotherID = false;
2514  for (unsigned int i = 0; i < matchingMotherIDs_.size(); i++)
2515  if ((mother == nullptr) || ((mother != nullptr) && mother->pdgId() == matchingMotherIDs_[i]))
2516  matchingMotherID = true;
2517 
2518  if (matchingMotherID) {
2519  if (mcIter->pt() > maxPt_ || std::abs(mcIter->eta()) > maxAbsEta_)
2520  continue;
2521 
2522  // suppress the endcaps
2523  //if (std::abs(mcIter->eta()) > 1.5) continue;
2524  // select central z
2525  //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
2526 
2527  // looking for the best matching gsf electron
2528  bool okGsfFound = false;
2529  double gsfOkRatio = 999999.;
2530 
2531  // find best matched electron
2532  reco::GsfElectron bestGsfElectron;
2533  for (reco::GsfElectronCollection::const_iterator gsfIter = gsfElectrons->begin();
2534  gsfIter != gsfElectrons->end();
2535  gsfIter++) {
2536  double dphi = gsfIter->phi() - mcIter->phi();
2537  if (std::abs(dphi) > CLHEP::pi)
2538  dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
2539  double deltaR = sqrt(std::pow((gsfIter->eta() - mcIter->eta()), 2) + std::pow(dphi, 2));
2540  if (deltaR < deltaR_) {
2541  double mc_charge = mcIter->pdgId() == 11 ? -1. : 1.;
2542  h_ele_ChargeMnChargeTrue->Fill(std::abs(gsfIter->charge() - mc_charge));
2543  // require here a charge mismatch
2544  if (((mcIter->pdgId() == 11) && (gsfIter->charge() > 0.)) ||
2545  ((mcIter->pdgId() == -11) && (gsfIter->charge() < 0.))) {
2546  double tmpGsfRatio = gsfIter->p() / mcIter->p();
2547  if (std::abs(tmpGsfRatio - 1) < std::abs(gsfOkRatio - 1)) {
2548  gsfOkRatio = tmpGsfRatio;
2549  bestGsfElectron = *gsfIter;
2550  okGsfFound = true;
2551  }
2552  }
2553  }
2554  } // loop over rec ele to look for the best one
2555 
2556  // analysis when the mc track is found
2557  if (okGsfFound) {
2558  // generated distributions for matched electrons
2559  h_ele_simPt_matched_qmisid->Fill(mcIter->pt());
2560  h_ele_simPhi_matched_qmisid->Fill(mcIter->phi());
2561  h_ele_simAbsEta_matched_qmisid->Fill(std::abs(mcIter->eta()));
2562  h_ele_simEta_matched_qmisid->Fill(mcIter->eta());
2563  h_ele_simZ_matched_qmisid->Fill(mcIter->vz());
2564  }
2565  }
2566  }
2567  }
2568 
2569  // association mc-reco
2570  for (reco::GenParticleCollection::const_iterator mcIter = genParticles->begin(); mcIter != genParticles->end();
2571  mcIter++) {
2572  // number of mc particles
2573  mcNum++;
2574 
2575  // counts photons
2576  if (mcIter->pdgId() == 22) {
2577  gamNum++;
2578  }
2579 
2580  // select requested matching gen particle
2581  matchingID = false;
2582  for (unsigned int i = 0; i < matchingIDs_.size(); i++)
2583  if (mcIter->pdgId() == matchingIDs_[i])
2584  matchingID = true;
2585 
2586  if (matchingID) {
2587  // select requested mother matching gen particle
2588  // always include single particle with no mother
2589  const Candidate *mother = mcIter->mother();
2590  matchingMotherID = false;
2591  for (unsigned int i = 0; i < matchingMotherIDs_.size(); i++)
2592  if ((mother == nullptr) || ((mother != nullptr) && mother->pdgId() == matchingMotherIDs_[i]))
2593  matchingMotherID = true;
2594 
2595  if (matchingMotherID) {
2596  if (mcIter->pt() > maxPt_ || std::abs(mcIter->eta()) > maxAbsEta_)
2597  continue;
2598 
2599  // suppress the endcaps
2600  //if (std::abs(mcIter->eta()) > 1.5) continue;
2601  // select central z
2602  //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
2603 
2604  eleNum++;
2605  h_simEta->Fill(mcIter->eta());
2606  h_simAbsEta->Fill(std::abs(mcIter->eta()));
2607  h_simP->Fill(mcIter->p());
2608  h_simPt->Fill(mcIter->pt());
2609  h_simPhi->Fill(mcIter->phi());
2610  h_simZ->Fill(mcIter->vz());
2611  h_simPtEta->Fill(mcIter->eta(), mcIter->pt());
2612 
2613  // looking for the best matching gsf electron
2614  bool okGsfFound = false;
2615  double gsfOkRatio = 999999.;
2616 
2617  // find best matched electron
2618  reco::GsfElectron bestGsfElectron;
2619  for (reco::GsfElectronCollection::const_iterator gsfIter = gsfElectrons->begin();
2620  gsfIter != gsfElectrons->end();
2621  gsfIter++) {
2622  double dphi = gsfIter->phi() - mcIter->phi();
2623  if (std::abs(dphi) > CLHEP::pi)
2624  dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
2625  double deltaR = sqrt(std::pow((gsfIter->eta() - mcIter->eta()), 2) + std::pow(dphi, 2));
2626  if (deltaR < deltaR_) {
2627  if (((mcIter->pdgId() == 11) && (gsfIter->charge() < 0.)) ||
2628  ((mcIter->pdgId() == -11) && (gsfIter->charge() > 0.))) {
2629  double tmpGsfRatio = gsfIter->p() / mcIter->p();
2630  if (std::abs(tmpGsfRatio - 1) < std::abs(gsfOkRatio - 1)) {
2631  gsfOkRatio = tmpGsfRatio;
2632  bestGsfElectron = *gsfIter;
2633  okGsfFound = true;
2634  }
2635  }
2636  }
2637  } // loop over rec ele to look for the best one
2638 
2639  // analysis when the mc track is found
2640  if (okGsfFound) {
2641  // electron related distributions
2642  h_ele_charge->Fill(bestGsfElectron.charge());
2643  h_ele_chargeVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.charge());
2644  h_ele_chargeVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.charge());
2645  h_ele_chargeVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.charge());
2646  h_ele_vertexP->Fill(bestGsfElectron.p());
2647  h_ele_vertexPt->Fill(bestGsfElectron.pt());
2648  h_ele_Et->Fill(bestGsfElectron.superCluster()->energy() / cosh(bestGsfElectron.superCluster()->eta()));
2649  h_ele_vertexPtVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.pt());
2650  h_ele_vertexPtVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.pt());
2651  h_ele_vertexEta->Fill(bestGsfElectron.eta());
2652  // generated distributions for matched electrons
2653  h_ele_simPt_matched->Fill(mcIter->pt());
2654  h_ele_simPhi_matched->Fill(mcIter->phi());
2655  h_ele_simAbsEta_matched->Fill(std::abs(mcIter->eta()));
2656  h_ele_simEta_matched->Fill(mcIter->eta());
2657  h_ele_simPtEta_matched->Fill(mcIter->eta(), mcIter->pt());
2658  h_ele_vertexEtaVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta());
2659  h_ele_vertexPhi->Fill(bestGsfElectron.phi());
2660  h_ele_vertexX->Fill(bestGsfElectron.vertex().x());
2661  h_ele_vertexY->Fill(bestGsfElectron.vertex().y());
2662  h_ele_vertexZ->Fill(bestGsfElectron.vertex().z());
2663  h_ele_simZ_matched->Fill(mcIter->vz());
2664  double d = (bestGsfElectron.vertex().x() - mcIter->vx()) * (bestGsfElectron.vertex().x() - mcIter->vx()) +
2665  (bestGsfElectron.vertex().y() - mcIter->vy()) * (bestGsfElectron.vertex().y() - mcIter->vy());
2666  d = sqrt(d);
2667  h_ele_vertexTIP->Fill(d);
2668  h_ele_vertexTIPVsEta->Fill(bestGsfElectron.eta(), d);
2669  h_ele_vertexTIPVsPhi->Fill(bestGsfElectron.phi(), d);
2670  h_ele_vertexTIPVsPt->Fill(bestGsfElectron.pt(), d);
2671  h_ele_EtaMnEtaTrue->Fill(bestGsfElectron.eta() - mcIter->eta());
2672  if (bestGsfElectron.isEB())
2673  h_ele_EtaMnEtaTrue_barrel->Fill(bestGsfElectron.eta() - mcIter->eta());
2674  if (bestGsfElectron.isEE())
2675  h_ele_EtaMnEtaTrue_endcaps->Fill(bestGsfElectron.eta() - mcIter->eta());
2676  h_ele_EtaMnEtaTrueVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eta() - mcIter->eta());
2677  h_ele_EtaMnEtaTrueVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta() - mcIter->eta());
2678  h_ele_EtaMnEtaTrueVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.eta() - mcIter->eta());
2679  h_ele_PhiMnPhiTrue->Fill(bestGsfElectron.phi() - mcIter->phi());
2680  if (bestGsfElectron.isEB())
2681  h_ele_PhiMnPhiTrue_barrel->Fill(bestGsfElectron.phi() - mcIter->phi());
2682  if (bestGsfElectron.isEE())
2683  h_ele_PhiMnPhiTrue_endcaps->Fill(bestGsfElectron.phi() - mcIter->phi());
2684  h_ele_PhiMnPhiTrue2->Fill(bestGsfElectron.phi() - mcIter->phi());
2685  h_ele_PhiMnPhiTrueVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.phi() - mcIter->phi());
2686  h_ele_PhiMnPhiTrueVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.phi() - mcIter->phi());
2687  h_ele_PhiMnPhiTrueVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.phi() - mcIter->phi());
2688  h_ele_PoPtrue->Fill(bestGsfElectron.p() / mcIter->p());
2689  h_ele_PtoPttrue->Fill(bestGsfElectron.pt() / mcIter->pt());
2690  h_ele_PoPtrueVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.p() / mcIter->p());
2691  h_ele_PoPtrueVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.p() / mcIter->p());
2692  h_ele_PoPtrueVsPt->Fill(bestGsfElectron.py(), bestGsfElectron.p() / mcIter->p());
2693  if (bestGsfElectron.isEB())
2694  h_ele_PoPtrue_barrel->Fill(bestGsfElectron.p() / mcIter->p());
2695  if (bestGsfElectron.isEE())
2696  h_ele_PoPtrue_endcaps->Fill(bestGsfElectron.p() / mcIter->p());
2697  if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::GOLDEN)
2698  h_ele_PoPtrue_golden_barrel->Fill(bestGsfElectron.p() / mcIter->p());
2699  if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::GOLDEN)
2700  h_ele_PoPtrue_golden_endcaps->Fill(bestGsfElectron.p() / mcIter->p());
2701  if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::SHOWERING)
2702  h_ele_PoPtrue_showering_barrel->Fill(bestGsfElectron.p() / mcIter->p());
2703  if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::SHOWERING)
2704  h_ele_PoPtrue_showering_endcaps->Fill(bestGsfElectron.p() / mcIter->p());
2705  if (bestGsfElectron.isEB())
2706  h_ele_PtoPttrue_barrel->Fill(bestGsfElectron.pt() / mcIter->pt());
2707  if (bestGsfElectron.isEE())
2708  h_ele_PtoPttrue_endcaps->Fill(bestGsfElectron.pt() / mcIter->pt());
2709 
2710  // supercluster related distributions
2711  reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
2712  if (!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.trackerDrivenSeed())
2713  sclRef = bestGsfElectron.parentSuperCluster();
2714  histSclEn_->Fill(sclRef->energy());
2715  double R = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
2716  double Rt = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
2717  histSclEt_->Fill(sclRef->energy() * (Rt / R));
2718  histSclEtVsEta_->Fill(sclRef->eta(), sclRef->energy() * (Rt / R));
2719  histSclEtVsPhi_->Fill(sclRef->phi(), sclRef->energy() * (Rt / R));
2720  if (bestGsfElectron.isEB())
2721  histSclEoEtrue_barrel->Fill(sclRef->energy() / mcIter->p());
2722  if (bestGsfElectron.isEE())
2723  histSclEoEtrue_endcaps->Fill(sclRef->energy() / mcIter->p());
2724  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2725  histSclEoEtrue_barrel_eg->Fill(sclRef->energy() / mcIter->p());
2726  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2727  histSclEoEtrue_endcaps_eg->Fill(sclRef->energy() / mcIter->p());
2728  if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap())
2729  histSclEoEtrue_barrel_etagap->Fill(sclRef->energy() / mcIter->p());
2730  if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap())
2731  histSclEoEtrue_barrel_phigap->Fill(sclRef->energy() / mcIter->p());
2732  if (bestGsfElectron.isEBEEGap())
2733  histSclEoEtrue_ebeegap->Fill(sclRef->energy() / mcIter->p());
2734  //if (bestGsfElectron.isEE()) histSclEoEtrue_endcaps->Fill(sclRef->energy()/mcIter->p());
2735  if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap())
2736  histSclEoEtrue_endcaps_deegap->Fill(sclRef->energy() / mcIter->p());
2737  if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap())
2738  histSclEoEtrue_endcaps_ringgap->Fill(sclRef->energy() / mcIter->p());
2739  if (bestGsfElectron.isEB())
2740  histSclEoEtrue_barrel_new->Fill(sclRef->energy() / mcIter->p());
2741  if (bestGsfElectron.isEE())
2742  histSclEoEtrue_endcaps_new->Fill(sclRef->energy() / mcIter->p());
2743  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2744  histSclEoEtrue_barrel_eg_new->Fill(sclRef->energy() / mcIter->p());
2745  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2746  histSclEoEtrue_endcaps_eg_new->Fill(sclRef->energy() / mcIter->p());
2747  if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap())
2748  histSclEoEtrue_barrel_etagap_new->Fill(sclRef->energy() / mcIter->p());
2749  if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap())
2750  histSclEoEtrue_barrel_phigap_new->Fill(sclRef->energy() / mcIter->p());
2751  if (bestGsfElectron.isEBEEGap())
2752  histSclEoEtrue_ebeegap_new->Fill(sclRef->energy() / mcIter->p());
2753  //if (bestGsfElectron.isEE()) histSclEoEtrue_endcaps_new->Fill(sclRef->energy()/mcIter->p());
2754  if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap())
2755  histSclEoEtrue_endcaps_deegap_new->Fill(sclRef->energy() / mcIter->p());
2756  if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap())
2757  histSclEoEtrue_endcaps_ringgap_new->Fill(sclRef->energy() / mcIter->p());
2758  histSclEta_->Fill(sclRef->eta());
2759  histSclEtaVsPhi_->Fill(sclRef->phi(), sclRef->eta());
2760  histSclPhi_->Fill(sclRef->phi());
2761  histSclSigEtaEta_->Fill(bestGsfElectron.scSigmaEtaEta());
2762  if (bestGsfElectron.isEB())
2763  histSclSigEtaEta_barrel_->Fill(bestGsfElectron.scSigmaEtaEta());
2764  if (bestGsfElectron.isEE())
2765  histSclSigEtaEta_endcaps_->Fill(bestGsfElectron.scSigmaEtaEta());
2766  histSclSigIEtaIEta_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2767  if (bestGsfElectron.isEB())
2768  histSclSigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2769  if (bestGsfElectron.isEE())
2770  histSclSigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2771  histSclE1x5_->Fill(bestGsfElectron.scE1x5());
2772  if (bestGsfElectron.isEB())
2773  histSclE1x5_barrel_->Fill(bestGsfElectron.scE1x5());
2774  if (bestGsfElectron.isEE())
2775  histSclE1x5_endcaps_->Fill(bestGsfElectron.scE1x5());
2776  histSclE2x5max_->Fill(bestGsfElectron.scE2x5Max());
2777  if (bestGsfElectron.isEB())
2778  histSclE2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max());
2779  if (bestGsfElectron.isEE())
2780  histSclE2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max());
2781  histSclE5x5_->Fill(bestGsfElectron.scE5x5());
2782  if (bestGsfElectron.isEB())
2783  histSclE5x5_barrel_->Fill(bestGsfElectron.scE5x5());
2784  if (bestGsfElectron.isEE())
2785  histSclE5x5_endcaps_->Fill(bestGsfElectron.scE5x5());
2786  if (bestGsfElectron.ecalDrivenSeed())
2787  histSclSigIEtaIEta_eg_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2788  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2789  histSclSigIEtaIEta_eg_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2790  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2791  histSclSigIEtaIEta_eg_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2792  if (bestGsfElectron.ecalDrivenSeed())
2793  histSclE1x5_eg_->Fill(bestGsfElectron.scE1x5());
2794  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2795  histSclE1x5_eg_barrel_->Fill(bestGsfElectron.scE1x5());
2796  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2797  histSclE1x5_eg_endcaps_->Fill(bestGsfElectron.scE1x5());
2798  if (bestGsfElectron.ecalDrivenSeed())
2799  histSclE2x5max_eg_->Fill(bestGsfElectron.scE2x5Max());
2800  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2801  histSclE2x5max_eg_barrel_->Fill(bestGsfElectron.scE2x5Max());
2802  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2803  histSclE2x5max_eg_endcaps_->Fill(bestGsfElectron.scE2x5Max());
2804  if (bestGsfElectron.ecalDrivenSeed())
2805  histSclE5x5_eg_->Fill(bestGsfElectron.scE5x5());
2806  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2807  histSclE5x5_eg_barrel_->Fill(bestGsfElectron.scE5x5());
2808  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2809  histSclE5x5_eg_endcaps_->Fill(bestGsfElectron.scE5x5());
2810  float pfEnergy = 0., egEnergy = 0.;
2811  if (!bestGsfElectron.superCluster().isNull())
2812  egEnergy = bestGsfElectron.superCluster()->energy();
2813  if (!bestGsfElectron.parentSuperCluster().isNull())
2814  pfEnergy = bestGsfElectron.parentSuperCluster()->energy();
2815  histSclEoEtruePfVsEg->Fill(egEnergy / mcIter->p(), pfEnergy / mcIter->p());
2816 
2817  // track related distributions
2818  h_ele_ambiguousTracks->Fill(bestGsfElectron.ambiguousGsfTracksSize());
2819  h_ele_ambiguousTracksVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize());
2820  h_ele_ambiguousTracksVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize());
2821  h_ele_ambiguousTracksVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize());
2822  if (!readAOD_) { // track extra does not exist in AOD
2823  h_ele_foundHits->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits());
2824  if (bestGsfElectron.isEB())
2825  h_ele_foundHits_barrel->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits());
2826  if (bestGsfElectron.isEE())
2827  h_ele_foundHits_endcaps->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits());
2828  h_ele_foundHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits());
2829  h_ele_foundHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits());
2830  h_ele_foundHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits());
2831  h_ele_lostHits->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits());
2832  if (bestGsfElectron.isEB())
2833  h_ele_lostHits_barrel->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits());
2834  if (bestGsfElectron.isEE())
2835  h_ele_lostHits_endcaps->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits());
2836  h_ele_lostHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits());
2837  h_ele_lostHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits());
2838  h_ele_lostHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits());
2839  h_ele_chi2->Fill(bestGsfElectron.gsfTrack()->normalizedChi2());
2840  if (bestGsfElectron.isEB())
2841  h_ele_chi2_barrel->Fill(bestGsfElectron.gsfTrack()->normalizedChi2());
2842  if (bestGsfElectron.isEE())
2843  h_ele_chi2_endcaps->Fill(bestGsfElectron.gsfTrack()->normalizedChi2());
2844  h_ele_chi2VsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2());
2845  h_ele_chi2VsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2());
2846  h_ele_chi2VsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2());
2847  }
2848  // from gsf track interface, hence using mean
2849  if (!readAOD_) { // track extra does not exist in AOD
2850  h_ele_PinMnPout->Fill(bestGsfElectron.gsfTrack()->innerMomentum().R() -
2851  bestGsfElectron.gsfTrack()->outerMomentum().R());
2852  h_ele_outerP->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R());
2853  h_ele_outerPt->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho());
2854  }
2855  // from electron interface, hence using mode
2856  h_ele_PinMnPout_mode->Fill(bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2857  h_ele_PinMnPoutVsEta_mode->Fill(
2858  bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2859  h_ele_PinMnPoutVsPhi_mode->Fill(
2860  bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2861  h_ele_PinMnPoutVsPt_mode->Fill(
2862  bestGsfElectron.pt(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2863  h_ele_PinMnPoutVsE_mode->Fill(
2864  bestGsfElectron.caloEnergy(),
2865  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2866  if (!readAOD_) // track extra does not exist in AOD
2867  h_ele_PinMnPoutVsChi2_mode->Fill(
2868  bestGsfElectron.gsfTrack()->normalizedChi2(),
2869  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2870  h_ele_outerP_mode->Fill(bestGsfElectron.trackMomentumOut().R());
2871  h_ele_outerPVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().R());
2872  h_ele_outerPt_mode->Fill(bestGsfElectron.trackMomentumOut().Rho());
2873  h_ele_outerPtVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().Rho());
2874  h_ele_outerPtVsPhi_mode->Fill(bestGsfElectron.phi(), bestGsfElectron.trackMomentumOut().Rho());
2875  h_ele_outerPtVsPt_mode->Fill(bestGsfElectron.pt(), bestGsfElectron.trackMomentumOut().Rho());
2876 
2877  if (!readAOD_) { // track extra does not exist in AOD
2878  edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
2879  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>();
2880  h_ele_seed_dphi2_->Fill(elseed->dPhiNeg(1));
2881  h_ele_seed_dphi2VsEta_->Fill(bestGsfElectron.eta(), elseed->dPhiNeg(1));
2882  h_ele_seed_dphi2VsPt_->Fill(bestGsfElectron.pt(), elseed->dPhiNeg(1));
2883  h_ele_seed_drz2_->Fill(elseed->dRZNeg(1));
2884  h_ele_seed_drz2VsEta_->Fill(bestGsfElectron.eta(), elseed->dRZNeg(1));
2885  h_ele_seed_drz2VsPt_->Fill(bestGsfElectron.pt(), elseed->dRZNeg(1));
2886  h_ele_seed_subdet2_->Fill(elseed->subDet(1));
2887  }
2888  // match distributions
2889  h_ele_EoP->Fill(bestGsfElectron.eSuperClusterOverP());
2890  if (bestGsfElectron.ecalDrivenSeed())
2891  h_ele_EoP_eg->Fill(bestGsfElectron.eSuperClusterOverP());
2892  if (bestGsfElectron.isEB())
2893  h_ele_EoP_barrel->Fill(bestGsfElectron.eSuperClusterOverP());
2894  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2895  h_ele_EoP_eg_barrel->Fill(bestGsfElectron.eSuperClusterOverP());
2896  if (bestGsfElectron.isEE())
2897  h_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP());
2898  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2899  h_ele_EoP_eg_endcaps->Fill(bestGsfElectron.eSuperClusterOverP());
2900  h_ele_EoPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSuperClusterOverP());
2901  h_ele_EoPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSuperClusterOverP());
2902  h_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSuperClusterOverP());
2903  h_ele_EseedOP->Fill(bestGsfElectron.eSeedClusterOverP());
2904  if (bestGsfElectron.ecalDrivenSeed())
2905  h_ele_EseedOP_eg->Fill(bestGsfElectron.eSeedClusterOverP());
2906  if (bestGsfElectron.isEB())
2907  h_ele_EseedOP_barrel->Fill(bestGsfElectron.eSeedClusterOverP());
2908  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2909  h_ele_EseedOP_eg_barrel->Fill(bestGsfElectron.eSeedClusterOverP());
2910  if (bestGsfElectron.isEE())
2911  h_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP());
2912  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2913  h_ele_EseedOP_eg_endcaps->Fill(bestGsfElectron.eSeedClusterOverP());
2914  h_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverP());
2915  h_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverP());
2916  h_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverP());
2917  h_ele_EoPout->Fill(bestGsfElectron.eSeedClusterOverPout());
2918  if (bestGsfElectron.ecalDrivenSeed())
2919  h_ele_EoPout_eg->Fill(bestGsfElectron.eSeedClusterOverPout());
2920  if (bestGsfElectron.isEB())
2921  h_ele_EoPout_barrel->Fill(bestGsfElectron.eSeedClusterOverPout());
2922  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2923  h_ele_EoPout_eg_barrel->Fill(bestGsfElectron.eSeedClusterOverPout());
2924  if (bestGsfElectron.isEE())
2925  h_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout());
2926  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2927  h_ele_EoPout_eg_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout());
2928  h_ele_EoPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout());
2929  h_ele_EoPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout());
2930  h_ele_EoPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout());
2931  h_ele_EeleOPout->Fill(bestGsfElectron.eEleClusterOverPout());
2932  if (bestGsfElectron.ecalDrivenSeed())
2933  h_ele_EeleOPout_eg->Fill(bestGsfElectron.eEleClusterOverPout());
2934  if (bestGsfElectron.isEB())
2935  h_ele_EeleOPout_barrel->Fill(bestGsfElectron.eEleClusterOverPout());
2936  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2937  h_ele_EeleOPout_eg_barrel->Fill(bestGsfElectron.eEleClusterOverPout());
2938  if (bestGsfElectron.isEE())
2939  h_ele_EeleOPout_endcaps->Fill(bestGsfElectron.eEleClusterOverPout());
2940  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2941  h_ele_EeleOPout_eg_endcaps->Fill(bestGsfElectron.eEleClusterOverPout());
2942  h_ele_EeleOPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout());
2943  h_ele_EeleOPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout());
2944  h_ele_EeleOPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout());
2945  h_ele_dEtaSc_propVtx->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2946  if (bestGsfElectron.ecalDrivenSeed())
2947  h_ele_dEtaSc_propVtx_eg->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2948  if (bestGsfElectron.isEB())
2949  h_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2950  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2951  h_ele_dEtaSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2952  if (bestGsfElectron.isEE())
2953  h_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2954  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2955  h_ele_dEtaSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2956  h_ele_dEtaScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2957  h_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2958  h_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2959  h_ele_dPhiSc_propVtx->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2960  if (bestGsfElectron.ecalDrivenSeed())
2961  h_ele_dPhiSc_propVtx_eg->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2962  if (bestGsfElectron.isEB())
2963  h_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2964  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2965  h_ele_dPhiSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2966  if (bestGsfElectron.isEE())
2967  h_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2968  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2969  h_ele_dPhiSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2970  h_ele_dPhiScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2971  h_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2972  h_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2973  h_ele_dEtaCl_propOut->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2974  if (bestGsfElectron.ecalDrivenSeed())
2975  h_ele_dEtaCl_propOut_eg->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2976  if (bestGsfElectron.isEB())
2977  h_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2978  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2979  h_ele_dEtaCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2980  if (bestGsfElectron.isEE())
2981  h_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2982  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2983  h_ele_dEtaCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2984  h_ele_dEtaClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2985  h_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2986  h_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2987  h_ele_dPhiCl_propOut->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2988  if (bestGsfElectron.ecalDrivenSeed())
2989  h_ele_dPhiCl_propOut_eg->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2990  if (bestGsfElectron.isEB())
2991  h_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2992  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2993  h_ele_dPhiCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2994  if (bestGsfElectron.isEE())
2995  h_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2996  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2997  h_ele_dPhiCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2998  h_ele_dPhiClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2999  h_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3000  h_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3001  h_ele_dEtaEleCl_propOut->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3002  if (bestGsfElectron.ecalDrivenSeed())
3003  h_ele_dEtaEleCl_propOut_eg->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3004  if (bestGsfElectron.isEB())
3005  h_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3006  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3007  h_ele_dEtaEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3008  if (bestGsfElectron.isEE())
3009  h_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3010  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3011  h_ele_dEtaEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3012  h_ele_dEtaEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3013  h_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3014  h_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3015  h_ele_dPhiEleCl_propOut->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3016  if (bestGsfElectron.ecalDrivenSeed())
3017  h_ele_dPhiEleCl_propOut_eg->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3018  if (bestGsfElectron.isEB())
3019  h_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3020  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3021  h_ele_dPhiEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3022  if (bestGsfElectron.isEE())
3023  h_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3024  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3025  h_ele_dPhiEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3026  h_ele_dPhiEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3027  h_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3028  h_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3029  h_ele_HoE->Fill(bestGsfElectron.hadronicOverEm());
3030  if (bestGsfElectron.ecalDrivenSeed())
3031  h_ele_HoE_eg->Fill(bestGsfElectron.hadronicOverEm());
3032  if (bestGsfElectron.isEB())
3033  h_ele_HoE_barrel->Fill(bestGsfElectron.hadronicOverEm());
3034  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3035  h_ele_HoE_eg_barrel->Fill(bestGsfElectron.hadronicOverEm());
3036  if (bestGsfElectron.isEE())
3037  h_ele_HoE_endcaps->Fill(bestGsfElectron.hadronicOverEm());
3038  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3039  h_ele_HoE_eg_endcaps->Fill(bestGsfElectron.hadronicOverEm());
3040  if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap() && !bestGsfElectron.isEBEEGap() &&
3041  !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap())
3042  h_ele_HoE_fiducial->Fill(bestGsfElectron.hadronicOverEm());
3043  h_ele_HoEVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.hadronicOverEm());
3044  h_ele_HoEVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.hadronicOverEm());
3045  h_ele_HoEVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.hadronicOverEm());
3046 
3047  //classes
3048  int eleClass = bestGsfElectron.classification();
3049  if (bestGsfElectron.isEE())
3050  eleClass += 10;
3051  h_ele_classes->Fill(eleClass);
3052 
3053  if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEB())
3054  histSclEoEtrueGolden_barrel->Fill(sclRef->energy() / mcIter->p());
3055  if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEE())
3056  histSclEoEtrueGolden_endcaps->Fill(sclRef->energy() / mcIter->p());
3057  if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEB())
3058  histSclEoEtrueShowering_barrel->Fill(sclRef->energy() / mcIter->p());
3059  if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEE())
3060  histSclEoEtrueShowering_endcaps->Fill(sclRef->energy() / mcIter->p());
3061 
3062  //eleClass = eleClass%100; // get rid of barrel/endcap distinction
3063  h_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
3064  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
3065  h_ele_eta_golden->Fill(std::abs(bestGsfElectron.eta()));
3066  if (bestGsfElectron.classification() == GsfElectron::BIGBREM)
3067  h_ele_eta_bbrem->Fill(std::abs(bestGsfElectron.eta()));
3068  //if (bestGsfElectron.classification() == GsfElectron::NARROW) h_ele_eta_narrow ->Fill(std::abs(bestGsfElectron.eta()));
3069  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
3070  h_ele_eta_shower->Fill(std::abs(bestGsfElectron.eta()));
3071 
3072  //fbrem
3073  double fbrem_mean = 0.;
3074  if (!readAOD_) // track extra does not exist in AOD
3075  fbrem_mean =
3076  1. - bestGsfElectron.gsfTrack()->outerMomentum().R() / bestGsfElectron.gsfTrack()->innerMomentum().R();
3077  double fbrem_mode = bestGsfElectron.fbrem();
3078  h_ele_fbrem->Fill(fbrem_mode);
3079  if (bestGsfElectron.ecalDrivenSeed())
3080  h_ele_fbrem_eg->Fill(fbrem_mode);
3081  h_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(), fbrem_mode);
3082  if (!readAOD_) // track extra does not exist in AOD
3083  h_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(), fbrem_mean);
3084 
3085  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
3086  h_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(),
3087  bestGsfElectron.trackMomentumAtVtx().R());
3088  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
3089  h_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(),
3090  bestGsfElectron.trackMomentumAtVtx().R());
3091  if (!readAOD_) { // track extra not available in AOD
3092  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
3093  h_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(),
3094  bestGsfElectron.gsfTrack()->innerMomentum().R());
3095  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
3096  h_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(),
3097  bestGsfElectron.gsfTrack()->innerMomentum().R());
3098  }
3099  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
3100  h_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(),
3101  bestGsfElectron.trackMomentumAtVtx().Rho());
3102  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
3103  h_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(),
3104  bestGsfElectron.trackMomentumAtVtx().Rho());
3105  if (!readAOD_) { // track extra not available in AOD
3106  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
3107  h_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(),
3108  bestGsfElectron.gsfTrack()->innerMomentum().Rho());
3109  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
3110  h_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(),
3111  bestGsfElectron.gsfTrack()->innerMomentum().Rho());
3112  }
3113 
3114  h_ele_mva->Fill(bestGsfElectron.mva_e_pi());
3115  if (bestGsfElectron.ecalDrivenSeed())
3116  h_ele_mva_eg->Fill(bestGsfElectron.mva_e_pi());
3117  if (bestGsfElectron.ecalDrivenSeed())
3118  h_ele_provenance->Fill(1.);
3119  if (bestGsfElectron.trackerDrivenSeed())
3120  h_ele_provenance->Fill(-1.);
3121  if (bestGsfElectron.trackerDrivenSeed() || bestGsfElectron.ecalDrivenSeed())
3122  h_ele_provenance->Fill(0.);
3123  if (bestGsfElectron.trackerDrivenSeed() && !bestGsfElectron.ecalDrivenSeed())
3124  h_ele_provenance->Fill(-2.);
3125  if (!bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.ecalDrivenSeed())
3126  h_ele_provenance->Fill(2.);
3127 
3128  h_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
3129  h_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
3130  h_ele_hcalDepth1TowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
3131  h_ele_hcalDepth2TowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
3132  h_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
3133  h_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
3134  h_ele_hcalDepth1TowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
3135  h_ele_hcalDepth2TowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
3136 
3137  } // gsf electron found
3138 
3139  } // mc particle found
3140  }
3141 
3142  } // loop over mc particle
3143 
3144  h_mcNum->Fill(mcNum);
3145  h_eleNum->Fill(eleNum);
3146 }
T getParameter(std::string const &) const
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:156
double eta() const final
momentum pseudorapidity
float scSigmaEtaEta() const
Definition: GsfElectron.h:463
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
GsfElectronMCAnalyzer(const edm::ParameterSet &conf)
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:268
float dr04TkSumPt() const
Definition: GsfElectron.h:533
double pt() const final
transverse momentum
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
int charge() const final
electric charge
bool isEERingGap() const
Definition: GsfElectron.h:337
void analyze(const edm::Event &e, const edm::EventSetup &c) override
float dr03HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:525
float fbrem() const
Definition: GsfElectron.h:726
float scE2x5Max() const
Definition: GsfElectron.h:466
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
virtual int pdgId() const =0
PDG identifier.
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
bool isNull() const
Checks for null.
Definition: Ref.h:235
float deltaPhiEleClusterTrackAtCalo() const
Definition: GsfElectron.h:230
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
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
edm::EventID id() const
Definition: EventBase.h:59
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:226
fixed size matrix
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
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