CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ElectronMcSignalValidator.cc
Go to the documentation of this file.
1 
2 // user include files
4 
6 
7 //#include "DQMServices/Core/interface/DQMStore.h"
9 
19 
22 
29 
30 #include "CLHEP/Units/GlobalPhysicalConstants.h"
31 #include "TMath.h"
32 #include "TFile.h"
33 #include "TH1F.h"
34 #include "TH1I.h"
35 #include "TH2F.h"
36 #include "TProfile.h"
37 #include "TTree.h"
38 #include <vector>
39 #include <iostream>
40 
41 using namespace reco;
42 
45  {
46  //outputFile_ = conf.getParameter<std::string>("outputFile");
47  mcTruthCollection_ = consumes<reco::GenParticleCollection> (
48  conf.getParameter<edm::InputTag>("mcTruthCollection"));
49  electronCollection_ = consumes<reco::GsfElectronCollection> (
50  conf.getParameter<edm::InputTag>("electronCollection"));
51  electronCoreCollection_ = consumes<reco::GsfElectronCoreCollection> (
52  conf.getParameter<edm::InputTag>("electronCoreCollection"));
53  electronTrackCollection_ = consumes<reco::GsfTrackCollection> (
54  conf.getParameter<edm::InputTag>("electronTrackCollection"));
55  electronSeedCollection_ = consumes<reco::ElectronSeedCollection> (
56  conf.getParameter<edm::InputTag>("electronSeedCollection"));
57  beamSpotTag_ = consumes<reco::BeamSpot> (
58  conf.getParameter<edm::InputTag>("beamSpot"));
59 
60  readAOD_ = conf.getParameter<bool>("readAOD");
61 
62  isoFromDepsTk03Tag_ = consumes<edm::ValueMap<double> > (
63  conf.getParameter<edm::InputTag>( "isoFromDepsTk03"));
64  isoFromDepsTk04Tag_ = consumes<edm::ValueMap<double> > (
65  conf.getParameter<edm::InputTag>( "isoFromDepsTk04"));
66  isoFromDepsEcalFull03Tag_ = consumes<edm::ValueMap<double> > (
67  conf.getParameter<edm::InputTag>( "isoFromDepsEcalFull03"));
68  isoFromDepsEcalFull04Tag_ = consumes<edm::ValueMap<double> > (
69  conf.getParameter<edm::InputTag>( "isoFromDepsEcalFull04"));
70  isoFromDepsEcalReduced03Tag_ = consumes<edm::ValueMap<double> >(
71  conf.getParameter<edm::InputTag>( "isoFromDepsEcalReduced03"));
72  isoFromDepsEcalReduced04Tag_ = consumes<edm::ValueMap<double> > (
73  conf.getParameter<edm::InputTag>( "isoFromDepsEcalReduced04"));
74  isoFromDepsHcal03Tag_ = consumes<edm::ValueMap<double> > (
75  conf.getParameter<edm::InputTag>( "isoFromDepsHcal03"));
76  isoFromDepsHcal04Tag_ = consumes<edm::ValueMap<double> > (
77  conf.getParameter<edm::InputTag>( "isoFromDepsHcal04"));
78 
79  maxPt_ = conf.getParameter<double>("MaxPt");
80  maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
81  deltaR_ = conf.getParameter<double>("DeltaR");
82  matchingIDs_ = conf.getParameter<std::vector<int> >("MatchingID");
83  matchingMotherIDs_ = conf.getParameter<std::vector<int> >("MatchingMotherID");
84 
85  // histos bining and limits
86 
87  edm::ParameterSet histosSet = conf.getParameter<edm::ParameterSet>("histosCfg") ;
88 
89  xyz_nbin=histosSet.getParameter<int>("Nbinxyz");
90 
91  p_nbin=histosSet.getParameter<int>("Nbinp");
92  p2D_nbin=histosSet.getParameter<int>("Nbinp2D");
93  p_max=histosSet.getParameter<double>("Pmax");
94 
95  pt_nbin=histosSet.getParameter<int>("Nbinpt");
96  pt2D_nbin=histosSet.getParameter<int>("Nbinpt2D");
97  pteff_nbin=histosSet.getParameter<int>("Nbinpteff");
98  pt_max=histosSet.getParameter<double>("Ptmax");
99 
100  fhits_nbin=histosSet.getParameter<int>("Nbinfhits");
101  fhits_max=histosSet.getParameter<double>("Fhitsmax");
102 
103  lhits_nbin=histosSet.getParameter<int>("Nbinlhits");
104  lhits_max=histosSet.getParameter<double>("Lhitsmax");
105 
106  eop_nbin=histosSet.getParameter<int>("Nbineop");
107  eop2D_nbin=histosSet.getParameter<int>("Nbineop2D");
108  eop_max=histosSet.getParameter<double>("Eopmax");
109  eopmaxsht=histosSet.getParameter<double>("Eopmaxsht");
110 
111  eta_nbin=histosSet.getParameter<int>("Nbineta");
112  eta2D_nbin=histosSet.getParameter<int>("Nbineta2D");
113  eta_min=histosSet.getParameter<double>("Etamin");
114  eta_max=histosSet.getParameter<double>("Etamax");
115 
116  deta_nbin=histosSet.getParameter<int>("Nbindeta");
117  deta_min=histosSet.getParameter<double>("Detamin");
118  deta_max=histosSet.getParameter<double>("Detamax");
119 
120  phi_nbin=histosSet.getParameter<int>("Nbinphi");
121  phi2D_nbin=histosSet.getParameter<int>("Nbinphi2D");
122  phi_min=histosSet.getParameter<double>("Phimin");
123  phi_max=histosSet.getParameter<double>("Phimax");
124 
125  detamatch_nbin=histosSet.getParameter<int>("Nbindetamatch");
126  detamatch2D_nbin=histosSet.getParameter<int>("Nbindetamatch2D");
127  detamatch_min=histosSet.getParameter<double>("Detamatchmin");
128  detamatch_max=histosSet.getParameter<double>("Detamatchmax");
129 
130  dphi_nbin=histosSet.getParameter<int>("Nbindphi");
131  dphi_min=histosSet.getParameter<double>("Dphimin");
132  dphi_max=histosSet.getParameter<double>("Dphimax");
133 
134  dphimatch_nbin=histosSet.getParameter<int>("Nbindphimatch");
135  dphimatch2D_nbin=histosSet.getParameter<int>("Nbindphimatch2D");
136  dphimatch_min=histosSet.getParameter<double>("Dphimatchmin");
137  dphimatch_max=histosSet.getParameter<double>("Dphimatchmax");
138 
139  poptrue_nbin= histosSet.getParameter<int>("Nbinpoptrue");
140  poptrue_min=histosSet.getParameter<double>("Poptruemin");
141  poptrue_max=histosSet.getParameter<double>("Poptruemax");
142 
143  mee_nbin= histosSet.getParameter<int>("Nbinmee");
144  mee_min=histosSet.getParameter<double>("Meemin");
145  mee_max=histosSet.getParameter<double>("Meemax");
146 
147  hoe_nbin= histosSet.getParameter<int>("Nbinhoe");
148  hoe_min=histosSet.getParameter<double>("Hoemin");
149  hoe_max=histosSet.getParameter<double>("Hoemax");
150 
151  error_nbin=histosSet.getParameter<int>("Nbinerror");
152  enerror_max=histosSet.getParameter<double>("Energyerrormax");
153 
154  // so to please coverity...
155  h1_mcNum = 0 ;
156  h1_eleNum = 0 ;
157  h1_gamNum = 0 ;
158 
159  h1_recEleNum = 0 ;
160  h1_recCoreNum = 0 ;
161  h1_recTrackNum = 0 ;
162  h1_recSeedNum = 0 ;
163 
164  h1_mc_Eta = 0 ;
165  h1_mc_AbsEta = 0 ;
166  h1_mc_P = 0 ;
167  h1_mc_Pt = 0 ;
168  h1_mc_Phi = 0 ;
169  h1_mc_Z = 0 ;
170  h2_mc_PtEta = 0 ;
171 
172  h1_mc_Eta_matched = 0 ;
174  h1_mc_Pt_matched = 0 ;
175  h1_mc_Phi_matched = 0 ;
176  h1_mc_Z_matched = 0 ;
177  h2_mc_PtEta_matched = 0 ;
178 
184 
185  h1_ele_EoverP_all = 0 ;
188  h1_ele_EseedOP_all = 0 ;
191  h1_ele_EoPout_all = 0 ;
209  h1_ele_TIP_all = 0 ;
212  h1_ele_HoE_all = 0 ;
216  h1_ele_vertexPt_all = 0 ;
217  h1_ele_Et_all = 0 ;
218  h1_ele_mee_all = 0 ;
219  h1_ele_mee_os = 0 ;
220  h1_ele_mee_os_ebeb = 0 ;
221  h1_ele_mee_os_ebee = 0 ;
222  h1_ele_mee_os_eeee = 0 ;
223  h1_ele_mee_os_gg = 0 ;
224  h1_ele_mee_os_gb = 0 ;
225  h1_ele_mee_os_bb = 0 ;
226 
229 
230  h1_ele_charge = 0 ;
231  h2_ele_chargeVsEta = 0 ;
232  h2_ele_chargeVsPhi = 0 ;
233  h2_ele_chargeVsPt = 0 ;
234  h1_ele_vertexP = 0 ;
235  h1_ele_vertexPt = 0 ;
236  h1_ele_Et = 0 ;
240  h1_ele_vertexEta = 0 ;
242  h1_ele_vertexAbsEta = 0 ;
243  h1_ele_vertexPhi = 0 ;
244  h1_ele_vertexX = 0 ;
245  h1_ele_vertexY = 0 ;
246  h1_ele_vertexZ = 0 ;
247  h1_ele_vertexTIP = 0 ;
251 
252  h1_scl_En = 0 ;
271  h1_scl_Et = 0 ;
272  h2_scl_EtVsEta = 0 ;
273  h2_scl_EtVsPhi = 0 ;
274  h2_scl_EtaVsPhi = 0 ;
275  h1_scl_Eta = 0 ;
276  h1_scl_Phi = 0 ;
277 
279 
280  h1_scl_SigEtaEta = 0 ;
283  h1_scl_SigIEtaIEta = 0 ;
286  h1_scl_E1x5 = 0 ;
287  h1_scl_E1x5_barrel = 0 ;
288  h1_scl_E1x5_endcaps = 0 ;
289  h1_scl_E2x5max = 0 ;
292  h1_scl_E5x5 = 0 ;
293  h1_scl_E5x5_barrel = 0 ;
294  h1_scl_E5x5_endcaps = 0 ;
295  h1_scl_SigEtaEta_eg = 0 ;
301  h1_scl_E1x5_eg = 0 ;
304  h1_scl_E2x5max_eg = 0 ;
307  h1_scl_E5x5_eg = 0 ;
310 
315  h1_ele_foundHits = 0 ;
321  h1_ele_lostHits = 0 ;
326  h2_ele_lostHitsVsPt = 0 ;
327  h1_ele_chi2 = 0 ;
328  h1_ele_chi2_barrel = 0 ;
329  h1_ele_chi2_endcaps = 0 ;
330  h2_ele_chi2VsEta = 0 ;
331  h2_ele_chi2VsPhi = 0 ;
332  h2_ele_chi2VsPt = 0 ;
333 
334  h1_ele_PoPtrue = 0 ;
335  h1_ele_PtoPttrue = 0 ;
336  h2_ele_PoPtrueVsEta = 0 ;
337  h2_ele_PoPtrueVsPhi = 0 ;
338  h2_ele_PoPtrueVsPt = 0 ;
348  h1_ele_EtaMnEtaTrue = 0 ;
354  h1_ele_PhiMnPhiTrue = 0 ;
361  h1_ele_PinMnPout = 0 ;
368 
369  h1_ele_outerP = 0 ;
370  h1_ele_outerP_mode = 0 ;
372  h1_ele_outerPt = 0 ;
373  h1_ele_outerPt_mode = 0 ;
377  h1_ele_EoP = 0 ;
378  h1_ele_EoP_barrel = 0 ;
379  h1_ele_EoP_endcaps = 0 ;
380  h1_ele_EoP_eg = 0 ;
383  h2_ele_EoPVsEta = 0 ;
384  h2_ele_EoPVsPhi = 0 ;
385  h2_ele_EoPVsE = 0 ;
386  h1_ele_EseedOP = 0 ;
389  h1_ele_EseedOP_eg = 0 ;
392  h2_ele_EseedOPVsEta = 0 ;
393  h2_ele_EseedOPVsPhi = 0 ;
394  h2_ele_EseedOPVsE = 0 ;
395  h1_ele_EoPout = 0 ;
398  h1_ele_EoPout_eg = 0 ;
401  h2_ele_EoPoutVsEta = 0 ;
402  h2_ele_EoPoutVsPhi = 0 ;
403  h2_ele_EoPoutVsE = 0 ;
404  h1_ele_EeleOPout = 0 ;
407  h1_ele_EeleOPout_eg = 0 ;
412  h2_ele_EeleOPoutVsE = 0 ;
413 
468 
469  h1_ele_seed_subdet2 = 0 ;
470  h1_ele_seed_mask = 0 ;
474  h1_ele_seed_dphi2 = 0 ;
480  h1_ele_seed_drz2 = 0 ;
483  h1_ele_seed_drz2pos = 0 ;
486 
487  h1_ele_classes = 0 ;
488  h1_ele_eta = 0 ;
489  h1_ele_eta_golden = 0 ;
490  h1_ele_eta_bbrem = 0 ;
491  h1_ele_eta_shower = 0 ;
492 
493  h1_ele_HoE = 0 ;
494  h1_ele_HoE_barrel = 0 ;
495  h1_ele_HoE_endcaps = 0 ;
496  h1_ele_HoE_eg = 0 ;
499  h1_ele_HoE_fiducial = 0 ;
500  h2_ele_HoEVsEta = 0 ;
501  h2_ele_HoEVsPhi = 0 ;
502  h2_ele_HoEVsE = 0 ;
503 
504  h1_ele_fbrem = 0 ;
505  h1_ele_fbrem_eg = 0 ;
508 
521 
522  h1_ele_mva = 0 ;
523  h1_ele_mva_eg = 0 ;
524  h1_ele_provenance = 0 ;
525 
526  // isolation
527  h1_ele_tkSumPt_dr03 = 0 ;
537  h1_ele_tkSumPt_dr04 = 0 ;
547 
556 
557  // conversions
558  h1_ele_convFlags = 0 ;
560  h1_ele_convDist = 0 ;
561  h1_ele_convDist_all = 0 ;
562  h1_ele_convDcot = 0 ;
563  h1_ele_convDcot_all = 0 ;
564  h1_ele_convRadius = 0 ;
566  }
567 
569  {
570 // prepareStore() ;
571 // setStoreFolder("EgammaV/ElectronMcSignalValidator") ;
572  setBookIndex(-1) ;
573  setBookPrefix("h") ;
574 
575  // mc truth collections sizes
576  h1_mcNum = bookH1withSumw2("mcNum","# mc particles",fhits_nbin,0.,fhits_max,"N_{gen}" );
577  h1_eleNum = bookH1withSumw2("mcNum_ele","# mc electrons",fhits_nbin,0.,fhits_max,"N_{gen ele}");
578  h1_gamNum = bookH1withSumw2("mcNum_gam","# mc gammas",fhits_nbin,0.,fhits_max,"N_{gen #gamma}");
579 
580  // rec event collections sizes
581  h1_recEleNum = bookH1("recEleNum","# rec electrons",11, -0.5,10.5,"N_{ele}");
582  h1_recCoreNum = bookH1("recCoreNum","# rec electron cores",21, -0.5,20.5,"N_{core}");
583  h1_recTrackNum = bookH1("recTrackNum","# rec gsf tracks",41, -0.5,40.5,"N_{track}");
584  h1_recSeedNum = bookH1("recSeedNum","# rec electron seeds",101, -0.5,100.5,"N_{seed}");
585 
586  // mc
587  setBookPrefix("h_mc") ;
588  h1_mc_Eta = bookH1withSumw2("Eta","gen #eta",eta_nbin,eta_min,eta_max,"#eta");
589  h1_mc_AbsEta = bookH1withSumw2("AbsEta","gen |#eta|",eta_nbin/2,0.,eta_max);
590  h1_mc_P = bookH1withSumw2("P","gen p",p_nbin,0.,p_max,"p (GeV/c)");
591  h1_mc_Pt = bookH1withSumw2("Pt","gen pt",pteff_nbin,5.,pt_max);
592  h1_mc_Phi = bookH1withSumw2("Phi","gen phi",phi_nbin,phi_min,phi_max);
593  h1_mc_Z = bookH1withSumw2("Z","gen z ",xyz_nbin, -25, 25 );
594  h2_mc_PtEta = bookH2withSumw2("PtEta","gen pt vs #eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,5.,pt_max );
595 
596  // all electrons
597  setBookPrefix("h_ele") ;
598  h1_ele_EoverP_all = bookH1withSumw2("EoverP_all","ele E/P_{vertex}, all reco electrons",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
599  h1_ele_EoverP_all_barrel = bookH1withSumw2("EoverP_all_barrel","ele E/P_{vertex}, all reco electrons, barrel",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
600  h1_ele_EoverP_all_endcaps = bookH1withSumw2("EoverP_all_endcaps","ele E/P_{vertex}, all reco electrons, endcaps",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
601  h1_ele_EseedOP_all = bookH1withSumw2("EseedOP_all","ele E_{seed}/P_{vertex}, all reco electrons",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
602  h1_ele_EseedOP_all_barrel = bookH1withSumw2("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");
603  h1_ele_EseedOP_all_endcaps = bookH1withSumw2("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");
604  h1_ele_EoPout_all = bookH1withSumw2("EoPout_all","ele E_{seed}/P_{out}, all reco electrons",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
605  h1_ele_EoPout_all_barrel = bookH1withSumw2("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");
606  h1_ele_EoPout_all_endcaps = bookH1withSumw2("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");
607  h1_ele_EeleOPout_all = bookH1withSumw2("EeleOPout_all","ele E_{ele}/P_{out}, all reco electrons",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
608  h1_ele_EeleOPout_all_barrel = bookH1withSumw2("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");
609  h1_ele_EeleOPout_all_endcaps = bookH1withSumw2("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");
610  h1_ele_dEtaSc_propVtx_all = bookH1withSumw2("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");
611  h1_ele_dEtaSc_propVtx_all_barrel = bookH1withSumw2("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");
612  h1_ele_dEtaSc_propVtx_all_endcaps = bookH1withSumw2("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");
613  h1_ele_dPhiSc_propVtx_all = bookH1withSumw2("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");
614  h1_ele_dPhiSc_propVtx_all_barrel = bookH1withSumw2("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");
615  h1_ele_dPhiSc_propVtx_all_endcaps = bookH1withSumw2("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");
616  h1_ele_dEtaCl_propOut_all = bookH1withSumw2("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");
617  h1_ele_dEtaCl_propOut_all_barrel = bookH1withSumw2("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");
618  h1_ele_dEtaCl_propOut_all_endcaps = bookH1withSumw2("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");
619  h1_ele_dPhiCl_propOut_all = bookH1withSumw2("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");
620  h1_ele_dPhiCl_propOut_all_barrel = bookH1withSumw2("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");
621  h1_ele_dPhiCl_propOut_all_endcaps = bookH1withSumw2("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");
622  h1_ele_HoE_all = bookH1withSumw2("HoE_all","ele hadronic energy / em energy, all reco electrons",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
623  h1_ele_HoE_all_barrel = bookH1withSumw2("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") ;
624  h1_ele_HoE_all_endcaps = bookH1withSumw2("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") ;
625  h1_ele_HoE_bc_all = bookH1withSumw2("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") ;
626  h1_ele_vertexPt_all = bookH1withSumw2("vertexPt_all","ele p_{T}, all reco electrons",pteff_nbin,5.,pt_max,"","Events","ELE_LOGY E1 P");
627  h1_ele_Et_all = bookH1withSumw2("Et_all","ele ecal E_{T}, all reco electrons",pteff_nbin,5.,pt_max,"E_{T} (GeV)","Events","ELE_LOGY E1 P");
628  h1_ele_vertexEta_all = bookH1withSumw2("vertexEta_all","ele eta, all reco electrons",eta_nbin,eta_min,eta_max,"","Events","ELE_LOGY E1 P");
629  h1_ele_TIP_all = bookH1withSumw2("TIP_all","ele vertex transverse radius, all reco electrons", 100,0.,0.2,"r_{T} (cm)","Events","ELE_LOGY E1 P");
630  h1_ele_TIP_all_barrel = bookH1withSumw2("TIP_all_barrel","ele vertex transverse radius, all reco electrons barrel", 100,0.,0.2,"r_{T} (cm)","Events","ELE_LOGY E1 P");
631  h1_ele_TIP_all_endcaps = bookH1withSumw2("TIP_all_endcaps","ele vertex transverse radius, all reco electrons endcaps", 100,0.,0.2,"r_{T} (cm)","Events","ELE_LOGY E1 P");
632  h1_ele_mee_all = bookH1withSumw2("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");
633  h1_ele_mee_os = bookH1withSumw2("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");
634  h1_ele_mee_os_ebeb = bookH1withSumw2("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");
635  h1_ele_mee_os_ebee = bookH1withSumw2("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");
636  h1_ele_mee_os_eeee = bookH1withSumw2("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");
637  h1_ele_mee_os_gg = bookH1withSumw2("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");
638  h1_ele_mee_os_gb = bookH1withSumw2("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");
639  h1_ele_mee_os_bb = bookH1withSumw2("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");
640 
641  // duplicates
642  h2_ele_E2mnE1vsMee_all = bookH2("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)");
643  h2_ele_E2mnE1vsMee_egeg_all = bookH2("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)");
644 
645  // charge ID
646  h1_ele_ChargeMnChargeTrue = bookH1withSumw2("ChargeMnChargeTrue","ele charge - gen charge ",5,-1.,4.,"q_{rec} - q_{gen}");
647  setBookPrefix("h_mc") ;
648  h1_mc_Eta_matched_qmisid = bookH1withSumw2("Eta_matched_qmisid","charge misid vs gen eta",eta_nbin,eta_min,eta_max);
649  h1_mc_AbsEta_matched_qmisid = bookH1withSumw2("AbsEta_matched_qmisid","charge misid vs gen |eta|",eta_nbin/2,0.,eta_max);
650  h1_mc_Pt_matched_qmisid = bookH1withSumw2("Pt_matched_qmisid","charge misid vs gen transverse momentum",pteff_nbin,5.,pt_max);
651  h1_mc_Phi_matched_qmisid = bookH1withSumw2("Phi_matched_qmisid","charge misid vs gen phi",phi_nbin,phi_min,phi_max);
652  h1_mc_Z_matched_qmisid = bookH1withSumw2("Z_matched_qmisid","charge misid vs gen z",xyz_nbin, -25, 25 );
653 
654  // matched electrons
655  setBookPrefix("h_mc") ;
656  h1_mc_Eta_matched = bookH1withSumw2("Eta_matched","Efficiency vs gen eta",eta_nbin,eta_min,eta_max);
657  h1_mc_AbsEta_matched = bookH1withSumw2("AbsEta_matched","Efficiency vs gen |eta|",eta_nbin/2,0.,2.5);
658  h1_mc_Pt_matched = bookH1("Pt_matched","Efficiency vs gen transverse momentum",pteff_nbin,5.,pt_max);
659  h1_mc_Phi_matched = bookH1withSumw2("Phi_matched","Efficiency vs gen phi",phi_nbin,phi_min,phi_max);
660  h1_mc_Z_matched = bookH1withSumw2("Z_matched","Efficiency vs gen vertex z",xyz_nbin,-25,25);
661  h2_mc_PtEta_matched = bookH2withSumw2("PtEta_matched","Efficiency vs pt #eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,5.,pt_max );
662  setBookPrefix("h_ele") ;
663  h1_ele_charge = bookH1withSumw2("charge","ele charge",5,-2.5,2.5,"charge");
664  h2_ele_chargeVsEta = bookH2("chargeVsEta","ele charge vs eta",eta2D_nbin,eta_min,eta_max,5,-2.,2.);
665  h2_ele_chargeVsPhi = bookH2("chargeVsPhi","ele charge vs phi",phi2D_nbin,phi_min,phi_max,5,-2.,2.);
666  h2_ele_chargeVsPt = bookH2("chargeVsPt","ele charge vs pt",pt_nbin,0.,100.,5,-2.,2.);
667  h1_ele_vertexP = bookH1withSumw2("vertexP","ele momentum",p_nbin,0.,p_max,"p_{vertex} (GeV/c)");
668  h1_ele_vertexPt = bookH1withSumw2("vertexPt","ele transverse momentum",pt_nbin,0.,pt_max,"p_{T vertex} (GeV/c)");
669  h1_ele_Et = bookH1withSumw2("Et","ele ecal E_{T}",pt_nbin,0.,pt_max,"E_{T} (GeV)");
670  h2_ele_vertexPtVsEta = bookH2("vertexPtVsEta","ele transverse momentum vs eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,0.,pt_max);
671  h2_ele_vertexPtVsPhi = bookH2("vertexPtVsPhi","ele transverse momentum vs phi",phi2D_nbin,phi_min,phi_max,pt2D_nbin,0.,pt_max);
672  h1_ele_vertexEta = bookH1withSumw2("vertexEta","ele momentum eta",eta_nbin,eta_min,eta_max,"#eta");
673  h2_ele_vertexEtaVsPhi = bookH2("vertexEtaVsPhi","ele momentum eta vs phi",eta2D_nbin,eta_min,eta_max,phi2D_nbin,phi_min,phi_max );
674  h1_ele_vertexPhi = bookH1withSumw2("vertexPhi","ele momentum #phi",phi_nbin,phi_min,phi_max,"#phi (rad)");
675  h1_ele_vertexX = bookH1withSumw2("vertexX","ele vertex x",xyz_nbin,-0.6,0.6,"x (cm)" );
676  h1_ele_vertexY = bookH1withSumw2("vertexY","ele vertex y",xyz_nbin,-0.6,0.6,"y (cm)" );
677  h1_ele_vertexZ = bookH1withSumw2("vertexZ","ele vertex z",xyz_nbin,-25, 25,"z (cm)" );
678  h1_ele_vertexTIP = bookH1withSumw2("vertexTIP","ele transverse impact parameter (wrt gen vtx)",90,0.,0.15,"TIP (cm)");
679  h2_ele_vertexTIPVsEta = bookH2("vertexTIPVsEta","ele transverse impact parameter (wrt gen vtx) vs eta",eta2D_nbin,eta_min,eta_max,45,0.,0.15,"#eta","TIP (cm)");
680  h2_ele_vertexTIPVsPhi = bookH2("vertexTIPVsPhi","ele transverse impact parameter (wrt gen vtx) vs phi",phi2D_nbin,phi_min,phi_max,45,0.,0.15,"#phi (rad)","TIP (cm)");
681  h2_ele_vertexTIPVsPt = bookH2("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)");
682  h1_ele_PoPtrue = bookH1withSumw2("PoPtrue","ele momentum / gen momentum",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
683  h1_ele_PoPtrue_barrel = bookH1withSumw2("PoPtrue_barrel","ele momentum / gen momentum, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
684  h1_ele_PoPtrue_endcaps = bookH1withSumw2("PoPtrue_endcaps","ele momentum / gen momentum, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
685  h2_ele_PoPtrueVsEta = bookH2withSumw2("PoPtrueVsEta","ele momentum / gen momentum vs eta",eta2D_nbin,eta_min,eta_max,50,poptrue_min,poptrue_max);
686  h2_ele_PoPtrueVsPhi = bookH2("PoPtrueVsPhi","ele momentum / gen momentum vs phi",phi2D_nbin,phi_min,phi_max,50,poptrue_min,poptrue_max);
687  h2_ele_PoPtrueVsPt = bookH2("PoPtrueVsPt","ele momentum / gen momentum vs eta",pt2D_nbin,0.,pt_max,50,poptrue_min,poptrue_max);
688  h1_ele_PoPtrue_golden_barrel = bookH1withSumw2("PoPtrue_golden_barrel","ele momentum / gen momentum, golden, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
689  h1_ele_PoPtrue_golden_endcaps = bookH1withSumw2("PoPtrue_golden_endcaps","ele momentum / gen momentum, golden, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
690  h1_ele_PoPtrue_showering_barrel = bookH1withSumw2("PoPtrue_showering_barrel","ele momentum / gen momentum, showering, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
691  h1_ele_PoPtrue_showering_endcaps = bookH1withSumw2("PoPtrue_showering_endcaps","ele momentum / gen momentum, showering, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
692  h1_ele_PtoPttrue = bookH1withSumw2("PtoPttrue","ele transverse momentum / gen transverse momentum",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
693  h1_ele_PtoPttrue_barrel = bookH1withSumw2("PtoPttrue_barrel","ele transverse momentum / gen transverse momentum, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
694  h1_ele_PtoPttrue_endcaps = bookH1withSumw2("PtoPttrue_endcaps","ele transverse momentum / gen transverse momentum, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
695  h1_ele_EtaMnEtaTrue = bookH1withSumw2("EtaMnEtaTrue","ele momentum eta - gen eta",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
696  h1_ele_EtaMnEtaTrue_barrel = bookH1withSumw2("EtaMnEtaTrue_barrel","ele momentum eta - gen eta barrel",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
697  h1_ele_EtaMnEtaTrue_endcaps = bookH1withSumw2("EtaMnEtaTrue_endcaps","ele momentum eta - gen eta endcaps",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
698  h2_ele_EtaMnEtaTrueVsEta = bookH2("EtaMnEtaTrueVsEta","ele momentum eta - gen eta vs eta",eta2D_nbin,eta_min,eta_max,deta_nbin/2,deta_min,deta_max);
699  h2_ele_EtaMnEtaTrueVsPhi = bookH2("EtaMnEtaTrueVsPhi","ele momentum eta - gen eta vs phi",phi2D_nbin,phi_min,phi_max,deta_nbin/2,deta_min,deta_max);
700  h2_ele_EtaMnEtaTrueVsPt = bookH2("EtaMnEtaTrueVsPt","ele momentum eta - gen eta vs pt",pt_nbin,0.,pt_max,deta_nbin/2,deta_min,deta_max);
701  h1_ele_PhiMnPhiTrue = bookH1withSumw2("PhiMnPhiTrue","ele momentum phi - gen phi",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
702  h1_ele_PhiMnPhiTrue_barrel = bookH1withSumw2("PhiMnPhiTrue_barrel","ele momentum phi - gen phi barrel",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
703  h1_ele_PhiMnPhiTrue_endcaps = bookH1withSumw2("PhiMnPhiTrue_endcaps","ele momentum phi - gen phi endcaps",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
704  h1_ele_PhiMnPhiTrue2 = bookH1("PhiMnPhiTrue2","ele momentum phi - gen phi",dphimatch2D_nbin,dphimatch_min,dphimatch_max);
705  h2_ele_PhiMnPhiTrueVsEta = bookH2("PhiMnPhiTrueVsEta","ele momentum phi - gen phi vs eta",eta2D_nbin,eta_min,eta_max,dphi_nbin/2,dphi_min,dphi_max);
706  h2_ele_PhiMnPhiTrueVsPhi = bookH2("PhiMnPhiTrueVsPhi","ele momentum phi - gen phi vs phi",phi2D_nbin,phi_min,phi_max,dphi_nbin/2,dphi_min,dphi_max);
707  h2_ele_PhiMnPhiTrueVsPt = bookH2("PhiMnPhiTrueVsPt","ele momentum phi - gen phi vs pt",pt2D_nbin,0.,pt_max,dphi_nbin/2,dphi_min,dphi_max);
709  h1_ele_ecalEnergyError_barrel = bookH1withSumw2("ecalEnergyError_barrel","",30,0,30);
710  h1_ele_ecalEnergyError_endcaps = bookH1withSumw2("ecalEnergyError_endcaps","",error_nbin,0,enerror_max);
712  h1_ele_combinedP4Error_barrel = bookH1withSumw2("combinedP4Error_barrel","",30,0,30);
713  h1_ele_combinedP4Error_endcaps = bookH1withSumw2("combinedP4Error_endcaps","",error_nbin,0,enerror_max);
714 
715  // matched electron, superclusters
716  setBookPrefix("h_scl") ;
717  h1_scl_En = bookH1withSumw2("energy","ele ecal energy",p_nbin,0.,p_max);
718  h1_scl_EoEtrue_barrel = bookH1withSumw2("EoEtrue_barrel","ele ecal energy / gen energy, barrel",50,0.2,1.2,"E/E_{gen}");
719  h1_scl_EoEtrue_barrel_eg = bookH1withSumw2("EoEtrue_barrel_eg","ele ecal energy / gen energy, barrel, ecal driven",50,0.2,1.2,"E/E_{gen}");
720  h1_scl_EoEtrue_barrel_etagap = bookH1withSumw2("EoEtrue_barrel_etagap","ele ecal energy / gen energy, barrel, etagap",50,0.2,1.2,"E/E_{gen}");
721  h1_scl_EoEtrue_barrel_phigap = bookH1withSumw2("EoEtrue_barrel_phigap","ele ecal energy / gen energy, barrel, phigap",50,0.2,1.2,"E/E_{gen}");
722  h1_scl_EoEtrue_ebeegap = bookH1withSumw2("EoEtrue_ebeegap","ele ecal energy / gen energy, ebeegap",50,0.2,1.2,"E/E_{gen}");
723  h1_scl_EoEtrue_endcaps = bookH1withSumw2("EoEtrue_endcaps","ele ecal energy / gen energy, endcaps",50,0.2,1.2,"E/E_{gen}");
724  h1_scl_EoEtrue_endcaps_eg = bookH1withSumw2("EoEtrue_endcaps_eg","ele ecal energy / gen energy, endcaps, ecal driven",50,0.2,1.2,"E/E_{gen}");
725  h1_scl_EoEtrue_endcaps_deegap = bookH1withSumw2("EoEtrue_endcaps_deegap","ele ecal energy / gen energy, endcaps, deegap",50,0.2,1.2,"E/E_{gen}");
726  h1_scl_EoEtrue_endcaps_ringgap = bookH1withSumw2("EoEtrue_endcaps_ringgap","ele ecal energy / gen energy, endcaps, ringgap",50,0.2,1.2,"E/E_{gen}");
727  h1_scl_EoEtrue_barrel_new = bookH1withSumw2("EoEtrue_barrel_new","ele ecal energy / gen energy, barrel",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
728  h1_scl_EoEtrue_barrel_new_eg = bookH1withSumw2("EoEtrue_barrel_new_eg","ele ecal energy / gen energy, barrel, ecal driven",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
729  h1_scl_EoEtrue_barrel_new_etagap = bookH1withSumw2("EoEtrue_barrel_new_etagap","ele ecal energy / gen energy, barrel, etagap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
730  h1_scl_EoEtrue_barrel_new_phigap = bookH1withSumw2("EoEtrue_barrel_new_phigap","ele ecal energy / gen energy, barrel, phigap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
731  h1_scl_EoEtrue_ebeegap_new = bookH1withSumw2("EoEtrue_ebeegap_new","ele ecal energy / gen energy, ebeegap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
732  h1_scl_EoEtrue_endcaps_new = bookH1withSumw2("EoEtrue_endcaps_new","ele ecal energy / gen energy, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
733  h1_scl_EoEtrue_endcaps_new_eg = bookH1withSumw2("EoEtrue_endcaps_new_eg","ele ecal energy / gen energy, endcaps, ecal driven",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
734  h1_scl_EoEtrue_endcaps_new_deegap = bookH1withSumw2("EoEtrue_endcaps_new_deegap","ele ecal energy / gen energy, endcaps, deegap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
735  h1_scl_EoEtrue_endcaps_new_ringgap = bookH1withSumw2("EoEtrue_endcaps_new_ringgap","ele ecal energy / gen energy, endcaps, ringgap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
736  h1_scl_Et = bookH1withSumw2("et","ele supercluster transverse energy",pt_nbin,0.,pt_max);
737  h2_scl_EtVsEta = bookH2("etVsEta","ele supercluster transverse energy vs eta",eta2D_nbin,eta_min,eta_max,pt_nbin,0.,pt_max);
738  h2_scl_EtVsPhi = bookH2("etVsPhi","ele supercluster transverse energy vs phi",phi2D_nbin,phi_min,phi_max,pt_nbin,0.,pt_max);
739  h2_scl_EtaVsPhi = bookH2("etaVsPhi","ele supercluster eta vs phi",phi2D_nbin,phi_min,phi_max,eta2D_nbin,eta_min,eta_max);
740  h1_scl_Eta = bookH1withSumw2("eta","ele supercluster eta",eta_nbin,eta_min,eta_max);
741  h1_scl_Phi = bookH1withSumw2("phi","ele supercluster phi",phi_nbin,phi_min,phi_max);
742  h1_scl_SigEtaEta = bookH1withSumw2("sigetaeta","ele supercluster sigma eta eta",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
743  h1_scl_SigEtaEta_barrel = bookH1withSumw2("sigetaeta_barrel","ele supercluster sigma eta eta barrel",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
744  h1_scl_SigEtaEta_endcaps = bookH1withSumw2("sigetaeta_endcaps","ele supercluster sigma eta eta endcaps",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
745  h1_scl_SigIEtaIEta = bookH1withSumw2("sigietaieta","ele supercluster sigma ieta ieta",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
746  h1_scl_SigIEtaIEta_barrel = bookH1withSumw2("sigietaieta_barrel","ele supercluster sigma ieta ieta, barrel",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
747  h1_scl_SigIEtaIEta_endcaps = bookH1withSumw2("sigietaieta_endcaps","ele supercluster sigma ieta ieta, endcaps",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
748  h1_scl_E1x5 = bookH1withSumw2("E1x5","ele supercluster energy in 1x5",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
749  h1_scl_E1x5_barrel = bookH1withSumw2("E1x5_barrel","ele supercluster energy in 1x5 barrel",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
750  h1_scl_E1x5_endcaps = bookH1withSumw2("E1x5_endcaps","ele supercluster energy in 1x5 endcaps",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
751  h1_scl_E2x5max = bookH1withSumw2("E2x5max","ele supercluster energy in 2x5 max",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
752  h1_scl_E2x5max_barrel = bookH1withSumw2("E2x5max_barrel","ele supercluster energy in 2x5 _max barrel",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
753  h1_scl_E2x5max_endcaps = bookH1withSumw2("E2x5max_endcaps","ele supercluster energy in 2x5 _max endcaps",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
754  h1_scl_E5x5 = bookH1withSumw2("E5x5","ele supercluster energy in 5x5",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
755  h1_scl_E5x5_barrel = bookH1withSumw2("E5x5_barrel","ele supercluster energy in 5x5 barrel",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
756  h1_scl_E5x5_endcaps = bookH1withSumw2("E5x5_endcaps","ele supercluster energy in 5x5 endcaps",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
757  h1_scl_SigEtaEta_eg = bookH1withSumw2("sigetaeta_eg","ele supercluster sigma eta eta, ecal driven",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
758  h1_scl_SigEtaEta_eg_barrel = bookH1withSumw2("sigetaeta_eg_barrel","ele supercluster sigma eta eta, ecal driven barrel",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
759  h1_scl_SigEtaEta_eg_endcaps = bookH1withSumw2("sigetaeta_eg_endcaps","ele supercluster sigma eta eta, ecal driven endcaps",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
760  h1_scl_SigIEtaIEta_eg = bookH1withSumw2("sigietaieta_eg","ele supercluster sigma ieta ieta, ecal driven",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
761  h1_scl_SigIEtaIEta_eg_barrel = bookH1withSumw2("sigietaieta_barrel_eg","ele supercluster sigma ieta ieta, barrel, ecal driven",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
762  h1_scl_SigIEtaIEta_eg_endcaps = bookH1withSumw2("sigietaieta_endcaps_eg","ele supercluster sigma ieta ieta, endcaps, ecal driven",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
763  h1_scl_E1x5_eg = bookH1withSumw2("E1x5_eg","ele supercluster energy in 1x5, ecal driven",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
764  h1_scl_E1x5_eg_barrel = bookH1withSumw2("E1x5_eg_barrel","ele supercluster energy in 1x5, ecal driven barrel",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
765  h1_scl_E1x5_eg_endcaps = bookH1withSumw2("E1x5_eg_endcaps","ele supercluster energy in 1x5, ecal driven endcaps",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
766  h1_scl_E2x5max_eg = bookH1withSumw2("E2x5max_eg","ele supercluster energy in 2x5 _max, ecal driven",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
767  h1_scl_E2x5max_eg_barrel = bookH1withSumw2("E2x5max_eg_barrel","ele supercluster energy in 2x5 _max, ecal driven barrel",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
768  h1_scl_E2x5max_eg_endcaps = bookH1withSumw2("E2x5max_eg_endcaps","ele supercluster energy in 2x5 _max, ecal driven endcaps",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
769  h1_scl_E5x5_eg = bookH1withSumw2("E5x5_eg","ele supercluster energy in 5x5, ecal driven",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
770  h1_scl_E5x5_eg_barrel = bookH1withSumw2("E5x5_eg_barrel","ele supercluster energy in 5x5, ecal driven barrel",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
771  h1_scl_E5x5_eg_endcaps = bookH1withSumw2("E5x5_eg_endcaps","ele supercluster energy in 5x5, ecal driven endcaps",p_nbin,0.,p_max,"E5x5 (GeV)");
772  h2_scl_EoEtruePfVsEg = bookH2("EoEtruePfVsEg","ele supercluster energy / gen energy pflow vs eg",75,-0.1,1.4, 75, -0.1, 1.4,"E/E_{gen} (e/g)","E/E_{gen} (pflow)") ;
773 
774  // matched electron, gsf tracks
775  setBookPrefix("h_ele") ;
776  h1_ele_ambiguousTracks = bookH1withSumw2("ambiguousTracks","ele # ambiguous tracks", 5,0.,5.,"N_{ambiguous tracks}","Events","ELE_LOGY E1 P");
777  h2_ele_ambiguousTracksVsEta = bookH2("ambiguousTracksVsEta","ele # ambiguous tracks vs eta",eta2D_nbin,eta_min,eta_max,5,0.,5.);
778  h2_ele_ambiguousTracksVsPhi = bookH2("ambiguousTracksVsPhi","ele # ambiguous tracks vs phi",phi2D_nbin,phi_min,phi_max,5,0.,5.);
779  h2_ele_ambiguousTracksVsPt = bookH2("ambiguousTracksVsPt","ele # ambiguous tracks vs pt",pt2D_nbin,0.,pt_max,5,0.,5.);
780  h1_ele_foundHits = bookH1withSumw2("foundHits","ele track # found hits",fhits_nbin,0.,fhits_max,"N_{hits}");
781  h1_ele_foundHits_barrel = bookH1withSumw2("foundHits_barrel","ele track # found hits, barrel",fhits_nbin,0.,fhits_max,"N_{hits}");
782  h1_ele_foundHits_endcaps = bookH1withSumw2("foundHits_endcaps","ele track # found hits, endcaps",fhits_nbin,0.,fhits_max,"N_{hits}");
783  h2_ele_foundHitsVsEta = bookH2("foundHitsVsEta","ele track # found hits vs eta",eta2D_nbin,eta_min,eta_max,fhits_nbin,0.,fhits_max);
784  h2_ele_foundHitsVsPhi = bookH2("foundHitsVsPhi","ele track # found hits vs phi",phi2D_nbin,phi_min,phi_max,fhits_nbin,0.,fhits_max);
785  h2_ele_foundHitsVsPt = bookH2("foundHitsVsPt","ele track # found hits vs pt",pt2D_nbin,0.,pt_max,fhits_nbin,0.,fhits_max);
786  h1_ele_lostHits = bookH1withSumw2("lostHits","ele track # lost hits", 5,0.,5.,"N_{lost hits}");
787  h1_ele_lostHits_barrel = bookH1withSumw2("lostHits_barrel","ele track # lost hits, barrel", 5,0.,5.,"N_{lost hits}");
788  h1_ele_lostHits_endcaps = bookH1withSumw2("lostHits_endcaps","ele track # lost hits, endcaps", 5,0.,5.,"N_{lost hits}");
789  h2_ele_lostHitsVsEta = bookH2("lostHitsVsEta","ele track # lost hits vs eta",eta2D_nbin,eta_min,eta_max,lhits_nbin,0.,lhits_max);
790  h2_ele_lostHitsVsPhi = bookH2("lostHitsVsPhi","ele track # lost hits vs eta",phi2D_nbin,phi_min,phi_max,lhits_nbin,0.,lhits_max);
791  h2_ele_lostHitsVsPt = bookH2("lostHitsVsPt","ele track # lost hits vs eta",pt2D_nbin,0.,pt_max,lhits_nbin,0.,lhits_max);
792  h1_ele_chi2 = bookH1withSumw2("chi2","ele track #chi^{2}",100,0.,15.,"#Chi^{2}","Events","ELE_LOGY E1 P");
793  h1_ele_chi2_barrel = bookH1withSumw2("chi2_barrel","ele track #chi^{2}, barrel",100,0.,15.,"#Chi^{2}","Events","ELE_LOGY E1 P");
794  h1_ele_chi2_endcaps = bookH1withSumw2("chi2_endcaps","ele track #chi^{2}, endcaps",100,0.,15.,"#Chi^{2}","Events","ELE_LOGY E1 P");
795  h2_ele_chi2VsEta = bookH2("chi2VsEta","ele track #chi^{2} vs eta",eta2D_nbin,eta_min,eta_max,50,0.,15.);
796  h2_ele_chi2VsPhi = bookH2("chi2VsPhi","ele track #chi^{2} vs phi",phi2D_nbin,phi_min,phi_max,50,0.,15.);
797  h2_ele_chi2VsPt = bookH2("chi2VsPt","ele track #chi^{2} vs pt",pt2D_nbin,0.,pt_max,50,0.,15.);
798  h1_ele_PinMnPout = bookH1withSumw2("PinMnPout","ele track inner p - outer p, mean of GSF components" ,p_nbin,0.,200.,"P_{vertex} - P_{out} (GeV/c)");
799  h1_ele_PinMnPout_mode = bookH1withSumw2("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)");
800  h2_ele_PinMnPoutVsEta_mode = bookH2("PinMnPoutVsEta_mode","ele track inner p - outer p vs eta, mode of GSF components" ,eta2D_nbin, eta_min,eta_max,p2D_nbin,0.,100.);
801  h2_ele_PinMnPoutVsPhi_mode = bookH2("PinMnPoutVsPhi_mode","ele track inner p - outer p vs phi, mode of GSF components" ,phi2D_nbin, phi_min,phi_max,p2D_nbin,0.,100.);
802  h2_ele_PinMnPoutVsPt_mode = bookH2("PinMnPoutVsPt_mode","ele track inner p - outer p vs pt, mode of GSF components" ,pt2D_nbin, 0.,pt_max,p2D_nbin,0.,100.);
803  h2_ele_PinMnPoutVsE_mode = bookH2("PinMnPoutVsE_mode","ele track inner p - outer p vs E, mode of GSF components" ,p2D_nbin, 0.,200.,p2D_nbin,0.,100.);
804  h2_ele_PinMnPoutVsChi2_mode = bookH2("PinMnPoutVsChi2_mode","ele track inner p - outer p vs track chi2, mode of GSF components" ,50, 0.,20.,p2D_nbin,0.,100.);
805  h1_ele_outerP = bookH1withSumw2("outerP","ele track outer p, mean of GSF components",p_nbin,0.,p_max,"P_{out} (GeV/c)");
806  h1_ele_outerP_mode = bookH1withSumw2("outerP_mode","ele track outer p, mode of GSF components",p_nbin,0.,p_max,"P_{out} (GeV/c)");
807  h2_ele_outerPVsEta_mode = bookH2("outerPVsEta_mode","ele track outer p vs eta mode",eta2D_nbin,eta_min,eta_max,50,0.,p_max);
808  h1_ele_outerPt = bookH1withSumw2("outerPt","ele track outer p_{T}, mean of GSF components",pt_nbin,0.,pt_max,"P_{T out} (GeV/c)");
809  h1_ele_outerPt_mode = bookH1withSumw2("outerPt_mode","ele track outer p_{T}, mode of GSF components",pt_nbin,0.,pt_max,"P_{T out} (GeV/c)");
810  h2_ele_outerPtVsEta_mode = bookH2("outerPtVsEta_mode","ele track outer p_{T} vs eta, mode of GSF components",eta2D_nbin,eta_min,eta_max,pt2D_nbin,0.,pt_max);
811  h2_ele_outerPtVsPhi_mode = bookH2("outerPtVsPhi_mode","ele track outer p_{T} vs phi, mode of GSF components",phi2D_nbin,phi_min,phi_max,pt2D_nbin,0.,pt_max);
812  h2_ele_outerPtVsPt_mode = bookH2("outerPtVsPt_mode","ele track outer p_{T} vs pt, mode of GSF components",pt2D_nbin,0.,100.,pt2D_nbin,0.,pt_max);
813 
814  // matched electrons, matching
815  h1_ele_EoP = bookH1withSumw2("EoP","ele E/P_{vertex}",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
816  h1_ele_EoP_eg = bookH1withSumw2("EoP_eg","ele E/P_{vertex}, ecal driven",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
817  h1_ele_EoP_barrel = bookH1withSumw2("EoP_barrel","ele E/P_{vertex} barrel",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
818  h1_ele_EoP_eg_barrel = bookH1withSumw2("EoP_eg_barrel","ele E/P_{vertex}, ecal driven barrel",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
819  h1_ele_EoP_endcaps = bookH1withSumw2("EoP_endcaps","ele E/P_{vertex} endcaps",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
820  h1_ele_EoP_eg_endcaps = bookH1withSumw2("EoP_eg_endcaps","ele E/P_{vertex}, ecal driven endcaps",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
821  h2_ele_EoPVsEta = bookH2("EoPVsEta","ele E/P_{vertex} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
822  h2_ele_EoPVsPhi = bookH2("EoPVsPhi","ele E/P_{vertex} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
823  h2_ele_EoPVsE = bookH2("EoPVsE","ele E/P_{vertex} vs E", 50,0.,p_max ,50,0.,5.);
824  h1_ele_EseedOP = bookH1withSumw2("EseedOP","ele E_{seed}/P_{vertex}",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
825  h1_ele_EseedOP_eg = bookH1withSumw2("EseedOP_eg","ele E_{seed}/P_{vertex}, ecal driven",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
826  h1_ele_EseedOP_barrel = bookH1withSumw2("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_eg_barrel = bookH1withSumw2("EseedOP_eg_barrel","ele E_{seed}/P_{vertex}, ecal driven barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
828  h1_ele_EseedOP_endcaps = bookH1withSumw2("EseedOP_endcaps","ele E_{seed}/P_{vertex} endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
829  h1_ele_EseedOP_eg_endcaps = bookH1withSumw2("EseedOP_eg_endcaps","ele E_{seed}/P_{vertex}, ecal driven, endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
830  h2_ele_EseedOPVsEta = bookH2("EseedOPVsEta","ele E_{seed}/P_{vertex} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
831  h2_ele_EseedOPVsPhi = bookH2("EseedOPVsPhi","ele E_{seed}/P_{vertex} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
832  h2_ele_EseedOPVsE = bookH2("EseedOPVsE","ele E_{seed}/P_{vertex} vs E", 50,0.,p_max ,50,0.,5.);
833  h1_ele_EoPout = bookH1withSumw2("EoPout","ele E_{seed}/P_{out}",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
834  h1_ele_EoPout_eg = bookH1withSumw2("EoPout_eg","ele E_{seed}/P_{out}, ecal driven",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
835  h1_ele_EoPout_barrel = bookH1withSumw2("EoPout_barrel","ele E_{seed}/P_{out} barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
836  h1_ele_EoPout_eg_barrel = bookH1withSumw2("EoPout_eg_barrel","ele E_{seed}/P_{out}, ecal driven, barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
837  h1_ele_EoPout_endcaps = bookH1withSumw2("EoPout_endcaps","ele E_{seed}/P_{out} endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
838  h1_ele_EoPout_eg_endcaps = bookH1withSumw2("EoPout_eg_endcaps","ele E_{seed}/P_{out}, ecal driven, endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
839  h2_ele_EoPoutVsEta = bookH2("EoPoutVsEta","ele E_{seed}/P_{out} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
840  h2_ele_EoPoutVsPhi = bookH2("EoPoutVsPhi","ele E_{seed}/P_{out} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
841  h2_ele_EoPoutVsE = bookH2("EoPoutVsE","ele E_{seed}/P_{out} vs E",p2D_nbin,0.,p_max,eop2D_nbin,0.,eopmaxsht);
842  h1_ele_EeleOPout = bookH1withSumw2("EeleOPout","ele E_{ele}/P_{out}",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
843  h1_ele_EeleOPout_eg = bookH1withSumw2("EeleOPout_eg","ele E_{ele}/P_{out}, ecal driven",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
844  h1_ele_EeleOPout_barrel = bookH1withSumw2("EeleOPout_barrel","ele E_{ele}/P_{out} barrel",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
845  h1_ele_EeleOPout_eg_barrel = bookH1withSumw2("EeleOPout_eg_barrel","ele E_{ele}/P_{out}, ecal driven, barrel",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
846  h1_ele_EeleOPout_endcaps = bookH1withSumw2("EeleOPout_endcaps","ele E_{ele}/P_{out} endcaps",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
847  h1_ele_EeleOPout_eg_endcaps = bookH1withSumw2("EeleOPout_eg_endcaps","ele E_{ele}/P_{out}, ecal driven, endcaps",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
848  h2_ele_EeleOPoutVsEta = bookH2("EeleOPoutVsEta","ele E_{ele}/P_{out} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
849  h2_ele_EeleOPoutVsPhi = bookH2("EeleOPoutVsPhi","ele E_{ele}/P_{out} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
850  h2_ele_EeleOPoutVsE = bookH2("EeleOPoutVsE","ele E_{ele}/P_{out} vs E",p2D_nbin,0.,p_max,eop2D_nbin,0.,eopmaxsht);
851  h1_ele_dEtaSc_propVtx = bookH1withSumw2("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");
852  h1_ele_dEtaSc_propVtx_eg = bookH1withSumw2("dEtaSc_propVtx_eg","ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
853  h1_ele_dEtaSc_propVtx_barrel = bookH1withSumw2("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");
854  h1_ele_dEtaSc_propVtx_eg_barrel = bookH1withSumw2("dEtaSc_propVtx_eg_barrel","ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
855  h1_ele_dEtaSc_propVtx_endcaps = bookH1withSumw2("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");
856  h1_ele_dEtaSc_propVtx_eg_endcaps = bookH1withSumw2("dEtaSc_propVtx_eg_endcaps","ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
857  h2_ele_dEtaScVsEta_propVtx = bookH2("dEtaScVsEta_propVtx","ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
858  h2_ele_dEtaScVsPhi_propVtx = bookH2("dEtaScVsPhi_propVtx","ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
859  h2_ele_dEtaScVsPt_propVtx = bookH2("dEtaScVsPt_propVtx","ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
860  h1_ele_dPhiSc_propVtx = bookH1withSumw2("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");
861  h1_ele_dPhiSc_propVtx_eg = bookH1withSumw2("dPhiSc_propVtx_eg","ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
862  h1_ele_dPhiSc_propVtx_barrel = bookH1withSumw2("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");
863  h1_ele_dPhiSc_propVtx_eg_barrel = bookH1withSumw2("dPhiSc_propVtx_eg_barrel","ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
864  h1_ele_dPhiSc_propVtx_endcaps = bookH1withSumw2("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");
865  h1_ele_dPhiSc_propVtx_eg_endcaps = bookH1withSumw2("dPhiSc_propVtx_eg_endcaps","ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
866  h2_ele_dPhiScVsEta_propVtx = bookH2("dPhiScVsEta_propVtx","ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
867  h2_ele_dPhiScVsPhi_propVtx = bookH2("dPhiScVsPhi_propVtx","ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
868  h2_ele_dPhiScVsPt_propVtx = bookH2("dPhiScVsPt_propVtx","ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
869  h1_ele_dEtaCl_propOut = bookH1withSumw2("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");
870  h1_ele_dEtaCl_propOut_eg = bookH1withSumw2("dEtaCl_propOut_eg","ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
871  h1_ele_dEtaCl_propOut_barrel = bookH1withSumw2("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");
872  h1_ele_dEtaCl_propOut_eg_barrel = bookH1withSumw2("dEtaCl_propOut_eg_barrel","ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
873  h1_ele_dEtaCl_propOut_endcaps = bookH1withSumw2("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");
874  h1_ele_dEtaCl_propOut_eg_endcaps = bookH1withSumw2("dEtaCl_propOut_eg_endcaps","ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
875  h2_ele_dEtaClVsEta_propOut = bookH2("dEtaClVsEta_propOut","ele #eta_{cl} - #eta_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
876  h2_ele_dEtaClVsPhi_propOut = bookH2("dEtaClVsPhi_propOut","ele #eta_{cl} - #eta_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
877  h2_ele_dEtaClVsPt_propOut = bookH2("dEtaScVsPt_propOut","ele #eta_{cl} - #eta_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
878  h1_ele_dPhiCl_propOut = bookH1withSumw2("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");
879  h1_ele_dPhiCl_propOut_eg = bookH1withSumw2("dPhiCl_propOut_eg","ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
880  h1_ele_dPhiCl_propOut_barrel = bookH1withSumw2("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");
881  h1_ele_dPhiCl_propOut_eg_barrel = bookH1withSumw2("dPhiCl_propOut_eg_barrel","ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
882  h1_ele_dPhiCl_propOut_endcaps = bookH1withSumw2("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");
883  h1_ele_dPhiCl_propOut_eg_endcaps = bookH1withSumw2("dPhiCl_propOut_eg_endcaps","ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
884  h2_ele_dPhiClVsEta_propOut = bookH2("dPhiClVsEta_propOut","ele #phi_{cl} - #phi_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
885  h2_ele_dPhiClVsPhi_propOut = bookH2("dPhiClVsPhi_propOut","ele #phi_{cl} - #phi_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
886  h2_ele_dPhiClVsPt_propOut = bookH2("dPhiSClsPt_propOut","ele #phi_{cl} - #phi_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
887  h1_ele_dEtaEleCl_propOut = bookH1withSumw2("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");
888  h1_ele_dEtaEleCl_propOut_eg = bookH1withSumw2("dEtaEleCl_propOut_eg","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
889  h1_ele_dEtaEleCl_propOut_barrel = bookH1withSumw2("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");
890  h1_ele_dEtaEleCl_propOut_eg_barrel = bookH1withSumw2("dEtaEleCl_propOut_eg_barrel","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
891  h1_ele_dEtaEleCl_propOut_endcaps = bookH1withSumw2("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");
892  h1_ele_dEtaEleCl_propOut_eg_endcaps = bookH1withSumw2("dEtaEleCl_propOut_eg_endcaps","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
893  h2_ele_dEtaEleClVsEta_propOut = bookH2("dEtaEleClVsEta_propOut","ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
894  h2_ele_dEtaEleClVsPhi_propOut = bookH2("dEtaEleClVsPhi_propOut","ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
895  h2_ele_dEtaEleClVsPt_propOut = bookH2("dEtaScVsPt_propOut","ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
896  h1_ele_dPhiEleCl_propOut = bookH1withSumw2("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");
897  h1_ele_dPhiEleCl_propOut_eg = bookH1withSumw2("dPhiEleCl_propOut_eg","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
898  h1_ele_dPhiEleCl_propOut_barrel = bookH1withSumw2("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");
899  h1_ele_dPhiEleCl_propOut_eg_barrel = bookH1withSumw2("dPhiEleCl_propOut_eg_barrel","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
900  h1_ele_dPhiEleCl_propOut_endcaps = bookH1withSumw2("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");
901  h1_ele_dPhiEleCl_propOut_eg_endcaps = bookH1withSumw2("dPhiEleCl_propOut_eg_endcaps","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
902  h2_ele_dPhiEleClVsEta_propOut = bookH2("dPhiEleClVsEta_propOut","ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
903  h2_ele_dPhiEleClVsPhi_propOut = bookH2("dPhiEleClVsPhi_propOut","ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
904  h2_ele_dPhiEleClVsPt_propOut = bookH2("dPhiSEleClsPt_propOut","ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
905  h1_ele_HoE = bookH1withSumw2("HoE","ele hadronic energy / em energy",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
906  h1_ele_HoE_bc = bookH1withSumw2("HoE_bc","ele hadronic energy / em energy behind cluster",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
907  h1_ele_HoE_eg = bookH1withSumw2("HoE_eg","ele hadronic energy / em energy, ecal driven",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
908  h1_ele_HoE_barrel = bookH1withSumw2("HoE_barrel","ele hadronic energy / em energy, barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
909  h1_ele_HoE_bc_barrel = bookH1withSumw2("HoE_bc_barrel","ele hadronic energy / em energy, behind cluster barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
910  h1_ele_HoE_eg_barrel = bookH1withSumw2("HoE_eg_barrel","ele hadronic energy / em energy, ecal driven, barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
911  h1_ele_HoE_endcaps = bookH1withSumw2("HoE_endcaps","ele hadronic energy / em energy, endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
912  h1_ele_HoE_bc_endcaps = bookH1withSumw2("HoE_bc_endcaps","ele hadronic energy / em energy, behind cluster, endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
913  h1_ele_HoE_eg_endcaps = bookH1withSumw2("HoE_eg_endcaps","ele hadronic energy / em energy, ecal driven, endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
914  h1_ele_hcalDepth1OverEcalBc = bookH1withSumw2("hcalDepth1OverEcalBc","hcalDepth1OverEcalBc",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
915  h1_ele_hcalDepth1OverEcalBc_barrel = bookH1withSumw2("hcalDepth1OverEcalBc_barrel","hcalDepth1OverEcalBc_barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
916  h1_ele_hcalDepth1OverEcalBc_endcaps = bookH1withSumw2("hcalDepth1OverEcalBc_endcaps","hcalDepth1OverEcalBc_endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
917  h1_ele_hcalDepth2OverEcalBc = bookH1withSumw2("hcalDepth2OverEcalBc","hcalDepth2OverEcalBc",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
918  h1_ele_hcalDepth2OverEcalBc_barrel = bookH1withSumw2("hcalDepth2OverEcalBc_barrel","hcalDepth2OverEcalBc_barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
919  h1_ele_hcalDepth2OverEcalBc_endcaps = bookH1withSumw2("hcalDepth2OverEcalBc_endcaps","hcalDepth2OverEcalBc_endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
920 
921  h1_ele_HoE_fiducial = bookH1withSumw2("HoE_fiducial","ele hadronic energy / em energy, fiducial region",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
922  h2_ele_HoEVsEta = bookH2("HoEVsEta","ele hadronic energy / em energy vs eta",eta_nbin,eta_min,eta_max,hoe_nbin, hoe_min, hoe_max) ;
923  h2_ele_HoEVsPhi = bookH2("HoEVsPhi","ele hadronic energy / em energy vs phi",phi2D_nbin,phi_min,phi_max,hoe_nbin, hoe_min, hoe_max) ;
924  h2_ele_HoEVsE = bookH2("HoEVsE","ele hadronic energy / em energy vs E",p_nbin, 0.,300.,hoe_nbin, hoe_min, hoe_max) ;
925 
926  // seeds
927  h1_ele_seed_subdet2 = bookH1withSumw2("seedSubdet2","ele seed subdet 2nd layer",11,-0.5,10.5,"2nd hit subdet Id") ;
928  h1_ele_seed_mask = bookH1withSumw2("seedMask","ele seed hits mask",13,-0.5,12.5) ;
929  h1_ele_seed_mask_bpix = bookH1withSumw2("seedMask_Bpix","ele seed hits mask when subdet2 is bpix",13,-0.5,12.5) ;
930  h1_ele_seed_mask_fpix = bookH1withSumw2("seedMask_Fpix","ele seed hits mask when subdet2 is fpix",13,-0.5,12.5) ;
931  h1_ele_seed_mask_tec = bookH1withSumw2("seedMask_Tec","ele seed hits mask when subdet2 is tec",13,-0.5,12.5) ;
932  h1_ele_seed_dphi2 = bookH1withSumw2("seedDphi2","ele seed dphi 2nd layer", 50,-0.010,+0.010,"#phi_{hit}-#phi_{pred} (rad)") ;
933  h2_ele_seed_dphi2VsEta = bookH2("seedDphi2_VsEta","ele seed dphi 2nd layer vs eta",eta2D_nbin,eta_min,eta_max,50,-0.003,+0.003) ;
934  h2_ele_seed_dphi2VsPt = bookH2("seedDphi2_VsPt","ele seed dphi 2nd layer vs pt",pt2D_nbin,0.,pt_max,50,-0.003,+0.003) ;
935  h1_ele_seed_dphi2pos = bookH1withSumw2("seedDphi2Pos","ele seed dphi 2nd layer positron", 50,-0.010,+0.010,"#phi_{hit}-#phi_{pred} (rad)") ;
936  h2_ele_seed_dphi2posVsEta = bookH2("seedDphi2Pos_VsEta","ele seed dphi 2nd layer positron vs eta",eta2D_nbin,eta_min,eta_max,50,-0.003,+0.003) ;
937  h2_ele_seed_dphi2posVsPt = bookH2("seedDphi2Pos_VsPt","ele seed dphi 2nd layer positron vs pt",pt2D_nbin,0.,pt_max,50,-0.003,+0.003) ;
938  h1_ele_seed_drz2 = bookH1withSumw2("seedDrz2","ele seed dr (dz) 2nd layer", 50,-0.03,+0.03,"r(z)_{hit}-r(z)_{pred} (cm)") ;
939  h2_ele_seed_drz2VsEta = bookH2("seedDrz2_VsEta","ele seed dr/dz 2nd layer vs eta",eta2D_nbin,eta_min,eta_max,50,-0.03,+0.03) ;
940  h2_ele_seed_drz2VsPt = bookH2("seedDrz2_VsPt","ele seed dr/dz 2nd layer vs pt",pt2D_nbin,0.,pt_max,50,-0.03,+0.03) ;
941  h1_ele_seed_drz2pos = bookH1withSumw2("seedDrz2Pos","ele seed dr (dz) 2nd layer positron", 50,-0.03,+0.03,"r(z)_{hit}-r(z)_{pred} (cm)") ;
942  h2_ele_seed_drz2posVsEta = bookH2("seedDrz2Pos_VsEta","ele seed dr/dz 2nd layer positron vs eta",eta2D_nbin,eta_min,eta_max,50,-0.03,+0.03) ;
943  h2_ele_seed_drz2posVsPt = bookH2("seedDrz2Pos_VsPt","ele seed dr/dz 2nd layer positron vs pt",pt2D_nbin,0.,pt_max,50,-0.03,+0.03) ;
944 
945  // classes
946  h1_ele_classes = bookH1withSumw2("classes","ele classes",20,0.0,20.,"class Id");
947  h1_ele_eta = bookH1withSumw2("eta","ele electron eta",eta_nbin/2,0.0,eta_max);
948  h1_ele_eta_golden = bookH1withSumw2("eta_golden","ele electron eta golden",eta_nbin/2,0.0,eta_max);
949  h1_ele_eta_bbrem = bookH1withSumw2("eta_bbrem","ele electron eta bbrem",eta_nbin/2,0.0,eta_max);
950  h1_ele_eta_shower = bookH1withSumw2("eta_shower","ele electron eta showering",eta_nbin/2,0.0,eta_max);
951  h2_ele_PinVsPoutGolden_mode = bookH2("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);
952  h2_ele_PinVsPoutShowering_mode = bookH2("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);
953  h2_ele_PinVsPoutGolden_mean = bookH2("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);
954  h2_ele_PinVsPoutShowering_mean = bookH2("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);
955  h2_ele_PtinVsPtoutGolden_mode = bookH2("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);
956  h2_ele_PtinVsPtoutShowering_mode = bookH2("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);
957  h2_ele_PtinVsPtoutGolden_mean = bookH2("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);
958  h2_ele_PtinVsPtoutShowering_mean = bookH2("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);
959  setBookPrefix("h_scl") ;
960  h1_scl_EoEtrueGolden_barrel = bookH1withSumw2("EoEtrue_golden_barrel","ele supercluster energy / gen energy, golden, barrel",poptrue_nbin,poptrue_min,poptrue_max);
961  h1_scl_EoEtrueGolden_endcaps = bookH1withSumw2("EoEtrue_golden_endcaps","ele supercluster energy / gen energy, golden, endcaps",poptrue_nbin,poptrue_min,poptrue_max);
962  h1_scl_EoEtrueShowering_barrel = bookH1withSumw2("EoEtrue_showering_barrel","ele supercluster energy / gen energy, showering, barrel",poptrue_nbin,poptrue_min,poptrue_max);
963  h1_scl_EoEtrueShowering_endcaps = bookH1withSumw2("EoEtrue_showering_endcaps","ele supercluster energy / gen energy, showering, endcaps",poptrue_nbin,poptrue_min,poptrue_max);
964 
965  // isolation
966  setBookPrefix("h_ele") ;
967  h1_ele_tkSumPt_dr03 = bookH1withSumw2("tkSumPt_dr03","tk isolation sum, dR=0.3",100,0.0,20.,"TkIsoSum, cone 0.3 (GeV/c)","Events","ELE_LOGY E1 P");
968  h1_ele_tkSumPt_dr03_barrel = bookH1withSumw2("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");
969  h1_ele_tkSumPt_dr03_endcaps = bookH1withSumw2("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");
970  h1_ele_ecalRecHitSumEt_dr03 = bookH1withSumw2("ecalRecHitSumEt_dr03","ecal isolation sum, dR=0.3",100,0.0,20.,"EcalIsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
971  h1_ele_ecalRecHitSumEt_dr03_barrel = bookH1withSumw2("ecalRecHitSumEt_dr03_barrel","ecal isolation sum, dR=0.3, barrel",100,0.0,20.,"EcalIsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
972  h1_ele_ecalRecHitSumEt_dr03_endcaps = bookH1withSumw2("ecalRecHitSumEt_dr03_endcaps","ecal isolation sum, dR=0.3, endcaps",100,0.0,20.,"EcalIsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
973  h1_ele_hcalTowerSumEt_dr03_depth1 = bookH1withSumw2("hcalTowerSumEt_dr03_depth1","hcal depth1 isolation sum, dR=0.3",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
974  h1_ele_hcalTowerSumEt_dr03_depth1_barrel = bookH1withSumw2("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");
975  h1_ele_hcalTowerSumEt_dr03_depth1_endcaps = bookH1withSumw2("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");
976  h1_ele_hcalTowerSumEt_dr03_depth2 = bookH1withSumw2("hcalTowerSumEt_dr03_depth2","hcal depth2 isolation sum, dR=0.3",100,0.0,20.,"Hcal2IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
977  h1_ele_hcalTowerSumEt_dr03_depth2_barrel = bookH1withSumw2("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");
978  h1_ele_hcalTowerSumEt_dr03_depth2_endcaps = bookH1withSumw2("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");
979  h1_ele_tkSumPt_dr04 = bookH1withSumw2("tkSumPt_dr04","tk isolation sum, dR=0.4",100,0.0,20.,"TkIsoSum, cone 0.4 (GeV/c)","Events","ELE_LOGY E1 P");
980  h1_ele_tkSumPt_dr04_barrel = bookH1withSumw2("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");
981  h1_ele_tkSumPt_dr04_endcaps = bookH1withSumw2("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");
982  h1_ele_ecalRecHitSumEt_dr04 = bookH1withSumw2("ecalRecHitSumEt_dr04","ecal isolation sum, dR=0.4",100,0.0,20.,"EcalIsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
983  h1_ele_ecalRecHitSumEt_dr04_barrel = bookH1withSumw2("ecalRecHitSumEt_dr04_barrel","ecal isolation sum, dR=0.4, barrel",100,0.0,20.,"EcalIsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
984  h1_ele_ecalRecHitSumEt_dr04_endcaps = bookH1withSumw2("ecalRecHitSumEt_dr04_endcaps","ecal isolation sum, dR=0.4, endcaps",100,0.0,20.,"EcalIsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
985  h1_ele_hcalTowerSumEt_dr04_depth1 = bookH1withSumw2("hcalTowerSumEt_dr04_depth1","hcal depth1 isolation sum, dR=0.4",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
986  h1_ele_hcalTowerSumEt_dr04_depth1_barrel = bookH1withSumw2("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");
987  h1_ele_hcalTowerSumEt_dr04_depth1_endcaps = bookH1withSumw2("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");
988  h1_ele_hcalTowerSumEt_dr04_depth2 = bookH1withSumw2("hcalTowerSumEt_dr04_depth2","hcal depth2 isolation sum, dR=0.4",100,0.0,20.,"Hcal2IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
989  h1_ele_hcalTowerSumEt_dr04_depth2_barrel = bookH1withSumw2("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");
990  h1_ele_hcalTowerSumEt_dr04_depth2_endcaps = bookH1withSumw2("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");
991 
992  h1_ele_dIso_tkSumPt_dr03 = bookH1withSumw2("dIso_tkSumPt_dr03","diff with iso from deposits, tk isolation sum, dR=0.3",21,-10.0,10.,"TkIsoSum diff, cone 0.3 (GeV/c)","Events","ELE_LOGY E1 P");
993  h1_ele_dIso_tkSumPt_dr04 = bookH1withSumw2("dIso_tkSumPt_dr04","diff with iso from deposits, tk isolation sum, dR=0.4",21,-10.0,10.,"TkIsoSum diff, cone 0.4 (GeV/c)","Events","ELE_LOGY E1 P");
994  h1_ele_dIso_ecalFullRecHitSumEt_dr03 = bookH1withSumw2("dIso_ecalFullRecHitSumEt_dr03","diff with iso from deposits, ecal isolation sum, dR=0.3",21,-10.0,10.,"EcalIsoSum diff, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
995  h1_ele_dIso_ecalFullRecHitSumEt_dr04 = bookH1withSumw2("dIso_ecalFullRecHitSumEt_dr04","diff with iso from deposits, ecal isolation sum, dR=0.4",21,-10.0,10.,"EcalIsoSum diff, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
996  h1_ele_dIso_ecalReducedRecHitSumEt_dr03 = bookH1withSumw2("dIso_ecalReducedRecHitSumEt_dr03","diff with iso from deposits, ecal isolation sum, dR=0.3",21,-10.0,10.,"EcalIsoSum diff, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
997  h1_ele_dIso_ecalReducedRecHitSumEt_dr04 = bookH1withSumw2("dIso_ecalReducedRecHitSumEt_dr04","diff with iso from deposits, ecal isolation sum, dR=0.4",21,-10.0,10.,"EcalIsoSum diff, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
998  h1_ele_dIso_hcalTowerSumEt_dr03 = bookH1withSumw2("dIso_hcalTowerSumEt_dr03","diff with iso from deposits, hcal depth1 isolation sum, dR=0.3",21,-10.0,10.,"Hcal1IsoSum diff, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
999  h1_ele_dIso_hcalTowerSumEt_dr04 = bookH1withSumw2("dIso_hcalTowerSumEt_dr04","diff with iso from deposits, hcal depth1 isolation sum, dR=0.4",21,-10.0,10.,"Hcal1IsoSum diff, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
1000 
1001  // newHCAL
1002  // isolation new hcal
1003  h1_ele_hcalTowerSumEtBc_dr03_depth1 = bookH1withSumw2("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");
1004  h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel = bookH1withSumw2("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");
1005  h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps = bookH1withSumw2("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");
1006 
1007  h1_ele_hcalTowerSumEtBc_dr04_depth1 = bookH1withSumw2("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");
1008  h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel = bookH1withSumw2("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");
1009  h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps = bookH1withSumw2("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");
1010 
1011  h1_ele_hcalTowerSumEtBc_dr03_depth2 = bookH1withSumw2("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");
1012  h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel = bookH1withSumw2("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");
1013  h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps = bookH1withSumw2("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");
1014 
1015  h1_ele_hcalTowerSumEtBc_dr04_depth2 = bookH1withSumw2("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");
1016  h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel = bookH1withSumw2("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");
1017  h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps = bookH1withSumw2("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");
1018 
1019  // fbrem
1020  h1_ele_fbrem = bookH1withSumw2("fbrem","ele brem fraction, mode of GSF components",100,0.,1.,"P_{in} - P_{out} / P_{in}");
1021  h1_ele_fbrem_barrel = bookH1withSumw2("fbrem_barrel","ele brem fraction for barrel, mode of GSF components", 100, 0.,1.,"P_{in} - P_{out} / P_{in}");
1022  h1_ele_fbrem_endcaps = bookH1withSumw2("fbrem_endcaps", "ele brem franction for endcaps, mode of GSF components", 100, 0.,1.,"P_{in} - P_{out} / P_{in}");
1023  h1_ele_fbrem_eg = bookH1withSumw2("brem_eg","ele brem fraction, mode of GSF components, ecal driven",100,0.,1.);
1024  p1_ele_fbremVsEta_mode = bookP1("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}>");
1025  p1_ele_fbremVsEta_mean = bookP1("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}>");
1026  h1_ele_chargeInfo = bookH1withSumw2("chargeInfo","chargeInfo",5,-2.,3.);
1027 
1028  // e/g et pflow electrons
1029  h1_ele_mva = bookH1withSumw2("mva","ele identification mva",100,-1.,1.);
1030  h1_ele_mva_barrel = bookH1withSumw2("mva_barrel", "ele identification mva barrel",100,-1.,1.);
1031  h1_ele_mva_endcaps = bookH1withSumw2("mva_endcaps", "ele identification mva endcaps",100,-1.,1.);
1032  h1_ele_mva_eg = bookH1withSumw2("mva_eg","ele identification mva, ecal driven",100,-1.,1.);
1033  h1_ele_provenance = bookH1withSumw2("provenance","ele provenance",5,-2.,3.);
1034  h1_ele_provenance_barrel = bookH1withSumw2("provenance_barrel","ele provenance barrel",5,-2.,3.);
1035  h1_ele_provenance_endcaps = bookH1withSumw2("provenance_endcaps","ele provenance endcaps",5,-2.,3.);
1036 
1037  // pflow isolation variables
1038  h1_ele_chargedHadronIso = bookH1withSumw2("chargedHadronIso","chargedHadronIso",100,0.0,20.,"chargedHadronIso","Events","ELE_LOGY E1 P");
1039  h1_ele_chargedHadronIso_barrel = bookH1withSumw2("chargedHadronIso_barrel","chargedHadronIso for barrel",100,0.0,20.,"chargedHadronIso_barrel","Events","ELE_LOGY E1 P");
1040  h1_ele_chargedHadronIso_endcaps = bookH1withSumw2("chargedHadronIso_endcaps","chargedHadronIso for endcaps",100,0.0,20.,"chargedHadronIso_endcaps","Events","ELE_LOGY E1 P");
1041  h1_ele_neutralHadronIso = bookH1withSumw2("neutralHadronIso","neutralHadronIso",21,0.0,20.,"neutralHadronIso","Events", "ELE_LOGY E1 P");
1042  h1_ele_neutralHadronIso_barrel = bookH1withSumw2("neutralHadronIso_barrel","neutralHadronIso for barrel",21,0.0,20.,"neutralHadronIso_barrel","Events","ELE_LOGY E1 P");
1043  h1_ele_neutralHadronIso_endcaps = bookH1withSumw2("neutralHadronIso_endcaps","neutralHadronIso for endcaps",21,0.0,20.,"neutralHadronIso_endcaps","Events","ELE_LOGY E1 P");
1044  h1_ele_photonIso = bookH1withSumw2("photonIso","photonIso",100,0.0,20.,"photonIso","Events","ELE_LOGY E1 P");
1045  h1_ele_photonIso_barrel = bookH1withSumw2("photonIso_barrel","photonIso for barrel",100,0.0,20.,"photonIso_barrel","Events","ELE_LOGY E1 P");
1046  h1_ele_photonIso_endcaps = bookH1withSumw2("photonIso_endcaps","photonIso for endcaps",100,0.0,20.,"photonIso_endcaps","Events","ELE_LOGY E1 P");
1047 
1048  // conversion rejection information
1049  h1_ele_convFlags = bookH1withSumw2("convFlags","conversion rejection flag",5,-1.5,3.5);
1050  h1_ele_convFlags_all = bookH1withSumw2("convFlags_all","conversion rejection flag, all electrons",5,-1.5,3.5);
1051  h1_ele_convDist = bookH1withSumw2("convDist","distance to the conversion partner",100,-15.,15.);
1052  h1_ele_convDist_all = bookH1withSumw2("convDist_all","distance to the conversion partner, all electrons",100,-15.,15.);
1053  h1_ele_convDcot = bookH1withSumw2("convDcot","difference of cot(angle) with the conversion partner",100,-CLHEP::pi/2.,CLHEP::pi/2.);
1054  h1_ele_convDcot_all = bookH1withSumw2("convDcot_all","difference of cot(angle) with the conversion partner, all electrons",100,-CLHEP::pi/2.,CLHEP::pi/2.);
1055  h1_ele_convRadius = bookH1withSumw2("convRadius","signed conversion radius",100,0.,130.);
1056  h1_ele_convRadius_all = bookH1withSumw2("convRadius_all","signed conversion radius, all electrons",100,0.,130.);
1057 
1058  }
1059 
1061  {}
1062 
1064  {
1065  // get collections
1067  iEvent.getByToken(electronCollection_, gsfElectrons) ;
1069  iEvent.getByToken(electronCoreCollection_,gsfElectronCores) ;
1070  edm::Handle<GsfTrackCollection> gsfElectronTracks ;
1071  iEvent.getByToken(electronTrackCollection_,gsfElectronTracks) ;
1072  edm::Handle<ElectronSeedCollection> gsfElectronSeeds ;
1073  iEvent.getByToken(electronSeedCollection_,gsfElectronSeeds) ;
1075  iEvent.getByToken(mcTruthCollection_, genParticles) ;
1076  edm::Handle<reco::BeamSpot> theBeamSpot ;
1077  iEvent.getByToken(beamSpotTag_,theBeamSpot) ;
1078 
1079  edm::Handle<edm::ValueMap<double> > isoFromDepsTk03Handle;
1080  iEvent.getByToken(isoFromDepsTk03Tag_, isoFromDepsTk03Handle);
1081 
1082  edm::Handle<edm::ValueMap<double> > isoFromDepsTk04Handle;
1083  iEvent.getByToken(isoFromDepsTk04Tag_, isoFromDepsTk04Handle);
1084 
1085  edm::Handle<edm::ValueMap<double> > isoFromDepsEcalFull03Handle;
1086  iEvent.getByToken( isoFromDepsEcalFull03Tag_, isoFromDepsEcalFull03Handle);
1087 
1088  edm::Handle<edm::ValueMap<double> > isoFromDepsEcalFull04Handle;
1089  iEvent.getByToken( isoFromDepsEcalFull04Tag_, isoFromDepsEcalFull04Handle);
1090 
1091  edm::Handle<edm::ValueMap<double> > isoFromDepsEcalReduced03Handle;
1092  iEvent.getByToken( isoFromDepsEcalReduced03Tag_, isoFromDepsEcalReduced03Handle);
1093 
1094  edm::Handle<edm::ValueMap<double> > isoFromDepsEcalReduced04Handle;
1095  iEvent.getByToken( isoFromDepsEcalReduced04Tag_, isoFromDepsEcalReduced04Handle);
1096 
1097  edm::Handle<edm::ValueMap<double> > isoFromDepsHcal03Handle;
1098  iEvent.getByToken( isoFromDepsHcal03Tag_, isoFromDepsHcal03Handle);
1099 
1100  edm::Handle<edm::ValueMap<double> > isoFromDepsHcal04Handle;
1101  iEvent.getByToken( isoFromDepsHcal04Tag_, isoFromDepsHcal04Handle);
1102 
1103  edm::LogInfo("ElectronMcSignalValidator::analyze")
1104  <<"Treating event "<<iEvent.id()
1105  <<" with "<<gsfElectrons.product()->size()<<" electrons" ;
1106  h1_recEleNum->Fill((*gsfElectrons).size()) ;
1107  h1_recCoreNum->Fill((*gsfElectronCores).size());
1108  h1_recTrackNum->Fill((*gsfElectronTracks).size());
1109  h1_recSeedNum->Fill((*gsfElectronSeeds).size());
1110 
1111  //===============================================
1112  // all rec electrons
1113  //===============================================
1114 
1115  reco::GsfElectronCollection::const_iterator gsfIter ;
1116  for ( gsfIter=gsfElectrons->begin() ; gsfIter!=gsfElectrons->end() ; gsfIter++ )
1117  {
1118  // preselect electrons
1119  if (gsfIter->pt()>maxPt_ || std::abs(gsfIter->eta())>maxAbsEta_) continue ;
1120 
1121  //
1122  h1_ele_EoverP_all->Fill(gsfIter->eSuperClusterOverP()) ;
1123  h1_ele_EseedOP_all->Fill(gsfIter->eSeedClusterOverP()) ;
1124  h1_ele_EoPout_all->Fill(gsfIter->eSeedClusterOverPout()) ;
1125  h1_ele_EeleOPout_all->Fill( gsfIter->eEleClusterOverPout()) ;
1126  h1_ele_dEtaSc_propVtx_all->Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx()) ;
1127  h1_ele_dPhiSc_propVtx_all->Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx()) ;
1128  h1_ele_dEtaCl_propOut_all->Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo()) ;
1129  h1_ele_dPhiCl_propOut_all->Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo()) ;
1130  h1_ele_HoE_all->Fill(gsfIter->hcalOverEcal()) ;
1131  h1_ele_HoE_bc_all->Fill(gsfIter->hcalOverEcalBc()) ;
1132  h1_ele_TIP_all->Fill( EleRelPoint(gsfIter->vertex(),theBeamSpot->position()).perp() );
1133  h1_ele_vertexEta_all->Fill( gsfIter->eta() );
1134  h1_ele_vertexPt_all->Fill( gsfIter->pt() );
1135  h1_ele_Et_all->Fill( gsfIter->ecalEnergy()/cosh(gsfIter->superCluster()->eta()));
1136  float enrj1=gsfIter->ecalEnergy();
1137 
1138  // mee
1139  reco::GsfElectronCollection::const_iterator gsfIter2 ;
1140  for ( gsfIter2=gsfIter+1 ; gsfIter2!=gsfElectrons->end() ; gsfIter2++ )
1141  {
1142  math::XYZTLorentzVector p12 = (*gsfIter).p4()+(*gsfIter2).p4();
1143  float mee2 = p12.Dot(p12);
1144  float enrj2=gsfIter2->ecalEnergy() ;
1145  h1_ele_mee_all->Fill(sqrt(mee2));
1146  h2_ele_E2mnE1vsMee_all->Fill(sqrt(mee2),enrj2-enrj1);
1147  if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
1148  { h2_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2),enrj2-enrj1) ; }
1149  if (gsfIter->charge()*gsfIter2->charge()<0.)
1150  {
1151  h1_ele_mee_os->Fill(sqrt(mee2));
1152  if (gsfIter->isEB() && gsfIter2->isEB()) { h1_ele_mee_os_ebeb->Fill(sqrt(mee2)) ; }
1153  if ((gsfIter->isEB() && gsfIter2->isEE()) || (gsfIter->isEE() && gsfIter2->isEB())) h1_ele_mee_os_ebee -> Fill(sqrt(mee2));
1154  if (gsfIter->isEE() && gsfIter2->isEE()) { h1_ele_mee_os_eeee->Fill(sqrt(mee2)) ; }
1155  if
1156  ( (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::GOLDEN) ||
1157  (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::BIGBREM) ||
1158  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::GOLDEN) ||
1159  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::BIGBREM) )
1160  { h1_ele_mee_os_gg->Fill(sqrt(mee2)) ; }
1161  else if
1162  ( (gsfIter->classification()==GsfElectron::SHOWERING && gsfIter2->classification()==GsfElectron::SHOWERING) ||
1163  (gsfIter->classification()==GsfElectron::SHOWERING && gsfIter2->isGap()) ||
1164  (gsfIter->isGap() && gsfIter2->classification()==GsfElectron::SHOWERING) ||
1165  (gsfIter->isGap() && gsfIter2->isGap()) )
1166  { h1_ele_mee_os_bb->Fill(sqrt(mee2)) ; }
1167  else
1168  { h1_ele_mee_os_gb->Fill(sqrt(mee2)) ; }
1169  }
1170  }
1171 
1172  // conversion rejection
1173  int flags = gsfIter->convFlags() ;
1174  if (flags==-9999) { flags=-1 ; }
1175  h1_ele_convFlags_all->Fill(flags);
1176  if (flags>=0.)
1177  {
1178  h1_ele_convDist_all->Fill( gsfIter->convDist() );
1179  h1_ele_convDcot_all->Fill( gsfIter->convDcot() );
1180  h1_ele_convRadius_all->Fill( gsfIter->convRadius() );
1181  }
1182  }
1183 
1184  //===============================================
1185  // charge mis-ID
1186  //===============================================
1187 
1188  int mcNum=0, gamNum=0, eleNum=0 ;
1189  bool matchingID, matchingMotherID ;
1190 
1191  reco::GenParticleCollection::const_iterator mcIter ;
1192  for
1193  ( mcIter=genParticles->begin() ; mcIter!=genParticles->end() ; mcIter++ )
1194  {
1195  // select requested matching gen particle
1196  matchingID=false;
1197  for ( unsigned int i=0 ; i<matchingIDs_.size() ; i++ )
1198  {
1199  if ( mcIter->pdgId() == matchingIDs_[i] )
1200  { matchingID=true ; }
1201  }
1202  if (matchingID)
1203  {
1204  // select requested mother matching gen particle
1205  // always include single particle with no mother
1206  const Candidate * mother = mcIter->mother() ;
1207  matchingMotherID = false ;
1208  for ( unsigned int i=0 ; i<matchingMotherIDs_.size() ; i++ )
1209  {
1210  if ((mother == 0) || ((mother != 0) && mother->pdgId() == matchingMotherIDs_[i]) )
1211  { matchingMotherID = true ; }
1212  }
1213  if (matchingMotherID)
1214  {
1215  if ( mcIter->pt()>maxPt_ || std::abs(mcIter->eta())>maxAbsEta_ )
1216  { continue ; }
1217  // suppress the endcaps
1218  //if (std::abs(mcIter->eta()) > 1.5) continue;
1219  // select central z
1220  //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
1221 
1222  // looking for the best matching gsf electron
1223  bool okGsfFound = false ;
1224  double gsfOkRatio = 999999. ;
1225 
1226  // find best matched electron
1227  reco::GsfElectron bestGsfElectron ;
1228  reco::GsfElectronCollection::const_iterator gsfIter ;
1229  for
1230  ( gsfIter=gsfElectrons->begin() ; gsfIter!=gsfElectrons->end() ; gsfIter++ )
1231  {
1232  double dphi = gsfIter->phi()-mcIter->phi() ;
1233  if (std::abs(dphi)>CLHEP::pi)
1234  { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
1235  double deltaR = sqrt(pow((gsfIter->eta()-mcIter->eta()),2) + pow(dphi,2)) ;
1236  if ( deltaR < deltaR_ )
1237  {
1238  double mc_charge = mcIter->pdgId() == 11 ? -1. : 1. ;
1239  h1_ele_ChargeMnChargeTrue->Fill( std::abs(gsfIter->charge()-mc_charge));
1240  // require here a charge mismatch
1241  if
1242  ( ( (mcIter->pdgId() == 11) && (gsfIter->charge() > 0.) ) ||
1243  ( (mcIter->pdgId() == -11) && (gsfIter->charge() < 0.) ) )
1244  {
1245  double tmpGsfRatio = gsfIter->p()/mcIter->p();
1246  if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) )
1247  {
1248  gsfOkRatio = tmpGsfRatio;
1249  bestGsfElectron=*gsfIter;
1250  okGsfFound = true;
1251  }
1252  }
1253  }
1254  } // loop over rec ele to look for the best one
1255 
1256  // analysis when the mc track is found
1257  if (okGsfFound)
1258  {
1259  // generated distributions for matched electrons
1260  h1_mc_Pt_matched_qmisid->Fill( mcIter->pt() ) ;
1261  h1_mc_Phi_matched_qmisid->Fill( mcIter->phi() ) ;
1262  h1_mc_AbsEta_matched_qmisid->Fill( std::abs(mcIter->eta()) ) ;
1263  h1_mc_Eta_matched_qmisid->Fill( mcIter->eta() ) ;
1264  h1_mc_Z_matched_qmisid->Fill( mcIter->vz() ) ;
1265  }
1266  }
1267  }
1268  }
1269 
1270  //===============================================
1271  // association mc-reco
1272  //===============================================
1273 
1274  for ( mcIter=genParticles->begin() ; mcIter!=genParticles->end() ; mcIter++ )
1275  {
1276  // number of mc particles
1277  mcNum++ ;
1278 
1279  // counts photons
1280  if (mcIter->pdgId() == 22 )
1281  { gamNum++ ; }
1282 
1283  // select requested matching gen particle
1284  matchingID = false ;
1285  for ( unsigned int i=0 ; i<matchingIDs_.size() ; i++ )
1286  {
1287  if ( mcIter->pdgId() == matchingIDs_[i] )
1288  { matchingID=true ; }
1289  }
1290  if (!matchingID) continue ;
1291 
1292  // select requested mother matching gen particle
1293  // always include single particle with no mother
1294  const Candidate * mother = mcIter->mother() ;
1295  matchingMotherID = false ;
1296  for ( unsigned int i=0 ; i<matchingMotherIDs_.size() ; i++ )
1297  {
1298  if ( (mother == 0) || ((mother != 0) && mother->pdgId() == matchingMotherIDs_[i]) )
1299  { matchingMotherID = true ; }
1300  }
1301  if (!matchingMotherID) continue ;
1302 
1303  // electron preselection
1304  if (mcIter->pt()> maxPt_ || std::abs(mcIter->eta())> maxAbsEta_)
1305  { continue ; }
1306 
1307  // suppress the endcaps
1308  //if (std::abs(mcIter->eta()) > 1.5) continue;
1309  // select central z
1310  //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
1311 
1312  eleNum++;
1313  h1_mc_Eta->Fill( mcIter->eta() );
1314  h1_mc_AbsEta->Fill( std::abs(mcIter->eta()) );
1315  h1_mc_P->Fill( mcIter->p() );
1316  h1_mc_Pt->Fill( mcIter->pt() );
1317  h1_mc_Phi->Fill( mcIter->phi() );
1318  h1_mc_Z->Fill( mcIter->vz() );
1319  h2_mc_PtEta->Fill( mcIter->eta(),mcIter->pt() );
1320 
1321  // find best matched electron
1322  bool okGsfFound = false ;
1323  double gsfOkRatio = 999999. ;
1324  reco::GsfElectron bestGsfElectron ;
1325  reco::GsfElectronRef bestGsfElectronRef ;
1326  reco::GsfElectronCollection::const_iterator gsfIter ;
1328  for ( gsfIter=gsfElectrons->begin(), iElectron=0 ; gsfIter!=gsfElectrons->end() ; gsfIter++, iElectron++ )
1329  {
1330  double dphi = gsfIter->phi()-mcIter->phi() ;
1331  if (std::abs(dphi)>CLHEP::pi)
1332  { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
1333  double deltaR = sqrt(pow((gsfIter->eta()-mcIter->eta()),2) + pow(dphi,2));
1334  if ( deltaR < deltaR_ )
1335  {
1336  if ( ( (mcIter->pdgId() == 11) && (gsfIter->charge() < 0.) ) ||
1337  ( (mcIter->pdgId() == -11) && (gsfIter->charge() > 0.) ) )
1338  {
1339  double tmpGsfRatio = gsfIter->p()/mcIter->p() ;
1340  if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) )
1341  {
1342  gsfOkRatio = tmpGsfRatio;
1343  bestGsfElectron=*gsfIter;
1344  bestGsfElectronRef=reco::GsfElectronRef(gsfElectrons,iElectron);
1345  okGsfFound = true;
1346  }
1347  }
1348  }
1349  } // loop over rec ele to look for the best one
1350  if (! okGsfFound) continue ;
1351 
1352  //------------------------------------
1353  // analysis when the mc track is found
1354  //------------------------------------
1355 
1356  // electron related distributions
1357  h1_ele_charge->Fill( bestGsfElectron.charge() );
1358  h2_ele_chargeVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.charge() );
1359  h2_ele_chargeVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.charge() );
1360  h2_ele_chargeVsPt->Fill( bestGsfElectron.pt(),bestGsfElectron.charge() );
1361  h1_ele_vertexP->Fill( bestGsfElectron.p() );
1362  h1_ele_vertexPt->Fill( bestGsfElectron.pt() );
1363  h1_ele_Et->Fill( bestGsfElectron.ecalEnergy()/cosh(bestGsfElectron.superCluster()->eta()));
1364  h2_ele_vertexPtVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.pt() );
1365  h2_ele_vertexPtVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.pt() );
1366  h1_ele_vertexEta->Fill( bestGsfElectron.eta() );
1367  // generated distributions for matched electrons
1368  h1_mc_Pt_matched->Fill( mcIter->pt() );
1369  h1_mc_Phi_matched->Fill( mcIter->phi() );
1370  h1_mc_AbsEta_matched->Fill( std::abs(mcIter->eta()) );
1371  h1_mc_Eta_matched->Fill( mcIter->eta() );
1372  h2_mc_PtEta_matched->Fill( mcIter->eta(),mcIter->pt() );
1373  h2_ele_vertexEtaVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.eta() );
1374  h1_ele_vertexPhi->Fill( bestGsfElectron.phi() );
1375  h1_ele_vertexX->Fill( bestGsfElectron.vertex().x() );
1376  h1_ele_vertexY->Fill( bestGsfElectron.vertex().y() );
1377  h1_ele_vertexZ->Fill( bestGsfElectron.vertex().z() );
1378  h1_mc_Z_matched->Fill( mcIter->vz() );
1379  double d =
1380  (bestGsfElectron.vertex().x()-mcIter->vx())*(bestGsfElectron.vertex().x()-mcIter->vx()) +
1381  (bestGsfElectron.vertex().y()-mcIter->vy())*(bestGsfElectron.vertex().y()-mcIter->vy()) ;
1382  d = sqrt(d) ;
1383  h1_ele_vertexTIP->Fill( d );
1384  h2_ele_vertexTIPVsEta->Fill( bestGsfElectron.eta(), d );
1385  h2_ele_vertexTIPVsPhi->Fill( bestGsfElectron.phi(), d );
1386  h2_ele_vertexTIPVsPt->Fill( bestGsfElectron.pt(), d );
1387  h1_ele_EtaMnEtaTrue->Fill( bestGsfElectron.eta()-mcIter->eta());
1388  if (bestGsfElectron.isEB()) h1_ele_EtaMnEtaTrue_barrel->Fill( bestGsfElectron.eta()-mcIter->eta());
1389  if (bestGsfElectron.isEE()) h1_ele_EtaMnEtaTrue_endcaps->Fill( bestGsfElectron.eta()-mcIter->eta());
1390  h2_ele_EtaMnEtaTrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eta()-mcIter->eta());
1391  h2_ele_EtaMnEtaTrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eta()-mcIter->eta());
1392  h2_ele_EtaMnEtaTrueVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.eta()-mcIter->eta());
1393  h1_ele_PhiMnPhiTrue->Fill( bestGsfElectron.phi()-mcIter->phi());
1394  if (bestGsfElectron.isEB()) h1_ele_PhiMnPhiTrue_barrel->Fill( bestGsfElectron.phi()-mcIter->phi());
1395  if (bestGsfElectron.isEE()) h1_ele_PhiMnPhiTrue_endcaps->Fill( bestGsfElectron.phi()-mcIter->phi());
1396  h1_ele_PhiMnPhiTrue2->Fill( bestGsfElectron.phi()-mcIter->phi());
1397  h2_ele_PhiMnPhiTrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.phi()-mcIter->phi());
1398  h2_ele_PhiMnPhiTrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.phi()-mcIter->phi());
1399  h2_ele_PhiMnPhiTrueVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.phi()-mcIter->phi());
1400  h1_ele_PoPtrue->Fill( bestGsfElectron.p()/mcIter->p());
1401  h1_ele_PtoPttrue->Fill( bestGsfElectron.pt()/mcIter->pt());
1402  h2_ele_PoPtrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.p()/mcIter->p());
1403  h2_ele_PoPtrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.p()/mcIter->p());
1404  h2_ele_PoPtrueVsPt->Fill( bestGsfElectron.py(), bestGsfElectron.p()/mcIter->p());
1405  if (bestGsfElectron.isEB()) h1_ele_PoPtrue_barrel->Fill( bestGsfElectron.p()/mcIter->p());
1406  if (bestGsfElectron.isEE()) h1_ele_PoPtrue_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
1407  if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_PoPtrue_golden_barrel->Fill( bestGsfElectron.p()/mcIter->p());
1408  if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_PoPtrue_golden_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
1409  if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_PoPtrue_showering_barrel->Fill( bestGsfElectron.p()/mcIter->p());
1410  if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_PoPtrue_showering_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
1411  if (bestGsfElectron.isEB()) h1_ele_PtoPttrue_barrel->Fill( bestGsfElectron.pt()/mcIter->pt());
1412  if (bestGsfElectron.isEE()) h1_ele_PtoPttrue_endcaps->Fill( bestGsfElectron.pt()/mcIter->pt());
1414  if (bestGsfElectron.isEB()) h1_ele_ecalEnergyError_barrel->Fill(bestGsfElectron.correctedEcalEnergyError());
1415  if (bestGsfElectron.isEE()) h1_ele_ecalEnergyError_endcaps->Fill(bestGsfElectron.correctedEcalEnergyError());
1416  h1_ele_combinedP4Error->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION));
1417  if (bestGsfElectron.isEB()) h1_ele_combinedP4Error_barrel->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION));
1418  if (bestGsfElectron.isEE()) h1_ele_combinedP4Error_endcaps->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION));
1419 
1420  // supercluster related distributions
1421  reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
1422  //if (!bestGsfElectron.ecalDrivenSeed()&&bestGsfElectron.trackerDrivenSeed())
1423  // { sclRef = bestGsfElectron.parentSuperCluster() ; }
1424 
1425  h1_scl_En->Fill(bestGsfElectron.ecalEnergy());
1426  if (bestGsfElectron.isEB()) h1_scl_EoEtrue_barrel->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1427  if (bestGsfElectron.isEE()) h1_scl_EoEtrue_endcaps->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1428  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed()) h1_scl_EoEtrue_barrel_eg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1429  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed()) h1_scl_EoEtrue_endcaps_eg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1430  if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap()) h1_scl_EoEtrue_barrel_etagap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1431  if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap()) h1_scl_EoEtrue_barrel_phigap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1432  if (bestGsfElectron.isEBEEGap()) h1_scl_EoEtrue_ebeegap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1433  //if (bestGsfElectron.isEE()) h1_scl_EoEtrue_endcaps->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1434  if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap()) h1_scl_EoEtrue_endcaps_deegap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1435  if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap()) h1_scl_EoEtrue_endcaps_ringgap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1436  if (bestGsfElectron.isEB()) h1_scl_EoEtrue_barrel_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1437  if (bestGsfElectron.isEE()) h1_scl_EoEtrue_endcaps_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1438  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed()) h1_scl_EoEtrue_barrel_new_eg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1439  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed()) h1_scl_EoEtrue_endcaps_new_eg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1440  if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap()) h1_scl_EoEtrue_barrel_new_etagap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1441  if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap()) h1_scl_EoEtrue_barrel_new_phigap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1442  if (bestGsfElectron.isEBEEGap()) h1_scl_EoEtrue_ebeegap_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1443  //if (bestGsfElectron.isEE()) h1_scl_EoEtrue_endcaps_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1444  if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap()) h1_scl_EoEtrue_endcaps_new_deegap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1445  if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap()) h1_scl_EoEtrue_endcaps_new_ringgap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
1446 
1447  double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
1448  double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
1449  h1_scl_Et->Fill(sclRef->energy()*(Rt/R));
1450  h2_scl_EtVsEta->Fill(sclRef->eta(),sclRef->energy()*(Rt/R));
1451  h2_scl_EtVsPhi->Fill(sclRef->phi(),sclRef->energy()*(Rt/R));
1452  h1_scl_Eta->Fill(sclRef->eta());
1453  h2_scl_EtaVsPhi->Fill(sclRef->phi(),sclRef->eta());
1454  h1_scl_Phi->Fill(sclRef->phi());
1455  h1_scl_SigEtaEta->Fill(bestGsfElectron.scSigmaEtaEta());
1456  if (bestGsfElectron.isEB()) h1_scl_SigEtaEta_barrel->Fill(bestGsfElectron.scSigmaEtaEta());
1457  if (bestGsfElectron.isEE()) h1_scl_SigEtaEta_endcaps->Fill(bestGsfElectron.scSigmaEtaEta());
1458  h1_scl_SigIEtaIEta->Fill(bestGsfElectron.scSigmaIEtaIEta());
1459  if (bestGsfElectron.isEB()) h1_scl_SigIEtaIEta_barrel->Fill(bestGsfElectron.scSigmaIEtaIEta());
1460  if (bestGsfElectron.isEE()) h1_scl_SigIEtaIEta_endcaps->Fill(bestGsfElectron.scSigmaIEtaIEta());
1461  h1_scl_E1x5->Fill(bestGsfElectron.scE1x5());
1462  if (bestGsfElectron.isEB()) h1_scl_E1x5_barrel->Fill(bestGsfElectron.scE1x5());
1463  if (bestGsfElectron.isEE()) h1_scl_E1x5_endcaps->Fill(bestGsfElectron.scE1x5());
1464  h1_scl_E2x5max->Fill(bestGsfElectron.scE2x5Max());
1465  if (bestGsfElectron.isEB()) h1_scl_E2x5max_barrel->Fill(bestGsfElectron.scE2x5Max());
1466  if (bestGsfElectron.isEE()) h1_scl_E2x5max_endcaps->Fill(bestGsfElectron.scE2x5Max());
1467  h1_scl_E5x5->Fill(bestGsfElectron.scE5x5());
1468  if (bestGsfElectron.isEB()) h1_scl_E5x5_barrel->Fill(bestGsfElectron.scE5x5());
1469  if (bestGsfElectron.isEE()) h1_scl_E5x5_endcaps->Fill(bestGsfElectron.scE5x5());
1470  if (bestGsfElectron.ecalDrivenSeed()) h1_scl_SigIEtaIEta_eg->Fill(bestGsfElectron.scSigmaIEtaIEta());
1471  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_scl_SigIEtaIEta_eg_barrel->Fill(bestGsfElectron.scSigmaIEtaIEta());
1472  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_scl_SigIEtaIEta_eg_endcaps->Fill(bestGsfElectron.scSigmaIEtaIEta());
1473  if (bestGsfElectron.ecalDrivenSeed())h1_scl_E1x5_eg->Fill(bestGsfElectron.scE1x5());
1474  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())h1_scl_E1x5_eg_barrel->Fill(bestGsfElectron.scE1x5());
1475  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())h1_scl_E1x5_eg_endcaps->Fill(bestGsfElectron.scE1x5());
1476  if (bestGsfElectron.ecalDrivenSeed())h1_scl_E2x5max_eg->Fill(bestGsfElectron.scE2x5Max());
1477  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())h1_scl_E2x5max_eg_barrel->Fill(bestGsfElectron.scE2x5Max());
1478  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())h1_scl_E2x5max_eg_endcaps->Fill(bestGsfElectron.scE2x5Max());
1479  if (bestGsfElectron.ecalDrivenSeed())h1_scl_E5x5_eg->Fill(bestGsfElectron.scE5x5());
1480  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())h1_scl_E5x5_eg_barrel->Fill(bestGsfElectron.scE5x5());
1481  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())h1_scl_E5x5_eg_endcaps->Fill(bestGsfElectron.scE5x5());
1482  float pfEnergy=0. ;
1483  if (!bestGsfElectron.parentSuperCluster().isNull()) pfEnergy = bestGsfElectron.parentSuperCluster()->energy();
1484  h2_scl_EoEtruePfVsEg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p(),pfEnergy/mcIter->p());
1485 
1486  // track related distributions
1487  h1_ele_ambiguousTracks->Fill( bestGsfElectron.ambiguousGsfTracksSize() );
1488  h2_ele_ambiguousTracksVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize() );
1489  h2_ele_ambiguousTracksVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize() );
1490  h2_ele_ambiguousTracksVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize() );
1491  if (!readAOD_) // track extra does not exist in AOD
1492  {
1493  h1_ele_foundHits->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
1494  if (bestGsfElectron.isEB()) h1_ele_foundHits_barrel->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
1495  if (bestGsfElectron.isEE()) h1_ele_foundHits_endcaps->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
1496  h2_ele_foundHitsVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
1497  h2_ele_foundHitsVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
1498  h2_ele_foundHitsVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
1499  h1_ele_lostHits->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
1500  if (bestGsfElectron.isEB()) h1_ele_lostHits_barrel->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
1501  if (bestGsfElectron.isEE()) h1_ele_lostHits_endcaps->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
1502  h2_ele_lostHitsVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
1503  h2_ele_lostHitsVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
1504  h2_ele_lostHitsVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
1505  h1_ele_chi2->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
1506  if (bestGsfElectron.isEB()) h1_ele_chi2_barrel->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
1507  if (bestGsfElectron.isEE()) h1_ele_chi2_endcaps->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
1508  h2_ele_chi2VsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2() );
1509  h2_ele_chi2VsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2() );
1510  h2_ele_chi2VsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2() );
1511  }
1512  // from gsf track interface, hence using mean
1513  if (!readAOD_) // track extra does not exist in AOD
1514  {
1515  h1_ele_PinMnPout->Fill( bestGsfElectron.gsfTrack()->innerMomentum().R() - bestGsfElectron.gsfTrack()->outerMomentum().R() );
1516  h1_ele_outerP->Fill( bestGsfElectron.gsfTrack()->outerMomentum().R() );
1517  h1_ele_outerPt->Fill( bestGsfElectron.gsfTrack()->outerMomentum().Rho() );
1518  }
1519  // from electron interface, hence using mode
1520  h1_ele_PinMnPout_mode->Fill( bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
1521  h2_ele_PinMnPoutVsEta_mode->Fill( bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
1522  h2_ele_PinMnPoutVsPhi_mode->Fill( bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
1523  h2_ele_PinMnPoutVsPt_mode->Fill( bestGsfElectron.pt(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
1524  h2_ele_PinMnPoutVsE_mode->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
1525  if (!readAOD_) // track extra does not exist in AOD
1526  {
1528  ( bestGsfElectron.gsfTrack()->normalizedChi2(),
1529  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() ) ;
1530  }
1531  h1_ele_outerP_mode->Fill( bestGsfElectron.trackMomentumOut().R() );
1532  h2_ele_outerPVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().R() );
1533  h1_ele_outerPt_mode->Fill( bestGsfElectron.trackMomentumOut().Rho() );
1534  h2_ele_outerPtVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().Rho() );
1535  h2_ele_outerPtVsPhi_mode->Fill(bestGsfElectron.phi(), bestGsfElectron.trackMomentumOut().Rho() );
1536  h2_ele_outerPtVsPt_mode->Fill(bestGsfElectron.pt(), bestGsfElectron.trackMomentumOut().Rho() );
1537 
1538  if (!readAOD_) // track extra does not exist in AOD
1539  {
1540  edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
1541  ElectronSeedRef elseed=seed.castTo<ElectronSeedRef>();
1542  h1_ele_seed_subdet2->Fill(elseed->subDet2());
1543  h1_ele_seed_mask->Fill(elseed->hitsMask());
1544  if (elseed->subDet2()==1)
1545  { h1_ele_seed_mask_bpix->Fill(elseed->hitsMask()); }
1546  else if (elseed->subDet2()==2)
1547  { h1_ele_seed_mask_fpix->Fill(elseed->hitsMask()); }
1548  else if (elseed->subDet2()==6)
1549  { h1_ele_seed_mask_tec->Fill(elseed->hitsMask()); }
1550  h1_ele_seed_dphi2->Fill(elseed->dPhi2());
1551  h2_ele_seed_dphi2VsEta->Fill(bestGsfElectron.eta(), elseed->dPhi2());
1552  h2_ele_seed_dphi2VsPt->Fill(bestGsfElectron.pt(), elseed->dPhi2());
1553  h1_ele_seed_dphi2pos->Fill(elseed->dPhi2Pos());
1554  h2_ele_seed_dphi2posVsEta->Fill(bestGsfElectron.eta(), elseed->dPhi2Pos());
1555  h2_ele_seed_dphi2posVsPt->Fill(bestGsfElectron.pt(), elseed->dPhi2Pos());
1556  h1_ele_seed_drz2->Fill(elseed->dRz2());
1557  h2_ele_seed_drz2VsEta->Fill(bestGsfElectron.eta(), elseed->dRz2());
1558  h2_ele_seed_drz2VsPt->Fill(bestGsfElectron.pt(), elseed->dRz2());
1559  h1_ele_seed_drz2pos->Fill(elseed->dRz2Pos());
1560  h2_ele_seed_drz2posVsEta->Fill(bestGsfElectron.eta(), elseed->dRz2Pos());
1561  h2_ele_seed_drz2posVsPt->Fill(bestGsfElectron.pt(), elseed->dRz2Pos());
1562  }
1563 
1564  // match distributions
1565  h1_ele_EoP->Fill( bestGsfElectron.eSuperClusterOverP() );
1566  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg->Fill( bestGsfElectron.eSuperClusterOverP() );
1567  if (bestGsfElectron.isEB()) h1_ele_EoP_barrel->Fill( bestGsfElectron.eSuperClusterOverP() );
1568  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg_barrel->Fill( bestGsfElectron.eSuperClusterOverP() );
1569  if (bestGsfElectron.isEE()) h1_ele_EoP_endcaps->Fill( bestGsfElectron.eSuperClusterOverP() );
1570  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg_endcaps->Fill( bestGsfElectron.eSuperClusterOverP() );
1571  h2_ele_EoPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSuperClusterOverP() );
1572  h2_ele_EoPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSuperClusterOverP() );
1573  h2_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSuperClusterOverP() );
1574  h1_ele_EseedOP->Fill( bestGsfElectron.eSeedClusterOverP() );
1575  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg->Fill( bestGsfElectron.eSeedClusterOverP() );
1576  if (bestGsfElectron.isEB()) h1_ele_EseedOP_barrel->Fill( bestGsfElectron.eSeedClusterOverP() );
1577  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg_barrel->Fill( bestGsfElectron.eSeedClusterOverP() );
1578  if (bestGsfElectron.isEE()) h1_ele_EseedOP_endcaps->Fill( bestGsfElectron.eSeedClusterOverP() );
1579  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg_endcaps->Fill( bestGsfElectron.eSeedClusterOverP() );
1580  h2_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverP() );
1581  h2_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverP() );
1582  h2_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverP() );
1583  h1_ele_EoPout->Fill( bestGsfElectron.eSeedClusterOverPout() );
1584  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg->Fill( bestGsfElectron.eSeedClusterOverPout() );
1585  if (bestGsfElectron.isEB()) h1_ele_EoPout_barrel->Fill( bestGsfElectron.eSeedClusterOverPout() );
1586  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg_barrel->Fill( bestGsfElectron.eSeedClusterOverPout() );
1587  if (bestGsfElectron.isEE()) h1_ele_EoPout_endcaps->Fill( bestGsfElectron.eSeedClusterOverPout() );
1588  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg_endcaps->Fill( bestGsfElectron.eSeedClusterOverPout() );
1589  h2_ele_EoPoutVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout() );
1590  h2_ele_EoPoutVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout() );
1591  h2_ele_EoPoutVsE->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout() );
1592  h1_ele_EeleOPout->Fill( bestGsfElectron.eEleClusterOverPout() );
1593  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg->Fill( bestGsfElectron.eEleClusterOverPout() );
1594  if (bestGsfElectron.isEB()) h1_ele_EeleOPout_barrel->Fill( bestGsfElectron.eEleClusterOverPout() );
1595  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg_barrel->Fill( bestGsfElectron.eEleClusterOverPout() );
1596  if (bestGsfElectron.isEE()) h1_ele_EeleOPout_endcaps->Fill( bestGsfElectron.eEleClusterOverPout() );
1597  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg_endcaps->Fill( bestGsfElectron.eEleClusterOverPout() );
1598  h2_ele_EeleOPoutVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout() );
1599  h2_ele_EeleOPoutVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout() );
1600  h2_ele_EeleOPoutVsE->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout() );
1602  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1603  if (bestGsfElectron.isEB()) h1_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1604  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1605  if (bestGsfElectron.isEE())h1_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1606  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1607  h2_ele_dEtaScVsEta_propVtx->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1608  h2_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1609  h2_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
1611  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1612  if (bestGsfElectron.isEB()) h1_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1613  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1614  if (bestGsfElectron.isEE())h1_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1615  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1616  h2_ele_dPhiScVsEta_propVtx->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1617  h2_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1618  h2_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
1620  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1621  if (bestGsfElectron.isEB()) h1_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1622  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1623  if (bestGsfElectron.isEE()) h1_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1624  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1625  h2_ele_dEtaClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1626  h2_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1627  h2_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1629  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1630  if (bestGsfElectron.isEB()) h1_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1631  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1632  if (bestGsfElectron.isEE()) h1_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1633  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1634  h2_ele_dPhiClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1635  h2_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1636  h2_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1638  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1639  if (bestGsfElectron.isEB()) h1_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1640  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1641  if (bestGsfElectron.isEE()) h1_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1642  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1643  h2_ele_dEtaEleClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1644  h2_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1645  h2_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1647  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1648  if (bestGsfElectron.isEB()) h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1649  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1650  if (bestGsfElectron.isEE()) h1_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1651  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1652  h2_ele_dPhiEleClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1653  h2_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1654  h2_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1655  h1_ele_HoE->Fill(bestGsfElectron.hcalOverEcal());
1656  h1_ele_HoE_bc->Fill(bestGsfElectron.hcalOverEcalBc());
1657  if (bestGsfElectron.isEB()) h1_ele_HoE_bc_barrel->Fill(bestGsfElectron.hcalOverEcalBc());
1658  if (bestGsfElectron.isEE()) h1_ele_HoE_bc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc());
1659  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg->Fill(bestGsfElectron.hcalOverEcal());
1660  if (bestGsfElectron.isEB()) h1_ele_HoE_barrel->Fill(bestGsfElectron.hcalOverEcal());
1661  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg_barrel->Fill(bestGsfElectron.hcalOverEcal());
1662  if (bestGsfElectron.isEE()) h1_ele_HoE_endcaps->Fill(bestGsfElectron.hcalOverEcal());
1663  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg_endcaps->Fill(bestGsfElectron.hcalOverEcal());
1664  if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap()&& !bestGsfElectron.isEBEEGap() &&
1665  !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap()) h1_ele_HoE_fiducial->Fill(bestGsfElectron.hcalOverEcal());
1666  h2_ele_HoEVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.hcalOverEcal());
1667  h2_ele_HoEVsPhi->Fill(bestGsfElectron.phi(),bestGsfElectron.hcalOverEcal());
1668  h2_ele_HoEVsE->Fill(bestGsfElectron.caloEnergy(),bestGsfElectron.hcalOverEcal());
1669 
1670  //classes
1671  int eleClass = bestGsfElectron.classification();
1672  if (bestGsfElectron.isEE()) eleClass+=10;
1673  h1_ele_classes->Fill(eleClass);
1674 
1675  if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEB()) h1_scl_EoEtrueGolden_barrel->Fill(sclRef->energy()/mcIter->p());
1676  if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEE()) h1_scl_EoEtrueGolden_endcaps->Fill(sclRef->energy()/mcIter->p());
1677  if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEB()) h1_scl_EoEtrueShowering_barrel->Fill(sclRef->energy()/mcIter->p());
1678  if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEE()) h1_scl_EoEtrueShowering_endcaps->Fill(sclRef->energy()/mcIter->p());
1679 
1680  //eleClass = eleClass%100; // get rid of barrel/endcap distinction
1681  h1_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
1682  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_eta_golden->Fill(std::abs(bestGsfElectron.eta()));
1683  if (bestGsfElectron.classification() == GsfElectron::BIGBREM) h1_ele_eta_bbrem->Fill(std::abs(bestGsfElectron.eta()));
1684  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_eta_shower->Fill(std::abs(bestGsfElectron.eta()));
1685 
1686  // fbrem
1687 
1688  double fbrem_mode = bestGsfElectron.fbrem();
1689  h1_ele_fbrem->Fill(fbrem_mode);
1690 
1691  if (bestGsfElectron.isEB())
1692  {
1693  double fbrem_mode_barrel = bestGsfElectron.fbrem();
1694  h1_ele_fbrem_barrel->Fill(fbrem_mode_barrel);
1695  }
1696 
1697  if (bestGsfElectron.isEE())
1698  {
1699  double fbrem_mode_endcaps = bestGsfElectron.fbrem();
1700  h1_ele_fbrem_endcaps->Fill(fbrem_mode_endcaps);
1701  }
1702 
1703  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_fbrem_eg->Fill(fbrem_mode);
1704  p1_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(),fbrem_mode);
1705 
1706  if (!readAOD_) // track extra does not exist in AOD
1707  {
1708  double fbrem_mean = 1. - bestGsfElectron.gsfTrack()->outerMomentum().R()/bestGsfElectron.gsfTrack()->innerMomentum().R() ;
1709  p1_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(),fbrem_mean) ;
1710  }
1711 
1712  //
1713 
1714  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
1715  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
1716  if (!readAOD_) // track extra not available in AOD
1717  {
1718  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
1719  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
1720  }
1721  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
1722  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
1723  if (!readAOD_) // track extra not available in AOD
1724  {
1725  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
1726  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
1727  }
1728 
1729  // provenance and pflow data
1730  h1_ele_mva->Fill(bestGsfElectron.mva());
1731  if (bestGsfElectron.isEB()) h1_ele_mva_barrel->Fill(bestGsfElectron.mva());
1732  if (bestGsfElectron.isEE()) h1_ele_mva_endcaps->Fill(bestGsfElectron.mva());
1733  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_mva_eg->Fill(bestGsfElectron.mva());
1734  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(1.);
1735  if (bestGsfElectron.trackerDrivenSeed()) h1_ele_provenance->Fill(-1.);
1736  if (bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(0.);
1737  if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(-2.);
1738  if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(2.);
1739 
1740  if (bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(1.);
1741  if (bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(-1.);
1742  if ((bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(0.);
1743  if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(-2.);
1744  if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(2.);
1745  if (bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(1.);
1746  if (bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(-1.);
1747  if ((bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(0.);
1748  if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(-2.);
1749  if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(2.);
1750 
1751  if (bestGsfElectron.isGsfCtfScPixChargeConsistent()) h1_ele_chargeInfo->Fill(-1.0);
1752  if (bestGsfElectron.isGsfScPixChargeConsistent()) h1_ele_chargeInfo->Fill(0.);
1753  if (bestGsfElectron.isGsfCtfChargeConsistent()) h1_ele_chargeInfo->Fill(1.0);
1754 
1755  // Pflow isolation
1757  if (bestGsfElectron.isEB()) h1_ele_chargedHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt);
1758  if (bestGsfElectron.isEE()) h1_ele_chargedHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt);
1759 
1761  if (bestGsfElectron.isEB()) h1_ele_neutralHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt);
1762  if (bestGsfElectron.isEE()) h1_ele_neutralHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt);
1763 
1765  if (bestGsfElectron.isEB()) h1_ele_photonIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt);
1766  if (bestGsfElectron.isEE()) h1_ele_photonIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt);
1767 
1768  // isolation
1769  h1_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
1770  if (bestGsfElectron.isEB()) h1_ele_tkSumPt_dr03_barrel->Fill(bestGsfElectron.dr03TkSumPt());
1771  if (bestGsfElectron.isEE()) h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt());
1773  if (bestGsfElectron.isEB()) h1_ele_ecalRecHitSumEt_dr03_barrel->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
1774  if (bestGsfElectron.isEE()) h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
1776  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
1777  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
1779  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
1780  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
1782  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEtBc());
1783  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEtBc());
1785  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEtBc());
1786  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEtBc());
1787  h1_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
1788  if (bestGsfElectron.isEB()) h1_ele_tkSumPt_dr04_barrel->Fill(bestGsfElectron.dr04TkSumPt());
1789  if (bestGsfElectron.isEE()) h1_ele_tkSumPt_dr04_endcaps->Fill(bestGsfElectron.dr04TkSumPt());
1791  if (bestGsfElectron.isEB()) h1_ele_ecalRecHitSumEt_dr04_barrel->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
1792  if (bestGsfElectron.isEE()) h1_ele_ecalRecHitSumEt_dr04_endcaps->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
1794  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
1795  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
1797  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
1798  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
1799 
1801  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEtBc());
1802  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEtBc());
1804  if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEtBc());
1805  if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEtBc());
1806 
1808  if (bestGsfElectron.isEB()) h1_ele_hcalDepth1OverEcalBc_barrel->Fill(bestGsfElectron.hcalDepth1OverEcalBc());
1809  if (bestGsfElectron.isEE()) h1_ele_hcalDepth1OverEcalBc_endcaps->Fill(bestGsfElectron.hcalDepth1OverEcalBc());
1811  if (bestGsfElectron.isEB()) h1_ele_hcalDepth2OverEcalBc_barrel->Fill(bestGsfElectron.hcalDepth2OverEcalBc());
1812  if (bestGsfElectron.isEE()) h1_ele_hcalDepth2OverEcalBc_endcaps->Fill(bestGsfElectron.hcalDepth2OverEcalBc());
1813 
1814  // isolation : difference with iso deposits
1815  if ( isoFromDepsTk03Handle.isValid() )
1816  { h1_ele_dIso_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt()-((*isoFromDepsTk03Handle)[bestGsfElectronRef])) ; }
1817  if ( isoFromDepsTk04Handle.isValid() )
1818  { h1_ele_dIso_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt()-((*isoFromDepsTk04Handle)[bestGsfElectronRef])) ; }
1819  if ( isoFromDepsEcalFull03Handle.isValid() )
1820  { h1_ele_dIso_ecalFullRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt()-((*isoFromDepsEcalFull03Handle)[bestGsfElectronRef])) ; }
1821  if ( isoFromDepsEcalFull04Handle.isValid() )
1822  { h1_ele_dIso_ecalFullRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt()-((*isoFromDepsEcalFull04Handle)[bestGsfElectronRef])) ; }
1823  if ( isoFromDepsEcalReduced03Handle.isValid() )
1824  { h1_ele_dIso_ecalReducedRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt()-((*isoFromDepsEcalReduced03Handle)[bestGsfElectronRef])) ; }
1825  if ( isoFromDepsEcalReduced04Handle.isValid() )
1826  { h1_ele_dIso_ecalReducedRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt()-((*isoFromDepsEcalReduced04Handle)[bestGsfElectronRef])) ; }
1827  if ( isoFromDepsHcal03Handle.isValid() )
1828  { h1_ele_dIso_hcalTowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalTowerSumEt()-((*isoFromDepsHcal03Handle)[bestGsfElectronRef])) ; }
1829  if ( isoFromDepsHcal04Handle.isValid() )
1830  { h1_ele_dIso_hcalTowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalTowerSumEt()-((*isoFromDepsHcal04Handle)[bestGsfElectronRef])) ; }
1831 
1832  // conversion rejection
1833  int flags = bestGsfElectron.convFlags() ;
1834  if (flags==-9999) { flags=-1 ; }
1835  h1_ele_convFlags->Fill(flags);
1836  if (flags>=0.)
1837  {
1838  h1_ele_convDist->Fill( bestGsfElectron.convDist() );
1839  h1_ele_convDcot->Fill( bestGsfElectron.convDcot() );
1840  h1_ele_convRadius->Fill( bestGsfElectron.convRadius() );
1841  }
1842 
1843  } // loop over mc particle
1844  h1_mcNum->Fill(mcNum) ;
1845  h1_eleNum->Fill(eleNum) ;
1846  }
1847 
1848 
const PflowIsolationVariables & pfIsolationVariables() const
Definition: GsfElectron.h:570
MonitorElement * h1_ele_dIso_hcalTowerSumEt_dr03
MonitorElement * h1_ele_ecalEnergyError_endcaps
MonitorElement * h1_scl_EoEtrue_endcaps_ringgap
MonitorElement * h1_ele_dPhiCl_propOut_eg_barrel
T getParameter(std::string const &) const
float dr04HcalTowerSumEt() const
Definition: GsfElectron.h:458
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth1_endcaps
int i
Definition: DBlmapReader.cc:9
MonitorElement * bookP1(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 * bookH1(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_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:175
float scSigmaEtaEta() const
Definition: GsfElectron.h:405
bool isEBEtaGap() const
Definition: GsfElectron.h:339
float dr03HcalDepth1TowerSumEtBc() const
Definition: GsfElectron.h:448
edm::EDGetTokenT< reco::GsfElectronCollection > electronCollection_
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth2
float eSuperClusterOverP() const
Definition: GsfElectron.h:230
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
virtual double p() const GCC11_FINAL
magnitude of momentum vector
MonitorElement * h1_scl_EoEtrue_endcaps_new_eg
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsTk03Tag_
bool isEBEEGap() const
Definition: GsfElectron.h:337
float dr04HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:456
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * h1_ele_hcalDepth1OverEcalBc_barrel
virtual const Point & vertex() const
vertex position (overwritten by PF...)
MonitorElement * h1_ele_dPhiEleCl_propOut_endcaps
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:273
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth2_endcaps
MonitorElement * h2_ele_dEtaEleClVsEta_propOut
edm::EDGetTokenT< reco::GenParticleCollection > mcTruthCollection_
MonitorElement * h1_ele_dEtaSc_propVtx_endcaps
float p4Error(P4Kind kind) const
Definition: GsfElectron.cc:216
MonitorElement * h1_ele_dEtaSc_propVtx_all_endcaps
MonitorElement * h1_ele_dPhiCl_propOut_all_endcaps
MonitorElement * h1_ele_dIso_ecalReducedRecHitSumEt_dr03
MonitorElement * h1_ele_dIso_ecalFullRecHitSumEt_dr04
float dr04TkSumPt() const
Definition: GsfElectron.h:454
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
MonitorElement * h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps
bool isEERingGap() const
Definition: GsfElectron.h:343
MonitorElement * h1_ele_dEtaCl_propOut_eg_barrel
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsHcal04Tag_
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:446
float fbrem() const
Definition: GsfElectron.h:653
MonitorElement * h1_ele_hcalDepth2OverEcalBc_barrel
float scE2x5Max() const
Definition: GsfElectron.h:408
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth1_endcaps
float convDist() const
Definition: GsfElectron.h:505
float convRadius() const
Definition: GsfElectron.h:507
uint16_t size_type
bool isEEDeeGap() const
Definition: GsfElectron.h:342
MonitorElement * h1_ele_chargedHadronIso_endcaps
MonitorElement * bookH1withSumw2(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")
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
MonitorElement * h2_ele_dPhiEleClVsPhi_propOut
bool isEE() const
Definition: GsfElectron.h:335
bool isEB() const
Definition: GsfElectron.h:334
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)
float convDcot() const
Definition: GsfElectron.h:506
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth1
edm::EDGetTokenT< reco::GsfElectronCoreCollection > electronCoreCollection_
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth2
bool isGsfScPixChargeConsistent() const
Definition: GsfElectron.h:140
MonitorElement * h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel
MonitorElement * h1_ele_dIso_hcalTowerSumEt_dr04
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
float dr04HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:457
MonitorElement * h1_ele_PoPtrue_showering_endcaps
MonitorElement * h1_ele_hcalDepth2OverEcalBc_endcaps
MonitorElement * h2_ele_PtinVsPtoutGolden_mode
MonitorElement * h1_ele_neutralHadronIso_barrel
float mva() const
Definition: GsfElectron.h:581
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
bool isGsfCtfChargeConsistent() const
Definition: GsfElectron.h:141
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:234
int iEvent
Definition: GenABIO.cc:243
MonitorElement * h1_ele_dEtaEleCl_propOut_endcaps
bool isNull() const
Checks for null.
Definition: Ref.h:247
float dr03HcalDepth2TowerSumEtBc() const
Definition: GsfElectron.h:449
float eSeedClusterOverP() const
Definition: GsfElectron.h:231
MonitorElement * h1_ele_dPhiSc_propVtx_endcaps
float dr04EcalRecHitSumEt() const
Definition: GsfElectron.h:455
MonitorElement * h1_ele_dEtaSc_propVtx_eg_endcaps
float deltaPhiSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:238
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T sqrt(T t)
Definition: SSEVec.h:48
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:169
math::XYZVectorF trackMomentumOut() const
Definition: GsfElectron.h:275
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
Definition: GsfElectron.h:527
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:237
MonitorElement * h1_ele_dPhiSc_propVtx_eg_barrel
MonitorElement * h2_ele_dPhiEleClVsEta_propOut
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
float hcalOverEcal() const
Definition: GsfElectron.h:394
MonitorElement * h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps
float dr04HcalDepth1TowerSumEtBc() const
Definition: GsfElectron.h:459
float dr03TkSumPt() const
Definition: GsfElectron.h:443
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * h1_scl_EoEtrueShowering_endcaps
float dr03HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:445
MonitorElement * h1_ele_hcalDepth1OverEcalBc_endcaps
float eEleClusterOverPout() const
Definition: GsfElectron.h:233
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:526
float eSeedClusterOverPout() const
Definition: GsfElectron.h:232
MonitorElement * h1_ele_ecalEnergyError_barrel
MonitorElement * h1_ele_dPhiSc_propVtx_eg_endcaps
bool isValid() const
Definition: HandleBase.h:76
float hcalOverEcalBc() const
Definition: GsfElectron.h:398
float scSigmaIEtaIEta() const
Definition: GsfElectron.h:406
edm::EDGetTokenT< reco::GsfTrackCollection > electronTrackCollection_
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
MonitorElement * h1_ele_dIso_ecalReducedRecHitSumEt_dr04
float deltaPhiEleClusterTrackAtCalo() const
Definition: GsfElectron.h:239
MonitorElement * h1_ele_dPhiSc_propVtx_all_barrel
tuple conf
Definition: dbtoconf.py:185
MonitorElement * h1_ele_dEtaCl_propOut_eg_endcaps
MonitorElement * h1_ele_hcalTowerSumEtBc_dr04_depth1
MonitorElement * h1_scl_EoEtrueShowering_barrel
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
virtual int pdgId() const =0
PDG identifier.
MonitorElement * h1_ele_dPhiEleCl_propOut_barrel
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsTk04Tag_
MonitorElement * h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel
MonitorElement * h1_scl_EoEtrue_barrel_new_etagap
MonitorElement * h1_ele_hcalTowerSumEtBc_dr03_depth2
MonitorElement * h1_ele_dPhiEleCl_propOut_eg_barrel
float deltaEtaEleClusterTrackAtCalo() const
Definition: GsfElectron.h:236
virtual int charge() const GCC11_FINAL
electric charge
Classification classification() const
Definition: GsfElectron.h:649
float hcalDepth2OverEcalBc() const
Definition: GsfElectron.h:397
REF castTo() const
cast to a concrete type
Definition: RefToBase.h:241
GsfTrackRefVector::size_type ambiguousGsfTracksSize() const
Definition: GsfElectron.h:602
float dr04HcalDepth2TowerSumEtBc() const
Definition: GsfElectron.h:460
MonitorElement * h1_ele_dEtaCl_propOut_endcaps
ElectronMcSignalValidator(const edm::ParameterSet &conf)
MonitorElement * h2_ele_PinVsPoutShowering_mean
MonitorElement * h1_scl_SigIEtaIEta_eg_endcaps
MonitorElement * h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel
MonitorElement * h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps
T const * product() const
Definition: Handle.h:81
MonitorElement * bookH2(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_hcalTowerSumEtBc_dr04_depth1_barrel
float ecalEnergy() const
Definition: GsfElectron.h:741
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:444
MonitorElement * h1_ele_dPhiCl_propOut_all_barrel
MonitorElement * h1_ele_dEtaCl_propOut_all_barrel
float correctedEcalEnergyError() const
Definition: GsfElectron.h:728
MonitorElement * h1_ele_dEtaEleCl_propOut_eg_barrel
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsEcalFull03Tag_
MonitorElement * h1_ele_dIso_ecalFullRecHitSumEt_dr03
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth2_barrel
edm::EventID id() const
Definition: EventBase.h:56
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:235
MonitorElement * h1_ele_dEtaEleCl_propOut_eg_endcaps
T perp() const
Magnitude of transverse component.
MonitorElement * h1_ele_combinedP4Error_endcaps
int convFlags() const
Definition: GsfElectron.h:503
MonitorElement * h1_ele_ecalRecHitSumEt_dr03_barrel
bool isEBPhiGap() const
Definition: GsfElectron.h:340
MonitorElement * h1_scl_EoEtrue_endcaps_new_deegap
bool isGsfCtfScPixChargeConsistent() const
Definition: GsfElectron.h:139
bool trackerDrivenSeed() const
Definition: GsfElectron.h:174
MonitorElement * h2_ele_PinVsPoutShowering_mode
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth2_endcaps
float dr03HcalTowerSumEt() const
Definition: GsfElectron.h:447
MonitorElement * h1_ele_ecalRecHitSumEt_dr04_endcaps
MonitorElement * h1_ele_dEtaCl_propOut_all_endcaps
float scE5x5() const
Definition: GsfElectron.h:409
volatile std::atomic< bool > shutdown_flag false
double pi
float hcalDepth1OverEcalBc() const
Definition: GsfElectron.h:396
MonitorElement * bookH2withSumw2(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")
virtual float pt() const GCC11_FINAL
transverse momentum
MonitorElement * h1_ele_dPhiEleCl_propOut_eg_endcaps
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
Definition: GsfElectron.h:525
float caloEnergy() const
Definition: GsfElectron.h:744
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_dEtaEleCl_propOut_barrel
edm::EDGetTokenT< reco::ElectronSeedCollection > electronSeedCollection_
MonitorElement * h1_ele_dEtaSc_propVtx_eg_barrel
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsEcalReduced04Tag_
MonitorElement * h1_ele_dPhiCl_propOut_endcaps
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
MonitorElement * h1_ele_PoPtrue_golden_endcaps
float scE1x5() const
Definition: GsfElectron.h:407
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:170
MonitorElement * h1_ele_dPhiCl_propOut_eg_endcaps
edm::EDGetTokenT< edm::ValueMap< double > > isoFromDepsHcal03Tag_
bool ecalDrivenSeed() const
Definition: GsfElectron.h:173
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth2_barrel