CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/RecoEgamma/Examples/plugins/GsfElectronFakeAnalyzer.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    RecoEgamma/Examples
00004 // Class:      GsfElectronFakeAnalyzer
00005 //
00013 //
00014 // Original Author:  Ursula Berthon
00015 //         Created:  Mon Mar 27 13:22:06 CEST 2006
00016 // $Id: GsfElectronFakeAnalyzer.cc,v 1.32 2011/03/04 14:43:15 chamont Exp $
00017 //
00018 //
00019 
00020 // user include files
00021 #include "RecoEgamma/Examples/plugins/GsfElectronFakeAnalyzer.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/JetReco/interface/CaloJetCollection.h"
00035 #include "DataFormats/JetReco/interface/CaloJet.h"
00036 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00037 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00038 
00039 #include "CLHEP/Units/GlobalPhysicalConstants.h"
00040 #include <iostream>
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 GsfElectronFakeAnalyzer::GsfElectronFakeAnalyzer(const edm::ParameterSet& conf)
00053 {
00054 
00055   outputFile_ = conf.getParameter<std::string>("outputFile");
00056   histfile_ = new TFile(outputFile_.c_str(),"RECREATE");
00057   electronCollection_=conf.getParameter<edm::InputTag>("electronCollection");
00058   matchingObjectCollection_ = conf.getParameter<edm::InputTag>("matchingObjectCollection");
00059   readAOD_ = conf.getParameter<bool>("readAOD");
00060   maxPt_ = conf.getParameter<double>("MaxPt");
00061   maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
00062   deltaR_ = conf.getParameter<double>("DeltaR");
00063 
00064   edm::ParameterSet pset =
00065    conf.getParameter<edm::ParameterSet>("HistosConfigurationFake") ;
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   nbinmee= pset.getParameter<int>("Nbinmee");
00106   meemin=pset.getParameter<double>("Meemin");
00107   meemax=pset.getParameter<double>("Meemax");
00108   nbinhoe= pset.getParameter<int>("Nbinhoe");
00109   hoemin=pset.getParameter<double>("Hoemin");
00110   hoemax=pset.getParameter<double>("Hoemax");
00111 
00112 }
00113 
00114 GsfElectronFakeAnalyzer::~GsfElectronFakeAnalyzer()
00115 {
00116 
00117   // do anything here that needs to be done at desctruction time
00118   // (e.g. close files, deallocate resources etc.)
00119   histfile_->Write();
00120   histfile_->Close();
00121 }
00122 
00123 void GsfElectronFakeAnalyzer::beginJob(){
00124 
00125   histfile_->cd();
00126 
00127 
00128   // matching object
00129   std::string::size_type locJet = matchingObjectCollection_.label().find( "iterativeCone5CaloJets", 0 );
00130   std::string type_;
00131   if ( locJet != std::string::npos ) {
00132     std::cout << "Matching objects are CaloJets " << std::endl;
00133     type_ = "CaloJet";
00134   } else {
00135     std::cout << "Didn't recognize input matching objects!! " << std::endl;
00136   }
00137 
00138   std::string htitle, hlabel;
00139   hlabel="h_"+type_+"Num"; htitle="# "+type_+"s";
00140   h_matchingObjectNum              = new TH1F( hlabel.c_str(), htitle.c_str(),    nbinfhits,0.,fhitsmax );
00141 
00142   // rec event
00143 
00144   histNum_= new TH1F("h_recEleNum","# rec electrons",20, 0.,20.);
00145 
00146   // matching object distributions
00147   hlabel="h_"+type_+"_eta"; htitle=type_+" #eta";
00148   h_matchingObjectEta             = new TH1F( hlabel.c_str(), htitle.c_str(), nbineta,etamin,etamax);
00149   hlabel="h_"+type_+"_abseta"; htitle=type_+" |#eta|";
00150   h_matchingObjectAbsEta             = new TH1F( hlabel.c_str(), htitle.c_str(), nbineta/2,0.,etamax);
00151   hlabel="h_"+type_+"_P"; htitle=type_+" p";
00152   h_matchingObjectP               = new TH1F( hlabel.c_str(), htitle.c_str(),              nbinp,0.,pmax);
00153   hlabel="h_"+type_+"_Pt"; htitle=type_+" pt";
00154   h_matchingObjectPt               = new TH1F( hlabel.c_str(),htitle.c_str(),            nbinpteff,5.,ptmax);
00155   hlabel="h_"+type_+"_phi"; htitle=type_+" phi";
00156   h_matchingObjectPhi               = new TH1F( hlabel.c_str(), htitle.c_str(),        nbinphi,phimin,phimax);
00157   hlabel="h_"+type_+"_z"; htitle=type_+" z";
00158   h_matchingObjectZ      = new TH1F( hlabel.c_str(), htitle.c_str(),    nbinxyz, -25, 25 );
00159 
00160   // all electrons
00161   h_ele_EoverP_all       = new TH1F( "h_ele_EoverP_all",       "ele E/P_{vertex}, all reco electrons",  nbineop,0.,eopmax);
00162   h_ele_EseedOP_all            = new TH1F( "h_ele_EseedOP_all",            "ele E_{seed}/P_{vertex}, all reco electrons",        nbineop,0.,eopmax);
00163   h_ele_EoPout_all         = new TH1F( "h_ele_EoPout_all",         "ele E_{seed}/P_{out}, all reco electrons",           nbineop,0.,eopmax);
00164   h_ele_EeleOPout_all         = new TH1F( "h_ele_EeleOPout_all",         "ele E_{ele}/P_{out}, all reco electrons",           nbineop,0.,eopmax);
00165   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);
00166   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);
00167   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);
00168   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);
00169   h_ele_HoE_all = new TH1F("h_ele_HoE_all", "ele hadronic energy / em energy, all reco electrons", nbinhoe, hoemin, hoemax) ;
00170   h_ele_vertexPt_all       = new TH1F( "h_ele_vertexPt_all",       "ele p_{T}, all reco electrons",  nbinpteff,5.,ptmax);
00171   h_ele_vertexPt_all->Sumw2();
00172   h_ele_vertexEta_all      = new TH1F( "h_ele_vertexEta_all",      "ele eta, all reco electrons",    nbineta,etamin,etamax);
00173   h_ele_vertexEta_all->Sumw2();
00174   h_ele_TIP_all       = new TH1F( "h_ele_TIP_all",       "ele vertex transverse radius, all reco electrons",  100,0.,0.2);
00175   h_ele_mee_all      = new TH1F( "h_ele_mee_all", "ele pairs invariant mass, all reco electrons", nbinmee, meemin, meemax );
00176   h_ele_mee_os      = new TH1F( "h_ele_mee_os", "ele pairs invariant mass, opp. sign", nbinmee, meemin, meemax );
00177 
00178   // duplicates
00179   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. );
00180   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. );
00181 
00182   // matched electrons
00183   h_ele_charge         = new TH1F( "h_ele_charge",         "ele charge",             5,-2.,2.);
00184   h_ele_chargeVsEta    = new TH2F( "h_ele_chargeVsEta",         "ele charge vs eta", nbineta2D,etamin,etamax,5,-2.,2.);
00185   h_ele_chargeVsPhi    = new TH2F( "h_ele_chargeVsPhi",         "ele charge vs phi", nbinphi2D,phimin,phimax,5,-2.,2.);
00186   h_ele_chargeVsPt    = new TH2F( "h_ele_chargeVsPt",         "ele charge vs pt", nbinpt,0.,100.,5,-2.,2.);
00187   h_ele_vertexP        = new TH1F( "h_ele_vertexP",        "ele momentum",       nbinp,0.,pmax);
00188   h_ele_vertexPt       = new TH1F( "h_ele_vertexPt",       "ele transverse momentum",  nbinpt,0.,ptmax);
00189   h_ele_vertexPtVsEta   = new TH2F( "h_ele_vertexPtVsEta",       "ele transverse momentum vs eta",nbineta2D,etamin,etamax,nbinpt2D,0.,ptmax);
00190   h_ele_vertexPtVsPhi   = new TH2F( "h_ele_vertexPtVsPhi",       "ele transverse momentum vs phi",nbinphi2D,phimin,phimax,nbinpt2D,0.,ptmax);
00191   h_ele_matchingObjectPt_matched       = new TH1F( "h_ele_matchingObjectPt_matched",       "Efficiency vs matching jet p_{T}",  nbinpteff,5.,ptmax);
00192   h_ele_matchingObjectPt_matched->Sumw2();
00193   h_ele_vertexEta      = new TH1F( "h_ele_vertexEta",      "ele momentum eta",    nbineta,etamin,etamax);
00194   h_ele_vertexEtaVsPhi  = new TH2F( "h_ele_vertexEtaVsPhi",      "ele momentum eta vs phi",nbineta2D,etamin,etamax,nbinphi2D,phimin,phimax );
00195   h_ele_matchingObjectAbsEta_matched      = new TH1F( "h_ele_matchingObjectAbsEta_matched",      "Efficiency vs matching jet |#eta|",    nbineta/2,0.,2.5);
00196   h_ele_matchingObjectAbsEta_matched->Sumw2();
00197   h_ele_matchingObjectEta_matched      = new TH1F( "h_ele_matchingObjectEta_matched",      "Efficiency vs matching jet #eta",    nbineta,etamin,etamax);
00198   h_ele_matchingObjectEta_matched ->Sumw2();
00199   h_ele_matchingObjectPhi_matched               = new TH1F( "h_ele_matchingObjectPhi_matched", "Efficiency vs matching jet phi",        nbinphi,phimin,phimax);
00200   h_ele_matchingObjectPhi_matched->Sumw2();
00201   h_ele_vertexPhi      = new TH1F( "h_ele_vertexPhi",      "ele  momentum #phi",    nbinphi,phimin,phimax);
00202   h_ele_vertexX      = new TH1F( "h_ele_vertexX",      "ele vertex x",    nbinxyz,-0.1,0.1 );
00203   h_ele_vertexY      = new TH1F( "h_ele_vertexY",      "ele vertex y",    nbinxyz,-0.1,0.1 );
00204   h_ele_vertexZ      = new TH1F( "h_ele_vertexZ",      "ele vertex z",    nbinxyz,-25, 25 );
00205   h_ele_matchingObjectZ_matched      = new TH1F( "h_ele_matchingObjectZ_matched",      "Efficiency vs matching jet z",    nbinxyz,-25,25);
00206   h_ele_matchingObjectZ_matched->Sumw2();
00207   h_ele_vertexTIP      = new TH1F( "h_ele_vertexTIP",      "ele transverse impact parameter (wrt bs)",    90,0.,0.15);
00208   h_ele_vertexTIPVsEta      = new TH2F( "h_ele_vertexTIPVsEta",      "ele transverse impact parameter (wrt bs) vs eta", nbineta2D,etamin,etamax,45,0.,0.15);
00209   h_ele_vertexTIPVsPhi      = new TH2F( "h_ele_vertexTIPVsPhi",      "ele transverse impact parameter (wrt bs) vs phi", nbinphi2D,phimin,phimax,45,0.,0.15);
00210   h_ele_vertexTIPVsPt      = new TH2F( "h_ele_vertexTIPVsPt",      "ele transverse impact parameter (wrt bs) vs Pt", nbinpt2D,0.,ptmax,45,0.,0.15);
00211   h_ele_PoPmatchingObject        = new TH1F( "h_ele_PoPmatchingObject",        "ele momentum / matching jet momentum", 75,0.,1.5);
00212   h_ele_PoPmatchingObjectVsEta   = new TH2F( "h_ele_PoPmatchingObjectVsEta",        "ele momentum / matching jet momentum vs eta", nbineta2D,etamin,etamax,50,0.,1.5);
00213   h_ele_PoPmatchingObjectVsPhi   = new TH2F( "h_ele_PoPmatchingObjectVsPhi",        "ele momentum / matching jet momentum vs phi", nbinphi2D,phimin,phimax,50,0.,1.5);
00214   h_ele_PoPmatchingObjectVsPt   = new TH2F( "h_ele_PoPmatchingObjectVsPt",        "ele momentum / matching jet momentum vs eta", nbinpt2D,0.,ptmax,50,0.,1.5);
00215   h_ele_PoPmatchingObject_barrel         = new TH1F( "h_ele_PoPmatchingObject_barrel",        "ele momentum / matching jet momentum, barrel",75,0.,1.5);
00216   h_ele_PoPmatchingObject_endcaps        = new TH1F( "h_ele_PoPmatchingObject_endcaps",        "ele momentum / matching jet momentum, endcaps",75,0.,1.5);
00217   h_ele_EtaMnEtamatchingObject   = new TH1F( "h_ele_EtaMnEtamatchingObject",   "ele momentum eta - matching jet eta",nbindeta,detamin,detamax);
00218   h_ele_EtaMnEtamatchingObjectVsEta   = new TH2F( "h_ele_EtaMnEtamatchingObjectVsEta",   "ele momentum eta - matching jet eta vs eta",nbineta2D,etamin,etamax,nbindeta/2,detamin,detamax);
00219   h_ele_EtaMnEtamatchingObjectVsPhi   = new TH2F( "h_ele_EtaMnEtamatchingObjectVsPhi",   "ele momentum eta - matching jet eta vs phi",nbinphi2D,phimin,phimax,nbindeta/2,detamin,detamax);
00220   h_ele_EtaMnEtamatchingObjectVsPt   = new TH2F( "h_ele_EtaMnEtamatchingObjectVsPt",   "ele momentum eta - matching jet eta vs pt",nbinpt,0.,ptmax,nbindeta/2,detamin,detamax);
00221   h_ele_PhiMnPhimatchingObject   = new TH1F( "h_ele_PhiMnPhimatchingObject",   "ele momentum phi - matching jet phi",nbindphi,dphimin,dphimax);
00222   h_ele_PhiMnPhimatchingObject2   = new TH1F( "h_ele_PhiMnPhimatchingObject2",   "ele momentum phi - matching jet phi",nbindphimatch2D,dphimatchmin,dphimatchmax);
00223   h_ele_PhiMnPhimatchingObjectVsEta   = new TH2F( "h_ele_PhiMnPhimatchingObjectVsEta",   "ele momentum phi - matching SC phi vs eta",nbineta2D,etamin,etamax,nbindphi/2,dphimin,dphimax);
00224   h_ele_PhiMnPhimatchingObjectVsPhi   = new TH2F( "h_ele_PhiMnPhimatchingObjectVsPhi",   "ele momentum phi - matching SC phi vs phi",nbinphi2D,phimin,phimax,nbindphi/2,dphimin,dphimax);
00225   h_ele_PhiMnPhimatchingObjectVsPt   = new TH2F( "h_ele_PhiMnPhimatchingObjectVsPt",   "ele momentum phi - matching SC phi vs pt",nbinpt2D,0.,ptmax,nbindphi/2,dphimin,dphimax);
00226 
00227   // matched electron, superclusters
00228   histSclEn_ = new TH1F("h_scl_energy","ele supercluster energy",nbinp,0.,pmax);
00229   histSclEoEmatchingObject_barrel = new TH1F("h_scl_EoEmatchingObject_barrel","ele supercluster energy / matching jet energy, barrel",50,0.2,1.2);
00230   histSclEoEmatchingObject_endcaps = new TH1F("h_scl_EoEmatchingObject_endcaps","ele supercluster energy / matching jet energy, endcaps",50,0.2,1.2);
00231   histSclEt_ = new TH1F("h_scl_et","ele supercluster transverse energy",nbinpt,0.,ptmax);
00232   histSclEtVsEta_ = new TH2F("h_scl_etVsEta","ele supercluster transverse energy vs eta",nbineta2D,etamin,etamax,nbinpt,0.,ptmax);
00233   histSclEtVsPhi_ = new TH2F("h_scl_etVsPhi","ele supercluster transverse energy vs phi",nbinphi2D,phimin,phimax,nbinpt,0.,ptmax);
00234   histSclEtaVsPhi_ = new TH2F("h_scl_etaVsPhi","ele supercluster eta vs phi",nbinphi2D,phimin,phimax,nbineta2D,etamin,etamax);
00235   histSclEta_ = new TH1F("h_scl_eta","ele supercluster eta",nbineta,etamin,etamax);
00236   histSclPhi_ = new TH1F("h_scl_phi","ele supercluster phi",nbinphi,phimin,phimax);
00237 
00238   histSclSigIEtaIEta_ =  new TH1F("h_scl_sigietaieta","ele supercluster sigma ieta ieta",100,0.,0.05);
00239   histSclSigIEtaIEta_barrel_ =  new TH1F("h_scl_sigietaieta_barrel","ele supercluster sigma ieta ieta, barrel",100,0.,0.05);
00240   histSclSigIEtaIEta_endcaps_ =  new TH1F("h_scl_sigietaieta_endcaps","ele supercluster sigma ieta ieta, endcaps",100,0.,0.05);
00241   histSclE1x5_ =  new TH1F("h_scl_E1x5","ele supercluster energy in 1x5",nbinp,0.,pmax);
00242   histSclE1x5_barrel_ =  new TH1F("h_scl_E1x5_barrel","ele supercluster energy in 1x5 barrel",nbinp,0.,pmax);
00243   histSclE1x5_endcaps_ =  new TH1F("h_scl_E1x5_endcaps","ele supercluster energy in 1x5 endcaps",nbinp,0.,pmax);
00244   histSclE2x5max_ =  new TH1F("h_scl_E2x5max","ele supercluster energy in 2x5 max",nbinp,0.,pmax);
00245   histSclE2x5max_barrel_ =  new TH1F("h_scl_E2x5max_barrel","ele supercluster energy in 2x5 max barrel",nbinp,0.,pmax);
00246   histSclE2x5max_endcaps_ =  new TH1F("h_scl_E2x5max_endcaps","ele supercluster energy in 2x5 max endcaps",nbinp,0.,pmax);
00247   histSclE5x5_ =  new TH1F("h_scl_E5x5","ele supercluster energy in 5x5",nbinp,0.,pmax);
00248   histSclE5x5_barrel_ =  new TH1F("h_scl_E5x5_barrel","ele supercluster energy in 5x5 barrel",nbinp,0.,pmax);
00249   histSclE5x5_endcaps_ =  new TH1F("h_scl_E5x5_endcaps","ele supercluster energy in 5x5 endcaps",nbinp,0.,pmax);
00250 
00251   // matched electron, gsf tracks
00252   h_ele_ambiguousTracks      = new TH1F( "h_ele_ambiguousTracks", "ele # ambiguous tracks",  5,0.,5.);
00253   h_ele_ambiguousTracksVsEta      = new TH2F( "h_ele_ambiguousTracksVsEta","ele # ambiguous tracks  vs eta",  nbineta2D,etamin,etamax,5,0.,5.);
00254   h_ele_ambiguousTracksVsPhi      = new TH2F( "h_ele_ambiguousTracksVsPhi", "ele # ambiguous tracks  vs phi",  nbinphi2D,phimin,phimax,5,0.,5.);
00255   h_ele_ambiguousTracksVsPt      = new TH2F( "h_ele_ambiguousTracksVsPt", "ele # ambiguous tracks vs pt",  nbinpt2D,0.,ptmax,5,0.,5.);
00256   h_ele_foundHits      = new TH1F( "h_ele_foundHits",      "ele track # found hits",      nbinfhits,0.,fhitsmax);
00257   h_ele_foundHitsVsEta      = new TH2F( "h_ele_foundHitsVsEta",      "ele track # found hits vs eta",  nbineta2D,etamin,etamax,nbinfhits,0.,fhitsmax);
00258   h_ele_foundHitsVsPhi      = new TH2F( "h_ele_foundHitsVsPhi",      "ele track # found hits vs phi",  nbinphi2D,phimin,phimax,nbinfhits,0.,fhitsmax);
00259   h_ele_foundHitsVsPt      = new TH2F( "h_ele_foundHitsVsPt",      "ele track # found hits vs pt",  nbinpt2D,0.,ptmax,nbinfhits,0.,fhitsmax);
00260   h_ele_lostHits       = new TH1F( "h_ele_lostHits",       "ele track # lost hits",       5,0.,5.);
00261   h_ele_lostHitsVsEta       = new TH2F( "h_ele_lostHitsVsEta",       "ele track # lost hits vs eta",   nbineta2D,etamin,etamax,nbinlhits,0.,lhitsmax);
00262   h_ele_lostHitsVsPhi       = new TH2F( "h_ele_lostHitsVsPhi",       "ele track # lost hits vs eta",   nbinphi2D,phimin,phimax,nbinlhits,0.,lhitsmax);
00263   h_ele_lostHitsVsPt       = new TH2F( "h_ele_lostHitsVsPt",       "ele track # lost hits vs eta",   nbinpt2D,0.,ptmax,nbinlhits,0.,lhitsmax);
00264   h_ele_chi2           = new TH1F( "h_ele_chi2",           "ele track #chi^{2}",         100,0.,15.);
00265   h_ele_chi2VsEta           = new TH2F( "h_ele_chi2VsEta",           "ele track #chi^{2} vs eta",  nbineta2D,etamin,etamax,50,0.,15.);
00266   h_ele_chi2VsPhi           = new TH2F( "h_ele_chi2VsPhi",           "ele track #chi^{2} vs phi",  nbinphi2D,phimin,phimax,50,0.,15.);
00267   h_ele_chi2VsPt           = new TH2F( "h_ele_chi2VsPt",           "ele track #chi^{2} vs pt",  nbinpt2D,0.,ptmax,50,0.,15.);
00268   h_ele_PinMnPout      = new TH1F( "h_ele_PinMnPout",      "ele track inner p - outer p, mean"   ,nbinp,0.,200.);
00269   h_ele_PinMnPout_mode      = new TH1F( "h_ele_PinMnPout_mode",      "ele track inner p - outer p, mode"   ,nbinp,0.,100.);
00270   h_ele_PinMnPoutVsEta_mode = new TH2F( "h_ele_PinMnPoutVsEta_mode",      "ele track inner p - outer p vs eta, mode" ,nbineta2D, etamin,etamax,nbinp2D,0.,100.);
00271   h_ele_PinMnPoutVsPhi_mode = new TH2F( "h_ele_PinMnPoutVsPhi_mode",      "ele track inner p - outer p vs phi, mode" ,nbinphi2D, phimin,phimax,nbinp2D,0.,100.);
00272   h_ele_PinMnPoutVsPt_mode = new TH2F( "h_ele_PinMnPoutVsPt_mode",      "ele track inner p - outer p vs pt, mode" ,nbinpt2D, 0.,ptmax,nbinp2D,0.,100.);
00273   h_ele_PinMnPoutVsE_mode = new TH2F( "h_ele_PinMnPoutVsE_mode",      "ele track inner p - outer p vs E, mode" ,nbinp2D, 0.,200.,nbinp2D,0.,100.);
00274   h_ele_PinMnPoutVsChi2_mode = new TH2F( "h_ele_PinMnPoutVsChi2_mode",      "ele track inner p - outer p vs track chi2, mode" ,50, 0.,20.,nbinp2D,0.,100.);
00275   h_ele_outerP         = new TH1F( "h_ele_outerP",         "ele track outer p, mean",          nbinp,0.,pmax);
00276   h_ele_outerP_mode         = new TH1F( "h_ele_outerP_mode",         "ele track outer p, mode",          nbinp,0.,pmax);
00277   h_ele_outerPVsEta_mode         = new TH2F( "h_ele_outerPVsEta_mode",         "ele track outer p vs eta mode", nbineta2D,etamin,etamax,50,0.,pmax);
00278   h_ele_outerPt        = new TH1F( "h_ele_outerPt",        "ele track outer p_{T}, mean",      nbinpt,0.,ptmax);
00279   h_ele_outerPt_mode        = new TH1F( "h_ele_outerPt_mode",        "ele track outer p_{T}, mode",      nbinpt,0.,ptmax);
00280   h_ele_outerPtVsEta_mode        = new TH2F( "h_ele_outerPtVsEta_mode", "ele track outer p_{T} vs eta, mode", nbineta2D,etamin,etamax,nbinpt2D,0.,ptmax);
00281   h_ele_outerPtVsPhi_mode        = new TH2F( "h_ele_outerPtVsPhi_mode", "ele track outer p_{T} vs phi, mode", nbinphi2D,phimin,phimax,nbinpt2D,0.,ptmax);
00282   h_ele_outerPtVsPt_mode        = new TH2F( "h_ele_outerPtVsPt_mode", "ele track outer p_{T} vs pt, mode", nbinpt2D,0.,100.,nbinpt2D,0.,ptmax);
00283 
00284   // matched electrons,cluster-track  matching
00285   h_ele_EoP            = new TH1F( "h_ele_EoP",            "ele E/P_{vertex}",        nbineop,0.,eopmax);
00286   h_ele_EoP->Sumw2();
00287   h_ele_EoP_eg            = new TH1F( "h_ele_EoP_eg",            "ele E/P_{vertex}, ecal driven",        nbineop,0.,eopmax);
00288   h_ele_EoP_eg->Sumw2();
00289   h_ele_EoP_barrel            = new TH1F( "h_ele_EoP_barrel",            "ele E/P_{vertex} barrel",        nbineop,0.,eopmax);
00290   h_ele_EoP_barrel->Sumw2();
00291   h_ele_EoP_eg_barrel            = new TH1F( "h_ele_EoP_eg_barrel",            "ele E/P_{vertex}, ecal driven barrel",        nbineop,0.,eopmax);
00292   h_ele_EoP_eg_barrel->Sumw2();
00293   h_ele_EoP_endcaps            = new TH1F( "h_ele_EoP_endcaps",            "ele E/P_{vertex} endcaps",        nbineop,0.,eopmax);
00294   h_ele_EoP_endcaps->Sumw2();
00295   h_ele_EoP_eg_endcaps            = new TH1F( "h_ele_EoP_eg_endcaps",            "ele E/P_{vertex}, ecal driven endcaps",        nbineop,0.,eopmax);
00296   h_ele_EoP_eg_endcaps->Sumw2();
00297   h_ele_EoPVsEta            = new TH2F( "h_ele_EoPVsEta",            "ele E/P_{vertex} vs eta",  nbineta2D,etamin,etamax,nbineop2D,0.,eopmaxsht);
00298   h_ele_EoPVsPhi            = new TH2F( "h_ele_EoPVsPhi",            "ele E/P_{vertex} vs phi",  nbinphi2D,phimin,phimax,nbineop2D,0.,eopmaxsht);
00299   h_ele_EoPVsE            = new TH2F( "h_ele_EoPVsE",            "ele E/P_{vertex} vs E",  50,0.,pmax ,50,0.,5.);
00300   h_ele_EseedOP            = new TH1F( "h_ele_EseedOP",            "ele E_{seed}/P_{vertex}",        nbineop,0.,eopmax);
00301   h_ele_EseedOP->Sumw2();
00302   h_ele_EseedOP_eg            = new TH1F( "h_ele_EseedOP_eg",            "ele E_{seed}/P_{vertex}, ecal driven",        nbineop,0.,eopmax);
00303   h_ele_EseedOP_eg->Sumw2();
00304   h_ele_EseedOP_barrel            = new TH1F( "h_ele_EseedOP_barrel",            "ele E_{seed}/P_{vertex} barrel",        nbineop,0.,eopmax);
00305   h_ele_EseedOP_barrel->Sumw2();
00306   h_ele_EseedOP_eg_barrel            = new TH1F( "h_ele_EseedOP_eg_barrel",            "ele E_{seed}/P_{vertex}, ecal driven barrel",        nbineop,0.,eopmax);
00307   h_ele_EseedOP_eg_barrel->Sumw2();
00308   h_ele_EseedOP_endcaps            = new TH1F( "h_ele_EseedOP_endcaps",            "ele E_{seed}/P_{vertex} endcaps",        nbineop,0.,eopmax);
00309   h_ele_EseedOP_endcaps->Sumw2();
00310   h_ele_EseedOP_eg_endcaps            = new TH1F( "h_ele_EseedOP_eg_endcaps",            "ele E_{seed}/P_{vertex}, ecal driven, endcaps",        nbineop,0.,eopmax);
00311   h_ele_EseedOP_eg_endcaps->Sumw2();
00312   h_ele_EseedOPVsEta            = new TH2F( "h_ele_EseedOPVsEta",            "ele E_{seed}/P_{vertex} vs eta",  nbineta2D,etamin,etamax,nbineop2D,0.,eopmaxsht);
00313   h_ele_EseedOPVsPhi            = new TH2F( "h_ele_EseedOPVsPhi",            "ele E_{seed}/P_{vertex} vs phi",  nbinphi2D,phimin,phimax,nbineop2D,0.,eopmaxsht);
00314   h_ele_EseedOPVsE            = new TH2F( "h_ele_EseedOPVsE",            "ele E_{seed}/P_{vertex} vs E",  50,0.,pmax ,50,0.,5.);
00315   h_ele_EoPout         = new TH1F( "h_ele_EoPout",         "ele E_{seed}/P_{out}",           nbineop,0.,eopmax);
00316   h_ele_EoPout->Sumw2();
00317   h_ele_EoPout_eg         = new TH1F( "h_ele_EoPout_eg",         "ele E_{seed}/P_{out}, ecal driven",           nbineop,0.,eopmax);
00318   h_ele_EoPout_eg->Sumw2();
00319   h_ele_EoPout_barrel         = new TH1F( "h_ele_EoPout_barrel",         "ele E_{seed}/P_{out} barrel",           nbineop,0.,eopmax);
00320   h_ele_EoPout_barrel->Sumw2();
00321   h_ele_EoPout_eg_barrel         = new TH1F( "h_ele_EoPout_eg_barrel",         "ele E_{seed}/P_{out}, ecal driven, barrel",           nbineop,0.,eopmax);
00322   h_ele_EoPout_eg_barrel->Sumw2();
00323   h_ele_EoPout_endcaps         = new TH1F( "h_ele_EoPout_endcaps",         "ele E_{seed}/P_{out} endcaps",           nbineop,0.,eopmax);
00324   h_ele_EoPout_endcaps->Sumw2();
00325   h_ele_EoPout_eg_endcaps         = new TH1F( "h_ele_EoPout_eg_endcaps",         "ele E_{seed}/P_{out}, ecal driven, endcaps",           nbineop,0.,eopmax);
00326   h_ele_EoPout_eg_endcaps->Sumw2();
00327   h_ele_EoPoutVsEta         = new TH2F( "h_ele_EoPoutVsEta",         "ele E/P_{out} vs eta",    nbineta2D,etamin,etamax,nbineop2D,0.,eopmaxsht);
00328   h_ele_EoPoutVsPhi         = new TH2F( "h_ele_EoPoutVsPhi",         "ele E/P_{out} vs phi",    nbinphi2D,phimin,phimax,nbineop2D,0.,eopmaxsht);
00329   h_ele_EoPoutVsE         = new TH2F( "h_ele_EoPoutVsE",         "ele E/P_{out} vs E",    nbinp2D,0.,pmax,nbineop2D,0.,eopmaxsht);
00330   h_ele_EeleOPout         = new TH1F( "h_ele_EeleOPout",         "ele E_{ele}/P_{out}",           nbineop,0.,eopmax);
00331   h_ele_EeleOPout->Sumw2();
00332   h_ele_EeleOPout_eg         = new TH1F( "h_ele_EeleOPout_eg",         "ele E_{ele}/P_{out}, ecal driven",           nbineop,0.,eopmax);
00333   h_ele_EeleOPout_eg->Sumw2();
00334   h_ele_EeleOPout_barrel         = new TH1F( "h_ele_EeleOPout_barrel",         "ele E_{ele}/P_{out} barrel",           nbineop,0.,eopmax);
00335   h_ele_EeleOPout_barrel->Sumw2();
00336   h_ele_EeleOPout_eg_barrel         = new TH1F( "h_ele_EeleOPout_eg_barrel",         "ele E_{ele}/P_{out}, ecal driven, barrel",           nbineop,0.,eopmax);
00337   h_ele_EeleOPout_eg_barrel->Sumw2();
00338   h_ele_EeleOPout_endcaps         = new TH1F( "h_ele_EeleOPout_endcaps",         "ele E_{ele}/P_{out} endcaps",           nbineop,0.,eopmax);
00339   h_ele_EeleOPout_endcaps->Sumw2();
00340   h_ele_EeleOPout_eg_endcaps         = new TH1F( "h_ele_EeleOPout_eg_endcaps",         "ele E_{ele}/P_{out}, ecal driven, endcaps",           nbineop,0.,eopmax);
00341   h_ele_EeleOPout_eg_endcaps->Sumw2();
00342   h_ele_EeleOPoutVsEta         = new TH2F( "h_ele_EeleOPoutVsEta",         "ele E_{ele}/P_{out} vs eta",    nbineta2D,etamin,etamax,nbineop2D,0.,eopmaxsht);
00343   h_ele_EeleOPoutVsPhi         = new TH2F( "h_ele_EeleOPoutVsPhi",         "ele E_{ele}/P_{out} vs phi",    nbinphi2D,phimin,phimax,nbineop2D,0.,eopmaxsht);
00344   h_ele_EeleOPoutVsE         = new TH2F( "h_ele_EeleOPoutVsE",         "ele E_{ele}/P_{out} vs E",    nbinp2D,0.,pmax,nbineop2D,0.,eopmaxsht);
00345   h_ele_dEtaSc_propVtx = new TH1F( "h_ele_dEtaSc_propVtx", "ele #eta_{sc} - #eta_{tr}, prop from vertex",      nbindetamatch,detamatchmin,detamatchmax);
00346   h_ele_dEtaSc_propVtx->Sumw2();
00347   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);
00348   h_ele_dEtaSc_propVtx_eg->Sumw2();
00349   h_ele_dEtaSc_propVtx_barrel = new TH1F( "h_ele_dEtaSc_propVtx_barrel", "ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",      nbindetamatch,detamatchmin,detamatchmax);
00350   h_ele_dEtaSc_propVtx_barrel->Sumw2();
00351   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);
00352   h_ele_dEtaSc_propVtx_eg_barrel->Sumw2();
00353   h_ele_dEtaSc_propVtx_endcaps = new TH1F( "h_ele_dEtaSc_propVtx_endcaps", "ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",      nbindetamatch,detamatchmin,detamatchmax);
00354   h_ele_dEtaSc_propVtx_endcaps->Sumw2();
00355   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);
00356   h_ele_dEtaSc_propVtx_eg_endcaps->Sumw2();
00357   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);
00358   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);
00359   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);
00360   h_ele_dPhiSc_propVtx = new TH1F( "h_ele_dPhiSc_propVtx", "ele #phi_{sc} - #phi_{tr}, prop from vertex",      nbindphimatch,dphimatchmin,dphimatchmax);
00361   h_ele_dPhiSc_propVtx->Sumw2();
00362   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);
00363   h_ele_dPhiSc_propVtx_eg->Sumw2();
00364   h_ele_dPhiSc_propVtx_barrel = new TH1F( "h_ele_dPhiSc_propVtx_barrel", "ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",      nbindphimatch,dphimatchmin,dphimatchmax);
00365   h_ele_dPhiSc_propVtx_barrel->Sumw2();
00366   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);
00367   h_ele_dPhiSc_propVtx_eg_barrel->Sumw2();
00368   h_ele_dPhiSc_propVtx_endcaps = new TH1F( "h_ele_dPhiSc_propVtx_endcaps", "ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",      nbindphimatch,dphimatchmin,dphimatchmax);
00369   h_ele_dPhiSc_propVtx_endcaps->Sumw2();
00370   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);
00371   h_ele_dPhiSc_propVtx_eg_endcaps->Sumw2();
00372   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);
00373   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);
00374   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);
00375   h_ele_dEtaCl_propOut = new TH1F( "h_ele_dEtaCl_propOut", "ele #eta_{cl} - #eta_{tr}, prop from outermost",   nbindetamatch,detamatchmin,detamatchmax);
00376   h_ele_dEtaCl_propOut->Sumw2();
00377   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);
00378   h_ele_dEtaCl_propOut_eg->Sumw2();
00379   h_ele_dEtaCl_propOut_barrel = new TH1F( "h_ele_dEtaCl_propOut_barrel", "ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",   nbindetamatch,detamatchmin,detamatchmax);
00380   h_ele_dEtaCl_propOut_barrel->Sumw2();
00381   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);
00382   h_ele_dEtaCl_propOut_eg_barrel->Sumw2();
00383   h_ele_dEtaCl_propOut_endcaps = new TH1F( "h_ele_dEtaCl_propOut_endcaps", "ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",   nbindetamatch,detamatchmin,detamatchmax);
00384   h_ele_dEtaCl_propOut_endcaps->Sumw2();
00385   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);
00386   h_ele_dEtaCl_propOut_eg_endcaps->Sumw2();
00387   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);
00388   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);
00389   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);
00390   h_ele_dPhiCl_propOut = new TH1F( "h_ele_dPhiCl_propOut", "ele #phi_{cl} - #phi_{tr}, prop from outermost",   nbindphimatch,dphimatchmin,dphimatchmax);
00391   h_ele_dPhiCl_propOut->Sumw2();
00392   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);
00393   h_ele_dPhiCl_propOut_eg->Sumw2();
00394   h_ele_dPhiCl_propOut_barrel = new TH1F( "h_ele_dPhiCl_propOut_barrel", "ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",   nbindphimatch,dphimatchmin,dphimatchmax);
00395   h_ele_dPhiCl_propOut_barrel->Sumw2();
00396   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);
00397   h_ele_dPhiCl_propOut_eg_barrel->Sumw2();
00398   h_ele_dPhiCl_propOut_endcaps = new TH1F( "h_ele_dPhiCl_propOut_endcaps", "ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",   nbindphimatch,dphimatchmin,dphimatchmax);
00399   h_ele_dPhiCl_propOut_endcaps->Sumw2();
00400   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);
00401   h_ele_dPhiCl_propOut_eg_endcaps->Sumw2();
00402   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);
00403   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);
00404   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);
00405   h_ele_dEtaEleCl_propOut = new TH1F( "h_ele_dEtaEleCl_propOut", "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",   nbindetamatch,detamatchmin,detamatchmax);
00406   h_ele_dEtaEleCl_propOut->Sumw2();
00407   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);
00408   h_ele_dEtaEleCl_propOut_eg->Sumw2();
00409   h_ele_dEtaEleCl_propOut_barrel = new TH1F( "h_ele_dEtaEleCl_propOut_barrel", "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",   nbindetamatch,detamatchmin,detamatchmax);
00410   h_ele_dEtaEleCl_propOut_barrel->Sumw2();
00411   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);
00412   h_ele_dEtaEleCl_propOut_eg_barrel->Sumw2();
00413   h_ele_dEtaEleCl_propOut_endcaps = new TH1F( "h_ele_dEtaEleCl_propOut_endcaps", "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",   nbindetamatch,detamatchmin,detamatchmax);
00414   h_ele_dEtaEleCl_propOut_endcaps->Sumw2();
00415   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);
00416   h_ele_dEtaEleCl_propOut_eg_endcaps->Sumw2();
00417   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);
00418   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);
00419   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);
00420   h_ele_dPhiEleCl_propOut = new TH1F( "h_ele_dPhiEleCl_propOut", "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",   nbindphimatch,dphimatchmin,dphimatchmax);
00421   h_ele_dPhiEleCl_propOut->Sumw2();
00422   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);
00423   h_ele_dPhiEleCl_propOut_eg->Sumw2();
00424   h_ele_dPhiEleCl_propOut_barrel = new TH1F( "h_ele_dPhiEleCl_propOut_barrel", "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",   nbindphimatch,dphimatchmin,dphimatchmax);
00425   h_ele_dPhiEleCl_propOut_barrel->Sumw2();
00426   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);
00427   h_ele_dPhiEleCl_propOut_eg_barrel->Sumw2();
00428   h_ele_dPhiEleCl_propOut_endcaps = new TH1F( "h_ele_dPhiEleCl_propOut_endcaps", "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",   nbindphimatch,dphimatchmin,dphimatchmax);
00429   h_ele_dPhiEleCl_propOut_endcaps->Sumw2();
00430   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);
00431   h_ele_dPhiEleCl_propOut_eg_endcaps->Sumw2();
00432   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);
00433   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);
00434   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);
00435 
00436   h_ele_HoE = new TH1F("h_ele_HoE", "ele hadronic energy / em energy", nbinhoe, hoemin, hoemax) ;
00437   h_ele_HoE->Sumw2();
00438   h_ele_HoE_eg = new TH1F("h_ele_HoE_eg", "ele hadronic energy / em energy, ecal driven", nbinhoe, hoemin, hoemax) ;
00439   h_ele_HoE_eg->Sumw2();
00440   h_ele_HoE_barrel = new TH1F("h_ele_HoE_barrel", "ele hadronic energy / em energy, barrel", nbinhoe, hoemin, hoemax) ;
00441   h_ele_HoE_barrel->Sumw2();
00442   h_ele_HoE_eg_barrel = new TH1F("h_ele_HoE_eg_barrel", "ele hadronic energy / em energy, ecal driven, barrel", nbinhoe, hoemin, hoemax) ;
00443   h_ele_HoE_eg_barrel->Sumw2();
00444   h_ele_HoE_endcaps = new TH1F("h_ele_HoE_endcaps", "ele hadronic energy / em energy, endcaps", nbinhoe, hoemin, hoemax) ;
00445   h_ele_HoE_endcaps->Sumw2();
00446   h_ele_HoE_eg_endcaps = new TH1F("h_ele_HoE_eg_endcaps", "ele hadronic energy / em energy, ecal driven, endcaps", nbinhoe, hoemin, hoemax) ;
00447   h_ele_HoE_eg_endcaps->Sumw2();
00448   h_ele_HoE_fiducial = new TH1F("h_ele_HoE_fiducial", "ele hadronic energy / em energy",nbinhoe, hoemin, hoemax) ;
00449   h_ele_HoEVsEta = new TH2F("h_ele_HoEVsEta", "ele hadronic energy / em energy vs eta", nbineta,etamin,etamax,nbinhoe, hoemin, hoemax) ;
00450   h_ele_HoEVsPhi = new TH2F("h_ele_HoEVsPhi", "ele hadronic energy / em energy vs phi", nbinphi2D,phimin,phimax,nbinhoe, hoemin, hoemax) ;
00451   h_ele_HoEVsE = new TH2F("h_ele_HoEVsE", "ele hadronic energy / em energy vs E", nbinp, 0.,300.,nbinhoe, hoemin, hoemax) ;
00452 
00453   h_ele_seed_dphi2_ = new TH1F("h_ele_seedDphi2", "ele seed dphi 2nd layer", 50,-0.003,+0.003) ;
00454   h_ele_seed_dphi2VsEta_ = new TH2F("h_ele_seedDphi2VsEta", "ele seed dphi 2nd layer vs eta", nbineta2D,etamin,etamax,50,-0.003,+0.003) ;
00455   h_ele_seed_dphi2VsPt_ = new TH2F("h_ele_seedDphi2VsPt", "ele seed dphi 2nd layer vs pt", nbinpt2D,0.,ptmax,50,-0.003,+0.003) ;
00456   h_ele_seed_drz2_ = new TH1F("h_ele_seedDrz2", "ele seed dr/dz 2nd layer", 50,-0.03,+0.03) ;
00457   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) ;
00458   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) ;
00459   h_ele_seed_subdet2_ = new TH1F("h_ele_seedSubdet2", "ele seed subdet 2nd layer", 10,0.,10.) ;
00460 
00461   // classes
00462   h_ele_classes = new TH1F( "h_ele_classes", "electron classes",      20,0.0,20.);
00463   h_ele_eta = new TH1F( "h_ele_eta", "ele electron eta",  nbineta/2,0.0,etamax);
00464   h_ele_eta_golden = new TH1F( "h_ele_eta_golden", "ele electron eta golden",  nbineta/2,0.0,etamax);
00465   h_ele_eta_bbrem = new TH1F( "h_ele_eta_bbrem", "ele electron eta bbrem",  nbineta/2,0.0,etamax);
00466   h_ele_eta_narrow = new TH1F( "h_ele_eta_narrow", "ele electron eta narrow",  nbineta/2,0.0,etamax);
00467   h_ele_eta_shower = new TH1F( "h_ele_eta_show", "el, electron eta showering",  nbineta/2,0.0,etamax);
00468   h_ele_PinVsPoutGolden_mode = new TH2F( "h_ele_PinVsPoutGolden_mode",      "ele track inner p vs outer p, golden, mode" ,nbinp2D,0.,pmax,50,0.,pmax);
00469   h_ele_PinVsPoutShowering_mode = new TH2F( "h_ele_PinVsPoutShowering_mode",      "ele track inner p vs outer p vs eta, showering, mode" ,nbinp2D,0.,pmax,50,0.,pmax);
00470   h_ele_PinVsPoutGolden_mean = new TH2F( "h_ele_PinVsPoutGolden_mean",      "ele track inner p vs outer p, golden, mean" ,nbinp2D,0.,pmax,50,0.,pmax);
00471   h_ele_PinVsPoutShowering_mean = new TH2F( "h_ele_PinVsPoutShowering_mean",      "ele track inner p vs outer p, showering, mean" ,nbinp2D,0.,pmax,50,0.,pmax);
00472   h_ele_PtinVsPtoutGolden_mode = new TH2F( "h_ele_PtinVsPtoutGolden_mode",      "ele track inner pt vs outer pt, golden, mode" ,nbinpt2D,0.,ptmax,50,0.,ptmax);
00473   h_ele_PtinVsPtoutShowering_mode = new TH2F( "h_ele_PtinVsPtoutShowering_mode",      "ele track inner pt vs outer pt, showering, mode" ,nbinpt2D,0.,ptmax,50,0.,ptmax);
00474   h_ele_PtinVsPtoutGolden_mean = new TH2F( "h_ele_PtinVsPtoutGolden_mean",      "ele track inner pt vs outer pt, golden, mean" ,nbinpt2D,0.,ptmax,50,0.,ptmax);
00475   h_ele_PtinVsPtoutShowering_mean = new TH2F( "h_ele_PtinVsPtoutShowering_mean",      "ele track inner pt vs outer pt, showering, mean" ,nbinpt2D,0.,ptmax,50,0.,ptmax);
00476   histSclEoEmatchingObjectGolden_barrel = new TH1F("h_scl_EoEmatchingObject golden, barrel","ele SC energy over matching jet energy, golden, barrel",100,0.2,1.2);
00477   histSclEoEmatchingObjectGolden_endcaps = new TH1F("h_scl_EoEmatchingObject golden, endcaps","ele SC energy over matching jet energy, golden, endcaps",100,0.2,1.2);
00478   histSclEoEmatchingObjectShowering_barrel = new TH1F("h_scl_EoEmatchingObject showering, barrel","ele SC energy over matching jet energy, showering, barrel",100,0.2,1.2);
00479   histSclEoEmatchingObjectShowering_endcaps = new TH1F("h_scl_EoEmatchingObject showering, endcaps","ele SC energy over matching jet energy, showering, endcaps",100,0.2,1.2);
00480 
00481   // isolation
00482   h_ele_tkSumPt_dr03 = new TH1F("h_ele_tkSumPt_dr03","tk isolation sum, dR=0.3",100,0.0,20.);
00483   h_ele_ecalRecHitSumEt_dr03= new TH1F("h_ele_ecalRecHitSumEt_dr03","ecal isolation sum, dR=0.3",100,0.0,20.);
00484   h_ele_hcalDepth1TowerSumEt_dr03= new TH1F("h_ele_hcalDepth1TowerSumEt_dr03","hcal depth1 isolation sum, dR=0.3",100,0.0,20.);
00485   h_ele_hcalDepth2TowerSumEt_dr03= new TH1F("h_ele_hcalDepth2TowerSumEt_dr03","hcal depth2 isolation sum, dR=0.3",100,0.0,20.);
00486   h_ele_tkSumPt_dr04= new TH1F("h_ele_tkSumPt_dr04","hcal isolation sum",100,0.0,20.);
00487   h_ele_ecalRecHitSumEt_dr04= new TH1F("h_ele_ecalRecHitSumEt_dr04","ecal isolation sum, dR=0.4",100,0.0,20.);
00488   h_ele_hcalDepth1TowerSumEt_dr04= new TH1F("h_ele_hcalDepth1TowerSumEt_dr04","hcal depth1 isolation sum, dR=0.4",100,0.0,20.);
00489   h_ele_hcalDepth2TowerSumEt_dr04= new TH1F("h_ele_hcalDepth2TowerSumEt_dr04","hcal depth2 isolation sum, dR=0.4",100,0.0,20.);
00490 
00491   // fbrem
00492   h_ele_fbrem = new TH1F( "h_ele_fbrem","ele brem fraction, mode",100,0.,1.);
00493   h_ele_fbremVsEta_mode = new TProfile( "h_ele_fbremvsEtamode","mean ele brem fraction vs eta, mode",nbineta2D,etamin,etamax,0.,1.);
00494   h_ele_fbremVsEta_mean = new TProfile( "h_ele_fbremvsEtamean","mean ele brem fraction vs eta, mean",nbineta2D,etamin,etamax,0.,1.);
00495 
00496   // e/g et pflow electrons
00497   h_ele_mva = new TH1F( "h_ele_mva","ele mva",100,-1.,1.);
00498   h_ele_provenance = new TH1F( "h_ele_provenance","ele provenance",5,-2.,3.);
00499 
00500   // histos titles
00501   h_matchingObjectNum              -> GetXaxis()-> SetTitle("N_{SC}");
00502   h_matchingObjectNum              -> GetYaxis()-> SetTitle("Events");
00503   h_matchingObjectEta             -> GetXaxis()-> SetTitle("#eta_{SC}");
00504   h_matchingObjectEta             -> GetYaxis()-> SetTitle("Events");
00505   h_matchingObjectP               -> GetXaxis()-> SetTitle("E_{SC} (GeV)");
00506   h_matchingObjectP               -> GetYaxis()-> SetTitle("Events");
00507   h_ele_foundHits      -> GetXaxis()-> SetTitle("N_{hits}");
00508   h_ele_foundHits      -> GetYaxis()-> SetTitle("Events");
00509   h_ele_ambiguousTracks      -> GetXaxis()-> SetTitle("N_{ambiguous tracks}");
00510   h_ele_ambiguousTracks      -> GetYaxis()-> SetTitle("Events");
00511   h_ele_lostHits       -> GetXaxis()-> SetTitle("N_{lost hits}");
00512   h_ele_lostHits       -> GetYaxis()-> SetTitle("Events");
00513   h_ele_chi2           -> GetXaxis()-> SetTitle("#Chi^{2}");
00514   h_ele_chi2           -> GetYaxis()-> SetTitle("Events");
00515   h_ele_charge         -> GetXaxis()-> SetTitle("charge");
00516   h_ele_charge         -> GetYaxis()-> SetTitle("Events");
00517   h_ele_vertexP        -> GetXaxis()-> SetTitle("p_{vertex} (GeV/c)");
00518   h_ele_vertexP        -> GetYaxis()-> SetTitle("Events");
00519   h_ele_vertexPt       -> GetXaxis()-> SetTitle("p_{T vertex} (GeV/c)");
00520   h_ele_vertexPt       -> GetYaxis()-> SetTitle("Events");
00521   h_ele_vertexEta      -> GetXaxis()-> SetTitle("#eta");
00522   h_ele_vertexEta      -> GetYaxis()-> SetTitle("Events");
00523   h_ele_vertexPhi      -> GetXaxis()-> SetTitle("#phi (rad)");
00524   h_ele_vertexPhi      -> GetYaxis()-> SetTitle("Events");
00525   h_ele_PoPmatchingObject        -> GetXaxis()-> SetTitle("P/P_{jet}");
00526   h_ele_PoPmatchingObject        -> GetYaxis()-> SetTitle("Events");
00527   h_ele_PoPmatchingObject_barrel        -> GetXaxis()-> SetTitle("P/P_{jet}");
00528   h_ele_PoPmatchingObject_barrel        -> GetYaxis()-> SetTitle("Events");
00529   h_ele_PoPmatchingObject_endcaps        -> GetXaxis()-> SetTitle("P/P_{jet}");
00530   h_ele_PoPmatchingObject_endcaps        -> GetYaxis()-> SetTitle("Events");
00531   histSclSigIEtaIEta_-> GetXaxis()-> SetTitle("#sigma_{#eta #eta}") ;
00532   histSclSigIEtaIEta_-> GetYaxis()-> SetTitle("Events") ;
00533   histSclSigIEtaIEta_barrel_-> GetXaxis()-> SetTitle("#sigma_{i#eta i#eta}") ;
00534   histSclSigIEtaIEta_barrel_-> GetYaxis()-> SetTitle("Events") ;
00535   histSclSigIEtaIEta_endcaps_-> GetXaxis()-> SetTitle("#sigma_{i#eta i#eta}") ;
00536   histSclSigIEtaIEta_endcaps_-> GetYaxis()-> SetTitle("Events") ;
00537   histSclE1x5_-> GetXaxis()-> SetTitle("E1x5 (GeV)") ;
00538   histSclE1x5_-> GetYaxis()-> SetTitle("Events") ;
00539   histSclE1x5_barrel_-> GetXaxis()-> SetTitle("E1x5 (GeV)") ;
00540   histSclE1x5_barrel_-> GetYaxis()-> SetTitle("Events") ;
00541   histSclE1x5_endcaps_-> GetXaxis()-> SetTitle("E1x5 (GeV)") ;
00542   histSclE1x5_endcaps_-> GetYaxis()-> SetTitle("Events") ;
00543   histSclE2x5max_-> GetXaxis()-> SetTitle("E2x5 (GeV)") ;
00544   histSclE2x5max_-> GetYaxis()-> SetTitle("Events") ;
00545   histSclE2x5max_barrel_-> GetXaxis()-> SetTitle("E2x5 (GeV)") ;
00546   histSclE2x5max_barrel_-> GetYaxis()-> SetTitle("Events") ;
00547   histSclE2x5max_endcaps_-> GetXaxis()-> SetTitle("E2x5 (GeV)") ;
00548   histSclE2x5max_endcaps_-> GetYaxis()-> SetTitle("Events") ;
00549   histSclE5x5_-> GetXaxis()-> SetTitle("E5x5 (GeV)") ;
00550   histSclE5x5_-> GetYaxis()-> SetTitle("Events") ;
00551   histSclE5x5_barrel_-> GetXaxis()-> SetTitle("E5x5 (GeV)") ;
00552   histSclE5x5_barrel_-> GetYaxis()-> SetTitle("Events") ;
00553   histSclE5x5_endcaps_-> GetXaxis()-> SetTitle("E5x5 (GeV)") ;
00554   histSclE5x5_endcaps_-> GetYaxis()-> SetTitle("Events") ;
00555   h_ele_EtaMnEtamatchingObject   -> GetXaxis()-> SetTitle("#eta_{rec} - #eta_{jet}");
00556   h_ele_EtaMnEtamatchingObject   -> GetYaxis()-> SetTitle("Events");
00557   h_ele_PhiMnPhimatchingObject   -> GetXaxis()-> SetTitle("#phi_{rec} - #phi_{jet} (rad)");
00558   h_ele_PhiMnPhimatchingObject   -> GetYaxis()-> SetTitle("Events");
00559   h_ele_PinMnPout      -> GetXaxis()-> SetTitle("P_{vertex} - P_{out} (GeV/c)");
00560   h_ele_PinMnPout      -> GetYaxis()-> SetTitle("Events");
00561   h_ele_PinMnPout_mode      -> GetXaxis()-> SetTitle("P_{vertex} - P_{out}, mode (GeV/c)");
00562   h_ele_PinMnPout_mode      -> GetYaxis()-> SetTitle("Events");
00563   h_ele_outerP         -> GetXaxis()-> SetTitle("P_{out} (GeV/c)");
00564   h_ele_outerP         -> GetYaxis()-> SetTitle("Events");
00565   h_ele_outerP_mode         -> GetXaxis()-> SetTitle("P_{out} (GeV/c)");
00566   h_ele_outerP_mode         -> GetYaxis()-> SetTitle("Events");
00567   h_ele_outerPt        -> GetXaxis()-> SetTitle("P_{T out} (GeV/c)");
00568   h_ele_outerPt        -> GetYaxis()-> SetTitle("Events");
00569   h_ele_outerPt_mode        -> GetXaxis()-> SetTitle("P_{T out} (GeV/c)");
00570   h_ele_outerPt_mode        -> GetYaxis()-> SetTitle("Events");
00571   h_ele_EoP            -> GetXaxis()-> SetTitle("E/P_{vertex}");
00572   h_ele_EoP            -> GetYaxis()-> SetTitle("Events");
00573   h_ele_EseedOP            -> GetXaxis()-> SetTitle("E_{seed}/P_{vertex}");
00574   h_ele_EseedOP            -> GetYaxis()-> SetTitle("Events");
00575   h_ele_EoPout         -> GetXaxis()-> SetTitle("E_{seed}/P_{out}");
00576   h_ele_EoPout         -> GetYaxis()-> SetTitle("Events");
00577   h_ele_EeleOPout         -> GetXaxis()-> SetTitle("E_{ele}/P_{out}");
00578   h_ele_EeleOPout         -> GetYaxis()-> SetTitle("Events");
00579   h_ele_EoP_barrel            -> GetXaxis()-> SetTitle("E/P_{vertex}");
00580   h_ele_EoP_barrel            -> GetYaxis()-> SetTitle("Events");
00581   h_ele_EseedOP_barrel            -> GetXaxis()-> SetTitle("E_{seed}/P_{vertex}");
00582   h_ele_EseedOP_barrel            -> GetYaxis()-> SetTitle("Events");
00583   h_ele_EoPout_barrel         -> GetXaxis()-> SetTitle("E_{seed}/P_{out}");
00584   h_ele_EoPout_barrel         -> GetYaxis()-> SetTitle("Events");
00585   h_ele_EeleOPout_barrel         -> GetXaxis()-> SetTitle("E_{ele}/P_{out}");
00586   h_ele_EeleOPout_barrel         -> GetYaxis()-> SetTitle("Events");
00587   h_ele_EoP_endcaps            -> GetXaxis()-> SetTitle("E/P_{vertex}");
00588   h_ele_EoP_endcaps            -> GetYaxis()-> SetTitle("Events");
00589   h_ele_EseedOP_endcaps            -> GetXaxis()-> SetTitle("E_{seed}/P_{vertex}");
00590   h_ele_EseedOP_endcaps            -> GetYaxis()-> SetTitle("Events");
00591   h_ele_EoPout_endcaps         -> GetXaxis()-> SetTitle("E_{seed}/P_{out}");
00592   h_ele_EoPout_endcaps         -> GetYaxis()-> SetTitle("Events");
00593   h_ele_EeleOPout_endcaps         -> GetXaxis()-> SetTitle("E_{ele}/P_{out}");
00594   h_ele_EeleOPout_endcaps         -> GetYaxis()-> SetTitle("Events");
00595   h_ele_vertexX-> GetXaxis()-> SetTitle("x (cm)");
00596   h_ele_vertexX-> GetYaxis()-> SetTitle("Events");
00597   h_ele_vertexY-> GetXaxis()-> SetTitle("y (cm)");
00598   h_ele_vertexY-> GetYaxis()-> SetTitle("Events");
00599   h_ele_vertexZ-> GetXaxis()-> SetTitle("z (cm)");
00600   h_ele_vertexZ-> GetYaxis()-> SetTitle("Events");
00601   h_ele_vertexTIP-> GetXaxis()-> SetTitle("TIP (cm)");
00602   h_ele_vertexTIP-> GetYaxis()-> SetTitle("Events");
00603   h_ele_TIP_all-> GetXaxis()-> SetTitle("r_{T} (cm)");
00604   h_ele_TIP_all-> GetYaxis()-> SetTitle("Events");
00605   h_ele_vertexTIPVsEta-> GetYaxis()-> SetTitle("TIP (cm)");
00606   h_ele_vertexTIPVsEta-> GetXaxis()-> SetTitle("#eta");
00607   h_ele_vertexTIPVsPhi-> GetYaxis()-> SetTitle("TIP (cm)");
00608   h_ele_vertexTIPVsPhi-> GetXaxis()-> SetTitle("#phi (rad)");
00609   h_ele_vertexTIPVsPt-> GetYaxis()-> SetTitle("TIP (cm)");
00610   h_ele_vertexTIPVsPt-> GetXaxis()-> SetTitle("p_{T} (GeV/c)");
00611   h_ele_dEtaSc_propVtx-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
00612   h_ele_dEtaSc_propVtx-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
00613   h_ele_dEtaSc_propVtx-> GetYaxis()-> SetTitle("Events");
00614   h_ele_dEtaCl_propOut-> GetXaxis()-> SetTitle("#eta_{seedcl} - #eta_{tr}");
00615   h_ele_dEtaCl_propOut-> GetYaxis()-> SetTitle("Events");
00616   h_ele_dEtaEleCl_propOut-> GetXaxis()-> SetTitle("#eta_{elecl} - #eta_{tr}");
00617   h_ele_dEtaEleCl_propOut-> GetYaxis()-> SetTitle("Events");
00618   h_ele_dPhiSc_propVtx-> GetXaxis()-> SetTitle("#phi_{sc} - #phi_{tr} (rad)");
00619   h_ele_dPhiSc_propVtx-> GetYaxis()-> SetTitle("Events");
00620   h_ele_dPhiCl_propOut-> GetXaxis()-> SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
00621   h_ele_dPhiCl_propOut-> GetYaxis()-> SetTitle("Events");
00622   h_ele_dPhiEleCl_propOut-> GetXaxis()-> SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
00623   h_ele_dPhiEleCl_propOut-> GetYaxis()-> SetTitle("Events");
00624   h_ele_dEtaSc_propVtx_barrel-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
00625   h_ele_dEtaSc_propVtx_barrel-> GetYaxis()-> SetTitle("Events");
00626   h_ele_dEtaCl_propOut_barrel-> GetXaxis()-> SetTitle("#eta_{seedcl} - #eta_{tr}");
00627   h_ele_dEtaCl_propOut_barrel-> GetYaxis()-> SetTitle("Events");
00628   h_ele_dEtaEleCl_propOut_barrel-> GetXaxis()-> SetTitle("#eta_{elecl} - #eta_{tr}");
00629   h_ele_dEtaEleCl_propOut_barrel-> GetYaxis()-> SetTitle("Events");
00630   h_ele_dPhiSc_propVtx_barrel-> GetXaxis()-> SetTitle("#phi_{sc} - #phi_{tr} (rad)");
00631   h_ele_dPhiSc_propVtx_barrel-> GetYaxis()-> SetTitle("Events");
00632   h_ele_dPhiCl_propOut_barrel-> GetXaxis()-> SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
00633   h_ele_dPhiCl_propOut_barrel-> GetYaxis()-> SetTitle("Events");
00634   h_ele_dPhiEleCl_propOut_barrel-> GetXaxis()-> SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
00635   h_ele_dPhiEleCl_propOut_barrel-> GetYaxis()-> SetTitle("Events");
00636   h_ele_dEtaSc_propVtx_endcaps-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
00637   h_ele_dEtaSc_propVtx_endcaps-> GetYaxis()-> SetTitle("Events");
00638   h_ele_dEtaCl_propOut_endcaps-> GetXaxis()-> SetTitle("#eta_{seedcl} - #eta_{tr}");
00639   h_ele_dEtaCl_propOut_endcaps-> GetYaxis()-> SetTitle("Events");
00640   h_ele_dEtaEleCl_propOut_endcaps-> GetXaxis()-> SetTitle("#eta_{elecl} - #eta_{tr}");
00641   h_ele_dEtaEleCl_propOut_endcaps-> GetYaxis()-> SetTitle("Events");
00642   h_ele_dPhiSc_propVtx_endcaps-> GetXaxis()-> SetTitle("#phi_{sc} - #phi_{tr} (rad)");
00643   h_ele_dPhiSc_propVtx_endcaps-> GetYaxis()-> SetTitle("Events");
00644   h_ele_dPhiCl_propOut_endcaps-> GetXaxis()-> SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
00645   h_ele_dPhiCl_propOut_endcaps-> GetYaxis()-> SetTitle("Events");
00646   h_ele_dPhiEleCl_propOut_endcaps-> GetXaxis()-> SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
00647   h_ele_dPhiEleCl_propOut_endcaps-> GetYaxis()-> SetTitle("Events");
00648   h_ele_HoE-> GetXaxis()-> SetTitle("H/E") ;
00649   h_ele_HoE-> GetYaxis()-> SetTitle("Events") ;
00650   h_ele_HoE_barrel-> GetXaxis()-> SetTitle("H/E") ;
00651   h_ele_HoE_barrel-> GetYaxis()-> SetTitle("Events") ;
00652   h_ele_HoE_endcaps-> GetXaxis()-> SetTitle("H/E") ;
00653   h_ele_HoE_endcaps-> GetYaxis()-> SetTitle("Events") ;
00654   h_ele_HoE_fiducial-> GetXaxis()-> SetTitle("H/E") ;
00655   h_ele_HoE_fiducial-> GetYaxis()-> SetTitle("Events") ;
00656   h_ele_fbrem-> GetXaxis()-> SetTitle("P_{in} - P_{out} / P_{in}");
00657   h_ele_fbrem-> GetYaxis()-> SetTitle("Events");
00658   h_ele_seed_dphi2_-> GetXaxis()-> SetTitle("#phi_{hit}-#phi_{pred} (rad)") ;
00659   h_ele_seed_dphi2_-> GetYaxis()-> SetTitle("Events") ;
00660   h_ele_seed_drz2_-> GetXaxis()-> SetTitle("r(z)_{hit}-r(z)_{pred} (cm)") ;
00661   h_ele_seed_drz2_-> GetYaxis()-> SetTitle("Events") ;
00662   h_ele_seed_subdet2_-> GetXaxis()-> SetTitle("2nd hit subdet Id") ;
00663   h_ele_seed_subdet2_-> GetYaxis()-> SetTitle("Events") ;
00664   h_ele_classes-> GetXaxis()-> SetTitle("class Id") ;
00665   h_ele_classes-> GetYaxis()-> SetTitle("Events") ;
00666   h_ele_EoverP_all-> GetXaxis()-> SetTitle("E/P_{vertex}");
00667   h_ele_EoverP_all-> GetYaxis()-> SetTitle("Events");
00668   h_ele_EseedOP_all-> GetXaxis()-> SetTitle("E_{seed}/P_{vertex}");
00669   h_ele_EseedOP_all-> GetYaxis()-> SetTitle("Events");
00670   h_ele_EoPout_all -> GetXaxis()-> SetTitle("E_{seed}/P_{out}");
00671   h_ele_EoPout_all-> GetYaxis()-> SetTitle("Events");
00672   h_ele_EeleOPout_all-> GetXaxis()-> SetTitle("E_{ele}/P_{out}");
00673   h_ele_EeleOPout_all-> GetYaxis()-> SetTitle("Events");
00674   h_ele_dEtaSc_propVtx_all-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
00675   h_ele_dEtaSc_propVtx_all-> GetYaxis()-> SetTitle("Events");
00676   h_ele_dPhiSc_propVtx_all-> GetXaxis()-> SetTitle("#phi_{sc} - #phi_{tr} (rad)");
00677   h_ele_dPhiSc_propVtx_all-> GetYaxis()-> SetTitle("Events");
00678   h_ele_dEtaCl_propOut_all-> GetXaxis()-> SetTitle("#eta_{sc} - #eta_{tr}");
00679   h_ele_dEtaCl_propOut_all-> GetYaxis()-> SetTitle("Events");
00680   h_ele_dPhiCl_propOut_all-> GetXaxis()-> SetTitle("#phi_{sc} - #phi_{tr} (rad)");
00681   h_ele_dPhiCl_propOut_all-> GetYaxis()-> SetTitle("Events");
00682   h_ele_HoE_all-> GetXaxis()-> SetTitle("H/E") ;
00683   h_ele_HoE_all-> GetYaxis()-> SetTitle("Events");
00684   h_ele_mee_all-> GetXaxis()-> SetTitle("m_{ee} (GeV/c^{2})");
00685   h_ele_mee_all-> GetYaxis()-> SetTitle("Events");
00686   h_ele_mee_os-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
00687   h_ele_mee_os-> GetYaxis()-> SetTitle("Events");
00688   h_ele_E2mnE1vsMee_all-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
00689   h_ele_E2mnE1vsMee_all-> GetYaxis()-> SetTitle("E2 - E1 (GeV)");
00690   h_ele_E2mnE1vsMee_egeg_all-> GetXaxis()-> SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
00691   h_ele_E2mnE1vsMee_egeg_all-> GetYaxis()-> SetTitle("E2 - E1 (GeV)");
00692   histNum_-> GetXaxis()-> SetTitle("N_{ele}");
00693   histNum_-> GetYaxis()-> SetTitle("Events");
00694   h_ele_fbremVsEta_mode-> GetXaxis()-> SetTitle("#eta");
00695   h_ele_fbremVsEta_mean-> GetXaxis()-> SetTitle("#eta");
00696 
00697 }
00698 
00699 void
00700 GsfElectronFakeAnalyzer::endJob(){
00701 
00702   histfile_->cd();
00703   std::cout << "efficiency calculation " << std::endl;
00704   // efficiency vs eta
00705   TH1F *h_ele_etaEff = (TH1F*)h_ele_matchingObjectEta_matched->Clone("h_ele_etaEff");
00706   h_ele_etaEff->Reset();
00707   h_ele_etaEff->Divide(h_ele_matchingObjectEta_matched,h_matchingObjectEta,1,1,"b");
00708   h_ele_etaEff->Print();
00709   h_ele_etaEff->GetXaxis()->SetTitle("#eta");
00710   h_ele_etaEff->GetYaxis()->SetTitle("Efficiency");
00711 
00712   // efficiency vs z
00713   TH1F *h_ele_zEff = (TH1F*)h_ele_matchingObjectZ_matched->Clone("h_ele_zEff");
00714   h_ele_zEff->Reset();
00715   h_ele_zEff->Divide(h_ele_matchingObjectZ_matched,h_matchingObjectZ,1,1,"b");
00716   h_ele_zEff->Print();
00717   h_ele_zEff->GetXaxis()->SetTitle("z (cm)");
00718   h_ele_zEff->GetYaxis()->SetTitle("Efficiency");
00719 
00720   // efficiency vs |eta|
00721   TH1F *h_ele_absetaEff = (TH1F*)h_ele_matchingObjectAbsEta_matched->Clone("h_ele_absetaEff");
00722   h_ele_absetaEff->Reset();
00723   h_ele_absetaEff->Divide(h_ele_matchingObjectAbsEta_matched,h_matchingObjectAbsEta,1,1,"b");
00724   h_ele_absetaEff->GetXaxis()->SetTitle("|#eta|");
00725   h_ele_absetaEff->GetYaxis()->SetTitle("Efficiency");
00726 
00727   // efficiency vs pt
00728   TH1F *h_ele_ptEff = (TH1F*)h_ele_matchingObjectPt_matched->Clone("h_ele_ptEff");
00729   h_ele_ptEff->Reset();
00730   h_ele_ptEff->Divide(h_ele_matchingObjectPt_matched,h_matchingObjectPt,1,1,"b");
00731   h_ele_ptEff->GetXaxis()->SetTitle("p_{T} (GeV/c)");
00732   h_ele_ptEff->GetYaxis()->SetTitle("Efficiency");
00733 
00734   // efficiency vs phi
00735   TH1F *h_ele_phiEff = (TH1F*)h_ele_matchingObjectPhi_matched->Clone("h_ele_phiEff");
00736   h_ele_phiEff->Reset();
00737   h_ele_phiEff->Divide(h_ele_matchingObjectPhi_matched,h_matchingObjectPhi,1,1,"b");
00738   h_ele_phiEff->GetXaxis()->SetTitle("#phi (rad)");
00739   h_ele_phiEff->GetYaxis()->SetTitle("Efficiency");
00740 
00741   // rec/matching objects all electrons
00742   TH1F *h_ele_etaEff_all = (TH1F*)h_ele_vertexEta_all->Clone("h_ele_etaEff_all");
00743   h_ele_etaEff_all->Reset();
00744   h_ele_etaEff_all->Divide(h_ele_vertexEta_all,h_matchingObjectEta,1,1,"b");
00745   h_ele_etaEff_all->Print();
00746   h_ele_etaEff_all->GetXaxis()->SetTitle("#eta");
00747   h_ele_etaEff_all->GetYaxis()->SetTitle("N_{rec}/N_{matching jet}");
00748   TH1F *h_ele_ptEff_all = (TH1F*)h_ele_vertexPt_all->Clone("h_ele_ptEff_all");
00749   h_ele_ptEff_all->Reset();
00750   h_ele_ptEff_all->Divide(h_ele_vertexPt_all,h_matchingObjectPt,1,1,"b");
00751   h_ele_ptEff_all->Print();
00752   h_ele_ptEff_all->GetXaxis()->SetTitle("p_{T} (GeV/c)");
00753   h_ele_ptEff_all->GetYaxis()->SetTitle("N_{rec}/N_{matching jet}");
00754 
00755   // classes
00756   TH1F *h_ele_eta_goldenFrac = (TH1F*)h_ele_eta_golden->Clone("h_ele_eta_goldenFrac");
00757   h_ele_eta_goldenFrac->Reset();
00758   h_ele_eta_goldenFrac->GetXaxis()->SetTitle("|#eta|");
00759   h_ele_eta_goldenFrac->GetYaxis()->SetTitle("Fraction of electrons");
00760   h_ele_eta_goldenFrac->Divide(h_ele_eta_golden,h_ele_eta,1,1);
00761   h_ele_eta_goldenFrac->SetTitle("fraction of golden electrons vs eta");
00762   TH1F *h_ele_eta_bbremFrac = (TH1F*)h_ele_eta_bbrem->Clone("h_ele_eta_bbremFrac");
00763   h_ele_eta_bbremFrac->Reset();
00764   h_ele_eta_bbremFrac->Divide(h_ele_eta_bbrem,h_ele_eta,1,1);
00765   h_ele_eta_bbremFrac->GetXaxis()->SetTitle("|#eta|");
00766   h_ele_eta_bbremFrac->GetYaxis()->SetTitle("Fraction of electrons");
00767   h_ele_eta_bbremFrac->SetTitle("fraction of big brem electrons vs eta");
00768   TH1F *h_ele_eta_narrowFrac = (TH1F*)h_ele_eta_narrow->Clone("h_ele_eta_narrowFrac");
00769   h_ele_eta_narrowFrac->Reset();
00770   h_ele_eta_narrowFrac->Divide(h_ele_eta_narrow,h_ele_eta,1,1);
00771   h_ele_eta_narrowFrac->GetXaxis()->SetTitle("|#eta|");
00772   h_ele_eta_narrowFrac->GetYaxis()->SetTitle("Fraction of electrons");
00773   h_ele_eta_narrowFrac->SetTitle("fraction of narrow electrons vs eta");
00774   TH1F *h_ele_eta_showerFrac = (TH1F*)h_ele_eta_shower->Clone("h_ele_eta_showerFrac");
00775   h_ele_eta_showerFrac->Reset();
00776   h_ele_eta_showerFrac->Divide(h_ele_eta_shower,h_ele_eta,1,1);
00777   h_ele_eta_showerFrac->GetXaxis()->SetTitle("|#eta|");
00778   h_ele_eta_showerFrac->GetYaxis()->SetTitle("Fraction of electrons");
00779   h_ele_eta_showerFrac->SetTitle("fraction of showering electrons vs eta");
00780 
00781   // fbrem
00782   TH1F *h_ele_xOverX0VsEta = new TH1F( "h_ele_xOverx0VsEta","mean X/X_0 vs eta",nbineta/2,0.0,2.5);
00783   for (int ibin=1;ibin<h_ele_fbremVsEta_mean->GetNbinsX()+1;ibin++) {
00784     double xOverX0 = 0.;
00785     if (h_ele_fbremVsEta_mean->GetBinContent(ibin)>0.) xOverX0 = -log(h_ele_fbremVsEta_mean->GetBinContent(ibin));
00786     h_ele_xOverX0VsEta->SetBinContent(ibin,xOverX0);
00787   }
00788 
00789   //profiles from 2D histos
00790   TProfile *p_ele_PoPmatchingObjectVsEta = h_ele_PoPmatchingObjectVsEta->ProfileX();
00791   p_ele_PoPmatchingObjectVsEta->SetTitle("mean ele momentum / matching SC energy vs eta");
00792   p_ele_PoPmatchingObjectVsEta->GetXaxis()->SetTitle("#eta");
00793   p_ele_PoPmatchingObjectVsEta->GetYaxis()->SetTitle("<P/E_{matching jet}>");
00794   p_ele_PoPmatchingObjectVsEta->Write();
00795   TProfile *p_ele_PoPmatchingObjectVsPhi = h_ele_PoPmatchingObjectVsPhi->ProfileX();
00796   p_ele_PoPmatchingObjectVsPhi->SetTitle("mean ele momentum / gen momentum vs phi");
00797   p_ele_PoPmatchingObjectVsPhi->GetXaxis()->SetTitle("#phi (rad)");
00798   p_ele_PoPmatchingObjectVsPhi->GetYaxis()->SetTitle("<P/E_{matching jet}>");
00799   p_ele_PoPmatchingObjectVsPhi->Write();
00800   TProfile *p_ele_EtaMnEtamatchingObjectVsEta = h_ele_EtaMnEtamatchingObjectVsEta->ProfileX();
00801   p_ele_EtaMnEtamatchingObjectVsEta->GetXaxis()->SetTitle("#eta");
00802   p_ele_EtaMnEtamatchingObjectVsEta->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{matching jet}>");
00803   p_ele_EtaMnEtamatchingObjectVsEta->Write();
00804   TProfile *p_ele_EtaMnEtamatchingObjectVsPhi = h_ele_EtaMnEtamatchingObjectVsPhi->ProfileX();
00805   p_ele_EtaMnEtamatchingObjectVsPhi-> GetXaxis()-> SetTitle("#phi");
00806   p_ele_EtaMnEtamatchingObjectVsPhi-> GetYaxis()-> SetTitle("<#eta_{rec} - #eta_{matching jet}>");
00807   p_ele_EtaMnEtamatchingObjectVsPhi->Write();
00808   TProfile *p_ele_PhiMnPhimatchingObjectVsEta = h_ele_PhiMnPhimatchingObjectVsEta->ProfileX();
00809   p_ele_PhiMnPhimatchingObjectVsEta-> GetXaxis()-> SetTitle("#eta");
00810   p_ele_PhiMnPhimatchingObjectVsEta-> GetYaxis()-> SetTitle("<#phi_{rec} - #phi_{matching jet}> (rad)");
00811   p_ele_PhiMnPhimatchingObjectVsEta->Write();
00812   TProfile *p_ele_PhiMnPhimatchingObjectVsPhi = h_ele_PhiMnPhimatchingObjectVsPhi->ProfileX();
00813   p_ele_PhiMnPhimatchingObjectVsPhi-> GetXaxis()-> SetTitle("#phi");
00814   p_ele_PhiMnPhimatchingObjectVsPhi-> GetYaxis()-> SetTitle("<#phi_{rec} - #phi_{matching jet}> (rad)");
00815   p_ele_PhiMnPhimatchingObjectVsPhi->Write();
00816   TProfile *p_ele_vertexPtVsEta = h_ele_vertexPtVsEta->ProfileX();
00817   p_ele_vertexPtVsEta->GetXaxis()->SetTitle("#eta");
00818   p_ele_vertexPtVsEta->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
00819   p_ele_vertexPtVsEta->Write();
00820   TProfile *p_ele_vertexPtVsPhi = h_ele_vertexPtVsPhi->ProfileX();
00821   p_ele_vertexPtVsPhi->GetXaxis()->SetTitle("#phi (rad)");
00822   p_ele_vertexPtVsPhi->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
00823   p_ele_vertexPtVsPhi->Write();
00824   TProfile *p_ele_EoPVsEta = h_ele_EoPVsEta->ProfileX();
00825   p_ele_EoPVsEta->GetXaxis()->SetTitle("#eta");
00826   p_ele_EoPVsEta->GetYaxis()->SetTitle("<E/P_{vertex}>");
00827   p_ele_EoPVsEta->Write();
00828   TProfile *p_ele_EoPVsPhi = h_ele_EoPVsPhi->ProfileX();
00829   p_ele_EoPVsPhi->GetXaxis()->SetTitle("#phi (rad)");
00830   p_ele_EoPVsPhi->GetYaxis()->SetTitle("<E/P_{vertex}>");
00831   p_ele_EoPVsPhi->Write();
00832   TProfile *p_ele_EoPoutVsEta = h_ele_EoPoutVsEta->ProfileX();
00833   p_ele_EoPoutVsEta->GetXaxis()->SetTitle("#eta");
00834   p_ele_EoPoutVsEta->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
00835   p_ele_EoPoutVsEta->Write();
00836   TProfile *p_ele_EoPoutVsPhi = h_ele_EoPoutVsPhi->ProfileX();
00837   p_ele_EoPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
00838   p_ele_EoPoutVsPhi->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
00839   p_ele_EoPoutVsPhi->Write();
00840   TProfile *p_ele_EeleOPoutVsEta = h_ele_EeleOPoutVsEta->ProfileX();
00841   p_ele_EeleOPoutVsEta->SetTitle("mean ele Eele/pout vs eta");
00842   p_ele_EeleOPoutVsEta->GetXaxis()->SetTitle("#eta");
00843   p_ele_EeleOPoutVsEta->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
00844   p_ele_EeleOPoutVsEta->Write();
00845   TProfile *p_ele_EeleOPoutVsPhi = h_ele_EeleOPoutVsPhi->ProfileX();
00846   p_ele_EeleOPoutVsPhi->SetTitle("mean ele Eele/pout vs phi");
00847   p_ele_EeleOPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
00848   p_ele_EeleOPoutVsPhi->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
00849   p_ele_EeleOPoutVsPhi->Write();
00850   TProfile *p_ele_HoEVsEta = h_ele_HoEVsEta->ProfileX();
00851   p_ele_HoEVsEta->GetXaxis()->SetTitle("#eta");
00852   p_ele_HoEVsEta->GetYaxis()->SetTitle("<H/E>");
00853   p_ele_HoEVsEta->Write();
00854   TProfile *p_ele_HoEVsPhi = h_ele_HoEVsPhi->ProfileX();
00855   p_ele_HoEVsPhi->GetXaxis()->SetTitle("#phi (rad)");
00856   p_ele_HoEVsPhi->GetYaxis()->SetTitle("<H/E>");
00857   p_ele_HoEVsPhi->Write();
00858   TProfile *p_ele_chi2VsEta = h_ele_chi2VsEta->ProfileX();
00859   p_ele_chi2VsEta->GetXaxis()->SetTitle("#eta");
00860   p_ele_chi2VsEta->GetYaxis()->SetTitle("<#Chi^{2}>");
00861   p_ele_chi2VsEta->Write();
00862   TProfile *p_ele_chi2VsPhi = h_ele_chi2VsPhi->ProfileX();
00863   p_ele_chi2VsPhi->GetXaxis()->SetTitle("#phi (rad)");
00864   p_ele_chi2VsPhi->GetYaxis()->SetTitle("<#Chi^{2}>");
00865   p_ele_chi2VsPhi->Write();
00866   TProfile *p_ele_foundHitsVsEta = h_ele_foundHitsVsEta->ProfileX();
00867   p_ele_foundHitsVsEta->GetXaxis()->SetTitle("#eta");
00868   p_ele_foundHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
00869   p_ele_foundHitsVsEta->Write();
00870   TProfile *p_ele_foundHitsVsPhi = h_ele_foundHitsVsPhi->ProfileX();
00871   p_ele_foundHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
00872   p_ele_foundHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
00873   p_ele_foundHitsVsPhi->Write();
00874   TProfile *p_ele_lostHitsVsEta = h_ele_lostHitsVsEta->ProfileX();
00875   p_ele_lostHitsVsEta->GetXaxis()->SetTitle("#eta");
00876   p_ele_lostHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
00877   p_ele_lostHitsVsEta->Write();
00878   TProfile *p_ele_lostHitsVsPhi = h_ele_lostHitsVsPhi->ProfileX();
00879   p_ele_lostHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
00880   p_ele_lostHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
00881   p_ele_lostHitsVsPhi->Write();
00882   TProfile *p_ele_vertexTIPVsEta = h_ele_vertexTIPVsEta->ProfileX();
00883   p_ele_vertexTIPVsEta->SetTitle("mean tip (wrt gen vtx) vs eta");
00884   p_ele_vertexTIPVsEta->GetXaxis()->SetTitle("#eta");
00885   p_ele_vertexTIPVsEta->GetYaxis()->SetTitle("<TIP> (cm)");
00886   p_ele_vertexTIPVsEta->Write();
00887   TProfile *p_ele_vertexTIPVsPhi = h_ele_vertexTIPVsPhi->ProfileX();
00888   p_ele_vertexTIPVsPhi->SetTitle("mean tip (wrt gen vtx) vs phi");
00889   p_ele_vertexTIPVsPhi->GetXaxis()->SetTitle("#phi");
00890   p_ele_vertexTIPVsPhi->GetYaxis()->SetTitle("<TIP> (cm)");
00891   p_ele_vertexTIPVsPhi->Write();
00892   TProfile *p_ele_vertexTIPVsPt = h_ele_vertexTIPVsPt->ProfileX();
00893   p_ele_vertexTIPVsPt->SetTitle("mean tip (wrt gen vtx) vs phi");
00894   p_ele_vertexTIPVsPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
00895   p_ele_vertexTIPVsPt->GetYaxis()->SetTitle("<TIP> (cm)");
00896   p_ele_vertexTIPVsPt->Write();
00897 
00898   // mc truth
00899 
00900   h_matchingObjectNum->Write();
00901 
00902   // rec event
00903 
00904   histNum_->Write();
00905 
00906   // mc
00907   h_matchingObjectEta->Write();
00908   h_matchingObjectAbsEta->Write();
00909   h_matchingObjectP->Write();
00910   h_matchingObjectPt->Write();
00911   h_matchingObjectPhi->Write();
00912   h_matchingObjectZ->Write();
00913 
00914   // all electrons
00915   h_ele_EoverP_all->Write();
00916   h_ele_EseedOP_all->Write();
00917   h_ele_EoPout_all->Write();
00918   h_ele_EeleOPout_all ->Write();
00919   h_ele_dEtaSc_propVtx_all->Write();
00920   h_ele_dPhiSc_propVtx_all->Write();
00921   h_ele_dEtaCl_propOut_all ->Write();
00922   h_ele_dPhiCl_propOut_all->Write();
00923   h_ele_HoE_all->Write();
00924   h_ele_TIP_all->Write();
00925   h_ele_vertexPt_all->Write();
00926   h_ele_vertexEta_all->Write();
00927   h_ele_mee_all->Write();
00928   h_ele_mee_os->Write();
00929   h_ele_E2mnE1vsMee_all ->Write();
00930   h_ele_E2mnE1vsMee_egeg_all->Write();
00931 
00932   // matched electrons
00933   h_ele_charge->Write();
00934   h_ele_chargeVsEta->Write();
00935   h_ele_chargeVsPhi->Write();
00936   h_ele_chargeVsPt->Write();
00937   h_ele_vertexP->Write();
00938   h_ele_vertexPt->Write();
00939   h_ele_vertexPtVsEta->Write();
00940   h_ele_vertexPtVsPhi->Write();
00941   h_ele_matchingObjectPt_matched->Write();
00942   h_ele_vertexEta->Write();
00943   h_ele_vertexEtaVsPhi->Write();
00944   h_ele_matchingObjectAbsEta_matched->Write();
00945   h_ele_matchingObjectEta_matched->Write();
00946   h_ele_vertexPhi->Write();
00947   h_ele_matchingObjectPhi_matched->Write();
00948   h_ele_vertexX->Write();
00949   h_ele_vertexY ->Write();
00950   h_ele_vertexZ->Write();
00951   h_ele_vertexTIP->Write();
00952   h_ele_matchingObjectZ_matched->Write();
00953   h_ele_vertexTIPVsEta->Write();
00954   h_ele_vertexTIPVsPhi->Write();
00955   h_ele_vertexTIPVsPt->Write();
00956   h_ele_PoPmatchingObject->Write();
00957   h_ele_PoPmatchingObjectVsEta ->Write();
00958   h_ele_PoPmatchingObjectVsPhi->Write();
00959   h_ele_PoPmatchingObjectVsPt->Write();
00960   h_ele_PoPmatchingObject_barrel ->Write();
00961   h_ele_PoPmatchingObject_endcaps->Write();
00962   h_ele_EtaMnEtamatchingObject->Write();
00963   h_ele_EtaMnEtamatchingObjectVsEta ->Write();
00964   h_ele_EtaMnEtamatchingObjectVsPhi->Write();
00965   h_ele_EtaMnEtamatchingObjectVsPt->Write();
00966   h_ele_PhiMnPhimatchingObject ->Write();
00967   h_ele_PhiMnPhimatchingObject2 ->Write();
00968   h_ele_PhiMnPhimatchingObjectVsEta->Write();
00969   h_ele_PhiMnPhimatchingObjectVsPhi->Write();
00970   h_ele_PhiMnPhimatchingObjectVsPt->Write();
00971 
00972   // matched electron, superclusters
00973   histSclEn_->Write();
00974   histSclEoEmatchingObject_barrel->Write();
00975   histSclEoEmatchingObject_endcaps->Write();
00976   histSclEt_->Write();
00977   histSclEtVsEta_->Write();
00978   histSclEtVsPhi_->Write();
00979   histSclEtaVsPhi_ ->Write();
00980   histSclEta_->Write();
00981   histSclPhi_->Write();
00982   histSclSigIEtaIEta_->Write();
00983   histSclSigIEtaIEta_barrel_->Write();
00984   histSclSigIEtaIEta_endcaps_->Write();
00985   histSclE1x5_->Write();
00986   histSclE1x5_barrel_->Write();
00987   histSclE1x5_endcaps_->Write();
00988   histSclE2x5max_->Write();
00989   histSclE2x5max_barrel_->Write();
00990   histSclE2x5max_endcaps_->Write();
00991   histSclE5x5_->Write();
00992   histSclE5x5_barrel_->Write();
00993   histSclE5x5_endcaps_->Write();
00994 
00995   // matched electron, gsf tracks
00996   h_ele_ambiguousTracks->Write();
00997   h_ele_ambiguousTracksVsEta->Write();
00998   h_ele_ambiguousTracksVsPhi->Write();
00999   h_ele_ambiguousTracksVsPt->Write();
01000   h_ele_foundHits->Write();
01001   h_ele_foundHitsVsEta->Write();
01002   h_ele_foundHitsVsPhi->Write();
01003   h_ele_foundHitsVsPt->Write();
01004   h_ele_lostHits->Write();
01005   h_ele_lostHitsVsEta->Write();
01006   h_ele_lostHitsVsPhi->Write();
01007   h_ele_lostHitsVsPt->Write();
01008   h_ele_chi2 ->Write();
01009   h_ele_chi2VsEta ->Write();
01010   h_ele_chi2VsPhi ->Write();
01011   h_ele_chi2VsPt->Write();
01012   h_ele_PinMnPout->Write();
01013   h_ele_PinMnPout_mode->Write();
01014   h_ele_PinMnPoutVsEta_mode->Write();
01015   h_ele_PinMnPoutVsPhi_mode->Write();
01016   h_ele_PinMnPoutVsPt_mode->Write();
01017   h_ele_PinMnPoutVsE_mode->Write();
01018   h_ele_PinMnPoutVsChi2_mode->Write();
01019   h_ele_outerP ->Write();
01020   h_ele_outerP_mode->Write();
01021   h_ele_outerPVsEta_mode->Write();
01022   h_ele_outerPt->Write();
01023   h_ele_outerPt_mode ->Write();
01024   h_ele_outerPtVsEta_mode->Write();
01025   h_ele_outerPtVsPhi_mode->Write();
01026   h_ele_outerPtVsPt_mode->Write();
01027 
01028   // matched electrons, matching
01029   h_ele_EoP ->Write();
01030   h_ele_EoP_eg ->Write();
01031   h_ele_EoP_barrel ->Write();
01032   h_ele_EoP_eg_barrel ->Write();
01033   h_ele_EoP_endcaps ->Write();
01034   h_ele_EoP_eg_endcaps ->Write();
01035   h_ele_EoPVsEta ->Write();
01036   h_ele_EoPVsPhi->Write();
01037   h_ele_EoPVsE->Write();
01038   h_ele_EseedOP ->Write();
01039   h_ele_EseedOP_eg ->Write();
01040   h_ele_EseedOP_barrel ->Write();
01041   h_ele_EseedOP_eg_barrel ->Write();
01042   h_ele_EseedOP_endcaps ->Write();
01043   h_ele_EseedOP_eg_endcaps ->Write();
01044   h_ele_EseedOPVsEta ->Write();
01045   h_ele_EseedOPVsPhi->Write();
01046   h_ele_EseedOPVsE->Write();
01047   h_ele_EoPout->Write();
01048   h_ele_EoPout_eg->Write();
01049   h_ele_EoPout_barrel->Write();
01050   h_ele_EoPout_eg_barrel->Write();
01051   h_ele_EoPout_endcaps->Write();
01052   h_ele_EoPout_eg_endcaps->Write();
01053   h_ele_EoPoutVsEta->Write();
01054   h_ele_EoPoutVsPhi->Write();
01055   h_ele_EoPoutVsE ->Write();
01056   h_ele_EeleOPout->Write();
01057   h_ele_EeleOPout_eg->Write();
01058   h_ele_EeleOPout_barrel->Write();
01059   h_ele_EeleOPout_eg_barrel->Write();
01060   h_ele_EeleOPout_endcaps->Write();
01061   h_ele_EeleOPout_eg_endcaps->Write();
01062   h_ele_EeleOPoutVsEta->Write();
01063   h_ele_EeleOPoutVsPhi->Write();
01064   h_ele_EeleOPoutVsE ->Write();
01065   h_ele_dEtaSc_propVtx->Write();
01066   h_ele_dEtaSc_propVtx_eg->Write();
01067   h_ele_dEtaSc_propVtx_barrel->Write();
01068   h_ele_dEtaSc_propVtx_eg_barrel->Write();
01069   h_ele_dEtaSc_propVtx_endcaps->Write();
01070   h_ele_dEtaSc_propVtx_eg_endcaps->Write();
01071   h_ele_dEtaScVsEta_propVtx->Write();
01072   h_ele_dEtaScVsPhi_propVtx->Write();
01073   h_ele_dEtaScVsPt_propVtx ->Write();
01074   h_ele_dPhiSc_propVtx->Write();
01075   h_ele_dPhiSc_propVtx_eg->Write();
01076   h_ele_dPhiSc_propVtx_barrel->Write();
01077   h_ele_dPhiSc_propVtx_eg_barrel->Write();
01078   h_ele_dPhiSc_propVtx_endcaps->Write();
01079   h_ele_dPhiSc_propVtx_eg_endcaps->Write();
01080   h_ele_dPhiScVsEta_propVtx ->Write();
01081   h_ele_dPhiScVsPhi_propVtx->Write();
01082   h_ele_dPhiScVsPt_propVtx->Write();
01083   h_ele_dEtaCl_propOut->Write();
01084   h_ele_dEtaCl_propOut_eg->Write();
01085   h_ele_dEtaCl_propOut_barrel->Write();
01086   h_ele_dEtaCl_propOut_eg_barrel->Write();
01087   h_ele_dEtaCl_propOut_endcaps->Write();
01088   h_ele_dEtaCl_propOut_eg_endcaps->Write();
01089   h_ele_dEtaClVsEta_propOut->Write();
01090   h_ele_dEtaClVsPhi_propOut->Write();
01091   h_ele_dEtaClVsPt_propOut->Write();
01092   h_ele_dPhiCl_propOut->Write();
01093   h_ele_dPhiCl_propOut_eg->Write();
01094   h_ele_dPhiCl_propOut_barrel->Write();
01095   h_ele_dPhiCl_propOut_eg_barrel->Write();
01096   h_ele_dPhiCl_propOut_endcaps->Write();
01097   h_ele_dPhiCl_propOut_eg_endcaps->Write();
01098   h_ele_dPhiClVsEta_propOut->Write();
01099   h_ele_dPhiClVsPhi_propOut->Write();
01100   h_ele_dPhiClVsPt_propOut->Write();
01101   h_ele_dEtaEleCl_propOut->Write();
01102   h_ele_dEtaEleCl_propOut_eg->Write();
01103   h_ele_dEtaEleCl_propOut_barrel->Write();
01104   h_ele_dEtaEleCl_propOut_eg_barrel->Write();
01105   h_ele_dEtaEleCl_propOut_endcaps->Write();
01106   h_ele_dEtaEleCl_propOut_eg_endcaps->Write();
01107   h_ele_dEtaEleClVsEta_propOut->Write();
01108   h_ele_dEtaEleClVsPhi_propOut->Write();
01109   h_ele_dEtaEleClVsPt_propOut->Write();
01110   h_ele_dPhiEleCl_propOut->Write();
01111   h_ele_dPhiEleCl_propOut_eg->Write();
01112   h_ele_dPhiEleCl_propOut_barrel->Write();
01113   h_ele_dPhiEleCl_propOut_eg_barrel->Write();
01114   h_ele_dPhiEleCl_propOut_endcaps->Write();
01115   h_ele_dPhiEleCl_propOut_eg_endcaps->Write();
01116   h_ele_dPhiEleClVsEta_propOut->Write();
01117   h_ele_dPhiEleClVsPhi_propOut->Write();
01118   h_ele_dPhiEleClVsPt_propOut->Write();
01119   h_ele_HoE->Write();
01120   h_ele_HoE_eg->Write();
01121   h_ele_HoE_barrel->Write();
01122   h_ele_HoE_eg_barrel->Write();
01123   h_ele_HoE_endcaps->Write();
01124   h_ele_HoE_eg_endcaps->Write();
01125   h_ele_HoE_fiducial->Write();
01126   h_ele_HoEVsEta->Write();
01127   h_ele_HoEVsPhi->Write();
01128   h_ele_HoEVsE->Write();
01129 
01130   h_ele_seed_dphi2_->Write();
01131   h_ele_seed_subdet2_->Write();
01132   TProfile *p_ele_seed_dphi2VsEta_ = h_ele_seed_dphi2VsEta_->ProfileX();
01133   p_ele_seed_dphi2VsEta_->SetTitle("mean ele seed dphi 2nd layer vs eta");
01134   p_ele_seed_dphi2VsEta_->GetXaxis()->SetTitle("#eta");
01135   p_ele_seed_dphi2VsEta_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
01136   p_ele_seed_dphi2VsEta_->SetMinimum(-0.004);
01137   p_ele_seed_dphi2VsEta_->SetMaximum(0.004);
01138   p_ele_seed_dphi2VsEta_->Write();
01139   TProfile *p_ele_seed_dphi2VsPt_ = h_ele_seed_dphi2VsPt_->ProfileX();
01140   p_ele_seed_dphi2VsPt_->SetTitle("mean ele seed dphi 2nd layer vs pt");
01141   p_ele_seed_dphi2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
01142   p_ele_seed_dphi2VsPt_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
01143   p_ele_seed_dphi2VsPt_->SetMinimum(-0.004);
01144   p_ele_seed_dphi2VsPt_->SetMaximum(0.004);
01145   p_ele_seed_dphi2VsPt_->Write();
01146   h_ele_seed_drz2_->Write();
01147   TProfile *p_ele_seed_drz2VsEta_ = h_ele_seed_drz2VsEta_->ProfileX();
01148   p_ele_seed_drz2VsEta_->SetTitle("mean ele seed dr(dz) 2nd layer vs eta");
01149   p_ele_seed_drz2VsEta_->GetXaxis()->SetTitle("#eta");
01150   p_ele_seed_drz2VsEta_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
01151   p_ele_seed_drz2VsEta_->SetMinimum(-0.15);
01152   p_ele_seed_drz2VsEta_->SetMaximum(0.15);
01153   p_ele_seed_drz2VsEta_->Write();
01154   TProfile *p_ele_seed_drz2VsPt_ = h_ele_seed_drz2VsPt_->ProfileX();
01155   p_ele_seed_drz2VsPt_->SetTitle("mean ele seed dr(dz) 2nd layer vs pt");
01156   p_ele_seed_drz2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
01157   p_ele_seed_drz2VsPt_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
01158   p_ele_seed_drz2VsPt_->SetMinimum(-0.15);
01159   p_ele_seed_drz2VsPt_->SetMaximum(0.15);
01160   p_ele_seed_drz2VsPt_->Write();
01161 
01162   // classes
01163   h_ele_classes->Write();
01164   h_ele_eta->Write();
01165   h_ele_eta_golden->Write();
01166   h_ele_eta_bbrem->Write();
01167   h_ele_eta_narrow->Write();
01168   h_ele_eta_shower->Write();
01169   h_ele_PinVsPoutGolden_mode->Write();
01170   h_ele_PinVsPoutShowering_mode->Write();
01171   h_ele_PinVsPoutGolden_mean->Write();
01172   h_ele_PinVsPoutShowering_mean->Write();
01173   h_ele_PtinVsPtoutGolden_mode->Write();
01174   h_ele_PtinVsPtoutShowering_mode->Write();
01175   h_ele_PtinVsPtoutGolden_mean->Write();
01176   h_ele_PtinVsPtoutShowering_mean->Write();
01177   histSclEoEmatchingObjectGolden_barrel->Write();
01178   histSclEoEmatchingObjectGolden_endcaps->Write();
01179   histSclEoEmatchingObjectShowering_barrel->Write();
01180   histSclEoEmatchingObjectShowering_endcaps->Write();
01181 
01182   // fbrem
01183   h_ele_fbrem->Write();
01184   h_ele_fbremVsEta_mode->Write();
01185   h_ele_fbremVsEta_mean->Write();
01186   h_ele_etaEff->Write();
01187   h_ele_zEff->Write();
01188   h_ele_phiEff->Write();
01189   h_ele_absetaEff->Write();
01190   h_ele_ptEff->Write();
01191   h_ele_etaEff_all->Write();
01192   h_ele_ptEff_all->Write();
01193   h_ele_eta_goldenFrac->Write();
01194   h_ele_eta_bbremFrac->Write();
01195   h_ele_eta_narrowFrac->Write();
01196   h_ele_eta_showerFrac->Write();
01197   h_ele_xOverX0VsEta->Write();
01198 
01199   // e/g et pflow electrons
01200   h_ele_mva->Write();
01201   h_ele_provenance->Write();
01202 
01203   // isolation
01204   h_ele_tkSumPt_dr03->GetXaxis()->SetTitle("TkIsoSum, cone 0.3 (GeV/c)");
01205   h_ele_tkSumPt_dr03->GetYaxis()->SetTitle("Events");
01206   h_ele_tkSumPt_dr03->Write();
01207   h_ele_ecalRecHitSumEt_dr03->GetXaxis()->SetTitle("EcalIsoSum, cone 0.3 (GeV)");
01208   h_ele_ecalRecHitSumEt_dr03->GetYaxis()->SetTitle("Events");
01209   h_ele_ecalRecHitSumEt_dr03->Write();
01210   h_ele_hcalDepth1TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.3 (GeV)");
01211   h_ele_hcalDepth1TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
01212   h_ele_hcalDepth1TowerSumEt_dr03->Write();
01213   h_ele_hcalDepth2TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.3 (GeV)");
01214   h_ele_hcalDepth2TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
01215   h_ele_hcalDepth2TowerSumEt_dr03->Write();
01216   h_ele_tkSumPt_dr04->GetXaxis()->SetTitle("TkIsoSum, cone 0.4 (GeV/c)");
01217   h_ele_tkSumPt_dr04->GetYaxis()->SetTitle("Events");
01218   h_ele_tkSumPt_dr04->Write();
01219   h_ele_ecalRecHitSumEt_dr04->GetXaxis()->SetTitle("EcalIsoSum, cone 0.4 (GeV)");
01220   h_ele_ecalRecHitSumEt_dr04->GetYaxis()->SetTitle("Events");
01221   h_ele_ecalRecHitSumEt_dr04->Write();
01222   h_ele_hcalDepth1TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.4 (GeV)");
01223   h_ele_hcalDepth1TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
01224   h_ele_hcalDepth1TowerSumEt_dr04->Write();
01225   h_ele_hcalDepth2TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.4 (GeV)");
01226   h_ele_hcalDepth2TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
01227   h_ele_hcalDepth2TowerSumEt_dr04->Write();
01228 
01229 }
01230 
01231 void
01232 GsfElectronFakeAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
01233 {
01234   std::cout << "analyzing new event " << std::endl;
01235 
01236   // get reco electrons
01237   edm::Handle<reco::GsfElectronCollection> gsfElectrons;
01238   iEvent.getByLabel(electronCollection_,gsfElectrons);
01239   edm::LogInfo("")<<"\n\n =================> Treating event "<<iEvent.id()<<" Number of electrons "<<gsfElectrons.product()->size();
01240 
01241   // get reco calojet collection
01242   edm::Handle<reco::CaloJetCollection> recoCaloJets;
01243   iEvent.getByLabel(matchingObjectCollection_, recoCaloJets);
01244 
01245   // get the beamspot from the Event:
01246   edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
01247   iEvent.getByType(recoBeamSpotHandle);
01248   const BeamSpot bs = *recoBeamSpotHandle;
01249 
01250   histNum_->Fill((*gsfElectrons).size());
01251 
01252   // all rec electrons
01253   for (reco::GsfElectronCollection::const_iterator gsfIter=gsfElectrons->begin();
01254    gsfIter!=gsfElectrons->end(); gsfIter++){
01255     // preselect electrons
01256     if (gsfIter->pt()>maxPt_ || std::abs(gsfIter->eta())>maxAbsEta_) continue;
01257     h_ele_EoverP_all     -> Fill( gsfIter->eSuperClusterOverP() );
01258     h_ele_EseedOP_all     -> Fill( gsfIter->eSeedClusterOverP() );
01259     h_ele_EoPout_all     -> Fill( gsfIter->eSeedClusterOverPout() );
01260     h_ele_EeleOPout_all     -> Fill( gsfIter->eEleClusterOverPout() );
01261     h_ele_dEtaSc_propVtx_all -> Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx());
01262     h_ele_dPhiSc_propVtx_all -> Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx());
01263     h_ele_dEtaCl_propOut_all -> Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo());
01264     h_ele_dPhiCl_propOut_all -> Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo());
01265     h_ele_HoE_all     -> Fill( gsfIter->hadronicOverEm() );
01266     double d = gsfIter->vertex().x()*gsfIter->vertex().x()
01267                +gsfIter->vertex().y()*gsfIter->vertex().y();
01268     h_ele_TIP_all     -> Fill( sqrt(d) );
01269     h_ele_vertexEta_all     -> Fill( gsfIter->eta() );
01270     h_ele_vertexPt_all      -> Fill( gsfIter->pt() );
01271     float enrj1=gsfIter->superCluster()->energy();
01272     // mee
01273     for (reco::GsfElectronCollection::const_iterator gsfIter2=gsfIter+1;
01274      gsfIter2!=gsfElectrons->end(); gsfIter2++){
01275              math::XYZTLorentzVector p12 = (*gsfIter).p4()+(*gsfIter2).p4();
01276         float mee2 = p12.Dot(p12);
01277         h_ele_mee_all -> Fill(sqrt(mee2));
01278         float enrj2=gsfIter2->superCluster()->energy();
01279         h_ele_E2mnE1vsMee_all->Fill(sqrt(mee2),enrj2-enrj1);
01280         if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed()) h_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2),enrj2-enrj1);
01281         if (gsfIter->charge()*gsfIter2->charge()<0.) h_ele_mee_os -> Fill(sqrt(mee2));
01282     }
01283   }
01284 
01285   // association matching object-reco electrons
01286   int matchingObjectNum=0;
01287 
01288   for ( reco::CaloJetCollection::const_iterator moIter=recoCaloJets->begin();
01289    moIter!=recoCaloJets->end(); moIter++ ) {
01290 
01291     // number of matching objects
01292     matchingObjectNum++;
01293 
01294       if (moIter->energy()/cosh(moIter->eta())> maxPt_ || std::abs(moIter->eta())> maxAbsEta_) continue;
01295 
01296       // suppress the endcaps
01297       //if (std::abs(moIter->eta()) > 1.5) continue;
01298       // select central z
01299       //if ( std::abs((*mcIter)->production_vertex()->position().z())>50.) continue;
01300 
01301       h_matchingObjectEta -> Fill( moIter->eta() );
01302       h_matchingObjectAbsEta -> Fill( std::abs(moIter->eta()) );
01303       h_matchingObjectP   -> Fill( moIter->energy() );
01304       h_matchingObjectPt   -> Fill( moIter->energy()/cosh(moIter->eta()) );
01305       h_matchingObjectPhi   -> Fill( moIter->phi() );
01306       h_matchingObjectZ   -> Fill(  moIter->vz() );
01307 
01308       // looking for the best matching gsf electron
01309       bool okGsfFound = false;
01310       double gsfOkRatio = 999999.;
01311 
01312       // find best matched electron
01313       reco::GsfElectron bestGsfElectron;
01314       for (reco::GsfElectronCollection::const_iterator gsfIter=gsfElectrons->begin();
01315        gsfIter!=gsfElectrons->end(); gsfIter++){
01316 
01317         double dphi = gsfIter->phi()-moIter->phi();
01318         if (std::abs(dphi)>CLHEP::pi)
01319          dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
01320         double deltaR = sqrt(std::pow((gsfIter->eta()-moIter->eta()),2) + std::pow(dphi,2));
01321         if ( deltaR < deltaR_ ){
01322         //if ( (genPc->pdg_id() == 11) && (gsfIter->charge() < 0.) || (genPc->pdg_id() == -11) &&
01323         //(gsfIter->charge() > 0.) ){
01324           double tmpGsfRatio = gsfIter->p()/moIter->energy();
01325           if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) ) {
01326             gsfOkRatio = tmpGsfRatio;
01327             bestGsfElectron=*gsfIter;
01328             okGsfFound = true;
01329           }
01330         //}
01331         }
01332       } // loop over rec ele to look for the best one
01333 
01334       // analysis when the matching object is matched by a rec electron
01335      if (okGsfFound){
01336 
01337         // electron related distributions
01338         h_ele_charge        -> Fill( bestGsfElectron.charge() );
01339         h_ele_chargeVsEta        -> Fill( bestGsfElectron.eta(),bestGsfElectron.charge() );
01340         h_ele_chargeVsPhi        -> Fill( bestGsfElectron.phi(),bestGsfElectron.charge() );
01341         h_ele_chargeVsPt        -> Fill( bestGsfElectron.pt(),bestGsfElectron.charge() );
01342         h_ele_vertexP       -> Fill( bestGsfElectron.p() );
01343         h_ele_vertexPt      -> Fill( bestGsfElectron.pt() );
01344         h_ele_vertexPtVsEta      -> Fill(  bestGsfElectron.eta(),bestGsfElectron.pt() );
01345         h_ele_vertexPtVsPhi      -> Fill(  bestGsfElectron.phi(),bestGsfElectron.pt() );
01346         h_ele_vertexEta     -> Fill( bestGsfElectron.eta() );
01347         // generated distributions for matched electrons
01348         h_ele_matchingObjectPt_matched      -> Fill( moIter->energy()/cosh(moIter->eta()) );
01349         h_ele_matchingObjectPhi_matched   -> Fill( moIter->phi() );
01350         h_ele_matchingObjectAbsEta_matched     -> Fill( std::abs(moIter->eta()) );
01351         h_ele_matchingObjectEta_matched     -> Fill( moIter->eta() );
01352         h_ele_vertexEtaVsPhi     -> Fill(  bestGsfElectron.phi(),bestGsfElectron.eta() );
01353         h_ele_vertexPhi     -> Fill( bestGsfElectron.phi() );
01354         h_ele_vertexX     -> Fill( bestGsfElectron.vertex().x() );
01355         h_ele_vertexY     -> Fill( bestGsfElectron.vertex().y() );
01356         h_ele_vertexZ     -> Fill( bestGsfElectron.vertex().z() );
01357         h_ele_matchingObjectZ_matched   -> Fill( moIter->vz() );
01358         double d = (bestGsfElectron.vertex().x()-bs.position().x())
01359                   *(bestGsfElectron.vertex().x()-bs.position().x())+
01360                    (bestGsfElectron.vertex().y()-bs.position().y())
01361                   *(bestGsfElectron.vertex().y()-bs.position().y());
01362         d = sqrt(d);
01363         h_ele_vertexTIP     -> Fill( d );
01364         h_ele_vertexTIPVsEta     -> Fill(  bestGsfElectron.eta(), d );
01365         h_ele_vertexTIPVsPhi     -> Fill(  bestGsfElectron.phi(), d );
01366         h_ele_vertexTIPVsPt     -> Fill(  bestGsfElectron.pt(), d );
01367         h_ele_EtaMnEtamatchingObject  -> Fill( bestGsfElectron.eta()-moIter->eta());
01368         h_ele_EtaMnEtamatchingObjectVsEta  -> Fill( bestGsfElectron.eta(), bestGsfElectron.eta()-moIter->eta());
01369         h_ele_EtaMnEtamatchingObjectVsPhi  -> Fill( bestGsfElectron.phi(), bestGsfElectron.eta()-moIter->eta());
01370         h_ele_EtaMnEtamatchingObjectVsPt  -> Fill( bestGsfElectron.pt(), bestGsfElectron.eta()-moIter->eta());
01371         h_ele_PhiMnPhimatchingObject  -> Fill( bestGsfElectron.phi()-moIter->phi());
01372         h_ele_PhiMnPhimatchingObject2  -> Fill( bestGsfElectron.phi()-moIter->phi());
01373         h_ele_PhiMnPhimatchingObjectVsEta  -> Fill( bestGsfElectron.eta(), bestGsfElectron.phi()-moIter->phi());
01374         h_ele_PhiMnPhimatchingObjectVsPhi  -> Fill( bestGsfElectron.phi(), bestGsfElectron.phi()-moIter->phi());
01375         h_ele_PhiMnPhimatchingObjectVsPt  -> Fill( bestGsfElectron.pt(), bestGsfElectron.phi()-moIter->phi());
01376         h_ele_PoPmatchingObject       -> Fill( bestGsfElectron.p()/moIter->energy());
01377         h_ele_PoPmatchingObjectVsEta       -> Fill( bestGsfElectron.eta(), bestGsfElectron.p()/moIter->energy());
01378         h_ele_PoPmatchingObjectVsPhi       -> Fill( bestGsfElectron.phi(), bestGsfElectron.p()/moIter->energy());
01379         h_ele_PoPmatchingObjectVsPt       -> Fill( bestGsfElectron.py(), bestGsfElectron.p()/moIter->energy());
01380         if (bestGsfElectron.isEB()) h_ele_PoPmatchingObject_barrel       -> Fill( bestGsfElectron.p()/moIter->energy());
01381         if (bestGsfElectron.isEE()) h_ele_PoPmatchingObject_endcaps       -> Fill( bestGsfElectron.p()/moIter->energy());
01382 
01383         // supercluster related distributions
01384         reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
01385         if (!bestGsfElectron.ecalDrivenSeed()&&bestGsfElectron.trackerDrivenSeed()) sclRef = bestGsfElectron.pflowSuperCluster();
01386         histSclEn_->Fill(sclRef->energy());
01387         double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
01388         double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
01389         histSclEt_->Fill(sclRef->energy()*(Rt/R));
01390         histSclEtVsEta_->Fill(sclRef->eta(),sclRef->energy()*(Rt/R));
01391         histSclEtVsPhi_->Fill(sclRef->phi(),sclRef->energy()*(Rt/R));
01392         if (bestGsfElectron.classification() < 100)  histSclEoEmatchingObject_barrel->Fill(sclRef->energy()/moIter->energy());
01393         if (bestGsfElectron.classification() >= 100)  histSclEoEmatchingObject_endcaps->Fill(sclRef->energy()/moIter->energy());
01394         histSclEta_->Fill(sclRef->eta());
01395         histSclEtaVsPhi_->Fill(sclRef->phi(),sclRef->eta());
01396         histSclPhi_->Fill(sclRef->phi());
01397         histSclSigIEtaIEta_->Fill(bestGsfElectron.scSigmaIEtaIEta());
01398         if (bestGsfElectron.isEB()) histSclSigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
01399         if (bestGsfElectron.isEE()) histSclSigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
01400         histSclE1x5_->Fill(bestGsfElectron.scE1x5());
01401         if (bestGsfElectron.isEB()) histSclE1x5_barrel_->Fill(bestGsfElectron.scE1x5());
01402         if (bestGsfElectron.isEE()) histSclE1x5_endcaps_->Fill(bestGsfElectron.scE1x5());
01403         histSclE2x5max_->Fill(bestGsfElectron.scE2x5Max());
01404         if (bestGsfElectron.isEB()) histSclE2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max());
01405         if (bestGsfElectron.isEE()) histSclE2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max());
01406         histSclE5x5_->Fill(bestGsfElectron.scE5x5());
01407         if (bestGsfElectron.isEB()) histSclE5x5_barrel_->Fill(bestGsfElectron.scE5x5());
01408         if (bestGsfElectron.isEE()) histSclE5x5_endcaps_->Fill(bestGsfElectron.scE5x5());
01409 
01410         // track related distributions
01411         h_ele_ambiguousTracks     -> Fill( bestGsfElectron.ambiguousGsfTracksSize() );
01412         h_ele_ambiguousTracksVsEta     -> Fill( bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize() );
01413         h_ele_ambiguousTracksVsPhi     -> Fill( bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize() );
01414         h_ele_ambiguousTracksVsPt     -> Fill( bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize() );
01415         if (!readAOD_) { // track extra does not exist in AOD
01416           h_ele_foundHits     -> Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
01417           h_ele_foundHitsVsEta     -> Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
01418           h_ele_foundHitsVsPhi     -> Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
01419           h_ele_foundHitsVsPt     -> Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
01420           h_ele_lostHits      -> Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
01421           h_ele_lostHitsVsEta      -> Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
01422           h_ele_lostHitsVsPhi      -> Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
01423           h_ele_lostHitsVsPt      -> Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
01424           h_ele_chi2          -> Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
01425           h_ele_chi2VsEta          -> Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2() );
01426           h_ele_chi2VsPhi          -> Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2() );
01427           h_ele_chi2VsPt          -> Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2() );
01428         }
01429         // from gsf track interface, hence using mean
01430         if (!readAOD_) { // track extra does not exist in AOD
01431           h_ele_PinMnPout     -> Fill( bestGsfElectron.gsfTrack()->innerMomentum().R() - bestGsfElectron.gsfTrack()->outerMomentum().R() );
01432           h_ele_outerP        -> Fill( bestGsfElectron.gsfTrack()->outerMomentum().R() );
01433           h_ele_outerPt       -> Fill( bestGsfElectron.gsfTrack()->outerMomentum().Rho() );
01434         }
01435         // from electron interface, hence using mode
01436         h_ele_PinMnPout_mode     -> Fill( bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01437         h_ele_PinMnPoutVsEta_mode     -> Fill(  bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01438         h_ele_PinMnPoutVsPhi_mode     -> Fill(  bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01439         h_ele_PinMnPoutVsPt_mode     -> Fill(  bestGsfElectron.pt(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01440         h_ele_PinMnPoutVsE_mode     -> Fill(  bestGsfElectron.caloEnergy(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01441         if (!readAOD_)  // track extra does not exist in AOD
01442          h_ele_PinMnPoutVsChi2_mode     -> Fill(  bestGsfElectron.gsfTrack()->normalizedChi2(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01443         h_ele_outerP_mode        -> Fill( bestGsfElectron.trackMomentumOut().R() );
01444         h_ele_outerPVsEta_mode        -> Fill(bestGsfElectron.eta(),  bestGsfElectron.trackMomentumOut().R() );
01445         h_ele_outerPt_mode       -> Fill( bestGsfElectron.trackMomentumOut().Rho() );
01446         h_ele_outerPtVsEta_mode       -> Fill(bestGsfElectron.eta(),  bestGsfElectron.trackMomentumOut().Rho() );
01447         h_ele_outerPtVsPhi_mode       -> Fill(bestGsfElectron.phi(),  bestGsfElectron.trackMomentumOut().Rho() );
01448         h_ele_outerPtVsPt_mode       -> Fill(bestGsfElectron.pt(),  bestGsfElectron.trackMomentumOut().Rho() );
01449 
01450         if (!readAOD_) { // track extra does not exist in AOD
01451           edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
01452           ElectronSeedRef elseed=seed.castTo<ElectronSeedRef>();
01453           h_ele_seed_dphi2_-> Fill(elseed->dPhi2());
01454           h_ele_seed_dphi2VsEta_-> Fill(bestGsfElectron.eta(), elseed->dPhi2());
01455           h_ele_seed_dphi2VsPt_-> Fill(bestGsfElectron.pt(), elseed->dPhi2()) ;
01456           h_ele_seed_drz2_-> Fill(elseed->dRz2());
01457           h_ele_seed_drz2VsEta_-> Fill(bestGsfElectron.eta(), elseed->dRz2());
01458           h_ele_seed_drz2VsPt_-> Fill(bestGsfElectron.pt(), elseed->dRz2());
01459           h_ele_seed_subdet2_-> Fill(elseed->subDet2());
01460         }
01461         // match distributions
01462         h_ele_EoP    -> Fill( bestGsfElectron.eSuperClusterOverP() );
01463         if (bestGsfElectron.ecalDrivenSeed()) h_ele_EoP_eg    -> Fill( bestGsfElectron.eSuperClusterOverP() );
01464         if (bestGsfElectron.isEB()) h_ele_EoP_barrel    -> Fill( bestGsfElectron.eSuperClusterOverP() );
01465         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EoP_eg_barrel    -> Fill( bestGsfElectron.eSuperClusterOverP() );
01466         if (bestGsfElectron.isEE()) h_ele_EoP_endcaps    -> Fill( bestGsfElectron.eSuperClusterOverP() );
01467         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EoP_eg_endcaps    -> Fill( bestGsfElectron.eSuperClusterOverP() );
01468         h_ele_EoPVsEta    -> Fill(bestGsfElectron.eta(),  bestGsfElectron.eSuperClusterOverP() );
01469         h_ele_EoPVsPhi    -> Fill(bestGsfElectron.phi(),  bestGsfElectron.eSuperClusterOverP() );
01470         h_ele_EoPVsE    -> Fill(bestGsfElectron.caloEnergy(),  bestGsfElectron.eSuperClusterOverP() );
01471         h_ele_EseedOP    -> Fill( bestGsfElectron.eSeedClusterOverP() );
01472         if (bestGsfElectron.ecalDrivenSeed()) h_ele_EseedOP_eg    -> Fill( bestGsfElectron.eSeedClusterOverP() );
01473         if (bestGsfElectron.isEB()) h_ele_EseedOP_barrel    -> Fill( bestGsfElectron.eSeedClusterOverP() );
01474         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EseedOP_eg_barrel    -> Fill( bestGsfElectron.eSeedClusterOverP() );
01475         if (bestGsfElectron.isEE()) h_ele_EseedOP_endcaps    -> Fill( bestGsfElectron.eSeedClusterOverP() );
01476         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EseedOP_eg_endcaps    -> Fill( bestGsfElectron.eSeedClusterOverP() );
01477         h_ele_EseedOPVsEta    -> Fill(bestGsfElectron.eta(),  bestGsfElectron.eSeedClusterOverP() );
01478         h_ele_EseedOPVsPhi    -> Fill(bestGsfElectron.phi(),  bestGsfElectron.eSeedClusterOverP() );
01479         h_ele_EseedOPVsE    -> Fill(bestGsfElectron.caloEnergy(),  bestGsfElectron.eSeedClusterOverP() );
01480         h_ele_EoPout -> Fill( bestGsfElectron.eSeedClusterOverPout() );
01481         if (bestGsfElectron.ecalDrivenSeed()) h_ele_EoPout_eg -> Fill( bestGsfElectron.eSeedClusterOverPout() );
01482         if (bestGsfElectron.isEB()) h_ele_EoPout_barrel -> Fill( bestGsfElectron.eSeedClusterOverPout() );
01483         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EoPout_eg_barrel -> Fill( bestGsfElectron.eSeedClusterOverPout() );
01484         if (bestGsfElectron.isEE()) h_ele_EoPout_endcaps -> Fill( bestGsfElectron.eSeedClusterOverPout() );
01485         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EoPout_eg_endcaps -> Fill( bestGsfElectron.eSeedClusterOverPout() );
01486         h_ele_EoPoutVsEta -> Fill( bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout() );
01487         h_ele_EoPoutVsPhi -> Fill( bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout() );
01488         h_ele_EoPoutVsE -> Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout() );
01489         h_ele_EeleOPout -> Fill( bestGsfElectron.eEleClusterOverPout() );
01490         if (bestGsfElectron.ecalDrivenSeed()) h_ele_EeleOPout_eg -> Fill( bestGsfElectron.eEleClusterOverPout() );
01491         if (bestGsfElectron.isEB()) h_ele_EeleOPout_barrel -> Fill( bestGsfElectron.eEleClusterOverPout() );
01492         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EeleOPout_eg_barrel -> Fill( bestGsfElectron.eEleClusterOverPout() );
01493         if (bestGsfElectron.isEE()) h_ele_EeleOPout_endcaps -> Fill( bestGsfElectron.eEleClusterOverPout() );
01494         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_EeleOPout_eg_endcaps -> Fill( bestGsfElectron.eEleClusterOverPout() );
01495         h_ele_EeleOPoutVsEta -> Fill( bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout() );
01496         h_ele_EeleOPoutVsPhi -> Fill( bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout() );
01497         h_ele_EeleOPoutVsE -> Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout() );
01498         h_ele_dEtaSc_propVtx -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01499         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaSc_propVtx_eg -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01500         if (bestGsfElectron.isEB()) h_ele_dEtaSc_propVtx_barrel -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01501         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaSc_propVtx_eg_barrel -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01502         if (bestGsfElectron.isEE())h_ele_dEtaSc_propVtx_endcaps -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01503         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaSc_propVtx_eg_endcaps -> Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01504         h_ele_dEtaScVsEta_propVtx -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01505         h_ele_dEtaScVsPhi_propVtx -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01506         h_ele_dEtaScVsPt_propVtx -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01507         h_ele_dPhiSc_propVtx -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01508         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiSc_propVtx_eg -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01509         if (bestGsfElectron.isEB()) h_ele_dPhiSc_propVtx_barrel -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01510         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiSc_propVtx_eg_barrel -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01511         if (bestGsfElectron.isEE())h_ele_dPhiSc_propVtx_endcaps -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01512         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiSc_propVtx_eg_endcaps -> Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01513         h_ele_dPhiScVsEta_propVtx -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01514         h_ele_dPhiScVsPhi_propVtx -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01515         h_ele_dPhiScVsPt_propVtx -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01516         h_ele_dEtaCl_propOut -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01517         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaCl_propOut_eg -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01518         if (bestGsfElectron.isEB()) h_ele_dEtaCl_propOut_barrel -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01519         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaCl_propOut_eg_barrel -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01520         if (bestGsfElectron.isEE()) h_ele_dEtaCl_propOut_endcaps -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01521         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaCl_propOut_eg_endcaps -> Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01522         h_ele_dEtaClVsEta_propOut -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01523         h_ele_dEtaClVsPhi_propOut -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01524         h_ele_dEtaClVsPt_propOut -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01525         h_ele_dPhiCl_propOut -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01526         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiCl_propOut_eg -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01527         if (bestGsfElectron.isEB()) h_ele_dPhiCl_propOut_barrel -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01528         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiCl_propOut_eg_barrel -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01529         if (bestGsfElectron.isEE()) h_ele_dPhiCl_propOut_endcaps -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01530         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiCl_propOut_eg_endcaps -> Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01531         h_ele_dPhiClVsEta_propOut -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01532         h_ele_dPhiClVsPhi_propOut -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01533         h_ele_dPhiClVsPt_propOut -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01534         h_ele_dEtaEleCl_propOut -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01535         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaEleCl_propOut_eg -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01536         if (bestGsfElectron.isEB()) h_ele_dEtaEleCl_propOut_barrel -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01537         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaEleCl_propOut_eg_barrel -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01538         if (bestGsfElectron.isEE()) h_ele_dEtaEleCl_propOut_endcaps -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01539         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dEtaEleCl_propOut_eg_endcaps -> Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01540         h_ele_dEtaEleClVsEta_propOut -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01541         h_ele_dEtaEleClVsPhi_propOut -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01542         h_ele_dEtaEleClVsPt_propOut -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01543         h_ele_dPhiEleCl_propOut -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01544         if (bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiEleCl_propOut_eg -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01545         if (bestGsfElectron.isEB()) h_ele_dPhiEleCl_propOut_barrel -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01546         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiEleCl_propOut_eg_barrel -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01547         if (bestGsfElectron.isEE()) h_ele_dPhiEleCl_propOut_endcaps -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01548         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_dPhiEleCl_propOut_eg_endcaps -> Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01549         h_ele_dPhiEleClVsEta_propOut -> Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01550         h_ele_dPhiEleClVsPhi_propOut -> Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01551         h_ele_dPhiEleClVsPt_propOut -> Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01552         h_ele_HoE -> Fill(bestGsfElectron.hadronicOverEm());
01553         if (bestGsfElectron.ecalDrivenSeed()) h_ele_HoE_eg -> Fill(bestGsfElectron.hadronicOverEm());
01554         if (bestGsfElectron.isEB()) h_ele_HoE_barrel -> Fill(bestGsfElectron.hadronicOverEm());
01555         if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h_ele_HoE_eg_barrel -> Fill(bestGsfElectron.hadronicOverEm());
01556         if (bestGsfElectron.isEE()) h_ele_HoE_endcaps -> Fill(bestGsfElectron.hadronicOverEm());
01557         if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h_ele_HoE_eg_endcaps -> Fill(bestGsfElectron.hadronicOverEm());
01558         if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap()&& !bestGsfElectron.isEBEEGap() &&
01559             !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap()) h_ele_HoE_fiducial -> Fill(bestGsfElectron.hadronicOverEm());
01560         h_ele_HoEVsEta -> Fill( bestGsfElectron.eta(),bestGsfElectron.hadronicOverEm());
01561         h_ele_HoEVsPhi -> Fill(bestGsfElectron.phi(),bestGsfElectron.hadronicOverEm());
01562         h_ele_HoEVsE -> Fill(bestGsfElectron.caloEnergy(),bestGsfElectron.hadronicOverEm());
01563 
01564         //classes
01565         int eleClass = bestGsfElectron.classification();
01566         if (bestGsfElectron.isEE()) eleClass+=10;
01567         h_ele_classes ->Fill(eleClass);
01568 
01569   h_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
01570   if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_eta_golden ->Fill(std::abs(bestGsfElectron.eta()));
01571   if (bestGsfElectron.classification() == GsfElectron::BIGBREM) h_ele_eta_bbrem ->Fill(std::abs(bestGsfElectron.eta()));
01572   //if (bestGsfElectron.classification() == GsfElectron::OLDNARROW) h_ele_eta_narrow ->Fill(std::abs(bestGsfElectron.eta()));
01573   if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h_ele_eta_shower ->Fill(std::abs(bestGsfElectron.eta()));
01574 
01575         //fbrem
01576         double fbrem_mean=0.;
01577         if (!readAOD_) // track extra does not exist in AOD
01578          fbrem_mean =  1. - bestGsfElectron.gsfTrack()->outerMomentum().R()/bestGsfElectron.gsfTrack()->innerMomentum().R();
01579         double fbrem_mode =  bestGsfElectron.fbrem();
01580         h_ele_fbrem->Fill(fbrem_mode);
01581         h_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(),fbrem_mode);
01582         if (!readAOD_) // track extra does not exist in AOD
01583          h_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(),fbrem_mean);
01584 
01585         if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_PinVsPoutGolden_mode -> Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
01586         if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
01587          h_ele_PinVsPoutShowering_mode -> Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
01588         if (!readAOD_) // track extra does not exist in AOD
01589          if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_PinVsPoutGolden_mean -> Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
01590         if (!readAOD_) // track extra does not exist in AOD
01591          if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
01592           h_ele_PinVsPoutShowering_mean ->  Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
01593         if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_PtinVsPtoutGolden_mode -> Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
01594         if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
01595          h_ele_PtinVsPtoutShowering_mode -> Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
01596         if (!readAOD_) // track extra does not exist in AOD
01597          if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h_ele_PtinVsPtoutGolden_mean -> Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
01598         if (!readAOD_) // track extra does not exist in AOD
01599          if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
01600           h_ele_PtinVsPtoutShowering_mean ->  Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
01601 
01602         h_ele_mva->Fill(bestGsfElectron.mva());
01603         if (bestGsfElectron.ecalDrivenSeed()) h_ele_provenance->Fill(1.);
01604         if (bestGsfElectron.trackerDrivenSeed()) h_ele_provenance->Fill(-1.);
01605         if (bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) h_ele_provenance->Fill(0.);
01606         if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed()) h_ele_provenance->Fill(-2.);
01607         if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed()) h_ele_provenance->Fill(2.);
01608 
01609         h_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
01610         h_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
01611         h_ele_hcalDepth1TowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
01612         h_ele_hcalDepth2TowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
01613         h_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
01614         h_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
01615         h_ele_hcalDepth1TowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
01616         h_ele_hcalDepth2TowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
01617 
01618       } // gsf electron found
01619 
01620 //    } // matching object found
01621 
01622 //    }
01623 
01624   } // loop overmatching object
01625 
01626   h_matchingObjectNum->Fill(matchingObjectNum);
01627 
01628 }
01629 
01630