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 
9 
23 
30 
31 #include "CLHEP/Units/GlobalPhysicalConstants.h"
32 #include "TMath.h"
33 #include "TFile.h"
34 #include "TH1F.h"
35 #include "TH1I.h"
36 #include "TH2F.h"
37 #include "TProfile.h"
38 #include "TTree.h"
39 #include <vector>
40 #include <iostream>
41 
42 using namespace reco;
43 
45  : ElectronValidator(conf)
46  {
47  outputFile_ = conf.getParameter<std::string>("outputFile");
48  electronCollection_ = conf.getParameter<edm::InputTag>("electronCollection");
49  mcTruthCollection_ = conf.getParameter<edm::InputTag>("mcTruthCollection");
50  beamSpotTag_ = conf.getParameter<edm::InputTag>("beamSpot") ;
51  readAOD_ = conf.getParameter<bool>("readAOD");
52  maxPt_ = conf.getParameter<double>("MaxPt");
53  maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
54  deltaR_ = conf.getParameter<double>("DeltaR");
55  matchingIDs_ = conf.getParameter<std::vector<int> >("MatchingID");
56  matchingMotherIDs_ = conf.getParameter<std::vector<int> >("MatchingMotherID");
57 
58  // histos bining and limits
59 
60  edm::ParameterSet histosSet = conf.getParameter<edm::ParameterSet>("histosCfg") ;
61 
62  xyz_nbin=histosSet.getParameter<int>("Nbinxyz");
63 
64  p_nbin=histosSet.getParameter<int>("Nbinp");
65  p2D_nbin=histosSet.getParameter<int>("Nbinp2D");
66  p_max=histosSet.getParameter<double>("Pmax");
67 
68  pt_nbin=histosSet.getParameter<int>("Nbinpt");
69  pt2D_nbin=histosSet.getParameter<int>("Nbinpt2D");
70  pteff_nbin=histosSet.getParameter<int>("Nbinpteff");
71  pt_max=histosSet.getParameter<double>("Ptmax");
72 
73  fhits_nbin=histosSet.getParameter<int>("Nbinfhits");
74  fhits_max=histosSet.getParameter<double>("Fhitsmax");
75 
76  lhits_nbin=histosSet.getParameter<int>("Nbinlhits");
77  lhits_max=histosSet.getParameter<double>("Lhitsmax");
78 
79  eop_nbin=histosSet.getParameter<int>("Nbineop");
80  eop2D_nbin=histosSet.getParameter<int>("Nbineop2D");
81  eop_max=histosSet.getParameter<double>("Eopmax");
82  eopmaxsht=histosSet.getParameter<double>("Eopmaxsht");
83 
84  eta_nbin=histosSet.getParameter<int>("Nbineta");
85  eta2D_nbin=histosSet.getParameter<int>("Nbineta2D");
86  eta_min=histosSet.getParameter<double>("Etamin");
87  eta_max=histosSet.getParameter<double>("Etamax");
88 
89  deta_nbin=histosSet.getParameter<int>("Nbindeta");
90  deta_min=histosSet.getParameter<double>("Detamin");
91  deta_max=histosSet.getParameter<double>("Detamax");
92 
93  phi_nbin=histosSet.getParameter<int>("Nbinphi");
94  phi2D_nbin=histosSet.getParameter<int>("Nbinphi2D");
95  phi_min=histosSet.getParameter<double>("Phimin");
96  phi_max=histosSet.getParameter<double>("Phimax");
97 
98  detamatch_nbin=histosSet.getParameter<int>("Nbindetamatch");
99  detamatch2D_nbin=histosSet.getParameter<int>("Nbindetamatch2D");
100  detamatch_min=histosSet.getParameter<double>("Detamatchmin");
101  detamatch_max=histosSet.getParameter<double>("Detamatchmax");
102 
103  dphi_nbin=histosSet.getParameter<int>("Nbindphi");
104  dphi_min=histosSet.getParameter<double>("Dphimin");
105  dphi_max=histosSet.getParameter<double>("Dphimax");
106 
107  dphimatch_nbin=histosSet.getParameter<int>("Nbindphimatch");
108  dphimatch2D_nbin=histosSet.getParameter<int>("Nbindphimatch2D");
109  dphimatch_min=histosSet.getParameter<double>("Dphimatchmin");
110  dphimatch_max=histosSet.getParameter<double>("Dphimatchmax");
111 
112  poptrue_nbin= histosSet.getParameter<int>("Nbinpoptrue");
113  poptrue_min=histosSet.getParameter<double>("Poptruemin");
114  poptrue_max=histosSet.getParameter<double>("Poptruemax");
115 
116  mee_nbin= histosSet.getParameter<int>("Nbinmee");
117  mee_min=histosSet.getParameter<double>("Meemin");
118  mee_max=histosSet.getParameter<double>("Meemax");
119 
120  hoe_nbin= histosSet.getParameter<int>("Nbinhoe");
121  hoe_min=histosSet.getParameter<double>("Hoemin");
122  hoe_max=histosSet.getParameter<double>("Hoemax");
123  }
124 
126  {
127  prepareStore() ;
128  setStoreFolder("EgammaV/ElectronMcSignalValidator") ;
129 
130  // mc truth
131  h1_mcNum = bookH1withSumw2("h_mcNum","# mc particles",fhits_nbin,0.,fhits_max,"N_{gen}" );
132  h1_eleNum = bookH1withSumw2("h_mcNum_ele","# mc electrons",fhits_nbin,0.,fhits_max,"# gen ele");
133  h1_gamNum = bookH1withSumw2("h_mcNum_gam","# mc gammas",fhits_nbin,0.,fhits_max,"N_{gen #gamma}");
134 
135  // rec event
136  h1_recEleNum_= bookH1("h_recEleNum","# rec electrons",20, 0.,20.,"N_{ele}");
137 
138  // mc
139  h1_simEta = bookH1withSumw2("h_mc_eta","gen #eta",eta_nbin,eta_min,eta_max,"#eta");
140  h1_simAbsEta = bookH1withSumw2("h_mc_abseta","gen |#eta|",eta_nbin/2,0.,eta_max);
141  h1_simP = bookH1withSumw2("h_mc_P","gen p",p_nbin,0.,p_max,"p (GeV/c)");
142  h1_simPt = bookH1withSumw2("h_mc_Pt","gen pt",pteff_nbin,5.,pt_max);
143  h1_simPhi = bookH1withSumw2("h_mc_phi","gen phi",phi_nbin,phi_min,phi_max);
144  h1_simZ = bookH1withSumw2("h_mc_z","gen z ",xyz_nbin, -25, 25 );
145  h2_simPtEta = bookH2withSumw2("h_mc_pteta","gen pt vs #eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,5.,pt_max );
146 
147  // all electrons
148  h1_ele_EoverP_all = bookH1withSumw2("h_ele_EoverP_all","ele E/P_{vertex}, all reco electrons",eop_nbin,0.,eop_max,"E/P_{vertex}");
149  h1_ele_EoverP_all_barrel = bookH1withSumw2("h_ele_EoverP_all_barrel","ele E/P_{vertex}, all reco electrons, barrel",eop_nbin,0.,eop_max);
150  h1_ele_EoverP_all_endcaps = bookH1withSumw2("h_ele_EoverP_all_endcaps","ele E/P_{vertex}, all reco electrons, endcaps",eop_nbin,0.,eop_max);
151  h1_ele_EseedOP_all = bookH1withSumw2("h_ele_EseedOP_all","ele E_{seed}/P_{vertex}, all reco electrons",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}");
152  h1_ele_EseedOP_all_barrel = bookH1withSumw2("h_ele_EseedOP_all_barrel","ele E_{seed}/P_{vertex}, all reco electrons, barrel",eop_nbin,0.,eop_max);
153  h1_ele_EseedOP_all_endcaps = bookH1withSumw2("h_ele_EseedOP_all_endcaps","ele E_{seed}/P_{vertex}, all reco electrons, endcaps",eop_nbin,0.,eop_max);
154  h1_ele_EoPout_all = bookH1withSumw2("h_ele_EoPout_all","ele E_{seed}/P_{out}, all reco electrons",eop_nbin,0.,eop_max,"E_{seed}/P_{out}");
155  h1_ele_EoPout_all_barrel = bookH1withSumw2("h_ele_EoPout_all_barrel","ele E_{seed}/P_{out}, all reco electrons barrel",eop_nbin,0.,eop_max);
156  h1_ele_EoPout_all_endcaps = bookH1withSumw2("h_ele_EoPout_all_endcaps","ele E_{seed}/P_{out}, all reco electrons endcaps",eop_nbin,0.,eop_max);
157  h1_ele_EeleOPout_all = bookH1withSumw2("h_ele_EeleOPout_all","ele E_{ele}/P_{out}, all reco electrons",eop_nbin,0.,eop_max,"E_{ele}/P_{out}");
158  h1_ele_EeleOPout_all_barrel = bookH1withSumw2("h_ele_EeleOPout_all_barrel","ele E_{ele}/P_{out}, all reco electrons barrel",eop_nbin,0.,eop_max);
159  h1_ele_EeleOPout_all_endcaps = bookH1withSumw2("h_ele_EeleOPout_all_endcaps","ele E_{ele}/P_{out}, all reco electrons endcaps",eop_nbin,0.,eop_max);
160  h1_ele_dEtaSc_propVtx_all = bookH1withSumw2("h_ele_dEtaSc_propVtx_all","ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}");
161  h1_ele_dEtaSc_propVtx_all_barrel = bookH1withSumw2("h_ele_dEtaSc_propVtx_all_barrel","ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons barrel",detamatch_nbin,detamatch_min,detamatch_max);
162  h1_ele_dEtaSc_propVtx_all_endcaps = bookH1withSumw2("h_ele_dEtaSc_propVtx_all_endcaps","ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons endcaps",detamatch_nbin,detamatch_min,detamatch_max);
163  h1_ele_dPhiSc_propVtx_all = bookH1withSumw2("h_ele_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)");
164  h1_ele_dPhiSc_propVtx_all_barrel = bookH1withSumw2("h_ele_dPhiSc_propVtx_all_barrel","ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons barrel",dphimatch_nbin,dphimatch_min,dphimatch_max);
165  h1_ele_dPhiSc_propVtx_all_endcaps = bookH1withSumw2("h_ele_dPhiSc_propVtx_all_endcaps","ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max);
166  h1_ele_dEtaCl_propOut_all = bookH1withSumw2("h_ele_dEtaCl_propOut_all","ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}");
167  h1_ele_dEtaCl_propOut_all_barrel = bookH1withSumw2("h_ele_dEtaCl_propOut_all_barrel","ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons barrel",detamatch_nbin,detamatch_min,detamatch_max);
168  h1_ele_dEtaCl_propOut_all_endcaps = bookH1withSumw2("h_ele_dEtaCl_propOut_all_endcaps","ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons endcaps",detamatch_nbin,detamatch_min,detamatch_max);
169  h1_ele_dPhiCl_propOut_all = bookH1withSumw2("h_ele_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)");
170  h1_ele_dPhiCl_propOut_all_barrel = bookH1withSumw2("h_ele_dPhiCl_propOut_all_barrel","ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons barrel",dphimatch_nbin,dphimatch_min,dphimatch_max);
171  h1_ele_dPhiCl_propOut_all_endcaps = bookH1withSumw2("h_ele_dPhiCl_propOut_all_endcaps","ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max);
172  h1_ele_HoE_all = bookH1withSumw2("h_ele_HoE_all","ele hadronic energy / em energy, all reco electrons",hoe_nbin, hoe_min, hoe_max,"H/E") ;
173  h1_ele_HoE_all_barrel = bookH1withSumw2("h_ele_HoE_all_barrel","ele hadronic energy / em energy, all reco electrons barrel",hoe_nbin, hoe_min, hoe_max) ;
174  h1_ele_HoE_all_endcaps = bookH1withSumw2("h_ele_HoE_all_endcaps","ele hadronic energy / em energy, all reco electrons endcaps",hoe_nbin, hoe_min, hoe_max) ;
175  h1_ele_vertexPt_all = bookH1withSumw2("h_ele_vertexPt_all","ele p_{T}, all reco electrons",pteff_nbin,5.,pt_max);
176  h1_ele_Et_all = bookH1withSumw2("h_ele_Et_all","ele SC E_{T}, all reco electrons",pteff_nbin,5.,pt_max,"E_{T} (GeV)");
177  h1_ele_vertexEta_all = bookH1withSumw2("h_ele_vertexEta_all","ele eta, all reco electrons",eta_nbin,eta_min,eta_max);
178  h1_ele_TIP_all = bookH1withSumw2("h_ele_TIP_all","ele vertex transverse radius, all reco electrons", 100,0.,0.2,"r_{T} (cm)");
179  h1_ele_TIP_all_barrel = bookH1withSumw2("h_ele_TIP_all_barrel","ele vertex transverse radius, all reco electrons barrel", 100,0.,0.2);
180  h1_ele_TIP_all_endcaps = bookH1withSumw2("h_ele_TIP_all_endcaps","ele vertex transverse radius, all reco electrons endcaps", 100,0.,0.2);
181  h1_ele_mee_all = bookH1withSumw2("h_ele_mee_all","ele pairs invariant mass, all reco electrons",mee_nbin, mee_min, mee_max,"m_{ee} (GeV/c^{2})" );
182  h1_ele_mee_os = bookH1withSumw2("h_ele_mee_os","ele pairs invariant mass, opp. sign",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})" );
183  h1_ele_mee_os_ebeb = bookH1withSumw2("h_ele_mee_os_ebeb","ele pairs invariant mass, opp. sign, EB-EB",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})" );
184  h1_ele_mee_os_ebee = bookH1withSumw2("h_ele_mee_os_ebee","ele pairs invariant mass, opp. sign, EB-EE",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})" );
185  h1_ele_mee_os_eeee = bookH1withSumw2("h_ele_mee_os_eeee","ele pairs invariant mass, opp. sign, EE-EE",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})" );
186  h1_ele_mee_os_gg = bookH1withSumw2("h_ele_mee_os_gg","ele pairs invariant mass, opp. sign, good-good",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})" );
187  h1_ele_mee_os_gb = bookH1withSumw2("h_ele_mee_os_gb","ele pairs invariant mass, opp. sign, good-bad",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})" );
188  h1_ele_mee_os_bb = bookH1withSumw2("h_ele_mee_os_bb","ele pairs invariant mass, opp. sign, bad-bad",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})" );
189 
190  // duplicates
191  h2_ele_E2mnE1vsMee_all = bookH2("h_ele_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)");
192  h2_ele_E2mnE1vsMee_egeg_all = bookH2("h_ele_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)");
193 
194  // charge ID
195  h1_ele_ChargeMnChargeTrue = bookH1withSumw2("h_ele_ChargeMnChargeTrue","ele charge - gen charge ",5,-1.,4.,"q_{rec} - q_{gen}");
196  h1_ele_simEta_matched_qmisid = bookH1withSumw2("h_ele_eta_matched_qmisid","charge misid vs gen eta",eta_nbin,eta_min,eta_max);
197  h1_ele_simAbsEta_matched_qmisid = bookH1withSumw2("h_ele_abseta_matched_qmisid","charge misid vs gen |eta|",eta_nbin/2,0.,eta_max);
198  h1_ele_simPt_matched_qmisid = bookH1withSumw2("h_ele_Pt_matched_qmisid","charge misid vs gen transverse momentum",pteff_nbin,5.,pt_max);
199  h1_ele_simPhi_matched_qmisid = bookH1withSumw2("h_ele_phi_matched_qmisid","charge misid vs gen phi",phi_nbin,phi_min,phi_max);
200  h1_ele_simZ_matched_qmisid = bookH1withSumw2("h_ele_z_matched_qmisid","charge misid vs gen z",xyz_nbin, -25, 25 );
201 
202  // matched electrons
203  h1_ele_charge = bookH1withSumw2("h_ele_charge","ele charge",5,-2.,2.,"charge");
204  h2_ele_chargeVsEta = bookH2("h_ele_chargeVsEta","ele charge vs eta",eta2D_nbin,eta_min,eta_max,5,-2.,2.);
205  h2_ele_chargeVsPhi = bookH2("h_ele_chargeVsPhi","ele charge vs phi",phi2D_nbin,phi_min,phi_max,5,-2.,2.);
206  h2_ele_chargeVsPt = bookH2("h_ele_chargeVsPt","ele charge vs pt",pt_nbin,0.,100.,5,-2.,2.);
207  h1_ele_vertexP = bookH1withSumw2("h_ele_vertexP","ele momentum",p_nbin,0.,p_max,"p_{vertex} (GeV/c)");
208  h1_ele_vertexPt = bookH1withSumw2("h_ele_vertexPt","ele transverse momentum",pt_nbin,0.,pt_max,"p_{T vertex} (GeV/c)");
209  h1_ele_Et = bookH1withSumw2("h_ele_Et","ele transverse energy",pt_nbin,0.,pt_max,"E_{T} (GeV)");
210  h2_ele_vertexPtVsEta = bookH2("h_ele_vertexPtVsEta","ele transverse momentum vs eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,0.,pt_max);
211  h2_ele_vertexPtVsPhi = bookH2("h_ele_vertexPtVsPhi","ele transverse momentum vs phi",phi2D_nbin,phi_min,phi_max,pt2D_nbin,0.,pt_max);
212  h1_ele_simPt_matched = bookH1("h_ele_simPt_matched","Efficiency vs gen transverse momentum",pteff_nbin,5.,pt_max);
213  h1_ele_vertexEta = bookH1withSumw2("h_ele_vertexEta","ele momentum eta",eta_nbin,eta_min,eta_max,"#eta");
214  h2_ele_vertexEtaVsPhi = bookH2("h_ele_vertexEtaVsPhi","ele momentum eta vs phi",eta2D_nbin,eta_min,eta_max,phi2D_nbin,phi_min,phi_max );
215  h1_ele_simAbsEta_matched = bookH1withSumw2("h_ele_simAbsEta_matched","Efficiency vs gen |eta|",eta_nbin/2,0.,2.5);
216  h1_ele_simEta_matched = bookH1withSumw2("h_ele_simEta_matched","Efficiency vs gen eta",eta_nbin,eta_min,eta_max);
217  h2_ele_simPtEta_matched = bookH2withSumw2("h_ele_simPtEta_matched","Efficiency vs pt #eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,5.,pt_max );
218  h1_ele_simPhi_matched = bookH1withSumw2("h_ele_simPhi_matched","Efficiency vs gen phi",phi_nbin,phi_min,phi_max);
219  h1_ele_vertexPhi = bookH1withSumw2("h_ele_vertexPhi","ele momentum #phi",phi_nbin,phi_min,phi_max,"#phi (rad)");
220  h1_ele_vertexX = bookH1withSumw2("h_ele_vertexX","ele vertex x",xyz_nbin,-0.6,0.6,"x (cm)" );
221  h1_ele_vertexY = bookH1withSumw2("h_ele_vertexY","ele vertex y",xyz_nbin,-0.6,0.6,"y (cm)" );
222  h1_ele_vertexZ = bookH1withSumw2("h_ele_vertexZ","ele vertex z",xyz_nbin,-25, 25,"z (cm)" );
223  h1_ele_simZ_matched = bookH1withSumw2("h_ele_simZ_matched","Efficiency vs gen vertex z",xyz_nbin,-25,25);
224  h1_ele_vertexTIP = bookH1withSumw2("h_ele_vertexTIP","ele transverse impact parameter (wrt gen vtx)",90,0.,0.15,"TIP (cm)");
225  h2_ele_vertexTIPVsEta = bookH2("h_ele_vertexTIPVsEta","ele transverse impact parameter (wrt gen vtx) vs eta",eta2D_nbin,eta_min,eta_max,45,0.,0.15,"#eta","TIP (cm)");
226  h2_ele_vertexTIPVsPhi = bookH2("h_ele_vertexTIPVsPhi","ele transverse impact parameter (wrt gen vtx) vs phi",phi2D_nbin,phi_min,phi_max,45,0.,0.15,"#phi (rad)","TIP (cm)");
227  h2_ele_vertexTIPVsPt = bookH2("h_ele_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)");
228  h1_ele_PoPtrue = bookH1withSumw2("h_ele_PoPtrue","ele momentum / gen momentum",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
229  h1_ele_PoPtrue_barrel = bookH1withSumw2("h_ele_PoPtrue_barrel","ele momentum / gen momentum, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
230  h1_ele_PoPtrue_endcaps = bookH1withSumw2("h_ele_PoPtrue_endcaps","ele momentum / gen momentum, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
231  h2_ele_PoPtrueVsEta = bookH2("h_ele_PoPtrueVsEta","ele momentum / gen momentum vs eta",eta2D_nbin,eta_min,eta_max,50,poptrue_min,poptrue_max);
232  h2_ele_PoPtrueVsPhi = bookH2("h_ele_PoPtrueVsPhi","ele momentum / gen momentum vs phi",phi2D_nbin,phi_min,phi_max,50,poptrue_min,poptrue_max);
233  h2_ele_PoPtrueVsPt = bookH2("h_ele_PoPtrueVsPt","ele momentum / gen momentum vs eta",pt2D_nbin,0.,pt_max,50,poptrue_min,poptrue_max);
234  h1_ele_PoPtrue_golden_barrel = bookH1withSumw2("h_ele_PoPtrue_golden_barrel","ele momentum / gen momentum, golden, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
235  h1_ele_PoPtrue_golden_endcaps = bookH1withSumw2("h_ele_PoPtrue_golden_endcaps","ele momentum / gen momentum, golden, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
236  h1_ele_PoPtrue_showering_barrel = bookH1withSumw2("h_ele_PoPtrue_showering_barrel","ele momentum / gen momentum, showering, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
237  h1_ele_PoPtrue_showering_endcaps = bookH1withSumw2("h_ele_PoPtrue_showering_endcaps","ele momentum / gen momentum, showering, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
238  h1_ele_PtoPttrue = bookH1withSumw2("h_ele_PtoPttrue","ele transverse momentum / gen transverse momentum",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
239  h1_ele_PtoPttrue_barrel = bookH1withSumw2("h_ele_PtoPttrue_barrel","ele transverse momentum / gen transverse momentum, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
240  h1_ele_PtoPttrue_endcaps = bookH1withSumw2("h_ele_PtoPttrue_endcaps","ele transverse momentum / gen transverse momentum, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
241  h1_ele_EtaMnEtaTrue = bookH1withSumw2("h_ele_EtaMnEtaTrue","ele momentum eta - gen eta",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
242  h1_ele_EtaMnEtaTrue_barrel = bookH1withSumw2("h_ele_EtaMnEtaTrue_barrel","ele momentum eta - gen eta barrel",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
243  h1_ele_EtaMnEtaTrue_endcaps = bookH1withSumw2("h_ele_EtaMnEtaTrue_endcaps","ele momentum eta - gen eta endcaps",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
244  h2_ele_EtaMnEtaTrueVsEta = bookH2("h_ele_EtaMnEtaTrueVsEta","ele momentum eta - gen eta vs eta",eta2D_nbin,eta_min,eta_max,deta_nbin/2,deta_min,deta_max);
245  h2_ele_EtaMnEtaTrueVsPhi = bookH2("h_ele_EtaMnEtaTrueVsPhi","ele momentum eta - gen eta vs phi",phi2D_nbin,phi_min,phi_max,deta_nbin/2,deta_min,deta_max);
246  h2_ele_EtaMnEtaTrueVsPt = bookH2("h_ele_EtaMnEtaTrueVsPt","ele momentum eta - gen eta vs pt",pt_nbin,0.,pt_max,deta_nbin/2,deta_min,deta_max);
247  h1_ele_PhiMnPhiTrue = bookH1withSumw2("h_ele_PhiMnPhiTrue","ele momentum phi - gen phi",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
248  h1_ele_PhiMnPhiTrue_barrel = bookH1withSumw2("h_ele_PhiMnPhiTrue_barrel","ele momentum phi - gen phi barrel",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
249  h1_ele_PhiMnPhiTrue_endcaps = bookH1withSumw2("h_ele_PhiMnPhiTrue_endcaps","ele momentum phi - gen phi endcaps",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
250  h1_ele_PhiMnPhiTrue2 = bookH1("h_ele_PhiMnPhiTrue2","ele momentum phi - gen phi",dphimatch2D_nbin,dphimatch_min,dphimatch_max);
251  h2_ele_PhiMnPhiTrueVsEta = bookH2("h_ele_PhiMnPhiTrueVsEta","ele momentum phi - gen phi vs eta",eta2D_nbin,eta_min,eta_max,dphi_nbin/2,dphi_min,dphi_max);
252  h2_ele_PhiMnPhiTrueVsPhi = bookH2("h_ele_PhiMnPhiTrueVsPhi","ele momentum phi - gen phi vs phi",phi2D_nbin,phi_min,phi_max,dphi_nbin/2,dphi_min,dphi_max);
253  h2_ele_PhiMnPhiTrueVsPt = bookH2("h_ele_PhiMnPhiTrueVsPt","ele momentum phi - gen phi vs pt",pt2D_nbin,0.,pt_max,dphi_nbin/2,dphi_min,dphi_max);
254 
255  // matched electron, superclusters
256  h1_scl_En_ = bookH1withSumw2("h_scl_energy","ele supercluster energy",p_nbin,0.,p_max);
257  h1_scl_EoEtrue_barrel = bookH1withSumw2("h_scl_EoEtrue_barrel","ele supercluster energy / gen energy, barrel",50,0.2,1.2,"E/E_{gen}");
258  h1_scl_EoEtrue_barrel_eg = bookH1withSumw2("h_scl_EoEtrue_barrel_eg","ele supercluster energy / gen energy, barrel, ecal driven",50,0.2,1.2,"E/E_{gen}");
259  h1_scl_EoEtrue_barrel_etagap = bookH1withSumw2("h_scl_EoEtrue_barrel_etagap","ele supercluster energy / gen energy, barrel, etagap",50,0.2,1.2,"E/E_{gen}");
260  h1_scl_EoEtrue_barrel_phigap = bookH1withSumw2("h_scl_EoEtrue_barrel_phigap","ele supercluster energy / gen energy, barrel, phigap",50,0.2,1.2,"E/E_{gen}");
261  h1_scl_EoEtrue_ebeegap = bookH1withSumw2("h_scl_EoEtrue_ebeegap","ele supercluster energy / gen energy, ebeegap",50,0.2,1.2,"E/E_{gen}");
262  h1_scl_EoEtrue_endcaps = bookH1withSumw2("h_scl_EoEtrue_endcaps","ele supercluster energy / gen energy, endcaps",50,0.2,1.2,"E/E_{gen}");
263  h1_scl_EoEtrue_endcaps_eg = bookH1withSumw2("h_scl_EoEtrue_endcaps_eg","ele supercluster energy / gen energy, endcaps, ecal driven",50,0.2,1.2,"E/E_{gen}");
264  h1_scl_EoEtrue_endcaps_deegap = bookH1withSumw2("h_scl_EoEtrue_endcaps_deegap","ele supercluster energy / gen energy, endcaps, deegap",50,0.2,1.2,"E/E_{gen}");
265  h1_scl_EoEtrue_endcaps_ringgap = bookH1withSumw2("h_scl_EoEtrue_endcaps_ringgap","ele supercluster energy / gen energy, endcaps, ringgap",50,0.2,1.2,"E/E_{gen}");
266  h1_scl_EoEtrue_barrel_new = bookH1withSumw2("h_scl_EoEtrue_barrel_new","ele supercluster energy / gen energy, barrel",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
267  h1_scl_EoEtrue_barrel_new_eg = bookH1withSumw2("h_scl_EoEtrue_barrel_new_eg","ele supercluster energy / gen energy, barrel, ecal driven",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
268  h1_scl_EoEtrue_barrel_new_etagap = bookH1withSumw2("h_scl_EoEtrue_barrel_new_etagap","ele supercluster energy / gen energy, barrel, etagap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
269  h1_scl_EoEtrue_barrel_new_phigap = bookH1withSumw2("h_scl_EoEtrue_barrel_new_phigap","ele supercluster energy / gen energy, barrel, phigap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
270  h1_scl_EoEtrue_ebeegap_new = bookH1withSumw2("h_scl_EoEtrue_ebeegap_new","ele supercluster energy / gen energy, ebeegap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
271  h1_scl_EoEtrue_endcaps_new = bookH1withSumw2("h_scl_EoEtrue_endcaps_new","ele supercluster energy / gen energy, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
272  h1_scl_EoEtrue_endcaps_new_eg = bookH1withSumw2("h_scl_EoEtrue_endcaps_new_eg","ele supercluster energy / gen energy, endcaps, ecal driven",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
273  h1_scl_EoEtrue_endcaps_new_deegap = bookH1withSumw2("h_scl_EoEtrue_endcaps_new_deegap","ele supercluster energy / gen energy, endcaps, deegap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
274  h1_scl_EoEtrue_endcaps_new_ringgap = bookH1withSumw2("h_scl_EoEtrue_endcaps_new_ringgap","ele supercluster energy / gen energy, endcaps, ringgap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
275  h1_scl_Et_ = bookH1withSumw2("h_scl_et","ele supercluster transverse energy",pt_nbin,0.,pt_max);
276  h2_scl_EtVsEta_ = bookH2("h_scl_etVsEta","ele supercluster transverse energy vs eta",eta2D_nbin,eta_min,eta_max,pt_nbin,0.,pt_max);
277  h2_scl_EtVsPhi_ = bookH2("h_scl_etVsPhi","ele supercluster transverse energy vs phi",phi2D_nbin,phi_min,phi_max,pt_nbin,0.,pt_max);
278  h2_scl_EtaVsPhi_ = bookH2("h_scl_etaVsPhi","ele supercluster eta vs phi",phi2D_nbin,phi_min,phi_max,eta2D_nbin,eta_min,eta_max);
279  h1_scl_Eta_ = bookH1withSumw2("h_scl_eta","ele supercluster eta",eta_nbin,eta_min,eta_max);
280  h1_scl_Phi_ = bookH1withSumw2("h_scl_phi","ele supercluster phi",phi_nbin,phi_min,phi_max);
281  h1_scl_SigEtaEta_ = bookH1withSumw2("h_scl_sigetaeta","ele supercluster sigma eta eta",100,0.,0.05,"#sigma_{#eta #eta}");
282  h1_scl_SigEtaEta_barrel_ = bookH1withSumw2("h_scl_sigetaeta_barrel","ele supercluster sigma eta eta barrel",100,0.,0.05,"#sigma_{#eta #eta}");
283  h1_scl_SigEtaEta_endcaps_ = bookH1withSumw2("h_scl_sigetaeta_endcaps","ele supercluster sigma eta eta endcaps",100,0.,0.05,"#sigma_{#eta #eta}");
284  h1_scl_SigIEtaIEta_ = bookH1withSumw2("h_scl_sigietaieta","ele supercluster sigma ieta ieta",100,0.,0.05,"#sigma_{i#eta i#eta}");
285  h1_scl_SigIEtaIEta_barrel_ = bookH1withSumw2("h_scl_sigietaieta_barrel","ele supercluster sigma ieta ieta, barrel",100,0.,0.05,"#sigma_{i#eta i#eta}");
286  h1_scl_SigIEtaIEta_endcaps_ = bookH1withSumw2("h_scl_sigietaieta_endcaps","ele supercluster sigma ieta ieta, endcaps",100,0.,0.05,"#sigma_{i#eta i#eta}");
287  h1_scl_E1x5_ = bookH1withSumw2("h_scl_E1x5","ele supercluster energy in 1x5",p_nbin,0., p_max,"E1x5 (GeV)");
288  h1_scl_E1x5_barrel_ = bookH1withSumw2("h_scl_E1x5_barrel","ele supercluster energy in 1x5 barrel",p_nbin,0., p_max,"E1x5 (GeV)");
289  h1_scl_E1x5_endcaps_ = bookH1withSumw2("h_scl_E1x5_endcaps","ele supercluster energy in 1x5 endcaps",p_nbin,0., p_max,"E1x5 (GeV)");
290  h1_scl_E2x5max_ = bookH1withSumw2("h_scl_E2x5max","ele supercluster energy in 2x5 max",p_nbin,0.,p_max,"E2x5 (GeV)");
291  h1_scl_E2x5max_barrel_ = bookH1withSumw2("h_scl_E2x5max_barrel","ele supercluster energy in 2x5 _max barrel",p_nbin,0.,p_max,"E2x5 (GeV)");
292  h1_scl_E2x5max_endcaps_ = bookH1withSumw2("h_scl_E2x5max_endcaps","ele supercluster energy in 2x5 _max endcaps",p_nbin,0.,p_max,"E2x5 (GeV)");
293  h1_scl_E5x5_ = bookH1withSumw2("h_scl_E5x5","ele supercluster energy in 5x5",p_nbin,0.,p_max,"E5x5 (GeV)");
294  h1_scl_E5x5_barrel_ = bookH1withSumw2("h_scl_E5x5_barrel","ele supercluster energy in 5x5 barrel",p_nbin,0.,p_max,"E5x5 (GeV)");
295  h1_scl_E5x5_endcaps_ = bookH1withSumw2("h_scl_E5x5_endcaps","ele supercluster energy in 5x5 endcaps",p_nbin,0.,p_max,"E5x5 (GeV)");
296  h1_scl_SigEtaEta_eg_ = bookH1withSumw2("h_scl_sigetaeta_eg","ele supercluster sigma eta eta, ecal driven",100,0.,0.05);
297  h1_scl_SigEtaEta_eg_barrel_ = bookH1withSumw2("h_scl_sigetaeta_eg_barrel","ele supercluster sigma eta eta, ecal driven barrel",100,0.,0.05);
298  h1_scl_SigEtaEta_eg_endcaps_ = bookH1withSumw2("h_scl_sigetaeta_eg_endcaps","ele supercluster sigma eta eta, ecal driven endcaps",100,0.,0.05);
299  h1_scl_SigIEtaIEta_eg_ = bookH1withSumw2("h_scl_sigietaieta_eg","ele supercluster sigma ieta ieta, ecal driven",100,0.,0.05);
300  h1_scl_SigIEtaIEta_eg_barrel_ = bookH1withSumw2("h_scl_sigietaieta_barrel_eg","ele supercluster sigma ieta ieta, barrel, ecal driven",100,0.,0.05);
301  h1_scl_SigIEtaIEta_eg_endcaps_ = bookH1withSumw2("h_scl_sigietaieta_endcaps_eg","ele supercluster sigma ieta ieta, endcaps, ecal driven",100,0.,0.05);
302  h1_scl_E1x5_eg_ = bookH1withSumw2("h_scl_E1x5_eg","ele supercluster energy in 1x5, ecal driven",p_nbin,0., p_max);
303  h1_scl_E1x5_eg_barrel_ = bookH1withSumw2("h_scl_E1x5_eg_barrel","ele supercluster energy in 1x5, ecal driven barrel",p_nbin,0., p_max);
304  h1_scl_E1x5_eg_endcaps_ = bookH1withSumw2("h_scl_E1x5_eg_endcaps","ele supercluster energy in 1x5, ecal driven endcaps",p_nbin,0., p_max);
305  h1_scl_E2x5max_eg_ = bookH1withSumw2("h_scl_E2x5max_eg","ele supercluster energy in 2x5 _max, ecal driven",p_nbin,0.,p_max);
306  h1_scl_E2x5max_eg_barrel_ = bookH1withSumw2("h_scl_E2x5max_eg_barrel","ele supercluster energy in 2x5 _max, ecal driven barrel",p_nbin,0.,p_max);
307  h1_scl_E2x5max_eg_endcaps_ = bookH1withSumw2("h_scl_E2x5max_eg_endcaps","ele supercluster energy in 2x5 _max, ecal driven endcaps",p_nbin,0.,p_max);
308  h1_scl_E5x5_eg_ = bookH1withSumw2("h_scl_E5x5_eg","ele supercluster energy in 5x5, ecal driven",p_nbin,0.,p_max);
309  h1_scl_E5x5_eg_barrel_ = bookH1withSumw2("h_scl_E5x5_eg_barrel","ele supercluster energy in 5x5, ecal driven barrel",p_nbin,0.,p_max);
310  h1_scl_E5x5_eg_endcaps_ = bookH1withSumw2("h_scl_E5x5_eg_endcaps","ele supercluster energy in 5x5, ecal driven endcaps",p_nbin,0.,p_max);
311  h2_scl_EoEtruePfVsEg = bookH2("h_scl_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)") ;
312 
313  // matched electron, gsf tracks
314  h1_ele_ambiguousTracks = bookH1withSumw2("h_ele_ambiguousTracks","ele # ambiguous tracks", 5,0.,5.,"N_{ambiguous tracks}");
315  h2_ele_ambiguousTracksVsEta = bookH2("h_ele_ambiguousTracksVsEta","ele # ambiguous tracks vs eta",eta2D_nbin,eta_min,eta_max,5,0.,5.);
316  h2_ele_ambiguousTracksVsPhi = bookH2("h_ele_ambiguousTracksVsPhi","ele # ambiguous tracks vs phi",phi2D_nbin,phi_min,phi_max,5,0.,5.);
317  h2_ele_ambiguousTracksVsPt = bookH2("h_ele_ambiguousTracksVsPt","ele # ambiguous tracks vs pt",pt2D_nbin,0.,pt_max,5,0.,5.);
318  h1_ele_foundHits = bookH1withSumw2("h_ele_foundHits","ele track # found hits",fhits_nbin,0.,fhits_max,"N_{hits}");
319  h1_ele_foundHits_barrel = bookH1withSumw2("h_ele_foundHits_barrel","ele track # found hits, barrel",fhits_nbin,0.,fhits_max,"N_{hits}");
320  h1_ele_foundHits_endcaps = bookH1withSumw2("h_ele_foundHits_endcaps","ele track # found hits, endcaps",fhits_nbin,0.,fhits_max,"N_{hits}");
321  h2_ele_foundHitsVsEta = bookH2("h_ele_foundHitsVsEta","ele track # found hits vs eta",eta2D_nbin,eta_min,eta_max,fhits_nbin,0.,fhits_max);
322  h2_ele_foundHitsVsPhi = bookH2("h_ele_foundHitsVsPhi","ele track # found hits vs phi",phi2D_nbin,phi_min,phi_max,fhits_nbin,0.,fhits_max);
323  h2_ele_foundHitsVsPt = bookH2("h_ele_foundHitsVsPt","ele track # found hits vs pt",pt2D_nbin,0.,pt_max,fhits_nbin,0.,fhits_max);
324  h1_ele_lostHits = bookH1withSumw2("h_ele_lostHits","ele track # lost hits", 5,0.,5.,"N_{lost hits}");
325  h1_ele_lostHits_barrel = bookH1withSumw2("h_ele_lostHits_barrel","ele track # lost hits, barrel", 5,0.,5.,"N_{lost hits}");
326  h1_ele_lostHits_endcaps = bookH1withSumw2("h_ele_lostHits_endcaps","ele track # lost hits, endcaps", 5,0.,5.,"N_{lost hits}");
327  h2_ele_lostHitsVsEta = bookH2("h_ele_lostHitsVsEta","ele track # lost hits vs eta",eta2D_nbin,eta_min,eta_max,lhits_nbin,0.,lhits_max);
328  h2_ele_lostHitsVsPhi = bookH2("h_ele_lostHitsVsPhi","ele track # lost hits vs eta",phi2D_nbin,phi_min,phi_max,lhits_nbin,0.,lhits_max);
329  h2_ele_lostHitsVsPt = bookH2("h_ele_lostHitsVsPt","ele track # lost hits vs eta",pt2D_nbin,0.,pt_max,lhits_nbin,0.,lhits_max);
330  h1_ele_chi2 = bookH1withSumw2("h_ele_chi2","ele track #chi^{2}",100,0.,15.,"#Chi^{2}");
331  h1_ele_chi2_barrel = bookH1withSumw2("h_ele_chi2_barrel","ele track #chi^{2}, barrel",100,0.,15.,"#Chi^{2}");
332  h1_ele_chi2_endcaps = bookH1withSumw2("h_ele_chi2_endcaps","ele track #chi^{2}, endcaps",100,0.,15.,"#Chi^{2}");
333  h2_ele_chi2VsEta = bookH2("h_ele_chi2VsEta","ele track #chi^{2} vs eta",eta2D_nbin,eta_min,eta_max,50,0.,15.);
334  h2_ele_chi2VsPhi = bookH2("h_ele_chi2VsPhi","ele track #chi^{2} vs phi",phi2D_nbin,phi_min,phi_max,50,0.,15.);
335  h2_ele_chi2VsPt = bookH2("h_ele_chi2VsPt","ele track #chi^{2} vs pt",pt2D_nbin,0.,pt_max,50,0.,15.);
336  h1_ele_PinMnPout = bookH1withSumw2("h_ele_PinMnPout","ele track inner p - outer p, mean of GSF components" ,p_nbin,0.,200.,"P_{vertex} - P_{out} (GeV/c)");
337  h1_ele_PinMnPout_mode = bookH1withSumw2("h_ele_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)");
338  h2_ele_PinMnPoutVsEta_mode = bookH2("h_ele_PinMnPoutVsEta_mode","ele track inner p - outer p vs eta, mode of GSF components" ,eta2D_nbin, eta_min,eta_max,p2D_nbin,0.,100.);
339  h2_ele_PinMnPoutVsPhi_mode = bookH2("h_ele_PinMnPoutVsPhi_mode","ele track inner p - outer p vs phi, mode of GSF components" ,phi2D_nbin, phi_min,phi_max,p2D_nbin,0.,100.);
340  h2_ele_PinMnPoutVsPt_mode = bookH2("h_ele_PinMnPoutVsPt_mode","ele track inner p - outer p vs pt, mode of GSF components" ,pt2D_nbin, 0.,pt_max,p2D_nbin,0.,100.);
341  h2_ele_PinMnPoutVsE_mode = bookH2("h_ele_PinMnPoutVsE_mode","ele track inner p - outer p vs E, mode of GSF components" ,p2D_nbin, 0.,200.,p2D_nbin,0.,100.);
342  h2_ele_PinMnPoutVsChi2_mode = bookH2("h_ele_PinMnPoutVsChi2_mode","ele track inner p - outer p vs track chi2, mode of GSF components" ,50, 0.,20.,p2D_nbin,0.,100.);
343  h1_ele_outerP = bookH1withSumw2("h_ele_outerP","ele track outer p, mean of GSF components",p_nbin,0.,p_max,"P_{out} (GeV/c)");
344  h1_ele_outerP_mode = bookH1withSumw2("h_ele_outerP_mode","ele track outer p, mode of GSF components",p_nbin,0.,p_max,"P_{out} (GeV/c)");
345  h2_ele_outerPVsEta_mode = bookH2("h_ele_outerPVsEta_mode","ele track outer p vs eta mode",eta2D_nbin,eta_min,eta_max,50,0.,p_max);
346  h1_ele_outerPt = bookH1withSumw2("h_ele_outerPt","ele track outer p_{T}, mean of GSF components",pt_nbin,0.,pt_max,"P_{T out} (GeV/c)");
347  h1_ele_outerPt_mode = bookH1withSumw2("h_ele_outerPt_mode","ele track outer p_{T}, mode of GSF components",pt_nbin,0.,pt_max,"P_{T out} (GeV/c)");
348  h2_ele_outerPtVsEta_mode = bookH2("h_ele_outerPtVsEta_mode","ele track outer p_{T} vs eta, mode of GSF components",eta2D_nbin,eta_min,eta_max,pt2D_nbin,0.,pt_max);
349  h2_ele_outerPtVsPhi_mode = bookH2("h_ele_outerPtVsPhi_mode","ele track outer p_{T} vs phi, mode of GSF components",phi2D_nbin,phi_min,phi_max,pt2D_nbin,0.,pt_max);
350  h2_ele_outerPtVsPt_mode = bookH2("h_ele_outerPtVsPt_mode","ele track outer p_{T} vs pt, mode of GSF components",pt2D_nbin,0.,100.,pt2D_nbin,0.,pt_max);
351 
352  // matched electrons, matching
353  h1_ele_EoP = bookH1withSumw2("h_ele_EoP","ele E/P_{vertex}",eop_nbin,0.,eop_max,"E/P_{vertex}");
354  h1_ele_EoP_eg = bookH1withSumw2("h_ele_EoP_eg","ele E/P_{vertex}, ecal driven",eop_nbin,0.,eop_max);
355  h1_ele_EoP_barrel = bookH1withSumw2("h_ele_EoP_barrel","ele E/P_{vertex} barrel",eop_nbin,0.,eop_max,"E/P_{vertex}");
356  h1_ele_EoP_eg_barrel = bookH1withSumw2("h_ele_EoP_eg_barrel","ele E/P_{vertex}, ecal driven barrel",eop_nbin,0.,eop_max);
357  h1_ele_EoP_endcaps = bookH1withSumw2("h_ele_EoP_endcaps","ele E/P_{vertex} endcaps",eop_nbin,0.,eop_max,"E/P_{vertex}");
358  h1_ele_EoP_eg_endcaps = bookH1withSumw2("h_ele_EoP_eg_endcaps","ele E/P_{vertex}, ecal driven endcaps",eop_nbin,0.,eop_max);
359  h2_ele_EoPVsEta = bookH2("h_ele_EoPVsEta","ele E/P_{vertex} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
360  h2_ele_EoPVsPhi = bookH2("h_ele_EoPVsPhi","ele E/P_{vertex} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
361  h2_ele_EoPVsE = bookH2("h_ele_EoPVsE","ele E/P_{vertex} vs E", 50,0.,p_max ,50,0.,5.);
362  h1_ele_EseedOP = bookH1withSumw2("h_ele_EseedOP","ele E_{seed}/P_{vertex}",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}");
363  h1_ele_EseedOP_eg = bookH1withSumw2("h_ele_EseedOP_eg","ele E_{seed}/P_{vertex}, ecal driven",eop_nbin,0.,eop_max);
364  h1_ele_EseedOP_barrel = bookH1withSumw2("h_ele_EseedOP_barrel","ele E_{seed}/P_{vertex} barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}");
365  h1_ele_EseedOP_eg_barrel = bookH1withSumw2("h_ele_EseedOP_eg_barrel","ele E_{seed}/P_{vertex}, ecal driven barrel",eop_nbin,0.,eop_max);
366  h1_ele_EseedOP_endcaps = bookH1withSumw2("h_ele_EseedOP_endcaps","ele E_{seed}/P_{vertex} endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}");
367  h1_ele_EseedOP_eg_endcaps = bookH1withSumw2("h_ele_EseedOP_eg_endcaps","ele E_{seed}/P_{vertex}, ecal driven, endcaps",eop_nbin,0.,eop_max);
368  h2_ele_EseedOPVsEta = bookH2("h_ele_EseedOPVsEta","ele E_{seed}/P_{vertex} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
369  h2_ele_EseedOPVsPhi = bookH2("h_ele_EseedOPVsPhi","ele E_{seed}/P_{vertex} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
370  h2_ele_EseedOPVsE = bookH2("h_ele_EseedOPVsE","ele E_{seed}/P_{vertex} vs E", 50,0.,p_max ,50,0.,5.);
371  h1_ele_EoPout = bookH1withSumw2("h_ele_EoPout","ele E_{seed}/P_{out}",eop_nbin,0.,eop_max,"E_{seed}/P_{out}");
372  h1_ele_EoPout_eg = bookH1withSumw2("h_ele_EoPout_eg","ele E_{seed}/P_{out}, ecal driven",eop_nbin,0.,eop_max);
373  h1_ele_EoPout_barrel = bookH1withSumw2("h_ele_EoPout_barrel","ele E_{seed}/P_{out} barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{out}");
374  h1_ele_EoPout_eg_barrel = bookH1withSumw2("h_ele_EoPout_eg_barrel","ele E_{seed}/P_{out}, ecal driven, barrel",eop_nbin,0.,eop_max);
375  h1_ele_EoPout_endcaps = bookH1withSumw2("h_ele_EoPout_endcaps","ele E_{seed}/P_{out} endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{out}");
376  h1_ele_EoPout_eg_endcaps = bookH1withSumw2("h_ele_EoPout_eg_endcaps","ele E_{seed}/P_{out}, ecal driven, endcaps",eop_nbin,0.,eop_max);
377  h2_ele_EoPoutVsEta = bookH2("h_ele_EoPoutVsEta","ele E_{seed}/P_{out} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
378  h2_ele_EoPoutVsPhi = bookH2("h_ele_EoPoutVsPhi","ele E_{seed}/P_{out} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
379  h2_ele_EoPoutVsE = bookH2("h_ele_EoPoutVsE","ele E_{seed}/P_{out} vs E",p2D_nbin,0.,p_max,eop2D_nbin,0.,eopmaxsht);
380  h1_ele_EeleOPout = bookH1withSumw2("h_ele_EeleOPout","ele E_{ele}/P_{out}",eop_nbin,0.,eop_max,"E_{ele}/P_{out}");
381  h1_ele_EeleOPout_eg = bookH1withSumw2("h_ele_EeleOPout_eg","ele E_{ele}/P_{out}, ecal driven",eop_nbin,0.,eop_max);
382  h1_ele_EeleOPout_barrel = bookH1withSumw2("h_ele_EeleOPout_barrel","ele E_{ele}/P_{out} barrel",eop_nbin,0.,eop_max,"E_{ele}/P_{out}");
383  h1_ele_EeleOPout_eg_barrel = bookH1withSumw2("h_ele_EeleOPout_eg_barrel","ele E_{ele}/P_{out}, ecal driven, barrel",eop_nbin,0.,eop_max);
384  h1_ele_EeleOPout_endcaps = bookH1withSumw2("h_ele_EeleOPout_endcaps","ele E_{ele}/P_{out} endcaps",eop_nbin,0.,eop_max,"E_{ele}/P_{out}");
385  h1_ele_EeleOPout_eg_endcaps = bookH1withSumw2("h_ele_EeleOPout_eg_endcaps","ele E_{ele}/P_{out}, ecal driven, endcaps",eop_nbin,0.,eop_max);
386  h2_ele_EeleOPoutVsEta = bookH2("h_ele_EeleOPoutVsEta","ele E_{ele}/P_{out} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
387  h2_ele_EeleOPoutVsPhi = bookH2("h_ele_EeleOPoutVsPhi","ele E_{ele}/P_{out} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
388  h2_ele_EeleOPoutVsE = bookH2("h_ele_EeleOPoutVsE","ele E_{ele}/P_{out} vs E",p2D_nbin,0.,p_max,eop2D_nbin,0.,eopmaxsht);
389  h1_ele_dEtaSc_propVtx = bookH1withSumw2("h_ele_dEtaSc_propVtx","ele #eta_{sc} - #eta_{tr}, prop from vertex",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}");
390  h1_ele_dEtaSc_propVtx_eg = bookH1withSumw2("h_ele_dEtaSc_propVtx_eg","ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven",detamatch_nbin,detamatch_min,detamatch_max);
391  h1_ele_dEtaSc_propVtx_barrel = bookH1withSumw2("h_ele_dEtaSc_propVtx_barrel","ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}");
392  h1_ele_dEtaSc_propVtx_eg_barrel = bookH1withSumw2("h_ele_dEtaSc_propVtx_eg_barrel","ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, barrel",detamatch_nbin,detamatch_min,detamatch_max);
393  h1_ele_dEtaSc_propVtx_endcaps = bookH1withSumw2("h_ele_dEtaSc_propVtx_endcaps","ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}");
394  h1_ele_dEtaSc_propVtx_eg_endcaps = bookH1withSumw2("h_ele_dEtaSc_propVtx_eg_endcaps","ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, endcaps",detamatch_nbin,detamatch_min,detamatch_max);
395  h2_ele_dEtaScVsEta_propVtx = bookH2("h_ele_dEtaScVsEta_propVtx","ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
396  h2_ele_dEtaScVsPhi_propVtx = bookH2("h_ele_dEtaScVsPhi_propVtx","ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
397  h2_ele_dEtaScVsPt_propVtx = bookH2("h_ele_dEtaScVsPt_propVtx","ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
398  h1_ele_dPhiSc_propVtx = bookH1withSumw2("h_ele_dPhiSc_propVtx","ele #phi_{sc} - #phi_{tr}, prop from vertex",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)");
399  h1_ele_dPhiSc_propVtx_eg = bookH1withSumw2("h_ele_dPhiSc_propVtx_eg","ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven",dphimatch_nbin,dphimatch_min,dphimatch_max);
400  h1_ele_dPhiSc_propVtx_barrel = bookH1withSumw2("h_ele_dPhiSc_propVtx_barrel","ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)");
401  h1_ele_dPhiSc_propVtx_eg_barrel = bookH1withSumw2("h_ele_dPhiSc_propVtx_eg_barrel","ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max);
402  h1_ele_dPhiSc_propVtx_endcaps = bookH1withSumw2("h_ele_dPhiSc_propVtx_endcaps","ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)");
403  h1_ele_dPhiSc_propVtx_eg_endcaps = bookH1withSumw2("h_ele_dPhiSc_propVtx_eg_endcaps","ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max);
404  h2_ele_dPhiScVsEta_propVtx = bookH2("h_ele_dPhiScVsEta_propVtx","ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
405  h2_ele_dPhiScVsPhi_propVtx = bookH2("h_ele_dPhiScVsPhi_propVtx","ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
406  h2_ele_dPhiScVsPt_propVtx = bookH2("h_ele_dPhiScVsPt_propVtx","ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
407  h1_ele_dEtaCl_propOut = bookH1withSumw2("h_ele_dEtaCl_propOut","ele #eta_{cl} - #eta_{tr}, prop from outermost",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}");
408  h1_ele_dEtaCl_propOut_eg = bookH1withSumw2("h_ele_dEtaCl_propOut_eg","ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven",detamatch_nbin,detamatch_min,detamatch_max);
409  h1_ele_dEtaCl_propOut_barrel = bookH1withSumw2("h_ele_dEtaCl_propOut_barrel","ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}");
410  h1_ele_dEtaCl_propOut_eg_barrel = bookH1withSumw2("h_ele_dEtaCl_propOut_eg_barrel","ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, barrel",detamatch_nbin,detamatch_min,detamatch_max);
411  h1_ele_dEtaCl_propOut_endcaps = bookH1withSumw2("h_ele_dEtaCl_propOut_endcaps","ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}");
412  h1_ele_dEtaCl_propOut_eg_endcaps = bookH1withSumw2("h_ele_dEtaCl_propOut_eg_endcaps","ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",detamatch_nbin,detamatch_min,detamatch_max);
413  h2_ele_dEtaClVsEta_propOut = bookH2("h_ele_dEtaClVsEta_propOut","ele #eta_{cl} - #eta_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
414  h2_ele_dEtaClVsPhi_propOut = bookH2("h_ele_dEtaClVsPhi_propOut","ele #eta_{cl} - #eta_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
415  h2_ele_dEtaClVsPt_propOut = bookH2("h_ele_dEtaScVsPt_propOut","ele #eta_{cl} - #eta_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
416  h1_ele_dPhiCl_propOut = bookH1withSumw2("h_ele_dPhiCl_propOut","ele #phi_{cl} - #phi_{tr}, prop from outermost",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)");
417  h1_ele_dPhiCl_propOut_eg = bookH1withSumw2("h_ele_dPhiCl_propOut_eg","ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven",dphimatch_nbin,dphimatch_min,dphimatch_max);
418  h1_ele_dPhiCl_propOut_barrel = bookH1withSumw2("h_ele_dPhiCl_propOut_barrel","ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)");
419  h1_ele_dPhiCl_propOut_eg_barrel = bookH1withSumw2("h_ele_dPhiCl_propOut_eg_barrel","ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max);
420  h1_ele_dPhiCl_propOut_endcaps = bookH1withSumw2("h_ele_dPhiCl_propOut_endcaps","ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)");
421  h1_ele_dPhiCl_propOut_eg_endcaps = bookH1withSumw2("h_ele_dPhiCl_propOut_eg_endcaps","ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max);
422  h2_ele_dPhiClVsEta_propOut = bookH2("h_ele_dPhiClVsEta_propOut","ele #phi_{cl} - #phi_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
423  h2_ele_dPhiClVsPhi_propOut = bookH2("h_ele_dPhiClVsPhi_propOut","ele #phi_{cl} - #phi_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
424  h2_ele_dPhiClVsPt_propOut = bookH2("h_ele_dPhiSClsPt_propOut","ele #phi_{cl} - #phi_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
425  h1_ele_dEtaEleCl_propOut = bookH1withSumw2("h_ele_dEtaEleCl_propOut","ele #eta_{EleCl} - #eta_{tr}, prop from outermost",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}");
426  h1_ele_dEtaEleCl_propOut_eg = bookH1withSumw2("h_ele_dEtaEleCl_propOut_eg","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven",detamatch_nbin,detamatch_min,detamatch_max);
427  h1_ele_dEtaEleCl_propOut_barrel = bookH1withSumw2("h_ele_dEtaEleCl_propOut_barrel","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}");
428  h1_ele_dEtaEleCl_propOut_eg_barrel = bookH1withSumw2("h_ele_dEtaEleCl_propOut_eg_barrel","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, barrel",detamatch_nbin,detamatch_min,detamatch_max);
429  h1_ele_dEtaEleCl_propOut_endcaps = bookH1withSumw2("h_ele_dEtaEleCl_propOut_endcaps","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}");
430  h1_ele_dEtaEleCl_propOut_eg_endcaps = bookH1withSumw2("h_ele_dEtaEleCl_propOut_eg_endcaps","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",detamatch_nbin,detamatch_min,detamatch_max);
431  h2_ele_dEtaEleClVsEta_propOut = bookH2("h_ele_dEtaEleClVsEta_propOut","ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
432  h2_ele_dEtaEleClVsPhi_propOut = bookH2("h_ele_dEtaEleClVsPhi_propOut","ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
433  h2_ele_dEtaEleClVsPt_propOut = bookH2("h_ele_dEtaScVsPt_propOut","ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
434  h1_ele_dPhiEleCl_propOut = bookH1withSumw2("h_ele_dPhiEleCl_propOut","ele #phi_{EleCl} - #phi_{tr}, prop from outermost",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)");
435  h1_ele_dPhiEleCl_propOut_eg = bookH1withSumw2("h_ele_dPhiEleCl_propOut_eg","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven",dphimatch_nbin,dphimatch_min,dphimatch_max);
436  h1_ele_dPhiEleCl_propOut_barrel = bookH1withSumw2("h_ele_dPhiEleCl_propOut_barrel","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)");
437  h1_ele_dPhiEleCl_propOut_eg_barrel = bookH1withSumw2("h_ele_dPhiEleCl_propOut_eg_barrel","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max);
438  h1_ele_dPhiEleCl_propOut_endcaps = bookH1withSumw2("h_ele_dPhiEleCl_propOut_endcaps","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)");
439  h1_ele_dPhiEleCl_propOut_eg_endcaps = bookH1withSumw2("h_ele_dPhiEleCl_propOut_eg_endcaps","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max);
440  h2_ele_dPhiEleClVsEta_propOut = bookH2("h_ele_dPhiEleClVsEta_propOut","ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
441  h2_ele_dPhiEleClVsPhi_propOut = bookH2("h_ele_dPhiEleClVsPhi_propOut","ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
442  h2_ele_dPhiEleClVsPt_propOut = bookH2("h_ele_dPhiSEleClsPt_propOut","ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
443  h1_ele_HoE = bookH1withSumw2("h_ele_HoE","ele hadronic energy / em energy",hoe_nbin, hoe_min, hoe_max,"H/E") ;
444  h1_ele_HoE_eg = bookH1withSumw2("h_ele_HoE_eg","ele hadronic energy / em energy, ecal driven",hoe_nbin, hoe_min, hoe_max) ;
445  h1_ele_HoE_barrel = bookH1withSumw2("h_ele_HoE_barrel","ele hadronic energy / em energy, barrel",hoe_nbin, hoe_min, hoe_max,"H/E") ;
446  h1_ele_HoE_eg_barrel = bookH1withSumw2("h_ele_HoE_eg_barrel","ele hadronic energy / em energy, ecal driven, barrel",hoe_nbin, hoe_min, hoe_max) ;
447  h1_ele_HoE_endcaps = bookH1withSumw2("h_ele_HoE_endcaps","ele hadronic energy / em energy, endcaps",hoe_nbin, hoe_min, hoe_max,"H/E") ;
448  h1_ele_HoE_eg_endcaps = bookH1withSumw2("h_ele_HoE_eg_endcaps","ele hadronic energy / em energy, ecal driven, endcaps",hoe_nbin, hoe_min, hoe_max) ;
449  h1_ele_HoE_fiducial = bookH1withSumw2("h_ele_HoE_fiducial","ele hadronic energy / em energy, fiducial region",hoe_nbin, hoe_min, hoe_max,"H/E") ;
450  h2_ele_HoEVsEta = bookH2("h_ele_HoEVsEta","ele hadronic energy / em energy vs eta",eta_nbin,eta_min,eta_max,hoe_nbin, hoe_min, hoe_max) ;
451  h2_ele_HoEVsPhi = bookH2("h_ele_HoEVsPhi","ele hadronic energy / em energy vs phi",phi2D_nbin,phi_min,phi_max,hoe_nbin, hoe_min, hoe_max) ;
452  h2_ele_HoEVsE = bookH2("h_ele_HoEVsE","ele hadronic energy / em energy vs E",p_nbin, 0.,300.,hoe_nbin, hoe_min, hoe_max) ;
453  h1_ele_seed_dphi2_ = bookH1withSumw2("h_ele_seedDphi2","ele seed dphi 2nd layer", 50,-0.003,+0.003,"#phi_{hit}-#phi_{pred} (rad)") ;
454  h2_ele_seed_dphi2VsEta_ = bookH2("h_ele_seedDphi2VsEta","ele seed dphi 2nd layer vs eta",eta2D_nbin,eta_min,eta_max,50,-0.003,+0.003) ;
455  h2_ele_seed_dphi2VsPt_ = bookH2("h_ele_seedDphi2VsPt","ele seed dphi 2nd layer vs pt",pt2D_nbin,0.,pt_max,50,-0.003,+0.003) ;
456  h1_ele_seed_drz2_ = bookH1withSumw2("h_ele_seedDrz2","ele seed dr (dz) 2nd layer", 50,-0.03,+0.03,"r(z)_{hit}-r(z)_{pred} (cm)") ;
457  h2_ele_seed_drz2VsEta_ = bookH2("h_ele_seedDrz2VsEta","ele seed dr/dz 2nd layer vs eta",eta2D_nbin,eta_min,eta_max,50,-0.03,+0.03) ;
458  h2_ele_seed_drz2VsPt_ = bookH2("h_ele_seedDrz2VsPt","ele seed dr/dz 2nd layer vs pt",pt2D_nbin,0.,pt_max,50,-0.03,+0.03) ;
459  h1_ele_seed_subdet2_ = bookH1withSumw2("h_ele_seedSubdet2","ele seed subdet 2nd layer",10,0.,10.,"2nd hit subdet Id") ;
460 
461  // classes
462  h1_ele_classes = bookH1withSumw2("h_ele_classes","ele classes",20,0.0,20.,"class Id");
463  h1_ele_eta = bookH1withSumw2("h_ele_eta","ele electron eta",eta_nbin/2,0.0,eta_max);
464  h1_ele_eta_golden = bookH1withSumw2("h_ele_eta_golden","ele electron eta golden",eta_nbin/2,0.0,eta_max);
465  h1_ele_eta_bbrem = bookH1withSumw2("h_ele_eta_bbrem","ele electron eta bbrem",eta_nbin/2,0.0,eta_max);
466  h1_ele_eta_narrow = bookH1withSumw2("h_ele_eta_narrow","ele electron eta narrow",eta_nbin/2,0.0,eta_max);
467  h1_ele_eta_shower = bookH1withSumw2("h_ele_eta_show","ele electron eta showering",eta_nbin/2,0.0,eta_max);
468  h2_ele_PinVsPoutGolden_mode = bookH2("h_ele_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);
469  h2_ele_PinVsPoutShowering_mode = bookH2("h_ele_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);
470  h2_ele_PinVsPoutGolden_mean = bookH2("h_ele_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);
471  h2_ele_PinVsPoutShowering_mean = bookH2("h_ele_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);
472  h2_ele_PtinVsPtoutGolden_mode = bookH2("h_ele_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);
473  h2_ele_PtinVsPtoutShowering_mode = bookH2("h_ele_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);
474  h2_ele_PtinVsPtoutGolden_mean = bookH2("h_ele_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);
475  h2_ele_PtinVsPtoutShowering_mean = bookH2("h_ele_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);
476  h1_scl_EoEtrueGolden_barrel = bookH1withSumw2("h_scl_EoEtrue_golden_barrel","ele supercluster energy / gen energy, golden, barrel",poptrue_nbin,poptrue_min,poptrue_max);
477  h1_scl_EoEtrueGolden_endcaps = bookH1withSumw2("h_scl_EoEtrue_golden_endcaps","ele supercluster energy / gen energy, golden, endcaps",poptrue_nbin,poptrue_min,poptrue_max);
478  h1_scl_EoEtrueShowering_barrel = bookH1withSumw2("h_scl_EoEtrue_showering_barrel","ele supercluster energy / gen energy, showering, barrel",poptrue_nbin,poptrue_min,poptrue_max);
479  h1_scl_EoEtrueShowering_endcaps = bookH1withSumw2("h_scl_EoEtrue_showering_endcaps","ele supercluster energy / gen energy, showering, endcaps",poptrue_nbin,poptrue_min,poptrue_max);
480 
481  // isolation
482  h1_ele_tkSumPt_dr03 = bookH1withSumw2("h_ele_tkSumPt_dr03","tk isolation sum, dR=0.3",100,0.0,20.,"TkIsoSum, cone 0.3 (GeV/c)");
483  h1_ele_ecalRecHitSumEt_dr03 = bookH1withSumw2("h_ele_ecalRecHitSumEt_dr03","ecal isolation sum, dR=0.3",100,0.0,20.,"EcalIsoSum, cone 0.3 (GeV)");
484  h1_ele_hcalTowerSumEt_dr03_depth1 = bookH1withSumw2("h_ele_hcalTowerSumEt_dr03_depth1","hcal depth1 isolation sum, dR=0.3",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)");
485  h1_ele_hcalTowerSumEt_dr03_depth2 = bookH1withSumw2("h_ele_hcalTowerSumEt_dr03_depth2","hcal depth2 isolation sum, dR=0.3",100,0.0,20.,"Hcal2IsoSum, cone 0.3 (GeV)");
486  h1_ele_tkSumPt_dr04 = bookH1withSumw2("h_ele_tkSumPt_dr04","tk isolation sum, dR=0.4",100,0.0,20.,"TkIsoSum, cone 0.4 (GeV/c)");
487  h1_ele_ecalRecHitSumEt_dr04 = bookH1withSumw2("h_ele_ecalRecHitSumEt_dr04","ecal isolation sum, dR=0.4",100,0.0,20.,"EcalIsoSum, cone 0.4 (GeV)");
488  h1_ele_hcalTowerSumEt_dr04_depth1 = bookH1withSumw2("h_ele_hcalTowerSumEt_dr04_depth1","hcal depth1 isolation sum, dR=0.4",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)");
489  h1_ele_hcalTowerSumEt_dr04_depth2 = bookH1withSumw2("h_ele_hcalTowerSumEt_dr04_depth2","hcal depth2 isolation sum, dR=0.4",100,0.0,20.,"Hcal2IsoSum, cone 0.4 (GeV)");
490 
491  // fbrem
492  h1_ele_fbrem = bookH1withSumw2("h_ele_fbrem","ele brem fraction, mode of GSF components",100,0.,1.,"P_{in} - P_{out} / P_{in}");
493  h1_ele_fbrem_eg = bookH1withSumw2("h_ele_fbrem_eg","ele brem fraction, mode of GSF components, ecal driven",100,0.,1.);
494  p1_ele_fbremVsEta_mode = bookP1("h_ele_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}>");
495  p1_ele_fbremVsEta_mean = bookP1("h_ele_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}>");
496 
497  // e/g et pflow electrons
498  h1_ele_mva = bookH1withSumw2("h_ele_mva","ele identification mva",100,-1.,1.);
499  h1_ele_mva_eg = bookH1withSumw2("h_ele_mva_eg","ele identification mva, ecal driven",100,-1.,1.);
500  h1_ele_provenance = bookH1withSumw2("h_ele_provenance","ele provenance",5,-2.,3.);
501  }
502 
504  {}
505 
506 
507 //=========================================================================
508 // Main methods
509 //=========================================================================
510 
512  {
513  // get collections
515  iEvent.getByLabel(electronCollection_,gsfElectrons) ;
517  iEvent.getByLabel(mcTruthCollection_, genParticles) ;
518  edm::Handle<reco::BeamSpot> theBeamSpot ;
519  iEvent.getByLabel(beamSpotTag_,theBeamSpot) ;
520 
521  edm::LogInfo("ElectronMcSignalValidator::analyze")
522  <<"Treating event "<<iEvent.id()
523  <<" with "<<gsfElectrons.product()->size()<<" electrons" ;
524  h1_recEleNum_->Fill((*gsfElectrons).size()) ;
525 
526  // all rec electrons
527  reco::GsfElectronCollection::const_iterator gsfIter ;
528  for ( gsfIter=gsfElectrons->begin() ; gsfIter!=gsfElectrons->end() ; gsfIter++ )
529  {
530  // preselect electrons
531  if (gsfIter->pt()>maxPt_ || std::abs(gsfIter->eta())>maxAbsEta_) continue ;
532  h1_ele_EoverP_all->Fill(gsfIter->eSuperClusterOverP()) ;
533  h1_ele_EseedOP_all->Fill(gsfIter->eSeedClusterOverP()) ;
534  h1_ele_EoPout_all->Fill(gsfIter->eSeedClusterOverPout()) ;
535  h1_ele_EeleOPout_all->Fill( gsfIter->eEleClusterOverPout()) ;
536  h1_ele_dEtaSc_propVtx_all->Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx()) ;
537  h1_ele_dPhiSc_propVtx_all->Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx()) ;
538  h1_ele_dEtaCl_propOut_all->Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo()) ;
539  h1_ele_dPhiCl_propOut_all->Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo()) ;
540  h1_ele_HoE_all->Fill(gsfIter->hadronicOverEm()) ;
541  h1_ele_TIP_all->Fill( EleRelPoint(gsfIter->vertex(),theBeamSpot->position()).perp() );
542  h1_ele_vertexEta_all->Fill( gsfIter->eta() );
543  h1_ele_vertexPt_all->Fill( gsfIter->pt() );
544  h1_ele_Et_all->Fill( gsfIter->superCluster()->energy()/cosh(gsfIter->superCluster()->eta()));
545  float enrj1=gsfIter->superCluster()->energy();
546 
547  // mee
548  reco::GsfElectronCollection::const_iterator gsfIter2 ;
549  for ( gsfIter2=gsfIter+1 ; gsfIter2!=gsfElectrons->end() ; gsfIter2++ )
550  {
551  math::XYZTLorentzVector p12 = (*gsfIter).p4()+(*gsfIter2).p4();
552  float mee2 = p12.Dot(p12);
553  float enrj2=gsfIter2->superCluster()->energy();
554  h1_ele_mee_all->Fill(sqrt(mee2));
555  h2_ele_E2mnE1vsMee_all->Fill(sqrt(mee2),enrj2-enrj1);
556  if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
557  { h2_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2),enrj2-enrj1) ; }
558  if (gsfIter->charge()*gsfIter2->charge()<0.)
559  {
560  h1_ele_mee_os->Fill(sqrt(mee2));
561  if (gsfIter->isEB() && gsfIter2->isEB()) { h1_ele_mee_os_ebeb->Fill(sqrt(mee2)) ; }
562  if ((gsfIter->isEB() && gsfIter2->isEE()) || (gsfIter->isEE() && gsfIter2->isEB())) h1_ele_mee_os_ebee -> Fill(sqrt(mee2));
563  if (gsfIter->isEE() && gsfIter2->isEE()) { h1_ele_mee_os_eeee->Fill(sqrt(mee2)) ; }
564  if
565  ( (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::GOLDEN) ||
566  (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::BIGBREM) ||
567  (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::OLDNARROW) ||
568  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::GOLDEN) ||
569  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::BIGBREM) ||
570  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::OLDNARROW) ||
571  (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::GOLDEN) ||
572  (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::BIGBREM) ||
573  (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::OLDNARROW) )
574  { h1_ele_mee_os_gg->Fill(sqrt(mee2)) ; }
575  else if
576  ( (gsfIter->classification()==GsfElectron::SHOWERING && gsfIter2->classification()==GsfElectron::SHOWERING) ||
577  (gsfIter->classification()==GsfElectron::SHOWERING && gsfIter2->isGap()) ||
578  (gsfIter->isGap() && gsfIter2->classification()==GsfElectron::SHOWERING) ||
579  (gsfIter->isGap() && gsfIter2->isGap()) )
580  { h1_ele_mee_os_bb->Fill(sqrt(mee2)) ; }
581  else
582  { h1_ele_mee_os_gb->Fill(sqrt(mee2)) ; }
583  }
584  }
585  }
586 
587  int mcNum=0, gamNum=0, eleNum=0 ;
588  bool matchingID, matchingMotherID ;
589 
590  // charge mis-ID
591  reco::GenParticleCollection::const_iterator mcIter ;
592  for
593  ( mcIter=genParticles->begin() ; mcIter!=genParticles->end() ; mcIter++ )
594  {
595  // select requested matching gen particle
596  matchingID=false;
597  for ( unsigned int i=0 ; i<matchingIDs_.size() ; i++ )
598  {
599  if ( mcIter->pdgId() == matchingIDs_[i] )
600  { matchingID=true ; }
601  }
602  if (matchingID)
603  {
604  // select requested mother matching gen particle
605  // always include single particle with no mother
606  const Candidate * mother = mcIter->mother() ;
607  matchingMotherID = false ;
608  for ( unsigned int i=0 ; i<matchingMotherIDs_.size() ; i++ )
609  {
610  if ((mother == 0) || ((mother != 0) && mother->pdgId() == matchingMotherIDs_[i]) )
611  { matchingMotherID = true ; }
612  }
613  if (matchingMotherID)
614  {
615  if ( mcIter->pt()>maxPt_ || std::abs(mcIter->eta())>maxAbsEta_ )
616  { continue ; }
617  // suppress the endcaps
618  //if (std::abs(mcIter->eta()) > 1.5) continue;
619  // select central z
620  //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
621 
622  // looking for the best matching gsf electron
623  bool okGsfFound = false ;
624  double gsfOkRatio = 999999. ;
625 
626  // find best matched electron
627  reco::GsfElectron bestGsfElectron ;
628  reco::GsfElectronCollection::const_iterator gsfIter ;
629  for
630  ( gsfIter=gsfElectrons->begin() ; gsfIter!=gsfElectrons->end() ; gsfIter++ )
631  {
632  double dphi = gsfIter->phi()-mcIter->phi() ;
633  if (std::abs(dphi)>CLHEP::pi)
634  { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
635  double deltaR = sqrt(pow((gsfIter->eta()-mcIter->eta()),2) + pow(dphi,2)) ;
636  if ( deltaR < deltaR_ )
637  {
638  double mc_charge = mcIter->pdgId() == 11 ? -1. : 1. ;
639  h1_ele_ChargeMnChargeTrue->Fill( std::abs(gsfIter->charge()-mc_charge));
640  // require here a charge mismatch
641  if
642  ( ( (mcIter->pdgId() == 11) && (gsfIter->charge() > 0.) ) ||
643  ( (mcIter->pdgId() == -11) && (gsfIter->charge() < 0.) ) )
644  {
645  double tmpGsfRatio = gsfIter->p()/mcIter->p();
646  if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) )
647  {
648  gsfOkRatio = tmpGsfRatio;
649  bestGsfElectron=*gsfIter;
650  okGsfFound = true;
651  }
652  }
653  }
654  } // loop over rec ele to look for the best one
655 
656  // analysis when the mc track is found
657  if (okGsfFound)
658  {
659  // generated distributions for matched electrons
660  h1_ele_simPt_matched_qmisid->Fill( mcIter->pt() ) ;
661  h1_ele_simPhi_matched_qmisid->Fill( mcIter->phi() ) ;
662  h1_ele_simAbsEta_matched_qmisid->Fill( std::abs(mcIter->eta()) ) ;
663  h1_ele_simEta_matched_qmisid->Fill( mcIter->eta() ) ;
664  h1_ele_simZ_matched_qmisid->Fill( mcIter->vz() ) ;
665  }
666  }
667  }
668  }
669 
670  // association mc-reco
671  for ( mcIter=genParticles->begin() ; mcIter!=genParticles->end() ; mcIter++ )
672  {
673  // number of mc particles
674  mcNum++ ;
675 
676  // counts photons
677  if (mcIter->pdgId() == 22 )
678  { gamNum++ ; }
679 
680  // select requested matching gen particle
681  matchingID = false ;
682  for ( unsigned int i=0 ; i<matchingIDs_.size() ; i++ )
683  {
684  if ( mcIter->pdgId() == matchingIDs_[i] )
685  { matchingID=true ; }
686  }
687 
688  if (matchingID)
689  {
690  // select requested mother matching gen particle
691  // always include single particle with no mother
692  const Candidate * mother = mcIter->mother() ;
693  matchingMotherID = false ;
694  for ( unsigned int i=0 ; i<matchingMotherIDs_.size() ; i++ )
695  {
696  if ( (mother == 0) || ((mother != 0) && mother->pdgId() == matchingMotherIDs_[i]) )
697  { matchingMotherID = true ; }
698  }
699 
700  if (matchingMotherID)
701  {
702  if (mcIter->pt()> maxPt_ || std::abs(mcIter->eta())> maxAbsEta_)
703  { continue ; }
704 
705  // suppress the endcaps
706  //if (std::abs(mcIter->eta()) > 1.5) continue;
707  // select central z
708  //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
709 
710  eleNum++;
711  h1_simEta->Fill( mcIter->eta() );
712  h1_simAbsEta->Fill( std::abs(mcIter->eta()) );
713  h1_simP->Fill( mcIter->p() );
714  h1_simPt->Fill( mcIter->pt() );
715  h1_simPhi->Fill( mcIter->phi() );
716  h1_simZ->Fill( mcIter->vz() );
717  h2_simPtEta->Fill( mcIter->eta(),mcIter->pt() );
718 
719  // looking for the best matching gsf electron
720  bool okGsfFound = false;
721  double gsfOkRatio = 999999.;
722 
723  // find best matched electron
724  reco::GsfElectron bestGsfElectron ;
725  reco::GsfElectronCollection::const_iterator gsfIter ;
726  for ( gsfIter=gsfElectrons->begin() ; gsfIter!=gsfElectrons->end() ; gsfIter++ )
727  {
728  double dphi = gsfIter->phi()-mcIter->phi() ;
729  if (std::abs(dphi)>CLHEP::pi)
730  { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
731  double deltaR = sqrt(pow((gsfIter->eta()-mcIter->eta()),2) + pow(dphi,2));
732  if ( deltaR < deltaR_ )
733  {
734  if ( ( (mcIter->pdgId() == 11) && (gsfIter->charge() < 0.) ) ||
735  ( (mcIter->pdgId() == -11) && (gsfIter->charge() > 0.) ) )
736  {
737  double tmpGsfRatio = gsfIter->p()/mcIter->p() ;
738  if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) )
739  {
740  gsfOkRatio = tmpGsfRatio;
741  bestGsfElectron=*gsfIter;
742  okGsfFound = true;
743  }
744  }
745  }
746  } // loop over rec ele to look for the best one
747 
748  // analysis when the mc track is found
749  if (okGsfFound)
750  {
751  // electron related distributions
752  h1_ele_charge->Fill( bestGsfElectron.charge() );
753  h2_ele_chargeVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.charge() );
754  h2_ele_chargeVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.charge() );
755  h2_ele_chargeVsPt->Fill( bestGsfElectron.pt(),bestGsfElectron.charge() );
756  h1_ele_vertexP->Fill( bestGsfElectron.p() );
757  h1_ele_vertexPt->Fill( bestGsfElectron.pt() );
758  h1_ele_Et->Fill( bestGsfElectron.superCluster()->energy()/cosh(bestGsfElectron.superCluster()->eta()));
759  h2_ele_vertexPtVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.pt() );
760  h2_ele_vertexPtVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.pt() );
761  h1_ele_vertexEta->Fill( bestGsfElectron.eta() );
762  // generated distributions for matched electrons
763  h1_ele_simPt_matched->Fill( mcIter->pt() );
764  h1_ele_simPhi_matched->Fill( mcIter->phi() );
765  h1_ele_simAbsEta_matched->Fill( std::abs(mcIter->eta()) );
766  h1_ele_simEta_matched->Fill( mcIter->eta() );
767  h2_ele_simPtEta_matched->Fill( mcIter->eta(),mcIter->pt() );
768  h2_ele_vertexEtaVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.eta() );
769  h1_ele_vertexPhi->Fill( bestGsfElectron.phi() );
770  h1_ele_vertexX->Fill( bestGsfElectron.vertex().x() );
771  h1_ele_vertexY->Fill( bestGsfElectron.vertex().y() );
772  h1_ele_vertexZ->Fill( bestGsfElectron.vertex().z() );
773  h1_ele_simZ_matched->Fill( mcIter->vz() );
774  double d =
775  (bestGsfElectron.vertex().x()-mcIter->vx())*(bestGsfElectron.vertex().x()-mcIter->vx()) +
776  (bestGsfElectron.vertex().y()-mcIter->vy())*(bestGsfElectron.vertex().y()-mcIter->vy()) ;
777  d = sqrt(d) ;
778  h1_ele_vertexTIP->Fill( d );
779  h2_ele_vertexTIPVsEta->Fill( bestGsfElectron.eta(), d );
780  h2_ele_vertexTIPVsPhi->Fill( bestGsfElectron.phi(), d );
781  h2_ele_vertexTIPVsPt->Fill( bestGsfElectron.pt(), d );
782  h1_ele_EtaMnEtaTrue->Fill( bestGsfElectron.eta()-mcIter->eta());
783  if (bestGsfElectron.isEB()) h1_ele_EtaMnEtaTrue_barrel->Fill( bestGsfElectron.eta()-mcIter->eta());
784  if (bestGsfElectron.isEE()) h1_ele_EtaMnEtaTrue_endcaps->Fill( bestGsfElectron.eta()-mcIter->eta());
785  h2_ele_EtaMnEtaTrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eta()-mcIter->eta());
786  h2_ele_EtaMnEtaTrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eta()-mcIter->eta());
787  h2_ele_EtaMnEtaTrueVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.eta()-mcIter->eta());
788  h1_ele_PhiMnPhiTrue->Fill( bestGsfElectron.phi()-mcIter->phi());
789  if (bestGsfElectron.isEB()) h1_ele_PhiMnPhiTrue_barrel->Fill( bestGsfElectron.phi()-mcIter->phi());
790  if (bestGsfElectron.isEE()) h1_ele_PhiMnPhiTrue_endcaps->Fill( bestGsfElectron.phi()-mcIter->phi());
791  h1_ele_PhiMnPhiTrue2->Fill( bestGsfElectron.phi()-mcIter->phi());
792  h2_ele_PhiMnPhiTrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.phi()-mcIter->phi());
793  h2_ele_PhiMnPhiTrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.phi()-mcIter->phi());
794  h2_ele_PhiMnPhiTrueVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.phi()-mcIter->phi());
795  h1_ele_PoPtrue->Fill( bestGsfElectron.p()/mcIter->p());
796  h1_ele_PtoPttrue->Fill( bestGsfElectron.pt()/mcIter->pt());
797  h2_ele_PoPtrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.p()/mcIter->p());
798  h2_ele_PoPtrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.p()/mcIter->p());
799  h2_ele_PoPtrueVsPt->Fill( bestGsfElectron.py(), bestGsfElectron.p()/mcIter->p());
800  if (bestGsfElectron.isEB()) h1_ele_PoPtrue_barrel->Fill( bestGsfElectron.p()/mcIter->p());
801  if (bestGsfElectron.isEE()) h1_ele_PoPtrue_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
802  if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_PoPtrue_golden_barrel->Fill( bestGsfElectron.p()/mcIter->p());
803  if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_PoPtrue_golden_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
804  if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_PoPtrue_showering_barrel->Fill( bestGsfElectron.p()/mcIter->p());
805  if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_PoPtrue_showering_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
806  if (bestGsfElectron.isEB()) h1_ele_PtoPttrue_barrel->Fill( bestGsfElectron.pt()/mcIter->pt());
807  if (bestGsfElectron.isEE()) h1_ele_PtoPttrue_endcaps->Fill( bestGsfElectron.pt()/mcIter->pt());
808 
809  // supercluster related distributions
810  reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
811  if (!bestGsfElectron.ecalDrivenSeed()&&bestGsfElectron.trackerDrivenSeed())
812  { sclRef = bestGsfElectron.pflowSuperCluster() ; }
813  h1_scl_En_->Fill(sclRef->energy());
814  double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
815  double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
816  h1_scl_Et_->Fill(sclRef->energy()*(Rt/R));
817  h2_scl_EtVsEta_->Fill(sclRef->eta(),sclRef->energy()*(Rt/R));
818  h2_scl_EtVsPhi_->Fill(sclRef->phi(),sclRef->energy()*(Rt/R));
819  if (bestGsfElectron.isEB()) h1_scl_EoEtrue_barrel->Fill(sclRef->energy()/mcIter->p());
820  if (bestGsfElectron.isEE()) h1_scl_EoEtrue_endcaps->Fill(sclRef->energy()/mcIter->p());
821  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed()) h1_scl_EoEtrue_barrel_eg->Fill(sclRef->energy()/mcIter->p());
822  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed()) h1_scl_EoEtrue_endcaps_eg->Fill(sclRef->energy()/mcIter->p());
823  if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap()) h1_scl_EoEtrue_barrel_etagap->Fill(sclRef->energy()/mcIter->p());
824  if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap()) h1_scl_EoEtrue_barrel_phigap->Fill(sclRef->energy()/mcIter->p());
825  if (bestGsfElectron.isEBEEGap()) h1_scl_EoEtrue_ebeegap->Fill(sclRef->energy()/mcIter->p());
826  //if (bestGsfElectron.isEE()) h1_scl_EoEtrue_endcaps->Fill(sclRef->energy()/mcIter->p());
827  if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap()) h1_scl_EoEtrue_endcaps_deegap->Fill(sclRef->energy()/mcIter->p());
828  if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap()) h1_scl_EoEtrue_endcaps_ringgap->Fill(sclRef->energy()/mcIter->p());
829  if (bestGsfElectron.isEB()) h1_scl_EoEtrue_barrel_new->Fill(sclRef->energy()/mcIter->p());
830  if (bestGsfElectron.isEE()) h1_scl_EoEtrue_endcaps_new->Fill(sclRef->energy()/mcIter->p());
831  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed()) h1_scl_EoEtrue_barrel_new_eg->Fill(sclRef->energy()/mcIter->p());
832  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed()) h1_scl_EoEtrue_endcaps_new_eg->Fill(sclRef->energy()/mcIter->p());
833  if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap()) h1_scl_EoEtrue_barrel_new_etagap->Fill(sclRef->energy()/mcIter->p());
834  if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap()) h1_scl_EoEtrue_barrel_new_phigap->Fill(sclRef->energy()/mcIter->p());
835  if (bestGsfElectron.isEBEEGap()) h1_scl_EoEtrue_ebeegap_new->Fill(sclRef->energy()/mcIter->p());
836  //if (bestGsfElectron.isEE()) h1_scl_EoEtrue_endcaps_new->Fill(sclRef->energy()/mcIter->p());
837  if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap()) h1_scl_EoEtrue_endcaps_new_deegap->Fill(sclRef->energy()/mcIter->p());
838  if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap()) h1_scl_EoEtrue_endcaps_new_ringgap->Fill(sclRef->energy()/mcIter->p());
839  h1_scl_Eta_->Fill(sclRef->eta());
840  h2_scl_EtaVsPhi_->Fill(sclRef->phi(),sclRef->eta());
841  h1_scl_Phi_->Fill(sclRef->phi());
842  h1_scl_SigEtaEta_->Fill(bestGsfElectron.scSigmaEtaEta());
843  if (bestGsfElectron.isEB()) h1_scl_SigEtaEta_barrel_->Fill(bestGsfElectron.scSigmaEtaEta());
844  if (bestGsfElectron.isEE()) h1_scl_SigEtaEta_endcaps_->Fill(bestGsfElectron.scSigmaEtaEta());
845  h1_scl_SigIEtaIEta_->Fill(bestGsfElectron.scSigmaIEtaIEta());
846  if (bestGsfElectron.isEB()) h1_scl_SigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
847  if (bestGsfElectron.isEE()) h1_scl_SigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
848  h1_scl_E1x5_->Fill(bestGsfElectron.scE1x5());
849  if (bestGsfElectron.isEB()) h1_scl_E1x5_barrel_->Fill(bestGsfElectron.scE1x5());
850  if (bestGsfElectron.isEE()) h1_scl_E1x5_endcaps_->Fill(bestGsfElectron.scE1x5());
851  h1_scl_E2x5max_->Fill(bestGsfElectron.scE2x5Max());
852  if (bestGsfElectron.isEB()) h1_scl_E2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max());
853  if (bestGsfElectron.isEE()) h1_scl_E2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max());
854  h1_scl_E5x5_->Fill(bestGsfElectron.scE5x5());
855  if (bestGsfElectron.isEB()) h1_scl_E5x5_barrel_->Fill(bestGsfElectron.scE5x5());
856  if (bestGsfElectron.isEE()) h1_scl_E5x5_endcaps_->Fill(bestGsfElectron.scE5x5());
857  if (bestGsfElectron.ecalDrivenSeed()) h1_scl_SigIEtaIEta_eg_->Fill(bestGsfElectron.scSigmaIEtaIEta());
858  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_scl_SigIEtaIEta_eg_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
859  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_scl_SigIEtaIEta_eg_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
860  if (bestGsfElectron.ecalDrivenSeed())h1_scl_E1x5_eg_->Fill(bestGsfElectron.scE1x5());
861  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())h1_scl_E1x5_eg_barrel_->Fill(bestGsfElectron.scE1x5());
862  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())h1_scl_E1x5_eg_endcaps_->Fill(bestGsfElectron.scE1x5());
863  if (bestGsfElectron.ecalDrivenSeed())h1_scl_E2x5max_eg_->Fill(bestGsfElectron.scE2x5Max());
864  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())h1_scl_E2x5max_eg_barrel_->Fill(bestGsfElectron.scE2x5Max());
865  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())h1_scl_E2x5max_eg_endcaps_->Fill(bestGsfElectron.scE2x5Max());
866  if (bestGsfElectron.ecalDrivenSeed())h1_scl_E5x5_eg_->Fill(bestGsfElectron.scE5x5());
867  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())h1_scl_E5x5_eg_barrel_->Fill(bestGsfElectron.scE5x5());
868  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())h1_scl_E5x5_eg_endcaps_->Fill(bestGsfElectron.scE5x5());
869  float pfEnergy=0., egEnergy=0.;
870  if (!bestGsfElectron.superCluster().isNull()) egEnergy = bestGsfElectron.superCluster()->energy();
871  if (!bestGsfElectron.pflowSuperCluster().isNull()) pfEnergy = bestGsfElectron.pflowSuperCluster()->energy();
872  h2_scl_EoEtruePfVsEg->Fill(egEnergy/mcIter->p(),pfEnergy/mcIter->p());
873 
874  // track related distributions
875  h1_ele_ambiguousTracks->Fill( bestGsfElectron.ambiguousGsfTracksSize() );
876  h2_ele_ambiguousTracksVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize() );
877  h2_ele_ambiguousTracksVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize() );
878  h2_ele_ambiguousTracksVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize() );
879  if (!readAOD_) // track extra does not exist in AOD
880  {
881  h1_ele_foundHits->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
882  if (bestGsfElectron.isEB()) h1_ele_foundHits_barrel->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
883  if (bestGsfElectron.isEE()) h1_ele_foundHits_endcaps->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
884  h2_ele_foundHitsVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
885  h2_ele_foundHitsVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
886  h2_ele_foundHitsVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
887  h1_ele_lostHits->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
888  if (bestGsfElectron.isEB()) h1_ele_lostHits_barrel->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
889  if (bestGsfElectron.isEE()) h1_ele_lostHits_endcaps->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
890  h2_ele_lostHitsVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
891  h2_ele_lostHitsVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
892  h2_ele_lostHitsVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
893  h1_ele_chi2->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
894  if (bestGsfElectron.isEB()) h1_ele_chi2_barrel->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
895  if (bestGsfElectron.isEE()) h1_ele_chi2_endcaps->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
896  h2_ele_chi2VsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2() );
897  h2_ele_chi2VsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2() );
898  h2_ele_chi2VsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2() );
899  }
900  // from gsf track interface, hence using mean
901  if (!readAOD_) // track extra does not exist in AOD
902  {
903  h1_ele_PinMnPout->Fill( bestGsfElectron.gsfTrack()->innerMomentum().R() - bestGsfElectron.gsfTrack()->outerMomentum().R() );
904  h1_ele_outerP->Fill( bestGsfElectron.gsfTrack()->outerMomentum().R() );
905  h1_ele_outerPt->Fill( bestGsfElectron.gsfTrack()->outerMomentum().Rho() );
906  }
907  // from electron interface, hence using mode
908  h1_ele_PinMnPout_mode->Fill( bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
909  h2_ele_PinMnPoutVsEta_mode->Fill( bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
910  h2_ele_PinMnPoutVsPhi_mode->Fill( bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
911  h2_ele_PinMnPoutVsPt_mode->Fill( bestGsfElectron.pt(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
912  h2_ele_PinMnPoutVsE_mode->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
913  if (!readAOD_) // track extra does not exist in AOD
914  {
916  ( bestGsfElectron.gsfTrack()->normalizedChi2(),
917  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() ) ;
918  }
919  h1_ele_outerP_mode->Fill( bestGsfElectron.trackMomentumOut().R() );
920  h2_ele_outerPVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().R() );
921  h1_ele_outerPt_mode->Fill( bestGsfElectron.trackMomentumOut().Rho() );
922  h2_ele_outerPtVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().Rho() );
923  h2_ele_outerPtVsPhi_mode->Fill(bestGsfElectron.phi(), bestGsfElectron.trackMomentumOut().Rho() );
924  h2_ele_outerPtVsPt_mode->Fill(bestGsfElectron.pt(), bestGsfElectron.trackMomentumOut().Rho() );
925 
926  if (!readAOD_) // track extra does not exist in AOD
927  {
928  edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
929  ElectronSeedRef elseed=seed.castTo<ElectronSeedRef>();
930  h1_ele_seed_dphi2_->Fill(elseed->dPhi2());
931  h2_ele_seed_dphi2VsEta_->Fill(bestGsfElectron.eta(), elseed->dPhi2());
932  h2_ele_seed_dphi2VsPt_->Fill(bestGsfElectron.pt(), elseed->dPhi2());
933  h1_ele_seed_drz2_->Fill(elseed->dRz2());
934  h2_ele_seed_drz2VsEta_->Fill(bestGsfElectron.eta(), elseed->dRz2());
935  h2_ele_seed_drz2VsPt_->Fill(bestGsfElectron.pt(), elseed->dRz2());
936  h1_ele_seed_subdet2_->Fill(elseed->subDet2());
937  }
938  // match distributions
939  h1_ele_EoP->Fill( bestGsfElectron.eSuperClusterOverP() );
940  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg->Fill( bestGsfElectron.eSuperClusterOverP() );
941  if (bestGsfElectron.isEB()) h1_ele_EoP_barrel->Fill( bestGsfElectron.eSuperClusterOverP() );
942  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg_barrel->Fill( bestGsfElectron.eSuperClusterOverP() );
943  if (bestGsfElectron.isEE()) h1_ele_EoP_endcaps->Fill( bestGsfElectron.eSuperClusterOverP() );
944  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg_endcaps->Fill( bestGsfElectron.eSuperClusterOverP() );
945  h2_ele_EoPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSuperClusterOverP() );
946  h2_ele_EoPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSuperClusterOverP() );
947  h2_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSuperClusterOverP() );
948  h1_ele_EseedOP->Fill( bestGsfElectron.eSeedClusterOverP() );
949  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg->Fill( bestGsfElectron.eSeedClusterOverP() );
950  if (bestGsfElectron.isEB()) h1_ele_EseedOP_barrel->Fill( bestGsfElectron.eSeedClusterOverP() );
951  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg_barrel->Fill( bestGsfElectron.eSeedClusterOverP() );
952  if (bestGsfElectron.isEE()) h1_ele_EseedOP_endcaps->Fill( bestGsfElectron.eSeedClusterOverP() );
953  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg_endcaps->Fill( bestGsfElectron.eSeedClusterOverP() );
954  h2_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverP() );
955  h2_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverP() );
956  h2_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverP() );
957  h1_ele_EoPout->Fill( bestGsfElectron.eSeedClusterOverPout() );
958  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg->Fill( bestGsfElectron.eSeedClusterOverPout() );
959  if (bestGsfElectron.isEB()) h1_ele_EoPout_barrel->Fill( bestGsfElectron.eSeedClusterOverPout() );
960  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg_barrel->Fill( bestGsfElectron.eSeedClusterOverPout() );
961  if (bestGsfElectron.isEE()) h1_ele_EoPout_endcaps->Fill( bestGsfElectron.eSeedClusterOverPout() );
962  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg_endcaps->Fill( bestGsfElectron.eSeedClusterOverPout() );
963  h2_ele_EoPoutVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout() );
964  h2_ele_EoPoutVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout() );
965  h2_ele_EoPoutVsE->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout() );
966  h1_ele_EeleOPout->Fill( bestGsfElectron.eEleClusterOverPout() );
967  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg->Fill( bestGsfElectron.eEleClusterOverPout() );
968  if (bestGsfElectron.isEB()) h1_ele_EeleOPout_barrel->Fill( bestGsfElectron.eEleClusterOverPout() );
969  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg_barrel->Fill( bestGsfElectron.eEleClusterOverPout() );
970  if (bestGsfElectron.isEE()) h1_ele_EeleOPout_endcaps->Fill( bestGsfElectron.eEleClusterOverPout() );
971  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg_endcaps->Fill( bestGsfElectron.eEleClusterOverPout() );
972  h2_ele_EeleOPoutVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout() );
973  h2_ele_EeleOPoutVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout() );
974  h2_ele_EeleOPoutVsE->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout() );
976  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
977  if (bestGsfElectron.isEB()) h1_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
978  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
979  if (bestGsfElectron.isEE())h1_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
980  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
981  h2_ele_dEtaScVsEta_propVtx->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
982  h2_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
983  h2_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
985  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
986  if (bestGsfElectron.isEB()) h1_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
987  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
988  if (bestGsfElectron.isEE())h1_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
989  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
990  h2_ele_dPhiScVsEta_propVtx->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
991  h2_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
992  h2_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
994  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
995  if (bestGsfElectron.isEB()) h1_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
996  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
997  if (bestGsfElectron.isEE()) h1_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
998  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
999  h2_ele_dEtaClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1000  h2_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1001  h2_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
1003  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1004  if (bestGsfElectron.isEB()) h1_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1005  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1006  if (bestGsfElectron.isEE()) h1_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1007  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1008  h2_ele_dPhiClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1009  h2_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1010  h2_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
1012  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1013  if (bestGsfElectron.isEB()) h1_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1014  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1015  if (bestGsfElectron.isEE()) h1_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1016  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1017  h2_ele_dEtaEleClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1018  h2_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1019  h2_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
1021  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1022  if (bestGsfElectron.isEB()) h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1023  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1024  if (bestGsfElectron.isEE()) h1_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1025  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1026  h2_ele_dPhiEleClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1027  h2_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1028  h2_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
1029  h1_ele_HoE->Fill(bestGsfElectron.hadronicOverEm());
1030  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg->Fill(bestGsfElectron.hadronicOverEm());
1031  if (bestGsfElectron.isEB()) h1_ele_HoE_barrel->Fill(bestGsfElectron.hadronicOverEm());
1032  if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg_barrel->Fill(bestGsfElectron.hadronicOverEm());
1033  if (bestGsfElectron.isEE()) h1_ele_HoE_endcaps->Fill(bestGsfElectron.hadronicOverEm());
1034  if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg_endcaps->Fill(bestGsfElectron.hadronicOverEm());
1035  if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap()&& !bestGsfElectron.isEBEEGap() &&
1036  !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap()) h1_ele_HoE_fiducial->Fill(bestGsfElectron.hadronicOverEm());
1037  h2_ele_HoEVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.hadronicOverEm());
1038  h2_ele_HoEVsPhi->Fill(bestGsfElectron.phi(),bestGsfElectron.hadronicOverEm());
1039  h2_ele_HoEVsE->Fill(bestGsfElectron.caloEnergy(),bestGsfElectron.hadronicOverEm());
1040 
1041  //classes
1042  int eleClass = bestGsfElectron.classification();
1043  if (bestGsfElectron.isEE()) eleClass+=10;
1044  h1_ele_classes->Fill(eleClass);
1045 
1046  if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEB()) h1_scl_EoEtrueGolden_barrel->Fill(sclRef->energy()/mcIter->p());
1047  if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEE()) h1_scl_EoEtrueGolden_endcaps->Fill(sclRef->energy()/mcIter->p());
1048  if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEB()) h1_scl_EoEtrueShowering_barrel->Fill(sclRef->energy()/mcIter->p());
1049  if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEE()) h1_scl_EoEtrueShowering_endcaps->Fill(sclRef->energy()/mcIter->p());
1050 
1051  //eleClass = eleClass%100; // get rid of barrel/endcap distinction
1052  h1_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
1053  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_eta_golden->Fill(std::abs(bestGsfElectron.eta()));
1054  if (bestGsfElectron.classification() == GsfElectron::BIGBREM) h1_ele_eta_bbrem->Fill(std::abs(bestGsfElectron.eta()));
1055  if (bestGsfElectron.classification() == GsfElectron::OLDNARROW) h1_ele_eta_narrow->Fill(std::abs(bestGsfElectron.eta()));
1056  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_eta_shower->Fill(std::abs(bestGsfElectron.eta()));
1057 
1058  //fbrem
1059  double fbrem_mean=0.;
1060  if (!readAOD_) // track extra does not exist in AOD
1061  { fbrem_mean = 1. - bestGsfElectron.gsfTrack()->outerMomentum().R()/bestGsfElectron.gsfTrack()->innerMomentum().R() ; }
1062  double fbrem_mode = bestGsfElectron.fbrem();
1063  h1_ele_fbrem->Fill(fbrem_mode);
1064  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_fbrem_eg->Fill(fbrem_mode);
1065  p1_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(),fbrem_mode);
1066  if (!readAOD_) // track extra does not exist in AOD
1067  { p1_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(),fbrem_mean); }
1068 
1069  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
1070  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
1071  if (!readAOD_) // track extra not available in AOD
1072  {
1073  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
1074  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
1075  }
1076  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
1077  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
1078  if (!readAOD_) // track extra not available in AOD
1079  {
1080  if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
1081  if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
1082  }
1083  h1_ele_mva->Fill(bestGsfElectron.mva());
1084  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_mva_eg->Fill(bestGsfElectron.mva());
1085  if (bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(1.);
1086  if (bestGsfElectron.trackerDrivenSeed()) h1_ele_provenance->Fill(-1.);
1087  if (bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(0.);
1088  if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(-2.);
1089  if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(2.);
1090 
1091  h1_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
1095  h1_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
1099  } // gsf electron found
1100 
1101  } // mc particle found
1102 
1103  }
1104 
1105  } // loop over mc particle
1106 
1107  h1_mcNum->Fill(mcNum) ;
1108  h1_eleNum->Fill(eleNum) ;
1109 
1110  }
1111 
1113  {
1114  if (outputFile_!="")
1115  {
1116  setStoreFolder("EgammaV/ElectronMcSignalValidator") ;
1117 
1118  std::cout << "[ElectronMcSignalValidator] efficiency calculation " << std::endl ;
1119  bookH1andDivide("h_ele_etaEff",h1_ele_simEta_matched,h1_simEta,"#eta","Efficiency","",true);
1120  bookH1andDivide("h_ele_zEff",h1_ele_simZ_matched,h1_simZ,"z (cm)","Efficiency","",true);
1121  bookH1andDivide("h_ele_absetaEff",h1_ele_simAbsEta_matched,h1_simAbsEta,"|#eta|","Efficiency");
1122  bookH1andDivide("h_ele_ptEff",h1_ele_simPt_matched,h1_simPt,"p_{T} (GeV/c)","Efficiency");
1123  bookH1andDivide("h_ele_phiEff",h1_ele_simPhi_matched,h1_simPhi,"#phi (rad)","Efficiency");
1124  bookH2andDivide("h_ele_ptEtaEff",h2_ele_simPtEta_matched,h2_simPtEta,"#eta","p_{T} (GeV/c)");
1125 
1126  std::cout << "[ElectronMcSignalValidator] q-misid calculation " << std::endl;
1127  bookH1andDivide("h_ele_etaQmisid",h1_ele_simEta_matched_qmisid,h1_simEta,"#eta","q misId","",true);
1128  bookH1andDivide("h_ele_zQmisid",h1_ele_simZ_matched_qmisid,h1_simZ,"z (cm)","q misId","",true);
1129  bookH1andDivide("h_ele_absetaQmisid",h1_ele_simAbsEta_matched_qmisid,h1_simAbsEta,"|#eta|","q misId");
1130  bookH1andDivide("h_ele_ptQmisid",h1_ele_simPt_matched_qmisid,h1_simPt,"p_{T} (GeV/c)","q misId");
1131 
1132  std::cout << "[ElectronMcSignalValidator] all reco electrons " << std::endl ;
1133  bookH1andDivide("h_ele_etaEff_all",h1_ele_vertexEta_all,h1_simEta,"#eta","N_{rec}/N_{gen}","",true);
1134  bookH1andDivide("h_ele_ptEff_all",h1_ele_vertexPt_all,h1_simPt,"p_{T} (GeV/c)","N_{rec}/N_{gen}","",true);
1135 
1136  std::cout << "[ElectronMcSignalValidator] classes " << std::endl ;
1137  bookH1andDivide("h_ele_eta_goldenFrac",h1_ele_eta_golden,h1_ele_eta,"|#eta|","Fraction of electrons","fraction of golden electrons vs eta");
1138  bookH1andDivide("h_ele_eta_bbremFrac" ,h1_ele_eta_bbrem ,h1_ele_eta,"|#eta|","Fraction of electrons","fraction of big brem electrons vs eta");
1139  bookH1andDivide("h_ele_eta_narrowFrac",h1_ele_eta_narrow,h1_ele_eta,"|#eta|","Fraction of electrons","fraction of narrow electrons vs eta");
1140  bookH1andDivide("h_ele_eta_showerFrac",h1_ele_eta_shower,h1_ele_eta,"|#eta|","Fraction of electrons","fraction of showering electrons vs eta");
1141 
1142  // fbrem
1143  MonitorElement * h1_ele_xOverX0VsEta = bookH1withSumw2("h_ele_xOverx0VsEta","mean X/X_0 vs eta",eta_nbin/2,0.0,2.5);
1144  for (int ibin=1;ibin<p1_ele_fbremVsEta_mean->getNbinsX()+1;ibin++) {
1145  double xOverX0 = 0.;
1146  if (p1_ele_fbremVsEta_mean->getBinContent(ibin)>0.)
1147  { xOverX0 = -log(p1_ele_fbremVsEta_mean->getBinContent(ibin)) ; }
1148  h1_ele_xOverX0VsEta->setBinContent(ibin,xOverX0) ;
1149  }
1150 
1151  // profiles from 2D histos
1152  profileX("h_ele_PoPtrueVsEta_pfx",h2_ele_PoPtrueVsEta,"mean ele momentum / gen momentum vs eta","#eta","<P/P_{gen}>");
1153  profileX("h_ele_PoPtrueVsPhi_pfx",h2_ele_PoPtrueVsPhi,"mean ele momentum / gen momentum vs phi","#phi (rad)","<P/P_{gen}>");
1154  profileX("h_scl_EoEtruePfVsEg_pfx",h2_scl_EoEtruePfVsEg,"mean pflow sc energy / true energy vs e/g sc energy","E/E_{gen} (e/g)","<E/E_{gen}> (pflow)") ;
1155  profileY("h_scl_EoEtruePfVsEg_pfy",h2_scl_EoEtruePfVsEg,"mean e/g sc energy / true energy vs pflow sc energy","E/E_{gen} (pflow)","<E/E_{gen}> (eg)") ;
1156  profileX("h_ele_EtaMnEtaTrueVsEta_pfx",h2_ele_EtaMnEtaTrueVsEta,"mean ele eta - gen eta vs eta","#eta","<#eta_{rec} - #eta_{gen}>");
1157  profileX("h_ele_EtaMnEtaTrueVsPhi_pfx",h2_ele_EtaMnEtaTrueVsPhi,"mean ele eta - gen eta vs phi","#phi (rad)","<#eta_{rec} - #eta_{gen}>");
1158  profileX("h_ele_PhiMnPhiTrueVsEta_pfx",h2_ele_PhiMnPhiTrueVsEta,"mean ele phi - gen phi vs eta","#eta","<#phi_{rec} - #phi_{gen}> (rad)");
1159  profileX("h_ele_PhiMnPhiTrueVsPhi_pfx",h2_ele_PhiMnPhiTrueVsPhi,"mean ele phi - gen phi vs phi","#phi (rad)","");
1160  profileX("h_ele_vertexPtVsEta_pfx",h2_ele_vertexPtVsEta,"mean ele transverse momentum vs eta","#eta","<p_{T}> (GeV/c)");
1161  profileX("h_ele_vertexPtVsPhi_pfx",h2_ele_vertexPtVsPhi,"mean ele transverse momentum vs phi","#phi (rad)","<p_{T}> (GeV/c)");
1162  profileX("h_ele_EoPVsEta_pfx",h2_ele_EoPVsEta,"mean ele E/p vs eta","#eta","<E/P_{vertex}>");
1163  profileX("h_ele_EoPVsPhi_pfx",h2_ele_EoPVsPhi,"mean ele E/p vs phi","#phi (rad)","<E/P_{vertex}>");
1164  profileX("h_ele_EoPoutVsEta_pfx",h2_ele_EoPoutVsEta,"mean ele E/pout vs eta","#eta","<E_{seed}/P_{out}>");
1165  profileX("h_ele_EoPoutVsPhi_pfx",h2_ele_EoPoutVsPhi,"mean ele E/pout vs phi","#phi (rad)","<E_{seed}/P_{out}>");
1166  profileX("h_ele_EeleOPoutVsEta_pfx",h2_ele_EeleOPoutVsEta,"mean ele Eele/pout vs eta","#eta","<E_{ele}/P_{out}>");
1167  profileX("h_ele_EeleOPoutVsPhi_pfx",h2_ele_EeleOPoutVsPhi,"mean ele Eele/pout vs phi","#phi (rad)","<E_{ele}/P_{out}>");
1168  profileX("h_ele_HoEVsEta_pfx",h2_ele_HoEVsEta,"mean ele H/E vs eta","#eta","<H/E>");
1169  profileX("h_ele_HoEVsPhi_pfx",h2_ele_HoEVsPhi,"mean ele H/E vs phi","#phi (rad)","<H/E>");
1170  profileX("h_ele_chi2VsEta_pfx",h2_ele_chi2VsEta,"mean ele track chi2 vs eta","#eta","<#Chi^{2}>");
1171  profileX("h_ele_chi2VsPhi_pfx",h2_ele_chi2VsPhi,"mean ele track chi2 vs phi","#phi (rad)","<#Chi^{2}>");
1172  profileX("h_ele_foundHitsVsEta_pfx",h2_ele_foundHitsVsEta,"mean ele track # found hits vs eta","#eta","<N_{hits}>");
1173  profileX("h_ele_foundHitsVsPhi_pfx",h2_ele_foundHitsVsPhi,"mean ele track # found hits vs phi","#phi (rad)","<N_{hits}>");
1174  profileX("h_ele_lostHitsVsEta_pfx",h2_ele_lostHitsVsEta,"mean ele track # lost hits vs eta","#eta","<N_{hits}>");
1175  profileX("h_ele_lostHitsVsPhi_pfx",h2_ele_lostHitsVsPhi,"mean ele track # lost hits vs phi","#phi (rad)","<N_{hits}>");
1176  profileX("h_ele_vertexTIPVsEta_pfx",h2_ele_vertexTIPVsEta,"mean tip (wrt gen vtx) vs eta","#eta","<TIP> (cm)");
1177  profileX("h_ele_vertexTIPVsPhi_pfx",h2_ele_vertexTIPVsPhi,"mean tip (wrt gen vtx) vs phi","#phi","<TIP> (cm)");
1178  profileX("h_ele_vertexTIPVsPt_pfx",h2_ele_vertexTIPVsPt,"mean tip (wrt gen vtx) vs phi","p_{T} (GeV/c)","<TIP> (cm)");
1179  profileX("h_ele_seedDphi2VsEta_pfx",h2_ele_seed_dphi2VsEta_,"mean ele seed dphi 2nd layer vs eta","#eta","<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",-0.004,0.004);
1180  profileX("h_ele_seedDphi2VsPt_pfx",h2_ele_seed_dphi2VsPt_,"mean ele seed dphi 2nd layer vs pt","p_{T} (GeV/c)","<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)",-0.004,0.004);
1181  profileX("h_ele_seedDrz2VsEta_pfx",h2_ele_seed_drz2VsEta_,"mean ele seed dr(dz) 2nd layer vs eta","#eta","<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",-0.15,0.15);
1182  profileX("h_ele_seedDrz2VsPt_pfx",h2_ele_seed_drz2VsPt_,"mean ele seed dr(dz) 2nd layer vs pt","p_{T} (GeV/c)","<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)",-0.15,0.15);
1183 
1185  }
1186  }
1187 
1188 
MonitorElement * h1_scl_EoEtrue_endcaps_ringgap
MonitorElement * h1_ele_dPhiCl_propOut_eg_barrel
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
virtual double p() const
magnitude of momentum vector
void setBinContent(int binx, double content)
set content of bin (1-D)
float scSigmaEtaEta() const
Definition: GsfElectron.h:388
bool isEBEtaGap() const
Definition: GsfElectron.h:339
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth2
float eSuperClusterOverP() const
Definition: GsfElectron.h:201
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
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")
MonitorElement * h1_scl_EoEtrue_endcaps_new_eg
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="")
bool isEBEEGap() const
Definition: GsfElectron.h:337
float dr04HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:432
MonitorElement * h1_scl_SigIEtaIEta_eg_endcaps_
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
virtual const Point & vertex() const
vertex position
MonitorElement * h1_ele_dPhiEleCl_propOut_endcaps
T perp() const
Magnitude of transverse component.
MonitorElement * h2_ele_dEtaEleClVsEta_propOut
MonitorElement * h1_ele_simEta_matched_qmisid
MonitorElement * h1_ele_dEtaSc_propVtx_endcaps
MonitorElement * h1_ele_dEtaSc_propVtx_all_endcaps
MonitorElement * profileX(const std::string &name, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
MonitorElement * h1_ele_dPhiCl_propOut_all_endcaps
#define abs(x)
Definition: mlp_lapack.h:159
float dr04TkSumPt() const
Definition: GsfElectron.h:430
bool isEERingGap() const
Definition: GsfElectron.h:343
MonitorElement * h1_ele_dEtaCl_propOut_eg_barrel
MonitorElement * h2_ele_PtinVsPtoutShowering_mode
MonitorElement * h1_ele_PoPtrue_showering_barrel
MonitorElement * h1_ele_simPt_matched_qmisid
float dr03HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:425
float fbrem() const
Definition: GsfElectron.h:528
SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:166
float scE2x5Max() const
Definition: GsfElectron.h:391
bool isEEDeeGap() const
Definition: GsfElectron.h:342
virtual double eta() const
momentum pseudorapidity
MonitorElement * h2_ele_dPhiEleClVsPhi_propOut
bool isEE() const
Definition: GsfElectron.h:335
bool isEB() const
Definition: GsfElectron.h:334
MonitorElement * h2_ele_PtinVsPtoutGolden_mean
MonitorElement * h2_ele_dEtaEleClVsPhi_propOut
MonitorElement * h1_ele_dPhiSc_propVtx_all_endcaps
void Fill(long long x)
MonitorElement * h1_ele_hcalTowerSumEt_dr03_depth1
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth2
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
float dr04HcalDepth2TowerSumEt() const
Definition: GsfElectron.h:433
MonitorElement * h1_ele_PoPtrue_showering_endcaps
MonitorElement * h2_ele_PtinVsPtoutGolden_mode
float mva() const
Definition: GsfElectron.h:500
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:205
int iEvent
Definition: GenABIO.cc:243
MonitorElement * h1_ele_dEtaEleCl_propOut_endcaps
bool isNull() const
Checks for null.
Definition: Ref.h:244
void saveStore(const std::string &filename)
float hadronicOverEm() const
Definition: GsfElectron.h:393
float eSeedClusterOverP() const
Definition: GsfElectron.h:202
MonitorElement * h1_ele_dPhiSc_propVtx_endcaps
float dr04EcalRecHitSumEt() const
Definition: GsfElectron.h:431
MonitorElement * h1_ele_dEtaSc_propVtx_eg_endcaps
math::XYZVector trackMomentumOut() const
Definition: GsfElectron.h:246
math::XYZVector trackMomentumAtVtx() const
Definition: GsfElectron.h:244
float deltaPhiSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:209
T sqrt(T t)
Definition: SSEVec.h:28
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:208
MonitorElement * h1_ele_dPhiSc_propVtx_eg_barrel
MonitorElement * h2_ele_dPhiEleClVsEta_propOut
virtual int charge() const
electric charge
float dr03TkSumPt() const
Definition: GsfElectron.h:422
MonitorElement * h1_scl_EoEtrueShowering_endcaps
float dr03HcalDepth1TowerSumEt() const
Definition: GsfElectron.h:424
float eEleClusterOverPout() const
Definition: GsfElectron.h:204
MonitorElement * h1_ele_dEtaSc_propVtx_all_barrel
float eSeedClusterOverPout() const
Definition: GsfElectron.h:203
MonitorElement * h1_ele_dPhiSc_propVtx_eg_endcaps
float scSigmaIEtaIEta() const
Definition: GsfElectron.h:389
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
MonitorElement * h1_ele_hcalTowerSumEt_dr04_depth1
float deltaPhiEleClusterTrackAtCalo() const
Definition: GsfElectron.h:210
MonitorElement * h1_ele_dPhiSc_propVtx_all_barrel
tuple conf
Definition: dbtoconf.py:185
MonitorElement * h1_ele_dEtaCl_propOut_eg_endcaps
MonitorElement * h1_scl_EoEtrueShowering_barrel
MonitorElement * profileY(const std::string &name, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
virtual int pdgId() const =0
PDG identifier.
MonitorElement * h1_ele_simAbsEta_matched_qmisid
GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:167
MonitorElement * h1_ele_dPhiEleCl_propOut_barrel
MonitorElement * h1_scl_EoEtrue_barrel_new_etagap
MonitorElement * h1_ele_dPhiEleCl_propOut_eg_barrel
Log< T >::type log(const T &t)
Definition: Log.h:22
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="")
float deltaEtaEleClusterTrackAtCalo() const
Definition: GsfElectron.h:207
virtual double pt() const
transverse momentum
Classification classification() const
Definition: GsfElectron.h:530
REF castTo() const
cast to a concrete type
Definition: RefToBase.h:236
GsfTrackRefVector::size_type ambiguousGsfTracksSize() const
Definition: GsfElectron.h:295
MonitorElement * h1_ele_dEtaCl_propOut_endcaps
ElectronMcSignalValidator(const edm::ParameterSet &conf)
MonitorElement * h2_ele_PinVsPoutShowering_mean
T const * product() const
Definition: Handle.h:74
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:423
MonitorElement * h1_ele_dPhiCl_propOut_all_barrel
MonitorElement * h1_ele_dEtaCl_propOut_all_barrel
MonitorElement * h1_ele_dEtaEleCl_propOut_eg_barrel
double getBinContent(int binx) const
get content of bin (1-D)
edm::EventID id() const
Definition: EventBase.h:56
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:206
MonitorElement * h1_ele_dEtaEleCl_propOut_eg_endcaps
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")
void setStoreFolder(const std::string &path)
bool isEBPhiGap() const
Definition: GsfElectron.h:340
MonitorElement * h1_scl_EoEtrue_endcaps_new_deegap
MonitorElement * bookH1andDivide(const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="", bool print=false)
int getNbinsX(void) const
get # of bins in X-axis
bool trackerDrivenSeed() const
Definition: GsfElectron.h:169
MonitorElement * h2_ele_PinVsPoutShowering_mode
MonitorElement * bookH2andDivide(const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="", bool print=false)
tuple cout
Definition: gather_cfg.py:41
MonitorElement * h1_ele_dEtaCl_propOut_all_endcaps
float scE5x5() const
Definition: GsfElectron.h:392
double pi
MonitorElement * h1_scl_SigIEtaIEta_eg_barrel_
MonitorElement * h1_ele_dPhiEleCl_propOut_eg_endcaps
float caloEnergy() const
Definition: GsfElectron.h:595
virtual double phi() const
momentum azimuthal angle
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
SuperClusterRef pflowSuperCluster() const
Definition: GsfElectron.h:170
MonitorElement * h1_ele_dEtaSc_propVtx_eg_barrel
MonitorElement * h1_ele_dPhiCl_propOut_endcaps
virtual double py() const
y coordinate of momentum vector
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:390
MonitorElement * h1_ele_simPhi_matched_qmisid
MonitorElement * h1_ele_dPhiCl_propOut_eg_endcaps
bool ecalDrivenSeed() const
Definition: GsfElectron.h:168
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="")