CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/RecoEgamma/Examples/plugins/GsfElectronMCAnalyzer.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    RecoEgamma/Examples
00004 // Class:      GsfElectronMCAnalyzer
00005 //
00013 //
00014 // Original Author:  Ursula Berthon
00015 //         Created:  Mon Mar 27 13:22:06 CEST 2006
00016 // $Id: GsfElectronMCAnalyzer.cc,v 1.51 2011/03/04 14:43:15 chamont Exp $
00017 //
00018 //
00019 
00020 // user include files
00021 #include "RecoEgamma/Examples/plugins/GsfElectronMCAnalyzer.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023 #include "FWCore/Framework/interface/EDAnalyzer.h"
00024 #include "FWCore/Framework/interface/Event.h"
00025 #include "FWCore/Framework/interface/MakerMacros.h"
00026 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00027 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
00028 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
00029 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00030 #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
00031 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00032 #include "DataFormats/EgammaReco/interface/ElectronSeed.h"
00033 #include "DataFormats/EgammaReco/interface/ElectronSeedFwd.h"
00034 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00035 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00036 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
00037 
00038 #include "CLHEP/Units/GlobalPhysicalConstants.h"
00039 #include <iostream>
00040 #include <vector>
00041 #include "TMath.h"
00042 #include "TFile.h"
00043 #include "TH1F.h"
00044 #include "TH1I.h"
00045 #include "TH2F.h"
00046 #include "TProfile.h"
00047 #include "TTree.h"
00048 #include <iostream>
00049 
00050 using namespace reco;
00051 
00052 GsfElectronMCAnalyzer::GsfElectronMCAnalyzer(const edm::ParameterSet& conf)
00053  {
00054   outputFile_ = conf.getParameter<std::string>("outputFile");
00055   histfile_ = new TFile(outputFile_.c_str(),"RECREATE");
00056   electronCollection_=conf.getParameter<edm::InputTag>("electronCollection");
00057   mcTruthCollection_ = conf.getParameter<edm::InputTag>("mcTruthCollection");
00058   readAOD_ = conf.getParameter<bool>("readAOD");
00059   maxPt_ = conf.getParameter<double>("MaxPt");
00060   maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
00061   deltaR_ = conf.getParameter<double>("DeltaR");
00062   matchingIDs_ = conf.getParameter<std::vector<int> >("MatchingID");
00063   matchingMotherIDs_ = conf.getParameter<std::vector<int> >("MatchingMotherID");
00064   edm::ParameterSet pset =
00065    conf.getParameter<edm::ParameterSet>("HistosConfigurationMC") ;
00066 
00067   etamin=pset.getParameter<double>("Etamin");
00068   etamax=pset.getParameter<double>("Etamax");
00069   phimin=pset.getParameter<double>("Phimin");
00070   phimax=pset.getParameter<double>("Phimax");
00071   ptmax=pset.getParameter<double>("Ptmax");
00072   pmax=pset.getParameter<double>("Pmax");
00073   eopmax=pset.getParameter<double>("Eopmax");
00074   eopmaxsht=pset.getParameter<double>("Eopmaxsht");
00075   detamin=pset.getParameter<double>("Detamin");
00076   detamax=pset.getParameter<double>("Detamax");
00077   dphimin=pset.getParameter<double>("Dphimin");
00078   dphimax=pset.getParameter<double>("Dphimax");
00079   detamatchmin=pset.getParameter<double>("Detamatchmin");
00080   detamatchmax=pset.getParameter<double>("Detamatchmax");
00081   dphimatchmin=pset.getParameter<double>("Dphimatchmin");
00082   dphimatchmax=pset.getParameter<double>("Dphimatchmax");
00083   fhitsmax=pset.getParameter<double>("Fhitsmax");
00084   lhitsmax=pset.getParameter<double>("Lhitsmax");
00085   nbineta=pset.getParameter<int>("Nbineta");
00086   nbineta2D=pset.getParameter<int>("Nbineta2D");
00087   nbinp=pset.getParameter<int>("Nbinp");
00088   nbinpt=pset.getParameter<int>("Nbinpt");
00089   nbinp2D=pset.getParameter<int>("Nbinp2D");
00090   nbinpt2D=pset.getParameter<int>("Nbinpt2D");
00091   nbinpteff=pset.getParameter<int>("Nbinpteff");
00092   nbinphi=pset.getParameter<int>("Nbinphi");
00093   nbinphi2D=pset.getParameter<int>("Nbinphi2D");
00094   nbineop=pset.getParameter<int>("Nbineop");
00095   nbineop2D=pset.getParameter<int>("Nbineop2D");
00096   nbinfhits=pset.getParameter<int>("Nbinfhits");
00097   nbinlhits=pset.getParameter<int>("Nbinlhits");
00098   nbinxyz=pset.getParameter<int>("Nbinxyz");
00099   nbindeta=pset.getParameter<int>("Nbindeta");
00100   nbindphi=pset.getParameter<int>("Nbindphi");
00101   nbindetamatch=pset.getParameter<int>("Nbindetamatch");
00102   nbindphimatch=pset.getParameter<int>("Nbindphimatch");
00103   nbindetamatch2D=pset.getParameter<int>("Nbindetamatch2D");
00104   nbindphimatch2D=pset.getParameter<int>("Nbindphimatch2D");
00105   nbinpoptrue= pset.getParameter<int>("Nbinpoptrue");
00106   poptruemin=pset.getParameter<double>("Poptruemin");
00107   poptruemax=pset.getParameter<double>("Poptruemax");
00108   nbinmee= pset.getParameter<int>("Nbinmee");
00109   meemin=pset.getParameter<double>("Meemin");
00110   meemax=pset.getParameter<double>("Meemax");
00111   nbinhoe= pset.getParameter<int>("Nbinhoe");
00112   hoemin=pset.getParameter<double>("Hoemin");
00113   hoemax=pset.getParameter<double>("Hoemax");
00114  }
00115 
00116 void GsfElectronMCAnalyzer::beginJob(){
00117 
00118   histfile_->cd();
00119 
00120   // mc truth
00121   h_mcNum              = new TH1F( "h_mcNum",              "# mc particles",    nbinfhits,0.,fhitsmax );
00122   h_mcNum->Sumw2();
00123   h_eleNum             = new TH1F( "h_mcNum_ele",             "# mc electrons",             nbinfhits,0.,fhitsmax);
00124   h_eleNum->Sumw2();
00125   h_gamNum             = new TH1F( "h_mcNum_gam",             "# mc gammas",             nbinfhits,0.,fhitsmax);
00126   h_gamNum->Sumw2();
00127 
00128   // rec event
00129   histNum_= new TH1F("h_recEleNum","# rec electrons",20, 0.,20.);
00130 
00131   // mc
00132   h_simEta             = new TH1F( "h_mc_eta",             "gen #eta",           nbineta,etamin,etamax);
00133   h_simEta->Sumw2();
00134   h_simAbsEta             = new TH1F( "h_mc_abseta",             "gen |#eta|",           nbineta/2,0.,etamax);
00135   h_simAbsEta->Sumw2();
00136   h_simP               = new TH1F( "h_mc_P",               "gen p",              nbinp,0.,pmax);
00137   h_simP->Sumw2();
00138   h_simPt               = new TH1F( "h_mc_Pt",               "gen pt",            nbinpteff,5.,ptmax);
00139   h_simPt->Sumw2();
00140   h_simPhi               = new TH1F( "h_mc_phi",               "gen phi",        nbinphi,phimin,phimax);
00141   h_simPhi->Sumw2();
00142   h_simZ      = new TH1F( "h_mc_z",      "gen z ",    nbinxyz, -25, 25 );
00143   h_simZ->Sumw2();
00144   h_simPtEta           = new TH2F( "h_mc_pteta",   "gen pt vs #eta", nbineta2D,etamin,etamax, nbinpt2D,5.,ptmax );
00145   h_simPtEta->Sumw2();
00146 
00147   // all electrons
00148   h_ele_EoverP_all       = new TH1F( "h_ele_EoverP_all",       "ele E/P_{vertex}, all reco electrons",  nbineop,0.,eopmax);
00149   h_ele_EoverP_all->Sumw2();
00150   h_ele_EoverP_all_barrel       = new TH1F( "h_ele_EoverP_all_barrel",       "ele E/P_{vertex}, all reco electrons, barrel",  nbineop,0.,eopmax);
00151   h_ele_EoverP_all_barrel->Sumw2();
00152   h_ele_EoverP_all_endcaps       = new TH1F( "h_ele_EoverP_all_endcaps",       "ele E/P_{vertex}, all reco electrons, endcaps",  nbineop,0.,eopmax);
00153   h_ele_EoverP_all_endcaps->Sumw2();
00154   h_ele_EseedOP_all            = new TH1F( "h_ele_EseedOP_all",            "ele E_{seed}/P_{vertex}, all reco electrons",        nbineop,0.,eopmax);
00155   h_ele_EseedOP_all->Sumw2();
00156   h_ele_EseedOP_all_barrel            = new TH1F( "h_ele_EseedOP_all_barrel",            "ele E_{seed}/P_{vertex}, all reco electrons, barrel",        nbineop,0.,eopmax);
00157   h_ele_EseedOP_all_barrel->Sumw2();
00158   h_ele_EseedOP_all_endcaps            = new TH1F( "h_ele_EseedOP_all_endcaps",            "ele E_{seed}/P_{vertex}, all reco electrons, endcaps",        nbineop,0.,eopmax);
00159   h_ele_EseedOP_all_endcaps->Sumw2();
00160   h_ele_EoPout_all         = new TH1F( "h_ele_EoPout_all",         "ele E_{seed}/P_{out}, all reco electrons",           nbineop,0.,eopmax);
00161   h_ele_EoPout_all->Sumw2();
00162   h_ele_EoPout_all_barrel         = new TH1F( "h_ele_EoPout_all_barrel",         "ele E_{seed}/P_{out}, all reco electrons barrel",           nbineop,0.,eopmax);
00163   h_ele_EoPout_all_barrel->Sumw2();
00164   h_ele_EoPout_all_endcaps         = new TH1F( "h_ele_EoPout_all_endcaps",         "ele E_{seed}/P_{out}, all reco electrons endcaps",           nbineop,0.,eopmax);
00165   h_ele_EoPout_all_endcaps->Sumw2();
00166   h_ele_EeleOPout_all         = new TH1F( "h_ele_EeleOPout_all",         "ele E_{ele}/P_{out}, all reco electrons",           nbineop,0.,eopmax);
00167   h_ele_EeleOPout_all->Sumw2();
00168   h_ele_EeleOPout_all_barrel         = new TH1F( "h_ele_EeleOPout_all_barrel",         "ele E_{ele}/P_{out}, all reco electrons barrel",           nbineop,0.,eopmax);
00169   h_ele_EeleOPout_all_barrel->Sumw2();
00170   h_ele_EeleOPout_all_endcaps         = new TH1F( "h_ele_EeleOPout_all_endcaps",         "ele E_{ele}/P_{out}, all reco electrons endcaps",           nbineop,0.,eopmax);
00171   h_ele_EeleOPout_all_endcaps->Sumw2();
00172   h_ele_dEtaSc_propVtx_all = new TH1F( "h_ele_dEtaSc_propVtx_all", "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",      nbindetamatch,detamatchmin,detamatchmax);
00173   h_ele_dEtaSc_propVtx_all->Sumw2();
00174   h_ele_dEtaSc_propVtx_all_barrel = new TH1F( "h_ele_dEtaSc_propVtx_all_barrel", "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons barrel",      nbindetamatch,detamatchmin,detamatchmax);
00175   h_ele_dEtaSc_propVtx_all_barrel->Sumw2();
00176   h_ele_dEtaSc_propVtx_all_endcaps = new TH1F( "h_ele_dEtaSc_propVtx_all_endcaps", "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons endcaps",      nbindetamatch,detamatchmin,detamatchmax);
00177   h_ele_dEtaSc_propVtx_all_endcaps->Sumw2();
00178   h_ele_dPhiSc_propVtx_all = new TH1F( "h_ele_dPhiSc_propVtx_all", "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons",      nbindphimatch,dphimatchmin,dphimatchmax);
00179   h_ele_dPhiSc_propVtx_all->Sumw2();
00180   h_ele_dPhiSc_propVtx_all_barrel = new TH1F( "h_ele_dPhiSc_propVtx_all_barrel", "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons barrel",      nbindphimatch,dphimatchmin,dphimatchmax);
00181   h_ele_dPhiSc_propVtx_all_barrel->Sumw2();
00182   h_ele_dPhiSc_propVtx_all_endcaps = new TH1F( "h_ele_dPhiSc_propVtx_all_endcaps", "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons endcaps",      nbindphimatch,dphimatchmin,dphimatchmax);
00183   h_ele_dPhiSc_propVtx_all_endcaps->Sumw2();
00184   h_ele_dEtaCl_propOut_all = new TH1F( "h_ele_dEtaCl_propOut_all", "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",   nbindetamatch,detamatchmin,detamatchmax);
00185   h_ele_dEtaCl_propOut_all->Sumw2();
00186   h_ele_dEtaCl_propOut_all_barrel = new TH1F( "h_ele_dEtaCl_propOut_all_barrel", "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons barrel",   nbindetamatch,detamatchmin,detamatchmax);
00187   h_ele_dEtaCl_propOut_all_barrel->Sumw2();
00188   h_ele_dEtaCl_propOut_all_endcaps = new TH1F( "h_ele_dEtaCl_propOut_all_endcaps", "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons endcaps",   nbindetamatch,detamatchmin,detamatchmax);
00189   h_ele_dEtaCl_propOut_all_endcaps->Sumw2();
00190   h_ele_dPhiCl_propOut_all = new TH1F( "h_ele_dPhiCl_propOut_all", "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons",   nbindphimatch,dphimatchmin,dphimatchmax);
00191   h_ele_dPhiCl_propOut_all->Sumw2();
00192   h_ele_dPhiCl_propOut_all_barrel = new TH1F( "h_ele_dPhiCl_propOut_all_barrel", "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons barrel",   nbindphimatch,dphimatchmin,dphimatchmax);
00193   h_ele_dPhiCl_propOut_all_endcaps = new TH1F( "h_ele_dPhiCl_propOut_all_endcaps", "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons endcaps",   nbindphimatch,dphimatchmin,dphimatchmax);
00194   h_ele_dPhiCl_propOut_all_barrel->Sumw2();
00195   h_ele_dPhiCl_propOut_all_endcaps->Sumw2();
00196   h_ele_HoE_all = new TH1F("h_ele_HoE_all", "ele hadronic energy / em energy, all reco electrons", nbinhoe, hoemin, hoemax) ;
00197   h_ele_HoE_all->Sumw2();
00198   h_ele_HoE_all_barrel = new TH1F("h_ele_HoE_all_barrel", "ele hadronic energy / em energy, all reco electrons barrel", nbinhoe, hoemin, hoemax) ;
00199   h_ele_HoE_all_barrel->Sumw2();
00200   h_ele_HoE_all_endcaps = new TH1F("h_ele_HoE_all_endcaps", "ele hadronic energy / em energy, all reco electrons endcaps", nbinhoe, hoemin, hoemax) ;
00201   h_ele_HoE_all_endcaps->Sumw2();
00202   h_ele_vertexPt_all       = new TH1F( "h_ele_vertexPt_all",       "ele p_{T}, all reco electrons",  nbinpteff,5.,ptmax);
00203   h_ele_vertexPt_all->Sumw2();
00204   h_ele_Et_all       = new TH1F( "h_ele_Et_all",       "ele SC E_{T}, all reco electrons",  nbinpteff,5.,ptmax);
00205   h_ele_Et_all->Sumw2();
00206   h_ele_vertexEta_all      = new TH1F( "h_ele_vertexEta_all",      "ele eta, all reco electrons",    nbineta,etamin,etamax);
00207   h_ele_vertexEta_all->Sumw2();
00208   h_ele_TIP_all       = new TH1F( "h_ele_TIP_all",       "ele vertex transverse radius, all reco electrons",  100,0.,0.2);
00209   h_ele_TIP_all->Sumw2();
00210   h_ele_TIP_all_barrel       = new TH1F( "h_ele_TIP_all_barrel",       "ele vertex transverse radius, all reco electrons barrel",  100,0.,0.2);
00211   h_ele_TIP_all_barrel->Sumw2();
00212   h_ele_TIP_all_endcaps       = new TH1F( "h_ele_TIP_all_endcaps",       "ele vertex transverse radius, all reco electrons endcaps",  100,0.,0.2);
00213   h_ele_TIP_all_endcaps->Sumw2();
00214   h_ele_mee_all      = new TH1F( "h_ele_mee_all", "ele pairs invariant mass, all reco electrons", nbinmee, meemin, meemax );
00215   h_ele_mee_all->Sumw2();
00216   h_ele_mee_os      = new TH1F( "h_ele_mee_os", "ele pairs invariant mass, opp. sign", nbinmee, meemin, meemax );
00217   h_ele_mee_os->Sumw2();
00218   h_ele_mee_os_ebeb      = new TH1F( "h_ele_mee_os_ebeb", "ele pairs invariant mass, opp. sign, EB-EB", nbinmee, meemin, meemax );
00219   h_ele_mee_os_ebeb->Sumw2();
00220   h_ele_mee_os_ebee      = new TH1F( "h_ele_mee_os_ebee", "ele pairs invariant mass, opp. sign, EB-EE", nbinmee, meemin, meemax );
00221   h_ele_mee_os_ebee->Sumw2();
00222   h_ele_mee_os_eeee      = new TH1F( "h_ele_mee_os_eeee", "ele pairs invariant mass, opp. sign, EE-EE", nbinmee, meemin, meemax );
00223   h_ele_mee_os_eeee->Sumw2();
00224   h_ele_mee_os_gg      = new TH1F( "h_ele_mee_os_gg", "ele pairs invariant mass, opp. sign, good-good", nbinmee, meemin, meemax );
00225   h_ele_mee_os_gg->Sumw2();
00226   h_ele_mee_os_gb      = new TH1F( "h_ele_mee_os_gb", "ele pairs invariant mass, opp. sign, good-bad", nbinmee, meemin, meemax );
00227   h_ele_mee_os_gb->Sumw2();
00228   h_ele_mee_os_bb      = new TH1F( "h_ele_mee_os_bb", "ele pairs invariant mass, opp. sign, bad-bad", nbinmee, meemin, meemax );
00229   h_ele_mee_os_bb->Sumw2();
00230 
00231   // duplicates
00232   h_ele_E2mnE1vsMee_all = new TH2F("h_ele_E2mnE1vsMee_all", "E2 - E1 vs ele pairs invariant mass, all electrons", nbinmee, meemin, meemax, 100, -50., 50. );
00233   h_ele_E2mnE1vsMee_egeg_all = new TH2F("h_ele_E2mnE1vsMee_egeg_all", "E2 - E1 vs ele pairs invariant mass, ecal driven pairs, all electrons", nbinmee, meemin, meemax, 100, -50., 50. );
00234 
00235   // charge ID
00236   h_ele_ChargeMnChargeTrue   = new TH1F( "h_ele_ChargeMnChargeTrue",   "ele charge - gen charge ",5,-1.,4.);
00237   h_ele_ChargeMnChargeTrue->Sumw2();
00238   h_ele_simEta_matched_qmisid             = new TH1F( "h_ele_eta_matched_qmisid","charge misid vs gen eta", nbineta,etamin,etamax);
00239   h_ele_simEta_matched_qmisid->Sumw2();
00240   h_ele_simAbsEta_matched_qmisid             = new TH1F( "h_ele_abseta_matched_qmisid", "charge misid vs gen |eta|", nbineta/2,0.,etamax);
00241   h_ele_simAbsEta_matched_qmisid->Sumw2();
00242   h_ele_simPt_matched_qmisid               = new TH1F( "h_ele_Pt_matched_qmisid", "charge misid vs gen transverse momentum", nbinpteff,5.,ptmax);
00243   h_ele_simPt_matched_qmisid->Sumw2();
00244   h_ele_simPhi_matched_qmisid               = new TH1F( "h_ele_phi_matched_qmisid","charge misid vs gen phi", nbinphi,phimin,phimax);
00245   h_ele_simPhi_matched_qmisid->Sumw2();
00246   h_ele_simZ_matched_qmisid      = new TH1F( "h_ele_z_matched_qmisid","charge misid vs gen z",nbinxyz, -25, 25 );
00247   h_ele_simZ_matched_qmisid->Sumw2();
00248 
00249   // matched electrons
00250   h_ele_charge         = new TH1F( "h_ele_charge",         "ele charge",             5,-2.,2.);
00251   h_ele_charge->Sumw2();
00252   h_ele_chargeVsEta    = new TH2F( "h_ele_chargeVsEta",         "ele charge vs eta", nbineta2D,etamin,etamax,5,-2.,2.);
00253   h_ele_chargeVsPhi    = new TH2F( "h_ele_chargeVsPhi",         "ele charge vs phi", nbinphi2D,phimin,phimax,5,-2.,2.);
00254   h_ele_chargeVsPt    = new TH2F( "h_ele_chargeVsPt",         "ele charge vs pt", nbinpt,0.,100.,5,-2.,2.);
00255   h_ele_vertexP        = new TH1F( "h_ele_vertexP",        "ele momentum",       nbinp,0.,pmax);
00256   h_ele_vertexP->Sumw2();
00257   h_ele_vertexPt       = new TH1F( "h_ele_vertexPt",       "ele transverse momentum",  nbinpt,0.,ptmax);
00258   h_ele_vertexPt->Sumw2();
00259   h_ele_Et       = new TH1F( "h_ele_Et",       "ele transverse energy",  nbinpt,0.,ptmax);
00260   h_ele_Et->Sumw2();
00261   h_ele_vertexPtVsEta   = new TH2F( "h_ele_vertexPtVsEta",       "ele transverse momentum vs eta",nbineta2D,etamin,etamax,nbinpt2D,0.,ptmax);
00262   h_ele_vertexPtVsPhi   = new TH2F( "h_ele_vertexPtVsPhi",       "ele transverse momentum vs phi",nbinphi2D,phimin,phimax,nbinpt2D,0.,ptmax);
00263   h_ele_simPt_matched       = new TH1F( "h_ele_simPt_matched",       "Efficiency vs gen transverse momentum",  nbinpteff,5.,ptmax);
00264   h_ele_vertexEta      = new TH1F( "h_ele_vertexEta",      "ele momentum eta",    nbineta,etamin,etamax);
00265   h_ele_vertexEta->Sumw2();
00266   h_ele_vertexEtaVsPhi  = new TH2F( "h_ele_vertexEtaVsPhi",      "ele momentum eta vs phi",nbineta2D,etamin,etamax,nbinphi2D,phimin,phimax );
00267   h_ele_simAbsEta_matched      = new TH1F( "h_ele_simAbsEta_matched",      "Efficiency vs gen |eta|",    nbineta/2,0.,2.5);
00268   h_ele_simAbsEta_matched->Sumw2();
00269   h_ele_simEta_matched      = new TH1F( "h_ele_simEta_matched",      "Efficiency vs gen eta",    nbineta,etamin,etamax);
00270   h_ele_simEta_matched->Sumw2();
00271   h_ele_simPtEta_matched           = new TH2F( "h_ele_simPtEta_matched",   "Efficiency vs pt #eta",  nbineta2D,etamin,etamax, nbinpt2D,5.,ptmax );
00272   h_ele_simPtEta_matched->Sumw2();
00273   h_ele_simPhi_matched               = new TH1F( "h_ele_simPhi_matched",               "Efficiency vs gen phi",        nbinphi,phimin,phimax);
00274   h_ele_simPhi_matched->Sumw2();
00275   h_ele_vertexPhi      = new TH1F( "h_ele_vertexPhi",      "ele  momentum #phi",    nbinphi,phimin,phimax);
00276   h_ele_vertexPhi->Sumw2();
00277   h_ele_vertexX      = new TH1F( "h_ele_vertexX",      "ele vertex x",    nbinxyz,-0.1,0.1 );
00278   h_ele_vertexX->Sumw2();
00279   h_ele_vertexY      = new TH1F( "h_ele_vertexY",      "ele vertex y",    nbinxyz,-0.1,0.1 );
00280   h_ele_vertexY->Sumw2();
00281   h_ele_vertexZ      = new TH1F( "h_ele_vertexZ",      "ele vertex z",    nbinxyz,-25, 25 );
00282   h_ele_vertexZ->Sumw2();
00283   h_ele_simZ_matched      = new TH1F( "h_ele_simZ_matched",      "Efficiency vs gen vertex z",    nbinxyz,-25,25);
00284   h_ele_simZ_matched->Sumw2();
00285   h_ele_vertexTIP      = new TH1F( "h_ele_vertexTIP",      "ele transverse impact parameter (wrt gen vtx)",    90,0.,0.15);
00286   h_ele_vertexTIP->Sumw2();
00287   h_ele_vertexTIPVsEta      = new TH2F( "h_ele_vertexTIPVsEta",      "ele transverse impact parameter (wrt gen vtx) vs eta", nbineta2D,etamin,etamax,45,0.,0.15);
00288   h_ele_vertexTIPVsPhi      = new TH2F( "h_ele_vertexTIPVsPhi",      "ele transverse impact parameter (wrt gen vtx) vs phi", nbinphi2D,phimin,phimax,45,0.,0.15);
00289   h_ele_vertexTIPVsPt      = new TH2F( "h_ele_vertexTIPVsPt",      "ele transverse impact parameter (wrt gen vtx) vs transverse momentum", nbinpt2D,0.,ptmax,45,0.,0.15);
00290   h_ele_PoPtrue        = new TH1F( "h_ele_PoPtrue",        "ele momentum / gen momentum", nbinpoptrue,poptruemin,poptruemax);
00291   h_ele_PoPtrue->Sumw2();
00292   h_ele_PtoPttrue        = new TH1F( "h_ele_PtoPttrue",        "ele transverse momentum / gen transverse momentum", nbinpoptrue,poptruemin,poptruemax);
00293   h_ele_PtoPttrue->Sumw2();
00294   h_ele_PoPtrueVsEta   = new TH2F( "h_ele_PoPtrueVsEta",        "ele momentum / gen momentum vs eta", nbineta2D,etamin,etamax,50,poptruemin,poptruemax);
00295   h_ele_PoPtrueVsPhi   = new TH2F( "h_ele_PoPtrueVsPhi",        "ele momentum / gen momentum vs phi", nbinphi2D,phimin,phimax,50,poptruemin,poptruemax);
00296   h_ele_PoPtrueVsPt   = new TH2F( "h_ele_PoPtrueVsPt",        "ele momentum / gen momentum vs eta", nbinpt2D,0.,ptmax,50,poptruemin,poptruemax);
00297   h_ele_PoPtrue_barrel         = new TH1F( "h_ele_PoPtrue_barrel",        "ele momentum / gen momentum, barrel",nbinpoptrue,poptruemin,poptruemax);
00298   h_ele_PoPtrue_barrel->Sumw2();
00299   h_ele_PoPtrue_endcaps        = new TH1F( "h_ele_PoPtrue_endcaps",        "ele momentum / gen momentum, endcaps",nbinpoptrue,poptruemin,poptruemax);
00300   h_ele_PoPtrue_endcaps->Sumw2();
00301   h_ele_PoPtrue_golden_barrel         = new TH1F( "h_ele_PoPtrue_golden_barrel",        "ele momentum / gen momentum, golden, barrel",nbinpoptrue,poptruemin,poptruemax);
00302   h_ele_PoPtrue_golden_barrel->Sumw2();
00303   h_ele_PoPtrue_golden_endcaps        = new TH1F( "h_ele_PoPtrue_golden_endcaps",        "ele momentum / gen momentum, golden, endcaps",nbinpoptrue,poptruemin,poptruemax);
00304   h_ele_PoPtrue_golden_endcaps->Sumw2();
00305   h_ele_PoPtrue_showering_barrel         = new TH1F( "h_ele_PoPtrue_showering_barrel",        "ele momentum / gen momentum, showering, barrel",nbinpoptrue,poptruemin,poptruemax);
00306   h_ele_PoPtrue_showering_barrel->Sumw2();
00307   h_ele_PoPtrue_showering_endcaps        = new TH1F( "h_ele_PoPtrue_showering_endcaps",        "ele momentum / gen momentum, showering, endcaps",nbinpoptrue,poptruemin,poptruemax);
00308   h_ele_PoPtrue_showering_endcaps->Sumw2();
00309   h_ele_PtoPttrue_barrel         = new TH1F( "h_ele_PtoPttrue_barrel",        "ele transverse momentum / gen transverse momentum, barrel",nbinpoptrue,poptruemin,poptruemax);
00310   h_ele_PtoPttrue_barrel->Sumw2();
00311   h_ele_PtoPttrue_endcaps        = new TH1F( "h_ele_PtoPttrue_endcaps",        "ele transverse momentum / gen transverse momentum, endcaps",nbinpoptrue,poptruemin,poptruemax);
00312   h_ele_PtoPttrue_endcaps->Sumw2();
00313   h_ele_EtaMnEtaTrue   = new TH1F( "h_ele_EtaMnEtaTrue",   "ele momentum  eta - gen  eta",nbindeta,detamin,detamax);
00314   h_ele_EtaMnEtaTrue->Sumw2();
00315   h_ele_EtaMnEtaTrue_barrel   = new TH1F( "h_ele_EtaMnEtaTrue_barrel",   "ele momentum  eta - gen  eta barrel",nbindeta,detamin,detamax);
00316   h_ele_EtaMnEtaTrue_barrel->Sumw2();
00317   h_ele_EtaMnEtaTrue_endcaps   = new TH1F( "h_ele_EtaMnEtaTrue_endcaps",   "ele momentum  eta - gen  eta endcaps",nbindeta,detamin,detamax);
00318   h_ele_EtaMnEtaTrue_endcaps->Sumw2();
00319   h_ele_EtaMnEtaTrueVsEta   = new TH2F( "h_ele_EtaMnEtaTrueVsEta",   "ele momentum  eta - gen  eta vs eta",nbineta2D,etamin,etamax,nbindeta/2,detamin,detamax);
00320   h_ele_EtaMnEtaTrueVsPhi   = new TH2F( "h_ele_EtaMnEtaTrueVsPhi",   "ele momentum  eta - gen  eta vs phi",nbinphi2D,phimin,phimax,nbindeta/2,detamin,detamax);
00321   h_ele_EtaMnEtaTrueVsPt   = new TH2F( "h_ele_EtaMnEtaTrueVsPt",   "ele momentum  eta - gen  eta vs pt",nbinpt,0.,ptmax,nbindeta/2,detamin,detamax);
00322   h_ele_PhiMnPhiTrue   = new TH1F( "h_ele_PhiMnPhiTrue",   "ele momentum  phi - gen  phi",nbindphi,dphimin,dphimax);
00323   h_ele_PhiMnPhiTrue->Sumw2();
00324   h_ele_PhiMnPhiTrue_barrel   = new TH1F( "h_ele_PhiMnPhiTrue_barrel",   "ele momentum  phi - gen  phi barrel",nbindphi,dphimin,dphimax);
00325   h_ele_PhiMnPhiTrue_barrel->Sumw2();
00326   h_ele_PhiMnPhiTrue_endcaps   = new TH1F( "h_ele_PhiMnPhiTrue_endcaps",   "ele momentum  phi - gen  phi endcaps",nbindphi,dphimin,dphimax);
00327   h_ele_PhiMnPhiTrue_endcaps->Sumw2();
00328   h_ele_PhiMnPhiTrue2   = new TH1F( "h_ele_PhiMnPhiTrue2",   "ele momentum  phi - gen  phi",nbindphimatch2D,dphimatchmin,dphimatchmax);
00329   h_ele_PhiMnPhiTrueVsEta   = new TH2F( "h_ele_PhiMnPhiTrueVsEta",   "ele momentum  phi - gen  phi vs eta",nbineta2D,etamin,etamax,nbindphi/2,dphimin,dphimax);
00330   h_ele_PhiMnPhiTrueVsPhi   = new TH2F( "h_ele_PhiMnPhiTrueVsPhi",   "ele momentum  phi - gen  phi vs phi",nbinphi2D,phimin,phimax,nbindphi/2,dphimin,dphimax);
00331   h_ele_PhiMnPhiTrueVsPt   = new TH2F( "h_ele_PhiMnPhiTrueVsPt",   "ele momentum  phi - gen  phi vs pt",nbinpt2D,0.,ptmax,nbindphi/2,dphimin,dphimax);
00332 
00333   // matched electron, superclusters
00334   histSclEn_ = new TH1F("h_scl_energy","ele supercluster energy",nbinp,0.,pmax);
00335   histSclEn_->Sumw2();
00336   histSclEoEtrue_barrel = new TH1F("h_scl_EoEtrue_barrel","ele supercluster energy / gen energy, barrel",50,0.2,1.2);
00337   histSclEoEtrue_barrel->Sumw2();
00338   histSclEoEtrue_barrel_eg = new TH1F("h_scl_EoEtrue_barrel_eg","ele supercluster energy / gen energy, barrel, ecal driven",50,0.2,1.2);
00339   histSclEoEtrue_barrel_eg->Sumw2();
00340   histSclEoEtrue_barrel_etagap = new TH1F("h_scl_EoEtrue_barrel_etagap","ele supercluster energy / gen energy, barrel, etagap",50,0.2,1.2);
00341   histSclEoEtrue_barrel_etagap->Sumw2();
00342   histSclEoEtrue_barrel_phigap = new TH1F("h_scl_EoEtrue_barrel_phigap","ele supercluster energy / gen energy, barrel, phigap",50,0.2,1.2);
00343   histSclEoEtrue_barrel_phigap->Sumw2();
00344   histSclEoEtrue_ebeegap = new TH1F("h_scl_EoEtrue_ebeegap","ele supercluster energy / gen energy, ebeegap",50,0.2,1.2);
00345   histSclEoEtrue_ebeegap->Sumw2();
00346   histSclEoEtrue_endcaps = new TH1F("h_scl_EoEtrue_endcaps","ele supercluster energy / gen energy, endcaps",50,0.2,1.2);
00347   histSclEoEtrue_endcaps->Sumw2();
00348   histSclEoEtrue_endcaps_eg = new TH1F("h_scl_EoEtrue_endcaps_eg","ele supercluster energy / gen energy, endcaps, ecal driven",50,0.2,1.2);
00349   histSclEoEtrue_endcaps_eg->Sumw2();
00350   histSclEoEtrue_endcaps_deegap = new TH1F("h_scl_EoEtrue_endcaps_deegap","ele supercluster energy / gen energy, endcaps, deegap",50,0.2,1.2);
00351   histSclEoEtrue_endcaps_deegap->Sumw2();
00352   histSclEoEtrue_endcaps_ringgap = new TH1F("h_scl_EoEtrue_endcaps_ringgap","ele supercluster energy / gen energy, endcaps, ringgap",50,0.2,1.2);
00353   histSclEoEtrue_endcaps_ringgap->Sumw2();
00354   histSclEoEtrue_barrel_new = new TH1F("h_scl_EoEtrue_barrel_new","ele supercluster energy / gen energy, barrel",nbinpoptrue,poptruemin,poptruemax);
00355   histSclEoEtrue_barrel_new->Sumw2();
00356   histSclEoEtrue_barrel_eg_new = new TH1F("h_scl_EoEtrue_barrel_eg_new","ele supercluster energy / gen energy, barrel, ecal driven",nbinpoptrue,poptruemin,poptruemax);
00357   histSclEoEtrue_barrel_eg_new->Sumw2();
00358   histSclEoEtrue_barrel_etagap_new = new TH1F("h_scl_EoEtrue_barrel_etagap_new","ele supercluster energy / gen energy, barrel, etagap",nbinpoptrue,poptruemin,poptruemax);
00359   histSclEoEtrue_barrel_etagap_new->Sumw2();
00360   histSclEoEtrue_barrel_phigap_new = new TH1F("h_scl_EoEtrue_barrel_phigap_new","ele supercluster energy / gen energy, barrel, phigap",nbinpoptrue,poptruemin,poptruemax);
00361   histSclEoEtrue_barrel_phigap_new->Sumw2();
00362   histSclEoEtrue_ebeegap_new = new TH1F("h_scl_EoEtrue_ebeegap_new","ele supercluster energy / gen energy, ebeegap",nbinpoptrue,poptruemin,poptruemax);
00363   histSclEoEtrue_ebeegap_new->Sumw2();
00364   histSclEoEtrue_endcaps_new = new TH1F("h_scl_EoEtrue_endcaps_new","ele supercluster energy / gen energy, endcaps",nbinpoptrue,poptruemin,poptruemax);
00365   histSclEoEtrue_endcaps_new->Sumw2();
00366   histSclEoEtrue_endcaps_eg_new = new TH1F("h_scl_EoEtrue_endcaps_eg_new","ele supercluster energy / gen energy, endcaps, ecal driven",nbinpoptrue,poptruemin,poptruemax);
00367   histSclEoEtrue_endcaps_eg_new->Sumw2();
00368   histSclEoEtrue_endcaps_deegap_new = new TH1F("h_scl_EoEtrue_endcaps_deegap_new","ele supercluster energy / gen energy, endcaps, deegap",nbinpoptrue,poptruemin,poptruemax);
00369   histSclEoEtrue_endcaps_deegap_new->Sumw2();
00370   histSclEoEtrue_endcaps_ringgap_new = new TH1F("h_scl_EoEtrue_endcaps_ringgap_new","ele supercluster energy / gen energy, endcaps, ringgap",nbinpoptrue,poptruemin,poptruemax);
00371   histSclEoEtrue_endcaps_ringgap_new->Sumw2();
00372   histSclEt_ = new TH1F("h_scl_et","ele supercluster transverse energy",nbinpt,0.,ptmax);
00373   histSclEt_->Sumw2();
00374   histSclEtVsEta_ = new TH2F("h_scl_etVsEta","ele supercluster transverse energy vs eta",nbineta2D,etamin,etamax,nbinpt,0.,ptmax);
00375   histSclEtVsPhi_ = new TH2F("h_scl_etVsPhi","ele supercluster transverse energy vs phi",nbinphi2D,phimin,phimax,nbinpt,0.,ptmax);
00376   histSclEtaVsPhi_ = new TH2F("h_scl_etaVsPhi","ele supercluster eta vs phi",nbinphi2D,phimin,phimax,nbineta2D,etamin,etamax);
00377   histSclEta_ = new TH1F("h_scl_eta","ele supercluster eta",nbineta,etamin,etamax);
00378   histSclEta_->Sumw2();
00379   histSclPhi_ = new TH1F("h_scl_phi","ele supercluster phi",nbinphi,phimin,phimax);
00380   histSclPhi_->Sumw2();
00381 
00382   histSclSigEtaEta_ =  new TH1F("h_scl_sigetaeta","ele supercluster sigma eta eta",100,0.,0.05);
00383   histSclSigEtaEta_->Sumw2();
00384   histSclSigEtaEta_barrel_ =  new TH1F("h_scl_sigetaeta_barrel","ele supercluster sigma eta eta barrel",100,0.,0.05);
00385   histSclSigEtaEta_barrel_->Sumw2();
00386   histSclSigEtaEta_endcaps_ =  new TH1F("h_scl_sigetaeta_endcaps","ele supercluster sigma eta eta endcaps",100,0.,0.05);
00387   histSclSigEtaEta_endcaps_->Sumw2();
00388   histSclSigIEtaIEta_ =  new TH1F("h_scl_sigietaieta","ele supercluster sigma ieta ieta",100,0.,0.05);
00389   histSclSigIEtaIEta_->Sumw2();
00390   histSclSigIEtaIEta_barrel_ =  new TH1F("h_scl_sigietaieta_barrel","ele supercluster sigma ieta ieta, barrel",100,0.,0.05);
00391   histSclSigIEtaIEta_barrel_->Sumw2();
00392   histSclSigIEtaIEta_endcaps_ =  new TH1F("h_scl_sigietaieta_endcaps","ele supercluster sigma ieta ieta, endcaps",100,0.,0.05);
00393   histSclSigIEtaIEta_endcaps_->Sumw2();
00394   histSclE1x5_ =  new TH1F("h_scl_E1x5","ele supercluster energy in 1x5",nbinp,0., pmax);
00395   histSclE1x5_->Sumw2();
00396   histSclE1x5_barrel_ =  new TH1F("h_scl_E1x5_barrel","ele supercluster energy in 1x5 barrel",nbinp,0., pmax);
00397   histSclE1x5_barrel_->Sumw2();
00398   histSclE1x5_endcaps_ =  new TH1F("h_scl_E1x5_endcaps","ele supercluster energy in 1x5 endcaps",nbinp,0., pmax);
00399   histSclE1x5_endcaps_->Sumw2();
00400   histSclE2x5max_ =  new TH1F("h_scl_E2x5max","ele supercluster energy in 2x5 max",nbinp,0.,pmax);
00401   histSclE2x5max_->Sumw2();
00402   histSclE2x5max_barrel_ =  new TH1F("h_scl_E2x5max_barrel","ele supercluster energy in 2x5 max barrel",nbinp,0.,pmax);
00403   histSclE2x5max_barrel_->Sumw2();
00404   histSclE2x5max_endcaps_ =  new TH1F("h_scl_E2x5max_endcaps","ele supercluster energy in 2x5 max endcaps",nbinp,0.,pmax);
00405   histSclE2x5max_endcaps_->Sumw2();
00406   histSclE5x5_ =  new TH1F("h_scl_E5x5","ele supercluster energy in 5x5",nbinp,0.,pmax);
00407   histSclE5x5_->Sumw2();
00408   histSclE5x5_barrel_ =  new TH1F("h_scl_E5x5_barrel","ele supercluster energy in 5x5 barrel",nbinp,0.,pmax);
00409   histSclE5x5_barrel_->Sumw2();
00410   histSclE5x5_endcaps_ =  new TH1F("h_scl_E5x5_endcaps","ele supercluster energy in 5x5 endcaps",nbinp,0.,pmax);
00411   histSclE5x5_endcaps_->Sumw2();
00412   histSclSigEtaEta_eg_ =  new TH1F("h_scl_sigetaeta_eg","ele supercluster sigma eta eta, ecal driven",100,0.,0.05);
00413   histSclSigEtaEta_eg_->Sumw2();
00414   histSclSigEtaEta_eg_barrel_ =  new TH1F("h_scl_sigetaeta_eg_barrel","ele supercluster sigma eta eta, ecal driven barrel",100,0.,0.05);
00415   histSclSigEtaEta_eg_barrel_->Sumw2();
00416   histSclSigEtaEta_eg_endcaps_ =  new TH1F("h_scl_sigetaeta_eg_endcaps","ele supercluster sigma eta eta, ecal driven endcaps",100,0.,0.05);
00417   histSclSigEtaEta_eg_endcaps_->Sumw2();
00418   histSclSigIEtaIEta_eg_ =  new TH1F("h_scl_sigietaieta_eg","ele supercluster sigma ieta ieta, ecal driven",100,0.,0.05);
00419   histSclSigIEtaIEta_eg_->Sumw2();
00420   histSclSigIEtaIEta_eg_barrel_ =  new TH1F("h_scl_sigietaieta_barrel_eg","ele supercluster sigma ieta ieta, barrel, ecal driven",100,0.,0.05);
00421   histSclSigIEtaIEta_eg_barrel_->Sumw2();
00422   histSclSigIEtaIEta_eg_endcaps_ =  new TH1F("h_scl_sigietaieta_endcaps_eg","ele supercluster sigma ieta ieta, endcaps, ecal driven",100,0.,0.05);
00423   histSclSigIEtaIEta_eg_endcaps_->Sumw2();
00424   histSclE1x5_eg_ =  new TH1F("h_scl_E1x5_eg","ele supercluster energy in 1x5, ecal driven",nbinp,0., pmax);
00425   histSclE1x5_eg_->Sumw2();
00426   histSclE1x5_eg_barrel_ =  new TH1F("h_scl_E1x5_eg_barrel","ele supercluster energy in 1x5, ecal driven barrel",nbinp,0., pmax);
00427   histSclE1x5_eg_barrel_->Sumw2();
00428   histSclE1x5_eg_endcaps_ =  new TH1F("h_scl_E1x5_eg_endcaps","ele supercluster energy in 1x5, ecal driven endcaps",nbinp,0., pmax);
00429   histSclE1x5_eg_endcaps_->Sumw2();
00430   histSclE2x5max_eg_ =  new TH1F("h_scl_E2x5max_eg","ele supercluster energy in 2x5 max, ecal driven",nbinp,0.,pmax);
00431   histSclE2x5max_eg_->Sumw2();
00432   histSclE2x5max_eg_barrel_ =  new TH1F("h_scl_E2x5max_eg_barrel","ele supercluster energy in 2x5 max, ecal driven barrel",nbinp,0.,pmax);
00433   histSclE2x5max_eg_barrel_->Sumw2();
00434   histSclE2x5max_eg_endcaps_ =  new TH1F("h_scl_E2x5max_eg_endcaps","ele supercluster energy in 2x5 max, ecal driven endcaps",nbinp,0.,pmax);
00435   histSclE2x5max_eg_endcaps_->Sumw2();
00436   histSclE5x5_eg_ =  new TH1F("h_scl_E5x5_eg","ele supercluster energy in 5x5, ecal driven",nbinp,0.,pmax);
00437   histSclE5x5_eg_->Sumw2();
00438   histSclE5x5_eg_barrel_ =  new TH1F("h_scl_E5x5_eg_barrel","ele supercluster energy in 5x5, ecal driven barrel",nbinp,0.,pmax);
00439   histSclE5x5_eg_barrel_->Sumw2();
00440   histSclE5x5_eg_endcaps_ =  new TH1F("h_scl_E5x5_eg_endcaps","ele supercluster energy in 5x5, ecal driven endcaps",nbinp,0.,pmax);
00441   histSclE5x5_eg_endcaps_->Sumw2();
00442 
00443   histSclEoEtruePfVsEg = new TH2F("h_scl_EoEtruePfVsEg","ele supercluster energy / gen energy pflow vs eg",75,-0.1,1.4, 75, -0.1, 1.4);
00444 
00445   // matched electron, gsf tracks
00446   h_ele_ambiguousTracks      = new TH1F( "h_ele_ambiguousTracks", "ele # ambiguous tracks",  5,0.,5.);
00447   h_ele_ambiguousTracks->Sumw2();
00448   h_ele_ambiguousTracksVsEta      = new TH2F( "h_ele_ambiguousTracksVsEta","ele # ambiguous tracks  vs eta",  nbineta2D,etamin,etamax,5,0.,5.);
00449   h_ele_ambiguousTracksVsPhi      = new TH2F( "h_ele_ambiguousTracksVsPhi", "ele # ambiguous tracks  vs phi",  nbinphi2D,phimin,phimax,5,0.,5.);
00450   h_ele_ambiguousTracksVsPt      = new TH2F( "h_ele_ambiguousTracksVsPt", "ele # ambiguous tracks vs pt",  nbinpt2D,0.,ptmax,5,0.,5.);
00451   h_ele_foundHits      = new TH1F( "h_ele_foundHits",      "ele track # found hits",      nbinfhits,0.,fhitsmax);
00452   h_ele_foundHits->Sumw2();
00453   h_ele_foundHits_barrel      = new TH1F( "h_ele_foundHits_barrel",      "ele track # found hits, barrel",      nbinfhits,0.,fhitsmax);
00454   h_ele_foundHits_barrel->Sumw2();
00455   h_ele_foundHits_endcaps      = new TH1F( "h_ele_foundHits_endcaps",      "ele track # found hits, endcaps",      nbinfhits,0.,fhitsmax);
00456   h_ele_foundHits_endcaps->Sumw2();
00457   h_ele_foundHitsVsEta      = new TH2F( "h_ele_foundHitsVsEta",      "ele track # found hits vs eta",  nbineta2D,etamin,etamax,nbinfhits,0.,fhitsmax);
00458   h_ele_foundHitsVsPhi      = new TH2F( "h_ele_foundHitsVsPhi",      "ele track # found hits vs phi",  nbinphi2D,phimin,phimax,nbinfhits,0.,fhitsmax);
00459   h_ele_foundHitsVsPt      = new TH2F( "h_ele_foundHitsVsPt",      "ele track # found hits vs pt",  nbinpt2D,0.,ptmax,nbinfhits,0.,fhitsmax);
00460   h_ele_lostHits       = new TH1F( "h_ele_lostHits",       "ele track # lost hits",       5,0.,5.);
00461   h_ele_lostHits->Sumw2();
00462   h_ele_lostHits_barrel       = new TH1F( "h_ele_lostHits_barrel",       "ele track # lost hits, barrel",       5,0.,5.);
00463   h_ele_lostHits_barrel->Sumw2();
00464   h_ele_lostHits_endcaps       = new TH1F( "h_ele_lostHits_endcaps",       "ele track # lost hits, endcaps",       5,0.,5.);
00465   h_ele_lostHits_endcaps->Sumw2();
00466   h_ele_lostHitsVsEta       = new TH2F( "h_ele_lostHitsVsEta",       "ele track # lost hits vs eta",   nbineta2D,etamin,etamax,nbinlhits,0.,lhitsmax);
00467   h_ele_lostHitsVsPhi       = new TH2F( "h_ele_lostHitsVsPhi",       "ele track # lost hits vs eta",   nbinphi2D,phimin,phimax,nbinlhits,0.,lhitsmax);
00468   h_ele_lostHitsVsPt       = new TH2F( "h_ele_lostHitsVsPt",       "ele track # lost hits vs eta",   nbinpt2D,0.,ptmax,nbinlhits,0.,lhitsmax);
00469   h_ele_chi2           = new TH1F( "h_ele_chi2",           "ele track #chi^{2}",         100,0.,15.);
00470   h_ele_chi2->Sumw2();
00471   h_ele_chi2_barrel           = new TH1F( "h_ele_chi2_barrel",           "ele track #chi^{2}, barrel",         100,0.,15.);
00472   h_ele_chi2_barrel->Sumw2();
00473   h_ele_chi2_endcaps           = new TH1F( "h_ele_chi2_endcaps",           "ele track #chi^{2}, endcaps",         100,0.,15.);
00474   h_ele_chi2_endcaps->Sumw2();
00475   h_ele_chi2VsEta           = new TH2F( "h_ele_chi2VsEta",           "ele track #chi^{2} vs eta",  nbineta2D,etamin,etamax,50,0.,15.);
00476   h_ele_chi2VsPhi           = new TH2F( "h_ele_chi2VsPhi",           "ele track #chi^{2} vs phi",  nbinphi2D,phimin,phimax,50,0.,15.);
00477   h_ele_chi2VsPt           = new TH2F( "h_ele_chi2VsPt",           "ele track #chi^{2} vs pt",  nbinpt2D,0.,ptmax,50,0.,15.);
00478   h_ele_PinMnPout      = new TH1F( "h_ele_PinMnPout",      "ele track inner p - outer p, mean of GSF components"   ,nbinp,0.,200.);
00479   h_ele_PinMnPout->Sumw2();
00480   h_ele_PinMnPout_mode      = new TH1F( "h_ele_PinMnPout_mode",      "ele track inner p - outer p, mode of GSF components"   ,nbinp,0.,100.);
00481   h_ele_PinMnPout_mode->Sumw2();
00482   h_ele_PinMnPoutVsEta_mode = new TH2F( "h_ele_PinMnPoutVsEta_mode",      "ele track inner p - outer p vs eta, mode of GSF components" ,nbineta2D, etamin,etamax,nbinp2D,0.,100.);
00483   h_ele_PinMnPoutVsPhi_mode = new TH2F( "h_ele_PinMnPoutVsPhi_mode",      "ele track inner p - outer p vs phi, mode of GSF components" ,nbinphi2D, phimin,phimax,nbinp2D,0.,100.);
00484   h_ele_PinMnPoutVsPt_mode = new TH2F( "h_ele_PinMnPoutVsPt_mode",      "ele track inner p - outer p vs pt, mode of GSF components" ,nbinpt2D, 0.,ptmax,nbinp2D,0.,100.);
00485   h_ele_PinMnPoutVsE_mode = new TH2F( "h_ele_PinMnPoutVsE_mode",      "ele track inner p - outer p vs E, mode of GSF components" ,nbinp2D, 0.,200.,nbinp2D,0.,100.);
00486   h_ele_PinMnPoutVsChi2_mode = new TH2F( "h_ele_PinMnPoutVsChi2_mode",      "ele track inner p - outer p vs track chi2, mode of GSF components" ,50, 0.,20.,nbinp2D,0.,100.);
00487   h_ele_outerP         = new TH1F( "h_ele_outerP",         "ele track outer p, mean of GSF components",          nbinp,0.,pmax);
00488   h_ele_outerP->Sumw2();
00489   h_ele_outerP_mode         = new TH1F( "h_ele_outerP_mode",         "ele track outer p, mode of GSF components",          nbinp,0.,pmax);
00490   h_ele_outerP_mode->Sumw2();
00491   h_ele_outerPVsEta_mode         = new TH2F( "h_ele_outerPVsEta_mode",         "ele track outer p vs eta mode", nbineta2D,etamin,etamax,50,0.,pmax);
00492   h_ele_outerPt        = new TH1F( "h_ele_outerPt",        "ele track outer p_{T}, mean of GSF components",      nbinpt,0.,ptmax);
00493   h_ele_outerPt->Sumw2();
00494   h_ele_outerPt_mode        = new TH1F( "h_ele_outerPt_mode",        "ele track outer p_{T}, mode of GSF components",      nbinpt,0.,ptmax);
00495   h_ele_outerPt_mode->Sumw2();
00496   h_ele_outerPtVsEta_mode        = new TH2F( "h_ele_outerPtVsEta_mode", "ele track outer p_{T} vs eta, mode of GSF components", nbineta2D,etamin,etamax,nbinpt2D,0.,ptmax);
00497   h_ele_outerPtVsPhi_mode        = new TH2F( "h_ele_outerPtVsPhi_mode", "ele track outer p_{T} vs phi, mode of GSF components", nbinphi2D,phimin,phimax,nbinpt2D,0.,ptmax);
00498   h_ele_outerPtVsPt_mode        = new TH2F( "h_ele_outerPtVsPt_mode", "ele track outer p_{T} vs pt, mode of GSF components", nbinpt2D,0.,100.,nbinpt2D,0.,ptmax);
00499 
00500   // matched electrons, matching
00501   h_ele_EoP            = new TH1F( "h_ele_EoP",            "ele E/P_{vertex}",        nbineop,0.,eopmax);
00502   h_ele_EoP->Sumw2();
00503   h_ele_EoP_eg            = new TH1F( "h_ele_EoP_eg",            "ele E/P_{vertex}, ecal driven",        nbineop,0.,eopmax);
00504   h_ele_EoP_eg->Sumw2();
00505   h_ele_EoP_barrel            = new TH1F( "h_ele_EoP_barrel",            "ele E/P_{vertex} barrel",        nbineop,0.,eopmax);
00506   h_ele_EoP_barrel->Sumw2();
00507   h_ele_EoP_eg_barrel            = new TH1F( "h_ele_EoP_eg_barrel",            "ele E/P_{vertex}, ecal driven barrel",        nbineop,0.,eopmax);
00508   h_ele_EoP_eg_barrel->Sumw2();
00509   h_ele_EoP_endcaps            = new TH1F( "h_ele_EoP_endcaps",            "ele E/P_{vertex} endcaps",        nbineop,0.,eopmax);
00510   h_ele_EoP_endcaps->Sumw2();
00511   h_ele_EoP_eg_endcaps            = new TH1F( "h_ele_EoP_eg_endcaps",            "ele E/P_{vertex}, ecal driven endcaps",        nbineop,0.,eopmax);
00512   h_ele_EoP_eg_endcaps->Sumw2();
00513   h_ele_EoPVsEta            = new TH2F( "h_ele_EoPVsEta",            "ele E/P_{vertex} vs eta",  nbineta2D,etamin,etamax,nbineop2D,0.,eopmaxsht);
00514   h_ele_EoPVsPhi            = new TH2F( "h_ele_EoPVsPhi",            "ele E/P_{vertex} vs phi",  nbinphi2D,phimin,phimax,nbineop2D,0.,eopmaxsht);
00515   h_ele_EoPVsE            = new TH2F( "h_ele_EoPVsE",            "ele E/P_{vertex} vs E",  50,0.,pmax ,50,0.,5.);
00516   h_ele_EseedOP            = new TH1F( "h_ele_EseedOP",            "ele E_{seed}/P_{vertex}",        nbineop,0.,eopmax);
00517   h_ele_EseedOP->Sumw2();
00518   h_ele_EseedOP_eg            = new TH1F( "h_ele_EseedOP_eg",            "ele E_{seed}/P_{vertex}, ecal driven",        nbineop,0.,eopmax);
00519   h_ele_EseedOP_eg->Sumw2();
00520   h_ele_EseedOP_barrel            = new TH1F( "h_ele_EseedOP_barrel",            "ele E_{seed}/P_{vertex} barrel",        nbineop,0.,eopmax);
00521   h_ele_EseedOP_barrel->Sumw2();
00522   h_ele_EseedOP_eg_barrel            = new TH1F( "h_ele_EseedOP_eg_barrel",            "ele E_{seed}/P_{vertex}, ecal driven barrel",        nbineop,0.,eopmax);
00523   h_ele_EseedOP_eg_barrel->Sumw2();
00524   h_ele_EseedOP_endcaps            = new TH1F( "h_ele_EseedOP_endcaps",            "ele E_{seed}/P_{vertex} endcaps",        nbineop,0.,eopmax);
00525   h_ele_EseedOP_endcaps->Sumw2();
00526   h_ele_EseedOP_eg_endcaps            = new TH1F( "h_ele_EseedOP_eg_endcaps",            "ele E_{seed}/P_{vertex}, ecal driven, endcaps",        nbineop,0.,eopmax);
00527   h_ele_EseedOP_eg_endcaps->Sumw2();
00528   h_ele_EseedOPVsEta            = new TH2F( "h_ele_EseedOPVsEta",            "ele E_{seed}/P_{vertex} vs eta",  nbineta2D,etamin,etamax,nbineop2D,0.,eopmaxsht);
00529   h_ele_EseedOPVsPhi            = new TH2F( "h_ele_EseedOPVsPhi",            "ele E_{seed}/P_{vertex} vs phi",  nbinphi2D,phimin,phimax,nbineop2D,0.,eopmaxsht);
00530   h_ele_EseedOPVsE            = new TH2F( "h_ele_EseedOPVsE",            "ele E_{seed}/P_{vertex} vs E",  50,0.,pmax ,50,0.,5.);
00531   h_ele_EoPout         = new TH1F( "h_ele_EoPout",         "ele E_{seed}/P_{out}",           nbineop,0.,eopmax);
00532   h_ele_EoPout->Sumw2();
00533   h_ele_EoPout_eg         = new TH1F( "h_ele_EoPout_eg",         "ele E_{seed}/P_{out}, ecal driven",           nbineop,0.,eopmax);
00534   h_ele_EoPout_eg->Sumw2();
00535   h_ele_EoPout_barrel         = new TH1F( "h_ele_EoPout_barrel",         "ele E_{seed}/P_{out} barrel",           nbineop,0.,eopmax);
00536   h_ele_EoPout_barrel->Sumw2();
00537   h_ele_EoPout_eg_barrel         = new TH1F( "h_ele_EoPout_eg_barrel",         "ele E_{seed}/P_{out}, ecal driven, barrel",           nbineop,0.,eopmax);
00538   h_ele_EoPout_eg_barrel->Sumw2();
00539   h_ele_EoPout_endcaps         = new TH1F( "h_ele_EoPout_endcaps",         "ele E_{seed}/P_{out} endcaps",           nbineop,0.,eopmax);
00540   h_ele_EoPout_endcaps->Sumw2();
00541   h_ele_EoPout_eg_endcaps         = new TH1F( "h_ele_EoPout_eg_endcaps",         "ele E_{seed}/P_{out}, ecal driven, endcaps",           nbineop,0.,eopmax);
00542   h_ele_EoPout_eg_endcaps->Sumw2();
00543   h_ele_EoPoutVsEta         = new TH2F( "h_ele_EoPoutVsEta",         "ele E_{seed}/P_{out} vs eta",    nbineta2D,etamin,etamax,nbineop2D,0.,eopmaxsht);
00544   h_ele_EoPoutVsPhi         = new TH2F( "h_ele_EoPoutVsPhi",         "ele E_{seed}/P_{out} vs phi",    nbinphi2D,phimin,phimax,nbineop2D,0.,eopmaxsht);
00545   h_ele_EoPoutVsE         = new TH2F( "h_ele_EoPoutVsE",         "ele E_{seed}/P_{out} vs E",    nbinp2D,0.,pmax,nbineop2D,0.,eopmaxsht);
00546   h_ele_EeleOPout         = new TH1F( "h_ele_EeleOPout",         "ele E_{ele}/P_{out}",           nbineop,0.,eopmax);
00547   h_ele_EeleOPout->Sumw2();
00548   h_ele_EeleOPout_eg         = new TH1F( "h_ele_EeleOPout_eg",         "ele E_{ele}/P_{out}, ecal driven",           nbineop,0.,eopmax);
00549   h_ele_EeleOPout_eg->Sumw2();
00550   h_ele_EeleOPout_barrel         = new TH1F( "h_ele_EeleOPout_barrel",         "ele E_{ele}/P_{out} barrel",           nbineop,0.,eopmax);
00551   h_ele_EeleOPout_barrel->Sumw2();
00552   h_ele_EeleOPout_eg_barrel         = new TH1F( "h_ele_EeleOPout_eg_barrel",         "ele E_{ele}/P_{out}, ecal driven, barrel",           nbineop,0.,eopmax);
00553   h_ele_EeleOPout_eg_barrel->Sumw2();
00554   h_ele_EeleOPout_endcaps         = new TH1F( "h_ele_EeleOPout_endcaps",         "ele E_{ele}/P_{out} endcaps",           nbineop,0.,eopmax);
00555   h_ele_EeleOPout_endcaps->Sumw2();
00556   h_ele_EeleOPout_eg_endcaps         = new TH1F( "h_ele_EeleOPout_eg_endcaps",         "ele E_{ele}/P_{out}, ecal driven, endcaps",           nbineop,0.,eopmax);
00557   h_ele_EeleOPout_eg_endcaps->Sumw2();
00558   h_ele_EeleOPoutVsEta         = new TH2F( "h_ele_EeleOPoutVsEta",         "ele E_{ele}/P_{out} vs eta",    nbineta2D,etamin,etamax,nbineop2D,0.,eopmaxsht);
00559   h_ele_EeleOPoutVsPhi         = new TH2F( "h_ele_EeleOPoutVsPhi",         "ele E_{ele}/P_{out} vs phi",    nbinphi2D,phimin,phimax,nbineop2D,0.,eopmaxsht);
00560   h_ele_EeleOPoutVsE         = new TH2F( "h_ele_EeleOPoutVsE",         "ele E_{ele}/P_{out} vs E",    nbinp2D,0.,pmax,nbineop2D,0.,eopmaxsht);
00561   h_ele_dEtaSc_propVtx = new TH1F( "h_ele_dEtaSc_propVtx", "ele #eta_{sc} - #eta_{tr}, prop from vertex",      nbindetamatch,detamatchmin,detamatchmax);
00562   h_ele_dEtaSc_propVtx->Sumw2();
00563   h_ele_dEtaSc_propVtx_eg = new TH1F( "h_ele_dEtaSc_propVtx_eg", "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven",      nbindetamatch,detamatchmin,detamatchmax);
00564   h_ele_dEtaSc_propVtx_eg->Sumw2();
00565   h_ele_dEtaSc_propVtx_barrel = new TH1F( "h_ele_dEtaSc_propVtx_barrel", "ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",      nbindetamatch,detamatchmin,detamatchmax);
00566   h_ele_dEtaSc_propVtx_barrel->Sumw2();
00567   h_ele_dEtaSc_propVtx_eg_barrel = new TH1F( "h_ele_dEtaSc_propVtx_eg_barrel", "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, barrel",      nbindetamatch,detamatchmin,detamatchmax);
00568   h_ele_dEtaSc_propVtx_eg_barrel->Sumw2();
00569   h_ele_dEtaSc_propVtx_endcaps = new TH1F( "h_ele_dEtaSc_propVtx_endcaps", "ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",      nbindetamatch,detamatchmin,detamatchmax);
00570   h_ele_dEtaSc_propVtx_endcaps->Sumw2();
00571   h_ele_dEtaSc_propVtx_eg_endcaps = new TH1F( "h_ele_dEtaSc_propVtx_eg_endcaps", "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, endcaps",      nbindetamatch,detamatchmin,detamatchmax);
00572   h_ele_dEtaSc_propVtx_eg_endcaps->Sumw2();
00573   h_ele_dEtaScVsEta_propVtx = new TH2F( "h_ele_dEtaScVsEta_propVtx", "ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex", nbineta2D,etamin,etamax,nbindetamatch2D,detamatchmin,detamatchmax);
00574   h_ele_dEtaScVsPhi_propVtx = new TH2F( "h_ele_dEtaScVsPhi_propVtx", "ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex", nbinphi2D,phimin,phimax,nbindetamatch2D,detamatchmin,detamatchmax);
00575   h_ele_dEtaScVsPt_propVtx = new TH2F( "h_ele_dEtaScVsPt_propVtx", "ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex", nbinpt2D,0.,ptmax,nbindetamatch2D,detamatchmin,detamatchmax);
00576   h_ele_dPhiSc_propVtx = new TH1F( "h_ele_dPhiSc_propVtx", "ele #phi_{sc} - #phi_{tr}, prop from vertex",      nbindphimatch,dphimatchmin,dphimatchmax);
00577   h_ele_dPhiSc_propVtx->Sumw2();
00578   h_ele_dPhiSc_propVtx_eg = new TH1F( "h_ele_dPhiSc_propVtx_eg", "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven",      nbindphimatch,dphimatchmin,dphimatchmax);
00579   h_ele_dPhiSc_propVtx_eg->Sumw2();
00580   h_ele_dPhiSc_propVtx_barrel = new TH1F( "h_ele_dPhiSc_propVtx_barrel", "ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",      nbindphimatch,dphimatchmin,dphimatchmax);
00581   h_ele_dPhiSc_propVtx_barrel->Sumw2();
00582   h_ele_dPhiSc_propVtx_eg_barrel = new TH1F( "h_ele_dPhiSc_propVtx_eg_barrel", "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, barrel",      nbindphimatch,dphimatchmin,dphimatchmax);
00583   h_ele_dPhiSc_propVtx_eg_barrel->Sumw2();
00584   h_ele_dPhiSc_propVtx_endcaps = new TH1F( "h_ele_dPhiSc_propVtx_endcaps", "ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",      nbindphimatch,dphimatchmin,dphimatchmax);
00585   h_ele_dPhiSc_propVtx_endcaps->Sumw2();
00586   h_ele_dPhiSc_propVtx_eg_endcaps = new TH1F( "h_ele_dPhiSc_propVtx_eg_endcaps", "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, endcaps",      nbindphimatch,dphimatchmin,dphimatchmax);
00587   h_ele_dPhiSc_propVtx_eg_endcaps->Sumw2();
00588   h_ele_dPhiScVsEta_propVtx = new TH2F( "h_ele_dPhiScVsEta_propVtx", "ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex", nbineta2D,etamin,etamax,nbindphimatch2D,dphimatchmin,dphimatchmax);
00589   h_ele_dPhiScVsPhi_propVtx = new TH2F( "h_ele_dPhiScVsPhi_propVtx", "ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex", nbinphi2D,phimin,phimax,nbindphimatch2D,dphimatchmin,dphimatchmax);
00590   h_ele_dPhiScVsPt_propVtx = new TH2F( "h_ele_dPhiScVsPt_propVtx", "ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex", nbinpt2D,0.,ptmax,nbindphimatch2D,dphimatchmin,dphimatchmax);
00591   h_ele_dEtaCl_propOut = new TH1F( "h_ele_dEtaCl_propOut", "ele #eta_{cl} - #eta_{tr}, prop from outermost",   nbindetamatch,detamatchmin,detamatchmax);
00592   h_ele_dEtaCl_propOut->Sumw2();
00593   h_ele_dEtaCl_propOut_eg = new TH1F( "h_ele_dEtaCl_propOut_eg", "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven",   nbindetamatch,detamatchmin,detamatchmax);
00594   h_ele_dEtaCl_propOut_eg->Sumw2();
00595   h_ele_dEtaCl_propOut_barrel = new TH1F( "h_ele_dEtaCl_propOut_barrel", "ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",   nbindetamatch,detamatchmin,detamatchmax);
00596   h_ele_dEtaCl_propOut_barrel->Sumw2();
00597   h_ele_dEtaCl_propOut_eg_barrel = new TH1F( "h_ele_dEtaCl_propOut_eg_barrel", "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, barrel",   nbindetamatch,detamatchmin,detamatchmax);
00598   h_ele_dEtaCl_propOut_eg_barrel->Sumw2();
00599   h_ele_dEtaCl_propOut_endcaps = new TH1F( "h_ele_dEtaCl_propOut_endcaps", "ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",   nbindetamatch,detamatchmin,detamatchmax);
00600   h_ele_dEtaCl_propOut_endcaps->Sumw2();
00601   h_ele_dEtaCl_propOut_eg_endcaps = new TH1F( "h_ele_dEtaCl_propOut_eg_endcaps", "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",   nbindetamatch,detamatchmin,detamatchmax);
00602   h_ele_dEtaCl_propOut_eg_endcaps->Sumw2();
00603   h_ele_dEtaClVsEta_propOut = new TH2F( "h_ele_dEtaClVsEta_propOut", "ele #eta_{cl} - #eta_{tr} vs eta, prop from out", nbineta2D,etamin,etamax,nbindetamatch2D,detamatchmin,detamatchmax);
00604   h_ele_dEtaClVsPhi_propOut = new TH2F( "h_ele_dEtaClVsPhi_propOut", "ele #eta_{cl} - #eta_{tr} vs phi, prop from out", nbinphi2D,phimin,phimax,nbindetamatch2D,detamatchmin,detamatchmax);
00605   h_ele_dEtaClVsPt_propOut = new TH2F( "h_ele_dEtaScVsPt_propOut", "ele #eta_{cl} - #eta_{tr} vs pt, prop from out", nbinpt2D,0.,ptmax,nbindetamatch2D,detamatchmin,detamatchmax);
00606   h_ele_dPhiCl_propOut = new TH1F( "h_ele_dPhiCl_propOut", "ele #phi_{cl} - #phi_{tr}, prop from outermost",   nbindphimatch,dphimatchmin,dphimatchmax);
00607   h_ele_dPhiCl_propOut->Sumw2();
00608   h_ele_dPhiCl_propOut_eg = new TH1F( "h_ele_dPhiCl_propOut_eg", "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven",   nbindphimatch,dphimatchmin,dphimatchmax);
00609   h_ele_dPhiCl_propOut_eg->Sumw2();
00610   h_ele_dPhiCl_propOut_barrel = new TH1F( "h_ele_dPhiCl_propOut_barrel", "ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",   nbindphimatch,dphimatchmin,dphimatchmax);
00611   h_ele_dPhiCl_propOut_barrel->Sumw2();
00612   h_ele_dPhiCl_propOut_eg_barrel = new TH1F( "h_ele_dPhiCl_propOut_eg_barrel", "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, barrel",   nbindphimatch,dphimatchmin,dphimatchmax);
00613   h_ele_dPhiCl_propOut_eg_barrel->Sumw2();
00614   h_ele_dPhiCl_propOut_endcaps = new TH1F( "h_ele_dPhiCl_propOut_endcaps", "ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",   nbindphimatch,dphimatchmin,dphimatchmax);
00615   h_ele_dPhiCl_propOut_endcaps->Sumw2();
00616   h_ele_dPhiCl_propOut_eg_endcaps = new TH1F( "h_ele_dPhiCl_propOut_eg_endcaps", "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",   nbindphimatch,dphimatchmin,dphimatchmax);
00617   h_ele_dPhiCl_propOut_eg_endcaps->Sumw2();
00618   h_ele_dPhiClVsEta_propOut = new TH2F( "h_ele_dPhiClVsEta_propOut", "ele #phi_{cl} - #phi_{tr} vs eta, prop from out", nbineta2D,etamin,etamax,nbindphimatch2D,dphimatchmin,dphimatchmax);
00619   h_ele_dPhiClVsPhi_propOut = new TH2F( "h_ele_dPhiClVsPhi_propOut", "ele #phi_{cl} - #phi_{tr} vs phi, prop from out", nbinphi2D,phimin,phimax,nbindphimatch2D,dphimatchmin,dphimatchmax);
00620   h_ele_dPhiClVsPt_propOut = new TH2F( "h_ele_dPhiSClsPt_propOut", "ele #phi_{cl} - #phi_{tr} vs pt, prop from out", nbinpt2D,0.,ptmax,nbindphimatch2D,dphimatchmin,dphimatchmax);
00621   h_ele_dEtaEleCl_propOut = new TH1F( "h_ele_dEtaEleCl_propOut", "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",   nbindetamatch,detamatchmin,detamatchmax);
00622   h_ele_dEtaEleCl_propOut->Sumw2();
00623   h_ele_dEtaEleCl_propOut_eg = new TH1F( "h_ele_dEtaEleCl_propOut_eg", "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven",   nbindetamatch,detamatchmin,detamatchmax);
00624   h_ele_dEtaEleCl_propOut_eg->Sumw2();
00625   h_ele_dEtaEleCl_propOut_barrel = new TH1F( "h_ele_dEtaEleCl_propOut_barrel", "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",   nbindetamatch,detamatchmin,detamatchmax);
00626   h_ele_dEtaEleCl_propOut_barrel->Sumw2();
00627   h_ele_dEtaEleCl_propOut_eg_barrel = new TH1F( "h_ele_dEtaEleCl_propOut_eg_barrel", "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, barrel",   nbindetamatch,detamatchmin,detamatchmax);
00628   h_ele_dEtaEleCl_propOut_eg_barrel->Sumw2();
00629   h_ele_dEtaEleCl_propOut_endcaps = new TH1F( "h_ele_dEtaEleCl_propOut_endcaps", "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",   nbindetamatch,detamatchmin,detamatchmax);
00630   h_ele_dEtaEleCl_propOut_endcaps->Sumw2();
00631   h_ele_dEtaEleCl_propOut_eg_endcaps = new TH1F( "h_ele_dEtaEleCl_propOut_eg_endcaps", "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",   nbindetamatch,detamatchmin,detamatchmax);
00632   h_ele_dEtaEleCl_propOut_eg_endcaps->Sumw2();
00633   h_ele_dEtaEleClVsEta_propOut = new TH2F( "h_ele_dEtaEleClVsEta_propOut", "ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out", nbineta2D,etamin,etamax,nbindetamatch2D,detamatchmin,detamatchmax);
00634   h_ele_dEtaEleClVsPhi_propOut = new TH2F( "h_ele_dEtaEleClVsPhi_propOut", "ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out", nbinphi2D,phimin,phimax,nbindetamatch2D,detamatchmin,detamatchmax);
00635   h_ele_dEtaEleClVsPt_propOut = new TH2F( "h_ele_dEtaScVsPt_propOut", "ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out", nbinpt2D,0.,ptmax,nbindetamatch2D,detamatchmin,detamatchmax);
00636   h_ele_dPhiEleCl_propOut = new TH1F( "h_ele_dPhiEleCl_propOut", "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",   nbindphimatch,dphimatchmin,dphimatchmax);
00637   h_ele_dPhiEleCl_propOut->Sumw2();
00638   h_ele_dPhiEleCl_propOut_eg = new TH1F( "h_ele_dPhiEleCl_propOut_eg", "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven",   nbindphimatch,dphimatchmin,dphimatchmax);
00639   h_ele_dPhiEleCl_propOut_eg->Sumw2();
00640   h_ele_dPhiEleCl_propOut_barrel = new TH1F( "h_ele_dPhiEleCl_propOut_barrel", "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",   nbindphimatch,dphimatchmin,dphimatchmax);
00641   h_ele_dPhiEleCl_propOut_barrel->Sumw2();
00642   h_ele_dPhiEleCl_propOut_eg_barrel = new TH1F( "h_ele_dPhiEleCl_propOut_eg_barrel", "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, barrel",   nbindphimatch,dphimatchmin,dphimatchmax);
00643   h_ele_dPhiEleCl_propOut_eg_barrel->Sumw2();
00644   h_ele_dPhiEleCl_propOut_endcaps = new TH1F( "h_ele_dPhiEleCl_propOut_endcaps", "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",   nbindphimatch,dphimatchmin,dphimatchmax);
00645   h_ele_dPhiEleCl_propOut_endcaps->Sumw2();
00646   h_ele_dPhiEleCl_propOut_eg_endcaps = new TH1F( "h_ele_dPhiEleCl_propOut_eg_endcaps", "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",   nbindphimatch,dphimatchmin,dphimatchmax);
00647   h_ele_dPhiEleCl_propOut_eg_endcaps->Sumw2();
00648   h_ele_dPhiEleClVsEta_propOut = new TH2F( "h_ele_dPhiEleClVsEta_propOut", "ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out", nbineta2D,etamin,etamax,nbindphimatch2D,dphimatchmin,dphimatchmax);
00649   h_ele_dPhiEleClVsPhi_propOut = new TH2F( "h_ele_dPhiEleClVsPhi_propOut", "ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out", nbinphi2D,phimin,phimax,nbindphimatch2D,dphimatchmin,dphimatchmax);
00650   h_ele_dPhiEleClVsPt_propOut = new TH2F( "h_ele_dPhiSEleClsPt_propOut", "ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out", nbinpt2D,0.,ptmax,nbindphimatch2D,dphimatchmin,dphimatchmax);
00651 
00652   h_ele_HoE = new TH1F("h_ele_HoE", "ele hadronic energy / em energy", nbinhoe, hoemin, hoemax) ;
00653   h_ele_HoE->Sumw2();
00654   h_ele_HoE_eg = new TH1F("h_ele_HoE_eg", "ele hadronic energy / em energy, ecal driven", nbinhoe, hoemin, hoemax) ;
00655   h_ele_HoE_eg->Sumw2();
00656   h_ele_HoE_barrel = new TH1F("h_ele_HoE_barrel", "ele hadronic energy / em energy, barrel", nbinhoe, hoemin, hoemax) ;
00657   h_ele_HoE_barrel->Sumw2();
00658   h_ele_HoE_eg_barrel = new TH1F("h_ele_HoE_eg_barrel", "ele hadronic energy / em energy, ecal driven, barrel", nbinhoe, hoemin, hoemax) ;
00659   h_ele_HoE_eg_barrel->Sumw2();
00660   h_ele_HoE_endcaps = new TH1F("h_ele_HoE_endcaps", "ele hadronic energy / em energy, endcaps", nbinhoe, hoemin, hoemax) ;
00661   h_ele_HoE_endcaps->Sumw2();
00662   h_ele_HoE_eg_endcaps = new TH1F("h_ele_HoE_eg_endcaps", "ele hadronic energy / em energy, ecal driven, endcaps", nbinhoe, hoemin, hoemax) ;
00663   h_ele_HoE_eg_endcaps->Sumw2();
00664   h_ele_HoE_fiducial = new TH1F("h_ele_HoE_fiducial", "ele hadronic energy / em energy, fiducial region", nbinhoe, hoemin, hoemax) ;
00665   h_ele_HoE_fiducial->Sumw2();
00666   h_ele_HoEVsEta = new TH2F("h_ele_HoEVsEta", "ele hadronic energy / em energy vs eta", nbineta,etamin,etamax,nbinhoe, hoemin, hoemax) ;
00667   h_ele_HoEVsPhi = new TH2F("h_ele_HoEVsPhi", "ele hadronic energy / em energy vs phi", nbinphi2D,phimin,phimax,nbinhoe, hoemin, hoemax) ;
00668   h_ele_HoEVsE = new TH2F("h_ele_HoEVsE", "ele hadronic energy / em energy vs E", nbinp, 0.,300.,nbinhoe, hoemin, hoemax) ;
00669 
00670   h_ele_seed_dphi2_ = new TH1F("h_ele_seedDphi2", "ele seed dphi 2nd layer", 50,-0.003,+0.003) ;
00671   h_ele_seed_dphi2_->Sumw2();
00672   h_ele_seed_dphi2VsEta_ = new TH2F("h_ele_seedDphi2VsEta", "ele seed dphi 2nd layer vs eta", nbineta2D,etamin,etamax,50,-0.003,+0.003) ;
00673   h_ele_seed_dphi2VsPt_ = new TH2F("h_ele_seedDphi2VsPt", "ele seed dphi 2nd layer vs pt", nbinpt2D,0.,ptmax,50,-0.003,+0.003) ;
00674   h_ele_seed_drz2_ = new TH1F("h_ele_seedDrz2", "ele seed dr (dz) 2nd layer", 50,-0.03,+0.03) ;
00675   h_ele_seed_drz2_->Sumw2();
00676   h_ele_seed_drz2VsEta_ = new TH2F("h_ele_seedDrz2VsEta", "ele seed dr/dz 2nd layer vs eta", nbineta2D,etamin,etamax,50,-0.03,+0.03) ;
00677   h_ele_seed_drz2VsPt_ = new TH2F("h_ele_seedDrz2VsPt", "ele seed dr/dz 2nd layer vs pt", nbinpt2D,0.,ptmax,50,-0.03,+0.03) ;
00678   h_ele_seed_subdet2_ = new TH1F("h_ele_seedSubdet2", "ele seed subdet 2nd layer", 10,0.,10.) ;
00679   h_ele_seed_subdet2_->Sumw2();
00680 
00681   // classes
00682   h_ele_classes = new TH1F( "h_ele_classes", "ele classes",      20,0.0,20.);
00683   h_ele_classes->Sumw2();
00684   h_ele_eta = new TH1F( "h_ele_eta", "ele electron eta",  nbineta/2,0.0,etamax);
00685   h_ele_eta->Sumw2();
00686   h_ele_eta_golden = new TH1F( "h_ele_eta_golden", "ele electron eta golden",  nbineta/2,0.0,etamax);
00687   h_ele_eta_golden->Sumw2();
00688   h_ele_eta_bbrem = new TH1F( "h_ele_eta_bbrem", "ele electron eta bbrem",  nbineta/2,0.0,etamax);
00689   h_ele_eta_bbrem->Sumw2();
00690   h_ele_eta_narrow = new TH1F( "h_ele_eta_narrow", "ele electron eta narrow",  nbineta/2,0.0,etamax);
00691   h_ele_eta_narrow->Sumw2();
00692   h_ele_eta_shower = new TH1F( "h_ele_eta_show", "ele electron eta showering",  nbineta/2,0.0,etamax);
00693   h_ele_eta_shower->Sumw2();
00694   h_ele_PinVsPoutGolden_mode = new TH2F( "h_ele_PinVsPoutGolden_mode",      "ele track inner p vs outer p vs eta, golden, mode of GSF components" ,nbinp2D,0.,pmax,50,0.,pmax);
00695   h_ele_PinVsPoutShowering_mode = new TH2F( "h_ele_PinVsPoutShowering_mode",      "ele track inner p vs outer p vs eta, showering, mode of GSF components" ,nbinp2D,0.,pmax,50,0.,pmax);
00696   h_ele_PinVsPoutGolden_mean = new TH2F( "h_ele_PinVsPoutGolden_mean",      "ele track inner p vs outer p vs eta, golden, mean of GSF components" ,nbinp2D,0.,pmax,50,0.,pmax);
00697   h_ele_PinVsPoutShowering_mean = new TH2F( "h_ele_PinVsPoutShowering_mean",      "ele track inner p vs outer p vs eta, showering, mean of GSF components" ,nbinp2D,0.,pmax,50,0.,pmax);
00698   h_ele_PtinVsPtoutGolden_mode = new TH2F( "h_ele_PtinVsPtoutGolden_mode",      "ele track inner pt vs outer pt vs eta, golden, mode of GSF components" ,nbinpt2D,0.,ptmax,50,0.,ptmax);
00699   h_ele_PtinVsPtoutShowering_mode = new TH2F( "h_ele_PtinVsPtoutShowering_mode",      "ele track inner pt vs outer pt vs eta, showering, mode of GSF components" ,nbinpt2D,0.,ptmax,50,0.,ptmax);
00700   h_ele_PtinVsPtoutGolden_mean = new TH2F( "h_ele_PtinVsPtoutGolden_mean",      "ele track inner pt vs outer pt vs eta, golden, mean of GSF components" ,nbinpt2D,0.,ptmax,50,0.,ptmax);
00701   h_ele_PtinVsPtoutShowering_mean = new TH2F( "h_ele_PtinVsPtoutShowering_mean",      "ele track inner pt vs outer pt vs eta, showering, mean of GSF components" ,nbinpt2D,0.,ptmax,50,0.,ptmax);
00702   histSclEoEtrueGolden_barrel = new TH1F("h_scl_EoEtrue_golden_barrel","ele supercluster energy / gen energy, golden, barrel",nbinpoptrue,poptruemin,poptruemax);
00703   histSclEoEtrueGolden_barrel->Sumw2();
00704   histSclEoEtrueGolden_endcaps = new TH1F("h_scl_EoEtrue_golden_endcaps","ele supercluster energy / gen energy, golden, endcaps",nbinpoptrue,poptruemin,poptruemax);
00705   histSclEoEtrueGolden_endcaps->Sumw2();
00706   histSclEoEtrueShowering_barrel = new TH1F("h_scl_EoEtrue_showering_barrel","ele supercluster energy / gen energy, showering, barrel",nbinpoptrue,poptruemin,poptruemax);
00707   histSclEoEtrueShowering_barrel->Sumw2();
00708   histSclEoEtrueShowering_endcaps = new TH1F("h_scl_EoEtrue_showering_endcaps","ele supercluster energy / gen energy, showering, endcaps",nbinpoptrue,poptruemin,poptruemax);
00709   histSclEoEtrueShowering_endcaps->Sumw2();
00710 
00711   // isolation
00712   h_ele_tkSumPt_dr03 = new TH1F("h_ele_tkSumPt_dr03","tk isolation sum, dR=0.3",100,0.0,20.);
00713   h_ele_tkSumPt_dr03->Sumw2();
00714   h_ele_ecalRecHitSumEt_dr03= new TH1F("h_ele_ecalRecHitSumEt_dr03","ecal isolation sum, dR=0.3",100,0.0,20.);
00715   h_ele_ecalRecHitSumEt_dr03->Sumw2();
00716   h_ele_hcalDepth1TowerSumEt_dr03= new TH1F("h_ele_hcalDepth1TowerSumEt_dr03","hcal depth1 isolation sum, dR=0.3",100,0.0,20.);
00717   h_ele_hcalDepth1TowerSumEt_dr03->Sumw2();
00718   h_ele_hcalDepth2TowerSumEt_dr03= new TH1F("h_ele_hcalDepth2TowerSumEt_dr03","hcal depth2 isolation sum, dR=0.3",100,0.0,20.);
00719   h_ele_hcalDepth2TowerSumEt_dr03->Sumw2();
00720   h_ele_tkSumPt_dr04= new TH1F("h_ele_tkSumPt_dr04","tk isolation sum, dR=0.4",100,0.0,20.);
00721   h_ele_tkSumPt_dr04->Sumw2();
00722   h_ele_ecalRecHitSumEt_dr04= new TH1F("h_ele_ecalRecHitSumEt_dr04","ecal isolation sum, dR=0.4",100,0.0,20.);
00723   h_ele_ecalRecHitSumEt_dr04->Sumw2();
00724   h_ele_hcalDepth1TowerSumEt_dr04= new TH1F("h_ele_hcalDepth1TowerSumEt_dr04","hcal depth1 isolation sum, dR=0.4",100,0.0,20.);
00725   h_ele_hcalDepth1TowerSumEt_dr04->Sumw2();
00726   h_ele_hcalDepth2TowerSumEt_dr04= new TH1F("h_ele_hcalDepth2TowerSumEt_dr04","hcal depth2 isolation sum, dR=0.4",100,0.0,20.);
00727   h_ele_hcalDepth2TowerSumEt_dr04->Sumw2();
00728 
00729   // fbrem
00730   h_ele_fbrem = new TH1F( "h_ele_fbrem","ele brem fraction, mode of GSF components",100,0.,1.);
00731   h_ele_fbrem->Sumw2();
00732   h_ele_fbrem_eg = new TH1F( "h_ele_fbrem_eg","ele brem fraction, mode of GSF components, ecal driven",100,0.,1.);
00733   h_ele_fbrem_eg->Sumw2();
00734   h_ele_fbremVsEta_mode = new TProfile( "h_ele_fbremvsEtamode","mean ele brem fraction vs eta, mode of GSF components",nbineta2D,etamin,etamax,0.,1.);
00735   h_ele_fbremVsEta_mean = new TProfile( "h_ele_fbremvsEtamean","mean ele brem fraction vs eta, mean of GSF components",nbineta2D,etamin,etamax,0.,1.);
00736 
00737   // e/g et pflow electrons
00738   h_ele_mva = new TH1F( "h_ele_mva","ele identification mva",100,-1.,1.);
00739   h_ele_mva->Sumw2();
00740   h_ele_mva_eg = new TH1F( "h_ele_mva_eg","ele identification mva, ecal driven",100,-1.,1.);
00741   h_ele_mva_eg->Sumw2();
00742   h_ele_provenance = new TH1F( "h_ele_provenance","ele provenance",5,-2.,3.);
00743   h_ele_provenance->Sumw2();
00744 
00745   // histos titles
00746   h_mcNum              -> GetXaxis()-> SetTitle("N_{gen}");
00747   h_mcNum              -> GetYaxis()-> SetTitle("Events");
00748   h_eleNum             -> GetXaxis()-> SetTitle("# gen ele");
00749   h_eleNum             -> GetYaxis()-> SetTitle("Events");
00750   h_gamNum             -> GetXaxis()-> SetTitle("N_{gen #gamma}");
00751   h_gamNum             -> GetYaxis()-> SetTitle("Events");
00752   h_simEta             -> GetXaxis()-> SetTitle("#eta");
00753   h_simEta             -> GetYaxis()-> SetTitle("Events");
00754   h_simP               -> GetXaxis()-> SetTitle("p (GeV/c)");
00755   h_simP               -> GetYaxis()-> SetTitle("Events");
00756   h_ele_foundHits      -> GetXaxis()-> SetTitle("N_{hits}");
00757   h_ele_foundHits      -> GetYaxis()-> SetTitle("Events");
00758   h_ele_foundHits_barrel      -> GetXaxis()-> SetTitle("N_{hits}");
00759   h_ele_foundHits_barrel      -> GetYaxis()-> SetTitle("Events");
00760   h_ele_foundHits_endcaps      -> GetXaxis()-> SetTitle("N_{hits}");
00761   h_ele_foundHits_endcaps      -> GetYaxis()-> SetTitle("Events");
00762   h_ele_ambiguousTracks      -> GetXaxis()-> SetTitle("N_{ambiguous tracks}");
00763   h_ele_ambiguousTracks      -> GetYaxis()-> SetTitle("Events");
00764   h_ele_lostHits       -> GetXaxis()-> SetTitle("N_{lost hits}");
00765   h_ele_lostHits       -> GetYaxis()-> SetTitle("Events");
00766   h_ele_lostHits_barrel       -> GetXaxis()-> SetTitle("N_{lost hits}");
00767   h_ele_lostHits_barrel       -> GetYaxis()-> SetTitle("Events");
00768   h_ele_lostHits_endcaps       -> GetXaxis()-> SetTitle("N_{lost hits}");
00769   h_ele_lostHits_endcaps       -> GetYaxis()-> SetTitle("Events");
00770   h_ele_chi2           -> GetXaxis()-> SetTitle("#Chi^{2}");
00771   h_ele_chi2           -> GetYaxis()-> SetTitle("Events");
00772   h_ele_chi2_barrel           -> GetXaxis()-> SetTitle("#Chi^{2}");
00773   h_ele_chi2_barrel           -> GetYaxis()-> SetTitle("Events");
00774   h_ele_chi2_endcaps           -> GetXaxis()-> SetTitle("#Chi^{2}");
00775   h_ele_chi2_endcaps           -> GetYaxis()-> SetTitle("Events");
00776   h_ele_charge         -> GetXaxis()-> SetTitle("charge");
00777   h_ele_charge         -> GetYaxis()-> SetTitle("Events");
00778   h_ele_vertexP        -> GetXaxis()-> SetTitle("p_{vertex} (GeV/c)");
00779   h_ele_vertexP        -> GetYaxis()-> SetTitle("Events");
00780   h_ele_vertexPt       -> GetXaxis()-> SetTitle("p_{T vertex} (GeV/c)");
00781   h_ele_vertexPt       -> GetYaxis()-> SetTitle("Events");
00782   h_ele_Et       -> GetXaxis()-> SetTitle("E_{T} (GeV)");
00783   h_ele_Et       -> GetYaxis()-> SetTitle("Events");
00784   h_ele_Et_all       -> GetXaxis()-> SetTitle("E_{T} (GeV)");
00785   h_ele_Et_all       -> GetYaxis()-> SetTitle("Events");
00786   h_ele_vertexEta      -> GetXaxis()-> SetTitle("#eta");
00787   h_ele_vertexEta      -> GetYaxis()-> SetTitle("Events");
00788   h_ele_vertexPhi      -> GetXaxis()-> SetTitle("#phi (rad)");
00789   h_ele_vertexPhi      -> GetYaxis()-> SetTitle("Events");
00790   h_ele_PoPtrue        -> GetXaxis()-> SetTitle("P/P_{gen}");
00791   h_ele_PoPtrue        -> GetYaxis()-> SetTitle("Events");
00792   h_ele_PoPtrue_barrel        -> GetXaxis()-> SetTitle("P/P_{gen}");
00793   h_ele_PoPtrue_barrel        -> GetYaxis()-> SetTitle("Events");
00794   h_ele_PoPtrue_endcaps        -> GetXaxis()-> SetTitle("P/P_{gen}");
00795   h_ele_PoPtrue_endcaps        -> GetYaxis()-> SetTitle("Events");
00796   h_ele_PoPtrue_golden_barrel        -> GetXaxis()-> SetTitle("P/P_{gen}");
00797   h_ele_PoPtrue_golden_barrel        -> GetYaxis()-> SetTitle("Events");
00798   h_ele_PoPtrue_showering_barrel        -> GetXaxis()-> SetTitle("P/P_{gen}");
00799   h_ele_PoPtrue_showering_barrel        -> GetYaxis()-> SetTitle("Events");
00800   h_ele_PoPtrue_golden_endcaps        -> GetXaxis()-> SetTitle("P/P_{gen}");
00801   h_ele_PoPtrue_golden_endcaps        -> GetYaxis()-> SetTitle("Events");
00802   h_ele_PoPtrue_showering_endcaps        -> GetXaxis()-> SetTitle("P/P_{gen}");
00803   h_ele_PoPtrue_showering_endcaps        -> GetYaxis()-> SetTitle("Events");
00804   h_ele_PtoPttrue        -> GetXaxis()-> SetTitle("P_{T}/P_{T}^{gen}");
00805   h_ele_PtoPttrue        -> GetYaxis()-> SetTitle("Events");
00806   h_ele_PtoPttrue_barrel        -> GetXaxis()-> SetTitle("P_{T}/P_{T}^{gen}");
00807   h_ele_PtoPttrue_barrel        -> GetYaxis()-> SetTitle("Events");
00808   h_ele_PtoPttrue_endcaps        -> GetXaxis()-> SetTitle("P_{T}/P_{T}^{gen}");
00809   h_ele_PtoPttrue_endcaps        -> GetYaxis()-> SetTitle("Events");
00810   histSclEoEtrue_barrel -> GetXaxis()-> SetTitle("E/E_{gen}") ;
00811   histSclEoEtrue_barrel -> GetYaxis()-> SetTitle("Events") ;
00812   histSclEoEtrue_endcaps -> GetXaxis()-> SetTitle("E/E_{gen}") ;
00813   histSclEoEtrue_endcaps -> GetYaxis()-> SetTitle("Events") ;
00814   histSclEoEtrueGolden_barrel -> GetXaxis()-> SetTitle("E/E_{gen}") ;
00815   histSclEoEtrueGolden_barrel -> GetYaxis()-> SetTitle("Events") ;
00816   histSclEoEtrueShowering_barrel -> GetXaxis()-> SetTitle("E/E_{gen}") ;
00817   histSclEoEtrueShowering_barrel -> GetYaxis()-> SetTitle("Events") ;
00818   histSclEoEtrueGolden_endcaps -> GetXaxis()-> SetTitle("E/E_{gen}") ;
00819   histSclEoEtrueGolden_endcaps -> GetYaxis()-> SetTitle("Events") ;
00820   histSclEoEtrueShowering_endcaps -> GetXaxis()-> SetTitle("E/E_{gen}") ;
00821   histSclEoEtrueShowering_endcaps -> GetYaxis()-> SetTitle("Events") ;
00822   histSclEoEtrue_barrel_etagap -> GetXaxis()-> SetTitle("E/E_{gen}");
00823   histSclEoEtrue_barrel_etagap -> GetYaxis()-> SetTitle("Events");
00824   histSclEoEtrue_barrel_phigap -> GetXaxis()-> SetTitle("E/E_{gen}");
00825   histSclEoEtrue_barrel_phigap -> GetYaxis()-> SetTitle("Events");
00826   histSclEoEtrue_ebeegap -> GetXaxis()-> SetTitle("E/E_{gen}");
00827   histSclEoEtrue_ebeegap -> GetYaxis()-> SetTitle("Events");
00828   histSclEoEtrue_endcaps_deegap -> GetXaxis()-> SetTitle("E/E_{gen}");
00829   histSclEoEtrue_endcaps_deegap -> GetYaxis()-> SetTitle("Events");
00830   histSclEoEtrue_endcaps_ringgap -> GetXaxis()-> SetTitle("E/E_{gen}");
00831   histSclEoEtrue_endcaps_ringgap -> GetYaxis()-> SetTitle("Events");
00832   histSclEoEtrue_barrel_new -> GetXaxis()-> SetTitle("E/E_{gen}") ;
00833   histSclEoEtrue_barrel_new -> GetYaxis()-> SetTitle("Events") ;
00834   histSclEoEtrue_endcaps_new -> GetXaxis()-> SetTitle("E/E_{gen}") ;
00835   histSclEoEtrue_endcaps_new -> GetYaxis()-> SetTitle("Events") ;
00836   histSclEoEtrue_barrel_etagap_new -> GetXaxis()-> SetTitle("E/E_{gen}");
00837   histSclEoEtrue_barrel_etagap_new -> GetYaxis()-> SetTitle("Events");
00838   histSclEoEtrue_barrel_phigap_new -> GetXaxis()-> SetTitle("E/E_{gen}");
00839   histSclEoEtrue_barrel_phigap_new -> GetYaxis()-> SetTitle("Events");
00840   histSclEoEtrue_ebeegap_new -> GetXaxis()-> SetTitle("E/E_{gen}");
00841   histSclEoEtrue_ebeegap_new -> GetYaxis()-> SetTitle("Events");
00842   histSclEoEtrue_endcaps_deegap_new -> GetXaxis()-> SetTitle("E/E_{gen}");
00843   histSclEoEtrue_endcaps_deegap_new -> GetYaxis()-> SetTitle("Events");
00844   histSclEoEtrue_endcaps_ringgap_new -> GetXaxis()-> SetTitle("E/E_{gen}");
00845   histSclEoEtrue_endcaps_ringgap_new -> GetYaxis()-> SetTitle("Events");
00846   histSclSigEtaEta_-> GetXaxis()-> SetTitle("#sigma_{#eta #eta}") ;
00847   histSclSigEtaEta_-> GetYaxis()-> SetTitle("Events") ;
00848   histSclSigEtaEta_barrel_-> GetXaxis()-> SetTitle("#sigma_{#eta #eta}") ;
00849   histSclSigEtaEta_barrel_-> GetYaxis()-> SetTitle("Events") ;
00850   histSclSigEtaEta_endcaps_-> GetXaxis()-> SetTitle("#sigma_{#eta #eta}") ;
00851   histSclSigEtaEta_endcaps_-> GetYaxis()-> SetTitle("Events") ;
00852   histSclSigIEtaIEta_-> GetXaxis()-> SetTitle("#sigma_{i#eta i#eta}") ;
00853   histSclSigIEtaIEta_-> GetYaxis()-> SetTitle("Events") ;
00854   histSclSigIEtaIEta_barrel_-> GetXaxis()-> SetTitle("#sigma_{i#eta i#eta}") ;
00855   histSclSigIEtaIEta_barrel_-> GetYaxis()-> SetTitle("Events") ;
00856   histSclSigIEtaIEta_endcaps_-> GetXaxis()-> SetTitle("#sigma_{i#eta i#eta}") ;
00857   histSclSigIEtaIEta_endcaps_-> GetYaxis()-> SetTitle("Events") ;
00858   histSclE1x5_-> GetXaxis()-> SetTitle("E1x5 (GeV)") ;
00859   histSclE1x5_-> GetYaxis()-> SetTitle("Events") ;
00860   histSclE1x5_barrel_-> GetXaxis()-> SetTitle("E1x5 (GeV)") ;
00861   histSclE1x5_barrel_-> GetYaxis()-> SetTitle("Events") ;
00862   histSclE1x5_endcaps_-> GetXaxis()-> SetTitle("E1x5 (GeV)") ;
00863   histSclE1x5_endcaps_-> GetYaxis()-> SetTitle("Events") ;
00864   histSclE2x5max_-> GetXaxis()-> SetTitle("E2x5 (GeV)") ;
00865   histSclE2x5max_-> GetYaxis()-> SetTitle("Events") ;
00866   histSclE2x5max_barrel_-> GetXaxis()-> SetTitle("E2x5 (GeV)") ;
00867   histSclE2x5max_barrel_-> GetYaxis()-> SetTitle("Events") ;
00868   histSclE2x5max_endcaps_-> GetXaxis()-> SetTitle("E2x5 (GeV)") ;
00869   histSclE2x5max_endcaps_-> GetYaxis()-> SetTitle("Events") ;
00870   histSclE5x5_-> GetXaxis()-> SetTitle("E5x5 (GeV)") ;
00871   histSclE5x5_-> GetYaxis()-> SetTitle("Events") ;
00872   histSclE5x5_barrel_-> GetXaxis()-> SetTitle("E5x5 (GeV)") ;
00873   histSclE5x5_barrel_-> GetYaxis()-> SetTitle("Events") ;
00874   histSclE5x5_endcaps_-> GetXaxis()-> SetTitle("E5x5 (GeV)") ;
00875   histSclE5x5_endcaps_-> GetYaxis()-> SetTitle("Events") ;
00876   histSclEoEtruePfVsEg->GetXaxis()->SetTitle("E/E_{gen} (e/g)") ;
00877   histSclEoEtruePfVsEg->GetYaxis()->SetTitle("E/E_{gen} (pflow)") ;
00878   h_ele_ChargeMnChargeTrue   -> GetXaxis()-> SetTitle("q_{rec} - q_{gen}");
00879   h_ele_ChargeMnChargeTrue   -> GetYaxis()-> SetTitle("Events");
00880   h_ele_EtaMnEtaTrue   -> GetXaxis()-> SetTitle("#eta_{rec} - #eta_{gen}");
00881   h_ele_EtaMnEtaTrue   -> GetYaxis()-> SetTitle("Events");
00882   h_ele_EtaMnEtaTrue_barrel   -> GetXaxis()-> SetTitle("#eta_{rec} - #eta_{gen}");
00883   h_ele_EtaMnEtaTrue_barrel   -> GetYaxis()-> SetTitle("Events");
00884   h_ele_EtaMnEtaTrue_endcaps   -> GetXaxis()-> SetTitle("#eta_{rec} - #eta_{gen}");
00885   h_ele_EtaMnEtaTrue_endcaps   -> GetYaxis()-> SetTitle("Events");
00886   h_ele_PhiMnPhiTrue   -> GetXaxis()-> SetTitle("#phi_{rec} - #phi_{gen} (rad)");
00887   h_ele_PhiMnPhiTrue   -> GetYaxis()-> SetTitle("Events");
00888   h_ele_PhiMnPhiTrue_barrel   -> GetXaxis()-> SetTitle("#phi_{rec} - #phi_{gen} (rad)");
00889   h_ele_PhiMnPhiTrue_barrel   -> GetYaxis()-> SetTitle("Events");
00890   h_ele_PhiMnPhiTrue_endcaps   -> GetXaxis()-> SetTitle("#phi_{rec} - #phi_{gen} (rad)");
00891   h_ele_PhiMnPhiTrue_endcaps   -> GetYaxis()-> SetTitle("Events");
00892   h_ele_PinMnPout      -> GetXaxis()-> SetTitle("P_{vertex} - P_{out} (GeV/c)");
00893   h_ele_PinMnPout      -> GetYaxis()-> SetTitle("Events");
00894   h_ele_PinMnPout_mode      -> GetXaxis()-> SetTitle("P_{vertex} - P_{out}, mode of GSF components (GeV/c)");
00895   h_ele_PinMnPout_mode      -> GetYaxis()-> SetTitle("Events");
00896   h_ele_outerP         -> GetXaxis()-> SetTitle("P_{out} (GeV/c)");
00897   h_ele_outerP         -> GetYaxis()-> SetTitle("Events");
00898   h_ele_outerP_mode         -> GetXaxis()-> SetTitle("P_{out} (GeV/c)");
00899   h_ele_outerP_mode         -> GetYaxis()-> SetTitle("Events");
00900   h_ele_outerPt        -> GetXaxis()-> SetTitle("P_{T out} (GeV/c)");
00901   h_ele_outerPt        -> GetYaxis()-> SetTitle("Events");
00902   h_ele_outerPt_mode        -> GetXaxis()-> SetTitle("P_{T out} (GeV/c)");
00903   h_ele_outerPt_mode        -> GetYaxis()-> SetTitle("Events");
00904   h_ele_EoP            -> GetXaxis()-> SetTitle("E/P_{vertex}");
00905   h_ele_EoP            -> GetYaxis()-> SetTitle("Events");
00906   h_ele_EseedOP            -> GetXaxis()-> SetTitle("E_{seed}/P_{vertex}");
00907   h_ele_EseedOP            -> GetYaxis()-> SetTitle("Events");
00908   h_ele_EoPout         -> GetXaxis()-> SetTitle("E_{seed}/P_{out}");
00909   h_ele_EoPout         -> GetYaxis()-> SetTitle("Events");
00910   h_ele_EeleOPout         -> GetXaxis()-> SetTitle("E_{ele}/P_{out}");
00911   h_ele_EeleOPout         -> GetYaxis()-> SetTitle("Events");
00912   h_ele_EoP_barrel            -> GetXaxis()-> SetTitle("E/P_{vertex}");
00913   h_ele_EoP_barrel            -> GetYaxis()-> SetTitle("Events");
00914   h_ele_EseedOP_barrel            -> GetXaxis()-> SetTitle("E_{seed}/P_{vertex}");
00915   h_ele_EseedOP_barrel            -> GetYaxis()-> SetTitle("Events");
00916   h_ele_EoPout_barrel         -> GetXaxis()-> SetTitle("E_{seed}/P_{out}");
00917   h_ele_EoPout_barrel         -> GetYaxis()-> SetTitle("Events");
00918   h_ele_EeleOPout_barrel         -> GetXaxis()-> SetTitle("E_{ele}/P_{out}");
00919   h_ele_EeleOPout_barrel         -> GetYaxis()-> SetTitle("Events");
00920   h_ele_EoP_endcaps            -> GetXaxis()-> SetTitle("E/P_{vertex}");
00921   h_ele_EoP_endcaps            -> GetYaxis()-> SetTitle("Events");
00922   h_ele_EseedOP_endcaps            -> GetXaxis()-> SetTitle("E_{seed}/P_{vertex}");
00923   h_ele_EseedOP_endcaps            -> GetYaxis()-> SetTitle("Events");
00924   h_ele_EoPout_endcaps         -> GetXaxis()-> SetTitle("E_{seed}/P_{out}");
00925   h_ele_EoPout_endcaps         -> GetYaxis()-> SetTitle("Events");
00926   h_ele_EeleOPout_endcaps         -> GetXaxis()-> SetTitle("E_{ele}/P_{out}");
00927   h_ele_EeleOPout_endcaps         -> GetYaxis()-> SetTitle("Events");
00928   h_ele_vertexX-> GetXaxis()-> SetTitle("x (cm)");
00929   h_ele_vertexX-> GetYaxis()-> SetTitle("Events");
00930   h_ele_vertexY-> GetXaxis()-> SetTitle("y (cm)");
00931   h_ele_vertexY-> GetYaxis()-> SetTitle("Events");
00932   h_ele_vertexZ-> GetXaxis()-> SetTitle("z (cm)");
00933   h_ele_vertexZ-> GetYaxis()-> SetTitle("Events");
00934   h_ele_vertexTIP-> GetXaxis()-> SetTitle("TIP (cm)");
00935   h_ele_vertexTIP-> GetYaxis()-> SetTitle("Events");
00936   h_ele_TIP_all-> GetXaxis()-> SetTitle("r_{T} (cm)");
00937   h_ele_TIP_all-> GetYaxis()-> SetTitle("Events");
00938   h_ele_vertexTIPVsEta-> GetYaxis()-> SetTitle("TIP (cm)");
00939   h_ele_vertexTIPVsEta-> GetXaxis()-> SetTitle("#eta");
00940   h_ele_vertexTIPVsPhi-> GetYaxis()-> SetTitle("TIP (cm)");
00941   h_ele_vertexTIPVsPhi-> GetXaxis()-> SetTitle("#phi (rad)");
00942   h_ele_vertexTIPVsPt-> GetYaxis()-> SetTitle("TIP (cm)");
00943   h_ele_vertexTIPVsPt-> GetXaxis()-> SetTitle("p_{T} (GeV/c)");
00944   h_ele_dEtaSc_propVtx-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
00945   h_ele_dEtaSc_propVtx-> GetYaxis()-> SetTitle("Events");
00946   h_ele_dEtaCl_propOut-> GetXaxis()-> SetTitle("#eta_{seedcl} - #eta_{tr}");
00947   h_ele_dEtaCl_propOut-> GetYaxis()-> SetTitle("Events");
00948   h_ele_dEtaEleCl_propOut-> GetXaxis()-> SetTitle("#eta_{elecl} - #eta_{tr}");
00949   h_ele_dEtaEleCl_propOut-> GetYaxis()-> SetTitle("Events");
00950   h_ele_dPhiSc_propVtx-> GetXaxis()-> SetTitle("#phi_{sc} - #phi_{tr} (rad)");
00951   h_ele_dPhiSc_propVtx-> GetYaxis()-> SetTitle("Events");
00952   h_ele_dPhiCl_propOut-> GetXaxis()-> SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
00953   h_ele_dPhiCl_propOut-> GetYaxis()-> SetTitle("Events");
00954   h_ele_dPhiEleCl_propOut-> GetXaxis()-> SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
00955   h_ele_dPhiEleCl_propOut-> GetYaxis()-> SetTitle("Events");
00956   h_ele_dEtaSc_propVtx_barrel-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
00957   h_ele_dEtaSc_propVtx_barrel-> GetYaxis()-> SetTitle("Events");
00958   h_ele_dEtaCl_propOut_barrel-> GetXaxis()-> SetTitle("#eta_{seedcl} - #eta_{tr}");
00959   h_ele_dEtaCl_propOut_barrel-> GetYaxis()-> SetTitle("Events");
00960   h_ele_dEtaEleCl_propOut_barrel-> GetXaxis()-> SetTitle("#eta_{elecl} - #eta_{tr}");
00961   h_ele_dEtaEleCl_propOut_barrel-> GetYaxis()-> SetTitle("Events");
00962   h_ele_dPhiSc_propVtx_barrel-> GetXaxis()-> SetTitle("#phi_{sc} - #phi_{tr} (rad)");
00963   h_ele_dPhiSc_propVtx_barrel-> GetYaxis()-> SetTitle("Events");
00964   h_ele_dPhiCl_propOut_barrel-> GetXaxis()-> SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
00965   h_ele_dPhiCl_propOut_barrel-> GetYaxis()-> SetTitle("Events");
00966   h_ele_dPhiEleCl_propOut_barrel-> GetXaxis()-> SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
00967   h_ele_dPhiEleCl_propOut_barrel-> GetYaxis()-> SetTitle("Events");
00968   h_ele_dEtaSc_propVtx_endcaps-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
00969   h_ele_dEtaSc_propVtx_endcaps-> GetYaxis()-> SetTitle("Events");
00970   h_ele_dEtaCl_propOut_endcaps-> GetXaxis()-> SetTitle("#eta_{seedcl} - #eta_{tr}");
00971   h_ele_dEtaCl_propOut_endcaps-> GetYaxis()-> SetTitle("Events");
00972   h_ele_dEtaEleCl_propOut_endcaps-> GetXaxis()-> SetTitle("#eta_{elecl} - #eta_{tr}");
00973   h_ele_dEtaEleCl_propOut_endcaps-> GetYaxis()-> SetTitle("Events");
00974   h_ele_dPhiSc_propVtx_endcaps-> GetXaxis()-> SetTitle("#phi_{sc} - #phi_{tr} (rad)");
00975   h_ele_dPhiSc_propVtx_endcaps-> GetYaxis()-> SetTitle("Events");
00976   h_ele_dPhiCl_propOut_endcaps-> GetXaxis()-> SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
00977   h_ele_dPhiCl_propOut_endcaps-> GetYaxis()-> SetTitle("Events");
00978   h_ele_dPhiEleCl_propOut_endcaps-> GetXaxis()-> SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
00979   h_ele_dPhiEleCl_propOut_endcaps-> GetYaxis()-> SetTitle("Events");
00980   h_ele_HoE-> GetXaxis()-> SetTitle("H/E") ;
00981   h_ele_HoE-> GetYaxis()-> SetTitle("Events") ;
00982   h_ele_HoE_barrel-> GetXaxis()-> SetTitle("H/E") ;
00983   h_ele_HoE_barrel-> GetYaxis()-> SetTitle("Events") ;
00984   h_ele_HoE_endcaps-> GetXaxis()-> SetTitle("H/E") ;
00985   h_ele_HoE_endcaps-> GetYaxis()-> SetTitle("Events") ;
00986   h_ele_HoE_fiducial-> GetXaxis()-> SetTitle("H/E") ;
00987   h_ele_HoE_fiducial-> GetYaxis()-> SetTitle("Events") ;
00988   h_ele_fbrem-> GetXaxis()-> SetTitle("P_{in} - P_{out} / P_{in}");
00989   h_ele_fbrem-> GetYaxis()-> SetTitle("Events");
00990   h_ele_seed_dphi2_-> GetXaxis()-> SetTitle("#phi_{hit}-#phi_{pred} (rad)") ;
00991   h_ele_seed_dphi2_-> GetYaxis()-> SetTitle("Events") ;
00992   h_ele_seed_drz2_-> GetXaxis()-> SetTitle("r(z)_{hit}-r(z)_{pred} (cm)") ;
00993   h_ele_seed_drz2_-> GetYaxis()-> SetTitle("Events") ;
00994   h_ele_seed_subdet2_-> GetXaxis()-> SetTitle("2nd hit subdet Id") ;
00995   h_ele_seed_subdet2_-> GetYaxis()-> SetTitle("Events") ;
00996   h_ele_classes-> GetXaxis()-> SetTitle("class Id") ;
00997   h_ele_classes-> GetYaxis()-> SetTitle("Events") ;
00998   h_ele_EoverP_all-> GetXaxis()-> SetTitle("E/P_{vertex}");
00999   h_ele_EoverP_all-> GetYaxis()-> SetTitle("Events");
01000   h_ele_EseedOP_all-> GetXaxis()-> SetTitle("E_{seed}/P_{vertex}");
01001   h_ele_EseedOP_all-> GetYaxis()-> SetTitle("Events");
01002   h_ele_EoPout_all -> GetXaxis()-> SetTitle("E_{seed}/P_{out}");
01003   h_ele_EoPout_all-> GetYaxis()-> SetTitle("Events");
01004   h_ele_EeleOPout_all-> GetXaxis()-> SetTitle("E_{ele}/P_{out}");
01005   h_ele_EeleOPout_all-> GetYaxis()-> SetTitle("Events");
01006   h_ele_dEtaSc_propVtx_all-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
01007   h_ele_dEtaSc_propVtx_all-> GetYaxis()-> SetTitle("Events");
01008   h_ele_dPhiSc_propVtx_all-> GetXaxis()-> SetTitle("#phi_{sc} - #phi_{tr} (rad)");
01009   h_ele_dPhiSc_propVtx_all-> GetYaxis()-> SetTitle("Events");
01010   h_ele_dEtaCl_propOut_all-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
01011   h_ele_dEtaCl_propOut_all-> GetYaxis()-> SetTitle("Events");
01012   h_ele_dPhiCl_propOut_all-> GetXaxis()-> SetTitle("#phi_{sc} - #phi_{tr} (rad)");
01013   h_ele_dPhiCl_propOut_all-> GetYaxis()-> SetTitle("Events");
01014   h_ele_HoE_all-> GetXaxis()-> SetTitle("H/E") ;
01015   h_ele_HoE_all-> GetYaxis()-> SetTitle("Events");
01016   h_ele_mee_all-> GetXaxis()-> SetTitle("m_{ee} (GeV/c^{2})");
01017   h_ele_mee_all-> GetYaxis()-> SetTitle("Events");
01018   h_ele_mee_os-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
01019   h_ele_mee_os-> GetYaxis()-> SetTitle("Events");
01020   h_ele_mee_os_ebeb-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
01021   h_ele_mee_os_ebeb-> GetYaxis()-> SetTitle("Events");
01022   h_ele_mee_os_ebee-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
01023   h_ele_mee_os_ebee-> GetYaxis()-> SetTitle("Events");
01024   h_ele_mee_os_eeee-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
01025   h_ele_mee_os_eeee-> GetYaxis()-> SetTitle("Events");
01026   h_ele_mee_os_gg-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
01027   h_ele_mee_os_gg-> GetYaxis()-> SetTitle("Events");
01028   h_ele_mee_os_gb-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
01029   h_ele_mee_os_gb-> GetYaxis()-> SetTitle("Events");
01030   h_ele_mee_os_bb-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
01031   h_ele_mee_os_bb-> GetYaxis()-> SetTitle("Events");
01032   h_ele_E2mnE1vsMee_all-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
01033   h_ele_E2mnE1vsMee_all-> GetYaxis()-> SetTitle("E2 - E1 (GeV)");
01034   h_ele_E2mnE1vsMee_egeg_all-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
01035   h_ele_E2mnE1vsMee_egeg_all-> GetYaxis()-> SetTitle("E2 - E1 (GeV)");
01036   histNum_-> GetXaxis()-> SetTitle("N_{ele}");
01037   histNum_-> GetYaxis()-> SetTitle("Events");
01038   h_ele_fbremVsEta_mode-> GetXaxis()-> SetTitle("#eta");
01039   h_ele_fbremVsEta_mean-> GetXaxis()-> SetTitle("#eta");
01040 
01041 }
01042 
01043 void
01044 GsfElectronMCAnalyzer::endJob(){
01045 
01046   histfile_->cd();
01047 
01048   std::cout << "[GsfElectronMCAnalyzer] efficiency calculation " << std::endl;
01049   // efficiency vs eta
01050   TH1F *h_ele_etaEff = (TH1F*)h_ele_simEta_matched->Clone("h_ele_etaEff");
01051   h_ele_etaEff->Reset();
01052   h_ele_etaEff->Divide(h_ele_simEta_matched,h_simEta,1,1,"b");
01053   h_ele_etaEff->Print();
01054   h_ele_etaEff->GetXaxis()->SetTitle("#eta");
01055   h_ele_etaEff->GetYaxis()->SetTitle("Efficiency");
01056 
01057   // efficiency vs z
01058   TH1F *h_ele_zEff = (TH1F*)h_ele_simZ_matched->Clone("h_ele_zEff");
01059   h_ele_zEff->Reset();
01060   h_ele_zEff->Divide(h_ele_simZ_matched,h_simZ,1,1,"b");
01061   h_ele_zEff->Print();
01062   h_ele_zEff->GetXaxis()->SetTitle("z (cm)");
01063   h_ele_zEff->GetYaxis()->SetTitle("Efficiency");
01064 
01065   // efficiency vs |eta|
01066   TH1F *h_ele_absetaEff = (TH1F*)h_ele_simAbsEta_matched->Clone("h_ele_absetaEff");
01067   h_ele_absetaEff->Reset();
01068   h_ele_absetaEff->Divide(h_ele_simAbsEta_matched,h_simAbsEta,1,1,"b");
01069   h_ele_absetaEff->GetXaxis()->SetTitle("|#eta|");
01070   h_ele_absetaEff->GetYaxis()->SetTitle("Efficiency");
01071 
01072   // efficiency vs pt
01073   TH1F *h_ele_ptEff = (TH1F*)h_ele_simPt_matched->Clone("h_ele_ptEff");
01074   h_ele_ptEff->Reset();
01075   h_ele_ptEff->Divide(h_ele_simPt_matched,h_simPt,1,1,"b");
01076   h_ele_ptEff->GetXaxis()->SetTitle("p_{T} (GeV/c)");
01077   h_ele_ptEff->GetYaxis()->SetTitle("Efficiency");
01078 
01079   // efficiency vs phi
01080   TH1F *h_ele_phiEff = (TH1F*)h_ele_simPhi_matched->Clone("h_ele_phiEff");
01081   h_ele_phiEff->Reset();
01082   h_ele_phiEff->Divide(h_ele_simPhi_matched,h_simPhi,1,1,"b");
01083   h_ele_phiEff->GetXaxis()->SetTitle("#phi (rad)");
01084   h_ele_phiEff->GetYaxis()->SetTitle("Efficiency");
01085 
01086   // efficiency vs pt eta
01087   TH2F *h_ele_ptEtaEff = (TH2F*)h_ele_simPtEta_matched->Clone("h_ele_ptEtaEff");
01088   h_ele_ptEtaEff->Reset();
01089   h_ele_ptEtaEff->Divide(h_ele_simPtEta_matched,h_simPtEta,1,1,"b");
01090   h_ele_ptEtaEff->GetYaxis()->SetTitle("p_{T} (GeV/c)");
01091   h_ele_ptEtaEff->GetXaxis()->SetTitle("#eta");
01092 
01093   std::cout << "[GsfElectronMCAnalyzer] q-misid calculation " << std::endl;
01094   // misid vs eta
01095   TH1F *h_ele_etaQmisid = (TH1F*)h_ele_simEta_matched_qmisid->Clone("h_ele_etaQmisid");
01096   h_ele_etaQmisid->Reset();
01097   h_ele_etaQmisid->Divide(h_ele_simEta_matched_qmisid,h_simEta,1,1,"b");
01098   h_ele_etaQmisid->Print();
01099   h_ele_etaQmisid->GetXaxis()->SetTitle("#eta");
01100   h_ele_etaQmisid->GetYaxis()->SetTitle("q misId");
01101 
01102   // misid vs z
01103   TH1F *h_ele_zQmisid = (TH1F*)h_ele_simZ_matched_qmisid->Clone("h_ele_zQmisid");
01104   h_ele_zQmisid->Reset();
01105   h_ele_zQmisid->Divide(h_ele_simZ_matched_qmisid,h_simZ,1,1,"b");
01106   h_ele_zQmisid->Print();
01107   h_ele_zQmisid->GetXaxis()->SetTitle("z (cm)");
01108   h_ele_zQmisid->GetYaxis()->SetTitle("q misId");
01109 
01110   // misid vs |eta|
01111   TH1F *h_ele_absetaQmisid = (TH1F*)h_ele_simAbsEta_matched_qmisid->Clone("h_ele_absetaQmisid");
01112   h_ele_absetaQmisid->Reset();
01113   h_ele_absetaQmisid->Divide(h_ele_simAbsEta_matched_qmisid,h_simAbsEta,1,1,"b");
01114   h_ele_absetaQmisid->GetXaxis()->SetTitle("|#eta|");
01115   h_ele_absetaQmisid->GetYaxis()->SetTitle("q misId");
01116 
01117   // misid vs pt
01118   TH1F *h_ele_ptQmisid = (TH1F*)h_ele_simPt_matched_qmisid->Clone("h_ele_ptQmisid");
01119   h_ele_ptQmisid->Reset();
01120   h_ele_ptQmisid->Divide(h_ele_simPt_matched_qmisid,h_simPt,1,1,"b");
01121   h_ele_ptQmisid->GetXaxis()->SetTitle("p_{T} (GeV/c)");
01122   h_ele_ptQmisid->GetYaxis()->SetTitle("q misId");
01123 
01124   std::cout << "[GsfElectronMCAnalyzer] all reco electrons " << std::endl;
01125   // rec/gen all electrons
01126   TH1F *h_ele_etaEff_all = (TH1F*)h_ele_vertexEta_all->Clone("h_ele_etaEff_all");
01127   h_ele_etaEff_all->Reset();
01128   h_ele_etaEff_all->Divide(h_ele_vertexEta_all,h_simEta,1,1,"b");
01129   h_ele_etaEff_all->Print();
01130   h_ele_etaEff_all->GetXaxis()->SetTitle("#eta");
01131   h_ele_etaEff_all->GetYaxis()->SetTitle("N_{rec}/N_{gen}");
01132   TH1F *h_ele_ptEff_all = (TH1F*)h_ele_vertexPt_all->Clone("h_ele_ptEff_all");
01133   h_ele_ptEff_all->Reset();
01134   h_ele_ptEff_all->Divide(h_ele_vertexPt_all,h_simPt,1,1,"b");
01135   h_ele_ptEff_all->Print();
01136   h_ele_ptEff_all->GetXaxis()->SetTitle("p_{T} (GeV/c)");
01137   h_ele_ptEff_all->GetYaxis()->SetTitle("N_{rec}/N_{gen}");
01138 
01139   // classes
01140   TH1F *h_ele_eta_goldenFrac = (TH1F*)h_ele_eta_golden->Clone("h_ele_eta_goldenFrac");
01141   h_ele_eta_goldenFrac->Reset();
01142   h_ele_eta_goldenFrac->Divide(h_ele_eta_golden,h_ele_eta,1,1,"b");
01143   h_ele_eta_goldenFrac->GetXaxis()->SetTitle("|#eta|");
01144   h_ele_eta_goldenFrac->GetYaxis()->SetTitle("Fraction of electrons");
01145   h_ele_eta_goldenFrac->SetTitle("fraction of golden electrons vs eta");
01146   TH1F *h_ele_eta_bbremFrac = (TH1F*)h_ele_eta_bbrem->Clone("h_ele_eta_bbremFrac");
01147   h_ele_eta_bbremFrac->Reset();
01148   h_ele_eta_bbremFrac->GetXaxis()->SetTitle("|#eta|");
01149   h_ele_eta_bbremFrac->GetYaxis()->SetTitle("Fraction of electrons");
01150   h_ele_eta_bbremFrac->Divide(h_ele_eta_bbrem,h_ele_eta,1,1,"b");
01151   h_ele_eta_bbremFrac->SetTitle("fraction of big brem electrons vs eta");
01152   TH1F *h_ele_eta_narrowFrac = (TH1F*)h_ele_eta_narrow->Clone("h_ele_eta_narrowFrac");
01153   h_ele_eta_narrowFrac->Reset();
01154   h_ele_eta_narrowFrac->Divide(h_ele_eta_narrow,h_ele_eta,1,1,"b");
01155   h_ele_eta_narrowFrac->GetXaxis()->SetTitle("|#eta|");
01156   h_ele_eta_narrowFrac->GetYaxis()->SetTitle("Fraction of electrons");
01157   h_ele_eta_narrowFrac->SetTitle("fraction of narrow electrons vs eta");
01158   TH1F *h_ele_eta_showerFrac = (TH1F*)h_ele_eta_shower->Clone("h_ele_eta_showerFrac");
01159   h_ele_eta_showerFrac->Reset();
01160   h_ele_eta_showerFrac->Divide(h_ele_eta_shower,h_ele_eta,1,1,"b");
01161   h_ele_eta_showerFrac->GetXaxis()->SetTitle("|#eta|");
01162   h_ele_eta_showerFrac->GetYaxis()->SetTitle("Fraction of electrons");
01163   h_ele_eta_showerFrac->SetTitle("fraction of showering electrons vs eta");
01164 
01165   // fbrem
01166   TH1F *h_ele_xOverX0VsEta = new TH1F( "h_ele_xOverx0VsEta","mean X/X_0 vs eta",nbineta/2,0.0,2.5);
01167   for (int ibin=1;ibin<h_ele_fbremVsEta_mean->GetNbinsX()+1;ibin++) {
01168     double xOverX0 = 0.;
01169     if (h_ele_fbremVsEta_mean->GetBinContent(ibin)>0.) xOverX0 = -log(h_ele_fbremVsEta_mean->GetBinContent(ibin));
01170     h_ele_xOverX0VsEta->SetBinContent(ibin,xOverX0);
01171   }
01172 
01173   //profiles from 2D histos
01174   TProfile *p_ele_PoPtrueVsEta = h_ele_PoPtrueVsEta->ProfileX();
01175   p_ele_PoPtrueVsEta->SetTitle("mean ele momentum / gen momentum vs eta");
01176   p_ele_PoPtrueVsEta->GetXaxis()->SetTitle("#eta");
01177   p_ele_PoPtrueVsEta->GetYaxis()->SetTitle("<P/P_{gen}>");
01178   p_ele_PoPtrueVsEta->Write();
01179   TProfile *p_ele_PoPtrueVsPhi = h_ele_PoPtrueVsPhi->ProfileX();
01180   p_ele_PoPtrueVsPhi->SetTitle("mean ele momentum / gen momentum vs phi");
01181   p_ele_PoPtrueVsPhi->GetXaxis()->SetTitle("#phi (rad)");
01182   p_ele_PoPtrueVsPhi->GetYaxis()->SetTitle("<P/P_{gen}>");
01183   p_ele_PoPtrueVsPhi->Write();
01184   TProfile *p_ele_EoEtruePfVsEg_x = histSclEoEtruePfVsEg->ProfileX();
01185   p_ele_EoEtruePfVsEg_x->SetTitle("mean pflow sc energy / true energy vs e/g sc energy");
01186   p_ele_EoEtruePfVsEg_x->GetXaxis()->SetTitle("E/E_{gen} (e/g)") ;
01187   p_ele_EoEtruePfVsEg_x->GetYaxis()->SetTitle("<E/E_{gen}> (pflow)") ;
01188   p_ele_EoEtruePfVsEg_x->Write();
01189   TProfile *p_ele_EoEtruePfVsEg_y = histSclEoEtruePfVsEg->ProfileY();
01190   p_ele_EoEtruePfVsEg_y->SetTitle("mean e/g sc energy / true energy vs pflow sc energy");
01191   p_ele_EoEtruePfVsEg_y->GetXaxis()->SetTitle("E/E_{gen} (pflow)") ;
01192   p_ele_EoEtruePfVsEg_y->GetYaxis()->SetTitle("<E/E_{gen}> (eg)") ;
01193   p_ele_EoEtruePfVsEg_y->Write();
01194   TProfile *p_ele_EtaMnEtaTrueVsEta = h_ele_EtaMnEtaTrueVsEta->ProfileX();
01195   p_ele_EtaMnEtaTrueVsEta->SetTitle("mean ele eta - gen eta vs eta");
01196   p_ele_EtaMnEtaTrueVsEta->GetXaxis()->SetTitle("#eta");
01197   p_ele_EtaMnEtaTrueVsEta->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{gen}>");
01198   p_ele_EtaMnEtaTrueVsEta->Write();
01199   TProfile *p_ele_EtaMnEtaTrueVsPhi = h_ele_EtaMnEtaTrueVsPhi->ProfileX();
01200   p_ele_EtaMnEtaTrueVsPhi->SetTitle("mean ele eta - gen eta vs phi");
01201   p_ele_EtaMnEtaTrueVsPhi->GetXaxis()->SetTitle("#phi (rad)");
01202   p_ele_EtaMnEtaTrueVsPhi->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{gen}>");
01203   p_ele_EtaMnEtaTrueVsPhi->Write();
01204   TProfile *p_ele_PhiMnPhiTrueVsEta = h_ele_PhiMnPhiTrueVsEta->ProfileX();
01205   p_ele_PhiMnPhiTrueVsEta->SetTitle("mean ele phi - gen phi vs eta");
01206   p_ele_PhiMnPhiTrueVsEta->GetXaxis()->SetTitle("#eta");
01207   p_ele_PhiMnPhiTrueVsEta->GetYaxis()->SetTitle("<#phi_{rec} - #phi_{gen}> (rad)");
01208   p_ele_PhiMnPhiTrueVsEta->Write();
01209   TProfile *p_ele_PhiMnPhiTrueVsPhi = h_ele_PhiMnPhiTrueVsPhi->ProfileX();
01210   p_ele_PhiMnPhiTrueVsPhi->SetTitle("mean ele phi - gen phi vs phi");
01211   p_ele_PhiMnPhiTrueVsPhi->GetXaxis()->SetTitle("#phi (rad)");
01212   p_ele_PhiMnPhiTrueVsPhi->Write();
01213   TProfile *p_ele_vertexPtVsEta = h_ele_vertexPtVsEta->ProfileX();
01214   p_ele_vertexPtVsEta->SetTitle("mean ele transverse momentum vs eta");
01215   p_ele_vertexPtVsEta->GetXaxis()->SetTitle("#eta");
01216   p_ele_vertexPtVsEta->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
01217   p_ele_vertexPtVsEta->Write();
01218   TProfile *p_ele_vertexPtVsPhi = h_ele_vertexPtVsPhi->ProfileX();
01219   p_ele_vertexPtVsPhi->SetTitle("mean ele transverse momentum vs phi");
01220   p_ele_vertexPtVsPhi->GetXaxis()->SetTitle("#phi (rad)");
01221   p_ele_vertexPtVsPhi->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
01222   p_ele_vertexPtVsPhi->Write();
01223   TProfile *p_ele_EoPVsEta = h_ele_EoPVsEta->ProfileX();
01224   p_ele_EoPVsEta->SetTitle("mean ele E/p vs eta");
01225   p_ele_EoPVsEta->GetXaxis()->SetTitle("#eta");
01226   p_ele_EoPVsEta->GetYaxis()->SetTitle("<E/P_{vertex}>");
01227   p_ele_EoPVsEta->Write();
01228   TProfile *p_ele_EoPVsPhi = h_ele_EoPVsPhi->ProfileX();
01229   p_ele_EoPVsPhi->SetTitle("mean ele E/p vs phi");
01230   p_ele_EoPVsPhi->GetXaxis()->SetTitle("#phi (rad)");
01231   p_ele_EoPVsPhi->GetYaxis()->SetTitle("<E/P_{vertex}>");
01232   p_ele_EoPVsPhi->Write();
01233   TProfile *p_ele_EoPoutVsEta = h_ele_EoPoutVsEta->ProfileX();
01234   p_ele_EoPoutVsEta->SetTitle("mean ele E/pout vs eta");
01235   p_ele_EoPoutVsEta->GetXaxis()->SetTitle("#eta");
01236   p_ele_EoPoutVsEta->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
01237   p_ele_EoPoutVsEta->Write();
01238   TProfile *p_ele_EoPoutVsPhi = h_ele_EoPoutVsPhi->ProfileX();
01239   p_ele_EoPoutVsPhi->SetTitle("mean ele E/pout vs phi");
01240   p_ele_EoPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
01241   p_ele_EoPoutVsPhi->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
01242   p_ele_EoPoutVsPhi->Write();
01243   TProfile *p_ele_EeleOPoutVsEta = h_ele_EeleOPoutVsEta->ProfileX();
01244   p_ele_EeleOPoutVsEta->SetTitle("mean ele Eele/pout vs eta");
01245   p_ele_EeleOPoutVsEta->GetXaxis()->SetTitle("#eta");
01246   p_ele_EeleOPoutVsEta->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
01247   p_ele_EeleOPoutVsEta->Write();
01248   TProfile *p_ele_EeleOPoutVsPhi = h_ele_EeleOPoutVsPhi->ProfileX();
01249   p_ele_EeleOPoutVsPhi->SetTitle("mean ele Eele/pout vs phi");
01250   p_ele_EeleOPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
01251   p_ele_EeleOPoutVsPhi->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
01252   p_ele_EeleOPoutVsPhi->Write();
01253   TProfile *p_ele_HoEVsEta = h_ele_HoEVsEta->ProfileX();
01254   p_ele_HoEVsEta->SetTitle("mean ele H/E vs eta");
01255   p_ele_HoEVsEta->GetXaxis()->SetTitle("#eta");
01256   p_ele_HoEVsEta->GetYaxis()->SetTitle("<H/E>");
01257   p_ele_HoEVsEta->Write();
01258   TProfile *p_ele_HoEVsPhi = h_ele_HoEVsPhi->ProfileX();
01259   p_ele_HoEVsPhi->SetTitle("mean ele H/E vs phi");
01260   p_ele_HoEVsPhi->GetXaxis()->SetTitle("#phi (rad)");
01261   p_ele_HoEVsPhi->GetYaxis()->SetTitle("<H/E>");
01262   p_ele_HoEVsPhi->Write();
01263   TProfile *p_ele_chi2VsEta = h_ele_chi2VsEta->ProfileX();
01264   p_ele_chi2VsEta->SetTitle("mean ele track chi2 vs eta");
01265   p_ele_chi2VsEta->GetXaxis()->SetTitle("#eta");
01266   p_ele_chi2VsEta->GetYaxis()->SetTitle("<#Chi^{2}>");
01267   p_ele_chi2VsEta->Write();
01268   TProfile *p_ele_chi2VsPhi = h_ele_chi2VsPhi->ProfileX();
01269   p_ele_chi2VsPhi->SetTitle("mean ele track chi2 vs phi");
01270   p_ele_chi2VsPhi->GetXaxis()->SetTitle("#phi (rad)");
01271   p_ele_chi2VsPhi->GetYaxis()->SetTitle("<#Chi^{2}>");
01272   p_ele_chi2VsPhi->Write();
01273   TProfile *p_ele_foundHitsVsEta = h_ele_foundHitsVsEta->ProfileX();
01274   p_ele_foundHitsVsEta->SetTitle("mean ele track # found hits vs eta");
01275   p_ele_foundHitsVsEta->GetXaxis()->SetTitle("#eta");
01276   p_ele_foundHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
01277   p_ele_foundHitsVsEta->Write();
01278   TProfile *p_ele_foundHitsVsPhi = h_ele_foundHitsVsPhi->ProfileX();
01279   p_ele_foundHitsVsPhi->SetTitle("mean ele track # found hits vs phi");
01280   p_ele_foundHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
01281   p_ele_foundHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
01282   p_ele_foundHitsVsPhi->Write();
01283   TProfile *p_ele_lostHitsVsEta = h_ele_lostHitsVsEta->ProfileX();
01284   p_ele_lostHitsVsEta->SetTitle("mean ele track # lost hits vs eta");
01285   p_ele_lostHitsVsEta->GetXaxis()->SetTitle("#eta");
01286   p_ele_lostHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
01287   p_ele_lostHitsVsEta->Write();
01288   TProfile *p_ele_lostHitsVsPhi = h_ele_lostHitsVsPhi->ProfileX();
01289   p_ele_lostHitsVsPhi->SetTitle("mean ele track # lost hits vs phi");
01290   p_ele_lostHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
01291   p_ele_lostHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
01292   p_ele_lostHitsVsPhi->Write();
01293   TProfile *p_ele_vertexTIPVsEta = h_ele_vertexTIPVsEta->ProfileX();
01294   p_ele_vertexTIPVsEta->SetTitle("mean tip (wrt gen vtx) vs eta");
01295   p_ele_vertexTIPVsEta->GetXaxis()->SetTitle("#eta");
01296   p_ele_vertexTIPVsEta->GetYaxis()->SetTitle("<TIP> (cm)");
01297   p_ele_vertexTIPVsEta->Write();
01298   TProfile *p_ele_vertexTIPVsPhi = h_ele_vertexTIPVsPhi->ProfileX();
01299   p_ele_vertexTIPVsPhi->SetTitle("mean tip (wrt gen vtx) vs phi");
01300   p_ele_vertexTIPVsPhi->GetXaxis()->SetTitle("#phi");
01301   p_ele_vertexTIPVsPhi->GetYaxis()->SetTitle("<TIP> (cm)");
01302   p_ele_vertexTIPVsPhi->Write();
01303   TProfile *p_ele_vertexTIPVsPt = h_ele_vertexTIPVsPt->ProfileX();
01304   p_ele_vertexTIPVsPt->SetTitle("mean tip (wrt gen vtx) vs phi");
01305   p_ele_vertexTIPVsPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
01306   p_ele_vertexTIPVsPt->GetYaxis()->SetTitle("<TIP> (cm)");
01307   p_ele_vertexTIPVsPt->Write();
01308 
01309   // mc truth
01310   h_mcNum->Write();
01311   h_eleNum->Write();
01312   h_gamNum->Write();
01313 
01314   // rec event
01315   histNum_->Write();
01316 
01317   // mc
01318   h_simEta->Write();
01319   h_simAbsEta->Write();
01320   h_simP->Write();
01321   h_simPt->Write();
01322   h_simZ->Write();
01323   h_simPhi->Write();
01324   h_simPtEta->Write();
01325 
01326   // all electrons
01327   h_ele_EoverP_all->Write();
01328   h_ele_EseedOP_all->Write();
01329   h_ele_EoPout_all->Write();
01330   h_ele_EeleOPout_all ->Write();
01331   h_ele_dEtaSc_propVtx_all->Write();
01332   h_ele_dPhiSc_propVtx_all->Write();
01333   h_ele_dEtaCl_propOut_all ->Write();
01334   h_ele_dPhiCl_propOut_all->Write();
01335   h_ele_HoE_all->Write();
01336   h_ele_TIP_all->Write();
01337   h_ele_vertexPt_all->Write();
01338   h_ele_Et_all->Write();
01339   h_ele_vertexEta_all->Write();
01340   h_ele_mee_all->Write();
01341   h_ele_mee_os->Write();
01342   h_ele_mee_os_ebeb->Write();
01343   h_ele_mee_os_ebee->Write();
01344   h_ele_mee_os_eeee->Write();
01345   h_ele_mee_os_gg->Write();
01346   h_ele_mee_os_gb->Write();
01347   h_ele_mee_os_bb->Write();
01348   h_ele_E2mnE1vsMee_all ->Write();
01349   h_ele_E2mnE1vsMee_egeg_all->Write();
01350 
01351   // charge ID
01352   h_ele_charge->Write();
01353   h_ele_simEta_matched_qmisid->Write();
01354   h_ele_simAbsEta_matched_qmisid->Write();
01355   h_ele_simPt_matched_qmisid->Write();
01356   h_ele_simPhi_matched_qmisid->Write();
01357   h_ele_simZ_matched_qmisid->Write();
01358 
01359   // matched electrons
01360   h_ele_vertexP->Write();
01361   h_ele_vertexPt->Write();
01362   h_ele_Et->Write();
01363   h_ele_vertexPtVsEta->Write();
01364   h_ele_vertexPtVsPhi->Write();
01365   h_ele_simPt_matched->Write();
01366   h_ele_vertexEta->Write();
01367   h_ele_vertexEtaVsPhi->Write();
01368   h_ele_simAbsEta_matched->Write();
01369   h_ele_simEta_matched->Write();
01370   h_ele_simPhi_matched->Write();
01371   h_ele_simPtEta_matched->Write();
01372   h_ele_vertexPhi->Write();
01373   h_ele_vertexX->Write();
01374   h_ele_vertexY ->Write();
01375   h_ele_vertexZ->Write();
01376   h_ele_vertexTIP->Write();
01377   h_ele_simZ_matched->Write();
01378   h_ele_vertexTIPVsEta->Write();
01379   h_ele_vertexTIPVsPhi->Write();
01380   h_ele_vertexTIPVsPt->Write();
01381   h_ele_PoPtrue->Write();
01382   h_ele_PoPtrueVsEta ->Write();
01383   h_ele_PoPtrueVsPhi->Write();
01384   h_ele_PoPtrueVsPt->Write();
01385   h_ele_PoPtrue_barrel ->Write();
01386   h_ele_PoPtrue_endcaps->Write();
01387   h_ele_PoPtrue_golden_barrel ->Write();
01388   h_ele_PoPtrue_golden_endcaps->Write();
01389   h_ele_PoPtrue_showering_barrel ->Write();
01390   h_ele_PoPtrue_showering_endcaps->Write();
01391   h_ele_PtoPttrue->Write();
01392   h_ele_PtoPttrue_barrel ->Write();
01393   h_ele_PtoPttrue_endcaps->Write();
01394   h_ele_ChargeMnChargeTrue->Write();
01395   h_ele_EtaMnEtaTrue->Write();
01396   h_ele_EtaMnEtaTrue_barrel->Write();
01397   h_ele_EtaMnEtaTrue_endcaps->Write();
01398   h_ele_EtaMnEtaTrueVsEta ->Write();
01399   h_ele_EtaMnEtaTrueVsPhi->Write();
01400   h_ele_EtaMnEtaTrueVsPt->Write();
01401   h_ele_PhiMnPhiTrue ->Write();
01402   h_ele_PhiMnPhiTrue_barrel ->Write();
01403   h_ele_PhiMnPhiTrue_endcaps ->Write();
01404   h_ele_PhiMnPhiTrue2 ->Write();
01405   h_ele_PhiMnPhiTrueVsEta->Write();
01406   h_ele_PhiMnPhiTrueVsPhi->Write();
01407   h_ele_PhiMnPhiTrueVsPt->Write();
01408 
01409   // matched electron, superclusters
01410   histSclEn_->Write();
01411   histSclEoEtrue_barrel->Write();
01412   histSclEoEtrue_endcaps->Write();
01413   histSclEoEtrue_barrel_eg->Write();
01414   histSclEoEtrue_endcaps_eg->Write();
01415   histSclEoEtrue_barrel_etagap->Write();
01416   histSclEoEtrue_barrel_phigap->Write();
01417   histSclEoEtrue_ebeegap->Write();
01418   histSclEoEtrue_endcaps->Write();
01419   histSclEoEtrue_endcaps_deegap->Write();
01420   histSclEoEtrue_endcaps_ringgap->Write();
01421   histSclEoEtruePfVsEg->Write();
01422   histSclEoEtrue_barrel_new->Write();
01423   histSclEoEtrue_endcaps_new->Write();
01424   histSclEoEtrue_barrel_eg_new->Write();
01425   histSclEoEtrue_endcaps_eg_new->Write();
01426   histSclEoEtrue_barrel_etagap_new->Write();
01427   histSclEoEtrue_barrel_phigap_new->Write();
01428   histSclEoEtrue_ebeegap_new->Write();
01429   histSclEoEtrue_endcaps_new->Write();
01430   histSclEoEtrue_endcaps_deegap_new->Write();
01431   histSclEoEtrue_endcaps_ringgap_new->Write();
01432   histSclEoEtruePfVsEg->Write();
01433   histSclEt_->Write();
01434   histSclEtVsEta_->Write();
01435   histSclEtVsPhi_->Write();
01436   histSclEtaVsPhi_ ->Write();
01437   histSclEta_->Write();
01438   histSclPhi_->Write();
01439   histSclSigEtaEta_->Write();
01440   histSclSigEtaEta_barrel_->Write();
01441   histSclSigEtaEta_endcaps_->Write();
01442   histSclSigIEtaIEta_->Write();
01443   histSclSigIEtaIEta_barrel_->Write();
01444   histSclSigIEtaIEta_endcaps_->Write();
01445   histSclE1x5_->Write();
01446   histSclE1x5_barrel_->Write();
01447   histSclE1x5_endcaps_->Write();
01448   histSclE2x5max_->Write();
01449   histSclE2x5max_barrel_->Write();
01450   histSclE2x5max_endcaps_->Write();
01451   histSclE5x5_->Write();
01452   histSclE5x5_barrel_->Write();
01453   histSclE5x5_endcaps_->Write();
01454   histSclSigEtaEta_eg_->Write();
01455   histSclSigEtaEta_eg_barrel_->Write();
01456   histSclSigEtaEta_eg_endcaps_->Write();
01457   histSclSigIEtaIEta_eg_->Write();
01458   histSclSigIEtaIEta_eg_barrel_->Write();
01459   histSclSigIEtaIEta_eg_endcaps_->Write();
01460   histSclE1x5_eg_->Write();
01461   histSclE1x5_eg_barrel_->Write();
01462   histSclE1x5_eg_endcaps_->Write();
01463   histSclE2x5max_eg_->Write();
01464   histSclE2x5max_eg_barrel_->Write();
01465   histSclE2x5max_eg_endcaps_->Write();
01466   histSclE5x5_eg_->Write();
01467   histSclE5x5_eg_barrel_->Write();
01468   histSclE5x5_eg_endcaps_->Write();
01469 
01470   // matched electron, gsf tracks
01471   h_ele_ambiguousTracks->Write();
01472   h_ele_ambiguousTracksVsEta->Write();
01473   h_ele_ambiguousTracksVsPhi->Write();
01474   h_ele_ambiguousTracksVsPt->Write();
01475   h_ele_foundHits->Write();
01476   h_ele_foundHits_barrel->Write();
01477   h_ele_foundHits_endcaps->Write();
01478   h_ele_foundHitsVsEta->Write();
01479   h_ele_foundHitsVsPhi->Write();
01480   h_ele_foundHitsVsPt->Write();
01481   h_ele_lostHits->Write();
01482   h_ele_lostHits_barrel->Write();
01483   h_ele_lostHits_endcaps->Write();
01484   h_ele_lostHitsVsEta->Write();
01485   h_ele_lostHitsVsPhi->Write();
01486   h_ele_lostHitsVsPt->Write();
01487   h_ele_chi2 ->Write();
01488   h_ele_chi2_barrel ->Write();
01489   h_ele_chi2_endcaps ->Write();
01490   h_ele_chi2VsEta ->Write();
01491   h_ele_chi2VsPhi ->Write();
01492   h_ele_chi2VsPt->Write();
01493   h_ele_PinMnPout->Write();
01494   h_ele_PinMnPout_mode->Write();
01495   h_ele_PinMnPoutVsEta_mode->Write();
01496   h_ele_PinMnPoutVsPhi_mode->Write();
01497   h_ele_PinMnPoutVsPt_mode->Write();
01498   h_ele_PinMnPoutVsE_mode->Write();
01499   h_ele_PinMnPoutVsChi2_mode->Write();
01500   h_ele_outerP ->Write();
01501   h_ele_outerP_mode->Write();
01502   h_ele_outerPVsEta_mode->Write();
01503   h_ele_outerPt->Write();
01504   h_ele_outerPt_mode ->Write();
01505   h_ele_outerPtVsEta_mode->Write();
01506   h_ele_outerPtVsPhi_mode->Write();
01507   h_ele_outerPtVsPt_mode->Write();
01508 
01509   // matched electrons, matching
01510   h_ele_EoP ->Write();
01511   h_ele_EoP_eg ->Write();
01512   h_ele_EoP_barrel ->Write();
01513   h_ele_EoP_eg_barrel ->Write();
01514   h_ele_EoP_endcaps ->Write();
01515   h_ele_EoP_eg_endcaps ->Write();
01516   h_ele_EoPVsEta ->Write();
01517   h_ele_EoPVsPhi->Write();
01518   h_ele_EoPVsE->Write();
01519   h_ele_EseedOP ->Write();
01520   h_ele_EseedOP_eg ->Write();
01521   h_ele_EseedOP_barrel ->Write();
01522   h_ele_EseedOP_eg_barrel ->Write();
01523   h_ele_EseedOP_endcaps ->Write();
01524   h_ele_EseedOP_eg_endcaps ->Write();
01525   h_ele_EseedOPVsEta ->Write();
01526   h_ele_EseedOPVsPhi->Write();
01527   h_ele_EseedOPVsE->Write();
01528   h_ele_EoPout->Write();
01529   h_ele_EoPout_eg->Write();
01530   h_ele_EoPout_barrel->Write();
01531   h_ele_EoPout_eg_barrel->Write();
01532   h_ele_EoPout_endcaps->Write();
01533   h_ele_EoPout_eg_endcaps->Write();
01534   h_ele_EoPoutVsEta->Write();
01535   h_ele_EoPoutVsPhi->Write();
01536   h_ele_EoPoutVsE ->Write();
01537   h_ele_EeleOPout->Write();
01538   h_ele_EeleOPout_eg->Write();
01539   h_ele_EeleOPout_barrel->Write();
01540   h_ele_EeleOPout_eg_barrel->Write();
01541   h_ele_EeleOPout_endcaps->Write();
01542   h_ele_EeleOPout_eg_endcaps->Write();
01543   h_ele_EeleOPoutVsEta->Write();
01544   h_ele_EeleOPoutVsPhi->Write();
01545   h_ele_EeleOPoutVsE ->Write();
01546   h_ele_dEtaSc_propVtx->Write();
01547   h_ele_dEtaSc_propVtx_eg->Write();
01548   h_ele_dEtaSc_propVtx_barrel->Write();
01549   h_ele_dEtaSc_propVtx_eg_barrel->Write();
01550   h_ele_dEtaSc_propVtx_endcaps->Write();
01551   h_ele_dEtaSc_propVtx_eg_endcaps->Write();
01552   h_ele_dEtaScVsEta_propVtx->Write();
01553   h_ele_dEtaScVsPhi_propVtx->Write();
01554   h_ele_dEtaScVsPt_propVtx ->Write();
01555   h_ele_dPhiSc_propVtx->Write();
01556   h_ele_dPhiSc_propVtx_eg->Write();
01557   h_ele_dPhiSc_propVtx_barrel->Write();
01558   h_ele_dPhiSc_propVtx_eg_barrel->Write();
01559   h_ele_dPhiSc_propVtx_endcaps->Write();
01560   h_ele_dPhiSc_propVtx_eg_endcaps->Write();
01561   h_ele_dPhiScVsEta_propVtx ->Write();
01562   h_ele_dPhiScVsPhi_propVtx->Write();
01563   h_ele_dPhiScVsPt_propVtx->Write();
01564   h_ele_dEtaCl_propOut->Write();
01565   h_ele_dEtaCl_propOut_eg->Write();
01566   h_ele_dEtaCl_propOut_barrel->Write();
01567   h_ele_dEtaCl_propOut_eg_barrel->Write();
01568   h_ele_dEtaCl_propOut_endcaps->Write();
01569   h_ele_dEtaCl_propOut_eg_endcaps->Write();
01570   h_ele_dEtaClVsEta_propOut->Write();
01571   h_ele_dEtaClVsPhi_propOut->Write();
01572   h_ele_dEtaClVsPt_propOut->Write();
01573   h_ele_dPhiCl_propOut->Write();
01574   h_ele_dPhiCl_propOut_eg->Write();
01575   h_ele_dPhiCl_propOut_barrel->Write();
01576   h_ele_dPhiCl_propOut_eg_barrel->Write();
01577   h_ele_dPhiCl_propOut_endcaps->Write();
01578   h_ele_dPhiCl_propOut_eg_endcaps->Write();
01579   h_ele_dPhiClVsEta_propOut->Write();
01580   h_ele_dPhiClVsPhi_propOut->Write();
01581   h_ele_dPhiClVsPt_propOut->Write();
01582   h_ele_dEtaEleCl_propOut->Write();
01583   h_ele_dEtaEleCl_propOut_eg->Write();
01584   h_ele_dEtaEleCl_propOut_barrel->Write();
01585   h_ele_dEtaEleCl_propOut_eg_barrel->Write();
01586   h_ele_dEtaEleCl_propOut_endcaps->Write();
01587   h_ele_dEtaEleCl_propOut_eg_endcaps->Write();
01588   h_ele_dEtaEleClVsEta_propOut->Write();
01589   h_ele_dEtaEleClVsPhi_propOut->Write();
01590   h_ele_dEtaEleClVsPt_propOut->Write();
01591   h_ele_dPhiEleCl_propOut->Write();
01592   h_ele_dPhiEleCl_propOut_eg->Write();
01593   h_ele_dPhiEleCl_propOut_barrel->Write();
01594   h_ele_dPhiEleCl_propOut_eg_barrel->Write();
01595   h_ele_dPhiEleCl_propOut_endcaps->Write();
01596   h_ele_dPhiEleCl_propOut_eg_endcaps->Write();
01597   h_ele_dPhiEleClVsEta_propOut->Write();
01598   h_ele_dPhiEleClVsPhi_propOut->Write();
01599   h_ele_dPhiEleClVsPt_propOut->Write();
01600   h_ele_HoE->Write();
01601   h_ele_HoE_eg->Write();
01602   h_ele_HoE_barrel->Write();
01603   h_ele_HoE_eg_barrel->Write();
01604   h_ele_HoE_endcaps->Write();
01605   h_ele_HoE_eg_endcaps->Write();
01606   h_ele_HoE_fiducial->Write();
01607   h_ele_HoEVsEta->Write();
01608   h_ele_HoEVsPhi->Write();
01609   h_ele_HoEVsE->Write();
01610 
01611   h_ele_seed_dphi2_->Write();
01612   h_ele_seed_subdet2_->Write();
01613   TProfile *p_ele_seed_dphi2VsEta_ = h_ele_seed_dphi2VsEta_->ProfileX();
01614   p_ele_seed_dphi2VsEta_->SetTitle("mean ele seed dphi 2nd layer vs eta");
01615   p_ele_seed_dphi2VsEta_->GetXaxis()->SetTitle("#eta");
01616   p_ele_seed_dphi2VsEta_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
01617   p_ele_seed_dphi2VsEta_->SetMinimum(-0.004);
01618   p_ele_seed_dphi2VsEta_->SetMaximum(0.004);
01619   p_ele_seed_dphi2VsEta_->Write();
01620   TProfile *p_ele_seed_dphi2VsPt_ = h_ele_seed_dphi2VsPt_->ProfileX();
01621   p_ele_seed_dphi2VsPt_->SetTitle("mean ele seed dphi 2nd layer vs pt");
01622   p_ele_seed_dphi2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
01623   p_ele_seed_dphi2VsPt_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
01624   p_ele_seed_dphi2VsPt_->SetMinimum(-0.004);
01625   p_ele_seed_dphi2VsPt_->SetMaximum(0.004);
01626   p_ele_seed_dphi2VsPt_->Write();
01627   h_ele_seed_drz2_->Write();
01628   TProfile *p_ele_seed_drz2VsEta_ = h_ele_seed_drz2VsEta_->ProfileX();
01629   p_ele_seed_drz2VsEta_->SetTitle("mean ele seed dr(dz) 2nd layer vs eta");
01630   p_ele_seed_drz2VsEta_->GetXaxis()->SetTitle("#eta");
01631   p_ele_seed_drz2VsEta_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
01632   p_ele_seed_drz2VsEta_->SetMinimum(-0.15);
01633   p_ele_seed_drz2VsEta_->SetMaximum(0.15);
01634   p_ele_seed_drz2VsEta_->Write();
01635   TProfile *p_ele_seed_drz2VsPt_ = h_ele_seed_drz2VsPt_->ProfileX();
01636   p_ele_seed_drz2VsPt_->SetTitle("mean ele seed dr(dz) 2nd layer vs pt");
01637   p_ele_seed_drz2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
01638   p_ele_seed_drz2VsPt_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
01639   p_ele_seed_drz2VsPt_->SetMinimum(-0.15);
01640   p_ele_seed_drz2VsPt_->SetMaximum(0.15);
01641   p_ele_seed_drz2VsPt_->Write();
01642 
01643   // classes
01644   h_ele_classes->Write();
01645   h_ele_eta->Write();
01646   h_ele_eta_golden->Write();
01647   h_ele_eta_bbrem->Write();
01648   h_ele_eta_narrow->Write();
01649   h_ele_eta_shower->Write();
01650   h_ele_PinVsPoutGolden_mode->Write();
01651   h_ele_PinVsPoutShowering_mode->Write();
01652   h_ele_PinVsPoutGolden_mean->Write();
01653   h_ele_PinVsPoutShowering_mean->Write();
01654   h_ele_PtinVsPtoutGolden_mode->Write();
01655   h_ele_PtinVsPtoutShowering_mode->Write();
01656   h_ele_PtinVsPtoutGolden_mean->Write();
01657   h_ele_PtinVsPtoutShowering_mean->Write();
01658   histSclEoEtrueGolden_barrel->Write();
01659   histSclEoEtrueGolden_endcaps->Write();
01660   histSclEoEtrueShowering_barrel->Write();
01661   histSclEoEtrueShowering_endcaps->Write();
01662 
01663   // fbrem
01664   h_ele_fbrem->Write();
01665   h_ele_fbrem_eg->Write();
01666   h_ele_fbremVsEta_mode->GetXaxis()->SetTitle("#eta");
01667   h_ele_fbremVsEta_mode->GetYaxis()->SetTitle("<P_{in} - P_{out} / P_{in}>");
01668   h_ele_fbremVsEta_mode->Write();
01669   h_ele_fbremVsEta_mean->GetXaxis()->SetTitle("#eta");
01670   h_ele_fbremVsEta_mean->GetYaxis()->SetTitle("<P_{in} - P_{out} / P_{in}>");
01671   h_ele_fbremVsEta_mean->Write();
01672   h_ele_eta_goldenFrac->Write();
01673   h_ele_eta_bbremFrac->Write();
01674   h_ele_eta_narrowFrac->Write();
01675   h_ele_eta_showerFrac->Write();
01676   h_ele_xOverX0VsEta->Write();
01677 
01678   // efficiencies
01679   h_ele_etaEff->Write();
01680   h_ele_zEff->Write();
01681   h_ele_phiEff->Write();
01682   h_ele_absetaEff->Write();
01683   h_ele_ptEff->Write();
01684   h_ele_ptEtaEff->Write();
01685   h_ele_etaEff_all->Write();
01686   h_ele_ptEff_all->Write();
01687 
01688   // q misid
01689   h_ele_etaQmisid->Write();
01690   h_ele_zQmisid->Write();
01691   h_ele_absetaQmisid->Write();
01692   h_ele_ptQmisid->Write();
01693 
01694   // e/g et pflow electrons
01695   h_ele_mva->Write();
01696   h_ele_mva_eg->Write();
01697   h_ele_provenance->Write();
01698 
01699   // isolation
01700   h_ele_tkSumPt_dr03->GetXaxis()->SetTitle("TkIsoSum, cone 0.3 (GeV/c)");
01701   h_ele_tkSumPt_dr03->GetYaxis()->SetTitle("Events");
01702   h_ele_tkSumPt_dr03->Write();
01703   h_ele_ecalRecHitSumEt_dr03->GetXaxis()->SetTitle("EcalIsoSum, cone 0.3 (GeV)");
01704   h_ele_ecalRecHitSumEt_dr03->GetYaxis()->SetTitle("Events");
01705   h_ele_ecalRecHitSumEt_dr03->Write();
01706   h_ele_hcalDepth1TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.3 (GeV)");
01707   h_ele_hcalDepth1TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
01708   h_ele_hcalDepth1TowerSumEt_dr03->Write();
01709   h_ele_hcalDepth2TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.3 (GeV)");
01710   h_ele_hcalDepth2TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
01711   h_ele_hcalDepth2TowerSumEt_dr03->Write();
01712   h_ele_tkSumPt_dr04->GetXaxis()->SetTitle("TkIsoSum, cone 0.4 (GeV/c)");
01713   h_ele_tkSumPt_dr04->GetYaxis()->SetTitle("Events");
01714   h_ele_tkSumPt_dr04->Write();
01715   h_ele_ecalRecHitSumEt_dr04->GetXaxis()->SetTitle("EcalIsoSum, cone 0.4 (GeV)");
01716   h_ele_ecalRecHitSumEt_dr04->GetYaxis()->SetTitle("Events");
01717   h_ele_ecalRecHitSumEt_dr04->Write();
01718   h_ele_hcalDepth1TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.4 (GeV)");
01719   h_ele_hcalDepth1TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
01720   h_ele_hcalDepth1TowerSumEt_dr04->Write();
01721   h_ele_hcalDepth2TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.4 (GeV)");
01722   h_ele_hcalDepth2TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
01723   h_ele_hcalDepth2TowerSumEt_dr04->Write();
01724 
01725 }
01726 
01727 GsfElectronMCAnalyzer::~GsfElectronMCAnalyzer()
01728 {
01729 
01730   // do anything here that needs to be done at desctruction time
01731   // (e.g. close files, deallocate resources etc.)
01732   histfile_->Write();
01733   histfile_->Close();
01734 
01735 }
01736 
01737 
01738 //=========================================================================
01739 // Main method
01740 //=========================================================================
01741 
01742 void
01743 GsfElectronMCAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
01744 {
01745   std::cout << "analyzing new event " << std::endl;
01746   // get electrons
01747 
01748   edm::Handle<GsfElectronCollection> gsfElectrons;
01749   iEvent.getByLabel(electronCollection_,gsfElectrons);
01750   edm::LogInfo("")<<"\n\n =================> Treating event "<<iEvent.id()<<" Number of electrons "<<gsfElectrons.product()->size();
01751 
01752   edm::Handle<GenParticleCollection> genParticles;
01753   iEvent.getByLabel(mcTruthCollection_, genParticles);
01754 
01755   histNum_->Fill((*gsfElectrons).size());
01756 
01757   // all rec electrons
01758   for (reco::GsfElectronCollection::const_iterator gsfIter=gsfElectrons->begin();
01759    gsfIter!=gsfElectrons->end(); gsfIter++){
01760     // preselect electrons
01761     if (gsfIter->pt()>maxPt_ || std::abs(gsfIter->eta())>maxAbsEta_) continue;
01762     h_ele_EoverP_all     -> Fill( gsfIter->eSuperClusterOverP() );
01763     h_ele_EseedOP_all     -> Fill( gsfIter->eSeedClusterOverP() );
01764     h_ele_EoPout_all     -> Fill( gsfIter->eSeedClusterOverPout() );
01765     h_ele_EeleOPout_all     -> Fill( gsfIter->eEleClusterOverPout() );
01766     h_ele_dEtaSc_propVtx_all -> Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx());
01767     h_ele_dPhiSc_propVtx_all -> Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx());
01768     h_ele_dEtaCl_propOut_all -> Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo());
01769     h_ele_dPhiCl_propOut_all -> Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo());
01770     h_ele_HoE_all     -> Fill( gsfIter->hadronicOverEm() );
01771     double d = gsfIter->vertex().x()*gsfIter->vertex().x()+gsfIter->vertex().y()*gsfIter->vertex().y();
01772     h_ele_TIP_all     -> Fill( sqrt(d) );
01773     h_ele_vertexEta_all     -> Fill( gsfIter->eta() );
01774     h_ele_vertexPt_all      -> Fill( gsfIter->pt() );
01775     h_ele_Et_all      -> Fill( gsfIter->superCluster()->energy()/cosh(gsfIter->superCluster()->eta()));
01776     float enrj1=gsfIter->superCluster()->energy();
01777     // mee
01778     for (reco::GsfElectronCollection::const_iterator gsfIter2=gsfIter+1;
01779      gsfIter2!=gsfElectrons->end(); gsfIter2++){
01780         math::XYZTLorentzVector p12 = (*gsfIter).p4()+(*gsfIter2).p4();
01781         float mee2 = p12.Dot(p12);
01782         float enrj2=gsfIter2->superCluster()->energy();
01783         h_ele_mee_all -> Fill(sqrt(mee2));
01784         h_ele_E2mnE1vsMee_all->Fill(sqrt(mee2),enrj2-enrj1);
01785         if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed()) h_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2),enrj2-enrj1);
01786         if (gsfIter->charge()*gsfIter2->charge()<0.) {
01787           h_ele_mee_os -> Fill(sqrt(mee2));
01788           if (gsfIter->isEB() && gsfIter2->isEB()) h_ele_mee_os_ebeb -> Fill(sqrt(mee2));
01789           if ((gsfIter->isEB() && gsfIter2->isEE()) || (gsfIter->isEE() && gsfIter2->isEB())) h_ele_mee_os_ebee -> Fill(sqrt(mee2));
01790           if (gsfIter->isEE() && gsfIter2->isEE()) h_ele_mee_os_eeee -> Fill(sqrt(mee2));
01791           if ((gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::GOLDEN) ||
01792              (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::BIGBREM) ||
01793              //(gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::OLDNARROW) ||
01794              (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::GOLDEN) ||
01795              (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::BIGBREM)/* ||
01796              (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::OLDNARROW) ||
01797              (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::GOLDEN) ||
01798              (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::BIGBREM) ||
01799              (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::OLDNARROW)*/ )
01800            { h_ele_mee_os_gg -> Fill(sqrt(mee2));}
01801           else if (
01802              (gsfIter->classification()==GsfElectron::SHOWERING && gsfIter2->classification()==GsfElectron::SHOWERING) ||
01803              (gsfIter->classification()==GsfElectron::SHOWERING && gsfIter2->isGap()) ||
01804              (gsfIter->isGap() && gsfIter2->classification()==GsfElectron::SHOWERING) ||
01805              (gsfIter->isGap() && gsfIter2->isGap()))
01806            { h_ele_mee_os_bb -> Fill(sqrt(mee2));}
01807           else
01808            { h_ele_mee_os_gb -> Fill(sqrt(mee2));}
01809         }
01810     }
01811   }
01812 
01813   int mcNum=0, gamNum=0, eleNum=0;
01814   bool matchingID, matchingMotherID;
01815 
01816   // charge mis-ID
01817   for (reco::GenParticleCollection::const_iterator mcIter=genParticles->begin(); mcIter != genParticles->end(); mcIter++ ) {
01818 
01819     // select requested matching gen particle
01820     matchingID=false;
01821     for (unsigned int i=0; i<matchingIDs_.size(); i++)
01822      if ( mcIter->pdgId() == matchingIDs_[i] ) matchingID=true;
01823 
01824     if (matchingID) {
01825 
01826       // select requested mother matching gen particle
01827       // always include single particle with no mother
01828       const Candidate * mother = mcIter->mother();
01829       matchingMotherID=false;
01830       for (unsigned int i=0; i<matchingMotherIDs_.size(); i++)
01831         if ((mother == 0) || ((mother != 0) &&  mother->pdgId() == matchingMotherIDs_[i]) ) matchingMotherID=true;
01832 
01833       if (matchingMotherID) {
01834 
01835       if (mcIter->pt()> maxPt_ || std::abs(mcIter->eta())> maxAbsEta_) continue;
01836 
01837       // suppress the endcaps
01838       //if (std::abs(mcIter->eta()) > 1.5) continue;
01839       // select central z
01840       //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
01841 
01842       // looking for the best matching gsf electron
01843       bool okGsfFound = false;
01844       double gsfOkRatio = 999999.;
01845 
01846       // find best matched electron
01847       reco::GsfElectron bestGsfElectron;
01848       for (reco::GsfElectronCollection::const_iterator gsfIter=gsfElectrons->begin();
01849        gsfIter!=gsfElectrons->end(); gsfIter++){
01850 
01851         double dphi = gsfIter->phi()-mcIter->phi();
01852         if (std::abs(dphi)>CLHEP::pi)
01853          dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
01854         double deltaR = sqrt(std::pow((gsfIter->eta()-mcIter->eta()),2) + std::pow(dphi,2));
01855         if ( deltaR < deltaR_ ){
01856           double mc_charge = mcIter->pdgId() == 11 ? -1. : 1. ;
01857           h_ele_ChargeMnChargeTrue  -> Fill( std::abs(gsfIter->charge()-mc_charge));
01858           // require here a charge mismatch
01859           if ( ( (mcIter->pdgId() == 11) && (gsfIter->charge() > 0.) ) ||
01860                ( (mcIter->pdgId() == -11) && (gsfIter->charge() < 0.) ) )
01861            {
01862             double tmpGsfRatio = gsfIter->p()/mcIter->p();
01863             if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) ) {
01864               gsfOkRatio = tmpGsfRatio;
01865               bestGsfElectron=*gsfIter;
01866               okGsfFound = true;
01867             }
01868           }
01869         }
01870       } // loop over rec ele to look for the best one
01871 
01872       // analysis when the mc track is found
01873       if (okGsfFound)
01874        {
01875 
01876         // generated distributions for matched electrons
01877         h_ele_simPt_matched_qmisid      -> Fill( mcIter->pt() );
01878         h_ele_simPhi_matched_qmisid   -> Fill( mcIter->phi() );
01879         h_ele_simAbsEta_matched_qmisid     -> Fill( std::abs(mcIter->eta()) );
01880         h_ele_simEta_matched_qmisid     -> Fill( mcIter->eta() );
01881         h_ele_simZ_matched_qmisid     -> Fill( mcIter->vz() );
01882 
01883        }
01884       }
01885     }
01886 
01887   }
01888 
01889   // association mc-reco
01890   for (reco::GenParticleCollection::const_iterator mcIter=genParticles->begin(); mcIter != genParticles->end(); mcIter++ ) {
01891 
01892     // number of mc particles
01893     mcNum++;
01894 
01895     // counts photons
01896     if (mcIter->pdgId() == 22 ){ gamNum++; }
01897 
01898       // select requested matching gen particle
01899       matchingID=false;
01900       for (unsigned int i=0; i<matchingIDs_.size(); i++)
01901        if ( mcIter->pdgId() == matchingIDs_[i] ) matchingID=true;
01902 
01903       if (matchingID) {
01904 
01905       // select requested mother matching gen particle
01906       // always include single particle with no mother
01907       const Candidate * mother = mcIter->mother();
01908       matchingMotherID=false;
01909       for (unsigned int i=0; i<matchingMotherIDs_.size(); i++)
01910        if ((mother == 0) || ((mother != 0) &&  mother->pdgId() == matchingMotherIDs_[i]) ) matchingMotherID=true;
01911 
01912       if (matchingMotherID) {
01913 
01914       if (mcIter->pt()> maxPt_ || std::abs(mcIter->eta())> maxAbsEta_) continue;
01915 
01916       // suppress the endcaps
01917       //if (std::abs(mcIter->eta()) > 1.5) continue;
01918       // select central z
01919       //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
01920 
01921       eleNum++;
01922       h_simEta -> Fill( mcIter->eta() );
01923       h_simAbsEta -> Fill( std::abs(mcIter->eta()) );
01924       h_simP   -> Fill( mcIter->p() );
01925       h_simPt   -> Fill( mcIter->pt() );
01926       h_simPhi   -> Fill( mcIter->phi() );
01927       h_simZ   -> Fill( mcIter->vz() );
01928       h_simPtEta   -> Fill( mcIter->eta(),mcIter->pt() );
01929 
01930       // looking for the best matching gsf electron
01931       bool okGsfFound = false;
01932       double gsfOkRatio = 999999.;
01933 
01934       // find best matched electron
01935       reco::GsfElectron bestGsfElectron;
01936       for (reco::GsfElectronCollection::const_iterator gsfIter=gsfElectrons->begin();
01937        gsfIter!=gsfElectrons->end(); gsfIter++){
01938 
01939         double dphi = gsfIter->phi()-mcIter->phi();
01940         if (std::abs(dphi)>CLHEP::pi)
01941          dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
01942         double deltaR = sqrt(std::pow((gsfIter->eta()-mcIter->eta()),2) + std::pow(dphi,2));
01943         if ( deltaR < deltaR_ ){
01944           if ( ( (mcIter->pdgId() == 11) && (gsfIter->charge() < 0.) ) ||
01945                ( (mcIter->pdgId() == -11) && (gsfIter->charge() > 0.) ) )
01946            {
01947             double tmpGsfRatio = gsfIter->p()/mcIter->p();
01948             if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) ) {
01949               gsfOkRatio = tmpGsfRatio;
01950               bestGsfElectron=*gsfIter;
01951               okGsfFound = true;
01952             }
01953           }
01954         }
01955       } // loop over rec ele to look for the best one
01956 
01957       // analysis when the mc track is found
01958      if (okGsfFound){
01959 
01960         // electron related distributions
01961         h_ele_charge        -> Fill( bestGsfElectron.charge() );
01962         h_ele_chargeVsEta        -> Fill( bestGsfElectron.eta(),bestGsfElectron.charge() );
01963         h_ele_chargeVsPhi        -> Fill( bestGsfElectron.phi(),bestGsfElectron.charge() );
01964         h_ele_chargeVsPt        -> Fill( bestGsfElectron.pt(),bestGsfElectron.charge() );
01965         h_ele_vertexP       -> Fill( bestGsfElectron.p() );
01966         h_ele_vertexPt      -> Fill( bestGsfElectron.pt() );
01967         h_ele_Et      -> Fill( bestGsfElectron.superCluster()->energy()/cosh(bestGsfElectron.superCluster()->eta()));
01968         h_ele_vertexPtVsEta      -> Fill(  bestGsfElectron.eta(),bestGsfElectron.pt() );
01969         h_ele_vertexPtVsPhi      -> Fill(  bestGsfElectron.phi(),bestGsfElectron.pt() );
01970         h_ele_vertexEta     -> Fill( bestGsfElectron.eta() );
01971         // generated distributions for matched electrons
01972         h_ele_simPt_matched      -> Fill( mcIter->pt() );
01973         h_ele_simPhi_matched   -> Fill( mcIter->phi() );
01974         h_ele_simAbsEta_matched     -> Fill( std::abs(mcIter->eta()) );
01975         h_ele_simEta_matched     -> Fill( mcIter->eta() );
01976         h_ele_simPtEta_matched      -> Fill(  mcIter->eta(),mcIter->pt() );
01977         h_ele_vertexEtaVsPhi     -> Fill(  bestGsfElectron.phi(),bestGsfElectron.eta() );
01978         h_ele_vertexPhi     -> Fill( bestGsfElectron.phi() );
01979         h_ele_vertexX     -> Fill( bestGsfElectron.vertex().x() );
01980         h_ele_vertexY     -> Fill( bestGsfElectron.vertex().y() );
01981         h_ele_vertexZ     -> Fill( bestGsfElectron.vertex().z() );
01982         h_ele_simZ_matched   -> Fill( mcIter->vz() );
01983         double d = (bestGsfElectron.vertex().x()-mcIter->vx())
01984                   *(bestGsfElectron.vertex().x()-mcIter->vx())+
01985                    (bestGsfElectron.vertex().y()-mcIter->vy())
01986                   *(bestGsfElectron.vertex().y()-mcIter->vy());
01987         d = sqrt(d);
01988         h_ele_vertexTIP     -> Fill( d );
01989         h_ele_vertexTIPVsEta     -> Fill(  bestGsfElectron.eta(), d );
01990         h_ele_vertexTIPVsPhi     -> Fill(  bestGsfElectron.phi(), d );
01991         h_ele_vertexTIPVsPt     -> Fill(  bestGsfElectron.pt(), d );
01992         h_ele_EtaMnEtaTrue  -> Fill( bestGsfElectron.eta()-mcIter->eta());
01993         if (bestGsfElectron.isEB()) h_ele_EtaMnEtaTrue_barrel  -> Fill( bestGsfElectron.eta()-mcIter->eta());
01994         if (bestGsfElectron.isEE()) h_ele_EtaMnEtaTrue_endcaps  -> Fill( bestGsfElectron.eta()-mcIter->eta());
01995         h_ele_EtaMnEtaTrueVsEta  -> Fill( bestGsfElectron.eta(), bestGsfElectron.eta()-mcIter->eta());
01996         h_ele_EtaMnEtaTrueVsPhi  -> Fill( bestGsfElectron.phi(), bestGsfElectron.eta()-mcIter->eta());
01997         h_ele_EtaMnEtaTrueVsPt  -> Fill( bestGsfElectron.pt(), bestGsfElectron.eta()-mcIter->eta());
01998         h_ele_PhiMnPhiTrue  -> Fill( bestGsfElectron.phi()-mcIter->phi());
01999         if (bestGsfElectron.isEB()) h_ele_PhiMnPhiTrue_barrel  -> Fill( bestGsfElectron.phi()-mcIter->phi());
02000         if (bestGsfElectron.isEE()) h_ele_PhiMnPhiTrue_endcaps  -> Fill( bestGsfElectron.phi()-mcIter->phi());
02001         h_ele_PhiMnPhiTrue2  -> Fill( bestGsfElectron.phi()-mcIter->phi());
02002         h_ele_PhiMnPhiTrueVsEta  -> Fill( bestGsfElectron.eta(), bestGsfElectron.phi()-mcIter->phi());
02003         h_ele_PhiMnPhiTrueVsPhi  -> Fill( bestGsfElectron.phi(), bestGsfElectron.phi()-mcIter->phi());
02004         h_ele_PhiMnPhiTrueVsPt  -> Fill( bestGsfElectron.pt(), bestGsfElectron.phi()-mcIter->phi());
02005         h_ele_PoPtrue       -> Fill( bestGsfElectron.p()/mcIter->p());
02006         h_ele_PtoPttrue       -> Fill( bestGsfElectron.pt()/mcIter->pt());
02007         h_ele_PoPtrueVsEta       -> Fill( bestGsfElectron.eta(), bestGsfElectron.p()/mcIter->p());
02008         h_ele_PoPtrueVsPhi       -> Fill( bestGsfElectron.phi(), bestGsfElectron.p()/mcIter->p());
02009         h_ele_PoPtrueVsPt       -> Fill( bestGsfElectron.py(), bestGsfElectron.p()/mcIter->p());
02010         if (bestGsfElectron.isEB()) h_ele_PoPtrue_barrel       -> Fill( bestGsfElectron.p()/mcIter->p());
02011         if (bestGsfElectron.isEE()) h_ele_PoPtrue_endcaps       -> Fill( bestGsfElectron.p()/mcIter->p());
02012         if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_PoPtrue_golden_barrel       -> Fill( bestGsfElectron.p()/mcIter->p());
02013         if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_PoPtrue_golden_endcaps       -> Fill( bestGsfElectron.p()/mcIter->p());
02014         if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::SHOWERING) h_ele_PoPtrue_showering_barrel       -> Fill( bestGsfElectron.p()/mcIter->p());
02015         if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::SHOWERING) h_ele_PoPtrue_showering_endcaps       -> Fill( bestGsfElectron.p()/mcIter->p());
02016         if (bestGsfElectron.isEB()) h_ele_PtoPttrue_barrel       -> Fill( bestGsfElectron.pt()/mcIter->pt());
02017         if (bestGsfElectron.isEE()) h_ele_PtoPttrue_endcaps       -> Fill( bestGsfElectron.pt()/mcIter->pt());
02018 
02019         // supercluster related distributions
02020         reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
02021         if (!bestGsfElectron.ecalDrivenSeed()&&bestGsfElectron.trackerDrivenSeed()) sclRef = bestGsfElectron.pflowSuperCluster();
02022         histSclEn_->Fill(sclRef->energy());
02023         double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
02024         double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
02025         histSclEt_->Fill(sclRef->energy()*(Rt/R));
02026         histSclEtVsEta_->Fill(sclRef->eta(),sclRef->energy()*(Rt/R));
02027         histSclEtVsPhi_->Fill(sclRef->phi(),sclRef->energy()*(Rt/R));
02028         if (bestGsfElectron.isEB())  histSclEoEtrue_barrel->Fill(sclRef->energy()/mcIter->p());
02029         if (bestGsfElectron.isEE())  histSclEoEtrue_endcaps->Fill(sclRef->energy()/mcIter->p());
02030         if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())  histSclEoEtrue_barrel_eg->Fill(sclRef->energy()/mcIter->p());
02031         if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())  histSclEoEtrue_endcaps_eg->Fill(sclRef->energy()/mcIter->p());
02032         if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap())  histSclEoEtrue_barrel_etagap->Fill(sclRef->energy()/mcIter->p());
02033         if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap())  histSclEoEtrue_barrel_phigap->Fill(sclRef->energy()/mcIter->p());
02034         if (bestGsfElectron.isEBEEGap())  histSclEoEtrue_ebeegap->Fill(sclRef->energy()/mcIter->p());
02035         //if (bestGsfElectron.isEE())  histSclEoEtrue_endcaps->Fill(sclRef->energy()/mcIter->p());
02036         if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap())  histSclEoEtrue_endcaps_deegap->Fill(sclRef->energy()/mcIter->p());
02037         if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap())  histSclEoEtrue_endcaps_ringgap->Fill(sclRef->energy()/mcIter->p());
02038         if (bestGsfElectron.isEB())  histSclEoEtrue_barrel_new->Fill(sclRef->energy()/mcIter->p());
02039         if (bestGsfElectron.isEE())  histSclEoEtrue_endcaps_new->Fill(sclRef->energy()/mcIter->p());
02040         if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())  histSclEoEtrue_barrel_eg_new->Fill(sclRef->energy()/mcIter->p());
02041         if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())  histSclEoEtrue_endcaps_eg_new->Fill(sclRef->energy()/mcIter->p());
02042         if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap())  histSclEoEtrue_barrel_etagap_new->Fill(sclRef->energy()/mcIter->p());
02043         if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap())  histSclEoEtrue_barrel_phigap_new->Fill(sclRef->energy()/mcIter->p());
02044         if (bestGsfElectron.isEBEEGap())  histSclEoEtrue_ebeegap_new->Fill(sclRef->energy()/mcIter->p());
02045         //if (bestGsfElectron.isEE())  histSclEoEtrue_endcaps_new->Fill(sclRef->energy()/mcIter->p());
02046         if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap())  histSclEoEtrue_endcaps_deegap_new->Fill(sclRef->energy()/mcIter->p());
02047         if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap())  histSclEoEtrue_endcaps_ringgap_new->Fill(sclRef->energy()/mcIter->p());
02048         histSclEta_->Fill(sclRef->eta());
02049         histSclEtaVsPhi_->Fill(sclRef->phi(),sclRef->eta());
02050         histSclPhi_->Fill(sclRef->phi());
02051         histSclSigEtaEta_->Fill(bestGsfElectron.scSigmaEtaEta());
02052         if (bestGsfElectron.isEB()) histSclSigEtaEta_barrel_->Fill(bestGsfElectron.scSigmaEtaEta());
02053         if (bestGsfElectron.isEE()) histSclSigEtaEta_endcaps_->Fill(bestGsfElectron.scSigmaEtaEta());
02054         histSclSigIEtaIEta_->Fill(bestGsfElectron.scSigmaIEtaIEta());
02055         if (bestGsfElectron.isEB()) histSclSigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
02056         if (bestGsfElectron.isEE()) histSclSigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
02057         histSclE1x5_->Fill(bestGsfElectron.scE1x5());
02058         if (bestGsfElectron.isEB()) histSclE1x5_barrel_->Fill(bestGsfElectron.scE1x5());
02059         if (bestGsfElectron.isEE()) histSclE1x5_endcaps_->Fill(bestGsfElectron.scE1x5());
02060         histSclE2x5max_->Fill(bestGsfElectron.scE2x5Max());
02061         if (bestGsfElectron.isEB()) histSclE2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max());
02062         if (bestGsfElectron.isEE()) histSclE2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max());
02063         histSclE5x5_->Fill(bestGsfElectron.scE5x5());
02064         if (bestGsfElectron.isEB()) histSclE5x5_barrel_->Fill(bestGsfElectron.scE5x5());
02065         if (bestGsfElectron.isEE()) histSclE5x5_endcaps_->Fill(bestGsfElectron.scE5x5());
02066         if (bestGsfElectron.ecalDrivenSeed()) histSclSigIEtaIEta_eg_->Fill(bestGsfElectron.scSigmaIEtaIEta());
02067         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) histSclSigIEtaIEta_eg_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
02068         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) histSclSigIEtaIEta_eg_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
02069         if (bestGsfElectron.ecalDrivenSeed())histSclE1x5_eg_->Fill(bestGsfElectron.scE1x5());
02070         if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())histSclE1x5_eg_barrel_->Fill(bestGsfElectron.scE1x5());
02071         if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())histSclE1x5_eg_endcaps_->Fill(bestGsfElectron.scE1x5());
02072         if (bestGsfElectron.ecalDrivenSeed())histSclE2x5max_eg_->Fill(bestGsfElectron.scE2x5Max());
02073         if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())histSclE2x5max_eg_barrel_->Fill(bestGsfElectron.scE2x5Max());
02074         if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())histSclE2x5max_eg_endcaps_->Fill(bestGsfElectron.scE2x5Max());
02075         if (bestGsfElectron.ecalDrivenSeed())histSclE5x5_eg_->Fill(bestGsfElectron.scE5x5());
02076         if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())histSclE5x5_eg_barrel_->Fill(bestGsfElectron.scE5x5());
02077         if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())histSclE5x5_eg_endcaps_->Fill(bestGsfElectron.scE5x5());
02078         float pfEnergy=0., egEnergy=0.;
02079         if (!bestGsfElectron.superCluster().isNull()) egEnergy = bestGsfElectron.superCluster()->energy();
02080         if (!bestGsfElectron.pflowSuperCluster().isNull()) pfEnergy = bestGsfElectron.pflowSuperCluster()->energy();
02081         histSclEoEtruePfVsEg->Fill(egEnergy/mcIter->p(),pfEnergy/mcIter->p());
02082 
02083         // track related distributions
02084         h_ele_ambiguousTracks     -> Fill( bestGsfElectron.ambiguousGsfTracksSize() );
02085         h_ele_ambiguousTracksVsEta     -> Fill( bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize() );
02086         h_ele_ambiguousTracksVsPhi     -> Fill( bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize() );
02087         h_ele_ambiguousTracksVsPt     -> Fill( bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize() );
02088         if (!readAOD_) { // track extra does not exist in AOD
02089           h_ele_foundHits     -> Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
02090           if (bestGsfElectron.isEB()) h_ele_foundHits_barrel     -> Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
02091           if (bestGsfElectron.isEE()) h_ele_foundHits_endcaps     -> Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
02092           h_ele_foundHitsVsEta     -> Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
02093           h_ele_foundHitsVsPhi     -> Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
02094           h_ele_foundHitsVsPt     -> Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
02095           h_ele_lostHits      -> Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
02096           if (bestGsfElectron.isEB()) h_ele_lostHits_barrel      -> Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
02097           if (bestGsfElectron.isEE()) h_ele_lostHits_endcaps      -> Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
02098           h_ele_lostHitsVsEta      -> Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
02099           h_ele_lostHitsVsPhi      -> Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
02100           h_ele_lostHitsVsPt      -> Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
02101           h_ele_chi2          -> Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
02102           if (bestGsfElectron.isEB()) h_ele_chi2_barrel          -> Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
02103           if (bestGsfElectron.isEE()) h_ele_chi2_endcaps          -> Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
02104           h_ele_chi2VsEta          -> Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2() );
02105           h_ele_chi2VsPhi          -> Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2() );
02106           h_ele_chi2VsPt          -> Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2() );
02107         }
02108         // from gsf track interface, hence using mean
02109         if (!readAOD_) { // track extra does not exist in AOD
02110           h_ele_PinMnPout     -> Fill( bestGsfElectron.gsfTrack()->innerMomentum().R() - bestGsfElectron.gsfTrack()->outerMomentum().R() );
02111           h_ele_outerP        -> Fill( bestGsfElectron.gsfTrack()->outerMomentum().R() );
02112           h_ele_outerPt       -> Fill( bestGsfElectron.gsfTrack()->outerMomentum().Rho() );
02113         }
02114         // from electron interface, hence using mode
02115         h_ele_PinMnPout_mode     -> Fill( bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
02116         h_ele_PinMnPoutVsEta_mode     -> Fill(  bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
02117         h_ele_PinMnPoutVsPhi_mode     -> Fill(  bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
02118         h_ele_PinMnPoutVsPt_mode     -> Fill(  bestGsfElectron.pt(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
02119         h_ele_PinMnPoutVsE_mode     -> Fill(  bestGsfElectron.caloEnergy(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
02120         if (!readAOD_)  // track extra does not exist in AOD
02121          h_ele_PinMnPoutVsChi2_mode     -> Fill(  bestGsfElectron.gsfTrack()->normalizedChi2(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
02122         h_ele_outerP_mode        -> Fill( bestGsfElectron.trackMomentumOut().R() );
02123         h_ele_outerPVsEta_mode        -> Fill(bestGsfElectron.eta(),  bestGsfElectron.trackMomentumOut().R() );
02124         h_ele_outerPt_mode       -> Fill( bestGsfElectron.trackMomentumOut().Rho() );
02125         h_ele_outerPtVsEta_mode       -> Fill(bestGsfElectron.eta(),  bestGsfElectron.trackMomentumOut().Rho() );
02126         h_ele_outerPtVsPhi_mode       -> Fill(bestGsfElectron.phi(),  bestGsfElectron.trackMomentumOut().Rho() );
02127         h_ele_outerPtVsPt_mode       -> Fill(bestGsfElectron.pt(),  bestGsfElectron.trackMomentumOut().Rho() );
02128 
02129         if (!readAOD_) { // track extra does not exist in AOD
02130           edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
02131           ElectronSeedRef elseed=seed.castTo<ElectronSeedRef>();
02132           h_ele_seed_dphi2_-> Fill(elseed->dPhi2());
02133           h_ele_seed_dphi2VsEta_-> Fill(bestGsfElectron.eta(), elseed->dPhi2());
02134           h_ele_seed_dphi2VsPt_-> Fill(bestGsfElectron.pt(), elseed->dPhi2()) ;
02135           h_ele_seed_drz2_-> Fill(elseed->dRz2());
02136           h_ele_seed_drz2VsEta_-> Fill(bestGsfElectron.eta(), elseed->dRz2());
02137           h_ele_seed_drz2VsPt_-> Fill(bestGsfElectron.pt(), elseed->dRz2());
02138           h_ele_seed_subdet2_-> Fill(elseed->subDet2());
02139         }
02140         // match distributions
02141         h_ele_EoP    -> Fill( bestGsfElectron.eSuperClusterOverP() );
02142         if (bestGsfElectron.ecalDrivenSeed()) h_ele_EoP_eg    -> Fill( bestGsfElectron.eSuperClusterOverP() );
02143         if (bestGsfElectron.isEB()) h_ele_EoP_barrel    -> Fill( bestGsfElectron.eSuperClusterOverP() );
02144         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EoP_eg_barrel    -> Fill( bestGsfElectron.eSuperClusterOverP() );
02145         if (bestGsfElectron.isEE()) h_ele_EoP_endcaps    -> Fill( bestGsfElectron.eSuperClusterOverP() );
02146         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EoP_eg_endcaps    -> Fill( bestGsfElectron.eSuperClusterOverP() );
02147         h_ele_EoPVsEta    -> Fill(bestGsfElectron.eta(),  bestGsfElectron.eSuperClusterOverP() );
02148         h_ele_EoPVsPhi    -> Fill(bestGsfElectron.phi(),  bestGsfElectron.eSuperClusterOverP() );
02149         h_ele_EoPVsE    -> Fill(bestGsfElectron.caloEnergy(),  bestGsfElectron.eSuperClusterOverP() );
02150         h_ele_EseedOP    -> Fill( bestGsfElectron.eSeedClusterOverP() );
02151         if (bestGsfElectron.ecalDrivenSeed()) h_ele_EseedOP_eg    -> Fill( bestGsfElectron.eSeedClusterOverP() );
02152         if (bestGsfElectron.isEB()) h_ele_EseedOP_barrel    -> Fill( bestGsfElectron.eSeedClusterOverP() );
02153         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EseedOP_eg_barrel    -> Fill( bestGsfElectron.eSeedClusterOverP() );
02154         if (bestGsfElectron.isEE()) h_ele_EseedOP_endcaps    -> Fill( bestGsfElectron.eSeedClusterOverP() );
02155         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EseedOP_eg_endcaps    -> Fill( bestGsfElectron.eSeedClusterOverP() );
02156         h_ele_EseedOPVsEta    -> Fill(bestGsfElectron.eta(),  bestGsfElectron.eSeedClusterOverP() );
02157         h_ele_EseedOPVsPhi    -> Fill(bestGsfElectron.phi(),  bestGsfElectron.eSeedClusterOverP() );
02158         h_ele_EseedOPVsE    -> Fill(bestGsfElectron.caloEnergy(),  bestGsfElectron.eSeedClusterOverP() );
02159         h_ele_EoPout -> Fill( bestGsfElectron.eSeedClusterOverPout() );
02160         if (bestGsfElectron.ecalDrivenSeed()) h_ele_EoPout_eg -> Fill( bestGsfElectron.eSeedClusterOverPout() );
02161         if (bestGsfElectron.isEB()) h_ele_EoPout_barrel -> Fill( bestGsfElectron.eSeedClusterOverPout() );
02162         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EoPout_eg_barrel -> Fill( bestGsfElectron.eSeedClusterOverPout() );
02163         if (bestGsfElectron.isEE()) h_ele_EoPout_endcaps -> Fill( bestGsfElectron.eSeedClusterOverPout() );
02164         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EoPout_eg_endcaps -> Fill( bestGsfElectron.eSeedClusterOverPout() );
02165         h_ele_EoPoutVsEta -> Fill( bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout() );
02166         h_ele_EoPoutVsPhi -> Fill( bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout() );
02167         h_ele_EoPoutVsE -> Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout() );
02168         h_ele_EeleOPout -> Fill( bestGsfElectron.eEleClusterOverPout() );
02169         if (bestGsfElectron.ecalDrivenSeed()) h_ele_EeleOPout_eg -> Fill( bestGsfElectron.eEleClusterOverPout() );
02170         if (bestGsfElectron.isEB()) h_ele_EeleOPout_barrel -> Fill( bestGsfElectron.eEleClusterOverPout() );
02171         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EeleOPout_eg_barrel -> Fill( bestGsfElectron.eEleClusterOverPout() );
02172         if (bestGsfElectron.isEE()) h_ele_EeleOPout_endcaps -> Fill( bestGsfElectron.eEleClusterOverPout() );
02173         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EeleOPout_eg_endcaps -> Fill( bestGsfElectron.eEleClusterOverPout() );
02174         h_ele_EeleOPoutVsEta -> Fill( bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout() );
02175         h_ele_EeleOPoutVsPhi -> Fill( bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout() );
02176         h_ele_EeleOPoutVsE -> Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout() );
02177         h_ele_dEtaSc_propVtx -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
02178         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaSc_propVtx_eg -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
02179         if (bestGsfElectron.isEB()) h_ele_dEtaSc_propVtx_barrel -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
02180         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaSc_propVtx_eg_barrel -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
02181         if (bestGsfElectron.isEE())h_ele_dEtaSc_propVtx_endcaps -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
02182         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaSc_propVtx_eg_endcaps -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
02183         h_ele_dEtaScVsEta_propVtx -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
02184         h_ele_dEtaScVsPhi_propVtx -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
02185         h_ele_dEtaScVsPt_propVtx -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
02186         h_ele_dPhiSc_propVtx -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
02187         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiSc_propVtx_eg -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
02188         if (bestGsfElectron.isEB()) h_ele_dPhiSc_propVtx_barrel -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
02189         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiSc_propVtx_eg_barrel -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
02190         if (bestGsfElectron.isEE())h_ele_dPhiSc_propVtx_endcaps -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
02191         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiSc_propVtx_eg_endcaps -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
02192         h_ele_dPhiScVsEta_propVtx -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
02193         h_ele_dPhiScVsPhi_propVtx -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
02194         h_ele_dPhiScVsPt_propVtx -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
02195         h_ele_dEtaCl_propOut -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
02196         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaCl_propOut_eg -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
02197         if (bestGsfElectron.isEB()) h_ele_dEtaCl_propOut_barrel -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
02198         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaCl_propOut_eg_barrel -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
02199         if (bestGsfElectron.isEE()) h_ele_dEtaCl_propOut_endcaps -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
02200         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaCl_propOut_eg_endcaps -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
02201         h_ele_dEtaClVsEta_propOut -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
02202         h_ele_dEtaClVsPhi_propOut -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
02203         h_ele_dEtaClVsPt_propOut -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
02204         h_ele_dPhiCl_propOut -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
02205         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiCl_propOut_eg -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
02206         if (bestGsfElectron.isEB()) h_ele_dPhiCl_propOut_barrel -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
02207         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiCl_propOut_eg_barrel -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
02208         if (bestGsfElectron.isEE()) h_ele_dPhiCl_propOut_endcaps -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
02209         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiCl_propOut_eg_endcaps -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
02210         h_ele_dPhiClVsEta_propOut -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
02211         h_ele_dPhiClVsPhi_propOut -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
02212         h_ele_dPhiClVsPt_propOut -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
02213         h_ele_dEtaEleCl_propOut -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
02214         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaEleCl_propOut_eg -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
02215         if (bestGsfElectron.isEB()) h_ele_dEtaEleCl_propOut_barrel -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
02216         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaEleCl_propOut_eg_barrel -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
02217         if (bestGsfElectron.isEE()) h_ele_dEtaEleCl_propOut_endcaps -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
02218         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaEleCl_propOut_eg_endcaps -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
02219         h_ele_dEtaEleClVsEta_propOut -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
02220         h_ele_dEtaEleClVsPhi_propOut -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
02221         h_ele_dEtaEleClVsPt_propOut -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
02222         h_ele_dPhiEleCl_propOut -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
02223         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiEleCl_propOut_eg -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
02224         if (bestGsfElectron.isEB()) h_ele_dPhiEleCl_propOut_barrel -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
02225         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiEleCl_propOut_eg_barrel -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
02226         if (bestGsfElectron.isEE()) h_ele_dPhiEleCl_propOut_endcaps -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
02227         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiEleCl_propOut_eg_endcaps -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
02228         h_ele_dPhiEleClVsEta_propOut -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
02229         h_ele_dPhiEleClVsPhi_propOut -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
02230         h_ele_dPhiEleClVsPt_propOut -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
02231         h_ele_HoE -> Fill(bestGsfElectron.hadronicOverEm());
02232         if (bestGsfElectron.ecalDrivenSeed()) h_ele_HoE_eg -> Fill(bestGsfElectron.hadronicOverEm());
02233         if (bestGsfElectron.isEB()) h_ele_HoE_barrel -> Fill(bestGsfElectron.hadronicOverEm());
02234         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_HoE_eg_barrel -> Fill(bestGsfElectron.hadronicOverEm());
02235         if (bestGsfElectron.isEE()) h_ele_HoE_endcaps -> Fill(bestGsfElectron.hadronicOverEm());
02236         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_HoE_eg_endcaps -> Fill(bestGsfElectron.hadronicOverEm());
02237         if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap()&& !bestGsfElectron.isEBEEGap() &&
02238             !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap()) h_ele_HoE_fiducial -> Fill(bestGsfElectron.hadronicOverEm());
02239         h_ele_HoEVsEta -> Fill( bestGsfElectron.eta(),bestGsfElectron.hadronicOverEm());
02240         h_ele_HoEVsPhi -> Fill(bestGsfElectron.phi(),bestGsfElectron.hadronicOverEm());
02241         h_ele_HoEVsE -> Fill(bestGsfElectron.caloEnergy(),bestGsfElectron.hadronicOverEm());
02242 
02243         //classes
02244         int eleClass = bestGsfElectron.classification();
02245         if (bestGsfElectron.isEE()) eleClass+=10;
02246         h_ele_classes ->Fill(eleClass);
02247 
02248         if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEB())  histSclEoEtrueGolden_barrel->Fill(sclRef->energy()/mcIter->p());
02249         if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEE())  histSclEoEtrueGolden_endcaps->Fill(sclRef->energy()/mcIter->p());
02250         if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEB())  histSclEoEtrueShowering_barrel->Fill(sclRef->energy()/mcIter->p());
02251         if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEE())  histSclEoEtrueShowering_endcaps->Fill(sclRef->energy()/mcIter->p());
02252 
02253         //eleClass = eleClass%100; // get rid of barrel/endcap distinction
02254   h_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
02255   if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_eta_golden ->Fill(std::abs(bestGsfElectron.eta()));
02256   if (bestGsfElectron.classification() == GsfElectron::BIGBREM) h_ele_eta_bbrem ->Fill(std::abs(bestGsfElectron.eta()));
02257   //if (bestGsfElectron.classification() == GsfElectron::NARROW) h_ele_eta_narrow ->Fill(std::abs(bestGsfElectron.eta()));
02258   if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h_ele_eta_shower ->Fill(std::abs(bestGsfElectron.eta()));
02259 
02260         //fbrem
02261         double fbrem_mean=0.;
02262         if (!readAOD_) // track extra does not exist in AOD
02263          fbrem_mean =  1. - bestGsfElectron.gsfTrack()->outerMomentum().R()/bestGsfElectron.gsfTrack()->innerMomentum().R();
02264         double fbrem_mode =  bestGsfElectron.fbrem();
02265         h_ele_fbrem->Fill(fbrem_mode);
02266         if (bestGsfElectron.ecalDrivenSeed()) h_ele_fbrem_eg->Fill(fbrem_mode);
02267         h_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(),fbrem_mode);
02268         if (!readAOD_) // track extra does not exist in AOD
02269          h_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(),fbrem_mean);
02270 
02271         if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_PinVsPoutGolden_mode -> Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
02272         if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
02273          h_ele_PinVsPoutShowering_mode -> Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
02274         if (!readAOD_) { // track extra not available in AOD
02275           if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_PinVsPoutGolden_mean -> Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
02276           if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
02277            h_ele_PinVsPoutShowering_mean ->  Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
02278         }
02279         if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_PtinVsPtoutGolden_mode -> Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
02280         if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
02281          h_ele_PtinVsPtoutShowering_mode -> Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
02282         if (!readAOD_) { // track extra not available in AOD
02283           if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_PtinVsPtoutGolden_mean -> Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
02284           if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
02285            h_ele_PtinVsPtoutShowering_mean ->  Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
02286         }
02287 
02288         h_ele_mva->Fill(bestGsfElectron.mva());
02289         if (bestGsfElectron.ecalDrivenSeed()) h_ele_mva_eg->Fill(bestGsfElectron.mva());
02290         if (bestGsfElectron.ecalDrivenSeed()) h_ele_provenance->Fill(1.);
02291         if (bestGsfElectron.trackerDrivenSeed()) h_ele_provenance->Fill(-1.);
02292         if (bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) h_ele_provenance->Fill(0.);
02293         if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed()) h_ele_provenance->Fill(-2.);
02294         if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed()) h_ele_provenance->Fill(2.);
02295 
02296         h_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
02297         h_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
02298         h_ele_hcalDepth1TowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
02299         h_ele_hcalDepth2TowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
02300         h_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
02301         h_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
02302         h_ele_hcalDepth1TowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
02303         h_ele_hcalDepth2TowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
02304 
02305       } // gsf electron found
02306 
02307     } // mc particle found
02308 
02309     }
02310 
02311   } // loop over mc particle
02312 
02313   h_mcNum->Fill(mcNum);
02314   h_eleNum->Fill(eleNum);
02315 
02316 }
02317 
02318