CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc

Go to the documentation of this file.
00001 
00002 // user include files
00003 #include "Validation/RecoEgamma/plugins/ElectronMcFakeValidator.h"
00004 
00005 #include "RecoEgamma/EgammaElectronAlgos/interface/ElectronUtilities.h"
00006 
00007 //#include "DQMServices/Core/interface/DQMStore.h"
00008 #include "DQMServices/Core/interface/MonitorElement.h"
00009 
00010 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
00011 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
00012 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00013 #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
00014 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00015 #include "DataFormats/EgammaReco/interface/ElectronSeed.h"
00016 #include "DataFormats/EgammaReco/interface/ElectronSeedFwd.h"
00017 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00018 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00019 #include "DataFormats/JetReco/interface/GenJetCollection.h"
00020 
00021 #include "DataFormats/Common/interface/Handle.h"
00022 #include "DataFormats/Common/interface/EDProduct.h"
00023 #include "DataFormats/Common/interface/ValueMap.h"
00024 
00025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00026 #include "FWCore/Framework/interface/EDAnalyzer.h"
00027 #include "FWCore/Framework/interface/Event.h"
00028 #include "FWCore/Framework/interface/MakerMacros.h"
00029 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00030 
00031 #include "CLHEP/Units/GlobalPhysicalConstants.h"
00032 #include "TMath.h"
00033 #include "TFile.h"
00034 #include "TH1F.h"
00035 #include "TH1I.h"
00036 #include "TH2F.h"
00037 #include "TProfile.h"
00038 #include "TTree.h"
00039 #include <vector>
00040 #include <iostream>
00041 
00042 using namespace reco;
00043 
00044 ElectronMcFakeValidator::ElectronMcFakeValidator( const edm::ParameterSet & conf )
00045  : ElectronDqmAnalyzerBase(conf)
00046  {
00047   //outputFile_ = conf.getParameter<std::string>("outputFile");
00048   electronCollection_ = conf.getParameter<edm::InputTag>("electronCollection");
00049   electronCoreCollection_ = conf.getParameter<edm::InputTag>("electronCoreCollection");
00050   electronTrackCollection_ = conf.getParameter<edm::InputTag>("electronTrackCollection");
00051   electronSeedCollection_ = conf.getParameter<edm::InputTag>("electronSeedCollection");
00052   matchingObjectCollection_ = conf.getParameter<edm::InputTag>("matchingObjectCollection");
00053 
00054   beamSpotTag_ = conf.getParameter<edm::InputTag>("beamSpot");
00055   readAOD_ = conf.getParameter<bool>("readAOD");
00056 
00057   isoFromDepsTk03Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsTk03" ) ;
00058   isoFromDepsTk04Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsTk04" ) ;
00059   isoFromDepsEcalFull03Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsEcalFull03" ) ;
00060   isoFromDepsEcalFull04Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsEcalFull04" ) ;
00061   isoFromDepsEcalReduced03Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsEcalReduced03" ) ;
00062   isoFromDepsEcalReduced04Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsEcalReduced04" ) ;
00063   isoFromDepsHcal03Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsHcal03" ) ;
00064   isoFromDepsHcal04Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsHcal04" ) ;
00065 
00066   maxPt_ = conf.getParameter<double>("MaxPt");
00067   maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
00068   deltaR_ = conf.getParameter<double>("DeltaR");
00069 
00070   // histos bining and limits
00071 
00072   edm::ParameterSet histosSet = conf.getParameter<edm::ParameterSet>("histosCfg") ;
00073 
00074   xyz_nbin=histosSet.getParameter<int>("Nbinxyz");
00075 
00076   p_nbin=histosSet.getParameter<int>("Nbinp");
00077   p2D_nbin=histosSet.getParameter<int>("Nbinp2D");
00078   p_max=histosSet.getParameter<double>("Pmax");
00079 
00080   pt_nbin=histosSet.getParameter<int>("Nbinpt");
00081   pt2D_nbin=histosSet.getParameter<int>("Nbinpt2D");
00082   pteff_nbin=histosSet.getParameter<int>("Nbinpteff");
00083   pt_max=histosSet.getParameter<double>("Ptmax");
00084 
00085   fhits_nbin=histosSet.getParameter<int>("Nbinfhits");
00086   fhits_max=histosSet.getParameter<double>("Fhitsmax");
00087 
00088   lhits_nbin=histosSet.getParameter<int>("Nbinlhits");
00089   lhits_max=histosSet.getParameter<double>("Lhitsmax");
00090 
00091   eop_nbin=histosSet.getParameter<int>("Nbineop");
00092   eop2D_nbin=histosSet.getParameter<int>("Nbineop2D");
00093   eop_max=histosSet.getParameter<double>("Eopmax");
00094   eopmaxsht=histosSet.getParameter<double>("Eopmaxsht");
00095 
00096   eta_nbin=histosSet.getParameter<int>("Nbineta");
00097   eta2D_nbin=histosSet.getParameter<int>("Nbineta2D");
00098   eta_min=histosSet.getParameter<double>("Etamin");
00099   eta_max=histosSet.getParameter<double>("Etamax");
00100 
00101   deta_nbin=histosSet.getParameter<int>("Nbindeta");
00102   deta_min=histosSet.getParameter<double>("Detamin");
00103   deta_max=histosSet.getParameter<double>("Detamax");
00104 
00105   detamatch_nbin=histosSet.getParameter<int>("Nbindetamatch");
00106   detamatch2D_nbin=histosSet.getParameter<int>("Nbindetamatch2D");
00107   detamatch_min=histosSet.getParameter<double>("Detamatchmin");
00108   detamatch_max=histosSet.getParameter<double>("Detamatchmax");
00109 
00110   phi_nbin=histosSet.getParameter<int>("Nbinphi");
00111   phi2D_nbin=histosSet.getParameter<int>("Nbinphi2D");
00112   phi_min=histosSet.getParameter<double>("Phimin");
00113   phi_max=histosSet.getParameter<double>("Phimax");
00114 
00115   dphi_nbin=histosSet.getParameter<int>("Nbindphi");
00116   dphi_min=histosSet.getParameter<double>("Dphimin");
00117   dphi_max=histosSet.getParameter<double>("Dphimax");
00118 
00119   dphimatch_nbin=histosSet.getParameter<int>("Nbindphimatch");
00120   dphimatch2D_nbin=histosSet.getParameter<int>("Nbindphimatch2D");
00121   dphimatch_min=histosSet.getParameter<double>("Dphimatchmin");
00122   dphimatch_max=histosSet.getParameter<double>("Dphimatchmax");
00123 
00124   mee_nbin= histosSet.getParameter<int>("Nbinmee");
00125   mee_min=histosSet.getParameter<double>("Meemin");
00126   mee_max=histosSet.getParameter<double>("Meemax");
00127 
00128   hoe_nbin= histosSet.getParameter<int>("Nbinhoe");
00129   hoe_min=histosSet.getParameter<double>("Hoemin");
00130   hoe_max=histosSet.getParameter<double>("Hoemax");
00131 
00132   popmatching_nbin= histosSet.getParameter<int>("Nbinpopmatching");
00133   popmatching_min=histosSet.getParameter<double>("Popmatchingmin");
00134   popmatching_max=histosSet.getParameter<double>("Popmatchingmax");
00135  }
00136 
00137 void ElectronMcFakeValidator::book()
00138  {
00139 //  prepareStore() ;
00140 //  setStoreFolder("EgammaV/ElectronMcFakeValidator") ;
00141   setBookIndex(-1) ;
00142   setBookPrefix("h") ;
00143 
00144   // matching object type
00145   std::string matchingObjectType ;
00146   if (std::string::npos!=matchingObjectCollection_.label().find("iterativeCone5GenJets",0))
00147    { matchingObjectType = "GenJet" ; }
00148   if (matchingObjectType=="")
00149    { edm::LogError("ElectronMcFakeValidator::beginJob")<<"Unknown matching object type !" ; }
00150   else
00151    { edm::LogInfo("ElectronMcFakeValidator::beginJob")<<"Matching object type: "<<matchingObjectType ; }
00152   std::string htitle = "# "+matchingObjectType+"s", xtitle = "N_{"+matchingObjectType+"}" ;
00153   h1_matchingObjectNum = bookH1withSumw2("matchingObjectNum",htitle,fhits_nbin,0.,fhits_max,xtitle) ;
00154 
00155   // rec event collections sizes
00156   h1_recEleNum_= bookH1("recEleNum","# rec electrons",11, -0.5,10.5,"N_{ele}");
00157   h1_recCoreNum_= bookH1("recCoreNum","# rec electron cores",21, -0.5,20.5,"N_{core}");
00158   h1_recTrackNum_= bookH1("recTrackNum","# rec gsf tracks",41, -0.5,40.5,"N_{track}");
00159   h1_recSeedNum_= bookH1("recSeedNum","# rec electron seeds",101, -0.5,100.5,"N_{seed}");
00160 
00161   // mc
00162   h1_matchingObjectEta = bookH1withSumw2("matchingObject_eta",matchingObjectType+" #eta",eta_nbin,eta_min,eta_max,"#eta");
00163   h1_matchingObjectAbsEta = bookH1withSumw2("matchingObject_abseta",matchingObjectType+" |#eta|",eta_nbin/2,0.,eta_max);
00164   h1_matchingObjectP = bookH1withSumw2("matchingObject_P",matchingObjectType+" p",p_nbin,0.,p_max,"p (GeV/c)");
00165   h1_matchingObjectPt = bookH1withSumw2("matchingObject_Pt",matchingObjectType+" pt",pteff_nbin,5.,pt_max);
00166   h1_matchingObjectPhi = bookH1withSumw2("matchingObject_phi",matchingObjectType+" phi",phi_nbin,phi_min,phi_max);
00167   h1_matchingObjectZ = bookH1withSumw2("matchingObject_z",matchingObjectType+" z",xyz_nbin, -25, 25 );
00168 
00169   setBookPrefix("h_ele") ;
00170 
00171   // all electrons
00172   h1_ele_EoverP_all = bookH1withSumw2("EoverP_all","ele E/P_{vertex}, all reco electrons",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
00173   h1_ele_EseedOP_all = bookH1withSumw2("EseedOP_all","ele E_{seed}/P_{vertex}, all reco electrons",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
00174   h1_ele_EoPout_all = bookH1withSumw2("EoPout_all","ele E_{seed}/P_{out}, all reco electrons",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
00175   h1_ele_EeleOPout_all = bookH1withSumw2("EeleOPout_all","ele E_{ele}/P_{out}, all reco electrons",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
00176   h1_ele_dEtaSc_propVtx_all = bookH1withSumw2("dEtaSc_propVtx_all","ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00177   h1_ele_dPhiSc_propVtx_all = bookH1withSumw2("dPhiSc_propVtx_all","ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00178   h1_ele_dEtaCl_propOut_all = bookH1withSumw2("dEtaCl_propOut_all","ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00179   h1_ele_dPhiCl_propOut_all = bookH1withSumw2("dPhiCl_propOut_all","ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00180   h1_ele_TIP_all = bookH1withSumw2("TIP_all","ele vertex transverse radius, all reco electrons",  100,0.,0.2,"r_{T} (cm)","Events","ELE_LOGY E1 P");
00181   h1_ele_HoE_all = bookH1withSumw2("HoE_all","ele hadronic energy / em energy, all reco electrons",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00182   h1_ele_vertexEta_all = bookH1withSumw2("vertexEta_all","ele eta, all reco electrons",eta_nbin,eta_min,eta_max,"","Events","ELE_LOGY E1 P");
00183   h1_ele_vertexPt_all = bookH1withSumw2("vertexPt_all","ele p_{T}, all reco electrons",pteff_nbin,5.,pt_max,"","Events","ELE_LOGY E1 P");
00184   h1_ele_mee_all = bookH1withSumw2("mee_all","ele pairs invariant mass, all reco electrons",mee_nbin, mee_min, mee_max,"m_{ee} (GeV/c^{2})" );
00185   h1_ele_mee_os = bookH1withSumw2("mee_os","ele pairs invariant mass, opp. sign",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})" );
00186 
00187   // duplicates
00188   h2_ele_E2mnE1vsMee_all = bookH2("E2mnE1vsMee_all","E2 - E1 vs ele pairs invariant mass, all electrons",mee_nbin, mee_min, mee_max, 100, -50., 50.,"m_{e^{+}e^{-}} (GeV/c^{2})","E2 - E1 (GeV)");
00189   h2_ele_E2mnE1vsMee_egeg_all = bookH2("E2mnE1vsMee_egeg_all","E2 - E1 vs ele pairs invariant mass, ecal driven pairs, all electrons",mee_nbin, mee_min, mee_max, 100, -50., 50.,"m_{e^{+}e^{-}} (GeV/c^{2})","E2 - E1 (GeV)");
00190 
00191 //  // charge ID
00192 //  h1_ele_ChargeMnChargeTrue = bookH1withSumw2("ChargeMnChargeTrue","ele charge - gen charge ",5,-1.,4.,"q_{rec} - q_{gen}");
00193 //  h1_ele_matchingObjectEta_matched_qmisid = bookH1withSumw2("eta_matched_qmisid","charge misid vs gen eta",eta_nbin,eta_min,eta_max);
00194 //  h1_ele_matchingObjectAbsEta_matched_qmisid = bookH1withSumw2("abseta_matched_qmisid","charge misid vs gen |eta|",eta_nbin/2,0.,eta_max);
00195 //  h1_ele_matchingObjectPt_matched_qmisid = bookH1withSumw2("Pt_matched_qmisid","charge misid vs gen transverse momentum",pteff_nbin,5.,pt_max);
00196 //  h1_ele_matchingObjectPhi_matched_qmisid = bookH1withSumw2("phi_matched_qmisid","charge misid vs gen phi",phi_nbin,phi_min,phi_max);
00197 //  h1_ele_matchingObjectZ_matched_qmisid = bookH1withSumw2("z_matched_qmisid","charge misid vs gen z",xyz_nbin, -25, 25 );
00198 
00199   // matched electrons
00200 
00201   htitle = "Efficiency vs matching "+matchingObjectType+" " ;
00202   h1_ele_matchingObjectEta_matched = bookH1withSumw2("matchingObjectEta_matched",htitle+"#eta",eta_nbin,eta_min,eta_max);
00203   h1_ele_matchingObjectAbsEta_matched = bookH1withSumw2("matchingObjectAbsEta_matched",htitle+"|#eta|",eta_nbin/2,0.,2.5);
00204   h1_ele_matchingObjectPt_matched = bookH1("matchingObjectPt_matched",htitle+"p_{T}",pteff_nbin,5.,pt_max);
00205   h1_ele_matchingObjectPhi_matched = bookH1withSumw2("matchingObjectPhi_matched",htitle+"phi",phi_nbin,phi_min,phi_max);
00206   h1_ele_matchingObjectZ_matched = bookH1withSumw2("matchingObjectZ_matched",htitle+"z",xyz_nbin,-25,25);
00207 
00208   h1_ele_charge = bookH1withSumw2("charge","ele charge",5,-2.5,2.5,"charge");
00209   h2_ele_chargeVsEta = bookH2("chargeVsEta","ele charge vs eta",eta2D_nbin,eta_min,eta_max,5,-2.,2.);
00210   h2_ele_chargeVsPhi = bookH2("chargeVsPhi","ele charge vs phi",phi2D_nbin,phi_min,phi_max,5,-2.,2.);
00211   h2_ele_chargeVsPt = bookH2("chargeVsPt","ele charge vs pt",pt_nbin,0.,100.,5,-2.,2.);
00212   h1_ele_vertexP = bookH1withSumw2("vertexP","ele momentum",p_nbin,0.,p_max,"p_{vertex} (GeV/c)");
00213   h1_ele_vertexPt = bookH1withSumw2("vertexPt","ele transverse momentum",pt_nbin,0.,pt_max,"p_{T vertex} (GeV/c)");
00214   h2_ele_vertexPtVsEta = bookH2("vertexPtVsEta","ele transverse momentum vs eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,0.,pt_max);
00215   h2_ele_vertexPtVsPhi = bookH2("vertexPtVsPhi","ele transverse momentum vs phi",phi2D_nbin,phi_min,phi_max,pt2D_nbin,0.,pt_max);
00216   h1_ele_vertexEta = bookH1withSumw2("vertexEta","ele momentum eta",eta_nbin,eta_min,eta_max,"#eta");
00217   h2_ele_vertexEtaVsPhi = bookH2("vertexEtaVsPhi","ele momentum eta vs phi",eta2D_nbin,eta_min,eta_max,phi2D_nbin,phi_min,phi_max );
00218   h1_ele_vertexPhi = bookH1withSumw2("vertexPhi","ele  momentum #phi",phi_nbin,phi_min,phi_max,"#phi (rad)");
00219   h1_ele_vertexX = bookH1withSumw2("vertexX","ele vertex x",xyz_nbin,-0.6,0.6,"x (cm)" );
00220   h1_ele_vertexY = bookH1withSumw2("vertexY","ele vertex y",xyz_nbin,-0.6,0.6,"y (cm)" );
00221   h1_ele_vertexZ = bookH1withSumw2("vertexZ","ele vertex z",xyz_nbin,-25, 25,"z (cm)" );
00222   h1_ele_vertexTIP = bookH1withSumw2("vertexTIP","ele transverse impact parameter (wrt gen vtx)",90,0.,0.15,"TIP (cm)","Events","ELE_LOGY E1 P");
00223   h2_ele_vertexTIPVsEta = bookH2("vertexTIPVsEta","ele transverse impact parameter (wrt gen vtx) vs eta",eta2D_nbin,eta_min,eta_max,45,0.,0.15,"#eta","TIP (cm)");
00224   h2_ele_vertexTIPVsPhi = bookH2("vertexTIPVsPhi","ele transverse impact parameter (wrt gen vtx) vs phi",phi2D_nbin,phi_min,phi_max,45,0.,0.15,"#phi (rad)","TIP (cm)");
00225   h2_ele_vertexTIPVsPt = bookH2("vertexTIPVsPt","ele transverse impact parameter (wrt gen vtx) vs transverse momentum",pt2D_nbin,0.,pt_max,45,0.,0.15,"p_{T} (GeV/c)","TIP (cm)");
00226 
00227   htitle = "Electron / Matching "+matchingObjectType+", momemtum" ;
00228   xtitle = "P / P_{"+matchingObjectType+"}" ;
00229   h1_ele_PoPmatchingObject = bookH1withSumw2("PoPmatchingObject",htitle,popmatching_nbin,popmatching_min,popmatching_max,xtitle);
00230   h2_ele_PoPmatchingObjectVsEta = bookH2("PoPmatchingObjectVsEta",htitle+",vs eta",eta2D_nbin,eta_min,eta_max,50,popmatching_min,popmatching_max);
00231   h2_ele_PoPmatchingObjectVsPhi = bookH2("PoPmatchingObjectVsPhi",htitle+",vs phi",phi2D_nbin,phi_min,phi_max,50,popmatching_min,popmatching_max);
00232   h2_ele_PoPmatchingObjectVsPt = bookH2("PoPmatchingObjectVsPt",htitle+",vs eta",pt2D_nbin,0.,pt_max,50,popmatching_min,popmatching_max);
00233   h1_ele_PoPmatchingObject_barrel = bookH1withSumw2("PoPmatchingObject_barrel",htitle+", barrel",popmatching_nbin,popmatching_min,popmatching_max,xtitle);
00234   h1_ele_PoPmatchingObject_endcaps = bookH1withSumw2("PoPmatchingObject_endcaps",htitle+", endcaps",popmatching_nbin,popmatching_min,popmatching_max,xtitle);
00235   htitle = "Ele - "+matchingObjectType+", " ;
00236   xtitle = "#eta - #eta_{"+matchingObjectType+"}" ;
00237   h1_ele_EtaMnEtamatchingObject = bookH1withSumw2("EtamatchingObjectEtaTrue",htitle+"eta",deta_nbin,deta_min,deta_max,xtitle);
00238   h2_ele_EtaMnEtamatchingObjectVsEta = bookH2("EtaMnEtamatchingObjectVsEta",htitle+"eta, vs eta",eta2D_nbin,eta_min,eta_max,deta_nbin/2,deta_min,deta_max);
00239   h2_ele_EtaMnEtamatchingObjectVsPhi = bookH2("EtaMnEtamatchingObjectVsPhi",htitle+"eta, vs phi",phi2D_nbin,phi_min,phi_max,deta_nbin/2,deta_min,deta_max);
00240   h2_ele_EtaMnEtamatchingObjectVsPt = bookH2("EtaMnEtamatchingObjectVsPt",htitle+"eta,, vs pt",pt_nbin,0.,pt_max,deta_nbin/2,deta_min,deta_max);
00241   xtitle = "#phi - #phi_{"+matchingObjectType+"} (rad)" ;
00242   h1_ele_PhiMnPhimatchingObject = bookH1withSumw2("PhiMnPhimatchingObject",htitle+"phi",dphi_nbin,dphi_min,dphi_max,xtitle);
00243   h1_ele_PhiMnPhimatchingObject2 = bookH1("PhiMnPhimatchingObject2",htitle+"phi",dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00244   h2_ele_PhiMnPhimatchingObjectVsEta = bookH2("PhiMnPhimatchingObjectVsEta",htitle+"phi, vs eta",eta2D_nbin,eta_min,eta_max,dphi_nbin/2,dphi_min,dphi_max);
00245   h2_ele_PhiMnPhimatchingObjectVsPhi = bookH2("PhiMnPhimatchingObjectVsPhi",htitle+"phi, vs phi",phi2D_nbin,phi_min,phi_max,dphi_nbin/2,dphi_min,dphi_max);
00246   h2_ele_PhiMnPhimatchingObjectVsPt = bookH2("PhiMnPhimatchingObjectVsPt",htitle+"phi, vs pt",pt2D_nbin,0.,pt_max,dphi_nbin/2,dphi_min,dphi_max);
00247 
00248   // matched electron, superclusters
00249 
00250   setBookPrefix("h_scl") ;
00251 
00252   h1_scl_En_ = bookH1withSumw2("energy","ele supercluster energy",p_nbin,0.,p_max);
00253   htitle = "Ele supercluster / "+matchingObjectType+", energy" ;
00254   xtitle = "E/E_{"+matchingObjectType+"}" ;
00255   h1_scl_EoEmatchingObject_barrel = bookH1withSumw2("EoEmatchingObject_barrel",htitle+", barrel",50,0.2,1.2,xtitle);
00256   h1_scl_EoEmatchingObject_endcaps = bookH1withSumw2("EoEmatchingObject_endcaps",htitle+", endcaps",50,0.2,1.2,xtitle);
00257   h1_scl_Et_ = bookH1withSumw2("et","ele supercluster transverse energy",pt_nbin,0.,pt_max);
00258   h2_scl_EtVsEta_ = bookH2("etVsEta","ele supercluster transverse energy vs eta",eta2D_nbin,eta_min,eta_max,pt_nbin,0.,pt_max);
00259   h2_scl_EtVsPhi_ = bookH2("etVsPhi","ele supercluster transverse energy vs phi",phi2D_nbin,phi_min,phi_max,pt_nbin,0.,pt_max);
00260   h2_scl_EtaVsPhi_ = bookH2("etaVsPhi","ele supercluster eta vs phi",phi2D_nbin,phi_min,phi_max,eta2D_nbin,eta_min,eta_max);
00261   h1_scl_Eta_ = bookH1withSumw2("eta","ele supercluster eta",eta_nbin,eta_min,eta_max);
00262   h1_scl_Phi_ = bookH1withSumw2("phi","ele supercluster phi",phi_nbin,phi_min,phi_max);
00263   h1_scl_SigIEtaIEta_  = bookH1withSumw2("sigietaieta","ele supercluster sigma ieta ieta",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
00264   h1_scl_SigIEtaIEta_barrel_  = bookH1withSumw2("sigietaieta_barrel","ele supercluster sigma ieta ieta, barrel",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
00265   h1_scl_SigIEtaIEta_endcaps_  = bookH1withSumw2("sigietaieta_endcaps","ele supercluster sigma ieta ieta, endcaps",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
00266   h1_scl_E1x5_  = bookH1withSumw2("E1x5","ele supercluster energy in 1x5",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
00267   h1_scl_E1x5_barrel_  = bookH1withSumw2("E1x5_barrel","ele supercluster energy in 1x5 barrel",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
00268   h1_scl_E1x5_endcaps_  = bookH1withSumw2("E1x5_endcaps","ele supercluster energy in 1x5 endcaps",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
00269   h1_scl_E2x5max_  = bookH1withSumw2("E2x5max","ele supercluster energy in 2x5 max",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
00270   h1_scl_E2x5max_barrel_  = bookH1withSumw2("E2x5max_barrel","ele supercluster energy in 2x5 _max barrel",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
00271   h1_scl_E2x5max_endcaps_  = bookH1withSumw2("E2x5max_endcaps","ele supercluster energy in 2x5 _max endcaps",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
00272   h1_scl_E5x5_  = bookH1withSumw2("E5x5","ele supercluster energy in 5x5",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
00273   h1_scl_E5x5_barrel_  = bookH1withSumw2("E5x5_barrel","ele supercluster energy in 5x5 barrel",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
00274   h1_scl_E5x5_endcaps_  = bookH1withSumw2("E5x5_endcaps","ele supercluster energy in 5x5 endcaps",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
00275 //  h2_scl_EoEtruePfVsEg = bookH2("EoEtruePfVseg","ele supercluster energy / gen energy pflow vs eg",75,-0.1,1.4, 75, -0.1, 1.4,"E/E_{gen} (e/g)","E/E_{gen} (pflow)") ;
00276 
00277   // matched electron, gsf tracks
00278 
00279   setBookPrefix("h_ele") ;
00280 
00281   h1_ele_ambiguousTracks = bookH1withSumw2("ambiguousTracks","ele # ambiguous tracks",  5,0.,5.,"N_{ambiguous tracks}","Events","ELE_LOGY E1 P");
00282   h2_ele_ambiguousTracksVsEta = bookH2("ambiguousTracksVsEta","ele # ambiguous tracks  vs eta",eta2D_nbin,eta_min,eta_max,5,0.,5.);
00283   h2_ele_ambiguousTracksVsPhi = bookH2("ambiguousTracksVsPhi","ele # ambiguous tracks  vs phi",phi2D_nbin,phi_min,phi_max,5,0.,5.);
00284   h2_ele_ambiguousTracksVsPt = bookH2("ambiguousTracksVsPt","ele # ambiguous tracks vs pt",pt2D_nbin,0.,pt_max,5,0.,5.);
00285   h1_ele_foundHits = bookH1withSumw2("foundHits","ele track # found hits",fhits_nbin,0.,fhits_max,"N_{hits}");
00286   h2_ele_foundHitsVsEta = bookH2("foundHitsVsEta","ele track # found hits vs eta",eta2D_nbin,eta_min,eta_max,fhits_nbin,0.,fhits_max);
00287   h2_ele_foundHitsVsPhi = bookH2("foundHitsVsPhi","ele track # found hits vs phi",phi2D_nbin,phi_min,phi_max,fhits_nbin,0.,fhits_max);
00288   h2_ele_foundHitsVsPt = bookH2("foundHitsVsPt","ele track # found hits vs pt",pt2D_nbin,0.,pt_max,fhits_nbin,0.,fhits_max);
00289   h1_ele_lostHits = bookH1withSumw2("lostHits","ele track # lost hits",       5,0.,5.,"N_{lost hits}");
00290   h2_ele_lostHitsVsEta = bookH2("lostHitsVsEta","ele track # lost hits vs eta",eta2D_nbin,eta_min,eta_max,lhits_nbin,0.,lhits_max);
00291   h2_ele_lostHitsVsPhi = bookH2("lostHitsVsPhi","ele track # lost hits vs eta",phi2D_nbin,phi_min,phi_max,lhits_nbin,0.,lhits_max);
00292   h2_ele_lostHitsVsPt = bookH2("lostHitsVsPt","ele track # lost hits vs eta",pt2D_nbin,0.,pt_max,lhits_nbin,0.,lhits_max);
00293   h1_ele_chi2 = bookH1withSumw2("chi2","ele track #chi^{2}",100,0.,15.,"#Chi^{2}","Events","ELE_LOGY E1 P");
00294   h2_ele_chi2VsEta = bookH2("chi2VsEta","ele track #chi^{2} vs eta",eta2D_nbin,eta_min,eta_max,50,0.,15.);
00295   h2_ele_chi2VsPhi = bookH2("chi2VsPhi","ele track #chi^{2} vs phi",phi2D_nbin,phi_min,phi_max,50,0.,15.);
00296   h2_ele_chi2VsPt = bookH2("chi2VsPt","ele track #chi^{2} vs pt",pt2D_nbin,0.,pt_max,50,0.,15.);
00297   h1_ele_PinMnPout = bookH1withSumw2("PinMnPout","ele track inner p - outer p, mean of GSF components"   ,p_nbin,0.,200.,"P_{vertex} - P_{out} (GeV/c)");
00298   h1_ele_PinMnPout_mode = bookH1withSumw2("PinMnPout_mode","ele track inner p - outer p, mode of GSF components"   ,p_nbin,0.,100.,"P_{vertex} - P_{out}, mode of GSF components (GeV/c)");
00299   h2_ele_PinMnPoutVsEta_mode = bookH2("PinMnPoutVsEta_mode","ele track inner p - outer p vs eta, mode of GSF components" ,eta2D_nbin, eta_min,eta_max,p2D_nbin,0.,100.);
00300   h2_ele_PinMnPoutVsPhi_mode = bookH2("PinMnPoutVsPhi_mode","ele track inner p - outer p vs phi, mode of GSF components" ,phi2D_nbin, phi_min,phi_max,p2D_nbin,0.,100.);
00301   h2_ele_PinMnPoutVsPt_mode = bookH2("PinMnPoutVsPt_mode","ele track inner p - outer p vs pt, mode of GSF components" ,pt2D_nbin, 0.,pt_max,p2D_nbin,0.,100.);
00302   h2_ele_PinMnPoutVsE_mode = bookH2("PinMnPoutVsE_mode","ele track inner p - outer p vs E, mode of GSF components" ,p2D_nbin, 0.,200.,p2D_nbin,0.,100.);
00303   h2_ele_PinMnPoutVsChi2_mode = bookH2("PinMnPoutVsChi2_mode","ele track inner p - outer p vs track chi2, mode of GSF components" ,50, 0.,20.,p2D_nbin,0.,100.);
00304   h1_ele_outerP = bookH1withSumw2("outerP","ele track outer p, mean of GSF components",p_nbin,0.,p_max,"P_{out} (GeV/c)");
00305   h1_ele_outerP_mode = bookH1withSumw2("outerP_mode","ele track outer p, mode of GSF components",p_nbin,0.,p_max,"P_{out} (GeV/c)");
00306   h2_ele_outerPVsEta_mode = bookH2("outerPVsEta_mode","ele track outer p vs eta mode",eta2D_nbin,eta_min,eta_max,50,0.,p_max);
00307   h1_ele_outerPt = bookH1withSumw2("outerPt","ele track outer p_{T}, mean of GSF components",pt_nbin,0.,pt_max,"P_{T out} (GeV/c)");
00308   h1_ele_outerPt_mode = bookH1withSumw2("outerPt_mode","ele track outer p_{T}, mode of GSF components",pt_nbin,0.,pt_max,"P_{T out} (GeV/c)");
00309   h2_ele_outerPtVsEta_mode = bookH2("outerPtVsEta_mode","ele track outer p_{T} vs eta, mode of GSF components",eta2D_nbin,eta_min,eta_max,pt2D_nbin,0.,pt_max);
00310   h2_ele_outerPtVsPhi_mode = bookH2("outerPtVsPhi_mode","ele track outer p_{T} vs phi, mode of GSF components",phi2D_nbin,phi_min,phi_max,pt2D_nbin,0.,pt_max);
00311   h2_ele_outerPtVsPt_mode = bookH2("outerPtVsPt_mode","ele track outer p_{T} vs pt, mode of GSF components",pt2D_nbin,0.,100.,pt2D_nbin,0.,pt_max);
00312 
00313   // matched electrons, matching
00314   h1_ele_EoP = bookH1withSumw2("EoP","ele E/P_{vertex}",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
00315   h1_ele_EoP_barrel = bookH1withSumw2("EoP_barrel","ele E/P_{vertex} barrel",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
00316   h1_ele_EoP_endcaps = bookH1withSumw2("EoP_endcaps","ele E/P_{vertex} endcaps",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
00317   h1_ele_EoP_eg = bookH1withSumw2("EoP_eg","ele E/P_{vertex}, ecal driven",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
00318   h1_ele_EoP_eg_barrel = bookH1withSumw2("EoP_eg_barrel","ele E/P_{vertex}, ecal driven barrel",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
00319   h1_ele_EoP_eg_endcaps = bookH1withSumw2("EoP_eg_endcaps","ele E/P_{vertex}, ecal driven endcaps",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
00320   h2_ele_EoPVsEta = bookH2("EoPVsEta","ele E/P_{vertex} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
00321   h2_ele_EoPVsPhi = bookH2("EoPVsPhi","ele E/P_{vertex} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
00322   h2_ele_EoPVsE = bookH2("EoPVsE","ele E/P_{vertex} vs E",  50,0.,p_max ,50,0.,5.);
00323   h1_ele_EseedOP = bookH1withSumw2("EseedOP","ele E_{seed}/P_{vertex}",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
00324   h1_ele_EseedOP_barrel = bookH1withSumw2("EseedOP_barrel","ele E_{seed}/P_{vertex} barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
00325   h1_ele_EseedOP_endcaps = bookH1withSumw2("EseedOP_endcaps","ele E_{seed}/P_{vertex} endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
00326   h1_ele_EseedOP_eg = bookH1withSumw2("EseedOP_eg","ele E_{seed}/P_{vertex}, ecal driven",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
00327   h1_ele_EseedOP_eg_barrel = bookH1withSumw2("EseedOP_eg_barrel","ele E_{seed}/P_{vertex}, ecal driven barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
00328   h1_ele_EseedOP_eg_endcaps = bookH1withSumw2("EseedOP_eg_endcaps","ele E_{seed}/P_{vertex}, ecal driven, endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
00329   h2_ele_EseedOPVsEta = bookH2("EseedOPVsEta","ele E_{seed}/P_{vertex} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
00330   h2_ele_EseedOPVsPhi = bookH2("EseedOPVsPhi","ele E_{seed}/P_{vertex} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
00331   h2_ele_EseedOPVsE = bookH2("EseedOPVsE","ele E_{seed}/P_{vertex} vs E",  50,0.,p_max ,50,0.,5.);
00332   h1_ele_EoPout = bookH1withSumw2("EoPout","ele E_{seed}/P_{out}",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
00333   h1_ele_EoPout_barrel = bookH1withSumw2("EoPout_barrel","ele E_{seed}/P_{out} barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
00334   h1_ele_EoPout_endcaps = bookH1withSumw2("EoPout_endcaps","ele E_{seed}/P_{out} endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
00335   h1_ele_EoPout_eg = bookH1withSumw2("EoPout_eg","ele E_{seed}/P_{out}, ecal driven",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
00336   h1_ele_EoPout_eg_barrel = bookH1withSumw2("EoPout_eg_barrel","ele E_{seed}/P_{out}, ecal driven, barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
00337   h1_ele_EoPout_eg_endcaps = bookH1withSumw2("EoPout_eg_endcaps","ele E_{seed}/P_{out}, ecal driven, endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
00338   h2_ele_EoPoutVsEta = bookH2("EoPoutVsEta","ele E_{seed}/P_{out} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
00339   h2_ele_EoPoutVsPhi = bookH2("EoPoutVsPhi","ele E_{seed}/P_{out} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
00340   h2_ele_EoPoutVsE = bookH2("EoPoutVsE","ele E_{seed}/P_{out} vs E",p2D_nbin,0.,p_max,eop2D_nbin,0.,eopmaxsht);
00341   h1_ele_EeleOPout = bookH1withSumw2("EeleOPout","ele E_{ele}/P_{out}",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
00342   h1_ele_EeleOPout_barrel = bookH1withSumw2("EeleOPout_barrel","ele E_{ele}/P_{out} barrel",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
00343   h1_ele_EeleOPout_endcaps = bookH1withSumw2("EeleOPout_endcaps","ele E_{ele}/P_{out} endcaps",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
00344   h1_ele_EeleOPout_eg = bookH1withSumw2("EeleOPout_eg","ele E_{ele}/P_{out}, ecal driven",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
00345   h1_ele_EeleOPout_eg_barrel = bookH1withSumw2("EeleOPout_eg_barrel","ele E_{ele}/P_{out}, ecal driven, barrel",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
00346   h1_ele_EeleOPout_eg_endcaps = bookH1withSumw2("EeleOPout_eg_endcaps","ele E_{ele}/P_{out}, ecal driven, endcaps",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
00347   h2_ele_EeleOPoutVsEta = bookH2("EeleOPoutVsEta","ele E_{ele}/P_{out} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
00348   h2_ele_EeleOPoutVsPhi = bookH2("EeleOPoutVsPhi","ele E_{ele}/P_{out} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
00349   h2_ele_EeleOPoutVsE = bookH2("EeleOPoutVsE","ele E_{ele}/P_{out} vs E",p2D_nbin,0.,p_max,eop2D_nbin,0.,eopmaxsht);
00350   h1_ele_dEtaSc_propVtx = bookH1withSumw2("dEtaSc_propVtx","ele #eta_{sc} - #eta_{tr}, prop from vertex",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00351   h1_ele_dEtaSc_propVtx_barrel = bookH1withSumw2("dEtaSc_propVtx_barrel","ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00352   h1_ele_dEtaSc_propVtx_endcaps = bookH1withSumw2("dEtaSc_propVtx_endcaps","ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00353   h1_ele_dEtaSc_propVtx_eg = bookH1withSumw2("dEtaSc_propVtx_eg","ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00354   h1_ele_dEtaSc_propVtx_eg_barrel = bookH1withSumw2("dEtaSc_propVtx_eg_barrel","ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00355   h1_ele_dEtaSc_propVtx_eg_endcaps = bookH1withSumw2("dEtaSc_propVtx_eg_endcaps","ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00356   h2_ele_dEtaScVsEta_propVtx = bookH2("dEtaScVsEta_propVtx","ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
00357   h2_ele_dEtaScVsPhi_propVtx = bookH2("dEtaScVsPhi_propVtx","ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
00358   h2_ele_dEtaScVsPt_propVtx = bookH2("dEtaScVsPt_propVtx","ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
00359   h1_ele_dPhiSc_propVtx = bookH1withSumw2("dPhiSc_propVtx","ele #phi_{sc} - #phi_{tr}, prop from vertex",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00360   h1_ele_dPhiSc_propVtx_barrel = bookH1withSumw2("dPhiSc_propVtx_barrel","ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00361   h1_ele_dPhiSc_propVtx_endcaps = bookH1withSumw2("dPhiSc_propVtx_endcaps","ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00362   h1_ele_dPhiSc_propVtx_eg = bookH1withSumw2("dPhiSc_propVtx_eg","ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00363   h1_ele_dPhiSc_propVtx_eg_barrel = bookH1withSumw2("dPhiSc_propVtx_eg_barrel","ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00364   h1_ele_dPhiSc_propVtx_eg_endcaps = bookH1withSumw2("dPhiSc_propVtx_eg_endcaps","ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00365   h2_ele_dPhiScVsEta_propVtx = bookH2("dPhiScVsEta_propVtx","ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00366   h2_ele_dPhiScVsPhi_propVtx = bookH2("dPhiScVsPhi_propVtx","ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00367   h2_ele_dPhiScVsPt_propVtx = bookH2("dPhiScVsPt_propVtx","ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00368   h1_ele_dEtaCl_propOut = bookH1withSumw2("dEtaCl_propOut","ele #eta_{cl} - #eta_{tr}, prop from outermost",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00369   h1_ele_dEtaCl_propOut_barrel = bookH1withSumw2("dEtaCl_propOut_barrel","ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00370   h1_ele_dEtaCl_propOut_endcaps = bookH1withSumw2("dEtaCl_propOut_endcaps","ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00371   h1_ele_dEtaCl_propOut_eg = bookH1withSumw2("dEtaCl_propOut_eg","ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00372   h1_ele_dEtaCl_propOut_eg_barrel = bookH1withSumw2("dEtaCl_propOut_eg_barrel","ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00373   h1_ele_dEtaCl_propOut_eg_endcaps = bookH1withSumw2("dEtaCl_propOut_eg_endcaps","ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{seedcl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00374   h2_ele_dEtaClVsEta_propOut = bookH2("dEtaClVsEta_propOut","ele #eta_{cl} - #eta_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
00375   h2_ele_dEtaClVsPhi_propOut = bookH2("dEtaClVsPhi_propOut","ele #eta_{cl} - #eta_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
00376   h2_ele_dEtaClVsPt_propOut = bookH2("dEtaScVsPt_propOut","ele #eta_{cl} - #eta_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
00377   h1_ele_dPhiCl_propOut = bookH1withSumw2("dPhiCl_propOut","ele #phi_{cl} - #phi_{tr}, prop from outermost",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00378   h1_ele_dPhiCl_propOut_barrel = bookH1withSumw2("dPhiCl_propOut_barrel","ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00379   h1_ele_dPhiCl_propOut_endcaps = bookH1withSumw2("dPhiCl_propOut_endcaps","ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00380   h1_ele_dPhiCl_propOut_eg = bookH1withSumw2("dPhiCl_propOut_eg","ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00381   h1_ele_dPhiCl_propOut_eg_barrel = bookH1withSumw2("dPhiCl_propOut_eg_barrel","ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00382   h1_ele_dPhiCl_propOut_eg_endcaps = bookH1withSumw2("dPhiCl_propOut_eg_endcaps","ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{seedcl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00383   h2_ele_dPhiClVsEta_propOut = bookH2("dPhiClVsEta_propOut","ele #phi_{cl} - #phi_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00384   h2_ele_dPhiClVsPhi_propOut = bookH2("dPhiClVsPhi_propOut","ele #phi_{cl} - #phi_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00385   h2_ele_dPhiClVsPt_propOut = bookH2("dPhiSClsPt_propOut","ele #phi_{cl} - #phi_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00386   h1_ele_dEtaEleCl_propOut = bookH1withSumw2("dEtaEleCl_propOut","ele #eta_{EleCl} - #eta_{tr}, prop from outermost",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00387   h1_ele_dEtaEleCl_propOut_barrel = bookH1withSumw2("dEtaEleCl_propOut_barrel","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00388   h1_ele_dEtaEleCl_propOut_endcaps = bookH1withSumw2("dEtaEleCl_propOut_endcaps","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00389   h1_ele_dEtaEleCl_propOut_eg = bookH1withSumw2("dEtaEleCl_propOut_eg","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00390   h1_ele_dEtaEleCl_propOut_eg_barrel = bookH1withSumw2("dEtaEleCl_propOut_eg_barrel","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00391   h1_ele_dEtaEleCl_propOut_eg_endcaps = bookH1withSumw2("dEtaEleCl_propOut_eg_endcaps","ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{elecl} - #eta_{tr}","Events","ELE_LOGY E1 P");
00392   h2_ele_dEtaEleClVsEta_propOut = bookH2("dEtaEleClVsEta_propOut","ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,detamatch2D_nbin,detamatch_min,detamatch_max);
00393   h2_ele_dEtaEleClVsPhi_propOut = bookH2("dEtaEleClVsPhi_propOut","ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,detamatch2D_nbin,detamatch_min,detamatch_max);
00394   h2_ele_dEtaEleClVsPt_propOut = bookH2("dEtaScVsPt_propOut","ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,detamatch2D_nbin,detamatch_min,detamatch_max);
00395   h1_ele_dPhiEleCl_propOut = bookH1withSumw2("dPhiEleCl_propOut","ele #phi_{EleCl} - #phi_{tr}, prop from outermost",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00396   h1_ele_dPhiEleCl_propOut_barrel = bookH1withSumw2("dPhiEleCl_propOut_barrel","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00397   h1_ele_dPhiEleCl_propOut_endcaps = bookH1withSumw2("dPhiEleCl_propOut_endcaps","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00398   h1_ele_dPhiEleCl_propOut_eg = bookH1withSumw2("dPhiEleCl_propOut_eg","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00399   h1_ele_dPhiEleCl_propOut_eg_barrel = bookH1withSumw2("dPhiEleCl_propOut_eg_barrel","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00400   h1_ele_dPhiEleCl_propOut_eg_endcaps = bookH1withSumw2("dPhiEleCl_propOut_eg_endcaps","ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{elecl} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00401   h2_ele_dPhiEleClVsEta_propOut = bookH2("dPhiEleClVsEta_propOut","ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",eta2D_nbin,eta_min,eta_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00402   h2_ele_dPhiEleClVsPhi_propOut = bookH2("dPhiEleClVsPhi_propOut","ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",phi2D_nbin,phi_min,phi_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00403   h2_ele_dPhiEleClVsPt_propOut = bookH2("dPhiSEleClsPt_propOut","ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",pt2D_nbin,0.,pt_max,dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00404   h1_ele_HoE = bookH1withSumw2("HoE","ele hadronic energy / em energy",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00405   h1_ele_HoE_barrel = bookH1withSumw2("HoE_barrel","ele hadronic energy / em energy, barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00406   h1_ele_HoE_endcaps = bookH1withSumw2("HoE_endcaps","ele hadronic energy / em energy, endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00407   h1_ele_HoE_eg = bookH1withSumw2("HoE_eg","ele hadronic energy / em energy, ecal driven",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00408   h1_ele_HoE_eg_barrel = bookH1withSumw2("HoE_eg_barrel","ele hadronic energy / em energy, ecal driven, barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00409   h1_ele_HoE_eg_endcaps = bookH1withSumw2("HoE_eg_endcaps","ele hadronic energy / em energy, ecal driven, endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00410   h1_ele_HoE_fiducial = bookH1withSumw2("HoE_fiducial","ele hadronic energy / em energy, fiducial region",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00411   h2_ele_HoEVsEta = bookH2("HoEVsEta","ele hadronic energy / em energy vs eta",eta_nbin,eta_min,eta_max,hoe_nbin, hoe_min, hoe_max) ;
00412   h2_ele_HoEVsPhi = bookH2("HoEVsPhi","ele hadronic energy / em energy vs phi",phi2D_nbin,phi_min,phi_max,hoe_nbin, hoe_min, hoe_max) ;
00413   h2_ele_HoEVsE = bookH2("HoEVsE","ele hadronic energy / em energy vs E",p_nbin, 0.,300.,hoe_nbin, hoe_min, hoe_max) ;
00414 
00415   // seeds
00416   h1_ele_seed_subdet2_ = bookH1withSumw2("seedSubdet2","ele seed subdet 2nd layer",11,-0.5,10.5,"2nd hit subdet Id") ;
00417   h1_ele_seed_mask_ = bookH1withSumw2("seedMask","ele seed hits mask",13,-0.5,12.5) ;
00418   h1_ele_seed_mask_bpix_ = bookH1withSumw2("seedMask_Bpix","ele seed hits mask when subdet2 is bpix",13,-0.5,12.5) ;
00419   h1_ele_seed_mask_fpix_ = bookH1withSumw2("seedMask_Fpix","ele seed hits mask when subdet2 is bpix",13,-0.5,12.5) ;
00420   h1_ele_seed_mask_tec_ = bookH1withSumw2("seedMask_Tec","ele seed hits mask when subdet2 is bpix",13,-0.5,12.5) ;
00421   h1_ele_seed_dphi2_ = bookH1withSumw2("seedDphi2","ele seed dphi 2nd layer", 50,-0.003,+0.003,"#phi_{hit}-#phi_{pred} (rad)") ;
00422   h2_ele_seed_dphi2VsEta_ = bookH2("seedDphi2_VsEta","ele seed dphi 2nd layer vs eta",eta2D_nbin,eta_min,eta_max,50,-0.003,+0.003) ;
00423   h2_ele_seed_dphi2VsPt_ = bookH2("seedDphi2_VsPt","ele seed dphi 2nd layer vs pt",pt2D_nbin,0.,pt_max,50,-0.003,+0.003) ;
00424   h1_ele_seed_dphi2pos_ = bookH1withSumw2("seedDphi2Pos","ele seed dphi 2nd layer positron", 50,-0.003,+0.003,"#phi_{hit}-#phi_{pred} (rad)") ;
00425   h2_ele_seed_dphi2posVsEta_ = bookH2("seedDphi2Pos_VsEta","ele seed dphi 2nd layer positron vs eta",eta2D_nbin,eta_min,eta_max,50,-0.003,+0.003) ;
00426   h2_ele_seed_dphi2posVsPt_ = bookH2("seedDphi2Pos_VsPt","ele seed dphi 2nd layer positron vs pt",pt2D_nbin,0.,pt_max,50,-0.003,+0.003) ;
00427   h1_ele_seed_drz2_ = bookH1withSumw2("seedDrz2","ele seed dr (dz) 2nd layer", 50,-0.03,+0.03,"r(z)_{hit}-r(z)_{pred} (cm)") ;
00428   h2_ele_seed_drz2VsEta_ = bookH2("seedDrz2_VsEta","ele seed dr/dz 2nd layer vs eta",eta2D_nbin,eta_min,eta_max,50,-0.03,+0.03) ;
00429   h2_ele_seed_drz2VsPt_ = bookH2("seedDrz2_VsPt","ele seed dr/dz 2nd layer vs pt",pt2D_nbin,0.,pt_max,50,-0.03,+0.03) ;
00430   h1_ele_seed_drz2pos_ = bookH1withSumw2("seedDrz2Pos","ele seed dr (dz) 2nd layer positron", 50,-0.03,+0.03,"r(z)_{hit}-r(z)_{pred} (cm)") ;
00431   h2_ele_seed_drz2posVsEta_ = bookH2("seedDrz2Pos_VsEta","ele seed dr/dz 2nd layer positron vs eta",eta2D_nbin,eta_min,eta_max,50,-0.03,+0.03) ;
00432   h2_ele_seed_drz2posVsPt_ = bookH2("seedDrz2Pos_VsPt","ele seed dr/dz 2nd layer positron vs pt",pt2D_nbin,0.,pt_max,50,-0.03,+0.03) ;
00433 
00434   // classes
00435   h1_ele_classes = bookH1withSumw2("classes","ele classes",20,0.0,20.,"class Id");
00436   h1_ele_eta = bookH1withSumw2("eta","ele electron eta",eta_nbin/2,0.0,eta_max);
00437   h1_ele_eta_golden = bookH1withSumw2("eta_golden","ele electron eta golden",eta_nbin/2,0.0,eta_max);
00438   h1_ele_eta_bbrem = bookH1withSumw2("eta_bbrem","ele electron eta bbrem",eta_nbin/2,0.0,eta_max);
00439   //h1_ele_eta_narrow = bookH1withSumw2("eta_narrow","ele electron eta narrow",eta_nbin/2,0.0,eta_max);
00440   h1_ele_eta_shower = bookH1withSumw2("eta_shower","ele electron eta showering",eta_nbin/2,0.0,eta_max);
00441   h2_ele_PinVsPoutGolden_mode = bookH2("PinVsPoutGolden_mode","ele track inner p vs outer p vs eta, golden, mode of GSF components" ,p2D_nbin,0.,p_max,50,0.,p_max);
00442   h2_ele_PinVsPoutShowering_mode = bookH2("PinVsPoutShowering_mode","ele track inner p vs outer p vs eta, showering, mode of GSF components" ,p2D_nbin,0.,p_max,50,0.,p_max);
00443   h2_ele_PinVsPoutGolden_mean = bookH2("PinVsPoutGolden_mean","ele track inner p vs outer p vs eta, golden, mean of GSF components" ,p2D_nbin,0.,p_max,50,0.,p_max);
00444   h2_ele_PinVsPoutShowering_mean = bookH2("PinVsPoutShowering_mean","ele track inner p vs outer p vs eta, showering, mean of GSF components" ,p2D_nbin,0.,p_max,50,0.,p_max);
00445   h2_ele_PtinVsPtoutGolden_mode = bookH2("PtinVsPtoutGolden_mode","ele track inner pt vs outer pt vs eta, golden, mode of GSF components" ,pt2D_nbin,0.,pt_max,50,0.,pt_max);
00446   h2_ele_PtinVsPtoutShowering_mode = bookH2("PtinVsPtoutShowering_mode","ele track inner pt vs outer pt vs eta, showering, mode of GSF components" ,pt2D_nbin,0.,pt_max,50,0.,pt_max);
00447   h2_ele_PtinVsPtoutGolden_mean = bookH2("PtinVsPtoutGolden_mean","ele track inner pt vs outer pt vs eta, golden, mean of GSF components" ,pt2D_nbin,0.,pt_max,50,0.,pt_max);
00448   h2_ele_PtinVsPtoutShowering_mean = bookH2("PtinVsPtoutShowering_mean","ele track inner pt vs outer pt vs eta, showering, mean of GSF components" ,pt2D_nbin,0.,pt_max,50,0.,pt_max);
00449   setBookPrefix("h_scl") ;
00450   h1_scl_EoEmatchingObjectGolden_barrel = bookH1withSumw2("EoEmatchingObject_golden_barrel","ele supercluster energy / gen energy, golden, barrel",popmatching_nbin,popmatching_min,popmatching_max);
00451   h1_scl_EoEmatchingObjectGolden_endcaps = bookH1withSumw2("EoEmatchingObject_golden_endcaps","ele supercluster energy / gen energy, golden, endcaps",popmatching_nbin,popmatching_min,popmatching_max);
00452   h1_scl_EoEmatchingObjectShowering_barrel = bookH1withSumw2("EoEmatchingObject_showering_barrel","ele supercluster energy / gen energy, showering, barrel",popmatching_nbin,popmatching_min,popmatching_max);
00453   h1_scl_EoEmatchingObjectShowering_endcaps = bookH1withSumw2("EoEmatchingObject_showering_endcaps","ele supercluster energy / gen energy, showering, endcaps",popmatching_nbin,popmatching_min,popmatching_max);
00454   setBookPrefix("h_ele") ;
00455 
00456   // isolation
00457   h1_ele_tkSumPt_dr03 = bookH1withSumw2("tkSumPt_dr03","tk isolation sum, dR=0.3",100,0.0,20.,"TkIsoSum, cone 0.3 (GeV/c)","Events","ELE_LOGY E1 P");
00458   h1_ele_tkSumPt_dr03_barrel = bookH1withSumw2("tkSumPt_dr03_barrel","tk isolation sum, dR=0.3, barrel",100,0.0,20.,"TkIsoSum, cone 0.3 (GeV/c)","Events","ELE_LOGY E1 P");
00459   h1_ele_tkSumPt_dr03_endcaps = bookH1withSumw2("tkSumPt_dr03_endcaps","tk isolation sum, dR=0.3, endcaps",100,0.0,20.,"TkIsoSum, cone 0.3 (GeV/c)","Events","ELE_LOGY E1 P");
00460   h1_ele_ecalRecHitSumEt_dr03 = bookH1withSumw2("ecalRecHitSumEt_dr03","ecal isolation sum, dR=0.3",100,0.0,20.,"EcalIsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00461   h1_ele_ecalRecHitSumEt_dr03_barrel = bookH1withSumw2("ecalRecHitSumEt_dr03_barrel","ecal isolation sum, dR=0.3, barrel",100,0.0,20.,"EcalIsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00462   h1_ele_ecalRecHitSumEt_dr03_endcaps = bookH1withSumw2("ecalRecHitSumEt_dr03_endcaps","ecal isolation sum, dR=0.3, endcaps",100,0.0,20.,"EcalIsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00463   h1_ele_hcalTowerSumEt_dr03_depth1 = bookH1withSumw2("hcalTowerSumEt_dr03_depth1","hcal depth1 isolation sum, dR=0.3",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00464   h1_ele_hcalTowerSumEt_dr03_depth1_barrel = bookH1withSumw2("hcalTowerSumEt_dr03_depth1_barrel","hcal depth1 isolation sum, dR=0.3, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00465   h1_ele_hcalTowerSumEt_dr03_depth1_endcaps = bookH1withSumw2("hcalTowerSumEt_dr03_depth1_endcaps","hcal depth1 isolation sum, dR=0.3, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00466   h1_ele_hcalTowerSumEt_dr03_depth2 = bookH1withSumw2("hcalTowerSumEt_dr03_depth2","hcal depth2 isolation sum, dR=0.3",100,0.0,20.,"Hcal2IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00467   h1_ele_tkSumPt_dr04 = bookH1withSumw2("tkSumPt_dr04","tk isolation sum, dR=0.4",100,0.0,20.,"TkIsoSum, cone 0.4 (GeV/c)","Events","ELE_LOGY E1 P");
00468   h1_ele_tkSumPt_dr04_barrel = bookH1withSumw2("tkSumPt_dr04_barrel","tk isolation sum, dR=0.4, barrel",100,0.0,20.,"TkIsoSum, cone 0.4 (GeV/c)","Events","ELE_LOGY E1 P");
00469   h1_ele_tkSumPt_dr04_endcaps = bookH1withSumw2("tkSumPt_dr04_endcaps","tk isolation sum, dR=0.4, endcaps",100,0.0,20.,"TkIsoSum, cone 0.4 (GeV/c)","Events","ELE_LOGY E1 P");
00470   h1_ele_ecalRecHitSumEt_dr04 = bookH1withSumw2("ecalRecHitSumEt_dr04","ecal isolation sum, dR=0.4",100,0.0,20.,"EcalIsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00471   h1_ele_ecalRecHitSumEt_dr04_barrel = bookH1withSumw2("ecalRecHitSumEt_dr04_barrel","ecal isolation sum, dR=0.4, barrel",100,0.0,20.,"EcalIsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00472   h1_ele_ecalRecHitSumEt_dr04_endcaps = bookH1withSumw2("ecalRecHitSumEt_dr04_endcaps","ecal isolation sum, dR=0.4, endcaps",100,0.0,20.,"EcalIsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00473   h1_ele_hcalTowerSumEt_dr04_depth1 = bookH1withSumw2("hcalTowerSumEt_dr04_depth1","hcal depth1 isolation sum, dR=0.4",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00474   h1_ele_hcalTowerSumEt_dr04_depth1_barrel = bookH1withSumw2("hcalTowerSumEt_dr04_depth1_barrel","hcal depth1 isolation sum, dR=0.4, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00475   h1_ele_hcalTowerSumEt_dr04_depth1_endcaps = bookH1withSumw2("hcalTowerSumEt_dr04_depth1_endcaps","hcal depth1 isolation sum, dR=0.4, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00476   h1_ele_hcalTowerSumEt_dr04_depth2 = bookH1withSumw2("hcalTowerSumEt_dr04_depth2","hcal depth2 isolation sum, dR=0.4",100,0.0,20.,"Hcal2IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00477 
00478   h1_ele_dIso_tkSumPt_dr03 = bookH1withSumw2("dIso_tkSumPt_dr03","diff with iso from deposits, tk isolation sum, dR=0.3",21,-10.0,10.,"TkIsoSum diff, cone 0.3 (GeV/c)","Events","ELE_LOGY E1 P");
00479   h1_ele_dIso_tkSumPt_dr04 = bookH1withSumw2("dIso_tkSumPt_dr04","diff with iso from deposits, tk isolation sum, dR=0.4",21,-10.0,10.,"TkIsoSum diff, cone 0.4 (GeV/c)","Events","ELE_LOGY E1 P");
00480   h1_ele_dIso_ecalFullRecHitSumEt_dr03 = bookH1withSumw2("dIso_ecalFullRecHitSumEt_dr03","diff with iso from deposits, ecal isolation sum, dR=0.3",21,-10.0,10.,"EcalIsoSum diff, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00481   h1_ele_dIso_ecalFullRecHitSumEt_dr04 = bookH1withSumw2("dIso_ecalFullRecHitSumEt_dr04","diff with iso from deposits, ecal isolation sum, dR=0.4",21,-10.0,10.,"EcalIsoSum diff, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00482   h1_ele_dIso_ecalReducedRecHitSumEt_dr03 = bookH1withSumw2("dIso_ecalReducedRecHitSumEt_dr03","diff with iso from deposits, ecal isolation sum, dR=0.3",21,-10.0,10.,"EcalIsoSum diff, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00483   h1_ele_dIso_ecalReducedRecHitSumEt_dr04 = bookH1withSumw2("dIso_ecalReducedRecHitSumEt_dr04","diff with iso from deposits, ecal isolation sum, dR=0.4",21,-10.0,10.,"EcalIsoSum diff, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00484   h1_ele_dIso_hcalTowerSumEt_dr03 = bookH1withSumw2("dIso_hcalTowerSumEt_dr03","diff with iso from deposits, hcal depth1 isolation sum, dR=0.3",21,-10.0,10.,"Hcal1IsoSum diff, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00485   h1_ele_dIso_hcalTowerSumEt_dr04 = bookH1withSumw2("dIso_hcalTowerSumEt_dr04","diff with iso from deposits, hcal depth1 isolation sum, dR=0.4",21,-10.0,10.,"Hcal1IsoSum diff, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00486 
00487   // fbrem
00488   h1_ele_fbrem = bookH1withSumw2("fbrem","ele brem fraction, mode of GSF components",100,0.,1.,"P_{in} - P_{out} / P_{in}");
00489   p1_ele_fbremVsEta_mode  = bookP1("fbremvsEtamode","mean ele brem fraction vs eta, mode of GSF components",eta2D_nbin,eta_min,eta_max,0.,1.,"#eta","<P_{in} - P_{out} / P_{in}>");
00490   p1_ele_fbremVsEta_mean  = bookP1("fbremvsEtamean","mean ele brem fraction vs eta, mean of GSF components",eta2D_nbin,eta_min,eta_max,0.,1.,"#eta","<P_{in} - P_{out} / P_{in}>");
00491 
00492   // e/g et pflow electrons
00493   h1_ele_mva = bookH1withSumw2("mva","ele identification mva",100,-1.,1.);
00494   h1_ele_provenance = bookH1withSumw2("provenance","ele provenance",5,-2.,3.);
00495 
00496   // conversion rejection information
00497   h1_ele_convFlags = bookH1withSumw2("convFlags","conversion rejection flag",5,-2.5,2.5);
00498   h1_ele_convFlags_all = bookH1withSumw2("convFlags_all","conversion rejection flag, all electrons",5,-2.5,2.5);
00499   h1_ele_convDist = bookH1withSumw2("convDist","distance to the conversion partner",100,-15.,15.);
00500   h1_ele_convDist_all = bookH1withSumw2("convDist_all","distance to the conversion partner, all electrons",100,-15.,15.);
00501   h1_ele_convDcot = bookH1withSumw2("convDcot","difference of cot(angle) with the conversion partner",100,-CLHEP::pi/2.,CLHEP::pi/2.);
00502   h1_ele_convDcot_all = bookH1withSumw2("convDcot_all","difference of cot(angle) with the conversion partner, all electrons",100,-CLHEP::pi/2.,CLHEP::pi/2.);
00503   h1_ele_convRadius = bookH1withSumw2("convRadius","signed conversion radius",100,0.,130.);
00504   h1_ele_convRadius_all = bookH1withSumw2("convRadius_all","signed conversion radius, all electrons",100,0.,130.);
00505 
00506  }
00507 
00508 ElectronMcFakeValidator::~ElectronMcFakeValidator()
00509  {}
00510 
00511 
00512 //=========================================================================
00513 // Main methods
00514 //=========================================================================
00515 
00516 void ElectronMcFakeValidator::analyze( const edm::Event & iEvent, const edm::EventSetup & iSetup )
00517  {
00518   // get reco electrons
00519   edm::Handle<reco::GsfElectronCollection> gsfElectrons;
00520   iEvent.getByLabel(electronCollection_,gsfElectrons);
00521   edm::Handle<GsfElectronCoreCollection> gsfElectronCores ;
00522   iEvent.getByLabel(electronCoreCollection_,gsfElectronCores) ;
00523   edm::Handle<GsfTrackCollection> gsfElectronTracks ;
00524   iEvent.getByLabel(electronTrackCollection_,gsfElectronTracks) ;
00525   edm::Handle<ElectronSeedCollection> gsfElectronSeeds ;
00526   iEvent.getByLabel(electronSeedCollection_,gsfElectronSeeds) ;
00527 
00528   edm::Handle<edm::ValueMap<double> > isoFromDepsTk03Handle          ;   iEvent.getByLabel( isoFromDepsTk03Tag_         , isoFromDepsTk03Handle          ) ;
00529   edm::Handle<edm::ValueMap<double> > isoFromDepsTk04Handle          ;   iEvent.getByLabel( isoFromDepsTk04Tag_         , isoFromDepsTk04Handle          ) ;
00530   edm::Handle<edm::ValueMap<double> > isoFromDepsEcalFull03Handle    ;   iEvent.getByLabel( isoFromDepsEcalFull03Tag_   , isoFromDepsEcalFull03Handle    ) ;
00531   edm::Handle<edm::ValueMap<double> > isoFromDepsEcalFull04Handle    ;   iEvent.getByLabel( isoFromDepsEcalFull04Tag_   , isoFromDepsEcalFull04Handle    ) ;
00532   edm::Handle<edm::ValueMap<double> > isoFromDepsEcalReduced03Handle ;   iEvent.getByLabel( isoFromDepsEcalReduced03Tag_, isoFromDepsEcalReduced03Handle ) ;
00533   edm::Handle<edm::ValueMap<double> > isoFromDepsEcalReduced04Handle ;   iEvent.getByLabel( isoFromDepsEcalReduced04Tag_, isoFromDepsEcalReduced04Handle ) ;
00534   edm::Handle<edm::ValueMap<double> > isoFromDepsHcal03Handle        ;   iEvent.getByLabel( isoFromDepsHcal03Tag_       , isoFromDepsHcal03Handle        ) ;
00535   edm::Handle<edm::ValueMap<double> > isoFromDepsHcal04Handle        ;   iEvent.getByLabel( isoFromDepsHcal04Tag_       , isoFromDepsHcal04Handle        ) ;
00536 
00537   // get gen jets
00538   edm::Handle<reco::GenJetCollection> genJets ;
00539   iEvent.getByLabel(matchingObjectCollection_,genJets);
00540 
00541   // get the beamspot from the Event:
00542   edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
00543   iEvent.getByLabel(beamSpotTag_,recoBeamSpotHandle);
00544   const BeamSpot bs = *recoBeamSpotHandle;
00545 
00546   edm::LogInfo("ElectronMcFakeValidator::analyze")
00547     <<"Treating event "<<iEvent.id()
00548     <<" with "<<gsfElectrons.product()->size()<<" electrons" ;
00549   h1_recEleNum_->Fill((*gsfElectrons).size());
00550   h1_recCoreNum_->Fill((*gsfElectronCores).size());
00551   h1_recTrackNum_->Fill((*gsfElectronTracks).size());
00552   h1_recSeedNum_->Fill((*gsfElectronSeeds).size());
00553 
00554   // all rec electrons
00555   reco::GsfElectronCollection::const_iterator gsfIter ;
00556   for
00557    ( gsfIter=gsfElectrons->begin() ;
00558      gsfIter!=gsfElectrons->end() ;
00559      gsfIter++ )
00560    {
00561     // preselect electrons
00562     if (gsfIter->pt()>maxPt_ || std::abs(gsfIter->eta())>maxAbsEta_)
00563      { continue ; }
00564 
00565     h1_ele_EoverP_all->Fill( gsfIter->eSuperClusterOverP() );
00566     h1_ele_EseedOP_all->Fill( gsfIter->eSeedClusterOverP() );
00567     h1_ele_EoPout_all->Fill( gsfIter->eSeedClusterOverPout() );
00568     h1_ele_EeleOPout_all->Fill( gsfIter->eEleClusterOverPout() );
00569     h1_ele_dEtaSc_propVtx_all->Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx());
00570     h1_ele_dPhiSc_propVtx_all->Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx());
00571     h1_ele_dEtaCl_propOut_all->Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo());
00572     h1_ele_dPhiCl_propOut_all->Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo());
00573     h1_ele_HoE_all->Fill( gsfIter->hadronicOverEm() );
00574     double d
00575      = gsfIter->vertex().x()*gsfIter->vertex().x()
00576      + gsfIter->vertex().y()*gsfIter->vertex().y() ;
00577     h1_ele_TIP_all->Fill( sqrt(d) );
00578     h1_ele_vertexEta_all->Fill( gsfIter->eta() );
00579     h1_ele_vertexPt_all->Fill( gsfIter->pt() );
00580     float enrj1=gsfIter->superCluster()->energy();
00581 
00582     // mee
00583     reco::GsfElectronCollection::const_iterator gsfIter2 ;
00584     for
00585      ( gsfIter2=gsfIter+1 ;
00586        gsfIter2!=gsfElectrons->end() ;
00587        gsfIter2++ )
00588      {
00589       math::XYZTLorentzVector p12 = (*gsfIter).p4()+(*gsfIter2).p4();
00590       float mee2 = p12.Dot(p12) ;
00591       h1_ele_mee_all->Fill(sqrt(mee2)) ;
00592       float enrj2=gsfIter2->superCluster()->energy();
00593       h2_ele_E2mnE1vsMee_all->Fill(sqrt(mee2),enrj2-enrj1);
00594       if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
00595        { h2_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2),enrj2-enrj1) ; }
00596       if (gsfIter->charge()*gsfIter2->charge()<0.)
00597        { h1_ele_mee_os->Fill(sqrt(mee2)) ; }
00598      }
00599 
00600     // conversion rejection
00601     int flags = gsfIter->convFlags() ;
00602     if (flags==-9999) { flags=-1 ; }
00603     h1_ele_convFlags_all->Fill(flags);
00604     if (flags>=0.)
00605      {
00606       h1_ele_convDist_all->Fill( gsfIter->convDist() );
00607       h1_ele_convDcot_all->Fill( gsfIter->convDcot() );
00608       h1_ele_convRadius_all->Fill( gsfIter->convRadius() );
00609      }
00610 
00611    }
00612 
00613   // association matching object-reco electrons
00614   int matchingObjectNum=0 ;
00615   reco::GenJetCollection::const_iterator moIter ;
00616   for
00617    ( moIter = genJets->begin() ;
00618      moIter != genJets->end() ; ++moIter )
00619    {
00620 
00621     // number of matching objects
00622     matchingObjectNum++ ;
00623 
00624     if (moIter->energy()/cosh(moIter->eta())> maxPt_ || std::abs(moIter->eta())> maxAbsEta_)
00625      { continue ; }
00626 
00627     // suppress the endcaps
00628     //if (std::abs(moIter->eta()) > 1.5) continue;
00629     // select central z
00630     //if ( std::abs((*mcIter)->production_vertex()->position().z())>50.) continue;
00631 
00632     h1_matchingObjectEta->Fill( moIter->eta() );
00633     h1_matchingObjectAbsEta->Fill( std::abs(moIter->eta()) );
00634     h1_matchingObjectP->Fill( moIter->energy() );
00635     h1_matchingObjectPt->Fill( moIter->energy()/cosh(moIter->eta()) );
00636     h1_matchingObjectPhi->Fill( moIter->phi() );
00637     h1_matchingObjectZ->Fill(  moIter->vz() );
00638 
00639     // looking for the best matching gsf electron
00640     bool okGsfFound = false;
00641     double gsfOkRatio = 999999.;
00642 
00643     // find best matched electron
00644     reco::GsfElectron bestGsfElectron ;
00645     reco::GsfElectronRef bestGsfElectronRef ;
00646     reco::GsfElectronCollection::const_iterator gsfIter ;
00647     reco::GsfElectronCollection::size_type iElectron ;
00648     for
00649      ( gsfIter=gsfElectrons->begin(), iElectron=0 ;
00650        gsfIter!=gsfElectrons->end() ; gsfIter++, iElectron++ )
00651      {
00652       double dphi = gsfIter->phi()-moIter->phi();
00653       if (std::abs(dphi)>CLHEP::pi)
00654        { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi; }
00655       double deltaR = sqrt(pow((gsfIter->eta()-moIter->eta()),2) + pow(dphi,2));
00656       if ( deltaR < deltaR_ )
00657        {
00658         //if ( (genPc->pdg_id() == 11) && (gsfIter->charge() < 0.) || (genPc->pdg_id() == -11) &&
00659         //(gsfIter->charge() > 0.) ){
00660         double tmpGsfRatio = gsfIter->p()/moIter->energy() ;
00661         if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) )
00662          {
00663           gsfOkRatio = tmpGsfRatio ;
00664           bestGsfElectronRef = reco::GsfElectronRef(gsfElectrons,iElectron) ;
00665           bestGsfElectron = *gsfIter ;
00666           okGsfFound = true ;
00667          }
00668         //}
00669        }
00670      } // loop over rec ele to look for the best one
00671 
00672     // analysis when the matching object is matched by a rec electron
00673     if (okGsfFound)
00674      {
00675       // electron related distributions
00676       h1_ele_charge->Fill( bestGsfElectron.charge() );
00677       h2_ele_chargeVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.charge() );
00678       h2_ele_chargeVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.charge() );
00679       h2_ele_chargeVsPt->Fill( bestGsfElectron.pt(),bestGsfElectron.charge() );
00680       h1_ele_vertexP->Fill( bestGsfElectron.p() );
00681       h1_ele_vertexPt->Fill( bestGsfElectron.pt() );
00682       h2_ele_vertexPtVsEta->Fill(  bestGsfElectron.eta(),bestGsfElectron.pt() );
00683       h2_ele_vertexPtVsPhi->Fill(  bestGsfElectron.phi(),bestGsfElectron.pt() );
00684       h1_ele_vertexEta->Fill( bestGsfElectron.eta() );
00685       // generated distributions for matched electrons
00686       h1_ele_matchingObjectPt_matched->Fill( moIter->energy()/cosh(moIter->eta()) );
00687       h1_ele_matchingObjectPhi_matched->Fill( moIter->phi() );
00688       h1_ele_matchingObjectAbsEta_matched->Fill( std::abs(moIter->eta()) );
00689       h1_ele_matchingObjectEta_matched->Fill( moIter->eta() );
00690       h2_ele_vertexEtaVsPhi->Fill(  bestGsfElectron.phi(),bestGsfElectron.eta() );
00691       h1_ele_vertexPhi->Fill( bestGsfElectron.phi() );
00692       h1_ele_vertexX->Fill( bestGsfElectron.vertex().x() );
00693       h1_ele_vertexY->Fill( bestGsfElectron.vertex().y() );
00694       h1_ele_vertexZ->Fill( bestGsfElectron.vertex().z() );
00695       h1_ele_matchingObjectZ_matched->Fill( moIter->vz() );
00696       double d
00697        =   (bestGsfElectron.vertex().x()-bs.position().x())
00698          * (bestGsfElectron.vertex().x()-bs.position().x())
00699        +   (bestGsfElectron.vertex().y()-bs.position().y())
00700          *(bestGsfElectron.vertex().y()-bs.position().y()) ;
00701       d = sqrt(d) ;
00702       h1_ele_vertexTIP->Fill( d );
00703       h2_ele_vertexTIPVsEta->Fill(  bestGsfElectron.eta(), d );
00704       h2_ele_vertexTIPVsPhi->Fill(  bestGsfElectron.phi(), d );
00705       h2_ele_vertexTIPVsPt->Fill(  bestGsfElectron.pt(), d );
00706       h1_ele_EtaMnEtamatchingObject->Fill( bestGsfElectron.eta()-moIter->eta());
00707       h2_ele_EtaMnEtamatchingObjectVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eta()-moIter->eta());
00708       h2_ele_EtaMnEtamatchingObjectVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eta()-moIter->eta());
00709       h2_ele_EtaMnEtamatchingObjectVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.eta()-moIter->eta());
00710       h1_ele_PhiMnPhimatchingObject->Fill( bestGsfElectron.phi()-moIter->phi());
00711       h1_ele_PhiMnPhimatchingObject2->Fill( bestGsfElectron.phi()-moIter->phi());
00712       h2_ele_PhiMnPhimatchingObjectVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.phi()-moIter->phi());
00713       h2_ele_PhiMnPhimatchingObjectVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.phi()-moIter->phi());
00714       h2_ele_PhiMnPhimatchingObjectVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.phi()-moIter->phi());
00715       h1_ele_PoPmatchingObject->Fill( bestGsfElectron.p()/moIter->energy());
00716       h2_ele_PoPmatchingObjectVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.p()/moIter->energy());
00717       h2_ele_PoPmatchingObjectVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.p()/moIter->energy());
00718       h2_ele_PoPmatchingObjectVsPt->Fill( bestGsfElectron.py(), bestGsfElectron.p()/moIter->energy());
00719       if (bestGsfElectron.isEB()) h1_ele_PoPmatchingObject_barrel->Fill( bestGsfElectron.p()/moIter->energy()) ;
00720       if (bestGsfElectron.isEE()) h1_ele_PoPmatchingObject_endcaps->Fill( bestGsfElectron.p()/moIter->energy()) ;
00721 
00722       // supercluster related distributions
00723       reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
00724       if (!bestGsfElectron.ecalDrivenSeed()&&bestGsfElectron.trackerDrivenSeed()) sclRef = bestGsfElectron.pflowSuperCluster();
00725       h1_scl_En_->Fill(sclRef->energy());
00726       double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
00727       double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
00728       h1_scl_Et_->Fill(sclRef->energy()*(Rt/R));
00729       h2_scl_EtVsEta_->Fill(sclRef->eta(),sclRef->energy()*(Rt/R));
00730       h2_scl_EtVsPhi_->Fill(sclRef->phi(),sclRef->energy()*(Rt/R));
00731       if (bestGsfElectron.classification() < 100)  h1_scl_EoEmatchingObject_barrel->Fill(sclRef->energy()/moIter->energy());
00732       if (bestGsfElectron.classification() >= 100)  h1_scl_EoEmatchingObject_endcaps->Fill(sclRef->energy()/moIter->energy());
00733       h1_scl_Eta_->Fill(sclRef->eta());
00734       h2_scl_EtaVsPhi_->Fill(sclRef->phi(),sclRef->eta());
00735       h1_scl_Phi_->Fill(sclRef->phi());
00736       h1_scl_SigIEtaIEta_->Fill(bestGsfElectron.scSigmaIEtaIEta());
00737       if (bestGsfElectron.isEB()) h1_scl_SigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
00738       if (bestGsfElectron.isEE()) h1_scl_SigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
00739       h1_scl_E1x5_->Fill(bestGsfElectron.scE1x5());
00740       if (bestGsfElectron.isEB()) h1_scl_E1x5_barrel_->Fill(bestGsfElectron.scE1x5());
00741       if (bestGsfElectron.isEE()) h1_scl_E1x5_endcaps_->Fill(bestGsfElectron.scE1x5());
00742       h1_scl_E2x5max_->Fill(bestGsfElectron.scE2x5Max());
00743       if (bestGsfElectron.isEB()) h1_scl_E2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max());
00744       if (bestGsfElectron.isEE()) h1_scl_E2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max());
00745       h1_scl_E5x5_->Fill(bestGsfElectron.scE5x5());
00746       if (bestGsfElectron.isEB()) h1_scl_E5x5_barrel_->Fill(bestGsfElectron.scE5x5());
00747       if (bestGsfElectron.isEE()) h1_scl_E5x5_endcaps_->Fill(bestGsfElectron.scE5x5());
00748 
00749       // track related distributions
00750       h1_ele_ambiguousTracks->Fill( bestGsfElectron.ambiguousGsfTracksSize() );
00751       h2_ele_ambiguousTracksVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize() );
00752       h2_ele_ambiguousTracksVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize() );
00753       h2_ele_ambiguousTracksVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize() );
00754       if (!readAOD_)
00755        { // track extra does not exist in AOD
00756         h1_ele_foundHits->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
00757         h2_ele_foundHitsVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
00758         h2_ele_foundHitsVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
00759         h2_ele_foundHitsVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
00760         h1_ele_lostHits->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
00761         h2_ele_lostHitsVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
00762         h2_ele_lostHitsVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
00763         h2_ele_lostHitsVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
00764         h1_ele_chi2->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
00765         h2_ele_chi2VsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2() );
00766         h2_ele_chi2VsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2() );
00767         h2_ele_chi2VsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2() );
00768        }
00769       // from gsf track interface, hence using mean
00770       if (!readAOD_)
00771        { // track extra does not exist in AOD
00772         h1_ele_PinMnPout->Fill( bestGsfElectron.gsfTrack()->innerMomentum().R() - bestGsfElectron.gsfTrack()->outerMomentum().R() );
00773         h1_ele_outerP->Fill( bestGsfElectron.gsfTrack()->outerMomentum().R() );
00774         h1_ele_outerPt->Fill( bestGsfElectron.gsfTrack()->outerMomentum().Rho() );
00775        }
00776       // from electron interface, hence using mode
00777       h1_ele_PinMnPout_mode->Fill( bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
00778       h2_ele_PinMnPoutVsEta_mode->Fill(  bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
00779       h2_ele_PinMnPoutVsPhi_mode->Fill(  bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
00780       h2_ele_PinMnPoutVsPt_mode->Fill(  bestGsfElectron.pt(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
00781       h2_ele_PinMnPoutVsE_mode->Fill(  bestGsfElectron.caloEnergy(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
00782       if (!readAOD_)  // track extra does not exist in AOD
00783        h2_ele_PinMnPoutVsChi2_mode->Fill
00784         ( bestGsfElectron.gsfTrack()->normalizedChi2(),
00785           bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() ) ;
00786       h1_ele_outerP_mode->Fill( bestGsfElectron.trackMomentumOut().R() );
00787       h2_ele_outerPVsEta_mode->Fill(bestGsfElectron.eta(),  bestGsfElectron.trackMomentumOut().R() );
00788       h1_ele_outerPt_mode->Fill( bestGsfElectron.trackMomentumOut().Rho() );
00789       h2_ele_outerPtVsEta_mode->Fill(bestGsfElectron.eta(),  bestGsfElectron.trackMomentumOut().Rho() );
00790       h2_ele_outerPtVsPhi_mode->Fill(bestGsfElectron.phi(),  bestGsfElectron.trackMomentumOut().Rho() );
00791       h2_ele_outerPtVsPt_mode->Fill(bestGsfElectron.pt(),  bestGsfElectron.trackMomentumOut().Rho() );
00792 
00793       if (!readAOD_)
00794        { // track extra does not exist in AOD
00795         edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
00796         ElectronSeedRef elseed=seed.castTo<ElectronSeedRef>();
00797         h1_ele_seed_subdet2_->Fill(elseed->subDet2());
00798         h1_ele_seed_mask_->Fill(elseed->hitsMask());
00799         if (elseed->subDet2()==1)
00800          { h1_ele_seed_mask_bpix_->Fill(elseed->hitsMask()); }
00801         else if (elseed->subDet2()==2)
00802          { h1_ele_seed_mask_fpix_->Fill(elseed->hitsMask()); }
00803         else if (elseed->subDet2()==6)
00804          { h1_ele_seed_mask_tec_->Fill(elseed->hitsMask()); }
00805         h1_ele_seed_dphi2_->Fill(elseed->dPhi2());
00806         h2_ele_seed_dphi2VsEta_->Fill(bestGsfElectron.eta(), elseed->dPhi2());
00807         h2_ele_seed_dphi2VsPt_->Fill(bestGsfElectron.pt(), elseed->dPhi2()) ;
00808         h1_ele_seed_dphi2pos_->Fill(elseed->dPhi2Pos());
00809         h2_ele_seed_dphi2posVsEta_->Fill(bestGsfElectron.eta(), elseed->dPhi2Pos());
00810         h2_ele_seed_dphi2posVsPt_->Fill(bestGsfElectron.pt(), elseed->dPhi2Pos());
00811         h1_ele_seed_drz2_->Fill(elseed->dRz2());
00812         h2_ele_seed_drz2VsEta_->Fill(bestGsfElectron.eta(), elseed->dRz2());
00813         h2_ele_seed_drz2VsPt_->Fill(bestGsfElectron.pt(), elseed->dRz2());
00814         h1_ele_seed_drz2pos_->Fill(elseed->dRz2Pos());
00815         h2_ele_seed_drz2posVsEta_->Fill(bestGsfElectron.eta(), elseed->dRz2Pos());
00816         h2_ele_seed_drz2posVsPt_->Fill(bestGsfElectron.pt(), elseed->dRz2Pos());
00817        }
00818       // match distributions
00819       h1_ele_EoP->Fill( bestGsfElectron.eSuperClusterOverP() );
00820       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg->Fill( bestGsfElectron.eSuperClusterOverP() );
00821       if (bestGsfElectron.isEB()) h1_ele_EoP_barrel->Fill( bestGsfElectron.eSuperClusterOverP() );
00822       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg_barrel->Fill( bestGsfElectron.eSuperClusterOverP() );
00823       if (bestGsfElectron.isEE()) h1_ele_EoP_endcaps->Fill( bestGsfElectron.eSuperClusterOverP() );
00824       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg_endcaps->Fill( bestGsfElectron.eSuperClusterOverP() );
00825       h2_ele_EoPVsEta->Fill(bestGsfElectron.eta(),  bestGsfElectron.eSuperClusterOverP() );
00826       h2_ele_EoPVsPhi->Fill(bestGsfElectron.phi(),  bestGsfElectron.eSuperClusterOverP() );
00827       h2_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(),  bestGsfElectron.eSuperClusterOverP() );
00828       h1_ele_EseedOP->Fill( bestGsfElectron.eSeedClusterOverP() );
00829       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg->Fill( bestGsfElectron.eSeedClusterOverP() );
00830       if (bestGsfElectron.isEB()) h1_ele_EseedOP_barrel->Fill( bestGsfElectron.eSeedClusterOverP() );
00831       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg_barrel->Fill( bestGsfElectron.eSeedClusterOverP() );
00832       if (bestGsfElectron.isEE()) h1_ele_EseedOP_endcaps->Fill( bestGsfElectron.eSeedClusterOverP() );
00833       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg_endcaps->Fill( bestGsfElectron.eSeedClusterOverP() );
00834       h2_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(),  bestGsfElectron.eSeedClusterOverP() );
00835       h2_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(),  bestGsfElectron.eSeedClusterOverP() );
00836       h2_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(),  bestGsfElectron.eSeedClusterOverP() );
00837       h1_ele_EoPout->Fill( bestGsfElectron.eSeedClusterOverPout() );
00838       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg->Fill( bestGsfElectron.eSeedClusterOverPout() );
00839       if (bestGsfElectron.isEB()) h1_ele_EoPout_barrel->Fill( bestGsfElectron.eSeedClusterOverPout() );
00840       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg_barrel->Fill( bestGsfElectron.eSeedClusterOverPout() );
00841       if (bestGsfElectron.isEE()) h1_ele_EoPout_endcaps->Fill( bestGsfElectron.eSeedClusterOverPout() );
00842       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg_endcaps->Fill( bestGsfElectron.eSeedClusterOverPout() );
00843       h2_ele_EoPoutVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout() );
00844       h2_ele_EoPoutVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout() );
00845       h2_ele_EoPoutVsE->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout() );
00846       h1_ele_EeleOPout->Fill( bestGsfElectron.eEleClusterOverPout() );
00847       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg->Fill( bestGsfElectron.eEleClusterOverPout() );
00848       if (bestGsfElectron.isEB()) h1_ele_EeleOPout_barrel->Fill( bestGsfElectron.eEleClusterOverPout() );
00849       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg_barrel->Fill( bestGsfElectron.eEleClusterOverPout() );
00850       if (bestGsfElectron.isEE()) h1_ele_EeleOPout_endcaps->Fill( bestGsfElectron.eEleClusterOverPout() );
00851       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg_endcaps->Fill( bestGsfElectron.eEleClusterOverPout() );
00852       h2_ele_EeleOPoutVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout() );
00853       h2_ele_EeleOPoutVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout() );
00854       h2_ele_EeleOPoutVsE->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout() );
00855       h1_ele_dEtaSc_propVtx->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
00856       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
00857       if (bestGsfElectron.isEB()) h1_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
00858       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
00859       if (bestGsfElectron.isEE())h1_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
00860       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
00861       h2_ele_dEtaScVsEta_propVtx->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
00862       h2_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
00863       h2_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
00864       h1_ele_dPhiSc_propVtx->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
00865       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
00866       if (bestGsfElectron.isEB()) h1_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
00867       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
00868       if (bestGsfElectron.isEE())h1_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
00869       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
00870       h2_ele_dPhiScVsEta_propVtx->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
00871       h2_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
00872       h2_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
00873       h1_ele_dEtaCl_propOut->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
00874       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
00875       if (bestGsfElectron.isEB()) h1_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
00876       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
00877       if (bestGsfElectron.isEE()) h1_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
00878       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
00879       h2_ele_dEtaClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
00880       h2_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
00881       h2_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
00882       h1_ele_dPhiCl_propOut->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
00883       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
00884       if (bestGsfElectron.isEB()) h1_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
00885       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
00886       if (bestGsfElectron.isEE()) h1_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
00887       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
00888       h2_ele_dPhiClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
00889       h2_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
00890       h2_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
00891       h1_ele_dEtaEleCl_propOut->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
00892       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
00893       if (bestGsfElectron.isEB()) h1_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
00894       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
00895       if (bestGsfElectron.isEE()) h1_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
00896       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
00897       h2_ele_dEtaEleClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
00898       h2_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
00899       h2_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
00900       h1_ele_dPhiEleCl_propOut->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
00901       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
00902       if (bestGsfElectron.isEB()) h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
00903       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
00904       if (bestGsfElectron.isEE()) h1_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
00905       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
00906       h2_ele_dPhiEleClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
00907       h2_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
00908       h2_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
00909       h1_ele_HoE->Fill(bestGsfElectron.hadronicOverEm());
00910       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg->Fill(bestGsfElectron.hadronicOverEm());
00911       if (bestGsfElectron.isEB()) h1_ele_HoE_barrel->Fill(bestGsfElectron.hadronicOverEm());
00912       if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg_barrel->Fill(bestGsfElectron.hadronicOverEm());
00913       if (bestGsfElectron.isEE()) h1_ele_HoE_endcaps->Fill(bestGsfElectron.hadronicOverEm());
00914       if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg_endcaps->Fill(bestGsfElectron.hadronicOverEm());
00915       if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap()&& !bestGsfElectron.isEBEEGap() &&
00916           !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap()) h1_ele_HoE_fiducial->Fill(bestGsfElectron.hadronicOverEm());
00917       h2_ele_HoEVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.hadronicOverEm());
00918       h2_ele_HoEVsPhi->Fill(bestGsfElectron.phi(),bestGsfElectron.hadronicOverEm());
00919       h2_ele_HoEVsE->Fill(bestGsfElectron.caloEnergy(),bestGsfElectron.hadronicOverEm());
00920 
00921       //classes
00922       int eleClass = bestGsfElectron.classification();
00923       if (bestGsfElectron.isEE()) eleClass+=10;
00924       h1_ele_classes->Fill(eleClass);
00925 
00926       h1_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
00927       if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_eta_golden->Fill(std::abs(bestGsfElectron.eta()));
00928       if (bestGsfElectron.classification() == GsfElectron::BIGBREM) h1_ele_eta_bbrem->Fill(std::abs(bestGsfElectron.eta()));
00929       //if (bestGsfElectron.classification() == GsfElectron::OLDNARROW) h1_ele_eta_narrow->Fill(std::abs(bestGsfElectron.eta()));
00930       if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_eta_shower->Fill(std::abs(bestGsfElectron.eta()));
00931 
00932       //fbrem
00933       double fbrem_mean=0.;
00934       if (!readAOD_) // track extra does not exist in AOD
00935         fbrem_mean =  1. - bestGsfElectron.gsfTrack()->outerMomentum().R()/bestGsfElectron.gsfTrack()->innerMomentum().R();
00936       double fbrem_mode =  bestGsfElectron.fbrem();
00937       h1_ele_fbrem->Fill(fbrem_mode);
00938       p1_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(),fbrem_mode);
00939       if (!readAOD_) // track extra does not exist in AOD
00940         p1_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(),fbrem_mean);
00941 
00942       if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
00943       if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
00944         h2_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
00945       if (!readAOD_) // track extra does not exist in AOD
00946         if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
00947           h2_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
00948       if (!readAOD_) // track extra does not exist in AOD
00949         if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
00950           h2_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
00951       if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
00952         h2_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
00953       if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
00954         h2_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
00955       if (!readAOD_) // track extra does not exist in AOD
00956         if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
00957           h2_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
00958       if (!readAOD_) // track extra does not exist in AOD
00959         if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
00960           h2_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
00961 
00962       h1_ele_mva->Fill(bestGsfElectron.mva());
00963       if (bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(1.);
00964       if (bestGsfElectron.trackerDrivenSeed()) h1_ele_provenance->Fill(-1.);
00965       if (bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(0.);
00966       if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(-2.);
00967       if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(2.);
00968 
00969       // isolation
00970       h1_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
00971       if (bestGsfElectron.isEB()) h1_ele_tkSumPt_dr03_barrel->Fill(bestGsfElectron.dr03TkSumPt());
00972       if (bestGsfElectron.isEE()) h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt());
00973       h1_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
00974       if (bestGsfElectron.isEB()) h1_ele_ecalRecHitSumEt_dr03_barrel->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
00975       if (bestGsfElectron.isEE()) h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
00976       h1_ele_hcalTowerSumEt_dr03_depth1->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
00977       if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
00978       if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
00979       h1_ele_hcalTowerSumEt_dr03_depth2->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
00980       h1_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
00981       if (bestGsfElectron.isEB()) h1_ele_tkSumPt_dr04_barrel->Fill(bestGsfElectron.dr04TkSumPt());
00982       if (bestGsfElectron.isEE()) h1_ele_tkSumPt_dr04_endcaps->Fill(bestGsfElectron.dr04TkSumPt());
00983       h1_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
00984       if (bestGsfElectron.isEB()) h1_ele_ecalRecHitSumEt_dr04_barrel->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
00985       if (bestGsfElectron.isEE()) h1_ele_ecalRecHitSumEt_dr04_endcaps->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
00986       h1_ele_hcalTowerSumEt_dr04_depth1->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
00987       if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
00988       if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
00989       h1_ele_hcalTowerSumEt_dr04_depth2->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
00990 
00991 
00992       // isolation : difference with iso deposits
00993       if ( isoFromDepsTk03Handle.isValid() )
00994         h1_ele_dIso_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt()-((*isoFromDepsTk03Handle)[bestGsfElectronRef])) ;
00995       if ( isoFromDepsTk04Handle.isValid() )
00996         h1_ele_dIso_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt()-((*isoFromDepsTk04Handle)[bestGsfElectronRef])) ;
00997       if ( isoFromDepsEcalFull03Handle.isValid() )
00998         h1_ele_dIso_ecalFullRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt()-((*isoFromDepsEcalFull03Handle)[bestGsfElectronRef])) ;
00999       if ( isoFromDepsEcalFull04Handle.isValid() )
01000       h1_ele_dIso_ecalFullRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt()-((*isoFromDepsEcalFull04Handle)[bestGsfElectronRef])) ;
01001       if ( isoFromDepsEcalReduced03Handle.isValid())
01002         h1_ele_dIso_ecalReducedRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt()-((*isoFromDepsEcalReduced03Handle)[bestGsfElectronRef])) ;
01003       if ( isoFromDepsEcalReduced04Handle.isValid())
01004         h1_ele_dIso_ecalReducedRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt()-((*isoFromDepsEcalReduced04Handle)[bestGsfElectronRef])) ;
01005       if ( isoFromDepsHcal03Handle.isValid())
01006         h1_ele_dIso_hcalTowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalTowerSumEt()-((*isoFromDepsHcal03Handle)[bestGsfElectronRef])) ;
01007       if ( isoFromDepsHcal04Handle.isValid())
01008         h1_ele_dIso_hcalTowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalTowerSumEt()-((*isoFromDepsHcal04Handle)[bestGsfElectronRef])) ;
01009 
01010       // conversion rejection
01011       int flags = bestGsfElectron.convFlags() ;
01012       if (flags==-9999) { flags=-1 ; }
01013       h1_ele_convFlags->Fill(flags);
01014       if (flags>=0.)
01015        {
01016         h1_ele_convDist->Fill( bestGsfElectron.convDist() );
01017         h1_ele_convDcot->Fill( bestGsfElectron.convDcot() );
01018         h1_ele_convRadius->Fill( bestGsfElectron.convRadius() );
01019        }
01020 
01021      } // gsf electron found
01022 
01023 //    } // matching object found
01024 
01025 //    }
01026 
01027    } // loop overmatching object
01028 
01029   h1_matchingObjectNum->Fill(matchingObjectNum) ;
01030 
01031  }
01032 
01033