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