CMS 3D CMS Logo

ElectronMcSignalValidator.cc
Go to the documentation of this file.
1 
2 // user include files
4 
6 
8 
18 
21 
24 
31 
32 #include "CLHEP/Units/GlobalPhysicalConstants.h"
33 #include "TMath.h"
34 #include "TFile.h"
35 #include "TH1F.h"
36 #include "TH1I.h"
37 #include "TH2F.h"
38 #include "TProfile.h"
39 #include "TTree.h"
40 #include <vector>
41 #include <iostream>
42 #include <typeinfo>
43 
44 using namespace reco;
45 
48  {
49  mcTruthCollection_ = consumes<reco::GenParticleCollection> (
50  conf.getParameter<edm::InputTag>("mcTruthCollection"));
51  electronCollection_ = consumes<reco::GsfElectronCollection> (
52  conf.getParameter<edm::InputTag>("electronCollection"));
53  electronCoreCollection_ = consumes<reco::GsfElectronCoreCollection> (
54  conf.getParameter<edm::InputTag>("electronCoreCollection"));
55  electronTrackCollection_ = consumes<reco::GsfTrackCollection> (
56  conf.getParameter<edm::InputTag>("electronTrackCollection"));
57  electronSeedCollection_ = consumes<reco::ElectronSeedCollection> (
58  conf.getParameter<edm::InputTag>("electronSeedCollection"));
59  /* new 03/02/2015 */
60  offlineVerticesCollection_ = consumes<reco::VertexCollection> (
61  conf.getParameter<edm::InputTag>("offlinePrimaryVertices"));
62  /* fin new */
63  beamSpotTag_ = consumes<reco::BeamSpot> (
64  conf.getParameter<edm::InputTag>("beamSpot"));
65 
66  readAOD_ = conf.getParameter<bool>("readAOD");
67 
68  isoFromDepsTk03Tag_ = consumes<edm::ValueMap<double> > (
69  conf.getParameter<edm::InputTag>( "isoFromDepsTk03"));
70  isoFromDepsTk04Tag_ = consumes<edm::ValueMap<double> > (
71  conf.getParameter<edm::InputTag>( "isoFromDepsTk04"));
72  isoFromDepsEcalFull03Tag_ = consumes<edm::ValueMap<double> > (
73  conf.getParameter<edm::InputTag>( "isoFromDepsEcalFull03"));
74  isoFromDepsEcalFull04Tag_ = consumes<edm::ValueMap<double> > (
75  conf.getParameter<edm::InputTag>( "isoFromDepsEcalFull04"));
76  isoFromDepsEcalReduced03Tag_ = consumes<edm::ValueMap<double> >(
77  conf.getParameter<edm::InputTag>( "isoFromDepsEcalReduced03"));
78  isoFromDepsEcalReduced04Tag_ = consumes<edm::ValueMap<double> > (
79  conf.getParameter<edm::InputTag>( "isoFromDepsEcalReduced04"));
80  isoFromDepsHcal03Tag_ = consumes<edm::ValueMap<double> > (
81  conf.getParameter<edm::InputTag>( "isoFromDepsHcal03"));
82  isoFromDepsHcal04Tag_ = consumes<edm::ValueMap<double> > (
83  conf.getParameter<edm::InputTag>( "isoFromDepsHcal04"));
84 
85  maxPt_ = conf.getParameter<double>("MaxPt");
86  maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
87  deltaR_ = conf.getParameter<double>("DeltaR");
88  deltaR2_ = deltaR_ * deltaR_;
89  matchingIDs_ = conf.getParameter<std::vector<int> >("MatchingID");
90  matchingMotherIDs_ = conf.getParameter<std::vector<int> >("MatchingMotherID");
91  inputFile_ = conf.getParameter<std::string>("InputFile") ;
92  outputFile_ = conf.getParameter<std::string>("OutputFile") ;
93  inputInternalPath_ = conf.getParameter<std::string>("InputFolderName") ;
94  outputInternalPath_ = conf.getParameter<std::string>("OutputFolderName") ;
95 
96  // histos bining and limits
97 
98  edm::ParameterSet histosSet = conf.getParameter<edm::ParameterSet>("histosCfg") ;
99 
100  xyz_nbin=histosSet.getParameter<int>("Nbinxyz");
101 
102  p_nbin=histosSet.getParameter<int>("Nbinp");
103  p2D_nbin=histosSet.getParameter<int>("Nbinp2D");
104  p_max=histosSet.getParameter<double>("Pmax");
105 
106  pt_nbin=histosSet.getParameter<int>("Nbinpt");
107  pt2D_nbin=histosSet.getParameter<int>("Nbinpt2D");
108  pteff_nbin=histosSet.getParameter<int>("Nbinpteff");
109  pt_max=histosSet.getParameter<double>("Ptmax");
110 
111  fhits_nbin=histosSet.getParameter<int>("Nbinfhits");
112  fhits_max=histosSet.getParameter<double>("Fhitsmax");
113 
114  lhits_nbin=histosSet.getParameter<int>("Nbinlhits");
115  lhits_max=histosSet.getParameter<double>("Lhitsmax");
116 
117  eop_nbin=histosSet.getParameter<int>("Nbineop");
118  eop2D_nbin=histosSet.getParameter<int>("Nbineop2D");
119  eop_max=histosSet.getParameter<double>("Eopmax");
120  eopmaxsht=histosSet.getParameter<double>("Eopmaxsht");
121 
122  eta_nbin=histosSet.getParameter<int>("Nbineta");
123  eta2D_nbin=histosSet.getParameter<int>("Nbineta2D");
124  eta_min=histosSet.getParameter<double>("Etamin");
125  eta_max=histosSet.getParameter<double>("Etamax");
126 
127  deta_nbin=histosSet.getParameter<int>("Nbindeta");
128  deta_min=histosSet.getParameter<double>("Detamin");
129  deta_max=histosSet.getParameter<double>("Detamax");
130 
131  phi_nbin=histosSet.getParameter<int>("Nbinphi");
132  phi2D_nbin=histosSet.getParameter<int>("Nbinphi2D");
133  phi_min=histosSet.getParameter<double>("Phimin");
134  phi_max=histosSet.getParameter<double>("Phimax");
135 
136  detamatch_nbin=histosSet.getParameter<int>("Nbindetamatch");
137  detamatch2D_nbin=histosSet.getParameter<int>("Nbindetamatch2D");
138  detamatch_min=histosSet.getParameter<double>("Detamatchmin");
139  detamatch_max=histosSet.getParameter<double>("Detamatchmax");
140 
141  dphi_nbin=histosSet.getParameter<int>("Nbindphi");
142  dphi_min=histosSet.getParameter<double>("Dphimin");
143  dphi_max=histosSet.getParameter<double>("Dphimax");
144 
145  dphimatch_nbin=histosSet.getParameter<int>("Nbindphimatch");
146  dphimatch2D_nbin=histosSet.getParameter<int>("Nbindphimatch2D");
147  dphimatch_min=histosSet.getParameter<double>("Dphimatchmin");
148  dphimatch_max=histosSet.getParameter<double>("Dphimatchmax");
149 
150  poptrue_nbin= histosSet.getParameter<int>("Nbinpoptrue");
151  poptrue_min=histosSet.getParameter<double>("Poptruemin");
152  poptrue_max=histosSet.getParameter<double>("Poptruemax");
153 
154  mee_nbin= histosSet.getParameter<int>("Nbinmee");
155  mee_min=histosSet.getParameter<double>("Meemin");
156  mee_max=histosSet.getParameter<double>("Meemax");
157 
158  hoe_nbin= histosSet.getParameter<int>("Nbinhoe");
159  hoe_min=histosSet.getParameter<double>("Hoemin");
160  hoe_max=histosSet.getParameter<double>("Hoemax");
161 
162  error_nbin=histosSet.getParameter<int>("Nbinerror");
163  enerror_max=histosSet.getParameter<double>("Energyerrormax");
164 
165  set_EfficiencyFlag=histosSet.getParameter<bool>("EfficiencyFlag");
166  set_StatOverflowFlag=histosSet.getParameter<bool>("StatOverflowFlag");
167 
168  // so to please coverity...
169  h1_mcNum = 0 ;
170  h1_eleNum = 0 ;
171  h1_gamNum = 0 ;
172 
173  h1_recEleNum = 0 ;
174  h1_recCoreNum = 0 ;
175  h1_recTrackNum = 0 ;
176  h1_recSeedNum = 0 ;
178 
179  h1_mc_Eta = 0 ;
180  h1_mc_AbsEta = 0 ;
181  h1_mc_P = 0 ;
182  h1_mc_Pt = 0 ;
183  h1_mc_Phi = 0 ;
184  h1_mc_Z = 0 ;
185  h2_mc_PtEta = 0 ;
186 
187  h1_mc_Eta_matched = 0 ;
189  h1_mc_Pt_matched = 0 ;
190  h1_mc_Phi_matched = 0 ;
191  h1_mc_Z_matched = 0 ;
192  h2_mc_PtEta_matched = 0 ;
193 
199 
200  h1_ele_EoverP_all = 0 ;
203  h1_ele_EseedOP_all = 0 ;
206  h1_ele_EoPout_all = 0 ;
224  h1_ele_TIP_all = 0 ;
227  h1_ele_HoE_all = 0 ;
231  h1_ele_vertexPt_all = 0 ;
232  h1_ele_Et_all = 0 ;
233  h1_ele_mee_all = 0 ;
234  h1_ele_mee_os = 0 ;
235  h1_ele_mee_os_ebeb = 0 ;
236  h1_ele_mee_os_ebee = 0 ;
237  h1_ele_mee_os_eeee = 0 ;
238  h1_ele_mee_os_gg = 0 ;
239  h1_ele_mee_os_gb = 0 ;
240  h1_ele_mee_os_bb = 0 ;
241 
244 
245  h1_ele_charge = 0 ;
246  h2_ele_chargeVsEta = 0 ;
247  h2_ele_chargeVsPhi = 0 ;
248  h2_ele_chargeVsPt = 0 ;
249  h1_ele_vertexP = 0 ;
250  h1_ele_vertexPt = 0 ;
252  h1_ele_Et = 0 ;
256  h1_ele_vertexEta = 0 ;
258  h1_ele_vertexAbsEta = 0 ;
259  h1_ele_vertexPhi = 0 ;
260  h1_ele_vertexX = 0 ;
261  h1_ele_vertexY = 0 ;
262  h1_ele_vertexZ = 0 ;
263  h1_ele_vertexTIP = 0 ;
267 
268  h1_scl_En = 0 ;
282  h2_scl_EoEtrueVsrecOfflineVertices = 0 ; // new 2015.15.05
283  h2_scl_EoEtrueVsrecOfflineVertices_barrel = 0 ; // new 2015.15.05
284  h2_scl_EoEtrueVsrecOfflineVertices_endcaps = 0 ; // new 2015.15.05
286  h1_scl_Et = 0 ;
287  h2_scl_EtVsEta = 0 ;
288  h2_scl_EtVsPhi = 0 ;
289  h2_scl_EtaVsPhi = 0 ;
290  h1_scl_Eta = 0 ;
291  h1_scl_Phi = 0 ;
292 // h1_scl_ESFrac = 0 ;
294 
296 
297  h1_scl_SigEtaEta = 0 ;
300  h1_scl_SigIEtaIEta = 0 ;
309  h1_scl_E1x5 = 0 ;
310  h1_scl_E1x5_barrel = 0 ;
311  h1_scl_E1x5_endcaps = 0 ;
312  h1_scl_E2x5max = 0 ;
315  h1_scl_E5x5 = 0 ;
316  h1_scl_E5x5_barrel = 0 ;
317  h1_scl_E5x5_endcaps = 0 ;
321 
326  h1_ele_foundHits = 0 ;
333  h1_ele_lostHits = 0 ;
338  h2_ele_lostHitsVsPt = 0 ;
339  h1_ele_chi2 = 0 ;
340  h1_ele_chi2_barrel = 0 ;
341  h1_ele_chi2_endcaps = 0 ;
342  h2_ele_chi2VsEta = 0 ;
343  h2_ele_chi2VsPhi = 0 ;
344  h2_ele_chi2VsPt = 0 ;
345 
346  h1_ele_PoPtrue = 0 ;
349 
350  h2_ele_PoPtrueVsEta = 0 ;
351  h2_ele_PoPtrueVsPhi = 0 ;
352  h2_ele_PoPtrueVsPt = 0 ;
354 
359  h1_ele_PtoPttrue = 0 ;
363  h1_ele_EtaMnEtaTrue = 0 ;
369  h1_ele_PhiMnPhiTrue = 0 ;
376  h1_ele_PinMnPout = 0 ;
383 
384  h1_ele_outerP = 0 ;
385  h1_ele_outerP_mode = 0 ;
387  h1_ele_outerPt = 0 ;
388  h1_ele_outerPt_mode = 0 ;
392  h1_ele_EoP = 0 ;
393  h1_ele_EoP_barrel = 0 ;
394  h1_ele_EoP_endcaps = 0 ;
395  h2_ele_EoPVsEta = 0 ;
396  h2_ele_EoPVsPhi = 0 ;
397  h2_ele_EoPVsE = 0 ;
398  h1_ele_EseedOP = 0 ;
401  h2_ele_EseedOPVsEta = 0 ;
402  h2_ele_EseedOPVsPhi = 0 ;
403  h2_ele_EseedOPVsE = 0 ;
404  h1_ele_EoPout = 0 ;
407  h2_ele_EoPoutVsEta = 0 ;
408  h2_ele_EoPoutVsPhi = 0 ;
409  h2_ele_EoPoutVsE = 0 ;
410  h1_ele_EeleOPout = 0 ;
415  h2_ele_EeleOPoutVsE = 0 ;
416 
459 
460  h1_ele_seed_subdet2 = 0 ;
461  h1_ele_seed_mask = 0 ;
465  h1_ele_seed_dphi2 = 0 ;
471  h1_ele_seed_drz2 = 0 ;
474  h1_ele_seed_drz2pos = 0 ;
477 
478  h1_ele_classes = 0 ;
479  h1_ele_eta = 0 ;
480  h1_ele_eta_golden = 0 ;
481  h1_ele_eta_bbrem = 0 ;
482  h1_ele_eta_shower = 0 ;
483 
484  h1_ele_HoE = 0 ;
485  h1_ele_HoE_barrel = 0 ;
486  h1_ele_HoE_endcaps = 0 ;
487  h1_ele_HoE_fiducial = 0 ;
488  h2_ele_HoEVsEta = 0 ;
489  h2_ele_HoEVsPhi = 0 ;
490  h2_ele_HoEVsE = 0 ;
491  h1_ele_HoE_mAOD = 0 ;
494 
495  h1_ele_fbrem = 0 ;
496  h1_ele_fbrem_barrel = 0 ;
500  h1_ele_fbrem_mAOD = 0 ;
504 
519 
520  h1_ele_mva = 0 ;
522  h1_ele_provenance = 0 ;
523 
524  // isolation
525  h1_ele_tkSumPt_dr03 = 0 ;
535  h1_ele_tkSumPt_dr04 = 0 ;
545 
546  // conversions
547  h1_ele_convFlags = 0 ;
549  h1_ele_convDist = 0 ;
550  h1_ele_convDist_all = 0 ;
551  h1_ele_convDcot = 0 ;
552  h1_ele_convDcot_all = 0 ;
553  h1_ele_convRadius = 0 ;
555 
556  // PF
566 
567  }
568 
570  {
572 
573  // prepareStore() ;
574  setBookIndex(-1) ;
575  setBookPrefix("h") ;
578 
579  // mc truth collections sizes
580  h1_mcNum = bookH1withSumw2(iBooker, "mcNum","# mc particles",fhits_nbin,0.,fhits_max,"N_{gen}" );
581  h1_eleNum = bookH1withSumw2(iBooker, "mcNum_ele","# mc electrons",fhits_nbin,0.,fhits_max,"N_{gen ele}");
582  h1_gamNum = bookH1withSumw2(iBooker, "mcNum_gam","# mc gammas",fhits_nbin,0.,fhits_max,"N_{gen #gamma}");
583 
584  // rec event collections sizes
585  h1_recEleNum = bookH1(iBooker, "recEleNum","# rec electrons",11, -0.5,10.5,"N_{ele}");
586  h1_recCoreNum = bookH1(iBooker, "recCoreNum","# rec electron cores",21, -0.5,20.5,"N_{core}");
587  h1_recTrackNum = bookH1(iBooker, "recTrackNum","# rec gsf tracks",41, -0.5,40.5,"N_{track}");
588  h1_recSeedNum = bookH1(iBooker, "recSeedNum","# rec electron seeds",101, -0.5,100.5,"N_{seed}");
589  h1_recOfflineVertices = bookH1(iBooker, "recOfflineVertices","# rec Offline Primary Vertices",61, -0.5,60.5,"N_{Vertices}");
590  h2_scl_EoEtrueVsrecOfflineVertices = bookH2(iBooker, "scl_EoEtrueVsrecOfflineVertices", "E/Etrue vs number of primary vertices", 10, 0., 50., 50, 0., 2.5, "N_{primary vertices}", "E/E_{true}");
591  h2_scl_EoEtrueVsrecOfflineVertices_barrel = bookH2(iBooker, "scl_EoEtrueVsrecOfflineVertices_barrel", "E/Etrue vs number of primary , barrel", 10, 0., 50., 50, 0., 2.5, "N_{primary vertices}", "E/E_{true}");
592  h2_scl_EoEtrueVsrecOfflineVertices_endcaps = bookH2(iBooker, "scl_EoEtrueVsrecOfflineVertices_endcaps", "E/Etrue vs number of primary , endcaps", 10, 0., 50., 50, 0., 2.5, "N_{primary vertices}", "E/E_{true}");
593 
594  // mc
595  setBookPrefix("h_mc") ;
596  h1_mc_Eta = bookH1withSumw2(iBooker, "Eta","gen #eta",eta_nbin,eta_min,eta_max,"#eta");
597  h1_mc_AbsEta = bookH1withSumw2(iBooker, "AbsEta","gen |#eta|",eta_nbin/2,0.,eta_max);
598  h1_mc_P = bookH1withSumw2(iBooker, "P","gen p",p_nbin,0.,p_max,"p (GeV/c)");
599  h1_mc_Pt = bookH1withSumw2(iBooker, "Pt","gen pt",pteff_nbin,5.,pt_max);
600  h1_mc_Phi = bookH1withSumw2(iBooker, "Phi","gen phi",phi_nbin,phi_min,phi_max);
601  h1_mc_Z = bookH1withSumw2(iBooker, "Z","gen z ",xyz_nbin, -25, 25 );
602  h2_mc_PtEta = bookH2withSumw2(iBooker, "PtEta","gen pt vs #eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,5.,pt_max );
603 
604  // all electrons
605  setBookPrefix("h_ele") ;
606  h1_ele_EoverP_all = bookH1withSumw2(iBooker, "EoverP_all","ele E/P_{vertex}, all reco electrons",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
607  h1_ele_EoverP_all_barrel = bookH1withSumw2(iBooker, "EoverP_all_barrel","ele E/P_{vertex}, all reco electrons, barrel",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
608  h1_ele_EoverP_all_endcaps = bookH1withSumw2(iBooker, "EoverP_all_endcaps","ele E/P_{vertex}, all reco electrons, endcaps",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
609  h1_ele_EseedOP_all = bookH1withSumw2(iBooker, "EseedOP_all","ele E_{seed}/P_{vertex}, all reco electrons",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
610  h1_ele_EseedOP_all_barrel = bookH1withSumw2(iBooker, "EseedOP_all_barrel","ele E_{seed}/P_{vertex}, all reco electrons, barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
611  h1_ele_EseedOP_all_endcaps = bookH1withSumw2(iBooker, "EseedOP_all_endcaps","ele E_{seed}/P_{vertex}, all reco electrons, endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
612  h1_ele_EoPout_all = bookH1withSumw2(iBooker, "EoPout_all","ele E_{seed}/P_{out}, all reco electrons",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
613  h1_ele_EoPout_all_barrel = bookH1withSumw2(iBooker, "EoPout_all_barrel","ele E_{seed}/P_{out}, all reco electrons barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
614  h1_ele_EoPout_all_endcaps = bookH1withSumw2(iBooker, "EoPout_all_endcaps","ele E_{seed}/P_{out}, all reco electrons endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
615  h1_ele_EeleOPout_all = bookH1withSumw2(iBooker, "EeleOPout_all","ele E_{ele}/P_{out}, all reco electrons",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
616  h1_ele_EeleOPout_all_barrel = bookH1withSumw2(iBooker, "EeleOPout_all_barrel","ele E_{ele}/P_{out}, all reco electrons barrel",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
617  h1_ele_EeleOPout_all_endcaps = bookH1withSumw2(iBooker, "EeleOPout_all_endcaps","ele E_{ele}/P_{out}, all reco electrons endcaps",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
618  h1_ele_dEtaSc_propVtx_all = bookH1withSumw2(iBooker, "dEtaSc_propVtx_all","ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
619  h1_ele_dEtaSc_propVtx_all_barrel = bookH1withSumw2(iBooker, "dEtaSc_propVtx_all_barrel","ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
620  h1_ele_dEtaSc_propVtx_all_endcaps = bookH1withSumw2(iBooker, "dEtaSc_propVtx_all_endcaps","ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
621  h1_ele_dPhiSc_propVtx_all = bookH1withSumw2(iBooker, "dPhiSc_propVtx_all","ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
622  h1_ele_dPhiSc_propVtx_all_barrel = bookH1withSumw2(iBooker, "dPhiSc_propVtx_all_barrel","ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
623  h1_ele_dPhiSc_propVtx_all_endcaps = bookH1withSumw2(iBooker, "dPhiSc_propVtx_all_endcaps","ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
624  h1_ele_dEtaCl_propOut_all = bookH1withSumw2(iBooker, "dEtaCl_propOut_all","ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
625  h1_ele_dEtaCl_propOut_all_barrel = bookH1withSumw2(iBooker, "dEtaCl_propOut_all_barrel","ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
626  h1_ele_dEtaCl_propOut_all_endcaps = bookH1withSumw2(iBooker, "dEtaCl_propOut_all_endcaps","ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
627  h1_ele_dPhiCl_propOut_all = bookH1withSumw2(iBooker, "dPhiCl_propOut_all","ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
628  h1_ele_dPhiCl_propOut_all_barrel = bookH1withSumw2(iBooker, "dPhiCl_propOut_all_barrel","ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
629  h1_ele_dPhiCl_propOut_all_endcaps = bookH1withSumw2(iBooker, "dPhiCl_propOut_all_endcaps","ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
630  h1_ele_HoE_all = bookH1withSumw2(iBooker, "HoE_all","ele hadronic energy / em energy, all reco electrons",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
631  h1_ele_HoE_all_barrel = bookH1withSumw2(iBooker, "HoE_all_barrel","ele hadronic energy / em energy, all reco electrons barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
632  h1_ele_HoE_all_endcaps = bookH1withSumw2(iBooker, "HoE_all_endcaps","ele hadronic energy / em energy, all reco electrons endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
633  h1_ele_HoE_bc_all = bookH1withSumw2(iBooker, "HoE_bc_all","ele hadronic energy / em energy, all reco electrons, behind cluster",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
634  h1_ele_vertexPt_all = bookH1withSumw2(iBooker, "vertexPt_all","ele p_{T}, all reco electrons",pteff_nbin,5.,pt_max,"","Events","ELE_LOGY E1 P");
635  h1_ele_Et_all = bookH1withSumw2(iBooker, "Et_all","ele ecal E_{T}, all reco electrons",pteff_nbin,5.,pt_max,"E_{T} (GeV)","Events","ELE_LOGY E1 P");
636  h1_ele_vertexEta_all = bookH1withSumw2(iBooker, "vertexEta_all","ele eta, all reco electrons",eta_nbin,eta_min,eta_max,"","Events","ELE_LOGY E1 P");
637  h1_ele_TIP_all = bookH1withSumw2(iBooker, "TIP_all","ele vertex transverse radius, all reco electrons", 100,0.,0.2,"r_{T} (cm)","Events","ELE_LOGY E1 P");
638  h1_ele_TIP_all_barrel = bookH1withSumw2(iBooker, "TIP_all_barrel","ele vertex transverse radius, all reco electrons barrel", 100,0.,0.2,"r_{T} (cm)","Events","ELE_LOGY E1 P");
639  h1_ele_TIP_all_endcaps = bookH1withSumw2(iBooker, "TIP_all_endcaps","ele vertex transverse radius, all reco electrons endcaps", 100,0.,0.2,"r_{T} (cm)","Events","ELE_LOGY E1 P");
640  h1_ele_mee_all = bookH1withSumw2(iBooker, "mee_all","ele pairs invariant mass, all reco electrons",mee_nbin, mee_min, mee_max,"m_{ee} (GeV/c^{2})","Events","ELE_LOGY E1 P");
641  h1_ele_mee_os = bookH1withSumw2(iBooker, "mee_os","ele pairs invariant mass, opp. sign",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
642  h1_ele_mee_os_ebeb = bookH1withSumw2(iBooker, "mee_os_ebeb","ele pairs invariant mass, opp. sign, EB-EB",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
643  h1_ele_mee_os_ebee = bookH1withSumw2(iBooker, "mee_os_ebee","ele pairs invariant mass, opp. sign, EB-EE",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
644  h1_ele_mee_os_eeee = bookH1withSumw2(iBooker, "mee_os_eeee","ele pairs invariant mass, opp. sign, EE-EE",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
645  h1_ele_mee_os_gg = bookH1withSumw2(iBooker, "mee_os_gg","ele pairs invariant mass, opp. sign, good-good",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
646  h1_ele_mee_os_gb = bookH1withSumw2(iBooker, "mee_os_gb","ele pairs invariant mass, opp. sign, good-bad",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
647  h1_ele_mee_os_bb = bookH1withSumw2(iBooker, "mee_os_bb","ele pairs invariant mass, opp. sign, bad-bad",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
648 
649  // duplicates
650  h2_ele_E2mnE1vsMee_all = bookH2(iBooker, "E2mnE1vsMee_all","E2 - E1 vs ele pairs invariant mass, all electrons",mee_nbin, mee_min, mee_max, 100, -50., 50.,"m_{e^{+}e^{-}} (GeV/c^{2})","E2 - E1 (GeV)");
651  h2_ele_E2mnE1vsMee_egeg_all = bookH2(iBooker, "E2mnE1vsMee_egeg_all","E2 - E1 vs ele pairs invariant mass, ecal driven pairs, all electrons",mee_nbin, mee_min, mee_max, 100, -50., 50.,"m_{e^{+}e^{-}} (GeV/c^{2})","E2 - E1 (GeV)");
652 
653  // charge ID
654  h1_ele_ChargeMnChargeTrue = bookH1withSumw2(iBooker, "ChargeMnChargeTrue","ele charge - gen charge ",5,-1.,4.,"q_{rec} - q_{gen}");
655  setBookPrefix("h_mc") ;
656  h1_mc_Eta_matched_qmisid = bookH1withSumw2(iBooker, "Eta_matched_qmisid","charge misid vs gen eta",eta_nbin,eta_min,eta_max);
657  h1_mc_AbsEta_matched_qmisid = bookH1withSumw2(iBooker, "AbsEta_matched_qmisid","charge misid vs gen |eta|",eta_nbin/2,0.,eta_max);
658  h1_mc_Pt_matched_qmisid = bookH1withSumw2(iBooker, "Pt_matched_qmisid","charge misid vs gen transverse momentum",pteff_nbin,5.,pt_max);
659  h1_mc_Phi_matched_qmisid = bookH1withSumw2(iBooker, "Phi_matched_qmisid","charge misid vs gen phi",phi_nbin,phi_min,phi_max);
660  h1_mc_Z_matched_qmisid = bookH1withSumw2(iBooker, "Z_matched_qmisid","charge misid vs gen z",xyz_nbin, -25, 25 );
661 
662  // matched electrons
663  setBookPrefix("h_mc") ;
664  h1_mc_Eta_matched = bookH1withSumw2(iBooker, "Eta_matched","Efficiency vs gen eta",eta_nbin,eta_min,eta_max);
665  h1_mc_AbsEta_matched = bookH1withSumw2(iBooker, "AbsEta_matched","Efficiency vs gen |eta|",eta_nbin/2,0.,2.5);
666  h1_mc_Pt_matched = bookH1(iBooker, "Pt_matched","Efficiency vs gen transverse momentum",pteff_nbin,5.,pt_max);
667  h1_mc_Phi_matched = bookH1withSumw2(iBooker, "Phi_matched","Efficiency vs gen phi",phi_nbin,phi_min,phi_max);
668  h1_mc_Z_matched = bookH1withSumw2(iBooker, "Z_matched","Efficiency vs gen vertex z",xyz_nbin,-25,25);
669  h2_mc_PtEta_matched = bookH2withSumw2(iBooker, "PtEta_matched","Efficiency vs pt #eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,5.,pt_max );
670  setBookPrefix("h_ele") ;
671  h1_ele_charge = bookH1withSumw2(iBooker, "charge","ele charge",5,-2.5,2.5,"charge");
672  h2_ele_chargeVsEta = bookH2(iBooker, "chargeVsEta","ele charge vs eta",eta2D_nbin,eta_min,eta_max,5,-2.,2.);
673  h2_ele_chargeVsPhi = bookH2(iBooker, "chargeVsPhi","ele charge vs phi",phi2D_nbin,phi_min,phi_max,5,-2.,2.);
674  h2_ele_chargeVsPt = bookH2(iBooker, "chargeVsPt","ele charge vs pt",pt_nbin,0.,100.,5,-2.,2.);
675  h1_ele_vertexP = bookH1withSumw2(iBooker, "vertexP","ele momentum",p_nbin,0.,p_max,"p_{vertex} (GeV/c)");
676  h1_ele_vertexPt = bookH1withSumw2(iBooker, "vertexPt","ele transverse momentum",pt_nbin,0.,pt_max,"p_{T vertex} (GeV/c)");
677  h1_ele_vertexPt_nocut = bookH1withSumw2(iBooker, "vertexPt_nocut","pT of prunned electrons",pt_nbin,0.,pt_max,"p_{T vertex} (GeV/c)");
678  h1_ele_Et = bookH1withSumw2(iBooker, "Et","ele ecal E_{T}",pt_nbin,0.,pt_max,"E_{T} (GeV)");
679  h2_ele_vertexPtVsEta = bookH2(iBooker, "vertexPtVsEta","ele transverse momentum vs eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,0.,pt_max);
680  h2_ele_vertexPtVsPhi = bookH2(iBooker, "vertexPtVsPhi","ele transverse momentum vs phi",phi2D_nbin,phi_min,phi_max,pt2D_nbin,0.,pt_max);
681  h1_ele_vertexEta = bookH1withSumw2(iBooker, "vertexEta","ele momentum eta",eta_nbin,eta_min,eta_max,"#eta");
682  h2_ele_vertexEtaVsPhi = bookH2(iBooker, "vertexEtaVsPhi","ele momentum eta vs phi",eta2D_nbin,eta_min,eta_max,phi2D_nbin,phi_min,phi_max );
683  h1_ele_vertexPhi = bookH1withSumw2(iBooker, "vertexPhi","ele momentum #phi",phi_nbin,phi_min,phi_max,"#phi (rad)");
684  h1_ele_vertexX = bookH1withSumw2(iBooker, "vertexX","ele vertex x",xyz_nbin,-0.6,0.6,"x (cm)" );
685  h1_ele_vertexY = bookH1withSumw2(iBooker, "vertexY","ele vertex y",xyz_nbin,-0.6,0.6,"y (cm)" );
686  h1_ele_vertexZ = bookH1withSumw2(iBooker, "vertexZ","ele vertex z",xyz_nbin,-25, 25,"z (cm)" );
687  h1_ele_vertexTIP = bookH1withSumw2(iBooker, "vertexTIP","ele transverse impact parameter (wrt gen vtx)",90,0.,0.15,"TIP (cm)");
688  h2_ele_vertexTIPVsEta = bookH2(iBooker, "vertexTIPVsEta","ele transverse impact parameter (wrt gen vtx) vs eta",eta2D_nbin,eta_min,eta_max,45,0.,0.15,"#eta","TIP (cm)");
689  h2_ele_vertexTIPVsPhi = bookH2(iBooker, "vertexTIPVsPhi","ele transverse impact parameter (wrt gen vtx) vs phi",phi2D_nbin,phi_min,phi_max,45,0.,0.15,"#phi (rad)","TIP (cm)");
690  h2_ele_vertexTIPVsPt = bookH2(iBooker, "vertexTIPVsPt","ele transverse impact parameter (wrt gen vtx) vs transverse momentum",pt2D_nbin,0.,pt_max,45,0.,0.15,"p_{T} (GeV/c)","TIP (cm)");
691  h1_ele_PoPtrue = bookH1withSumw2(iBooker, "PoPtrue","ele momentum / gen momentum",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
692  h1_ele_PoPtrue_barrel = bookH1withSumw2(iBooker, "PoPtrue_barrel","ele momentum / gen momentum, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
693  h1_ele_PoPtrue_endcaps = bookH1withSumw2(iBooker, "PoPtrue_endcaps","ele momentum / gen momentum, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
694  h2_ele_PoPtrueVsEta = bookH2withSumw2(iBooker, "PoPtrueVsEta","ele momentum / gen momentum vs eta",eta2D_nbin,eta_min,eta_max,50,poptrue_min,poptrue_max);
695  h2_ele_PoPtrueVsPhi = bookH2(iBooker, "PoPtrueVsPhi","ele momentum / gen momentum vs phi",phi2D_nbin,phi_min,phi_max,50,poptrue_min,poptrue_max);
696  h2_ele_PoPtrueVsPt = bookH2(iBooker, "PoPtrueVsPt","ele momentum / gen momentum vs eta",pt2D_nbin,0.,pt_max,50,poptrue_min,poptrue_max);
697 // h2_ele_sigmaIetaIetaVsPt = bookH2(iBooker,"sigmaIetaIetaVsPt","SigmaIetaIeta vs pt",pt_nbin,0.,pt_max,100,0.,0.05);
698  h2_ele_sigmaIetaIetaVsPt = bookH2(iBooker,"sigmaIetaIetaVsPt","SigmaIetaIeta vs pt",100,0.,pt_max,100,0.,0.05);
699  h1_ele_PoPtrue_golden_barrel = bookH1withSumw2(iBooker, "PoPtrue_golden_barrel","ele momentum / gen momentum, golden, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
700  h1_ele_PoPtrue_golden_endcaps = bookH1withSumw2(iBooker, "PoPtrue_golden_endcaps","ele momentum / gen momentum, golden, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
701  h1_ele_PoPtrue_showering_barrel = bookH1withSumw2(iBooker, "PoPtrue_showering_barrel","ele momentum / gen momentum, showering, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
702  h1_ele_PoPtrue_showering_endcaps = bookH1withSumw2(iBooker, "PoPtrue_showering_endcaps","ele momentum / gen momentum, showering, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
703  h1_ele_PtoPttrue = bookH1withSumw2(iBooker, "PtoPttrue","ele transverse momentum / gen transverse momentum",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
704  h1_ele_PtoPttrue_barrel = bookH1withSumw2(iBooker, "PtoPttrue_barrel","ele transverse momentum / gen transverse momentum, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
705  h1_ele_PtoPttrue_endcaps = bookH1withSumw2(iBooker, "PtoPttrue_endcaps","ele transverse momentum / gen transverse momentum, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
706  h1_ele_EtaMnEtaTrue = bookH1withSumw2(iBooker, "EtaMnEtaTrue","ele momentum eta - gen eta",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
707  h1_ele_EtaMnEtaTrue_barrel = bookH1withSumw2(iBooker, "EtaMnEtaTrue_barrel","ele momentum eta - gen eta barrel",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
708  h1_ele_EtaMnEtaTrue_endcaps = bookH1withSumw2(iBooker, "EtaMnEtaTrue_endcaps","ele momentum eta - gen eta endcaps",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
709  h2_ele_EtaMnEtaTrueVsEta = bookH2(iBooker, "EtaMnEtaTrueVsEta","ele momentum eta - gen eta vs eta",eta2D_nbin,eta_min,eta_max,deta_nbin/2,deta_min,deta_max);
710  h2_ele_EtaMnEtaTrueVsPhi = bookH2(iBooker, "EtaMnEtaTrueVsPhi","ele momentum eta - gen eta vs phi",phi2D_nbin,phi_min,phi_max,deta_nbin/2,deta_min,deta_max);
711  h2_ele_EtaMnEtaTrueVsPt = bookH2(iBooker, "EtaMnEtaTrueVsPt","ele momentum eta - gen eta vs pt",pt_nbin,0.,pt_max,deta_nbin/2,deta_min,deta_max);
712  h1_ele_PhiMnPhiTrue = bookH1withSumw2(iBooker, "PhiMnPhiTrue","ele momentum phi - gen phi",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
713  h1_ele_PhiMnPhiTrue_barrel = bookH1withSumw2(iBooker, "PhiMnPhiTrue_barrel","ele momentum phi - gen phi barrel",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
714  h1_ele_PhiMnPhiTrue_endcaps = bookH1withSumw2(iBooker, "PhiMnPhiTrue_endcaps","ele momentum phi - gen phi endcaps",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
715  h1_ele_PhiMnPhiTrue2 = bookH1(iBooker, "PhiMnPhiTrue2","ele momentum phi - gen phi",dphimatch2D_nbin,dphimatch_min,dphimatch_max);
716  h2_ele_PhiMnPhiTrueVsEta = bookH2(iBooker, "PhiMnPhiTrueVsEta","ele momentum phi - gen phi vs eta",eta2D_nbin,eta_min,eta_max,dphi_nbin/2,dphi_min,dphi_max);
717  h2_ele_PhiMnPhiTrueVsPhi = bookH2(iBooker, "PhiMnPhiTrueVsPhi","ele momentum phi - gen phi vs phi",phi2D_nbin,phi_min,phi_max,dphi_nbin/2,dphi_min,dphi_max);
718  h2_ele_PhiMnPhiTrueVsPt = bookH2(iBooker, "PhiMnPhiTrueVsPt","ele momentum phi - gen phi vs pt",pt2D_nbin,0.,pt_max,dphi_nbin/2,dphi_min,dphi_max);
719  h1_ele_ecalEnergyError = bookH1withSumw2(iBooker, "ecalEnergyError","Regression estimate of the ECAL energy error",error_nbin,0,enerror_max);
720  h1_ele_ecalEnergyError_barrel = bookH1withSumw2(iBooker, "ecalEnergyError_barrel","Regression estimate of the ECAL energy error - barrel",30,0,30);
721  h1_ele_ecalEnergyError_endcaps = bookH1withSumw2(iBooker, "ecalEnergyError_endcaps","Regression estimate of the ECAL energy error - endcaps",error_nbin,0,enerror_max);
722  h1_ele_combinedP4Error = bookH1withSumw2(iBooker, "combinedP4Error","Estimated error on the combined momentum",error_nbin,0,enerror_max);
723  h1_ele_combinedP4Error_barrel = bookH1withSumw2(iBooker, "combinedP4Error_barrel","Estimated error on the combined momentum - barrel",30,0,30);
724  h1_ele_combinedP4Error_endcaps = bookH1withSumw2(iBooker, "combinedP4Error_endcaps","Estimated error on the combined momentum - endcaps",error_nbin,0,enerror_max);
725 
726  // matched electron, superclusters
727  setBookPrefix("h_scl") ;
728  h1_scl_En = bookH1withSumw2(iBooker, "energy","ele ecal energy",p_nbin,0.,p_max);
729  h1_scl_EoEtrue_barrel = bookH1withSumw2(iBooker, "EoEtrue_barrel","ele ecal energy / gen energy, barrel",50,0.2,1.2,"E/E_{gen}");
730  h1_scl_EoEtrue_barrel_etagap = bookH1withSumw2(iBooker, "EoEtrue_barrel_etagap","ele ecal energy / gen energy, barrel, etagap",50,0.2,1.2,"E/E_{gen}");
731  h1_scl_EoEtrue_barrel_phigap = bookH1withSumw2(iBooker, "EoEtrue_barrel_phigap","ele ecal energy / gen energy, barrel, phigap",50,0.2,1.2,"E/E_{gen}");
732  h1_scl_EoEtrue_ebeegap = bookH1withSumw2(iBooker, "EoEtrue_ebeegap","ele ecal energy / gen energy, ebeegap",50,0.2,1.2,"E/E_{gen}");
733  h1_scl_EoEtrue_endcaps = bookH1withSumw2(iBooker, "EoEtrue_endcaps","ele ecal energy / gen energy, endcaps",50,0.2,1.2,"E/E_{gen}");
734  h1_scl_EoEtrue_endcaps_deegap = bookH1withSumw2(iBooker, "EoEtrue_endcaps_deegap","ele ecal energy / gen energy, endcaps, deegap",50,0.2,1.2,"E/E_{gen}");
735  h1_scl_EoEtrue_endcaps_ringgap = bookH1withSumw2(iBooker, "EoEtrue_endcaps_ringgap","ele ecal energy / gen energy, endcaps, ringgap",50,0.2,1.2,"E/E_{gen}");
736  h1_scl_EoEtrue_barrel_new = bookH1withSumw2(iBooker, "EoEtrue_barrel_new","ele ecal energy / gen energy, barrel",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
737  h1_scl_EoEtrue_barrel_new_etagap = bookH1withSumw2(iBooker, "EoEtrue_barrel_new_etagap","ele ecal energy / gen energy, barrel, etagap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
738  h1_scl_EoEtrue_barrel_new_phigap = bookH1withSumw2(iBooker, "EoEtrue_barrel_new_phigap","ele ecal energy / gen energy, barrel, phigap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
739  h1_scl_EoEtrue_ebeegap_new = bookH1withSumw2(iBooker, "EoEtrue_ebeegap_new","ele ecal energy / gen energy, ebeegap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
740  h1_scl_EoEtrue_endcaps_new = bookH1withSumw2(iBooker, "EoEtrue_endcaps_new","ele ecal energy / gen energy, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
741  h1_scl_EoEtrue_endcaps_new_deegap = bookH1withSumw2(iBooker, "EoEtrue_endcaps_new_deegap","ele ecal energy / gen energy, endcaps, deegap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
742  h1_scl_EoEtrue_endcaps_new_ringgap = bookH1withSumw2(iBooker, "EoEtrue_endcaps_new_ringgap","ele ecal energy / gen energy, endcaps, ringgap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
743  h1_scl_Et = bookH1withSumw2(iBooker, "et","ele supercluster transverse energy",pt_nbin,0.,pt_max);
744  h2_scl_EtVsEta = bookH2(iBooker, "etVsEta","ele supercluster transverse energy vs eta",eta2D_nbin,eta_min,eta_max,pt_nbin,0.,pt_max);
745  h2_scl_EtVsPhi = bookH2(iBooker, "etVsPhi","ele supercluster transverse energy vs phi",phi2D_nbin,phi_min,phi_max,pt_nbin,0.,pt_max);
746  h2_scl_EtaVsPhi = bookH2(iBooker, "etaVsPhi","ele supercluster eta vs phi",phi2D_nbin,phi_min,phi_max,eta2D_nbin,eta_min,eta_max);
747  h1_scl_Eta = bookH1withSumw2(iBooker, "eta","ele supercluster eta",eta_nbin,eta_min,eta_max);
748  h1_scl_Phi = bookH1withSumw2(iBooker, "phi","ele supercluster phi",phi_nbin,phi_min,phi_max);
749  h1_scl_SigEtaEta = bookH1withSumw2(iBooker, "sigetaeta","ele supercluster sigma eta eta",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
750  h1_scl_SigEtaEta_barrel = bookH1withSumw2(iBooker, "sigetaeta_barrel","ele supercluster sigma eta eta barrel",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
751  h1_scl_SigEtaEta_endcaps = bookH1withSumw2(iBooker, "sigetaeta_endcaps","ele supercluster sigma eta eta endcaps",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
752  h1_scl_SigIEtaIEta = bookH1withSumw2(iBooker, "sigietaieta","ele supercluster sigma ieta ieta",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
753  h1_scl_SigIEtaIEta_barrel = bookH1withSumw2(iBooker, "sigietaieta_barrel","ele supercluster sigma ieta ieta, barrel",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
754  h1_scl_SigIEtaIEta_endcaps = bookH1withSumw2(iBooker, "sigietaieta_endcaps","ele supercluster sigma ieta ieta, endcaps",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
755  h1_scl_SigIEtaIEta_mAOD = bookH1withSumw2(iBooker, "SigIEtaIEta_mAOD","ele supercluster sigma ieta ieta",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
756  h1_scl_SigIEtaIEta_mAOD_barrel = bookH1withSumw2(iBooker, "SigIEtaIEta_mAOD_barrel","ele supercluster sigma ieta ieta, barrel",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
757  h1_scl_SigIEtaIEta_mAOD_endcaps = bookH1withSumw2(iBooker, "SigIEtaIEta_mAOD_endcaps","ele supercluster sigma ieta ieta, endcaps",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
758  h1_scl_full5x5_sigmaIetaIeta = bookH1withSumw2(iBooker, "full5x5_sigietaieta","ele supercluster full5x5 sigma ieta ieta",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
759  h1_scl_full5x5_sigmaIetaIeta_barrel = bookH1withSumw2(iBooker, "full5x5_sigietaieta_barrel","ele supercluster full5x5 sigma ieta ieta, barrel",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
760  h1_scl_full5x5_sigmaIetaIeta_endcaps = bookH1withSumw2(iBooker, "full5x5_sigietaieta_endcaps","ele supercluster full5x5 sigma ieta ieta, endcaps",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
761  h1_scl_E1x5 = bookH1withSumw2(iBooker, "E1x5","ele supercluster energy in 1x5",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
762  h1_scl_E1x5_barrel = bookH1withSumw2(iBooker, "E1x5_barrel","ele supercluster energy in 1x5 barrel",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
763  h1_scl_E1x5_endcaps = bookH1withSumw2(iBooker, "E1x5_endcaps","ele supercluster energy in 1x5 endcaps",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
764  h1_scl_E2x5max = bookH1withSumw2(iBooker, "E2x5max","ele supercluster energy in 2x5 max",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
765  h1_scl_E2x5max_barrel = bookH1withSumw2(iBooker, "E2x5max_barrel","ele supercluster energy in 2x5 _max barrel",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
766  h1_scl_E2x5max_endcaps = bookH1withSumw2(iBooker, "E2x5max_endcaps","ele supercluster energy in 2x5 _max endcaps",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
767  h1_scl_E5x5 = bookH1withSumw2(iBooker, "E5x5","ele supercluster energy in 5x5",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
768  h1_scl_E5x5_barrel = bookH1withSumw2(iBooker, "E5x5_barrel","ele supercluster energy in 5x5 barrel",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
769  h1_scl_E5x5_endcaps = bookH1withSumw2(iBooker, "E5x5_endcaps","ele supercluster energy in 5x5 endcaps",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
770  h2_scl_EoEtruePfVsEg = bookH2(iBooker, "EoEtruePfVsEg","mean mustache SC/true energy vs final SC/true energy",75,-0.1,1.4, 75, -0.1, 1.4,"E_{final SC}/E_{gen}","E_{mustache}/E_{gen}") ;
771  h1_scl_bcl_EtotoEtrue = bookH1withSumw2(iBooker, "bcl_EtotoEtrue","Total basicclusters energy",50,0.2,1.2,"E/E_{gen}");
772  h1_scl_bcl_EtotoEtrue_barrel = bookH1withSumw2(iBooker, "bcl_EtotoEtrue_barrel","Total basicclusters energy , barrel",50,0.2,1.2,"E/E_{gen}");
773  h1_scl_bcl_EtotoEtrue_endcaps = bookH1withSumw2(iBooker, "bcl_EtotoEtrue_endcaps","Total basicclusters energy , endcaps",50,0.2,1.2,"E/E_{gen}");
774 // h1_scl_ESFrac = bookH1withSumw2(iBooker, "ESFrac","Preshower over SC raw energy",100,0.,0.8,"E_{PS} / E^{raw}_{SC}","Events","ELE_LOGY E1 P");
775  h1_scl_ESFrac_endcaps = bookH1withSumw2(iBooker, "ESFrac_endcaps","Preshower over SC raw energy , endcaps",100,0.,0.8,"E_{PS} / E^{raw}_{SC}","Events","ELE_LOGY E1 P");
776 
777  // matched electron, gsf tracks
778  setBookPrefix("h_ele") ;
779  h1_ele_ambiguousTracks = bookH1withSumw2(iBooker, "ambiguousTracks","ele # ambiguous tracks", 5,0.,5.,"N_{ambiguous tracks}","Events","ELE_LOGY E1 P");
780  h2_ele_ambiguousTracksVsEta = bookH2(iBooker, "ambiguousTracksVsEta","ele # ambiguous tracks vs eta",eta2D_nbin,eta_min,eta_max,5,0.,5.);
781  h2_ele_ambiguousTracksVsPhi = bookH2(iBooker, "ambiguousTracksVsPhi","ele # ambiguous tracks vs phi",phi2D_nbin,phi_min,phi_max,5,0.,5.);
782  h2_ele_ambiguousTracksVsPt = bookH2(iBooker, "ambiguousTracksVsPt","ele # ambiguous tracks vs pt",pt2D_nbin,0.,pt_max,5,0.,5.);
783  h1_ele_foundHits = bookH1withSumw2(iBooker, "foundHits","ele track # found hits",fhits_nbin,0.,fhits_max,"N_{hits}");
784  h1_ele_foundHits_barrel = bookH1withSumw2(iBooker, "foundHits_barrel","ele track # found hits, barrel",fhits_nbin,0.,fhits_max,"N_{hits}");
785  h1_ele_foundHits_endcaps = bookH1withSumw2(iBooker, "foundHits_endcaps","ele track # found hits, endcaps",fhits_nbin,0.,fhits_max,"N_{hits}");
786  h2_ele_foundHitsVsEta = bookH2(iBooker, "foundHitsVsEta","ele track # found hits vs eta",eta2D_nbin,eta_min,eta_max,fhits_nbin,0.,fhits_max);
787  h2_ele_foundHitsVsEta_mAOD = bookH2(iBooker, "foundHitsVsEta_mAOD","ele track # found hits vs eta",eta2D_nbin,eta_min,eta_max,fhits_nbin,0.,fhits_max);
788  h2_ele_foundHitsVsPhi = bookH2(iBooker, "foundHitsVsPhi","ele track # found hits vs phi",phi2D_nbin,phi_min,phi_max,fhits_nbin,0.,fhits_max);
789  h2_ele_foundHitsVsPt = bookH2(iBooker, "foundHitsVsPt","ele track # found hits vs pt",pt2D_nbin,0.,pt_max,fhits_nbin,0.,fhits_max);
790  h1_ele_lostHits = bookH1withSumw2(iBooker, "lostHits","ele track # lost hits", 5,0.,5.,"N_{lost hits}");
791  h1_ele_lostHits_barrel = bookH1withSumw2(iBooker, "lostHits_barrel","ele track # lost hits, barrel", 5,0.,5.,"N_{lost hits}");
792  h1_ele_lostHits_endcaps = bookH1withSumw2(iBooker, "lostHits_endcaps","ele track # lost hits, endcaps", 5,0.,5.,"N_{lost hits}");
793  h2_ele_lostHitsVsEta = bookH2(iBooker, "lostHitsVsEta","ele track # lost hits vs eta",eta2D_nbin,eta_min,eta_max,lhits_nbin,0.,lhits_max);
794  h2_ele_lostHitsVsPhi = bookH2(iBooker, "lostHitsVsPhi","ele track # lost hits vs eta",phi2D_nbin,phi_min,phi_max,lhits_nbin,0.,lhits_max);
795  h2_ele_lostHitsVsPt = bookH2(iBooker, "lostHitsVsPt","ele track # lost hits vs eta",pt2D_nbin,0.,pt_max,lhits_nbin,0.,lhits_max);
796  h1_ele_chi2 = bookH1withSumw2(iBooker, "chi2","ele track #chi^{2}",100,0.,15.,"#Chi^{2}","Events","ELE_LOGY E1 P");
797  h1_ele_chi2_barrel = bookH1withSumw2(iBooker, "chi2_barrel","ele track #chi^{2}, barrel",100,0.,15.,"#Chi^{2}","Events","ELE_LOGY E1 P");
798  h1_ele_chi2_endcaps = bookH1withSumw2(iBooker, "chi2_endcaps","ele track #chi^{2}, endcaps",100,0.,15.,"#Chi^{2}","Events","ELE_LOGY E1 P");
799  h2_ele_chi2VsEta = bookH2(iBooker, "chi2VsEta","ele track #chi^{2} vs eta",eta2D_nbin,eta_min,eta_max,50,0.,15.);
800  h2_ele_chi2VsPhi = bookH2(iBooker, "chi2VsPhi","ele track #chi^{2} vs phi",phi2D_nbin,phi_min,phi_max,50,0.,15.);
801  h2_ele_chi2VsPt = bookH2(iBooker, "chi2VsPt","ele track #chi^{2} vs pt",pt2D_nbin,0.,pt_max,50,0.,15.);
802  h1_ele_PinMnPout = bookH1withSumw2(iBooker, "PinMnPout","ele track inner p - outer p, mean of GSF components" ,p_nbin,0.,200.,"P_{vertex} - P_{out} (GeV/c)");
803  h1_ele_PinMnPout_mode = bookH1withSumw2(iBooker, "PinMnPout_mode","ele track inner p - outer p, mode of GSF components" ,p_nbin,0.,100.,"P_{vertex} - P_{out}, mode of GSF components (GeV/c)");
804  h2_ele_PinMnPoutVsEta_mode = bookH2(iBooker, "PinMnPoutVsEta_mode","ele track inner p - outer p vs eta, mode of GSF components" ,eta2D_nbin, eta_min,eta_max,p2D_nbin,0.,100.);
805  h2_ele_PinMnPoutVsPhi_mode = bookH2(iBooker, "PinMnPoutVsPhi_mode","ele track inner p - outer p vs phi, mode of GSF components" ,phi2D_nbin, phi_min,phi_max,p2D_nbin,0.,100.);
806  h2_ele_PinMnPoutVsPt_mode = bookH2(iBooker, "PinMnPoutVsPt_mode","ele track inner p - outer p vs pt, mode of GSF components" ,pt2D_nbin, 0.,pt_max,p2D_nbin,0.,100.);
807  h2_ele_PinMnPoutVsE_mode = bookH2(iBooker, "PinMnPoutVsE_mode","ele track inner p - outer p vs E, mode of GSF components" ,p2D_nbin, 0.,200.,p2D_nbin,0.,100.);
808  h2_ele_PinMnPoutVsChi2_mode = bookH2(iBooker, "PinMnPoutVsChi2_mode","ele track inner p - outer p vs track chi2, mode of GSF components" ,50, 0.,20.,p2D_nbin,0.,100.);
809  h1_ele_outerP = bookH1withSumw2(iBooker, "outerP","ele track outer p, mean of GSF components",p_nbin,0.,p_max,"P_{out} (GeV/c)");
810  h1_ele_outerP_mode = bookH1withSumw2(iBooker, "outerP_mode","ele track outer p, mode of GSF components",p_nbin,0.,p_max,"P_{out} (GeV/c)");
811  h2_ele_outerPVsEta_mode = bookH2(iBooker, "outerPVsEta_mode","ele track outer p vs eta mode",eta2D_nbin,eta_min,eta_max,50,0.,p_max);
812  h1_ele_outerPt = bookH1withSumw2(iBooker, "outerPt","ele track outer p_{T}, mean of GSF components",pt_nbin,0.,pt_max,"P_{T out} (GeV/c)");
813  h1_ele_outerPt_mode = bookH1withSumw2(iBooker, "outerPt_mode","ele track outer p_{T}, mode of GSF components",pt_nbin,0.,pt_max,"P_{T out} (GeV/c)");
814  h2_ele_outerPtVsEta_mode = bookH2(iBooker, "outerPtVsEta_mode","ele track outer p_{T} vs eta, mode of GSF components",eta2D_nbin,eta_min,eta_max,pt2D_nbin,0.,pt_max);
815  h2_ele_outerPtVsPhi_mode = bookH2(iBooker, "outerPtVsPhi_mode","ele track outer p_{T} vs phi, mode of GSF components",phi2D_nbin,phi_min,phi_max,pt2D_nbin,0.,pt_max);
816  h2_ele_outerPtVsPt_mode = bookH2(iBooker, "outerPtVsPt_mode","ele track outer p_{T} vs pt, mode of GSF components",pt2D_nbin,0.,100.,pt2D_nbin,0.,pt_max);
817 
818  // matched electrons, matching
819  h1_ele_EoP = bookH1withSumw2(iBooker, "EoP","ele E/P_{vertex}",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
820  h1_ele_EoP_barrel = bookH1withSumw2(iBooker, "EoP_barrel","ele E/P_{vertex} barrel",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
821  h1_ele_EoP_endcaps = bookH1withSumw2(iBooker, "EoP_endcaps","ele E/P_{vertex} endcaps",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
822  h2_ele_EoPVsEta = bookH2(iBooker, "EoPVsEta","ele E/P_{vertex} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
823  h2_ele_EoPVsPhi = bookH2(iBooker, "EoPVsPhi","ele E/P_{vertex} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
824  h2_ele_EoPVsE = bookH2(iBooker, "EoPVsE","ele E/P_{vertex} vs E", 50,0.,p_max ,50,0.,5.);
825  h1_ele_EseedOP = bookH1withSumw2(iBooker, "EseedOP","ele E_{seed}/P_{vertex}",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
826  h1_ele_EseedOP_barrel = bookH1withSumw2(iBooker, "EseedOP_barrel","ele E_{seed}/P_{vertex} barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
827  h1_ele_EseedOP_endcaps = bookH1withSumw2(iBooker, "EseedOP_endcaps","ele E_{seed}/P_{vertex} endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
828  h2_ele_EseedOPVsEta = bookH2(iBooker, "EseedOPVsEta","ele E_{seed}/P_{vertex} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
829  h2_ele_EseedOPVsPhi = bookH2(iBooker, "EseedOPVsPhi","ele E_{seed}/P_{vertex} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
830  h2_ele_EseedOPVsE = bookH2(iBooker, "EseedOPVsE","ele E_{seed}/P_{vertex} vs E", 50,0.,p_max ,50,0.,5.);
831  h1_ele_EoPout = bookH1withSumw2(iBooker, "EoPout","ele E_{seed}/P_{out}",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
832  h1_ele_EoPout_barrel = bookH1withSumw2(iBooker, "EoPout_barrel","ele E_{seed}/P_{out} barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
833  h1_ele_EoPout_endcaps = bookH1withSumw2(iBooker, "EoPout_endcaps","ele E_{seed}/P_{out} endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
834  h2_ele_EoPoutVsEta = bookH2(iBooker, "EoPoutVsEta","ele E_{seed}/P_{out} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
835  h2_ele_EoPoutVsPhi = bookH2(iBooker, "EoPoutVsPhi","ele E_{seed}/P_{out} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
836  h2_ele_EoPoutVsE = bookH2(iBooker, "EoPoutVsE","ele E_{seed}/P_{out} vs E",p2D_nbin,0.,p_max,eop2D_nbin,0.,eopmaxsht);
837  h1_ele_EeleOPout = bookH1withSumw2(iBooker, "EeleOPout","ele E_{ele}/P_{out}",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
838  h1_ele_EeleOPout_barrel = bookH1withSumw2(iBooker, "EeleOPout_barrel","ele E_{ele}/P_{out} barrel",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
839  h1_ele_EeleOPout_endcaps = bookH1withSumw2(iBooker, "EeleOPout_endcaps","ele E_{ele}/P_{out} endcaps",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
840  h2_ele_EeleOPoutVsEta = bookH2(iBooker, "EeleOPoutVsEta","ele E_{ele}/P_{out} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
841  h2_ele_EeleOPoutVsPhi = bookH2(iBooker, "EeleOPoutVsPhi","ele E_{ele}/P_{out} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
842  h2_ele_EeleOPoutVsE = bookH2(iBooker, "EeleOPoutVsE","ele E_{ele}/P_{out} vs E",p2D_nbin,0.,p_max,eop2D_nbin,0.,eopmaxsht);
843  h1_ele_dEtaSc_propVtx = bookH1withSumw2(iBooker, "dEtaSc_propVtx","ele #eta_{sc} - #eta_{tr}, prop from vertex",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
844  h1_ele_dEtaSc_propVtx_barrel = bookH1withSumw2(iBooker, "dEtaSc_propVtx_barrel","ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
845  h1_ele_dEtaSc_propVtx_endcaps = bookH1withSumw2(iBooker, "dEtaSc_propVtx_endcaps","ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
846  h1_ele_dEtaSc_propVtx_mAOD = bookH1withSumw2(iBooker, "dEtaSc_propVtx_mAOD","ele #eta_{sc} - #eta_{tr}, prop from vertex",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
847  h1_ele_dEtaSc_propVtx_mAOD_barrel = bookH1withSumw2(iBooker, "dEtaSc_propVtx_mAOD_barrel","ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
848  h1_ele_dEtaSc_propVtx_mAOD_endcaps = bookH1withSumw2(iBooker, "dEtaSc_propVtx_mAOD_endcaps","ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
849  h2_ele_dEtaScVsEta_propVtx = bookH2(iBooker, "dEtaScVsEta_propVtx","ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
850  h2_ele_dEtaScVsPhi_propVtx = bookH2(iBooker, "dEtaScVsPhi_propVtx","ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
851  h2_ele_dEtaScVsPt_propVtx = bookH2(iBooker, "dEtaScVsPt_propVtx","ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
852  h1_ele_dPhiSc_propVtx = bookH1withSumw2(iBooker, "dPhiSc_propVtx","ele #phi_{sc} - #phi_{tr}, prop from vertex",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
853  h1_ele_dPhiSc_propVtx_barrel = bookH1withSumw2(iBooker, "dPhiSc_propVtx_barrel","ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
854  h1_ele_dPhiSc_propVtx_endcaps = bookH1withSumw2(iBooker, "dPhiSc_propVtx_endcaps","ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
855  h2_ele_dPhiScVsEta_propVtx = bookH2(iBooker, "dPhiScVsEta_propVtx","ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
856  h2_ele_dPhiScVsPhi_propVtx = bookH2(iBooker, "dPhiScVsPhi_propVtx","ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
857  h2_ele_dPhiScVsPt_propVtx = bookH2(iBooker, "dPhiScVsPt_propVtx","ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
858  h1_ele_dEtaCl_propOut = bookH1withSumw2(iBooker, "dEtaCl_propOut","ele #eta_{cl} - #eta_{tr}, prop from outermost",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
859  h1_ele_dEtaCl_propOut_barrel = bookH1withSumw2(iBooker, "dEtaCl_propOut_barrel","ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
860  h1_ele_dEtaCl_propOut_endcaps = bookH1withSumw2(iBooker, "dEtaCl_propOut_endcaps","ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
861  h2_ele_dEtaClVsEta_propOut = bookH2(iBooker, "dEtaClVsEta_propOut","ele #eta_{cl} - #eta_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
862  h2_ele_dEtaClVsPhi_propOut = bookH2(iBooker, "dEtaClVsPhi_propOut","ele #eta_{cl} - #eta_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
863  h2_ele_dEtaClVsPt_propOut = bookH2(iBooker, "dEtaScVsPt_propOut","ele #eta_{cl} - #eta_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
864  h1_ele_dPhiCl_propOut = bookH1withSumw2(iBooker, "dPhiCl_propOut","ele #phi_{cl} - #phi_{tr}, prop from outermost",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
865  h1_ele_dPhiCl_propOut_barrel = bookH1withSumw2(iBooker, "dPhiCl_propOut_barrel","ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
866  h1_ele_dPhiCl_propOut_endcaps = bookH1withSumw2(iBooker, "dPhiCl_propOut_endcaps","ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
867  h1_ele_dPhiCl_propOut_mAOD = bookH1withSumw2(iBooker, "dPhiCl_propOut_mAOD","ele #phi_{cl} - #phi_{tr}, prop from outermost",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
868  h1_ele_dPhiCl_propOut_mAOD_barrel = bookH1withSumw2(iBooker, "dPhiCl_propOut_mAOD_barrel","ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
869  h1_ele_dPhiCl_propOut_mAOD_endcaps = bookH1withSumw2(iBooker, "dPhiCl_propOut_mAOD_endcaps","ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
870  h2_ele_dPhiClVsEta_propOut = bookH2(iBooker, "dPhiClVsEta_propOut","ele #phi_{cl} - #phi_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
871  h2_ele_dPhiClVsPhi_propOut = bookH2(iBooker, "dPhiClVsPhi_propOut","ele #phi_{cl} - #phi_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
872  h2_ele_dPhiClVsPt_propOut = bookH2(iBooker, "dPhiSClsPt_propOut","ele #phi_{cl} - #phi_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
873  h1_ele_dEtaEleCl_propOut = bookH1withSumw2(iBooker, "dEtaEleCl_propOut","ele #eta_{EleCl} - #eta_{tr}, prop from outermost",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
874  h1_ele_dEtaEleCl_propOut_barrel = bookH1withSumw2(iBooker, "dEtaEleCl_propOut_barrel","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
875  h1_ele_dEtaEleCl_propOut_endcaps = bookH1withSumw2(iBooker, "dEtaEleCl_propOut_endcaps","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
876  h2_ele_dEtaEleClVsEta_propOut = bookH2(iBooker, "dEtaEleClVsEta_propOut","ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
877  h2_ele_dEtaEleClVsPhi_propOut = bookH2(iBooker, "dEtaEleClVsPhi_propOut","ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
878  h2_ele_dEtaEleClVsPt_propOut = bookH2(iBooker, "dEtaScVsPt_propOut","ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
879  h1_ele_dPhiEleCl_propOut = bookH1withSumw2(iBooker, "dPhiEleCl_propOut","ele #phi_{EleCl} - #phi_{tr}, prop from outermost",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
880  h1_ele_dPhiEleCl_propOut_barrel = bookH1withSumw2(iBooker, "dPhiEleCl_propOut_barrel","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
881  h1_ele_dPhiEleCl_propOut_endcaps = bookH1withSumw2(iBooker, "dPhiEleCl_propOut_endcaps","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
882  h2_ele_dPhiEleClVsEta_propOut = bookH2(iBooker, "dPhiEleClVsEta_propOut","ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
883  h2_ele_dPhiEleClVsPhi_propOut = bookH2(iBooker, "dPhiEleClVsPhi_propOut","ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
884  h2_ele_dPhiEleClVsPt_propOut = bookH2(iBooker, "dPhiSEleClsPt_propOut","ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
885  h1_ele_HoE = bookH1withSumw2(iBooker, "HoE","ele hadronic energy / em energy",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
886  h1_ele_HoE_barrel = bookH1withSumw2(iBooker, "HoE_barrel","ele hadronic energy / em energy, barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
887  h1_ele_HoE_endcaps = bookH1withSumw2(iBooker, "HoE_endcaps","ele hadronic energy / em energy, endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
888  h1_ele_HoE_mAOD = bookH1withSumw2(iBooker, "HoE_mAOD","ele hadronic energy / em energy",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
889  h1_ele_HoE_mAOD_barrel = bookH1withSumw2(iBooker, "HoE_mAOD_barrel","ele hadronic energy / em energy, barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
890  h1_ele_HoE_mAOD_endcaps = bookH1withSumw2(iBooker, "HoE_mAOD_endcaps","ele hadronic energy / em energy, endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
891  h1_ele_HoE_bc = bookH1withSumw2(iBooker, "HoE_bc","ele hadronic energy / em energy behind cluster",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
892  h1_ele_HoE_bc_barrel = bookH1withSumw2(iBooker, "HoE_bc_barrel","ele hadronic energy / em energy, behind cluster barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
893  h1_ele_HoE_bc_endcaps = bookH1withSumw2(iBooker, "HoE_bc_endcaps","ele hadronic energy / em energy, behind cluster, endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
894  h1_ele_hcalDepth1OverEcalBc = bookH1withSumw2(iBooker, "hcalDepth1OverEcalBc","hcalDepth1OverEcalBc",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
895  h1_ele_hcalDepth1OverEcalBc_barrel = bookH1withSumw2(iBooker, "hcalDepth1OverEcalBc_barrel","hcalDepth1OverEcalBc_barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
896  h1_ele_hcalDepth1OverEcalBc_endcaps = bookH1withSumw2(iBooker, "hcalDepth1OverEcalBc_endcaps","hcalDepth1OverEcalBc_endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
897  h1_ele_hcalDepth2OverEcalBc = bookH1withSumw2(iBooker, "hcalDepth2OverEcalBc","hcalDepth2OverEcalBc",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
898  h1_ele_hcalDepth2OverEcalBc_barrel = bookH1withSumw2(iBooker, "hcalDepth2OverEcalBc_barrel","hcalDepth2OverEcalBc_barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
899  h1_ele_hcalDepth2OverEcalBc_endcaps = bookH1withSumw2(iBooker, "hcalDepth2OverEcalBc_endcaps","hcalDepth2OverEcalBc_endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
900 
901  h1_ele_HoE_fiducial = bookH1withSumw2(iBooker, "HoE_fiducial","ele hadronic energy / em energy, fiducial region",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
902  h2_ele_HoEVsEta = bookH2(iBooker, "HoEVsEta","ele hadronic energy / em energy vs eta",eta_nbin,eta_min,eta_max,hoe_nbin, hoe_min, hoe_max) ;
903  h2_ele_HoEVsPhi = bookH2(iBooker, "HoEVsPhi","ele hadronic energy / em energy vs phi",phi2D_nbin,phi_min,phi_max,hoe_nbin, hoe_min, hoe_max) ;
904  h2_ele_HoEVsE = bookH2(iBooker, "HoEVsE","ele hadronic energy / em energy vs E",p_nbin, 0.,300.,hoe_nbin, hoe_min, hoe_max) ;
905 
906  // seeds
907  h1_ele_seed_subdet2 = bookH1withSumw2(iBooker, "seedSubdet2","ele seed subdet 2nd layer",11,-0.5,10.5,"2nd hit subdet Id") ;
908  h1_ele_seed_mask = bookH1withSumw2(iBooker, "seedMask","ele seed hits mask",13,-0.5,12.5) ;
909  h1_ele_seed_mask_bpix = bookH1withSumw2(iBooker, "seedMask_Bpix","ele seed hits mask when subdet2 is bpix",13,-0.5,12.5) ;
910  h1_ele_seed_mask_fpix = bookH1withSumw2(iBooker, "seedMask_Fpix","ele seed hits mask when subdet2 is fpix",13,-0.5,12.5) ;
911  h1_ele_seed_mask_tec = bookH1withSumw2(iBooker, "seedMask_Tec","ele seed hits mask when subdet2 is tec",13,-0.5,12.5) ;
912  h1_ele_seed_dphi2 = bookH1withSumw2(iBooker, "seedDphi2","ele seed dphi 2nd layer", 50,-0.010,+0.010,"#phi_{hit}-#phi_{pred} (rad)") ;
913  h2_ele_seed_dphi2VsEta = bookH2(iBooker, "seedDphi2_VsEta","ele seed dphi 2nd layer vs eta",eta2D_nbin,eta_min,eta_max,50,-0.003,+0.003) ;
914  h2_ele_seed_dphi2VsPt = bookH2(iBooker, "seedDphi2_VsPt","ele seed dphi 2nd layer vs pt",pt2D_nbin,0.,pt_max,50,-0.003,+0.003) ;
915  h1_ele_seed_dphi2pos = bookH1withSumw2(iBooker, "seedDphi2Pos","ele seed dphi 2nd layer positron", 50,-0.010,+0.010,"#phi_{hit}-#phi_{pred} (rad)") ;
916  h2_ele_seed_dphi2posVsEta = bookH2(iBooker, "seedDphi2Pos_VsEta","ele seed dphi 2nd layer positron vs eta",eta2D_nbin,eta_min,eta_max,50,-0.003,+0.003) ;
917  h2_ele_seed_dphi2posVsPt = bookH2(iBooker, "seedDphi2Pos_VsPt","ele seed dphi 2nd layer positron vs pt",pt2D_nbin,0.,pt_max,50,-0.003,+0.003) ;
918  h1_ele_seed_drz2 = bookH1withSumw2(iBooker, "seedDrz2","ele seed dr (dz) 2nd layer", 50,-0.03,+0.03,"r(z)_{hit}-r(z)_{pred} (cm)") ;
919  h2_ele_seed_drz2VsEta = bookH2(iBooker, "seedDrz2_VsEta","ele seed dr/dz 2nd layer vs eta",eta2D_nbin,eta_min,eta_max,50,-0.03,+0.03) ;
920  h2_ele_seed_drz2VsPt = bookH2(iBooker, "seedDrz2_VsPt","ele seed dr/dz 2nd layer vs pt",pt2D_nbin,0.,pt_max,50,-0.03,+0.03) ;
921  h1_ele_seed_drz2pos = bookH1withSumw2(iBooker, "seedDrz2Pos","ele seed dr (dz) 2nd layer positron", 50,-0.03,+0.03,"r(z)_{hit}-r(z)_{pred} (cm)") ;
922  h2_ele_seed_drz2posVsEta = bookH2(iBooker, "seedDrz2Pos_VsEta","ele seed dr/dz 2nd layer positron vs eta",eta2D_nbin,eta_min,eta_max,50,-0.03,+0.03) ;
923  h2_ele_seed_drz2posVsPt = bookH2(iBooker, "seedDrz2Pos_VsPt","ele seed dr/dz 2nd layer positron vs pt",pt2D_nbin,0.,pt_max,50,-0.03,+0.03) ;
924 
925  // classes
926  h1_ele_classes = bookH1withSumw2(iBooker, "classes","ele classes",20,0.0,20.,"class Id");
927  h1_ele_eta = bookH1withSumw2(iBooker, "eta","ele electron eta",eta_nbin/2,0.0,eta_max);
928  h1_ele_eta_golden = bookH1withSumw2(iBooker, "eta_golden","ele electron eta golden",eta_nbin/2,0.0,eta_max);
929  h1_ele_eta_bbrem = bookH1withSumw2(iBooker, "eta_bbrem","ele electron eta bbrem",eta_nbin/2,0.0,eta_max);
930  h1_ele_eta_shower = bookH1withSumw2(iBooker, "eta_shower","ele electron eta showering",eta_nbin/2,0.0,eta_max);
931  h2_ele_PinVsPoutGolden_mode = bookH2(iBooker, "PinVsPoutGolden_mode","ele track inner p vs outer p vs eta, golden, mode of GSF components" ,p2D_nbin,0.,p_max,50,0.,p_max);
932  h2_ele_PinVsPoutShowering_mode = bookH2(iBooker, "PinVsPoutShowering_mode","ele track inner p vs outer p vs eta, showering, mode of GSF components" ,p2D_nbin,0.,p_max,50,0.,p_max);
933  h2_ele_PinVsPoutGolden_mean = bookH2(iBooker, "PinVsPoutGolden_mean","ele track inner p vs outer p vs eta, golden, mean of GSF components" ,p2D_nbin,0.,p_max,50,0.,p_max);
934  h2_ele_PinVsPoutShowering_mean = bookH2(iBooker, "PinVsPoutShowering_mean","ele track inner p vs outer p vs eta, showering, mean of GSF components" ,p2D_nbin,0.,p_max,50,0.,p_max);
935  h2_ele_PtinVsPtoutGolden_mode = bookH2(iBooker, "PtinVsPtoutGolden_mode","ele track inner pt vs outer pt vs eta, golden, mode of GSF components" ,pt2D_nbin,0.,pt_max,50,0.,pt_max);
936  h2_ele_PtinVsPtoutShowering_mode = bookH2(iBooker, "PtinVsPtoutShowering_mode","ele track inner pt vs outer pt vs eta, showering, mode of GSF components" ,pt2D_nbin,0.,pt_max,50,0.,pt_max);
937  h2_ele_PtinVsPtoutGolden_mean = bookH2(iBooker, "PtinVsPtoutGolden_mean","ele track inner pt vs outer pt vs eta, golden, mean of GSF components" ,pt2D_nbin,0.,pt_max,50,0.,pt_max);
938  h2_ele_PtinVsPtoutShowering_mean = bookH2(iBooker, "PtinVsPtoutShowering_mean","ele track inner pt vs outer pt vs eta, showering, mean of GSF components" ,pt2D_nbin,0.,pt_max,50,0.,pt_max);
939  setBookPrefix("h_scl") ;
940  h1_scl_EoEtrueGolden_barrel = bookH1withSumw2(iBooker, "EoEtrue_golden_barrel","ele supercluster energy / gen energy, golden, barrel",poptrue_nbin,poptrue_min,poptrue_max);
941  h1_scl_EoEtrueGolden_endcaps = bookH1withSumw2(iBooker, "EoEtrue_golden_endcaps","ele supercluster energy / gen energy, golden, endcaps",poptrue_nbin,poptrue_min,poptrue_max);
942  h1_scl_EoEtrueShowering_barrel = bookH1withSumw2(iBooker, "EoEtrue_showering_barrel","ele supercluster energy / gen energy, showering, barrel",poptrue_nbin,poptrue_min,poptrue_max);
943  h1_scl_EoEtrueShowering_endcaps = bookH1withSumw2(iBooker, "EoEtrue_showering_endcaps","ele supercluster energy / gen energy, showering, endcaps",poptrue_nbin,poptrue_min,poptrue_max);
944 
945  // isolation
946  setBookPrefix("h_ele") ;
947  h1_ele_tkSumPt_dr03 = bookH1withSumw2(iBooker, "tkSumPt_dr03","tk isolation sum, dR=0.3",100,0.0,20.,"TkIsoSum, cone 0.3 (GeV/c)","Events","ELE_LOGY E1 P");
948  h1_ele_tkSumPt_dr03_barrel = bookH1withSumw2(iBooker, "tkSumPt_dr03_barrel","tk isolation sum, dR=0.3, barrel",100,0.0,20.,"TkIsoSum, cone 0.3 (GeV/c)","Events","ELE_LOGY E1 P");
949  h1_ele_tkSumPt_dr03_endcaps = bookH1withSumw2(iBooker, "tkSumPt_dr03_endcaps","tk isolation sum, dR=0.3, endcaps",100,0.0,20.,"TkIsoSum, cone 0.3 (GeV/c)","Events","ELE_LOGY E1 P");
950  h1_ele_ecalRecHitSumEt_dr03 = bookH1withSumw2(iBooker, "ecalRecHitSumEt_dr03","ecal isolation sum, dR=0.3",100,0.0,20.,"EcalIsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
951  h1_ele_ecalRecHitSumEt_dr03_barrel = bookH1withSumw2(iBooker, "ecalRecHitSumEt_dr03_barrel","ecal isolation sum, dR=0.3, barrel",100,0.0,20.,"EcalIsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
952  h1_ele_ecalRecHitSumEt_dr03_endcaps = bookH1withSumw2(iBooker, "ecalRecHitSumEt_dr03_endcaps","ecal isolation sum, dR=0.3, endcaps",100,0.0,20.,"EcalIsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
953  h1_ele_hcalTowerSumEt_dr03_depth1 = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr03_depth1","hcal depth1 isolation sum, dR=0.3",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
954  h1_ele_hcalTowerSumEt_dr03_depth1_barrel = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr03_depth1_barrel","hcal depth1 isolation sum, dR=0.3, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
955  h1_ele_hcalTowerSumEt_dr03_depth1_endcaps = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr03_depth1_endcaps","hcal depth1 isolation sum, dR=0.3, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
956  h1_ele_hcalTowerSumEt_dr03_depth2 = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr03_depth2","hcal depth2 isolation sum, dR=0.3",100,0.0,20.,"Hcal2IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
957  h1_ele_hcalTowerSumEt_dr03_depth2_barrel = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr03_depth2_barrel","hcal depth2 isolation sum, dR=0.3",100,0.0,20.,"Hcal2IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
958  h1_ele_hcalTowerSumEt_dr03_depth2_endcaps = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr03_depth2_endcaps","hcal depth2 isolation sum, dR=0.3",100,0.0,20.,"Hcal2IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
959  h1_ele_tkSumPt_dr04 = bookH1withSumw2(iBooker, "tkSumPt_dr04","tk isolation sum, dR=0.4",100,0.0,20.,"TkIsoSum, cone 0.4 (GeV/c)","Events","ELE_LOGY E1 P");
960  h1_ele_tkSumPt_dr04_barrel = bookH1withSumw2(iBooker, "tkSumPt_dr04_barrel","tk isolation sum, dR=0.4, barrel",100,0.0,20.,"TkIsoSum, cone 0.4 (GeV/c)","Events","ELE_LOGY E1 P");
961  h1_ele_tkSumPt_dr04_endcaps = bookH1withSumw2(iBooker, "tkSumPt_dr04_endcaps","tk isolation sum, dR=0.4, endcaps",100,0.0,20.,"TkIsoSum, cone 0.4 (GeV/c)","Events","ELE_LOGY E1 P");
962  h1_ele_ecalRecHitSumEt_dr04 = bookH1withSumw2(iBooker, "ecalRecHitSumEt_dr04","ecal isolation sum, dR=0.4",100,0.0,20.,"EcalIsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
963  h1_ele_ecalRecHitSumEt_dr04_barrel = bookH1withSumw2(iBooker, "ecalRecHitSumEt_dr04_barrel","ecal isolation sum, dR=0.4, barrel",100,0.0,20.,"EcalIsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
964  h1_ele_ecalRecHitSumEt_dr04_endcaps = bookH1withSumw2(iBooker, "ecalRecHitSumEt_dr04_endcaps","ecal isolation sum, dR=0.4, endcaps",100,0.0,20.,"EcalIsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
965  h1_ele_hcalTowerSumEt_dr04_depth1 = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr04_depth1","hcal depth1 isolation sum, dR=0.4",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
966  h1_ele_hcalTowerSumEt_dr04_depth1_barrel = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr04_depth1_barrel","hcal depth1 isolation sum, dR=0.4, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
967  h1_ele_hcalTowerSumEt_dr04_depth1_endcaps = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr04_depth1_endcaps","hcal depth1 isolation sum, dR=0.4, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
968  h1_ele_hcalTowerSumEt_dr04_depth2 = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr04_depth2","hcal depth2 isolation sum, dR=0.4",100,0.0,20.,"Hcal2IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
969  h1_ele_hcalTowerSumEt_dr04_depth2_barrel = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr04_depth2_barrel","hcal depth2 isolation sum, dR=0.4",100,0.0,20.,"Hcal2IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
970  h1_ele_hcalTowerSumEt_dr04_depth2_endcaps = bookH1withSumw2(iBooker, "hcalTowerSumEt_dr04_depth2_endcaps","hcal depth2 isolation sum, dR=0.4",100,0.0,20.,"Hcal2IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
971 
972  // newHCAL
973  // isolation new hcal
974  h1_ele_hcalTowerSumEtBc_dr03_depth1 = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr03_depth1","hcal depth1 isolation sum behind cluster, dR=0.3",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
975  h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr03_depth1_barrel","hcal depth1 isolation sum behind cluster, dR=0.3, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
976  h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr03_depth1_endcaps","hcal depth1 isolation sum behind cluster, dR=0.3, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
977 
978  h1_ele_hcalTowerSumEtBc_dr04_depth1 = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr04_depth1","hcal depth1 isolation sum behind cluster, dR=0.4",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
979  h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr04_depth1_barrel","hcal depth1 isolation sum behind cluster, dR=0.4, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
980  h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr04_depth1_endcaps","hcal depth1 isolation sum behind cluster, dR=0.4, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
981 
982  h1_ele_hcalTowerSumEtBc_dr03_depth2 = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr03_depth2","hcal depth2 isolation sum behind cluster, dR=0.3",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
983  h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr03_depth2_barrel","hcal depth2 isolation sum behind cluster, dR=0.3, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
984  h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr03_depth2_endcaps","hcal depth2 isolation sum behind cluster, dR=0.3, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
985 
986  h1_ele_hcalTowerSumEtBc_dr04_depth2 = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr04_depth2","hcal depth2 isolation sum behind cluster, dR=0.4",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
987  h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr04_depth2_barrel","hcal depth2 isolation sum behind cluster, dR=0.4, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
988  h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps = bookH1withSumw2(iBooker, "hcalTowerSumEtBc_dr04_depth2_endcaps","hcal depth2 isolation sum behind cluster, dR=0.4, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
989 
990  // fbrem
991  h1_ele_fbrem = bookH1withSumw2(iBooker, "fbrem","ele brem fraction, mode of GSF components",100,0.,1.,"P_{in} - P_{out} / P_{in}");
992  h1_ele_fbrem_barrel = bookH1withSumw2(iBooker, "fbrem_barrel","ele brem fraction for barrel, mode of GSF components", 100, 0.,1.,"P_{in} - P_{out} / P_{in}");
993  h1_ele_fbrem_endcaps = bookH1withSumw2(iBooker, "fbrem_endcaps", "ele brem franction for endcaps, mode of GSF components", 100, 0.,1.,"P_{in} - P_{out} / P_{in}");
994  h1_ele_fbrem_mAOD = bookH1withSumw2(iBooker, "fbrem_mAOD","ele brem fraction, mode of GSF components",100,0.,1.,"P_{in} - P_{out} / P_{in}");
995  h1_ele_fbrem_mAOD_barrel = bookH1withSumw2(iBooker, "fbrem_mAOD_barrel","ele brem fraction for barrel, mode of GSF components", 100, 0.,1.,"P_{in} - P_{out} / P_{in}");
996  h1_ele_fbrem_mAOD_endcaps = bookH1withSumw2(iBooker, "fbrem_mAOD_endcaps", "ele brem franction for endcaps, mode of GSF components", 100, 0.,1.,"P_{in} - P_{out} / P_{in}");
997  h1_ele_superclusterfbrem = bookH1withSumw2(iBooker, "superclusterfbrem","supercluster brem fraction, mode of GSF components",100,0.,1.,"P_{in} - P_{out} / P_{in}");
998  h1_ele_superclusterfbrem_barrel = bookH1withSumw2(iBooker, "superclusterfbrem_barrel","supercluster brem fraction for barrel, mode of GSF components", 100, 0.,1.,"P_{in} - P_{out} / P_{in}");
999  h1_ele_superclusterfbrem_endcaps = bookH1withSumw2(iBooker, "superclusterfbrem_endcaps", "supercluster brem franction for endcaps, mode of GSF components", 100, 0.,1.,"P_{in} - P_{out} / P_{in}");
1000  p1_ele_fbremVsEta_mode = bookP1(iBooker, "fbremvsEtamode","mean ele brem fraction vs eta, mode of GSF components",eta2D_nbin,eta_min,eta_max,0.,1.,"#eta","<P_{in} - P_{out} / P_{in}>");
1001  p1_ele_fbremVsEta_mean = bookP1(iBooker, "fbremvsEtamean","mean ele brem fraction vs eta, mean of GSF components",eta2D_nbin,eta_min,eta_max,0.,1.,"#eta","<P_{in} - P_{out} / P_{in}>");
1002  h1_ele_chargeInfo = bookH1withSumw2(iBooker, "chargeInfo","chargeInfo",5,-2.,3.);
1003 
1004  // e/g et pflow electrons
1005  h1_ele_mva = bookH1withSumw2(iBooker, "mva","ele identification mva",100,-1.,1.);
1006  h1_ele_mva_barrel = bookH1withSumw2(iBooker, "mva_barrel", "ele identification mva barrel",100,-1.,1.);
1007  h1_ele_mva_endcaps = bookH1withSumw2(iBooker, "mva_endcaps", "ele identification mva endcaps",100,-1.,1.);
1008  h1_ele_mva_isolated = bookH1withSumw2(iBooker, "mva_isolated","ele identification mva isolated",100,-1.,1.);
1009  h1_ele_mva_barrel_isolated = bookH1withSumw2(iBooker, "mva_isolated_barrel", "ele identification mva isolated barrel",100,-1.,1.);
1010  h1_ele_mva_endcaps_isolated = bookH1withSumw2(iBooker, "mva_isolated_endcaps", "ele identification mva isolated endcaps",100,-1.,1.);
1011  h1_ele_provenance = bookH1withSumw2(iBooker, "provenance","ele provenance",5,-2.,3.);
1012  h1_ele_provenance_barrel = bookH1withSumw2(iBooker, "provenance_barrel","ele provenance barrel",5,-2.,3.);
1013  h1_ele_provenance_endcaps = bookH1withSumw2(iBooker, "provenance_endcaps","ele provenance endcaps",5,-2.,3.);
1014 
1015  // pflow isolation variables
1016  h1_ele_chargedHadronIso = bookH1withSumw2(iBooker, "chargedHadronIso","chargedHadronIso",100,0.0,20.,"chargedHadronIso","Events","ELE_LOGY E1 P");
1017  h1_ele_chargedHadronIso_barrel = bookH1withSumw2(iBooker, "chargedHadronIso_barrel","chargedHadronIso for barrel",100,0.0,20.,"chargedHadronIso_barrel","Events","ELE_LOGY E1 P");
1018  h1_ele_chargedHadronIso_endcaps = bookH1withSumw2(iBooker, "chargedHadronIso_endcaps","chargedHadronIso for endcaps",100,0.0,20.,"chargedHadronIso_endcaps","Events","ELE_LOGY E1 P");
1019  h1_ele_neutralHadronIso = bookH1withSumw2(iBooker, "neutralHadronIso","neutralHadronIso",21,0.0,20.,"neutralHadronIso","Events", "ELE_LOGY E1 P");
1020  h1_ele_neutralHadronIso_barrel = bookH1withSumw2(iBooker, "neutralHadronIso_barrel","neutralHadronIso for barrel",21,0.0,20.,"neutralHadronIso_barrel","Events","ELE_LOGY E1 P");
1021  h1_ele_neutralHadronIso_endcaps = bookH1withSumw2(iBooker, "neutralHadronIso_endcaps","neutralHadronIso for endcaps",21,0.0,20.,"neutralHadronIso_endcaps","Events","ELE_LOGY E1 P");
1022  h1_ele_photonIso = bookH1withSumw2(iBooker, "photonIso","photonIso",100,0.0,20.,"photonIso","Events","ELE_LOGY E1 P");
1023  h1_ele_photonIso_barrel = bookH1withSumw2(iBooker, "photonIso_barrel","photonIso for barrel",100,0.0,20.,"photonIso_barrel","Events","ELE_LOGY E1 P");
1024  h1_ele_photonIso_endcaps = bookH1withSumw2(iBooker, "photonIso_endcaps","photonIso for endcaps",100,0.0,20.,"photonIso_endcaps","Events","ELE_LOGY E1 P");
1025  // -- pflow over pT
1026  h1_ele_chargedHadronRelativeIso = bookH1withSumw2(iBooker, "chargedHadronRelativeIso","chargedHadronRelativeIso",100,0.0,2.,"chargedHadronRelativeIso","Events","ELE_LOGY E1 P");
1027  h1_ele_chargedHadronRelativeIso_barrel = bookH1withSumw2(iBooker, "chargedHadronRelativeIso_barrel","chargedHadronRelativeIso for barrel",100,0.0,2.,"chargedHadronRelativeIso_barrel","Events","ELE_LOGY E1 P");
1028  h1_ele_chargedHadronRelativeIso_endcaps = bookH1withSumw2(iBooker, "chargedHadronRelativeIso_endcaps","chargedHadronRelativeIso for endcaps",100,0.0,2.,"chargedHadronRelativeIso_endcaps","Events","ELE_LOGY E1 P");
1029  h1_ele_neutralHadronRelativeIso = bookH1withSumw2(iBooker, "neutralHadronRelativeIso","neutralHadronRelativeIso",100,0.0,2.,"neutralHadronRelativeIso","Events","ELE_LOGY E1 P");
1030  h1_ele_neutralHadronRelativeIso_barrel = bookH1withSumw2(iBooker, "neutralHadronRelativeIso_barrel","neutralHadronRelativeIso for barrel",100,0.0,2.,"neutralHadronRelativeIso_barrel","Events","ELE_LOGY E1 P");
1031  h1_ele_neutralHadronRelativeIso_endcaps = bookH1withSumw2(iBooker, "neutralHadronRelativeIso_endcaps","neutralHadronRelativeIso for endcaps",100,0.0,2.,"neutralHadronRelativeIso_endcaps","Events","ELE_LOGY E1 P");
1032  h1_ele_photonRelativeIso = bookH1withSumw2(iBooker, "photonRelativeIso","photonRelativeIso",100,0.0,2.,"photonRelativeIso","Events","ELE_LOGY E1 P");
1033  h1_ele_photonRelativeIso_barrel = bookH1withSumw2(iBooker, "photonRelativeIso_barrel","photonRelativeIso for barrel",100,0.0,2.,"photonRelativeIso_barrel","Events","ELE_LOGY E1 P");
1034  h1_ele_photonRelativeIso_endcaps = bookH1withSumw2(iBooker, "photonRelativeIso_endcaps","photonRelativeIso for endcaps",100,0.0,2.,"photonRelativeIso_endcaps","Events","ELE_LOGY E1 P");
1035  h1_ele_chargedHadronRelativeIso_mAOD = bookH1withSumw2(iBooker, "chargedHadronRelativeIso_mAOD","chargedHadronRelativeIso",100,0.0,2.,"chargedHadronRelativeIso","Events","ELE_LOGY E1 P");
1036  h1_ele_chargedHadronRelativeIso_mAOD_barrel = bookH1withSumw2(iBooker, "chargedHadronRelativeIso_mAOD_barrel","chargedHadronRelativeIso for barrel",100,0.0,2.,"chargedHadronRelativeIso_barrel","Events","ELE_LOGY E1 P");
1037  h1_ele_chargedHadronRelativeIso_mAOD_endcaps = bookH1withSumw2(iBooker, "chargedHadronRelativeIso_mAOD_endcaps","chargedHadronRelativeIso for endcaps",100,0.0,2.,"chargedHadronRelativeIso_endcaps","Events","ELE_LOGY E1 P");
1038  h1_ele_neutralHadronRelativeIso_mAOD = bookH1withSumw2(iBooker, "neutralHadronRelativeIso_mAOD","neutralHadronRelativeIso",100,0.0,2.,"neutralHadronRelativeIso","Events","ELE_LOGY E1 P");
1039  h1_ele_neutralHadronRelativeIso_mAOD_barrel = bookH1withSumw2(iBooker, "neutralHadronRelativeIso_mAOD_barrel","neutralHadronRelativeIso for barrel",100,0.0,2.,"neutralHadronRelativeIso_barrel","Events","ELE_LOGY E1 P");
1040  h1_ele_neutralHadronRelativeIso_mAOD_endcaps = bookH1withSumw2(iBooker, "neutralHadronRelativeIso_mAOD_endcaps","neutralHadronRelativeIso for endcaps",100,0.0,2.,"neutralHadronRelativeIso_endcaps","Events","ELE_LOGY E1 P");
1041  h1_ele_photonRelativeIso_mAOD = bookH1withSumw2(iBooker, "photonRelativeIso_mAOD","photonRelativeIso",100,0.0,2.,"photonRelativeIso","Events","ELE_LOGY E1 P");
1042  h1_ele_photonRelativeIso_mAOD_barrel = bookH1withSumw2(iBooker, "photonRelativeIso_mAOD_barrel","photonRelativeIso for barrel",100,0.0,2.,"photonRelativeIso_barrel","Events","ELE_LOGY E1 P");
1043  h1_ele_photonRelativeIso_mAOD_endcaps = bookH1withSumw2(iBooker, "photonRelativeIso_mAOD_endcaps","photonRelativeIso for endcaps",100,0.0,2.,"photonRelativeIso_endcaps","Events","ELE_LOGY E1 P");
1044 
1045  // conversion rejection information
1046  h1_ele_convFlags = bookH1withSumw2(iBooker, "convFlags","conversion rejection flag",5,-1.5,3.5);
1047  h1_ele_convFlags_all = bookH1withSumw2(iBooker, "convFlags_all","conversion rejection flag, all electrons",5,-1.5,3.5);
1048  h1_ele_convDist = bookH1withSumw2(iBooker, "convDist","distance to the conversion partner",100,-15.,15.);
1049  h1_ele_convDist_all = bookH1withSumw2(iBooker, "convDist_all","distance to the conversion partner, all electrons",100,-15.,15.);
1050  h1_ele_convDcot = bookH1withSumw2(iBooker, "convDcot","difference of cot(angle) with the conversion partner",100,-CLHEP::pi/2.,CLHEP::pi/2.);
1051  h1_ele_convDcot_all = bookH1withSumw2(iBooker, "convDcot_all","difference of cot(angle) with the conversion partner, all electrons",100,-CLHEP::pi/2.,CLHEP::pi/2.);
1052  h1_ele_convRadius = bookH1withSumw2(iBooker, "convRadius","signed conversion radius",100,0.,130.);
1053  h1_ele_convRadius_all = bookH1withSumw2(iBooker, "convRadius_all","signed conversion radius, all electrons",100,0.,130.);
1054 
1055  }
1056 
1058  {}
1059 
1061  {
1062  // get collections
1064  iEvent.getByToken(electronCollection_, gsfElectrons) ;
1066  iEvent.getByToken(electronCoreCollection_,gsfElectronCores) ;
1067  edm::Handle<GsfTrackCollection> gsfElectronTracks ;
1068  iEvent.getByToken(electronTrackCollection_,gsfElectronTracks) ;
1069  edm::Handle<ElectronSeedCollection> gsfElectronSeeds ;
1070  iEvent.getByToken(electronSeedCollection_,gsfElectronSeeds) ;
1072  iEvent.getByToken(mcTruthCollection_, genParticles) ;
1073  edm::Handle<reco::BeamSpot> theBeamSpot ;
1074  iEvent.getByToken(beamSpotTag_,theBeamSpot) ;
1075 
1076  edm::Handle<edm::ValueMap<double> > isoFromDepsTk03Handle;
1077  iEvent.getByToken(isoFromDepsTk03Tag_, isoFromDepsTk03Handle);
1078 
1079  edm::Handle<edm::ValueMap<double> > isoFromDepsTk04Handle;
1080  iEvent.getByToken(isoFromDepsTk04Tag_, isoFromDepsTk04Handle);
1081 
1082  edm::Handle<edm::ValueMap<double> > isoFromDepsEcalFull03Handle;
1083  iEvent.getByToken( isoFromDepsEcalFull03Tag_, isoFromDepsEcalFull03Handle);
1084 
1085  edm::Handle<edm::ValueMap<double> > isoFromDepsEcalFull04Handle;
1086  iEvent.getByToken( isoFromDepsEcalFull04Tag_, isoFromDepsEcalFull04Handle);
1087 
1088  edm::Handle<edm::ValueMap<double> > isoFromDepsEcalReduced03Handle;
1089  iEvent.getByToken( isoFromDepsEcalReduced03Tag_, isoFromDepsEcalReduced03Handle);
1090 
1091  edm::Handle<edm::ValueMap<double> > isoFromDepsEcalReduced04Handle;
1092  iEvent.getByToken( isoFromDepsEcalReduced04Tag_, isoFromDepsEcalReduced04Handle);
1093 
1094  edm::Handle<edm::ValueMap<double> > isoFromDepsHcal03Handle;
1095  iEvent.getByToken( isoFromDepsHcal03Tag_, isoFromDepsHcal03Handle);
1096 
1097  edm::Handle<edm::ValueMap<double> > isoFromDepsHcal04Handle;
1098  iEvent.getByToken( isoFromDepsHcal04Tag_, isoFromDepsHcal04Handle);
1099 
1100  edm::Handle<reco::VertexCollection> vertexCollectionHandle;
1101  iEvent.getByToken(offlineVerticesCollection_, vertexCollectionHandle);
1102  if(!vertexCollectionHandle.isValid())
1103  {edm::LogInfo("ElectronMcSignalValidator::analyze") << "vertexCollectionHandle KO" ;}
1104  else
1105  {
1106  edm::LogInfo("ElectronMcSignalValidator::analyze") << "vertexCollectionHandle OK" ;
1107  }
1108 
1109  edm::LogInfo("ElectronMcSignalValidator::analyze")
1110  <<"Treating event "<<iEvent.id()
1111  <<" with "<<gsfElectrons.product()->size()<<" electrons" ;
1112  h1_recEleNum->Fill((*gsfElectrons).size()) ;
1113  h1_recCoreNum->Fill((*gsfElectronCores).size());
1114  h1_recTrackNum->Fill((*gsfElectronTracks).size());
1115  h1_recSeedNum->Fill((*gsfElectronSeeds).size());
1116  h1_recOfflineVertices->Fill((*vertexCollectionHandle).size());
1117 
1118 
1119  //===============================================
1120  // all rec electrons
1121  //===============================================
1122 
1123  reco::GsfElectronCollection::const_iterator gsfIter ;
1124  // mee only
1125  for ( gsfIter=gsfElectrons->begin() ; gsfIter!=gsfElectrons->end() ; gsfIter++ )
1126  {
1127  // preselect electrons
1128 // if (gsfIter->pt()>maxPt_ || std::abs(gsfIter->eta())>maxAbsEta_) continue ;
1129 
1130  //
1131  float enrj1=gsfIter->ecalEnergy();
1132 
1133  reco::GsfElectronCollection::const_iterator gsfIter2 ;
1134  for ( gsfIter2=gsfIter+1 ; gsfIter2!=gsfElectrons->end() ; gsfIter2++ )
1135  {
1136  math::XYZTLorentzVector p12 = (*gsfIter).p4()+(*gsfIter2).p4();
1137  float mee2 = p12.Dot(p12);
1138  float enrj2=gsfIter2->ecalEnergy() ;
1139  h1_ele_mee_all->Fill(sqrt(mee2));
1140  h2_ele_E2mnE1vsMee_all->Fill(sqrt(mee2),enrj2-enrj1);
1141  if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
1142  { h2_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2),enrj2-enrj1) ; }
1143  if (gsfIter->charge()*gsfIter2->charge()<0.)
1144  {
1145  h1_ele_mee_os->Fill(sqrt(mee2));
1146  if (gsfIter->isEB() && gsfIter2->isEB()) { h1_ele_mee_os_ebeb->Fill(sqrt(mee2)) ; }
1147  if ((gsfIter->isEB() && gsfIter2->isEE()) || (gsfIter->isEE() && gsfIter2->isEB())) h1_ele_mee_os_ebee -> Fill(sqrt(mee2));
1148  if (gsfIter->isEE() && gsfIter2->isEE()) { h1_ele_mee_os_eeee->Fill(sqrt(mee2)) ; }
1149  if
1150  ( (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::GOLDEN) ||
1151  (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::BIGBREM) ||
1152  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::GOLDEN) ||
1153  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::BIGBREM) )
1154  { h1_ele_mee_os_gg->Fill(sqrt(mee2)) ; }
1155  else if
1156  ( (gsfIter->classification()==GsfElectron::SHOWERING && gsfIter2->classification()==GsfElectron::SHOWERING) ||
1157  (gsfIter->classification()==GsfElectron::SHOWERING && gsfIter2->isGap()) ||
1158  (gsfIter->isGap() && gsfIter2->classification()==GsfElectron::SHOWERING) ||
1159  (gsfIter->isGap() && gsfIter2->isGap()) )
1160  { h1_ele_mee_os_bb->Fill(sqrt(mee2)) ; }
1161  else
1162  { h1_ele_mee_os_gb->Fill(sqrt(mee2)) ; }
1163  }
1164  }
1165 
1166  }
1167 
1168  for ( gsfIter=gsfElectrons->begin() ; gsfIter!=gsfElectrons->end() ; gsfIter++ )
1169  {
1170  // preselect electrons
1171  if (gsfIter->pt()>maxPt_ || std::abs(gsfIter->eta())>maxAbsEta_) continue ;
1172 
1173  //
1174  h1_ele_EoverP_all->Fill(gsfIter->eSuperClusterOverP()) ;
1175  h1_ele_EseedOP_all->Fill(gsfIter->eSeedClusterOverP()) ;
1176  h1_ele_EoPout_all->Fill(gsfIter->eSeedClusterOverPout()) ;
1177  h1_ele_EeleOPout_all->Fill( gsfIter->eEleClusterOverPout()) ;
1178  h1_ele_dEtaSc_propVtx_all->Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx()) ;
1179  h1_ele_dPhiSc_propVtx_all->Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx()) ;
1180  h1_ele_dEtaCl_propOut_all->Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo()) ;
1181  h1_ele_dPhiCl_propOut_all->Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo()) ;
1182  h1_ele_HoE_all->Fill(gsfIter->hcalOverEcal()) ;
1183  h1_ele_HoE_bc_all->Fill(gsfIter->hcalOverEcalBc()) ;
1184  h1_ele_TIP_all->Fill( EleRelPoint(gsfIter->vertex(),theBeamSpot->position()).perp() );
1185  h1_ele_vertexEta_all->Fill( gsfIter->eta() );
1186  h1_ele_vertexPt_all->Fill( gsfIter->pt() );
1187  h1_ele_Et_all->Fill( gsfIter->ecalEnergy()/cosh(gsfIter->superCluster()->eta()));
1188 
1189  // conversion rejection
1190  int flags = gsfIter->convFlags() ;
1191  if (flags==-9999) { flags=-1 ; }
1192  h1_ele_convFlags_all->Fill(flags);
1193  if (flags>=0.)
1194  {
1195  h1_ele_convDist_all->Fill( gsfIter->convDist() );
1196  h1_ele_convDcot_all->Fill( gsfIter->convDcot() );
1197  h1_ele_convRadius_all->Fill( gsfIter->convRadius() );
1198  }
1199  }
1200 
1201  //===============================================
1202  // charge mis-ID
1203  //===============================================
1204 
1205  int mcNum=0, gamNum=0, eleNum=0 ;
1206  bool matchingID, matchingMotherID ;
1207 
1208  reco::GenParticleCollection::const_iterator mcIter ;
1209  for
1210  ( mcIter=genParticles->begin() ; mcIter!=genParticles->end() ; mcIter++ )
1211  {
1212 /* // DEBUG LINES - KEEP IT !
1213  std::cout << "\nevt ID = " << iEvent.id() ;
1214  std::cout << ", mcIter position : " << mcIter - genParticles->begin() << std::endl ;
1215  std::cout << "pdgID : " << mcIter->pdgId() << ", Pt : " << mcIter->pt() << ", eta : " << mcIter->eta() << ", phi : " << mcIter->phi() << std::endl;
1216  // DEBUG LINES - KEEP IT ! */
1217 
1218  // select requested matching gen particle
1219  matchingID=false;
1220  for ( unsigned int i=0 ; i<matchingIDs_.size() ; i++ ) {
1221 
1222  if ( mcIter->pdgId() == matchingIDs_[i] )
1223  { matchingID=true ;
1224 /* // DEBUG LINES - KEEP IT !
1225  std::cout << "\nMatching mis-reco : matchingIDs_.size() = " << matchingIDs_.size() << ", evt ID = " << iEvent.id() ;
1226  std::cout << ", mcIter pdgID : " << mcIter->pdgId() << ", matchingID : " << matchingID << std::endl ;
1227  // DEBUG LINES - KEEP IT ! */
1228  }
1229  }
1230  if (matchingID) {
1231  // select requested mother matching gen particle
1232  // always include single particle with no mother
1233  const Candidate * mother = mcIter->mother() ;
1234  matchingMotherID = false ;
1235  for ( unsigned int i=0 ; i<matchingMotherIDs_.size() ; i++ )
1236  {
1237 /* // DEBUG LINES - KEEP IT !
1238  std::cout << "Matching : matchingMotherID[" << ii << "] : "<< matchingMotherIDs_[ii] << ", evt ID = " << iEvent.id() << ", mother : " << mother ;
1239  if (mother != 0) {
1240  std::cout << "mother : " << mother << ", mother pdgID : " << mother->pdgId() << std::endl ;
1241  std::cout << "mother pdgID : " << mother->pdgId() << ", Pt : " << mother->pt() << ", eta : " << mother->eta() << ", phi : " << mother->phi() << std::endl;
1242  }
1243  else {
1244  std::cout << std::endl;
1245  }
1246  // DEBUG LINES - KEEP IT ! */
1247 
1248  if ( mother == 0 ) {
1249  matchingMotherID = true ;
1250  }
1251  else if ( mother->pdgId() == matchingMotherIDs_[i] ) {
1252  if ( mother->numberOfDaughters() <= 2 ) {
1253  matchingMotherID = true ;
1254 /* // DEBUG LINES - KEEP IT !
1255  std::cout << "Matching mis-reco : matchingMotherID[" << i << "] : " << matchingMotherIDs_[i] << ", evt ID = " << iEvent.id() << ", mother : " << mother ; // debug lines
1256  std::cout << "evt ID = " << iEvent.id() ; // debug lines
1257  std::cout << " - nb of Daughters : " << mother->numberOfDaughters() << " - pdgId() : " << mother->pdgId() << std::endl; // debug lines
1258  // DEBUG LINES - KEEP IT ! */
1259  }
1260  } // end of mother if test
1261 
1262  }
1263  if (matchingMotherID)
1264  {
1265  if ( mcIter->pt()>maxPt_ || std::abs(mcIter->eta())>maxAbsEta_ )
1266  { continue ; }
1267  // suppress the endcaps
1268  //if (std::abs(mcIter->eta()) > 1.5) continue;
1269  // select central z
1270  //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
1271 
1272  // looking for the best matching gsf electron
1273  bool okGsfFound = false ;
1274  double gsfOkRatio = 999999. ;
1275 
1276  // find best matched electron
1277  reco::GsfElectron bestGsfElectron ;
1278  reco::GsfElectronCollection::const_iterator gsfIter ;
1279  for
1280  ( gsfIter=gsfElectrons->begin() ; gsfIter!=gsfElectrons->end() ; gsfIter++ )
1281  {
1282  double dphi = gsfIter->phi()-mcIter->phi() ;
1283  if (std::abs(dphi)>CLHEP::pi)
1284  { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
1285  double deltaR2 = (gsfIter->eta()-mcIter->eta()) * (gsfIter->eta()-mcIter->eta()) + dphi * dphi ;
1286  if ( deltaR2 < deltaR2_ )
1287  {
1288  double mc_charge = mcIter->pdgId() == 11 ? -1. : 1. ;
1289  h1_ele_ChargeMnChargeTrue->Fill( std::abs(gsfIter->charge()-mc_charge));
1290  // require here a charge mismatch
1291  if
1292  ( ( (mcIter->pdgId() == 11) && (gsfIter->charge() > 0.) ) ||
1293  ( (mcIter->pdgId() == -11) && (gsfIter->charge() < 0.) ) )
1294  {
1295  double tmpGsfRatio = gsfIter->p()/mcIter->p();
1296  if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) )
1297  {
1298  gsfOkRatio = tmpGsfRatio;
1299  bestGsfElectron=*gsfIter;
1300  okGsfFound = true;
1301  }
1302  }
1303  }
1304  } // loop over rec ele to look for the best one
1305 
1306  // analysis when the mc track is found
1307  if (okGsfFound) {
1308  // generated distributions for matched electrons
1309  h1_mc_Pt_matched_qmisid->Fill( mcIter->pt() ) ;
1310  h1_mc_Phi_matched_qmisid->Fill( mcIter->phi() ) ;
1311  h1_mc_AbsEta_matched_qmisid->Fill( std::abs(mcIter->eta()) ) ;
1312  h1_mc_Eta_matched_qmisid->Fill( mcIter->eta() ) ;
1313  h1_mc_Z_matched_qmisid->Fill( mcIter->vz() ) ;
1314  }
1315  }
1316  }
1317  }
1318 
1319  //===============================================
1320  // association mc-reco
1321  //===============================================
1322 
1323  for ( mcIter=genParticles->begin() ; mcIter!=genParticles->end() ; mcIter++ )
1324  {
1325  // number of mc particles
1326  mcNum++ ;
1327 
1328  // counts photons
1329  if (mcIter->pdgId() == 22 )
1330  { gamNum++ ; }
1331 
1332  // select requested matching gen particle
1333  matchingID = false ;
1334  for ( unsigned int i=0 ; i<matchingIDs_.size() ; i++ )
1335  {
1336  if ( mcIter->pdgId() == matchingIDs_[i] )
1337  { matchingID=true ; }
1338  }
1339  if (!matchingID) continue ;
1340 
1341  // select requested mother matching gen particle
1342  // always include single particle with no mother
1343  const Candidate * mother = mcIter->mother() ;
1344  matchingMotherID = false ;
1345  for ( unsigned int i=0 ; i<matchingMotherIDs_.size() ; i++ )
1346  {
1347  if ( (mother == 0) || ((mother != 0) && mother->pdgId() == matchingMotherIDs_[i]) )
1348  { matchingMotherID = true ;
1349 /* // DEBUG LINES - KEEP IT !
1350  std::cout << "Matching mc-reco : matchingMotherID[" << i << "] : " << matchingMotherIDs_[i] << ", evt ID = " << iEvent.id() << ", mother : " << mother ;
1351  if (mother != 0) {
1352  std::cout << ", mother pdgID : " << mother->pdgId() << std::endl ;
1353  }
1354  else {
1355  std::cout << std::endl ;
1356  }
1357  // DEBUG LINES - KEEP IT ! */
1358  }
1359  }
1360  if (!matchingMotherID) continue ;
1361 
1362  // electron preselection
1363  if (mcIter->pt()> maxPt_ || std::abs(mcIter->eta())> maxAbsEta_)
1364  { continue ; }
1365 
1366  // suppress the endcaps
1367  //if (std::abs(mcIter->eta()) > 1.5) continue;
1368  // select central z
1369  //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
1370 
1371  eleNum++;
1372  h1_mc_Eta->Fill( mcIter->eta() );
1373  h1_mc_AbsEta->Fill( std::abs(mcIter->eta()) );
1374  h1_mc_P->Fill( mcIter->p() );
1375  h1_mc_Pt->Fill( mcIter->pt() );
1376  h1_mc_Phi->Fill( mcIter->phi() );
1377  h1_mc_Z->Fill( mcIter->vz() );
1378  h2_mc_PtEta->Fill( mcIter->eta(),mcIter->pt() );
1379 
1380  // find best matched electron
1381  bool okGsfFound = false ;
1382  bool passMiniAODSelection = true ;
1383  double gsfOkRatio = 999999. ;
1384  reco::GsfElectron bestGsfElectron ;
1385  reco::GsfElectronRef bestGsfElectronRef ;
1386  reco::GsfElectronCollection::const_iterator gsfIter ;
1388  for ( gsfIter=gsfElectrons->begin(), iElectron=0 ; gsfIter!=gsfElectrons->end() ; gsfIter++, iElectron++ )
1389  {
1390  // temporary cut for pt < 5.
1391  double dphi = gsfIter->phi()-mcIter->phi() ;
1392  if (std::abs(dphi)>CLHEP::pi)
1393  { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
1394  double deltaR2 = (gsfIter->eta()-mcIter->eta()) * (gsfIter->eta()-mcIter->eta()) + dphi * dphi;
1395  if ( deltaR2 < deltaR2_ )
1396  {
1397  if ( ( (mcIter->pdgId() == 11) && (gsfIter->charge() < 0.) ) ||
1398  ( (mcIter->pdgId() == -11) && (gsfIter->charge() > 0.) ) )
1399  {
1400  double tmpGsfRatio = gsfIter->p()/mcIter->p() ;
1401  if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) )
1402  {
1403  gsfOkRatio = tmpGsfRatio;
1404  bestGsfElectron=*gsfIter;
1405  bestGsfElectronRef=reco::GsfElectronRef(gsfElectrons,iElectron);
1406  okGsfFound = true;
1407 
1408  //std::cout << "evt ID : " << iEvent.id() << " - Pt : " << bestGsfElectron.pt() << " - eta : " << bestGsfElectron.eta() << " - phi : " << bestGsfElectron.phi() << std::endl; // debug lines
1409  }
1410  }
1411  }
1412  } // loop over rec ele to look for the best one
1413  if (! okGsfFound) continue ;
1414 
1415  //------------------------------------
1416  // analysis when the mc track is found
1417  //------------------------------------
1418  passMiniAODSelection = bestGsfElectron.pt() >= 5.;
1419 
1420  // electron related distributions
1421  h1_ele_charge->Fill( bestGsfElectron.charge() );
1422  h2_ele_chargeVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.charge() );
1423  h2_ele_chargeVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.charge() );
1424  h2_ele_chargeVsPt->Fill( bestGsfElectron.pt(),bestGsfElectron.charge() );
1425  h1_ele_vertexP->Fill( bestGsfElectron.p() );
1426  h1_ele_vertexPt->Fill( bestGsfElectron.pt() );
1427  if (bestGsfElectron.scSigmaIEtaIEta()==0.) h1_ele_vertexPt_nocut->Fill( bestGsfElectron.pt() );
1428  h1_ele_Et->Fill( bestGsfElectron.ecalEnergy()/cosh(bestGsfElectron.superCluster()->eta()));
1429  h2_ele_vertexPtVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.pt() );
1430  h2_ele_vertexPtVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.pt() );
1431  h1_ele_vertexEta->Fill( bestGsfElectron.eta() );
1432 
1433  h2_scl_EoEtrueVsrecOfflineVertices->Fill( (*vertexCollectionHandle).size(), bestGsfElectron.ecalEnergy()/mcIter->p() );
1434  if (bestGsfElectron.isEB()) h2_scl_EoEtrueVsrecOfflineVertices_barrel->Fill( (*vertexCollectionHandle).size(),bestGsfElectron.ecalEnergy()/mcIter->p() );
1435  if (bestGsfElectron.isEE()) h2_scl_EoEtrueVsrecOfflineVertices_endcaps->Fill( (*vertexCollectionHandle).size(),bestGsfElectron.ecalEnergy()/mcIter->p() );
1436 
1437  // generated distributions for matched electrons
1438  h1_mc_Pt_matched->Fill( mcIter->pt() );
1439  h1_mc_Phi_matched->Fill( mcIter->phi() );
1440  h1_mc_AbsEta_matched->Fill( std::abs(mcIter->eta()) );
1441  h1_mc_Eta_matched->Fill( mcIter->eta() );
1442  h2_mc_PtEta_matched->Fill( mcIter->eta(),mcIter->pt() );
1443  h2_ele_vertexEtaVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.eta() );
1444  h1_ele_vertexPhi->Fill( bestGsfElectron.phi() );
1445  h1_ele_vertexX->Fill( bestGsfElectron.vertex().x() );
1446  h1_ele_vertexY->Fill( bestGsfElectron.vertex().y() );
1447  h1_ele_vertexZ->Fill( bestGsfElectron.vertex().z() );
1448  h1_mc_Z_matched->Fill( mcIter->vz() );
1449  double d =
1450  (bestGsfElectron.vertex().x()-mcIter->vx())*(bestGsfElectron.vertex().x()-mcIter->vx()) +
1451  (bestGsfElectron.vertex().y()-mcIter->vy())*(bestGsfElectron.vertex().y()-mcIter->vy()) ;
1452  d = sqrt(d) ;
1453  h1_ele_vertexTIP->Fill( d );
1454  h2_ele_vertexTIPVsEta->Fill( bestGsfElectron.eta(), d );
1455  h2_ele_vertexTIPVsPhi->Fill( bestGsfElectron.phi(), d );
1456  h2_ele_vertexTIPVsPt->Fill( bestGsfElectron.pt(), d );
1457  h1_ele_EtaMnEtaTrue->Fill( bestGsfElectron.eta()-mcIter->eta());
1458  if (bestGsfElectron.isEB()) h1_ele_EtaMnEtaTrue_barrel->Fill( bestGsfElectron.eta()-mcIter->eta());
1459  if (bestGsfElectron.isEE()) h1_ele_EtaMnEtaTrue_endcaps->Fill( bestGsfElectron.eta()-mcIter->eta());
1460  h2_ele_EtaMnEtaTrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eta()-mcIter->eta());
1461  h2_ele_EtaMnEtaTrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eta()-mcIter->eta());
1462  h2_ele_EtaMnEtaTrueVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.eta()-mcIter->eta());
1463  h1_ele_PhiMnPhiTrue->Fill( bestGsfElectron.phi()-mcIter->phi());
1464  if (bestGsfElectron.isEB()) h1_ele_PhiMnPhiTrue_barrel->Fill( bestGsfElectron.phi()-mcIter->phi());
1465  if (bestGsfElectron.isEE()) h1_ele_PhiMnPhiTrue_endcaps->Fill( bestGsfElectron.phi()-mcIter->phi());
1466  h1_ele_PhiMnPhiTrue2->Fill( bestGsfElectron.phi()-mcIter->phi());
1467  h2_ele_PhiMnPhiTrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.phi()-mcIter->phi());
1468  h2_ele_PhiMnPhiTrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.phi()-mcIter->phi());
1469  h2_ele_PhiMnPhiTrueVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.phi()-mcIter->phi());
1470  h1_ele_PoPtrue->Fill( bestGsfElectron.p()/mcIter->p());
1471  h1_ele_PtoPttrue->Fill( bestGsfElectron.pt()/mcIter->pt());
1472  h2_ele_PoPtrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.p()/mcIter->p());
1473  h2_ele_PoPtrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.p()/mcIter->p());
1474  h2_ele_PoPtrueVsPt->Fill( bestGsfElectron.py(), bestGsfElectron.p()/mcIter->p());
1475 // if (passMiniAODSelection) { // Pt > 5.
1476  h2_ele_sigmaIetaIetaVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.scSigmaIEtaIEta());
1477 // }
1478  if (bestGsfElectron.isEB()) h1_ele_PoPtrue_barrel->Fill( bestGsfElectron.p()/mcIter->p());
1479  if (bestGsfElectron.isEE()) h1_ele_PoPtrue_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
1480  if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_PoPtrue_golden_barrel->Fill( bestGsfElectron.p()/mcIter->p());
1481  if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_PoPtrue_golden_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
1482  if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_PoPtrue_showering_barrel->Fill( bestGsfElectron.p()/mcIter->p());
1483  if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_PoPtrue_showering_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
1484  if (bestGsfElectron.isEB()) h1_ele_PtoPttrue_barrel->Fill( bestGsfElectron.pt()/mcIter->pt());
1485  if (bestGsfElectron.isEE()) h1_ele_PtoPttrue_endcaps->Fill( bestGsfElectron.pt()/mcIter->pt());
1487  if (bestGsfElectron.isEB()) h1_ele_ecalEnergyError_barrel->Fill(bestGsfElectron.correctedEcalEnergyError());
1488  if (bestGsfElectron.isEE()) h1_ele_ecalEnergyError_endcaps->Fill(bestGsfElectron.correctedEcalEnergyError());
1489  h1_ele_combinedP4Error->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION));
1490  if (bestGsfElectron.isEB()) h1_ele_combinedP4Error_barrel->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION));
1491  if (bestGsfElectron.isEE()) h1_ele_combinedP4Error_endcaps->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION));
1492 
1493  // supercluster related distributions
1494  reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
1495 
1496  h1_scl_En->Fill(bestGsfElectron.ecalEnergy());
1497  if (bestGsfElectron.isEB()) h1_scl_EoEtrue_barrel->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1498  if (bestGsfElectron.isEE()) h1_scl_EoEtrue_endcaps->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1499  if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap()) h1_scl_EoEtrue_barrel_etagap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1500  if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap()) h1_scl_EoEtrue_barrel_phigap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1501  if (bestGsfElectron.isEBEEGap()) h1_scl_EoEtrue_ebeegap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1502  if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap()) h1_scl_EoEtrue_endcaps_deegap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1503  if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap()) h1_scl_EoEtrue_endcaps_ringgap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1504  if (bestGsfElectron.isEB()) h1_scl_EoEtrue_barrel_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1505  if (bestGsfElectron.isEE()) h1_scl_EoEtrue_endcaps_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1506  if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap()) h1_scl_EoEtrue_barrel_new_etagap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1507  if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap()) h1_scl_EoEtrue_barrel_new_phigap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1508  if (bestGsfElectron.isEBEEGap()) h1_scl_EoEtrue_ebeegap_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1509  if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap()) h1_scl_EoEtrue_endcaps_new_deegap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1510  if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap()) h1_scl_EoEtrue_endcaps_new_ringgap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1511 
1512  double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
1513  double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
1514  h1_scl_Et->Fill(sclRef->energy()*(Rt/R));
1515  h2_scl_EtVsEta->Fill(sclRef->eta(),sclRef->energy()*(Rt/R));
1516  h2_scl_EtVsPhi->Fill(sclRef->phi(),sclRef->energy()*(Rt/R));
1517  h1_scl_Eta->Fill(sclRef->eta());
1518  h2_scl_EtaVsPhi->Fill(sclRef->phi(),sclRef->eta());
1519  h1_scl_Phi->Fill(sclRef->phi());
1520  h1_scl_SigEtaEta->Fill(bestGsfElectron.scSigmaEtaEta());
1521  if (bestGsfElectron.isEB()) h1_scl_SigEtaEta_barrel->Fill(bestGsfElectron.scSigmaEtaEta());
1522  if (bestGsfElectron.isEE()) h1_scl_SigEtaEta_endcaps->Fill(bestGsfElectron.scSigmaEtaEta());
1523  h1_scl_SigIEtaIEta->Fill(bestGsfElectron.scSigmaIEtaIEta());
1524  if (bestGsfElectron.isEB()) h1_scl_SigIEtaIEta_barrel->Fill(bestGsfElectron.scSigmaIEtaIEta());
1525  if (bestGsfElectron.isEE()) h1_scl_SigIEtaIEta_endcaps->Fill(bestGsfElectron.scSigmaIEtaIEta());
1526  if (passMiniAODSelection) { // Pt > 5.
1527  h1_scl_SigIEtaIEta_mAOD->Fill(bestGsfElectron.scSigmaIEtaIEta());
1528  if (bestGsfElectron.isEB()) h1_scl_SigIEtaIEta_mAOD_barrel->Fill(bestGsfElectron.scSigmaIEtaIEta());
1529  if (bestGsfElectron.isEE()) h1_scl_SigIEtaIEta_mAOD_endcaps->Fill(bestGsfElectron.scSigmaIEtaIEta());
1530  }
1532  if (bestGsfElectron.isEB()) h1_scl_full5x5_sigmaIetaIeta_barrel->Fill(bestGsfElectron.full5x5_sigmaIetaIeta());
1533  if (bestGsfElectron.isEE()) h1_scl_full5x5_sigmaIetaIeta_endcaps->Fill(bestGsfElectron.full5x5_sigmaIetaIeta());
1534  h1_scl_E1x5->Fill(bestGsfElectron.scE1x5());
1535  if (bestGsfElectron.isEB()) h1_scl_E1x5_barrel->Fill(bestGsfElectron.scE1x5());
1536  if (bestGsfElectron.isEE()) h1_scl_E1x5_endcaps->Fill(bestGsfElectron.scE1x5());
1537  h1_scl_E2x5max->Fill(bestGsfElectron.scE2x5Max());
1538  if (bestGsfElectron.isEB()) h1_scl_E2x5max_barrel->Fill(bestGsfElectron.scE2x5Max());
1539  if (bestGsfElectron.isEE()) h1_scl_E2x5max_endcaps->Fill(bestGsfElectron.scE2x5Max());
1540  h1_scl_E5x5->Fill(bestGsfElectron.scE5x5());
1541  if (bestGsfElectron.isEB()) h1_scl_E5x5_barrel->Fill(bestGsfElectron.scE5x5());
1542  if (bestGsfElectron.isEE()) h1_scl_E5x5_endcaps->Fill(bestGsfElectron.scE5x5());
1543  float pfEnergy=0. ;
1544  if (!bestGsfElectron.parentSuperCluster().isNull()) pfEnergy = bestGsfElectron.parentSuperCluster()->energy();
1545  h2_scl_EoEtruePfVsEg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p(),pfEnergy/mcIter->p());
1546  /*New from 06 05 2016*/
1547 // h1_scl_ESFrac->Fill( sclRef->preshowerEnergy() / sclRef->rawEnergy() );
1548  if (bestGsfElectron.isEE()) h1_scl_ESFrac_endcaps->Fill( sclRef->preshowerEnergy() / sclRef->rawEnergy() );
1549 
1550  float Etot = 0.;
1551  CaloCluster_iterator it = bestGsfElectron.superCluster()->clustersBegin();
1552  CaloCluster_iterator itend = bestGsfElectron.superCluster()->clustersEnd();
1553  for(; it !=itend;++it) {
1554  Etot += (*it)->energy();
1555  }
1556  h1_scl_bcl_EtotoEtrue->Fill( Etot/mcIter->p() );
1557  if (bestGsfElectron.isEB()) h1_scl_bcl_EtotoEtrue_barrel->Fill( Etot/mcIter->p() );
1558  if (bestGsfElectron.isEE()) h1_scl_bcl_EtotoEtrue_endcaps->Fill( Etot/mcIter->p() );
1559 
1560  // track related distributions
1561  h1_ele_ambiguousTracks->Fill( bestGsfElectron.ambiguousGsfTracksSize() );
1562  h2_ele_ambiguousTracksVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize() );
1563  h2_ele_ambiguousTracksVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize() );
1564  h2_ele_ambiguousTracksVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize() );
1565  if (!readAOD_) // track extra does not exist in AOD
1566  {
1567  h1_ele_foundHits->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
1568  if (bestGsfElectron.isEB()) h1_ele_foundHits_barrel->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
1569  if (bestGsfElectron.isEE()) h1_ele_foundHits_endcaps->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
1570  h2_ele_foundHitsVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
1571  if (passMiniAODSelection) { // Pt > 5.
1572  h2_ele_foundHitsVsEta_mAOD->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
1573  }
1574  h2_ele_foundHitsVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
1575  h2_ele_foundHitsVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
1576  h1_ele_lostHits->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
1577  if (bestGsfElectron.isEB()) h1_ele_lostHits_barrel->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
1578  if (bestGsfElectron.isEE()) h1_ele_lostHits_endcaps->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
1579  h2_ele_lostHitsVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
1580  h2_ele_lostHitsVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
1581  h2_ele_lostHitsVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
1582  h1_ele_chi2->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
1583  if (bestGsfElectron.isEB()) h1_ele_chi2_barrel->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
1584  if (bestGsfElectron.isEE()) h1_ele_chi2_endcaps->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
1585  h2_ele_chi2VsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2() );
1586  h2_ele_chi2VsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2() );
1587  h2_ele_chi2VsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2() );
1588  }
1589  // from gsf track interface, hence using mean
1590  if (!readAOD_) // track extra does not exist in AOD
1591  {
1592  h1_ele_PinMnPout->Fill( bestGsfElectron.gsfTrack()->innerMomentum().R() - bestGsfElectron.gsfTrack()->outerMomentum().R() );
1593  h1_ele_outerP->Fill( bestGsfElectron.gsfTrack()->outerMomentum().R() );
1594  h1_ele_outerPt->Fill( bestGsfElectron.gsfTrack()->outerMomentum().Rho() );
1595  }
1596  // from electron interface, hence using mode
1597  h1_ele_PinMnPout_mode->Fill( bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
1598  h2_ele_PinMnPoutVsEta_mode->Fill( bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
1599  h2_ele_PinMnPoutVsPhi_mode->Fill( bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
1600  h2_ele_PinMnPoutVsPt_mode->Fill( bestGsfElectron.pt(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
1601  h2_ele_PinMnPoutVsE_mode->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
1602  if (!readAOD_) // track extra does not exist in AOD
1603  {
1605  ( bestGsfElectron.gsfTrack()->normalizedChi2(),
1606  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() ) ;
1607  }
1608  h1_ele_outerP_mode->Fill( bestGsfElectron.trackMomentumOut().R() );
1609  h2_ele_outerPVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().R() );
1610  h1_ele_outerPt_mode->Fill( bestGsfElectron.trackMomentumOut().Rho() );
1611  h2_ele_outerPtVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().Rho() );
1612  h2_ele_outerPtVsPhi_mode->Fill(bestGsfElectron.phi(), bestGsfElectron.trackMomentumOut().Rho() );
1613  h2_ele_outerPtVsPt_mode->Fill(bestGsfElectron.pt(), bestGsfElectron.trackMomentumOut().Rho() );
1614 
1615  if (!readAOD_) // track extra does not exist in AOD
1616  {
1617  edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
1618  ElectronSeedRef elseed=seed.castTo<ElectronSeedRef>();
1619  h1_ele_seed_subdet2->Fill(elseed->subDet2());
1620  h1_ele_seed_mask->Fill(elseed->hitsMask());
1621  if (elseed->subDet2()==1)
1622  { h1_ele_seed_mask_bpix->Fill(elseed->hitsMask()); }
1623  else if (elseed->subDet2()==2)
1624  { h1_ele_seed_mask_fpix->Fill(elseed->hitsMask()); }
1625  else if (elseed->subDet2()==6)
1626  { h1_ele_seed_mask_tec->Fill(elseed->hitsMask()); }
1627 
1628  if ( elseed->dPhi2() != std::numeric_limits<float>::infinity() ) {
1629  h1_ele_seed_dphi2->Fill(elseed->dPhi2());
1630  h2_ele_seed_dphi2VsEta->Fill(bestGsfElectron.eta(), elseed->dPhi2());
1631  h2_ele_seed_dphi2VsPt->Fill(bestGsfElectron.pt(), elseed->dPhi2());
1632  }
1633  else {
1634  }
1635  if ( elseed->dPhi2Pos() != std::numeric_limits<float>::infinity() ) {
1636  h1_ele_seed_dphi2pos->Fill(elseed->dPhi2Pos());
1637  h2_ele_seed_dphi2posVsEta->Fill(bestGsfElectron.eta(), elseed->dPhi2Pos());
1638  h2_ele_seed_dphi2posVsPt->Fill(bestGsfElectron.pt(), elseed->dPhi2Pos());
1639  }
1640  if ( elseed->dRz2() != std::numeric_limits<float>::infinity() ) {
1641  h1_ele_seed_drz2->Fill(elseed->dRz2());
1642  h2_ele_seed_drz2VsEta->Fill(bestGsfElectron.eta(), elseed->dRz2());
1643  h2_ele_seed_drz2VsPt->Fill(bestGsfElectron.pt(), elseed->dRz2());
1644  }
1645  if ( elseed->dRz2Pos() != std::numeric_limits<float>::infinity() ) {
1646  h1_ele_seed_drz2pos->Fill(elseed->dRz2Pos());
1647  h2_ele_seed_drz2posVsEta->Fill(bestGsfElectron.eta(), elseed->dRz2Pos());
1648  h2_ele_seed_drz2posVsPt->Fill(bestGsfElectron.pt(), elseed->dRz2Pos());
1649  }
1650  }
1651 
1652  // match distributions
1653  h1_ele_EoP->Fill( bestGsfElectron.eSuperClusterOverP() );
1654  if (bestGsfElectron.isEB()) h1_ele_EoP_barrel->Fill( bestGsfElectron.eSuperClusterOverP() );
1655  if (bestGsfElectron.isEE()) h1_ele_EoP_endcaps->Fill( bestGsfElectron.eSuperClusterOverP() );
1656  h2_ele_EoPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSuperClusterOverP() );
1657  h2_ele_EoPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSuperClusterOverP() );
1658  h2_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSuperClusterOverP() );
1659  h1_ele_EseedOP->Fill( bestGsfElectron.eSeedClusterOverP() );
1660  if (bestGsfElectron.isEB()) h1_ele_EseedOP_barrel->Fill( bestGsfElectron.eSeedClusterOverP() );
1661  if (bestGsfElectron.isEE()) h1_ele_EseedOP_endcaps->Fill( bestGsfElectron.eSeedClusterOverP() );
1662  h2_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverP() );
1663  h2_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverP() );
1664  h2_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverP() );
1665  h1_ele_EoPout->Fill( bestGsfElectron.eSeedClusterOverPout() );
1666  if (bestGsfElectron.isEB()) h1_ele_EoPout_barrel->Fill( bestGsfElectron.eSeedClusterOverPout() );
1667  if (bestGsfElectron.isEE()) h1_ele_EoPout_endcaps->Fill( bestGsfElectron.eSeedClusterOverPout() );
1668  h2_ele_EoPoutVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout() );
1669  h2_ele_EoPoutVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout() );
1670  h2_ele_EoPoutVsE->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout() );
1671  h1_ele_EeleOPout->Fill( bestGsfElectron.eEleClusterOverPout() );
1672  if (bestGsfElectron.isEB()) h1_ele_EeleOPout_barrel->Fill( bestGsfElectron.eEleClusterOverPout() );
1673  if (bestGsfElectron.isEE()) h1_ele_EeleOPout_endcaps->Fill( bestGsfElectron.eEleClusterOverPout() );
1674  h2_ele_EeleOPoutVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout() );
1675  h2_ele_EeleOPoutVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout() );
1676  h2_ele_EeleOPoutVsE->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout() );
1678  if (passMiniAODSelection) { // Pt > 5.
1680  }
1681  if (bestGsfElectron.isEB()) h1_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1682  if (bestGsfElectron.isEE())h1_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1683  if (passMiniAODSelection) { // Pt > 5.
1684  if (bestGsfElectron.isEB()) h1_ele_dEtaSc_propVtx_mAOD_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1685  if (bestGsfElectron.isEE())h1_ele_dEtaSc_propVtx_mAOD_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1686  }
1687  h2_ele_dEtaScVsEta_propVtx->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1688  h2_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1689  h2_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1691  if (bestGsfElectron.isEB()) h1_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1692  if (bestGsfElectron.isEE())h1_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1693  h2_ele_dPhiScVsEta_propVtx->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1694  h2_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1695  h2_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1697  if (bestGsfElectron.isEB()) h1_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1698  if (bestGsfElectron.isEE()) h1_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1699  h2_ele_dEtaClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1700  h2_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1701  h2_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1703  if (passMiniAODSelection) { // Pt > 5.
1705  }
1706  if (bestGsfElectron.isEB()) h1_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1707  if (bestGsfElectron.isEE()) h1_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1708  if (passMiniAODSelection) { // Pt > 5.
1709  if (bestGsfElectron.isEB()) h1_ele_dPhiCl_propOut_mAOD_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1710  if (bestGsfElectron.isEE()) h1_ele_dPhiCl_propOut_mAOD_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1711  }
1712  h2_ele_dPhiClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1713  h2_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1714  h2_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1716  if (bestGsfElectron.isEB()) h1_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1717  if (bestGsfElectron.isEE()) h1_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1718  h2_ele_dEtaEleClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1719  h2_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1720  h2_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1722  if (bestGsfElectron.isEB()) h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1723  if (bestGsfElectron.isEE()) h1_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1724  h2_ele_dPhiEleClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1725  h2_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1726  h2_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1727  h1_ele_HoE->Fill(bestGsfElectron.hcalOverEcal());
1728  if (passMiniAODSelection) { // Pt > 5.
1729  h1_ele_HoE_mAOD->Fill(bestGsfElectron.hcalOverEcal());
1730  }
1731  h1_ele_HoE_bc->Fill(bestGsfElectron.hcalOverEcalBc());
1732  if (bestGsfElectron.isEB()) h1_ele_HoE_bc_barrel->Fill(bestGsfElectron.hcalOverEcalBc());
1733  if (bestGsfElectron.isEE()) h1_ele_HoE_bc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc());
1734  if (bestGsfElectron.isEB()) h1_ele_HoE_barrel->Fill(bestGsfElectron.hcalOverEcal());
1735  if (bestGsfElectron.isEE()) h1_ele_HoE_endcaps->Fill(bestGsfElectron.hcalOverEcal());
1736  if (passMiniAODSelection) { // Pt > 5.
1737  if (bestGsfElectron.isEB()) h1_ele_HoE_mAOD_barrel->Fill(bestGsfElectron.hcalOverEcal());
1738  if (bestGsfElectron.isEE()) h1_ele_HoE_mAOD_endcaps->Fill(bestGsfElectron.hcalOverEcal());
1739  }
1740  if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap()&& !bestGsfElectron.isEBEEGap() &&
1741  !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap()) h1_ele_HoE_fiducial->Fill(bestGsfElectron.hcalOverEcal());
1742  h2_ele_HoEVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.hcalOverEcal());
1743  h2_ele_HoEVsPhi->Fill(bestGsfElectron.phi(),bestGsfElectron.hcalOverEcal());
1744  h2_ele_HoEVsE->Fill(bestGsfElectron.caloEnergy(),bestGsfElectron.hcalOverEcal());
1745 
1746  //classes
1747  int eleClass = bestGsfElectron.classification();
1748  if (bestGsfElectron.isEE()) eleClass+=10;
1749  h1_ele_classes->Fill(eleClass);
1750 
1751  if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEB()) h1_scl_EoEtrueGolden_barrel->Fill(sclRef->energy()/mcIter->p());
1752  if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEE()) h1_scl_EoEtrueGolden_endcaps->Fill(sclRef->energy()/mcIter->p());
1753  if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEB()) h1_scl_EoEtrueShowering_barrel->Fill(sclRef->energy()/mcIter->p());
1754  if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEE()) h1_scl_EoEtrueShowering_endcaps->Fill(sclRef->energy()/mcIter->p());
1755 
1756  //eleClass = eleClass%100; // get rid of barrel/endcap distinction
1757  h1_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
1758  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_eta_golden->Fill(std::abs(bestGsfElectron.eta()));
1759  if (bestGsfElectron.classification() == GsfElectron::BIGBREM) h1_ele_eta_bbrem->Fill(std::abs(bestGsfElectron.eta()));
1760  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_eta_shower->Fill(std::abs(bestGsfElectron.eta()));
1761 
1762  // fbrem
1763 
1764  double fbrem_mode = bestGsfElectron.fbrem();
1765  h1_ele_fbrem->Fill(fbrem_mode);
1766  if (passMiniAODSelection) { // Pt > 5.
1767  h1_ele_fbrem_mAOD->Fill(fbrem_mode);
1768  }
1769  if (bestGsfElectron.isEB())
1770  {
1771  double fbrem_mode_barrel = bestGsfElectron.fbrem();
1772  h1_ele_fbrem_barrel->Fill(fbrem_mode_barrel);
1773  if (passMiniAODSelection) { // Pt > 5.
1774  h1_ele_fbrem_mAOD_barrel->Fill(fbrem_mode_barrel);
1775  }
1776  }
1777 
1778  if (bestGsfElectron.isEE())
1779  {
1780  double fbrem_mode_endcaps = bestGsfElectron.fbrem();
1781  h1_ele_fbrem_endcaps->Fill(fbrem_mode_endcaps);
1782  if (passMiniAODSelection) { // Pt > 5.
1783  h1_ele_fbrem_mAOD_endcaps->Fill(fbrem_mode_endcaps);
1784  }
1785  }
1786 
1787  double superclusterfbrem_mode = bestGsfElectron.superClusterFbrem();
1788  h1_ele_superclusterfbrem->Fill(superclusterfbrem_mode);
1789 
1790  if (bestGsfElectron.isEB())
1791  {
1792  double superclusterfbrem_mode_barrel = bestGsfElectron.superClusterFbrem();
1793  h1_ele_superclusterfbrem_barrel->Fill(superclusterfbrem_mode_barrel);
1794  }
1795 
1796  if (bestGsfElectron.isEE())
1797  {
1798  double superclusterfbrem_mode_endcaps = bestGsfElectron.superClusterFbrem();
1799  h1_ele_superclusterfbrem_endcaps->Fill(superclusterfbrem_mode_endcaps);
1800  }
1801 
1802  p1_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(),fbrem_mode);
1803 
1804  if (!readAOD_) // track extra does not exist in AOD
1805  {
1806  double fbrem_mean = 1. - bestGsfElectron.gsfTrack()->outerMomentum().R()/bestGsfElectron.gsfTrack()->innerMomentum().R() ;
1807  p1_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(),fbrem_mean) ;
1808  }
1809 
1810  //
1811 
1812  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
1813  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
1814  if (!readAOD_) // track extra not available in AOD
1815  {
1816  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
1817  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
1818  }
1819  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
1820  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
1821  if (!readAOD_) // track extra not available in AOD
1822  {
1823  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
1824  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
1825  }
1826 
1827  // provenance and pflow data
1828  h1_ele_mva->Fill(bestGsfElectron.mva_e_pi());
1829  if (bestGsfElectron.isEB()) h1_ele_mva_barrel->Fill(bestGsfElectron.mva_e_pi());
1830  if (bestGsfElectron.isEE()) h1_ele_mva_endcaps->Fill(bestGsfElectron.mva_e_pi());
1831  h1_ele_mva_isolated->Fill(bestGsfElectron.mva_Isolated());
1832  if (bestGsfElectron.isEB()) h1_ele_mva_barrel_isolated->Fill(bestGsfElectron.mva_Isolated());
1833  if (bestGsfElectron.isEE()) h1_ele_mva_endcaps_isolated->Fill(bestGsfElectron.mva_Isolated());
1834  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(1.);
1835  if (bestGsfElectron.trackerDrivenSeed()) h1_ele_provenance->Fill(-1.);
1836  if (bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(0.);
1837  if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(-2.);
1838  if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(2.);
1839 
1840  if (bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(1.);
1841  if (bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(-1.);
1842  if ((bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(0.);
1843  if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(-2.);
1844  if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(2.);
1845  if (bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(1.);
1846  if (bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(-1.);
1847  if ((bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(0.);
1848  if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(-2.);
1849  if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(2.);
1850 
1851  if (bestGsfElectron.isGsfCtfScPixChargeConsistent()) h1_ele_chargeInfo->Fill(-1.0);
1852  if (bestGsfElectron.isGsfScPixChargeConsistent()) h1_ele_chargeInfo->Fill(0.);
1853  if (bestGsfElectron.isGsfCtfChargeConsistent()) h1_ele_chargeInfo->Fill(1.0);
1854 
1855  // Pflow isolation
1857  if (bestGsfElectron.isEB()) h1_ele_chargedHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt);
1858  if (bestGsfElectron.isEE()) h1_ele_chargedHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt);
1859 
1861  if (bestGsfElectron.isEB()) h1_ele_neutralHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt);
1862  if (bestGsfElectron.isEE()) h1_ele_neutralHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt);
1863 
1865  if (bestGsfElectron.isEB()) h1_ele_photonIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt);
1866  if (bestGsfElectron.isEE()) h1_ele_photonIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt);
1867 
1868  // -- pflow over pT
1869  h1_ele_chargedHadronRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / bestGsfElectron.pt());
1870  if (bestGsfElectron.isEB()) h1_ele_chargedHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / bestGsfElectron.pt());
1871  if (bestGsfElectron.isEE()) h1_ele_chargedHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / bestGsfElectron.pt());
1872  if (passMiniAODSelection) { // Pt > 5.
1874  if (bestGsfElectron.isEB()) h1_ele_chargedHadronRelativeIso_mAOD_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / bestGsfElectron.pt());
1875  if (bestGsfElectron.isEE()) h1_ele_chargedHadronRelativeIso_mAOD_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / bestGsfElectron.pt());
1876  }
1877 
1878  h1_ele_neutralHadronRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt());
1879  if (bestGsfElectron.isEB()) h1_ele_neutralHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt());
1880  if (bestGsfElectron.isEE()) h1_ele_neutralHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt());
1881  if (passMiniAODSelection) { // Pt > 5.
1883  if (bestGsfElectron.isEB()) h1_ele_neutralHadronRelativeIso_mAOD_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt());
1884  if (bestGsfElectron.isEE()) h1_ele_neutralHadronRelativeIso_mAOD_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt());
1885  }
1886 
1887  h1_ele_photonRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt());
1888  if (bestGsfElectron.isEB()) h1_ele_photonRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt());
1889  if (bestGsfElectron.isEE()) h1_ele_photonRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt());
1890  if (passMiniAODSelection) { // Pt > 5.
1891  h1_ele_photonRelativeIso_mAOD->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt());
1892  if (bestGsfElectron.isEB()) h1_ele_photonRelativeIso_mAOD_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt());
1893  if (bestGsfElectron.isEE()) h1_ele_photonRelativeIso_mAOD_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt());
1894  }
1895 
1896  // isolation
1897  h1_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
1898  if (bestGsfElectron.isEB()) h1_ele_tkSumPt_dr03_barrel->Fill(bestGsfElectron.dr03TkSumPt());
1899  if (bestGsfElectron.isEE()) h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt());
1901  if (bestGsfElectron.isEB()) h1_ele_ecalRecHitSumEt_dr03_barrel->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
1902  if (bestGsfElectron.isEE()) h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
1904  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
1905  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
1907  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
1908  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
1910  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEtBc());
1911  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEtBc());
1913  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEtBc());
1914  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEtBc());
1915  h1_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
1916  if (bestGsfElectron.isEB()) h1_ele_tkSumPt_dr04_barrel->Fill(bestGsfElectron.dr04TkSumPt());
1917  if (bestGsfElectron.isEE()) h1_ele_tkSumPt_dr04_endcaps->Fill(bestGsfElectron.dr04TkSumPt());
1919  if (bestGsfElectron.isEB()) h1_ele_ecalRecHitSumEt_dr04_barrel->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
1920  if (bestGsfElectron.isEE()) h1_ele_ecalRecHitSumEt_dr04_endcaps->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
1922  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
1923  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
1925  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
1926  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
1927 
1929  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEtBc());
1930  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEtBc());
1932  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEtBc());
1933  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEtBc());
1934 
1936  if (bestGsfElectron.isEB()) h1_ele_hcalDepth1OverEcalBc_barrel->Fill(bestGsfElectron.hcalDepth1OverEcalBc());
1937  if (bestGsfElectron.isEE()) h1_ele_hcalDepth1OverEcalBc_endcaps->Fill(bestGsfElectron.hcalDepth1OverEcalBc());
1939  if (bestGsfElectron.isEB()) h1_ele_hcalDepth2OverEcalBc_barrel->Fill(bestGsfElectron.hcalDepth2OverEcalBc());
1940  if (bestGsfElectron.isEE()) h1_ele_hcalDepth2OverEcalBc_endcaps->Fill(bestGsfElectron.hcalDepth2OverEcalBc());
1941 
1942  // conversion rejection
1943  int flags = bestGsfElectron.convFlags() ;
1944  if (flags==-9999) { flags=-1 ; }
1945  h1_ele_convFlags->Fill(flags);
1946  if (flags>=0.)
1947  {
1948  h1_ele_convDist->Fill( bestGsfElectron.convDist() );
1949  h1_ele_convDcot->Fill( bestGsfElectron.convDcot() );
1950  h1_ele_convRadius->Fill( bestGsfElectron.convRadius() );
1951  }
1952 
1953  } // loop over mc particle
1954  h1_mcNum->Fill(mcNum) ;
1955  h1_eleNum->Fill(eleNum) ;
1956  }
1957 
1958 
const PflowIsolationVariables & pfIsolationVariables() const
Definition: GsfElectron.h:670
MonitorElement * h1_ele_ecalEnergyError_endcaps
MonitorElement * h1_scl_EoEtrue_endcaps_ringgap
T getParameter(std::string const &) const
virtual double pt() const final
transverse momentum
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth1_endcaps
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth1_barrel
MonitorElement * h1_ele_ecalRecHitSumEt_dr04_barrel
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth1_barrel
MonitorElement * h1_ele_ecalRecHitSumEt_dr03_endcaps
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsEcalFull04Tag_
SuperClusterRef parentSuperCluster() const
Definition: GsfElectron.h:190
float scSigmaEtaEta() const
Definition: GsfElectron.h:482
bool isEBEtaGap() const
Definition: GsfElectron.h:357
float dr03HcalDepth1TowerSumEtBc() const
Definition: GsfElectron.h:548
edm::EDGetTokenT< reco::GsfElectronCollection > electronCollection_
MonitorElement * h1_ele_photonRelativeIso_mAOD
MonitorElement * bookH2withSumw2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth2
float eSuperClusterOverP() const
Definition: GsfElectron.h:245
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsTk03Tag_
bool isEBEEGap() const
Definition: GsfElectron.h:355
float dr04HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:556
virtual double eta() const final
momentum pseudorapidity
MonitorElement * h1_scl_bcl_EtotoEtrue_endcaps
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * h1_ele_hcalDepth1OverEcalBc_barrel
MonitorElement * h1_ele_photonRelativeIso_mAOD_barrel
MonitorElement * h1_ele_neutralHadronRelativeIso_endcaps
virtual const Point & vertex() const
vertex position (overwritten by PF...)
MonitorElement * h1_ele_neutralHadronRelativeIso_barrel
MonitorElement * h1_ele_dPhiEleCl_propOut_endcaps
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:291
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth2_endcaps
MonitorElement * h2_ele_dEtaEleClVsEta_propOut
edm::EDGetTokenT< reco::GenParticleCollection > mcTruthCollection_
MonitorElement * h1_ele_chargedHadronRelativeIso_mAOD_endcaps
MonitorElement * bookH1withSumw2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
MonitorElement * h1_ele_dEtaSc_propVtx_endcaps
float p4Error(P4Kind kind) const
Definition: GsfElectron.cc:237
MonitorElement * h1_ele_dEtaSc_propVtx_all_endcaps
MonitorElement * h1_ele_dPhiCl_propOut_all_endcaps
float dr04TkSumPt() const
Definition: GsfElectron.h:554
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
MonitorElement * h1_ele_chargedHadronRelativeIso
MonitorElement * h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
bool isEERingGap() const
Definition: GsfElectron.h:361
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsHcal04Tag_
MonitorElement * bookH2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsEcalReduced03Tag_
MonitorElement * h1_ele_hcalTowerSumEtBc_dr03_depth1
MonitorElement * h2_ele_PtinVsPtoutShowering_mode
MonitorElement * h1_ele_PoPtrue_showering_barrel
float dr03HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:546
float fbrem() const
Definition: GsfElectron.h:750
MonitorElement * h1_ele_hcalDepth2OverEcalBc_barrel
float scE2x5Max() const
Definition: GsfElectron.h:485
MonitorElement * h2_scl_EoEtrueVsrecOfflineVertices_endcaps
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth1_endcaps
float convDist() const
Definition: GsfElectron.h:605
float convRadius() const
Definition: GsfElectron.h:607
uint16_t size_type
bool isEEDeeGap() const
Definition: GsfElectron.h:360
MonitorElement * h1_ele_chargedHadronIso_endcaps
float superClusterFbrem() const
Definition: GsfElectron.h:744
MonitorElement * h2_ele_dPhiEleClVsPhi_propOut
bool isEE() const
Definition: GsfElectron.h:353
bool isEB() const
Definition: GsfElectron.h:352
MonitorElement * h1_ele_neutralHadronIso_endcaps
MonitorElement * h2_ele_PtinVsPtoutGolden_mean
MonitorElement * h2_ele_dEtaEleClVsPhi_propOut
MonitorElement * h1_ele_dPhiSc_propVtx_all_endcaps
void Fill(long long x)
const Double_t pi
float convDcot() const
Definition: GsfElectron.h:606
float full5x5_sigmaIetaIeta() const
Definition: GsfElectron.h:455
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth1
edm::EDGetTokenT< reco::GsfElectronCoreCollection > electronCoreCollection_
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth2
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD_endcaps
bool isGsfScPixChargeConsistent() const
Definition: GsfElectron.h:155
virtual double phi() const final
momentum azimuthal angle
MonitorElement * h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
virtual int charge() const final
electric charge
Definition: LeafCandidate.h:91
float dr04HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:557
MonitorElement * h1_ele_PoPtrue_showering_endcaps
MonitorElement * h1_ele_hcalDepth2OverEcalBc_endcaps
MonitorElement * h1_ele_chargedHadronRelativeIso_endcaps
MonitorElement * h2_ele_PtinVsPtoutGolden_mode
MonitorElement * h1_ele_neutralHadronIso_barrel
edm::EDGetTokenT< reco::VertexCollection > offlineVerticesCollection_
bool isGsfCtfChargeConsistent() const
Definition: GsfElectron.h:156
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:249
int iEvent
Definition: GenABIO.cc:230
MonitorElement * h1_ele_dEtaEleCl_propOut_endcaps
float dr03HcalDepth2TowerSumEtBc() const
Definition: GsfElectron.h:549
float eSeedClusterOverP() const
Definition: GsfElectron.h:246
MonitorElement * h1_ele_dPhiCl_propOut_mAOD_endcaps
MonitorElement * h1_ele_dPhiSc_propVtx_endcaps
float dr04EcalRecHitSumEt() const
Definition: GsfElectron.h:555
float deltaPhiSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:253
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
virtual int pdgId() const =0
PDG identifier.
T sqrt(T t)
Definition: SSEVec.h:18
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:184
math::XYZVectorF trackMomentumOut() const
Definition: GsfElectron.h:293
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Definition: GsfElectron.h:627
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:252
MonitorElement * h2_ele_dPhiEleClVsEta_propOut
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
float hcalOverEcal() const
Definition: GsfElectron.h:442
const double infinity
MonitorElement * h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps
float dr04HcalDepth1TowerSumEtBc() const
Definition: GsfElectron.h:559
float dr03TkSumPt() const
Definition: GsfElectron.h:543
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * h1_scl_EoEtrueShowering_endcaps
virtual double p() const final
magnitude of momentum vector
float dr03HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:545
MonitorElement * h1_ele_hcalDepth1OverEcalBc_endcaps
float eEleClusterOverPout() const
Definition: GsfElectron.h:248
MonitorElement * h1_ele_chargedHadronIso_barrel
MonitorElement * h1_ele_dEtaSc_propVtx_all_barrel
void setBookPrefix(const std::string &)
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
Definition: GsfElectron.h:626
MonitorElement * h1_ele_dPhiCl_propOut_mAOD_barrel
MonitorElement * h1_scl_SigIEtaIEta_mAOD_endcaps
float eSeedClusterOverPout() const
Definition: GsfElectron.h:247
MonitorElement * h1_ele_ecalEnergyError_barrel
bool isValid() const
Definition: HandleBase.h:74
float hcalOverEcalBc() const
Definition: GsfElectron.h:446
float scSigmaIEtaIEta() const
Definition: GsfElectron.h:483
edm::EDGetTokenT< reco::GsfTrackCollection > electronTrackCollection_
MonitorElement * h1_ele_neutralHadronRelativeIso
bool isNull() const
Checks for null.
Definition: Ref.h:250
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth1
MonitorElement * h1_ele_combinedP4Error_barrel
edm::Ref< GsfElectronCollection > GsfElectronRef
reference to an object in a collection of GsfElectron objects
float deltaPhiEleClusterTrackAtCalo() const
Definition: GsfElectron.h:254
MonitorElement * bookP1(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="E1 P")
MonitorElement * h1_ele_dPhiSc_propVtx_all_barrel
MonitorElement * h1_ele_hcalTowerSumEtBc_dr04_depth1
MonitorElement * h1_scl_EoEtrueShowering_barrel
void setBookEfficiencyFlag(const bool &)
MonitorElement * h1_ele_chargedHadronRelativeIso_mAOD_barrel
MonitorElement * h1_ele_superclusterfbrem_endcaps
MonitorElement * h1_ele_dPhiEleCl_propOut_barrel
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsTk04Tag_
MonitorElement * h2_scl_EoEtrueVsrecOfflineVertices
MonitorElement * h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * h1_scl_EoEtrue_barrel_new_etagap
MonitorElement * h1_ele_hcalTowerSumEtBc_dr03_depth2
T const * product() const
Definition: Handle.h:81
float deltaEtaEleClusterTrackAtCalo() const
Definition: GsfElectron.h:251
MonitorElement * h1_ele_photonRelativeIso_endcaps
MonitorElement * h1_scl_full5x5_sigmaIetaIeta_endcaps
Classification classification() const
Definition: GsfElectron.h:746
float hcalDepth2OverEcalBc() const
Definition: GsfElectron.h:445
REF castTo() const
Definition: RefToBase.h:286
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD
MonitorElement * h1_ele_neutralHadronRelativeIso_mAOD_barrel
MonitorElement * h1_ele_photonRelativeIso_mAOD_endcaps
GsfTrackRefVector::size_type ambiguousGsfTracksSize() const
Definition: GsfElectron.h:701
float dr04HcalDepth2TowerSumEtBc() const
Definition: GsfElectron.h:560
MonitorElement * h1_ele_dEtaCl_propOut_endcaps
ElectronMcSignalValidator(const edm::ParameterSet &conf)
MonitorElement * h2_ele_PinVsPoutShowering_mean
MonitorElement * h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel
MonitorElement * h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps
MonitorElement * h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel
float ecalEnergy() const
Definition: GsfElectron.h:837
float mva_Isolated() const
Definition: GsfElectron.h:680
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:544
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
float mva_e_pi() const
Definition: GsfElectron.h:681
MonitorElement * h1_ele_dPhiCl_propOut_all_barrel
MonitorElement * h1_ele_dEtaCl_propOut_all_barrel
float correctedEcalEnergyError() const
Definition: GsfElectron.h:824
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsEcalFull03Tag_
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth2_barrel
edm::EventID id() const
Definition: EventBase.h:60
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:250
T perp() const
Magnitude of transverse component.
fixed size matrix
MonitorElement * h1_ele_superclusterfbrem_barrel
MonitorElement * h1_ele_combinedP4Error_endcaps
int convFlags() const
Definition: GsfElectron.h:603
MonitorElement * h1_ele_ecalRecHitSumEt_dr03_barrel
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
bool isEBPhiGap() const
Definition: GsfElectron.h:358
MonitorElement * h1_scl_EoEtrue_endcaps_new_deegap
MonitorElement * h1_ele_dEtaSc_propVtx_mAOD_barrel
bool isGsfCtfScPixChargeConsistent() const
Definition: GsfElectron.h:154
bool trackerDrivenSeed() const
Definition: GsfElectron.h:189
MonitorElement * h2_ele_PinVsPoutShowering_mode
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth2_endcaps
MonitorElement * h1_scl_full5x5_sigmaIetaIeta_barrel
const Point & position() const
position
Definition: BeamSpot.h:62
MonitorElement * bookH1(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
MonitorElement * h1_ele_ecalRecHitSumEt_dr04_endcaps
MonitorElement * h1_ele_dEtaCl_propOut_all_endcaps
float scE5x5() const
Definition: GsfElectron.h:486
float hcalDepth1OverEcalBc() const
Definition: GsfElectron.h:444
MonitorElement * h1_ele_chargedHadronRelativeIso_barrel
MonitorElement * h1_ele_photonRelativeIso_barrel
MonitorElement * h1_scl_SigIEtaIEta_mAOD_barrel
virtual size_type numberOfDaughters() const =0
number of daughters
void setBookStatOverflowFlag(const bool &)
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:625
float caloEnergy() const
Definition: GsfElectron.h:840
MonitorElement * h1_ele_hcalTowerSumEtBc_dr04_depth2
MonitorElement * h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps
MonitorElement * h1_scl_EoEtrue_barrel_new_phigap
MonitorElement * h2_ele_PtinVsPtoutShowering_mean
MonitorElement * h1_scl_EoEtrue_endcaps_new_ringgap
MonitorElement * h1_scl_EoEtrue_endcaps_deegap
MonitorElement * h1_ele_chargedHadronRelativeIso_mAOD
MonitorElement * h1_ele_dEtaEleCl_propOut_barrel
edm::EDGetTokenT< reco::ElectronSeedCollection > electronSeedCollection_
MonitorElement * h1_ele_dEtaSc_propVtx_mAOD_endcaps
MonitorElement * h2_scl_EoEtrueVsrecOfflineVertices_barrel
virtual double py() const final
y coordinate of momentum vector
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsEcalReduced04Tag_
MonitorElement * h1_ele_dPhiCl_propOut_endcaps
MonitorElement * h1_ele_PoPtrue_golden_endcaps
Definition: Run.h:42
float scE1x5() const
Definition: GsfElectron.h:484
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:185
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsHcal03Tag_
bool ecalDrivenSeed() const
Definition: GsfElectron.h:188
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth2_barrel