CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc

Go to the documentation of this file.
00001 
00002 // user include files
00003 #include "Validation/RecoEgamma/plugins/ElectronMcSignalValidator.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/HepMCCandidate/interface/GenParticle.h"
00019 #include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h"
00020 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00021 
00022 #include "DataFormats/Common/interface/Handle.h"
00023 #include "DataFormats/Common/interface/ValueMap.h"
00024 
00025 #include "FWCore/ServiceRegistry/interface/Service.h"
00026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00027 #include "FWCore/Framework/interface/EDAnalyzer.h"
00028 #include "FWCore/Framework/interface/Event.h"
00029 #include "FWCore/Framework/interface/MakerMacros.h"
00030 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00031 
00032 #include "CLHEP/Units/GlobalPhysicalConstants.h"
00033 #include "TMath.h"
00034 #include "TFile.h"
00035 #include "TH1F.h"
00036 #include "TH1I.h"
00037 #include "TH2F.h"
00038 #include "TProfile.h"
00039 #include "TTree.h"
00040 #include <vector>
00041 #include <iostream>
00042 
00043 using namespace reco;
00044 
00045 ElectronMcSignalValidator::ElectronMcSignalValidator( const edm::ParameterSet & conf )
00046  : ElectronDqmAnalyzerBase(conf)
00047  {
00048   //outputFile_ = conf.getParameter<std::string>("outputFile");
00049   mcTruthCollection_ = conf.getParameter<edm::InputTag>("mcTruthCollection");
00050   electronCollection_ = conf.getParameter<edm::InputTag>("electronCollection");
00051   electronCoreCollection_ = conf.getParameter<edm::InputTag>("electronCoreCollection");
00052   electronTrackCollection_ = conf.getParameter<edm::InputTag>("electronTrackCollection");
00053   electronSeedCollection_ = conf.getParameter<edm::InputTag>("electronSeedCollection");
00054 
00055   beamSpotTag_ = conf.getParameter<edm::InputTag>("beamSpot") ;
00056   readAOD_ = conf.getParameter<bool>("readAOD");
00057 
00058   isoFromDepsTk03Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsTk03" ) ;
00059   isoFromDepsTk04Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsTk04" ) ;
00060   isoFromDepsEcalFull03Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsEcalFull03" ) ;
00061   isoFromDepsEcalFull04Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsEcalFull04" ) ;
00062   isoFromDepsEcalReduced03Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsEcalReduced03" ) ;
00063   isoFromDepsEcalReduced04Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsEcalReduced04" ) ;
00064   isoFromDepsHcal03Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsHcal03" ) ;
00065   isoFromDepsHcal04Tag_ = conf.getParameter<edm::InputTag>( "isoFromDepsHcal04" ) ;
00066 
00067   maxPt_ = conf.getParameter<double>("MaxPt");
00068   maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
00069   deltaR_ = conf.getParameter<double>("DeltaR");
00070   matchingIDs_ = conf.getParameter<std::vector<int> >("MatchingID");
00071   matchingMotherIDs_ = conf.getParameter<std::vector<int> >("MatchingMotherID");
00072 
00073   // histos bining and limits
00074 
00075   edm::ParameterSet histosSet = conf.getParameter<edm::ParameterSet>("histosCfg") ;
00076 
00077   xyz_nbin=histosSet.getParameter<int>("Nbinxyz");
00078 
00079   p_nbin=histosSet.getParameter<int>("Nbinp");
00080   p2D_nbin=histosSet.getParameter<int>("Nbinp2D");
00081   p_max=histosSet.getParameter<double>("Pmax");
00082 
00083   pt_nbin=histosSet.getParameter<int>("Nbinpt");
00084   pt2D_nbin=histosSet.getParameter<int>("Nbinpt2D");
00085   pteff_nbin=histosSet.getParameter<int>("Nbinpteff");
00086   pt_max=histosSet.getParameter<double>("Ptmax");
00087 
00088   fhits_nbin=histosSet.getParameter<int>("Nbinfhits");
00089   fhits_max=histosSet.getParameter<double>("Fhitsmax");
00090 
00091   lhits_nbin=histosSet.getParameter<int>("Nbinlhits");
00092   lhits_max=histosSet.getParameter<double>("Lhitsmax");
00093 
00094   eop_nbin=histosSet.getParameter<int>("Nbineop");
00095   eop2D_nbin=histosSet.getParameter<int>("Nbineop2D");
00096   eop_max=histosSet.getParameter<double>("Eopmax");
00097   eopmaxsht=histosSet.getParameter<double>("Eopmaxsht");
00098 
00099   eta_nbin=histosSet.getParameter<int>("Nbineta");
00100   eta2D_nbin=histosSet.getParameter<int>("Nbineta2D");
00101   eta_min=histosSet.getParameter<double>("Etamin");
00102   eta_max=histosSet.getParameter<double>("Etamax");
00103 
00104   deta_nbin=histosSet.getParameter<int>("Nbindeta");
00105   deta_min=histosSet.getParameter<double>("Detamin");
00106   deta_max=histosSet.getParameter<double>("Detamax");
00107 
00108   phi_nbin=histosSet.getParameter<int>("Nbinphi");
00109   phi2D_nbin=histosSet.getParameter<int>("Nbinphi2D");
00110   phi_min=histosSet.getParameter<double>("Phimin");
00111   phi_max=histosSet.getParameter<double>("Phimax");
00112 
00113   detamatch_nbin=histosSet.getParameter<int>("Nbindetamatch");
00114   detamatch2D_nbin=histosSet.getParameter<int>("Nbindetamatch2D");
00115   detamatch_min=histosSet.getParameter<double>("Detamatchmin");
00116   detamatch_max=histosSet.getParameter<double>("Detamatchmax");
00117 
00118   dphi_nbin=histosSet.getParameter<int>("Nbindphi");
00119   dphi_min=histosSet.getParameter<double>("Dphimin");
00120   dphi_max=histosSet.getParameter<double>("Dphimax");
00121 
00122   dphimatch_nbin=histosSet.getParameter<int>("Nbindphimatch");
00123   dphimatch2D_nbin=histosSet.getParameter<int>("Nbindphimatch2D");
00124   dphimatch_min=histosSet.getParameter<double>("Dphimatchmin");
00125   dphimatch_max=histosSet.getParameter<double>("Dphimatchmax");
00126 
00127   poptrue_nbin= histosSet.getParameter<int>("Nbinpoptrue");
00128   poptrue_min=histosSet.getParameter<double>("Poptruemin");
00129   poptrue_max=histosSet.getParameter<double>("Poptruemax");
00130 
00131   mee_nbin= histosSet.getParameter<int>("Nbinmee");
00132   mee_min=histosSet.getParameter<double>("Meemin");
00133   mee_max=histosSet.getParameter<double>("Meemax");
00134 
00135   hoe_nbin= histosSet.getParameter<int>("Nbinhoe");
00136   hoe_min=histosSet.getParameter<double>("Hoemin");
00137   hoe_max=histosSet.getParameter<double>("Hoemax");
00138 
00139   // so to please coverity...
00140   h1_mcNum = 0 ;
00141   h1_eleNum = 0 ;
00142   h1_gamNum = 0 ;
00143 
00144   h1_recEleNum = 0 ;
00145   h1_recCoreNum = 0 ;
00146   h1_recTrackNum = 0 ;
00147   h1_recSeedNum = 0 ;
00148 
00149   h1_mc_Eta = 0 ;
00150   h1_mc_AbsEta = 0 ;
00151   h1_mc_P = 0 ;
00152   h1_mc_Pt = 0 ;
00153   h1_mc_Phi = 0 ;
00154   h1_mc_Z = 0 ;
00155   h2_mc_PtEta = 0 ;
00156 
00157   h1_mc_Eta_matched = 0 ;
00158   h1_mc_AbsEta_matched = 0 ;
00159   h1_mc_Pt_matched = 0 ;
00160   h1_mc_Phi_matched = 0 ;
00161   h1_mc_Z_matched = 0 ;
00162   h2_mc_PtEta_matched = 0 ;
00163 
00164   h1_mc_Eta_matched_qmisid = 0 ;
00165   h1_mc_AbsEta_matched_qmisid = 0 ;
00166   h1_mc_Pt_matched_qmisid = 0 ;
00167   h1_mc_Phi_matched_qmisid = 0 ;
00168   h1_mc_Z_matched_qmisid = 0 ;
00169 
00170   h1_ele_EoverP_all = 0 ;
00171   h1_ele_EoverP_all_barrel = 0 ;
00172   h1_ele_EoverP_all_endcaps = 0 ;
00173   h1_ele_EseedOP_all = 0 ;
00174   h1_ele_EseedOP_all_barrel = 0 ;
00175   h1_ele_EseedOP_all_endcaps = 0 ;
00176   h1_ele_EoPout_all = 0 ;
00177   h1_ele_EoPout_all_barrel = 0 ;
00178   h1_ele_EoPout_all_endcaps = 0 ;
00179   h1_ele_EeleOPout_all = 0 ;
00180   h1_ele_EeleOPout_all_barrel = 0 ;
00181   h1_ele_EeleOPout_all_endcaps = 0 ;
00182   h1_ele_dEtaSc_propVtx_all = 0 ;
00183   h1_ele_dEtaSc_propVtx_all_barrel = 0 ;
00184   h1_ele_dEtaSc_propVtx_all_endcaps = 0 ;
00185   h1_ele_dPhiSc_propVtx_all = 0 ;
00186   h1_ele_dPhiSc_propVtx_all_barrel = 0 ;
00187   h1_ele_dPhiSc_propVtx_all_endcaps = 0 ;
00188   h1_ele_dEtaCl_propOut_all = 0 ;
00189   h1_ele_dEtaCl_propOut_all_barrel = 0 ;
00190   h1_ele_dEtaCl_propOut_all_endcaps = 0 ;
00191   h1_ele_dPhiCl_propOut_all = 0 ;
00192   h1_ele_dPhiCl_propOut_all_barrel = 0 ;
00193   h1_ele_dPhiCl_propOut_all_endcaps = 0 ;
00194   h1_ele_TIP_all = 0 ;
00195   h1_ele_TIP_all_barrel = 0 ;
00196   h1_ele_TIP_all_endcaps = 0 ;
00197   h1_ele_HoE_all = 0 ;
00198   h1_ele_HoE_all_barrel = 0 ;
00199   h1_ele_HoE_all_endcaps = 0 ;
00200   h1_ele_vertexEta_all = 0 ;
00201   h1_ele_vertexPt_all = 0 ;
00202   h1_ele_Et_all = 0 ;
00203   h1_ele_mee_all = 0 ;
00204   h1_ele_mee_os = 0 ;
00205   h1_ele_mee_os_ebeb = 0 ;
00206   h1_ele_mee_os_ebee = 0 ;
00207   h1_ele_mee_os_eeee = 0 ;
00208   h1_ele_mee_os_gg = 0 ;
00209   h1_ele_mee_os_gb = 0 ;
00210   h1_ele_mee_os_bb = 0 ;
00211 
00212   h2_ele_E2mnE1vsMee_all = 0 ;
00213   h2_ele_E2mnE1vsMee_egeg_all = 0 ;
00214 
00215   h1_ele_charge = 0 ;
00216   h2_ele_chargeVsEta = 0 ;
00217   h2_ele_chargeVsPhi = 0 ;
00218   h2_ele_chargeVsPt = 0 ;
00219   h1_ele_vertexP = 0 ;
00220   h1_ele_vertexPt = 0 ;
00221   h1_ele_Et = 0 ;
00222   h2_ele_vertexPtVsEta = 0 ;
00223   h2_ele_vertexPtVsPhi = 0 ;
00224   h1_ele_vertexPt_5100 = 0 ;
00225   h1_ele_vertexEta = 0 ;
00226   h2_ele_vertexEtaVsPhi = 0 ;
00227   h1_ele_vertexAbsEta = 0 ;
00228   h1_ele_vertexPhi = 0 ;
00229   h1_ele_vertexX = 0 ;
00230   h1_ele_vertexY = 0 ;
00231   h1_ele_vertexZ = 0 ;
00232   h1_ele_vertexTIP = 0 ;
00233   h2_ele_vertexTIPVsEta = 0 ;
00234   h2_ele_vertexTIPVsPhi = 0 ;
00235   h2_ele_vertexTIPVsPt = 0 ;
00236 
00237   h1_scl_En = 0 ;
00238   h1_scl_EoEtrue_barrel = 0 ;
00239   h1_scl_EoEtrue_endcaps = 0 ;
00240   h1_scl_EoEtrue_barrel_eg = 0 ;
00241   h1_scl_EoEtrue_endcaps_eg = 0 ;
00242   h1_scl_EoEtrue_barrel_etagap = 0 ;
00243   h1_scl_EoEtrue_barrel_phigap = 0 ;
00244   h1_scl_EoEtrue_ebeegap = 0 ;
00245   h1_scl_EoEtrue_endcaps_deegap = 0 ;
00246   h1_scl_EoEtrue_endcaps_ringgap = 0 ;
00247   h1_scl_EoEtrue_barrel_new = 0 ;
00248   h1_scl_EoEtrue_endcaps_new = 0 ;
00249   h1_scl_EoEtrue_barrel_new_eg = 0 ;
00250   h1_scl_EoEtrue_endcaps_new_eg = 0 ;
00251   h1_scl_EoEtrue_barrel_new_etagap = 0 ;
00252   h1_scl_EoEtrue_barrel_new_phigap = 0 ;
00253   h1_scl_EoEtrue_ebeegap_new = 0 ;
00254   h1_scl_EoEtrue_endcaps_new_deegap = 0 ;
00255   h1_scl_EoEtrue_endcaps_new_ringgap = 0 ;
00256   h1_scl_Et = 0 ;
00257   h2_scl_EtVsEta = 0 ;
00258   h2_scl_EtVsPhi = 0 ;
00259   h2_scl_EtaVsPhi = 0 ;
00260   h1_scl_Eta = 0 ;
00261   h1_scl_Phi = 0 ;
00262 
00263   h2_scl_EoEtruePfVsEg  = 0 ;
00264 
00265   h1_scl_SigEtaEta = 0 ;
00266   h1_scl_SigEtaEta_barrel = 0 ;
00267   h1_scl_SigEtaEta_endcaps = 0 ;
00268   h1_scl_SigIEtaIEta = 0 ;
00269   h1_scl_SigIEtaIEta_barrel = 0 ;
00270   h1_scl_SigIEtaIEta_endcaps = 0 ;
00271   h1_scl_E1x5 = 0 ;
00272   h1_scl_E1x5_barrel = 0 ;
00273   h1_scl_E1x5_endcaps = 0 ;
00274   h1_scl_E2x5max = 0 ;
00275   h1_scl_E2x5max_barrel = 0 ;
00276   h1_scl_E2x5max_endcaps = 0 ;
00277   h1_scl_E5x5 = 0 ;
00278   h1_scl_E5x5_barrel = 0 ;
00279   h1_scl_E5x5_endcaps = 0 ;
00280   h1_scl_SigEtaEta_eg = 0 ;
00281   h1_scl_SigEtaEta_eg_barrel = 0 ;
00282   h1_scl_SigEtaEta_eg_endcaps = 0 ;
00283   h1_scl_SigIEtaIEta_eg = 0 ;
00284   h1_scl_SigIEtaIEta_eg_barrel = 0 ;
00285   h1_scl_SigIEtaIEta_eg_endcaps = 0 ;
00286   h1_scl_E1x5_eg = 0 ;
00287   h1_scl_E1x5_eg_barrel = 0 ;
00288   h1_scl_E1x5_eg_endcaps = 0 ;
00289   h1_scl_E2x5max_eg = 0 ;
00290   h1_scl_E2x5max_eg_barrel = 0 ;
00291   h1_scl_E2x5max_eg_endcaps = 0 ;
00292   h1_scl_E5x5_eg = 0 ;
00293   h1_scl_E5x5_eg_barrel = 0 ;
00294   h1_scl_E5x5_eg_endcaps = 0 ;
00295 
00296   h1_ele_ambiguousTracks = 0 ;
00297   h2_ele_ambiguousTracksVsEta = 0 ;
00298   h2_ele_ambiguousTracksVsPhi = 0 ;
00299   h2_ele_ambiguousTracksVsPt = 0 ;
00300   h1_ele_foundHits = 0 ;
00301   h1_ele_foundHits_barrel = 0 ;
00302   h1_ele_foundHits_endcaps = 0 ;
00303   h2_ele_foundHitsVsEta = 0 ;
00304   h2_ele_foundHitsVsPhi = 0 ;
00305   h2_ele_foundHitsVsPt = 0 ;
00306   h1_ele_lostHits = 0 ;
00307   h1_ele_lostHits_barrel = 0 ;
00308   h1_ele_lostHits_endcaps = 0 ;
00309   h2_ele_lostHitsVsEta = 0 ;
00310   h2_ele_lostHitsVsPhi = 0 ;
00311   h2_ele_lostHitsVsPt = 0 ;
00312   h1_ele_chi2 = 0 ;
00313   h1_ele_chi2_barrel = 0 ;
00314   h1_ele_chi2_endcaps = 0 ;
00315   h2_ele_chi2VsEta = 0 ;
00316   h2_ele_chi2VsPhi = 0 ;
00317   h2_ele_chi2VsPt = 0 ;
00318 
00319   h1_ele_PoPtrue = 0 ;
00320   h1_ele_PtoPttrue = 0 ;
00321   h2_ele_PoPtrueVsEta = 0 ;
00322   h2_ele_PoPtrueVsPhi = 0 ;
00323   h2_ele_PoPtrueVsPt = 0 ;
00324   h1_ele_PoPtrue_barrel = 0 ;
00325   h1_ele_PoPtrue_endcaps = 0 ;
00326   h1_ele_PoPtrue_golden_barrel = 0 ;
00327   h1_ele_PoPtrue_golden_endcaps = 0 ;
00328   h1_ele_PoPtrue_showering_barrel = 0 ;
00329   h1_ele_PoPtrue_showering_endcaps = 0 ;
00330   h1_ele_PtoPttrue_barrel = 0 ;
00331   h1_ele_PtoPttrue_endcaps = 0 ;
00332   h1_ele_ChargeMnChargeTrue = 0 ;
00333   h1_ele_EtaMnEtaTrue = 0 ;
00334   h1_ele_EtaMnEtaTrue_barrel = 0 ;
00335   h1_ele_EtaMnEtaTrue_endcaps = 0 ;
00336   h2_ele_EtaMnEtaTrueVsEta = 0 ;
00337   h2_ele_EtaMnEtaTrueVsPhi = 0 ;
00338   h2_ele_EtaMnEtaTrueVsPt = 0 ;
00339   h1_ele_PhiMnPhiTrue = 0 ;
00340   h1_ele_PhiMnPhiTrue_barrel = 0 ;
00341   h1_ele_PhiMnPhiTrue_endcaps = 0 ;
00342   h1_ele_PhiMnPhiTrue2 = 0 ;
00343   h2_ele_PhiMnPhiTrueVsEta = 0 ;
00344   h2_ele_PhiMnPhiTrueVsPhi = 0 ;
00345   h2_ele_PhiMnPhiTrueVsPt = 0 ;
00346   h1_ele_PinMnPout = 0 ;
00347   h1_ele_PinMnPout_mode = 0 ;
00348   h2_ele_PinMnPoutVsEta_mode = 0 ;
00349   h2_ele_PinMnPoutVsPhi_mode = 0 ;
00350   h2_ele_PinMnPoutVsPt_mode = 0 ;
00351   h2_ele_PinMnPoutVsE_mode = 0 ;
00352   h2_ele_PinMnPoutVsChi2_mode = 0 ;
00353 
00354   h1_ele_outerP = 0 ;
00355   h1_ele_outerP_mode = 0 ;
00356   h2_ele_outerPVsEta_mode = 0 ;
00357   h1_ele_outerPt = 0 ;
00358   h1_ele_outerPt_mode = 0 ;
00359   h2_ele_outerPtVsEta_mode = 0 ;
00360   h2_ele_outerPtVsPhi_mode = 0 ;
00361   h2_ele_outerPtVsPt_mode = 0 ;
00362   h1_ele_EoP = 0 ;
00363   h1_ele_EoP_barrel = 0 ;
00364   h1_ele_EoP_endcaps = 0 ;
00365   h1_ele_EoP_eg = 0 ;
00366   h1_ele_EoP_eg_barrel = 0 ;
00367   h1_ele_EoP_eg_endcaps = 0 ;
00368   h2_ele_EoPVsEta = 0 ;
00369   h2_ele_EoPVsPhi = 0 ;
00370   h2_ele_EoPVsE = 0 ;
00371   h1_ele_EseedOP = 0 ;
00372   h1_ele_EseedOP_barrel = 0 ;
00373   h1_ele_EseedOP_endcaps = 0 ;
00374   h1_ele_EseedOP_eg = 0 ;
00375   h1_ele_EseedOP_eg_barrel = 0 ;
00376   h1_ele_EseedOP_eg_endcaps = 0 ;
00377   h2_ele_EseedOPVsEta = 0 ;
00378   h2_ele_EseedOPVsPhi = 0 ;
00379   h2_ele_EseedOPVsE = 0 ;
00380   h1_ele_EoPout = 0 ;
00381   h1_ele_EoPout_barrel = 0 ;
00382   h1_ele_EoPout_endcaps = 0 ;
00383   h1_ele_EoPout_eg = 0 ;
00384   h1_ele_EoPout_eg_barrel = 0 ;
00385   h1_ele_EoPout_eg_endcaps = 0 ;
00386   h2_ele_EoPoutVsEta = 0 ;
00387   h2_ele_EoPoutVsPhi = 0 ;
00388   h2_ele_EoPoutVsE = 0 ;
00389   h1_ele_EeleOPout = 0 ;
00390   h1_ele_EeleOPout_barrel = 0 ;
00391   h1_ele_EeleOPout_endcaps = 0 ;
00392   h1_ele_EeleOPout_eg = 0 ;
00393   h1_ele_EeleOPout_eg_barrel = 0 ;
00394   h1_ele_EeleOPout_eg_endcaps = 0 ;
00395   h2_ele_EeleOPoutVsEta = 0 ;
00396   h2_ele_EeleOPoutVsPhi = 0 ;
00397   h2_ele_EeleOPoutVsE = 0 ;
00398 
00399   h1_ele_dEtaSc_propVtx = 0 ;
00400   h1_ele_dEtaSc_propVtx_barrel = 0 ;
00401   h1_ele_dEtaSc_propVtx_endcaps = 0 ;
00402   h1_ele_dEtaSc_propVtx_eg = 0 ;
00403   h1_ele_dEtaSc_propVtx_eg_barrel = 0 ;
00404   h1_ele_dEtaSc_propVtx_eg_endcaps = 0 ;
00405   h2_ele_dEtaScVsEta_propVtx = 0 ;
00406   h2_ele_dEtaScVsPhi_propVtx = 0 ;
00407   h2_ele_dEtaScVsPt_propVtx = 0 ;
00408   h1_ele_dPhiSc_propVtx = 0 ;
00409   h1_ele_dPhiSc_propVtx_barrel = 0 ;
00410   h1_ele_dPhiSc_propVtx_endcaps = 0 ;
00411   h1_ele_dPhiSc_propVtx_eg = 0 ;
00412   h1_ele_dPhiSc_propVtx_eg_barrel = 0 ;
00413   h1_ele_dPhiSc_propVtx_eg_endcaps = 0 ;
00414   h2_ele_dPhiScVsEta_propVtx = 0 ;
00415   h2_ele_dPhiScVsPhi_propVtx = 0 ;
00416   h2_ele_dPhiScVsPt_propVtx = 0 ;
00417   h1_ele_dEtaCl_propOut = 0 ;
00418   h1_ele_dEtaCl_propOut_barrel = 0 ;
00419   h1_ele_dEtaCl_propOut_endcaps = 0 ;
00420   h1_ele_dEtaCl_propOut_eg = 0 ;
00421   h1_ele_dEtaCl_propOut_eg_barrel = 0 ;
00422   h1_ele_dEtaCl_propOut_eg_endcaps = 0 ;
00423   h2_ele_dEtaClVsEta_propOut = 0 ;
00424   h2_ele_dEtaClVsPhi_propOut = 0 ;
00425   h2_ele_dEtaClVsPt_propOut = 0 ;
00426   h1_ele_dPhiCl_propOut = 0 ;
00427   h1_ele_dPhiCl_propOut_barrel = 0 ;
00428   h1_ele_dPhiCl_propOut_endcaps = 0 ;
00429   h1_ele_dPhiCl_propOut_eg = 0 ;
00430   h1_ele_dPhiCl_propOut_eg_barrel = 0 ;
00431   h1_ele_dPhiCl_propOut_eg_endcaps = 0 ;
00432   h2_ele_dPhiClVsEta_propOut = 0 ;
00433   h2_ele_dPhiClVsPhi_propOut = 0 ;
00434   h2_ele_dPhiClVsPt_propOut = 0 ;
00435   h1_ele_dEtaEleCl_propOut = 0 ;
00436   h1_ele_dEtaEleCl_propOut_barrel = 0 ;
00437   h1_ele_dEtaEleCl_propOut_endcaps = 0 ;
00438   h1_ele_dEtaEleCl_propOut_eg = 0 ;
00439   h1_ele_dEtaEleCl_propOut_eg_barrel = 0 ;
00440   h1_ele_dEtaEleCl_propOut_eg_endcaps = 0 ;
00441   h2_ele_dEtaEleClVsEta_propOut = 0 ;
00442   h2_ele_dEtaEleClVsPhi_propOut = 0 ;
00443   h2_ele_dEtaEleClVsPt_propOut = 0 ;
00444   h1_ele_dPhiEleCl_propOut = 0 ;
00445   h1_ele_dPhiEleCl_propOut_barrel = 0 ;
00446   h1_ele_dPhiEleCl_propOut_endcaps = 0 ;
00447   h1_ele_dPhiEleCl_propOut_eg = 0 ;
00448   h1_ele_dPhiEleCl_propOut_eg_barrel = 0 ;
00449   h1_ele_dPhiEleCl_propOut_eg_endcaps = 0 ;
00450   h2_ele_dPhiEleClVsEta_propOut = 0 ;
00451   h2_ele_dPhiEleClVsPhi_propOut = 0 ;
00452   h2_ele_dPhiEleClVsPt_propOut = 0 ;
00453 
00454   h1_ele_seed_subdet2 = 0 ;
00455   h1_ele_seed_mask = 0 ;
00456   h1_ele_seed_mask_bpix = 0 ;
00457   h1_ele_seed_mask_fpix = 0 ;
00458   h1_ele_seed_mask_tec = 0 ;
00459   h1_ele_seed_dphi2 = 0 ;
00460   h2_ele_seed_dphi2VsEta = 0 ;
00461   h2_ele_seed_dphi2VsPt = 0 ;
00462   h1_ele_seed_dphi2pos = 0 ;
00463   h2_ele_seed_dphi2posVsEta = 0 ;
00464   h2_ele_seed_dphi2posVsPt = 0 ;
00465   h1_ele_seed_drz2 = 0 ;
00466   h2_ele_seed_drz2VsEta = 0 ;
00467   h2_ele_seed_drz2VsPt = 0 ;
00468   h1_ele_seed_drz2pos = 0 ;
00469   h2_ele_seed_drz2posVsEta = 0 ;
00470   h2_ele_seed_drz2posVsPt = 0 ;
00471 
00472   h1_ele_classes = 0 ;
00473   h1_ele_eta = 0 ;
00474   h1_ele_eta_golden = 0 ;
00475   h1_ele_eta_bbrem = 0 ;
00476   h1_ele_eta_shower = 0 ;
00477 
00478   h1_ele_HoE = 0 ;
00479   h1_ele_HoE_barrel = 0 ;
00480   h1_ele_HoE_endcaps = 0 ;
00481   h1_ele_HoE_eg = 0 ;
00482   h1_ele_HoE_eg_barrel = 0 ;
00483   h1_ele_HoE_eg_endcaps = 0 ;
00484   h1_ele_HoE_fiducial = 0 ;
00485   h2_ele_HoEVsEta = 0 ;
00486   h2_ele_HoEVsPhi = 0 ;
00487   h2_ele_HoEVsE = 0 ;
00488 
00489   h1_ele_fbrem = 0 ;
00490   h1_ele_fbrem_eg = 0 ;
00491   p1_ele_fbremVsEta_mode = 0 ;
00492   p1_ele_fbremVsEta_mean = 0 ;
00493 
00494   h2_ele_PinVsPoutGolden_mode = 0 ;
00495   h2_ele_PinVsPoutShowering_mode = 0 ;
00496   h2_ele_PinVsPoutGolden_mean = 0 ;
00497   h2_ele_PinVsPoutShowering_mean = 0 ;
00498   h2_ele_PtinVsPtoutGolden_mode = 0 ;
00499   h2_ele_PtinVsPtoutShowering_mode = 0 ;
00500   h2_ele_PtinVsPtoutGolden_mean = 0 ;
00501   h2_ele_PtinVsPtoutShowering_mean = 0 ;
00502   h1_scl_EoEtrueGolden_barrel = 0 ;
00503   h1_scl_EoEtrueGolden_endcaps = 0 ;
00504   h1_scl_EoEtrueShowering_barrel = 0 ;
00505   h1_scl_EoEtrueShowering_endcaps = 0 ;
00506 
00507   h1_ele_mva = 0 ;
00508   h1_ele_mva_eg = 0 ;
00509   h1_ele_provenance = 0 ;
00510 
00511   // isolation
00512   h1_ele_tkSumPt_dr03 = 0 ;
00513   h1_ele_tkSumPt_dr03_barrel = 0 ;
00514   h1_ele_tkSumPt_dr03_endcaps = 0 ;
00515   h1_ele_ecalRecHitSumEt_dr03 = 0 ;
00516   h1_ele_ecalRecHitSumEt_dr03_barrel = 0 ;
00517   h1_ele_ecalRecHitSumEt_dr03_endcaps = 0 ;
00518   h1_ele_hcalTowerSumEt_dr03_depth1 = 0 ;
00519   h1_ele_hcalTowerSumEt_dr03_depth1_barrel = 0 ;
00520   h1_ele_hcalTowerSumEt_dr03_depth1_endcaps = 0 ;
00521   h1_ele_hcalTowerSumEt_dr03_depth2 = 0 ;
00522   h1_ele_tkSumPt_dr04 = 0 ;
00523   h1_ele_tkSumPt_dr04_barrel = 0 ;
00524   h1_ele_tkSumPt_dr04_endcaps = 0 ;
00525   h1_ele_ecalRecHitSumEt_dr04 = 0 ;
00526   h1_ele_ecalRecHitSumEt_dr04_barrel = 0 ;
00527   h1_ele_ecalRecHitSumEt_dr04_endcaps = 0 ;
00528   h1_ele_hcalTowerSumEt_dr04_depth1 = 0 ;
00529   h1_ele_hcalTowerSumEt_dr04_depth1_barrel = 0 ;
00530   h1_ele_hcalTowerSumEt_dr04_depth1_endcaps = 0 ;
00531   h1_ele_hcalTowerSumEt_dr04_depth2 = 0 ;
00532 
00533   h1_ele_dIso_tkSumPt_dr03 = 0 ;
00534   h1_ele_dIso_tkSumPt_dr04 = 0 ;
00535   h1_ele_dIso_ecalFullRecHitSumEt_dr03 = 0 ;
00536   h1_ele_dIso_ecalFullRecHitSumEt_dr04 = 0 ;
00537   h1_ele_dIso_ecalReducedRecHitSumEt_dr03 = 0 ;
00538   h1_ele_dIso_ecalReducedRecHitSumEt_dr04 = 0 ;
00539   h1_ele_dIso_hcalTowerSumEt_dr03 = 0 ;
00540   h1_ele_dIso_hcalTowerSumEt_dr04 = 0 ;
00541 
00542   // conversions
00543   h1_ele_convFlags = 0 ;
00544   h1_ele_convFlags_all = 0 ;
00545   h1_ele_convDist = 0 ;
00546   h1_ele_convDist_all = 0 ;
00547   h1_ele_convDcot = 0 ;
00548   h1_ele_convDcot_all = 0 ;
00549   h1_ele_convRadius = 0 ;
00550   h1_ele_convRadius_all = 0 ;
00551  }
00552 
00553 void ElectronMcSignalValidator::book()
00554  {
00555 //  prepareStore() ;
00556 //  setStoreFolder("EgammaV/ElectronMcSignalValidator") ;
00557   setBookIndex(-1) ;
00558   setBookPrefix("h") ;
00559 
00560   // mc truth collections sizes
00561   h1_mcNum = bookH1withSumw2("mcNum","# mc particles",fhits_nbin,0.,fhits_max,"N_{gen}" );
00562   h1_eleNum = bookH1withSumw2("mcNum_ele","# mc electrons",fhits_nbin,0.,fhits_max,"N_{gen ele}");
00563   h1_gamNum = bookH1withSumw2("mcNum_gam","# mc gammas",fhits_nbin,0.,fhits_max,"N_{gen #gamma}");
00564 
00565   // rec event collections sizes
00566   h1_recEleNum = bookH1("recEleNum","# rec electrons",11, -0.5,10.5,"N_{ele}");
00567   h1_recCoreNum = bookH1("recCoreNum","# rec electron cores",21, -0.5,20.5,"N_{core}");
00568   h1_recTrackNum = bookH1("recTrackNum","# rec gsf tracks",41, -0.5,40.5,"N_{track}");
00569   h1_recSeedNum = bookH1("recSeedNum","# rec electron seeds",101, -0.5,100.5,"N_{seed}");
00570 
00571   // mc
00572   setBookPrefix("h_mc") ;
00573   h1_mc_Eta = bookH1withSumw2("Eta","gen #eta",eta_nbin,eta_min,eta_max,"#eta");
00574   h1_mc_AbsEta = bookH1withSumw2("AbsEta","gen |#eta|",eta_nbin/2,0.,eta_max);
00575   h1_mc_P = bookH1withSumw2("P","gen p",p_nbin,0.,p_max,"p (GeV/c)");
00576   h1_mc_Pt = bookH1withSumw2("Pt","gen pt",pteff_nbin,5.,pt_max);
00577   h1_mc_Phi = bookH1withSumw2("Phi","gen phi",phi_nbin,phi_min,phi_max);
00578   h1_mc_Z = bookH1withSumw2("Z","gen z ",xyz_nbin, -25, 25 );
00579   h2_mc_PtEta = bookH2withSumw2("PtEta","gen pt vs #eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,5.,pt_max );
00580 
00581   // all electrons
00582   setBookPrefix("h_ele") ;
00583   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");
00584   h1_ele_EoverP_all_barrel = bookH1withSumw2("EoverP_all_barrel","ele E/P_{vertex}, all reco electrons, barrel",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
00585   h1_ele_EoverP_all_endcaps = bookH1withSumw2("EoverP_all_endcaps","ele E/P_{vertex}, all reco electrons, endcaps",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
00586   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");
00587   h1_ele_EseedOP_all_barrel = bookH1withSumw2("EseedOP_all_barrel","ele E_{seed}/P_{vertex}, all reco electrons, barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
00588   h1_ele_EseedOP_all_endcaps = bookH1withSumw2("EseedOP_all_endcaps","ele E_{seed}/P_{vertex}, all reco electrons, endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
00589   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");
00590   h1_ele_EoPout_all_barrel = bookH1withSumw2("EoPout_all_barrel","ele E_{seed}/P_{out}, all reco electrons barrel",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
00591   h1_ele_EoPout_all_endcaps = bookH1withSumw2("EoPout_all_endcaps","ele E_{seed}/P_{out}, all reco electrons endcaps",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
00592   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");
00593   h1_ele_EeleOPout_all_barrel = bookH1withSumw2("EeleOPout_all_barrel","ele E_{ele}/P_{out}, all reco electrons barrel",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
00594   h1_ele_EeleOPout_all_endcaps = bookH1withSumw2("EeleOPout_all_endcaps","ele E_{ele}/P_{out}, all reco electrons endcaps",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
00595   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");
00596   h1_ele_dEtaSc_propVtx_all_barrel = bookH1withSumw2("dEtaSc_propVtx_all_barrel","ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00597   h1_ele_dEtaSc_propVtx_all_endcaps = bookH1withSumw2("dEtaSc_propVtx_all_endcaps","ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00598   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");
00599   h1_ele_dPhiSc_propVtx_all_barrel = bookH1withSumw2("dPhiSc_propVtx_all_barrel","ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00600   h1_ele_dPhiSc_propVtx_all_endcaps = bookH1withSumw2("dPhiSc_propVtx_all_endcaps","ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00601   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");
00602   h1_ele_dEtaCl_propOut_all_barrel = bookH1withSumw2("dEtaCl_propOut_all_barrel","ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons barrel",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00603   h1_ele_dEtaCl_propOut_all_endcaps = bookH1withSumw2("dEtaCl_propOut_all_endcaps","ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons endcaps",detamatch_nbin,detamatch_min,detamatch_max,"#eta_{sc} - #eta_{tr}","Events","ELE_LOGY E1 P");
00604   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");
00605   h1_ele_dPhiCl_propOut_all_barrel = bookH1withSumw2("dPhiCl_propOut_all_barrel","ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons barrel",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00606   h1_ele_dPhiCl_propOut_all_endcaps = bookH1withSumw2("dPhiCl_propOut_all_endcaps","ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons endcaps",dphimatch_nbin,dphimatch_min,dphimatch_max,"#phi_{sc} - #phi_{tr} (rad)","Events","ELE_LOGY E1 P");
00607   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") ;
00608   h1_ele_HoE_all_barrel = bookH1withSumw2("HoE_all_barrel","ele hadronic energy / em energy, all reco electrons barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00609   h1_ele_HoE_all_endcaps = bookH1withSumw2("HoE_all_endcaps","ele hadronic energy / em energy, all reco electrons endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00610   h1_ele_HoE_bc_all = bookH1withSumw2("HoE_bc_all","ele hadronic energy / em energy, all reco electrons, behind cluster",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00611   h1_ele_vertexPt_all = bookH1withSumw2("vertexPt_all","ele p_{T}, all reco electrons",pteff_nbin,5.,pt_max,"","Events","ELE_LOGY E1 P");
00612   h1_ele_Et_all = bookH1withSumw2("Et_all","ele ecal E_{T}, all reco electrons",pteff_nbin,5.,pt_max,"E_{T} (GeV)","Events","ELE_LOGY E1 P");
00613   h1_ele_vertexEta_all = bookH1withSumw2("vertexEta_all","ele eta, all reco electrons",eta_nbin,eta_min,eta_max,"","Events","ELE_LOGY E1 P");
00614   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");
00615   h1_ele_TIP_all_barrel = bookH1withSumw2("TIP_all_barrel","ele vertex transverse radius, all reco electrons barrel",  100,0.,0.2,"r_{T} (cm)","Events","ELE_LOGY E1 P");
00616   h1_ele_TIP_all_endcaps = bookH1withSumw2("TIP_all_endcaps","ele vertex transverse radius, all reco electrons endcaps",  100,0.,0.2,"r_{T} (cm)","Events","ELE_LOGY E1 P");
00617   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})","Events","ELE_LOGY E1 P");
00618   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})","Events","ELE_LOGY E1 P");
00619   h1_ele_mee_os_ebeb = bookH1withSumw2("mee_os_ebeb","ele pairs invariant mass, opp. sign, EB-EB",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
00620   h1_ele_mee_os_ebee = bookH1withSumw2("mee_os_ebee","ele pairs invariant mass, opp. sign, EB-EE",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
00621   h1_ele_mee_os_eeee = bookH1withSumw2("mee_os_eeee","ele pairs invariant mass, opp. sign, EE-EE",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
00622   h1_ele_mee_os_gg = bookH1withSumw2("mee_os_gg","ele pairs invariant mass, opp. sign, good-good",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
00623   h1_ele_mee_os_gb = bookH1withSumw2("mee_os_gb","ele pairs invariant mass, opp. sign, good-bad",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
00624   h1_ele_mee_os_bb = bookH1withSumw2("mee_os_bb","ele pairs invariant mass, opp. sign, bad-bad",mee_nbin, mee_min, mee_max,"m_{e^{+}e^{-}} (GeV/c^{2})","Events","ELE_LOGY E1 P");
00625 
00626   // duplicates
00627   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)");
00628   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)");
00629 
00630   // charge ID
00631   h1_ele_ChargeMnChargeTrue = bookH1withSumw2("ChargeMnChargeTrue","ele charge - gen charge ",5,-1.,4.,"q_{rec} - q_{gen}");
00632   setBookPrefix("h_mc") ;
00633   h1_mc_Eta_matched_qmisid = bookH1withSumw2("Eta_matched_qmisid","charge misid vs gen eta",eta_nbin,eta_min,eta_max);
00634   h1_mc_AbsEta_matched_qmisid = bookH1withSumw2("AbsEta_matched_qmisid","charge misid vs gen |eta|",eta_nbin/2,0.,eta_max);
00635   h1_mc_Pt_matched_qmisid = bookH1withSumw2("Pt_matched_qmisid","charge misid vs gen transverse momentum",pteff_nbin,5.,pt_max);
00636   h1_mc_Phi_matched_qmisid = bookH1withSumw2("Phi_matched_qmisid","charge misid vs gen phi",phi_nbin,phi_min,phi_max);
00637   h1_mc_Z_matched_qmisid = bookH1withSumw2("Z_matched_qmisid","charge misid vs gen z",xyz_nbin, -25, 25 );
00638 
00639   // matched electrons
00640   setBookPrefix("h_mc") ;
00641   h1_mc_Eta_matched = bookH1withSumw2("Eta_matched","Efficiency vs gen eta",eta_nbin,eta_min,eta_max);
00642   h1_mc_AbsEta_matched = bookH1withSumw2("AbsEta_matched","Efficiency vs gen |eta|",eta_nbin/2,0.,2.5);
00643   h1_mc_Pt_matched = bookH1("Pt_matched","Efficiency vs gen transverse momentum",pteff_nbin,5.,pt_max);
00644   h1_mc_Phi_matched = bookH1withSumw2("Phi_matched","Efficiency vs gen phi",phi_nbin,phi_min,phi_max);
00645   h1_mc_Z_matched = bookH1withSumw2("Z_matched","Efficiency vs gen vertex z",xyz_nbin,-25,25);
00646   h2_mc_PtEta_matched = bookH2withSumw2("PtEta_matched","Efficiency vs pt #eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,5.,pt_max );
00647   setBookPrefix("h_ele") ;
00648   h1_ele_charge = bookH1withSumw2("charge","ele charge",5,-2.5,2.5,"charge");
00649   h2_ele_chargeVsEta = bookH2("chargeVsEta","ele charge vs eta",eta2D_nbin,eta_min,eta_max,5,-2.,2.);
00650   h2_ele_chargeVsPhi = bookH2("chargeVsPhi","ele charge vs phi",phi2D_nbin,phi_min,phi_max,5,-2.,2.);
00651   h2_ele_chargeVsPt = bookH2("chargeVsPt","ele charge vs pt",pt_nbin,0.,100.,5,-2.,2.);
00652   h1_ele_vertexP = bookH1withSumw2("vertexP","ele momentum",p_nbin,0.,p_max,"p_{vertex} (GeV/c)");
00653   h1_ele_vertexPt = bookH1withSumw2("vertexPt","ele transverse momentum",pt_nbin,0.,pt_max,"p_{T vertex} (GeV/c)");
00654   h1_ele_Et = bookH1withSumw2("Et","ele ecal E_{T}",pt_nbin,0.,pt_max,"E_{T} (GeV)");
00655   h2_ele_vertexPtVsEta = bookH2("vertexPtVsEta","ele transverse momentum vs eta",eta2D_nbin,eta_min,eta_max,pt2D_nbin,0.,pt_max);
00656   h2_ele_vertexPtVsPhi = bookH2("vertexPtVsPhi","ele transverse momentum vs phi",phi2D_nbin,phi_min,phi_max,pt2D_nbin,0.,pt_max);
00657   h1_ele_vertexEta = bookH1withSumw2("vertexEta","ele momentum eta",eta_nbin,eta_min,eta_max,"#eta");
00658   h2_ele_vertexEtaVsPhi = bookH2("vertexEtaVsPhi","ele momentum eta vs phi",eta2D_nbin,eta_min,eta_max,phi2D_nbin,phi_min,phi_max );
00659   h1_ele_vertexPhi = bookH1withSumw2("vertexPhi","ele  momentum #phi",phi_nbin,phi_min,phi_max,"#phi (rad)");
00660   h1_ele_vertexX = bookH1withSumw2("vertexX","ele vertex x",xyz_nbin,-0.6,0.6,"x (cm)" );
00661   h1_ele_vertexY = bookH1withSumw2("vertexY","ele vertex y",xyz_nbin,-0.6,0.6,"y (cm)" );
00662   h1_ele_vertexZ = bookH1withSumw2("vertexZ","ele vertex z",xyz_nbin,-25, 25,"z (cm)" );
00663   h1_ele_vertexTIP = bookH1withSumw2("vertexTIP","ele transverse impact parameter (wrt gen vtx)",90,0.,0.15,"TIP (cm)");
00664   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)");
00665   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)");
00666   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)");
00667   h1_ele_PoPtrue = bookH1withSumw2("PoPtrue","ele momentum / gen momentum",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
00668   h1_ele_PoPtrue_barrel = bookH1withSumw2("PoPtrue_barrel","ele momentum / gen momentum, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
00669   h1_ele_PoPtrue_endcaps = bookH1withSumw2("PoPtrue_endcaps","ele momentum / gen momentum, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
00670   h2_ele_PoPtrueVsEta = bookH2withSumw2("PoPtrueVsEta","ele momentum / gen momentum vs eta",eta2D_nbin,eta_min,eta_max,50,poptrue_min,poptrue_max);
00671   h2_ele_PoPtrueVsPhi = bookH2("PoPtrueVsPhi","ele momentum / gen momentum vs phi",phi2D_nbin,phi_min,phi_max,50,poptrue_min,poptrue_max);
00672   h2_ele_PoPtrueVsPt = bookH2("PoPtrueVsPt","ele momentum / gen momentum vs eta",pt2D_nbin,0.,pt_max,50,poptrue_min,poptrue_max);
00673   h1_ele_PoPtrue_golden_barrel = bookH1withSumw2("PoPtrue_golden_barrel","ele momentum / gen momentum, golden, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
00674   h1_ele_PoPtrue_golden_endcaps = bookH1withSumw2("PoPtrue_golden_endcaps","ele momentum / gen momentum, golden, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
00675   h1_ele_PoPtrue_showering_barrel = bookH1withSumw2("PoPtrue_showering_barrel","ele momentum / gen momentum, showering, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
00676   h1_ele_PoPtrue_showering_endcaps = bookH1withSumw2("PoPtrue_showering_endcaps","ele momentum / gen momentum, showering, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P/P_{gen}");
00677   h1_ele_PtoPttrue = bookH1withSumw2("PtoPttrue","ele transverse momentum / gen transverse momentum",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
00678   h1_ele_PtoPttrue_barrel = bookH1withSumw2("PtoPttrue_barrel","ele transverse momentum / gen transverse momentum, barrel",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
00679   h1_ele_PtoPttrue_endcaps = bookH1withSumw2("PtoPttrue_endcaps","ele transverse momentum / gen transverse momentum, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"P_{T}/P_{T}^{gen}");
00680   h1_ele_EtaMnEtaTrue = bookH1withSumw2("EtaMnEtaTrue","ele momentum  eta - gen  eta",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
00681   h1_ele_EtaMnEtaTrue_barrel = bookH1withSumw2("EtaMnEtaTrue_barrel","ele momentum  eta - gen  eta barrel",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
00682   h1_ele_EtaMnEtaTrue_endcaps = bookH1withSumw2("EtaMnEtaTrue_endcaps","ele momentum  eta - gen  eta endcaps",deta_nbin,deta_min,deta_max,"#eta_{rec} - #eta_{gen}");
00683   h2_ele_EtaMnEtaTrueVsEta = bookH2("EtaMnEtaTrueVsEta","ele momentum  eta - gen  eta vs eta",eta2D_nbin,eta_min,eta_max,deta_nbin/2,deta_min,deta_max);
00684   h2_ele_EtaMnEtaTrueVsPhi = bookH2("EtaMnEtaTrueVsPhi","ele momentum  eta - gen  eta vs phi",phi2D_nbin,phi_min,phi_max,deta_nbin/2,deta_min,deta_max);
00685   h2_ele_EtaMnEtaTrueVsPt = bookH2("EtaMnEtaTrueVsPt","ele momentum  eta - gen  eta vs pt",pt_nbin,0.,pt_max,deta_nbin/2,deta_min,deta_max);
00686   h1_ele_PhiMnPhiTrue = bookH1withSumw2("PhiMnPhiTrue","ele momentum  phi - gen  phi",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
00687   h1_ele_PhiMnPhiTrue_barrel = bookH1withSumw2("PhiMnPhiTrue_barrel","ele momentum  phi - gen  phi barrel",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
00688   h1_ele_PhiMnPhiTrue_endcaps = bookH1withSumw2("PhiMnPhiTrue_endcaps","ele momentum  phi - gen  phi endcaps",dphi_nbin,dphi_min,dphi_max,"#phi_{rec} - #phi_{gen} (rad)");
00689   h1_ele_PhiMnPhiTrue2 = bookH1("PhiMnPhiTrue2","ele momentum  phi - gen  phi",dphimatch2D_nbin,dphimatch_min,dphimatch_max);
00690   h2_ele_PhiMnPhiTrueVsEta = bookH2("PhiMnPhiTrueVsEta","ele momentum  phi - gen  phi vs eta",eta2D_nbin,eta_min,eta_max,dphi_nbin/2,dphi_min,dphi_max);
00691   h2_ele_PhiMnPhiTrueVsPhi = bookH2("PhiMnPhiTrueVsPhi","ele momentum  phi - gen  phi vs phi",phi2D_nbin,phi_min,phi_max,dphi_nbin/2,dphi_min,dphi_max);
00692   h2_ele_PhiMnPhiTrueVsPt = bookH2("PhiMnPhiTrueVsPt","ele momentum  phi - gen  phi vs pt",pt2D_nbin,0.,pt_max,dphi_nbin/2,dphi_min,dphi_max);
00693   h1_ele_ecalEnergyError = bookH1withSumw2("ecalEnergyError","",30,0,30);
00694   h1_ele_ecalEnergyError_barrel = bookH1withSumw2("ecalEnergyError_barrel","",30,0,30);
00695   h1_ele_ecalEnergyError_endcaps = bookH1withSumw2("ecalEnergyError_endcaps","",30,0,30);
00696   h1_ele_combinedP4Error = bookH1withSumw2("combinedP4Error","",30,0,30);
00697   h1_ele_combinedP4Error_barrel = bookH1withSumw2("combinedP4Error_barrel","",30,0,30);
00698   h1_ele_combinedP4Error_endcaps = bookH1withSumw2("combinedP4Error_endcaps","",30,0,30);
00699 
00700   // matched electron, superclusters
00701   setBookPrefix("h_scl") ;
00702   h1_scl_En = bookH1withSumw2("energy","ele ecal energy",p_nbin,0.,p_max);
00703   h1_scl_EoEtrue_barrel = bookH1withSumw2("EoEtrue_barrel","ele ecal energy / gen energy, barrel",50,0.2,1.2,"E/E_{gen}");
00704   h1_scl_EoEtrue_barrel_eg = bookH1withSumw2("EoEtrue_barrel_eg","ele ecal energy / gen energy, barrel, ecal driven",50,0.2,1.2,"E/E_{gen}");
00705   h1_scl_EoEtrue_barrel_etagap = bookH1withSumw2("EoEtrue_barrel_etagap","ele ecal energy / gen energy, barrel, etagap",50,0.2,1.2,"E/E_{gen}");
00706   h1_scl_EoEtrue_barrel_phigap = bookH1withSumw2("EoEtrue_barrel_phigap","ele ecal energy / gen energy, barrel, phigap",50,0.2,1.2,"E/E_{gen}");
00707   h1_scl_EoEtrue_ebeegap = bookH1withSumw2("EoEtrue_ebeegap","ele ecal energy / gen energy, ebeegap",50,0.2,1.2,"E/E_{gen}");
00708   h1_scl_EoEtrue_endcaps = bookH1withSumw2("EoEtrue_endcaps","ele ecal energy / gen energy, endcaps",50,0.2,1.2,"E/E_{gen}");
00709   h1_scl_EoEtrue_endcaps_eg = bookH1withSumw2("EoEtrue_endcaps_eg","ele ecal energy / gen energy, endcaps, ecal driven",50,0.2,1.2,"E/E_{gen}");
00710   h1_scl_EoEtrue_endcaps_deegap = bookH1withSumw2("EoEtrue_endcaps_deegap","ele ecal energy / gen energy, endcaps, deegap",50,0.2,1.2,"E/E_{gen}");
00711   h1_scl_EoEtrue_endcaps_ringgap = bookH1withSumw2("EoEtrue_endcaps_ringgap","ele ecal energy / gen energy, endcaps, ringgap",50,0.2,1.2,"E/E_{gen}");
00712   h1_scl_EoEtrue_barrel_new = bookH1withSumw2("EoEtrue_barrel_new","ele ecal energy / gen energy, barrel",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
00713   h1_scl_EoEtrue_barrel_new_eg = bookH1withSumw2("EoEtrue_barrel_new_eg","ele ecal energy / gen energy, barrel, ecal driven",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
00714   h1_scl_EoEtrue_barrel_new_etagap = bookH1withSumw2("EoEtrue_barrel_new_etagap","ele ecal energy / gen energy, barrel, etagap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
00715   h1_scl_EoEtrue_barrel_new_phigap = bookH1withSumw2("EoEtrue_barrel_new_phigap","ele ecal energy / gen energy, barrel, phigap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
00716   h1_scl_EoEtrue_ebeegap_new = bookH1withSumw2("EoEtrue_ebeegap_new","ele ecal energy / gen energy, ebeegap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
00717   h1_scl_EoEtrue_endcaps_new = bookH1withSumw2("EoEtrue_endcaps_new","ele ecal energy / gen energy, endcaps",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
00718   h1_scl_EoEtrue_endcaps_new_eg = bookH1withSumw2("EoEtrue_endcaps_new_eg","ele ecal energy / gen energy, endcaps, ecal driven",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
00719   h1_scl_EoEtrue_endcaps_new_deegap = bookH1withSumw2("EoEtrue_endcaps_new_deegap","ele ecal energy / gen energy, endcaps, deegap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
00720   h1_scl_EoEtrue_endcaps_new_ringgap = bookH1withSumw2("EoEtrue_endcaps_new_ringgap","ele ecal energy / gen energy, endcaps, ringgap",poptrue_nbin,poptrue_min,poptrue_max,"E/E_{gen}");
00721   h1_scl_Et = bookH1withSumw2("et","ele supercluster transverse energy",pt_nbin,0.,pt_max);
00722   h2_scl_EtVsEta = bookH2("etVsEta","ele supercluster transverse energy vs eta",eta2D_nbin,eta_min,eta_max,pt_nbin,0.,pt_max);
00723   h2_scl_EtVsPhi = bookH2("etVsPhi","ele supercluster transverse energy vs phi",phi2D_nbin,phi_min,phi_max,pt_nbin,0.,pt_max);
00724   h2_scl_EtaVsPhi = bookH2("etaVsPhi","ele supercluster eta vs phi",phi2D_nbin,phi_min,phi_max,eta2D_nbin,eta_min,eta_max);
00725   h1_scl_Eta = bookH1withSumw2("eta","ele supercluster eta",eta_nbin,eta_min,eta_max);
00726   h1_scl_Phi = bookH1withSumw2("phi","ele supercluster phi",phi_nbin,phi_min,phi_max);
00727   h1_scl_SigEtaEta = bookH1withSumw2("sigetaeta","ele supercluster sigma eta eta",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
00728   h1_scl_SigEtaEta_barrel = bookH1withSumw2("sigetaeta_barrel","ele supercluster sigma eta eta barrel",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
00729   h1_scl_SigEtaEta_endcaps = bookH1withSumw2("sigetaeta_endcaps","ele supercluster sigma eta eta endcaps",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
00730   h1_scl_SigIEtaIEta = bookH1withSumw2("sigietaieta","ele supercluster sigma ieta ieta",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
00731   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");
00732   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");
00733   h1_scl_E1x5 = bookH1withSumw2("E1x5","ele supercluster energy in 1x5",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
00734   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");
00735   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");
00736   h1_scl_E2x5max = bookH1withSumw2("E2x5max","ele supercluster energy in 2x5 max",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
00737   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");
00738   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");
00739   h1_scl_E5x5 = bookH1withSumw2("E5x5","ele supercluster energy in 5x5",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
00740   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");
00741   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");
00742   h1_scl_SigEtaEta_eg = bookH1withSumw2("sigetaeta_eg","ele supercluster sigma eta eta, ecal driven",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
00743   h1_scl_SigEtaEta_eg_barrel = bookH1withSumw2("sigetaeta_eg_barrel","ele supercluster sigma eta eta, ecal driven barrel",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
00744   h1_scl_SigEtaEta_eg_endcaps = bookH1withSumw2("sigetaeta_eg_endcaps","ele supercluster sigma eta eta, ecal driven endcaps",100,0.,0.05,"#sigma_{#eta #eta}","Events","ELE_LOGY E1 P");
00745   h1_scl_SigIEtaIEta_eg = bookH1withSumw2("sigietaieta_eg","ele supercluster sigma ieta ieta, ecal driven",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
00746   h1_scl_SigIEtaIEta_eg_barrel = bookH1withSumw2("sigietaieta_barrel_eg","ele supercluster sigma ieta ieta, barrel, ecal driven",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
00747   h1_scl_SigIEtaIEta_eg_endcaps = bookH1withSumw2("sigietaieta_endcaps_eg","ele supercluster sigma ieta ieta, endcaps, ecal driven",100,0.,0.05,"#sigma_{i#eta i#eta}","Events","ELE_LOGY E1 P");
00748   h1_scl_E1x5_eg = bookH1withSumw2("E1x5_eg","ele supercluster energy in 1x5, ecal driven",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
00749   h1_scl_E1x5_eg_barrel = bookH1withSumw2("E1x5_eg_barrel","ele supercluster energy in 1x5, ecal driven barrel",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
00750   h1_scl_E1x5_eg_endcaps = bookH1withSumw2("E1x5_eg_endcaps","ele supercluster energy in 1x5, ecal driven endcaps",p_nbin,0., p_max,"E1x5 (GeV)","Events","ELE_LOGY E1 P");
00751   h1_scl_E2x5max_eg = bookH1withSumw2("E2x5max_eg","ele supercluster energy in 2x5 _max, ecal driven",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
00752   h1_scl_E2x5max_eg_barrel = bookH1withSumw2("E2x5max_eg_barrel","ele supercluster energy in 2x5 _max, ecal driven barrel",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
00753   h1_scl_E2x5max_eg_endcaps = bookH1withSumw2("E2x5max_eg_endcaps","ele supercluster energy in 2x5 _max, ecal driven endcaps",p_nbin,0.,p_max,"E2x5 (GeV)","Events","ELE_LOGY E1 P");
00754   h1_scl_E5x5_eg = bookH1withSumw2("E5x5_eg","ele supercluster energy in 5x5, ecal driven",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
00755   h1_scl_E5x5_eg_barrel = bookH1withSumw2("E5x5_eg_barrel","ele supercluster energy in 5x5, ecal driven barrel",p_nbin,0.,p_max,"E5x5 (GeV)","Events","ELE_LOGY E1 P");
00756   h1_scl_E5x5_eg_endcaps = bookH1withSumw2("E5x5_eg_endcaps","ele supercluster energy in 5x5, ecal driven endcaps",p_nbin,0.,p_max,"E5x5 (GeV)");
00757   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)") ;
00758 
00759   // matched electron, gsf tracks
00760   setBookPrefix("h_ele") ;
00761   h1_ele_ambiguousTracks = bookH1withSumw2("ambiguousTracks","ele # ambiguous tracks",  5,0.,5.,"N_{ambiguous tracks}","Events","ELE_LOGY E1 P");
00762   h2_ele_ambiguousTracksVsEta = bookH2("ambiguousTracksVsEta","ele # ambiguous tracks vs eta",eta2D_nbin,eta_min,eta_max,5,0.,5.);
00763   h2_ele_ambiguousTracksVsPhi = bookH2("ambiguousTracksVsPhi","ele # ambiguous tracks vs phi",phi2D_nbin,phi_min,phi_max,5,0.,5.);
00764   h2_ele_ambiguousTracksVsPt = bookH2("ambiguousTracksVsPt","ele # ambiguous tracks vs pt",pt2D_nbin,0.,pt_max,5,0.,5.);
00765   h1_ele_foundHits = bookH1withSumw2("foundHits","ele track # found hits",fhits_nbin,0.,fhits_max,"N_{hits}");
00766   h1_ele_foundHits_barrel = bookH1withSumw2("foundHits_barrel","ele track # found hits, barrel",fhits_nbin,0.,fhits_max,"N_{hits}");
00767   h1_ele_foundHits_endcaps = bookH1withSumw2("foundHits_endcaps","ele track # found hits, endcaps",fhits_nbin,0.,fhits_max,"N_{hits}");
00768   h2_ele_foundHitsVsEta = bookH2("foundHitsVsEta","ele track # found hits vs eta",eta2D_nbin,eta_min,eta_max,fhits_nbin,0.,fhits_max);
00769   h2_ele_foundHitsVsPhi = bookH2("foundHitsVsPhi","ele track # found hits vs phi",phi2D_nbin,phi_min,phi_max,fhits_nbin,0.,fhits_max);
00770   h2_ele_foundHitsVsPt = bookH2("foundHitsVsPt","ele track # found hits vs pt",pt2D_nbin,0.,pt_max,fhits_nbin,0.,fhits_max);
00771   h1_ele_lostHits = bookH1withSumw2("lostHits","ele track # lost hits",       5,0.,5.,"N_{lost hits}");
00772   h1_ele_lostHits_barrel = bookH1withSumw2("lostHits_barrel","ele track # lost hits, barrel",       5,0.,5.,"N_{lost hits}");
00773   h1_ele_lostHits_endcaps = bookH1withSumw2("lostHits_endcaps","ele track # lost hits, endcaps",       5,0.,5.,"N_{lost hits}");
00774   h2_ele_lostHitsVsEta = bookH2("lostHitsVsEta","ele track # lost hits vs eta",eta2D_nbin,eta_min,eta_max,lhits_nbin,0.,lhits_max);
00775   h2_ele_lostHitsVsPhi = bookH2("lostHitsVsPhi","ele track # lost hits vs eta",phi2D_nbin,phi_min,phi_max,lhits_nbin,0.,lhits_max);
00776   h2_ele_lostHitsVsPt = bookH2("lostHitsVsPt","ele track # lost hits vs eta",pt2D_nbin,0.,pt_max,lhits_nbin,0.,lhits_max);
00777   h1_ele_chi2 = bookH1withSumw2("chi2","ele track #chi^{2}",100,0.,15.,"#Chi^{2}","Events","ELE_LOGY E1 P");
00778   h1_ele_chi2_barrel = bookH1withSumw2("chi2_barrel","ele track #chi^{2}, barrel",100,0.,15.,"#Chi^{2}","Events","ELE_LOGY E1 P");
00779   h1_ele_chi2_endcaps = bookH1withSumw2("chi2_endcaps","ele track #chi^{2}, endcaps",100,0.,15.,"#Chi^{2}","Events","ELE_LOGY E1 P");
00780   h2_ele_chi2VsEta = bookH2("chi2VsEta","ele track #chi^{2} vs eta",eta2D_nbin,eta_min,eta_max,50,0.,15.);
00781   h2_ele_chi2VsPhi = bookH2("chi2VsPhi","ele track #chi^{2} vs phi",phi2D_nbin,phi_min,phi_max,50,0.,15.);
00782   h2_ele_chi2VsPt = bookH2("chi2VsPt","ele track #chi^{2} vs pt",pt2D_nbin,0.,pt_max,50,0.,15.);
00783   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)");
00784   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)");
00785   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.);
00786   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.);
00787   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.);
00788   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.);
00789   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.);
00790   h1_ele_outerP = bookH1withSumw2("outerP","ele track outer p, mean of GSF components",p_nbin,0.,p_max,"P_{out} (GeV/c)");
00791   h1_ele_outerP_mode = bookH1withSumw2("outerP_mode","ele track outer p, mode of GSF components",p_nbin,0.,p_max,"P_{out} (GeV/c)");
00792   h2_ele_outerPVsEta_mode = bookH2("outerPVsEta_mode","ele track outer p vs eta mode",eta2D_nbin,eta_min,eta_max,50,0.,p_max);
00793   h1_ele_outerPt = bookH1withSumw2("outerPt","ele track outer p_{T}, mean of GSF components",pt_nbin,0.,pt_max,"P_{T out} (GeV/c)");
00794   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)");
00795   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);
00796   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);
00797   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);
00798 
00799   // matched electrons, matching
00800   h1_ele_EoP = bookH1withSumw2("EoP","ele E/P_{vertex}",eop_nbin,0.,eop_max,"E/P_{vertex}","Events","ELE_LOGY E1 P");
00801   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");
00802   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");
00803   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");
00804   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");
00805   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");
00806   h2_ele_EoPVsEta = bookH2("EoPVsEta","ele E/P_{vertex} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
00807   h2_ele_EoPVsPhi = bookH2("EoPVsPhi","ele E/P_{vertex} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
00808   h2_ele_EoPVsE = bookH2("EoPVsE","ele E/P_{vertex} vs E",  50,0.,p_max ,50,0.,5.);
00809   h1_ele_EseedOP = bookH1withSumw2("EseedOP","ele E_{seed}/P_{vertex}",eop_nbin,0.,eop_max,"E_{seed}/P_{vertex}","Events","ELE_LOGY E1 P");
00810   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");
00811   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");
00812   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");
00813   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");
00814   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");
00815   h2_ele_EseedOPVsEta = bookH2("EseedOPVsEta","ele E_{seed}/P_{vertex} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
00816   h2_ele_EseedOPVsPhi = bookH2("EseedOPVsPhi","ele E_{seed}/P_{vertex} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
00817   h2_ele_EseedOPVsE = bookH2("EseedOPVsE","ele E_{seed}/P_{vertex} vs E",  50,0.,p_max ,50,0.,5.);
00818   h1_ele_EoPout = bookH1withSumw2("EoPout","ele E_{seed}/P_{out}",eop_nbin,0.,eop_max,"E_{seed}/P_{out}","Events","ELE_LOGY E1 P");
00819   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");
00820   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");
00821   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");
00822   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");
00823   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");
00824   h2_ele_EoPoutVsEta = bookH2("EoPoutVsEta","ele E_{seed}/P_{out} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
00825   h2_ele_EoPoutVsPhi = bookH2("EoPoutVsPhi","ele E_{seed}/P_{out} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
00826   h2_ele_EoPoutVsE = bookH2("EoPoutVsE","ele E_{seed}/P_{out} vs E",p2D_nbin,0.,p_max,eop2D_nbin,0.,eopmaxsht);
00827   h1_ele_EeleOPout = bookH1withSumw2("EeleOPout","ele E_{ele}/P_{out}",eop_nbin,0.,eop_max,"E_{ele}/P_{out}","Events","ELE_LOGY E1 P");
00828   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");
00829   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");
00830   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");
00831   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");
00832   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");
00833   h2_ele_EeleOPoutVsEta = bookH2("EeleOPoutVsEta","ele E_{ele}/P_{out} vs eta",eta2D_nbin,eta_min,eta_max,eop2D_nbin,0.,eopmaxsht);
00834   h2_ele_EeleOPoutVsPhi = bookH2("EeleOPoutVsPhi","ele E_{ele}/P_{out} vs phi",phi2D_nbin,phi_min,phi_max,eop2D_nbin,0.,eopmaxsht);
00835   h2_ele_EeleOPoutVsE = bookH2("EeleOPoutVsE","ele E_{ele}/P_{out} vs E",p2D_nbin,0.,p_max,eop2D_nbin,0.,eopmaxsht);
00836   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");
00837   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");
00838   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");
00839   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");
00840   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");
00841   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");
00842   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);
00843   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);
00844   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);
00845   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");
00846   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");
00847   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");
00848   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");
00849   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");
00850   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");
00851   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);
00852   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);
00853   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);
00854   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");
00855   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");
00856   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");
00857   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");
00858   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");
00859   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");
00860   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);
00861   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);
00862   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);
00863   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");
00864   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");
00865   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");
00866   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");
00867   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");
00868   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");
00869   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);
00870   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);
00871   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);
00872   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");
00873   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");
00874   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");
00875   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");
00876   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");
00877   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");
00878   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);
00879   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);
00880   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);
00881   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");
00882   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");
00883   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");
00884   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");
00885   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");
00886   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");
00887   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);
00888   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);
00889   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);
00890   h1_ele_HoE = bookH1withSumw2("HoE","ele hadronic energy / em energy",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00891   h1_ele_HoE_bc = bookH1withSumw2("HoE_bc","ele hadronic energy / em energy behind cluster",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00892   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") ;
00893   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") ;
00894   h1_ele_HoE_bc_barrel = bookH1withSumw2("HoE_bc_barrel","ele hadronic energy / em energy, behind cluster barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00895   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") ;
00896   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") ;
00897   h1_ele_HoE_bc_endcaps = bookH1withSumw2("HoE_bc_endcaps","ele hadronic energy / em energy, behind cluster, endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P") ;
00898   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") ;
00899   h1_ele_hcalDepth1OverEcalBc = bookH1withSumw2("hcalDepth1OverEcalBc","hcalDepth1OverEcalBc",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
00900   h1_ele_hcalDepth1OverEcalBc_barrel = bookH1withSumw2("hcalDepth1OverEcalBc_barrel","hcalDepth1OverEcalBc_barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
00901   h1_ele_hcalDepth1OverEcalBc_endcaps = bookH1withSumw2("hcalDepth1OverEcalBc_endcaps","hcalDepth1OverEcalBc_endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
00902   h1_ele_hcalDepth2OverEcalBc = bookH1withSumw2("hcalDepth2OverEcalBc","hcalDepth2OverEcalBc",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
00903   h1_ele_hcalDepth2OverEcalBc_barrel = bookH1withSumw2("hcalDepth2OverEcalBc_barrel","hcalDepth2OverEcalBc_barrel",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
00904   h1_ele_hcalDepth2OverEcalBc_endcaps = bookH1withSumw2("hcalDepth2OverEcalBc_endcaps","hcalDepth2OverEcalBc_endcaps",hoe_nbin, hoe_min, hoe_max,"H/E","Events","ELE_LOGY E1 P");
00905 
00906   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") ;
00907   h2_ele_HoEVsEta = bookH2("HoEVsEta","ele hadronic energy / em energy vs eta",eta_nbin,eta_min,eta_max,hoe_nbin, hoe_min, hoe_max) ;
00908   h2_ele_HoEVsPhi = bookH2("HoEVsPhi","ele hadronic energy / em energy vs phi",phi2D_nbin,phi_min,phi_max,hoe_nbin, hoe_min, hoe_max) ;
00909   h2_ele_HoEVsE = bookH2("HoEVsE","ele hadronic energy / em energy vs E",p_nbin, 0.,300.,hoe_nbin, hoe_min, hoe_max) ;
00910 
00911   // seeds
00912   h1_ele_seed_subdet2 = bookH1withSumw2("seedSubdet2","ele seed subdet 2nd layer",11,-0.5,10.5,"2nd hit subdet Id") ;
00913   h1_ele_seed_mask = bookH1withSumw2("seedMask","ele seed hits mask",13,-0.5,12.5) ;
00914   h1_ele_seed_mask_bpix = bookH1withSumw2("seedMask_Bpix","ele seed hits mask when subdet2 is bpix",13,-0.5,12.5) ;
00915   h1_ele_seed_mask_fpix = bookH1withSumw2("seedMask_Fpix","ele seed hits mask when subdet2 is fpix",13,-0.5,12.5) ;
00916   h1_ele_seed_mask_tec = bookH1withSumw2("seedMask_Tec","ele seed hits mask when subdet2 is tec",13,-0.5,12.5) ;
00917   h1_ele_seed_dphi2 = bookH1withSumw2("seedDphi2","ele seed dphi 2nd layer", 50,-0.010,+0.010,"#phi_{hit}-#phi_{pred} (rad)") ;
00918   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) ;
00919   h2_ele_seed_dphi2VsPt = bookH2("seedDphi2_VsPt","ele seed dphi 2nd layer vs pt",pt2D_nbin,0.,pt_max,50,-0.003,+0.003) ;
00920   h1_ele_seed_dphi2pos = bookH1withSumw2("seedDphi2Pos","ele seed dphi 2nd layer positron", 50,-0.010,+0.010,"#phi_{hit}-#phi_{pred} (rad)") ;
00921   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) ;
00922   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) ;
00923   h1_ele_seed_drz2 = bookH1withSumw2("seedDrz2","ele seed dr (dz) 2nd layer", 50,-0.03,+0.03,"r(z)_{hit}-r(z)_{pred} (cm)") ;
00924   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) ;
00925   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) ;
00926   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)") ;
00927   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) ;
00928   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) ;
00929 
00930   // classes
00931   h1_ele_classes = bookH1withSumw2("classes","ele classes",20,0.0,20.,"class Id");
00932   h1_ele_eta = bookH1withSumw2("eta","ele electron eta",eta_nbin/2,0.0,eta_max);
00933   h1_ele_eta_golden = bookH1withSumw2("eta_golden","ele electron eta golden",eta_nbin/2,0.0,eta_max);
00934   h1_ele_eta_bbrem = bookH1withSumw2("eta_bbrem","ele electron eta bbrem",eta_nbin/2,0.0,eta_max);
00935   h1_ele_eta_shower = bookH1withSumw2("eta_shower","ele electron eta showering",eta_nbin/2,0.0,eta_max);
00936   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);
00937   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);
00938   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);
00939   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);
00940   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);
00941   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);
00942   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);
00943   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);
00944   setBookPrefix("h_scl") ;
00945   h1_scl_EoEtrueGolden_barrel = bookH1withSumw2("EoEtrue_golden_barrel","ele supercluster energy / gen energy, golden, barrel",poptrue_nbin,poptrue_min,poptrue_max);
00946   h1_scl_EoEtrueGolden_endcaps = bookH1withSumw2("EoEtrue_golden_endcaps","ele supercluster energy / gen energy, golden, endcaps",poptrue_nbin,poptrue_min,poptrue_max);
00947   h1_scl_EoEtrueShowering_barrel = bookH1withSumw2("EoEtrue_showering_barrel","ele supercluster energy / gen energy, showering, barrel",poptrue_nbin,poptrue_min,poptrue_max);
00948   h1_scl_EoEtrueShowering_endcaps = bookH1withSumw2("EoEtrue_showering_endcaps","ele supercluster energy / gen energy, showering, endcaps",poptrue_nbin,poptrue_min,poptrue_max);
00949 
00950   // isolation
00951   setBookPrefix("h_ele") ;
00952   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");
00953   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");
00954   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");
00955   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");
00956   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");
00957   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");
00958   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");
00959   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");
00960   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");
00961   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");
00962   h1_ele_hcalTowerSumEt_dr03_depth2_barrel = bookH1withSumw2("hcalTowerSumEt_dr03_depth2_barrel","hcal depth2 isolation sum, dR=0.3",100,0.0,20.,"Hcal2IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00963   h1_ele_hcalTowerSumEt_dr03_depth2_endcaps = bookH1withSumw2("hcalTowerSumEt_dr03_depth2_endcaps","hcal depth2 isolation sum, dR=0.3",100,0.0,20.,"Hcal2IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00964   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");
00965   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");
00966   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");
00967   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");
00968   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");
00969   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");
00970   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");
00971   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");
00972   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");
00973   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");
00974   h1_ele_hcalTowerSumEt_dr04_depth2_barrel = bookH1withSumw2("hcalTowerSumEt_dr04_depth2_barrel","hcal depth2 isolation sum, dR=0.4",100,0.0,20.,"Hcal2IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00975   h1_ele_hcalTowerSumEt_dr04_depth2_endcaps = bookH1withSumw2("hcalTowerSumEt_dr04_depth2_endcaps","hcal depth2 isolation sum, dR=0.4",100,0.0,20.,"Hcal2IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00976 
00977   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");
00978   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");
00979   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");
00980   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");
00981   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");
00982   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");
00983   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");
00984   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");
00985 
00986   // newHCAL
00987     // isolation new hcal
00988   h1_ele_hcalTowerSumEtBc_dr03_depth1 = bookH1withSumw2("hcalTowerSumEtBc_dr03_depth1","hcal depth1 isolation sum behind cluster, dR=0.3",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00989   h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel = bookH1withSumw2("hcalTowerSumEtBc_dr03_depth1_barrel","hcal depth1 isolation sum behind cluster, dR=0.3, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00990   h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps = bookH1withSumw2("hcalTowerSumEtBc_dr03_depth1_endcaps","hcal depth1 isolation sum behind cluster, dR=0.3, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00991 
00992   h1_ele_hcalTowerSumEtBc_dr04_depth1 = bookH1withSumw2("hcalTowerSumEtBc_dr04_depth1","hcal depth1 isolation sum behind cluster, dR=0.4",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00993   h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel = bookH1withSumw2("hcalTowerSumEtBc_dr04_depth1_barrel","hcal depth1 isolation sum behind cluster, dR=0.4, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00994   h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps = bookH1withSumw2("hcalTowerSumEtBc_dr04_depth1_endcaps","hcal depth1 isolation sum behind cluster, dR=0.4, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
00995 
00996   h1_ele_hcalTowerSumEtBc_dr03_depth2 = bookH1withSumw2("hcalTowerSumEtBc_dr03_depth2","hcal depth2 isolation sum behind cluster, dR=0.3",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00997   h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel = bookH1withSumw2("hcalTowerSumEtBc_dr03_depth2_barrel","hcal depth2 isolation sum behind cluster, dR=0.3, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00998   h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps = bookH1withSumw2("hcalTowerSumEtBc_dr03_depth2_endcaps","hcal depth2 isolation sum behind cluster, dR=0.3, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.3 (GeV)","Events","ELE_LOGY E1 P");
00999 
01000   h1_ele_hcalTowerSumEtBc_dr04_depth2 = bookH1withSumw2("hcalTowerSumEtBc_dr04_depth2","hcal depth2 isolation sum behind cluster, dR=0.4",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
01001   h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel = bookH1withSumw2("hcalTowerSumEtBc_dr04_depth2_barrel","hcal depth2 isolation sum behind cluster, dR=0.4, barrel",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
01002   h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps = bookH1withSumw2("hcalTowerSumEtBc_dr04_depth2_endcaps","hcal depth2 isolation sum behind cluster, dR=0.4, endcaps",100,0.0,20.,"Hcal1IsoSum, cone 0.4 (GeV)","Events","ELE_LOGY E1 P");
01003 
01004   // fbrem
01005   h1_ele_fbrem = bookH1withSumw2("fbrem","ele brem fraction, mode of GSF components",100,0.,1.,"P_{in} - P_{out} / P_{in}");
01006   h1_ele_fbrem_barrel = bookH1withSumw2("fbrem_barrel","ele brem fraction for barrel, mode of GSF components", 100, 0.,1.,"P_{in} - P_{out} / P_{in}");
01007   h1_ele_fbrem_endcaps = bookH1withSumw2("fbrem_endcaps", "ele brem franction for endcaps, mode of GSF components", 100, 0.,1.,"P_{in} - P_{out} / P_{in}");
01008   h1_ele_fbrem_eg = bookH1withSumw2("brem_eg","ele brem fraction, mode of GSF components, ecal driven",100,0.,1.);
01009   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}>");
01010   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}>");
01011   h1_ele_chargeInfo = bookH1withSumw2("chargeInfo","chargeInfo",5,-2.,3.);
01012 
01013   // e/g et pflow electrons
01014   h1_ele_mva = bookH1withSumw2("mva","ele identification mva",100,-1.,1.);
01015   h1_ele_mva_barrel = bookH1withSumw2("mva_barrel", "ele identification mva barrel",100,-1.,1.);
01016   h1_ele_mva_endcaps = bookH1withSumw2("mva_endcaps", "ele identification mva endcaps",100,-1.,1.);
01017   h1_ele_mva_eg = bookH1withSumw2("mva_eg","ele identification mva, ecal driven",100,-1.,1.);
01018   h1_ele_provenance = bookH1withSumw2("provenance","ele provenance",5,-2.,3.);
01019   h1_ele_provenance_barrel = bookH1withSumw2("provenance_barrel","ele provenance barrel",5,-2.,3.);
01020   h1_ele_provenance_endcaps = bookH1withSumw2("provenance_endcaps","ele provenance endcaps",5,-2.,3.);
01021 
01022   // pflow isolation variables
01023   h1_ele_chargedHadronIso = bookH1withSumw2("chargedHadronIso","chargedHadronIso",100,0.0,20.,"chargedHadronIso","Events","ELE_LOGY E1 P");
01024   h1_ele_chargedHadronIso_barrel = bookH1withSumw2("chargedHadronIso_barrel","chargedHadronIso for barrel",100,0.0,20.,"chargedHadronIso_barrel","Events","ELE_LOGY E1 P");
01025   h1_ele_chargedHadronIso_endcaps = bookH1withSumw2("chargedHadronIso_endcaps","chargedHadronIso for endcaps",100,0.0,20.,"chargedHadronIso_endcaps","Events","ELE_LOGY E1 P");
01026   h1_ele_neutralHadronIso = bookH1withSumw2("neutralHadronIso","neutralHadronIso",21,0.0,20.,"neutralHadronIso","Events", "ELE_LOGY E1 P");
01027   h1_ele_neutralHadronIso_barrel = bookH1withSumw2("neutralHadronIso_barrel","neutralHadronIso for barrel",21,0.0,20.,"neutralHadronIso_barrel","Events","ELE_LOGY E1 P");
01028   h1_ele_neutralHadronIso_endcaps = bookH1withSumw2("neutralHadronIso_endcaps","neutralHadronIso for endcaps",21,0.0,20.,"neutralHadronIso_endcaps","Events","ELE_LOGY E1 P");
01029   h1_ele_photonIso = bookH1withSumw2("photonIso","photonIso",100,0.0,20.,"photonIso","Events","ELE_LOGY E1 P");
01030   h1_ele_photonIso_barrel = bookH1withSumw2("photonIso_barrel","photonIso for barrel",100,0.0,20.,"photonIso_barrel","Events","ELE_LOGY E1 P");
01031   h1_ele_photonIso_endcaps = bookH1withSumw2("photonIso_endcaps","photonIso for endcaps",100,0.0,20.,"photonIso_endcaps","Events","ELE_LOGY E1 P");
01032 
01033   // conversion rejection information
01034   h1_ele_convFlags = bookH1withSumw2("convFlags","conversion rejection flag",5,-1.5,3.5);
01035   h1_ele_convFlags_all = bookH1withSumw2("convFlags_all","conversion rejection flag, all electrons",5,-1.5,3.5);
01036   h1_ele_convDist = bookH1withSumw2("convDist","distance to the conversion partner",100,-15.,15.);
01037   h1_ele_convDist_all = bookH1withSumw2("convDist_all","distance to the conversion partner, all electrons",100,-15.,15.);
01038   h1_ele_convDcot = bookH1withSumw2("convDcot","difference of cot(angle) with the conversion partner",100,-CLHEP::pi/2.,CLHEP::pi/2.);
01039   h1_ele_convDcot_all = bookH1withSumw2("convDcot_all","difference of cot(angle) with the conversion partner, all electrons",100,-CLHEP::pi/2.,CLHEP::pi/2.);
01040   h1_ele_convRadius = bookH1withSumw2("convRadius","signed conversion radius",100,0.,130.);
01041   h1_ele_convRadius_all = bookH1withSumw2("convRadius_all","signed conversion radius, all electrons",100,0.,130.);
01042 
01043  }
01044 
01045 ElectronMcSignalValidator::~ElectronMcSignalValidator()
01046  {}
01047 
01048 void ElectronMcSignalValidator::analyze( const edm::Event & iEvent, const edm::EventSetup & iSetup )
01049  {
01050   // get collections
01051   edm::Handle<GsfElectronCollection> gsfElectrons ;
01052   iEvent.getByLabel(electronCollection_,gsfElectrons) ;
01053   edm::Handle<GsfElectronCoreCollection> gsfElectronCores ;
01054   iEvent.getByLabel(electronCoreCollection_,gsfElectronCores) ;
01055   edm::Handle<GsfTrackCollection> gsfElectronTracks ;
01056   iEvent.getByLabel(electronTrackCollection_,gsfElectronTracks) ;
01057   edm::Handle<ElectronSeedCollection> gsfElectronSeeds ;
01058   iEvent.getByLabel(electronSeedCollection_,gsfElectronSeeds) ;
01059   edm::Handle<GenParticleCollection> genParticles ;
01060   iEvent.getByLabel(mcTruthCollection_, genParticles) ;
01061   edm::Handle<reco::BeamSpot> theBeamSpot ;
01062   iEvent.getByLabel(beamSpotTag_,theBeamSpot) ;
01063 
01064   edm::Handle<edm::ValueMap<double> > isoFromDepsTk03Handle          ;   iEvent.getByLabel( isoFromDepsTk03Tag_         , isoFromDepsTk03Handle          ) ;
01065   edm::Handle<edm::ValueMap<double> > isoFromDepsTk04Handle          ;   iEvent.getByLabel( isoFromDepsTk04Tag_         , isoFromDepsTk04Handle          ) ;
01066   edm::Handle<edm::ValueMap<double> > isoFromDepsEcalFull03Handle    ;   iEvent.getByLabel( isoFromDepsEcalFull03Tag_   , isoFromDepsEcalFull03Handle    ) ;
01067   edm::Handle<edm::ValueMap<double> > isoFromDepsEcalFull04Handle    ;   iEvent.getByLabel( isoFromDepsEcalFull04Tag_   , isoFromDepsEcalFull04Handle    ) ;
01068   edm::Handle<edm::ValueMap<double> > isoFromDepsEcalReduced03Handle ;   iEvent.getByLabel( isoFromDepsEcalReduced03Tag_, isoFromDepsEcalReduced03Handle ) ;
01069   edm::Handle<edm::ValueMap<double> > isoFromDepsEcalReduced04Handle ;   iEvent.getByLabel( isoFromDepsEcalReduced04Tag_, isoFromDepsEcalReduced04Handle ) ;
01070   edm::Handle<edm::ValueMap<double> > isoFromDepsHcal03Handle        ;   iEvent.getByLabel( isoFromDepsHcal03Tag_       , isoFromDepsHcal03Handle        ) ;
01071   edm::Handle<edm::ValueMap<double> > isoFromDepsHcal04Handle        ;   iEvent.getByLabel( isoFromDepsHcal04Tag_       , isoFromDepsHcal04Handle        ) ;
01072 
01073   edm::LogInfo("ElectronMcSignalValidator::analyze")
01074     <<"Treating event "<<iEvent.id()
01075     <<" with "<<gsfElectrons.product()->size()<<" electrons" ;
01076   h1_recEleNum->Fill((*gsfElectrons).size()) ;
01077   h1_recCoreNum->Fill((*gsfElectronCores).size());
01078   h1_recTrackNum->Fill((*gsfElectronTracks).size());
01079   h1_recSeedNum->Fill((*gsfElectronSeeds).size());
01080 
01081   //===============================================
01082   // all rec electrons
01083   //===============================================
01084 
01085   reco::GsfElectronCollection::const_iterator gsfIter ;
01086   for ( gsfIter=gsfElectrons->begin() ; gsfIter!=gsfElectrons->end() ; gsfIter++ )
01087    {
01088     // preselect electrons
01089     if (gsfIter->pt()>maxPt_ || std::abs(gsfIter->eta())>maxAbsEta_) continue ;
01090 
01091     //
01092     h1_ele_EoverP_all->Fill(gsfIter->eSuperClusterOverP()) ;
01093     h1_ele_EseedOP_all->Fill(gsfIter->eSeedClusterOverP()) ;
01094     h1_ele_EoPout_all->Fill(gsfIter->eSeedClusterOverPout()) ;
01095     h1_ele_EeleOPout_all->Fill( gsfIter->eEleClusterOverPout()) ;
01096     h1_ele_dEtaSc_propVtx_all->Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx()) ;
01097     h1_ele_dPhiSc_propVtx_all->Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx()) ;
01098     h1_ele_dEtaCl_propOut_all->Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo()) ;
01099     h1_ele_dPhiCl_propOut_all->Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo()) ;
01100     h1_ele_HoE_all->Fill(gsfIter->hcalOverEcal()) ;
01101     h1_ele_HoE_bc_all->Fill(gsfIter->hcalOverEcalBc()) ;
01102     h1_ele_TIP_all->Fill( EleRelPoint(gsfIter->vertex(),theBeamSpot->position()).perp() );
01103     h1_ele_vertexEta_all->Fill( gsfIter->eta() );
01104     h1_ele_vertexPt_all->Fill( gsfIter->pt() );
01105     h1_ele_Et_all->Fill( gsfIter->ecalEnergy()/cosh(gsfIter->superCluster()->eta()));
01106     float enrj1=gsfIter->ecalEnergy();
01107 
01108     // mee
01109     reco::GsfElectronCollection::const_iterator gsfIter2 ;
01110     for ( gsfIter2=gsfIter+1 ; gsfIter2!=gsfElectrons->end() ; gsfIter2++ )
01111      {
01112       math::XYZTLorentzVector p12 = (*gsfIter).p4()+(*gsfIter2).p4();
01113       float mee2 = p12.Dot(p12);
01114       float enrj2=gsfIter2->ecalEnergy() ;
01115       h1_ele_mee_all->Fill(sqrt(mee2));
01116       h2_ele_E2mnE1vsMee_all->Fill(sqrt(mee2),enrj2-enrj1);
01117       if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
01118        { h2_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2),enrj2-enrj1) ; }
01119       if (gsfIter->charge()*gsfIter2->charge()<0.)
01120        {
01121         h1_ele_mee_os->Fill(sqrt(mee2));
01122         if (gsfIter->isEB() && gsfIter2->isEB()) { h1_ele_mee_os_ebeb->Fill(sqrt(mee2)) ; }
01123               if ((gsfIter->isEB() && gsfIter2->isEE()) || (gsfIter->isEE() && gsfIter2->isEB())) h1_ele_mee_os_ebee -> Fill(sqrt(mee2));
01124         if (gsfIter->isEE() && gsfIter2->isEE()) { h1_ele_mee_os_eeee->Fill(sqrt(mee2)) ; }
01125         if
01126          ( (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::GOLDEN) ||
01127            (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::BIGBREM) ||
01128            (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::GOLDEN) ||
01129            (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::BIGBREM) )
01130          { h1_ele_mee_os_gg->Fill(sqrt(mee2)) ; }
01131         else if
01132          ( (gsfIter->classification()==GsfElectron::SHOWERING && gsfIter2->classification()==GsfElectron::SHOWERING) ||
01133            (gsfIter->classification()==GsfElectron::SHOWERING && gsfIter2->isGap()) ||
01134            (gsfIter->isGap() && gsfIter2->classification()==GsfElectron::SHOWERING) ||
01135            (gsfIter->isGap() && gsfIter2->isGap()) )
01136          { h1_ele_mee_os_bb->Fill(sqrt(mee2)) ; }
01137         else
01138          { h1_ele_mee_os_gb->Fill(sqrt(mee2)) ; }
01139        }
01140      }
01141 
01142     // conversion rejection
01143     int flags = gsfIter->convFlags() ;
01144     if (flags==-9999) { flags=-1 ; }
01145     h1_ele_convFlags_all->Fill(flags);
01146     if (flags>=0.)
01147      {
01148       h1_ele_convDist_all->Fill( gsfIter->convDist() );
01149       h1_ele_convDcot_all->Fill( gsfIter->convDcot() );
01150       h1_ele_convRadius_all->Fill( gsfIter->convRadius() );
01151      }
01152    }
01153 
01154   //===============================================
01155   // charge mis-ID
01156   //===============================================
01157 
01158   int mcNum=0, gamNum=0, eleNum=0 ;
01159   bool matchingID, matchingMotherID ;
01160 
01161   reco::GenParticleCollection::const_iterator mcIter ;
01162   for
01163    ( mcIter=genParticles->begin() ; mcIter!=genParticles->end() ; mcIter++ )
01164    {
01165     // select requested matching gen particle
01166     matchingID=false;
01167     for ( unsigned int i=0 ; i<matchingIDs_.size() ; i++ )
01168      {
01169       if ( mcIter->pdgId() == matchingIDs_[i] )
01170        { matchingID=true ; }
01171      }
01172     if (matchingID)
01173      {
01174       // select requested mother matching gen particle
01175       // always include single particle with no mother
01176       const Candidate * mother = mcIter->mother() ;
01177       matchingMotherID = false ;
01178       for ( unsigned int i=0 ; i<matchingMotherIDs_.size() ; i++ )
01179        {
01180         if ((mother == 0) || ((mother != 0) &&  mother->pdgId() == matchingMotherIDs_[i]) )
01181          { matchingMotherID = true ; }
01182        }
01183       if (matchingMotherID)
01184        {
01185         if ( mcIter->pt()>maxPt_ || std::abs(mcIter->eta())>maxAbsEta_ )
01186          { continue ; }
01187         // suppress the endcaps
01188         //if (std::abs(mcIter->eta()) > 1.5) continue;
01189         // select central z
01190         //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
01191 
01192         // looking for the best matching gsf electron
01193         bool okGsfFound = false ;
01194         double gsfOkRatio = 999999. ;
01195 
01196         // find best matched electron
01197         reco::GsfElectron bestGsfElectron ;
01198         reco::GsfElectronCollection::const_iterator gsfIter ;
01199         for
01200          ( gsfIter=gsfElectrons->begin() ; gsfIter!=gsfElectrons->end() ; gsfIter++ )
01201          {
01202           double dphi = gsfIter->phi()-mcIter->phi() ;
01203           if (std::abs(dphi)>CLHEP::pi)
01204            { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
01205           double deltaR = sqrt(pow((gsfIter->eta()-mcIter->eta()),2) + pow(dphi,2)) ;
01206           if ( deltaR < deltaR_ )
01207            {
01208             double mc_charge = mcIter->pdgId() == 11 ? -1. : 1. ;
01209             h1_ele_ChargeMnChargeTrue->Fill( std::abs(gsfIter->charge()-mc_charge));
01210             // require here a charge mismatch
01211             if
01212              ( ( (mcIter->pdgId() == 11) && (gsfIter->charge() > 0.) ) ||
01213                ( (mcIter->pdgId() == -11) && (gsfIter->charge() < 0.) ) )
01214              {
01215               double tmpGsfRatio = gsfIter->p()/mcIter->p();
01216               if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) )
01217                {
01218                 gsfOkRatio = tmpGsfRatio;
01219                 bestGsfElectron=*gsfIter;
01220                 okGsfFound = true;
01221                }
01222              }
01223            }
01224          } // loop over rec ele to look for the best one
01225 
01226         // analysis when the mc track is found
01227         if (okGsfFound)
01228          {
01229           // generated distributions for matched electrons
01230           h1_mc_Pt_matched_qmisid->Fill( mcIter->pt() ) ;
01231           h1_mc_Phi_matched_qmisid->Fill( mcIter->phi() ) ;
01232           h1_mc_AbsEta_matched_qmisid->Fill( std::abs(mcIter->eta()) ) ;
01233           h1_mc_Eta_matched_qmisid->Fill( mcIter->eta() ) ;
01234           h1_mc_Z_matched_qmisid->Fill( mcIter->vz() ) ;
01235          }
01236        }
01237      }
01238    }
01239 
01240   //===============================================
01241   // association mc-reco
01242   //===============================================
01243 
01244   for ( mcIter=genParticles->begin() ; mcIter!=genParticles->end() ; mcIter++ )
01245    {
01246     // number of mc particles
01247     mcNum++ ;
01248 
01249     // counts photons
01250     if (mcIter->pdgId() == 22 )
01251      { gamNum++ ; }
01252 
01253     // select requested matching gen particle
01254     matchingID = false ;
01255     for ( unsigned int i=0 ; i<matchingIDs_.size() ; i++ )
01256      {
01257       if ( mcIter->pdgId() == matchingIDs_[i] )
01258        { matchingID=true ; }
01259      }
01260     if (!matchingID) continue ;
01261 
01262     // select requested mother matching gen particle
01263     // always include single particle with no mother
01264     const Candidate * mother = mcIter->mother() ;
01265     matchingMotherID = false ;
01266     for ( unsigned int i=0 ; i<matchingMotherIDs_.size() ; i++ )
01267      {
01268       if ( (mother == 0) || ((mother != 0) &&  mother->pdgId() == matchingMotherIDs_[i]) )
01269        { matchingMotherID = true ; }
01270      }
01271     if (!matchingMotherID) continue ;
01272 
01273     // electron preselection
01274     if (mcIter->pt()> maxPt_ || std::abs(mcIter->eta())> maxAbsEta_)
01275      { continue ; }
01276 
01277     // suppress the endcaps
01278     //if (std::abs(mcIter->eta()) > 1.5) continue;
01279     // select central z
01280     //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
01281 
01282     eleNum++;
01283     h1_mc_Eta->Fill( mcIter->eta() );
01284     h1_mc_AbsEta->Fill( std::abs(mcIter->eta()) );
01285     h1_mc_P->Fill( mcIter->p() );
01286     h1_mc_Pt->Fill( mcIter->pt() );
01287     h1_mc_Phi->Fill( mcIter->phi() );
01288     h1_mc_Z->Fill( mcIter->vz() );
01289     h2_mc_PtEta->Fill( mcIter->eta(),mcIter->pt() );
01290 
01291     // find best matched electron
01292     bool okGsfFound = false ;
01293     double gsfOkRatio = 999999. ;
01294     reco::GsfElectron bestGsfElectron ;
01295     reco::GsfElectronRef bestGsfElectronRef ;
01296     reco::GsfElectronCollection::const_iterator gsfIter ;
01297     reco::GsfElectronCollection::size_type iElectron ;
01298     for ( gsfIter=gsfElectrons->begin(), iElectron=0 ; gsfIter!=gsfElectrons->end() ; gsfIter++, iElectron++ )
01299      {
01300       double dphi = gsfIter->phi()-mcIter->phi() ;
01301       if (std::abs(dphi)>CLHEP::pi)
01302        { dphi = dphi < 0? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi ; }
01303       double deltaR = sqrt(pow((gsfIter->eta()-mcIter->eta()),2) + pow(dphi,2));
01304       if ( deltaR < deltaR_ )
01305        {
01306         if ( ( (mcIter->pdgId() == 11) && (gsfIter->charge() < 0.) ) ||
01307              ( (mcIter->pdgId() == -11) && (gsfIter->charge() > 0.) ) )
01308          {
01309           double tmpGsfRatio = gsfIter->p()/mcIter->p() ;
01310           if ( std::abs(tmpGsfRatio-1) < std::abs(gsfOkRatio-1) )
01311            {
01312             gsfOkRatio = tmpGsfRatio;
01313             bestGsfElectron=*gsfIter;
01314             bestGsfElectronRef=reco::GsfElectronRef(gsfElectrons,iElectron);
01315             okGsfFound = true;
01316            }
01317          }
01318        }
01319      } // loop over rec ele to look for the best one
01320     if (! okGsfFound) continue ;
01321 
01322     //------------------------------------
01323     // analysis when the mc track is found
01324     //------------------------------------
01325 
01326     // electron related distributions
01327     h1_ele_charge->Fill( bestGsfElectron.charge() );
01328     h2_ele_chargeVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.charge() );
01329     h2_ele_chargeVsPhi->Fill( bestGsfElectron.phi(),bestGsfElectron.charge() );
01330     h2_ele_chargeVsPt->Fill( bestGsfElectron.pt(),bestGsfElectron.charge() );
01331     h1_ele_vertexP->Fill( bestGsfElectron.p() );
01332     h1_ele_vertexPt->Fill( bestGsfElectron.pt() );
01333     h1_ele_Et->Fill( bestGsfElectron.ecalEnergy()/cosh(bestGsfElectron.superCluster()->eta()));
01334     h2_ele_vertexPtVsEta->Fill(  bestGsfElectron.eta(),bestGsfElectron.pt() );
01335     h2_ele_vertexPtVsPhi->Fill(  bestGsfElectron.phi(),bestGsfElectron.pt() );
01336     h1_ele_vertexEta->Fill( bestGsfElectron.eta() );
01337     // generated distributions for matched electrons
01338     h1_mc_Pt_matched->Fill( mcIter->pt() );
01339     h1_mc_Phi_matched->Fill( mcIter->phi() );
01340     h1_mc_AbsEta_matched->Fill( std::abs(mcIter->eta()) );
01341     h1_mc_Eta_matched->Fill( mcIter->eta() );
01342     h2_mc_PtEta_matched->Fill(  mcIter->eta(),mcIter->pt() );
01343     h2_ele_vertexEtaVsPhi->Fill(  bestGsfElectron.phi(),bestGsfElectron.eta() );
01344     h1_ele_vertexPhi->Fill( bestGsfElectron.phi() );
01345     h1_ele_vertexX->Fill( bestGsfElectron.vertex().x() );
01346     h1_ele_vertexY->Fill( bestGsfElectron.vertex().y() );
01347     h1_ele_vertexZ->Fill( bestGsfElectron.vertex().z() );
01348     h1_mc_Z_matched->Fill( mcIter->vz() );
01349     double d =
01350      (bestGsfElectron.vertex().x()-mcIter->vx())*(bestGsfElectron.vertex().x()-mcIter->vx()) +
01351      (bestGsfElectron.vertex().y()-mcIter->vy())*(bestGsfElectron.vertex().y()-mcIter->vy()) ;
01352     d = sqrt(d) ;
01353     h1_ele_vertexTIP->Fill( d );
01354     h2_ele_vertexTIPVsEta->Fill(  bestGsfElectron.eta(), d );
01355     h2_ele_vertexTIPVsPhi->Fill(  bestGsfElectron.phi(), d );
01356     h2_ele_vertexTIPVsPt->Fill(  bestGsfElectron.pt(), d );
01357     h1_ele_EtaMnEtaTrue->Fill( bestGsfElectron.eta()-mcIter->eta());
01358     if (bestGsfElectron.isEB()) h1_ele_EtaMnEtaTrue_barrel->Fill( bestGsfElectron.eta()-mcIter->eta());
01359     if (bestGsfElectron.isEE()) h1_ele_EtaMnEtaTrue_endcaps->Fill( bestGsfElectron.eta()-mcIter->eta());
01360     h2_ele_EtaMnEtaTrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eta()-mcIter->eta());
01361     h2_ele_EtaMnEtaTrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eta()-mcIter->eta());
01362     h2_ele_EtaMnEtaTrueVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.eta()-mcIter->eta());
01363     h1_ele_PhiMnPhiTrue->Fill( bestGsfElectron.phi()-mcIter->phi());
01364     if (bestGsfElectron.isEB()) h1_ele_PhiMnPhiTrue_barrel->Fill( bestGsfElectron.phi()-mcIter->phi());
01365     if (bestGsfElectron.isEE()) h1_ele_PhiMnPhiTrue_endcaps->Fill( bestGsfElectron.phi()-mcIter->phi());
01366     h1_ele_PhiMnPhiTrue2->Fill( bestGsfElectron.phi()-mcIter->phi());
01367     h2_ele_PhiMnPhiTrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.phi()-mcIter->phi());
01368     h2_ele_PhiMnPhiTrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.phi()-mcIter->phi());
01369     h2_ele_PhiMnPhiTrueVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.phi()-mcIter->phi());
01370     h1_ele_PoPtrue->Fill( bestGsfElectron.p()/mcIter->p());
01371     h1_ele_PtoPttrue->Fill( bestGsfElectron.pt()/mcIter->pt());
01372     h2_ele_PoPtrueVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.p()/mcIter->p());
01373     h2_ele_PoPtrueVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.p()/mcIter->p());
01374     h2_ele_PoPtrueVsPt->Fill( bestGsfElectron.py(), bestGsfElectron.p()/mcIter->p());
01375     if (bestGsfElectron.isEB()) h1_ele_PoPtrue_barrel->Fill( bestGsfElectron.p()/mcIter->p());
01376     if (bestGsfElectron.isEE()) h1_ele_PoPtrue_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
01377     if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_PoPtrue_golden_barrel->Fill( bestGsfElectron.p()/mcIter->p());
01378     if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_PoPtrue_golden_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
01379     if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_PoPtrue_showering_barrel->Fill( bestGsfElectron.p()/mcIter->p());
01380     if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_PoPtrue_showering_endcaps->Fill( bestGsfElectron.p()/mcIter->p());
01381     if (bestGsfElectron.isEB()) h1_ele_PtoPttrue_barrel->Fill( bestGsfElectron.pt()/mcIter->pt());
01382     if (bestGsfElectron.isEE()) h1_ele_PtoPttrue_endcaps->Fill( bestGsfElectron.pt()/mcIter->pt());
01383     h1_ele_ecalEnergyError->Fill(bestGsfElectron.correctedEcalEnergyError());
01384     if (bestGsfElectron.isEB()) h1_ele_ecalEnergyError_barrel->Fill(bestGsfElectron.correctedEcalEnergyError());
01385     if (bestGsfElectron.isEE()) h1_ele_ecalEnergyError_endcaps->Fill(bestGsfElectron.correctedEcalEnergyError());
01386     h1_ele_combinedP4Error->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION));
01387     if (bestGsfElectron.isEB()) h1_ele_combinedP4Error_barrel->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION));
01388     if (bestGsfElectron.isEE()) h1_ele_combinedP4Error_endcaps->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION));
01389 
01390     // supercluster related distributions
01391     reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
01392     //if (!bestGsfElectron.ecalDrivenSeed()&&bestGsfElectron.trackerDrivenSeed())
01393     // { sclRef = bestGsfElectron.pflowSuperCluster() ; }
01394 
01395     h1_scl_En->Fill(bestGsfElectron.ecalEnergy());
01396     if (bestGsfElectron.isEB())  h1_scl_EoEtrue_barrel->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01397     if (bestGsfElectron.isEE())  h1_scl_EoEtrue_endcaps->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01398     if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())  h1_scl_EoEtrue_barrel_eg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01399     if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())  h1_scl_EoEtrue_endcaps_eg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01400     if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap())  h1_scl_EoEtrue_barrel_etagap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01401     if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap())  h1_scl_EoEtrue_barrel_phigap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01402     if (bestGsfElectron.isEBEEGap())  h1_scl_EoEtrue_ebeegap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01403     //if (bestGsfElectron.isEE())  h1_scl_EoEtrue_endcaps->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01404     if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap())  h1_scl_EoEtrue_endcaps_deegap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01405     if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap())  h1_scl_EoEtrue_endcaps_ringgap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01406     if (bestGsfElectron.isEB())  h1_scl_EoEtrue_barrel_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01407     if (bestGsfElectron.isEE())  h1_scl_EoEtrue_endcaps_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01408     if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())  h1_scl_EoEtrue_barrel_new_eg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01409     if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())  h1_scl_EoEtrue_endcaps_new_eg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01410     if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap())  h1_scl_EoEtrue_barrel_new_etagap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01411     if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap())  h1_scl_EoEtrue_barrel_new_phigap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01412     if (bestGsfElectron.isEBEEGap())  h1_scl_EoEtrue_ebeegap_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01413     //if (bestGsfElectron.isEE())  h1_scl_EoEtrue_endcaps_new->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01414     if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap())  h1_scl_EoEtrue_endcaps_new_deegap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01415     if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap())  h1_scl_EoEtrue_endcaps_new_ringgap->Fill(bestGsfElectron.ecalEnergy()/mcIter->p());
01416 
01417     double R=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y() +sclRef->z()*sclRef->z());
01418     double Rt=TMath::Sqrt(sclRef->x()*sclRef->x() + sclRef->y()*sclRef->y());
01419     h1_scl_Et->Fill(sclRef->energy()*(Rt/R));
01420     h2_scl_EtVsEta->Fill(sclRef->eta(),sclRef->energy()*(Rt/R));
01421     h2_scl_EtVsPhi->Fill(sclRef->phi(),sclRef->energy()*(Rt/R));
01422     h1_scl_Eta->Fill(sclRef->eta());
01423     h2_scl_EtaVsPhi->Fill(sclRef->phi(),sclRef->eta());
01424     h1_scl_Phi->Fill(sclRef->phi());
01425     h1_scl_SigEtaEta->Fill(bestGsfElectron.scSigmaEtaEta());
01426     if (bestGsfElectron.isEB()) h1_scl_SigEtaEta_barrel->Fill(bestGsfElectron.scSigmaEtaEta());
01427     if (bestGsfElectron.isEE()) h1_scl_SigEtaEta_endcaps->Fill(bestGsfElectron.scSigmaEtaEta());
01428     h1_scl_SigIEtaIEta->Fill(bestGsfElectron.scSigmaIEtaIEta());
01429     if (bestGsfElectron.isEB()) h1_scl_SigIEtaIEta_barrel->Fill(bestGsfElectron.scSigmaIEtaIEta());
01430     if (bestGsfElectron.isEE()) h1_scl_SigIEtaIEta_endcaps->Fill(bestGsfElectron.scSigmaIEtaIEta());
01431     h1_scl_E1x5->Fill(bestGsfElectron.scE1x5());
01432     if (bestGsfElectron.isEB()) h1_scl_E1x5_barrel->Fill(bestGsfElectron.scE1x5());
01433     if (bestGsfElectron.isEE()) h1_scl_E1x5_endcaps->Fill(bestGsfElectron.scE1x5());
01434     h1_scl_E2x5max->Fill(bestGsfElectron.scE2x5Max());
01435     if (bestGsfElectron.isEB()) h1_scl_E2x5max_barrel->Fill(bestGsfElectron.scE2x5Max());
01436     if (bestGsfElectron.isEE()) h1_scl_E2x5max_endcaps->Fill(bestGsfElectron.scE2x5Max());
01437     h1_scl_E5x5->Fill(bestGsfElectron.scE5x5());
01438     if (bestGsfElectron.isEB()) h1_scl_E5x5_barrel->Fill(bestGsfElectron.scE5x5());
01439     if (bestGsfElectron.isEE()) h1_scl_E5x5_endcaps->Fill(bestGsfElectron.scE5x5());
01440     if (bestGsfElectron.ecalDrivenSeed()) h1_scl_SigIEtaIEta_eg->Fill(bestGsfElectron.scSigmaIEtaIEta());
01441     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_scl_SigIEtaIEta_eg_barrel->Fill(bestGsfElectron.scSigmaIEtaIEta());
01442     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_scl_SigIEtaIEta_eg_endcaps->Fill(bestGsfElectron.scSigmaIEtaIEta());
01443     if (bestGsfElectron.ecalDrivenSeed())h1_scl_E1x5_eg->Fill(bestGsfElectron.scE1x5());
01444     if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())h1_scl_E1x5_eg_barrel->Fill(bestGsfElectron.scE1x5());
01445     if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())h1_scl_E1x5_eg_endcaps->Fill(bestGsfElectron.scE1x5());
01446     if (bestGsfElectron.ecalDrivenSeed())h1_scl_E2x5max_eg->Fill(bestGsfElectron.scE2x5Max());
01447     if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())h1_scl_E2x5max_eg_barrel->Fill(bestGsfElectron.scE2x5Max());
01448     if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())h1_scl_E2x5max_eg_endcaps->Fill(bestGsfElectron.scE2x5Max());
01449     if (bestGsfElectron.ecalDrivenSeed())h1_scl_E5x5_eg->Fill(bestGsfElectron.scE5x5());
01450     if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())h1_scl_E5x5_eg_barrel->Fill(bestGsfElectron.scE5x5());
01451     if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())h1_scl_E5x5_eg_endcaps->Fill(bestGsfElectron.scE5x5());
01452     float pfEnergy=0. ;
01453     if (!bestGsfElectron.pflowSuperCluster().isNull()) pfEnergy = bestGsfElectron.pflowSuperCluster()->energy();
01454     h2_scl_EoEtruePfVsEg->Fill(bestGsfElectron.ecalEnergy()/mcIter->p(),pfEnergy/mcIter->p());
01455 
01456     // track related distributions
01457     h1_ele_ambiguousTracks->Fill( bestGsfElectron.ambiguousGsfTracksSize() );
01458     h2_ele_ambiguousTracksVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize() );
01459     h2_ele_ambiguousTracksVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize() );
01460     h2_ele_ambiguousTracksVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize() );
01461     if (!readAOD_) // track extra does not exist in AOD
01462      {
01463       h1_ele_foundHits->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
01464       if (bestGsfElectron.isEB()) h1_ele_foundHits_barrel->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
01465       if (bestGsfElectron.isEE()) h1_ele_foundHits_endcaps->Fill( bestGsfElectron.gsfTrack()->numberOfValidHits() );
01466       h2_ele_foundHitsVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
01467       h2_ele_foundHitsVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
01468       h2_ele_foundHitsVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits() );
01469       h1_ele_lostHits->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
01470       if (bestGsfElectron.isEB()) h1_ele_lostHits_barrel->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
01471       if (bestGsfElectron.isEE()) h1_ele_lostHits_endcaps->Fill( bestGsfElectron.gsfTrack()->numberOfLostHits() );
01472       h2_ele_lostHitsVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
01473       h2_ele_lostHitsVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
01474       h2_ele_lostHitsVsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits() );
01475       h1_ele_chi2->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
01476       if (bestGsfElectron.isEB()) h1_ele_chi2_barrel->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
01477       if (bestGsfElectron.isEE()) h1_ele_chi2_endcaps->Fill( bestGsfElectron.gsfTrack()->normalizedChi2() );
01478       h2_ele_chi2VsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2() );
01479       h2_ele_chi2VsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2() );
01480       h2_ele_chi2VsPt->Fill( bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2() );
01481      }
01482     // from gsf track interface, hence using mean
01483     if (!readAOD_) // track extra does not exist in AOD
01484      {
01485       h1_ele_PinMnPout->Fill( bestGsfElectron.gsfTrack()->innerMomentum().R() - bestGsfElectron.gsfTrack()->outerMomentum().R() );
01486       h1_ele_outerP->Fill( bestGsfElectron.gsfTrack()->outerMomentum().R() );
01487       h1_ele_outerPt->Fill( bestGsfElectron.gsfTrack()->outerMomentum().Rho() );
01488      }
01489     // from electron interface, hence using mode
01490     h1_ele_PinMnPout_mode->Fill( bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01491     h2_ele_PinMnPoutVsEta_mode->Fill(  bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01492     h2_ele_PinMnPoutVsPhi_mode->Fill(  bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01493     h2_ele_PinMnPoutVsPt_mode->Fill(  bestGsfElectron.pt(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01494     h2_ele_PinMnPoutVsE_mode->Fill(  bestGsfElectron.caloEnergy(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() );
01495     if (!readAOD_)  // track extra does not exist in AOD
01496      {
01497       h2_ele_PinMnPoutVsChi2_mode->Fill
01498        ( bestGsfElectron.gsfTrack()->normalizedChi2(),
01499          bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R() ) ;
01500      }
01501     h1_ele_outerP_mode->Fill( bestGsfElectron.trackMomentumOut().R() );
01502     h2_ele_outerPVsEta_mode->Fill(bestGsfElectron.eta(),  bestGsfElectron.trackMomentumOut().R() );
01503     h1_ele_outerPt_mode->Fill( bestGsfElectron.trackMomentumOut().Rho() );
01504     h2_ele_outerPtVsEta_mode->Fill(bestGsfElectron.eta(),  bestGsfElectron.trackMomentumOut().Rho() );
01505     h2_ele_outerPtVsPhi_mode->Fill(bestGsfElectron.phi(),  bestGsfElectron.trackMomentumOut().Rho() );
01506     h2_ele_outerPtVsPt_mode->Fill(bestGsfElectron.pt(),  bestGsfElectron.trackMomentumOut().Rho() );
01507 
01508     if (!readAOD_) // track extra does not exist in AOD
01509      {
01510       edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
01511       ElectronSeedRef elseed=seed.castTo<ElectronSeedRef>();
01512       h1_ele_seed_subdet2->Fill(elseed->subDet2());
01513       h1_ele_seed_mask->Fill(elseed->hitsMask());
01514       if (elseed->subDet2()==1)
01515        { h1_ele_seed_mask_bpix->Fill(elseed->hitsMask()); }
01516       else if (elseed->subDet2()==2)
01517        { h1_ele_seed_mask_fpix->Fill(elseed->hitsMask()); }
01518       else if (elseed->subDet2()==6)
01519        { h1_ele_seed_mask_tec->Fill(elseed->hitsMask()); }
01520       h1_ele_seed_dphi2->Fill(elseed->dPhi2());
01521       h2_ele_seed_dphi2VsEta->Fill(bestGsfElectron.eta(), elseed->dPhi2());
01522       h2_ele_seed_dphi2VsPt->Fill(bestGsfElectron.pt(), elseed->dPhi2());
01523       h1_ele_seed_dphi2pos->Fill(elseed->dPhi2Pos());
01524       h2_ele_seed_dphi2posVsEta->Fill(bestGsfElectron.eta(), elseed->dPhi2Pos());
01525       h2_ele_seed_dphi2posVsPt->Fill(bestGsfElectron.pt(), elseed->dPhi2Pos());
01526       h1_ele_seed_drz2->Fill(elseed->dRz2());
01527       h2_ele_seed_drz2VsEta->Fill(bestGsfElectron.eta(), elseed->dRz2());
01528       h2_ele_seed_drz2VsPt->Fill(bestGsfElectron.pt(), elseed->dRz2());
01529       h1_ele_seed_drz2pos->Fill(elseed->dRz2Pos());
01530       h2_ele_seed_drz2posVsEta->Fill(bestGsfElectron.eta(), elseed->dRz2Pos());
01531       h2_ele_seed_drz2posVsPt->Fill(bestGsfElectron.pt(), elseed->dRz2Pos());
01532      }
01533 
01534     // match distributions
01535     h1_ele_EoP->Fill( bestGsfElectron.eSuperClusterOverP() );
01536     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg->Fill( bestGsfElectron.eSuperClusterOverP() );
01537     if (bestGsfElectron.isEB()) h1_ele_EoP_barrel->Fill( bestGsfElectron.eSuperClusterOverP() );
01538     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg_barrel->Fill( bestGsfElectron.eSuperClusterOverP() );
01539     if (bestGsfElectron.isEE()) h1_ele_EoP_endcaps->Fill( bestGsfElectron.eSuperClusterOverP() );
01540     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoP_eg_endcaps->Fill( bestGsfElectron.eSuperClusterOverP() );
01541     h2_ele_EoPVsEta->Fill(bestGsfElectron.eta(),  bestGsfElectron.eSuperClusterOverP() );
01542     h2_ele_EoPVsPhi->Fill(bestGsfElectron.phi(),  bestGsfElectron.eSuperClusterOverP() );
01543     h2_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(),  bestGsfElectron.eSuperClusterOverP() );
01544     h1_ele_EseedOP->Fill( bestGsfElectron.eSeedClusterOverP() );
01545     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg->Fill( bestGsfElectron.eSeedClusterOverP() );
01546     if (bestGsfElectron.isEB()) h1_ele_EseedOP_barrel->Fill( bestGsfElectron.eSeedClusterOverP() );
01547     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg_barrel->Fill( bestGsfElectron.eSeedClusterOverP() );
01548     if (bestGsfElectron.isEE()) h1_ele_EseedOP_endcaps->Fill( bestGsfElectron.eSeedClusterOverP() );
01549     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EseedOP_eg_endcaps->Fill( bestGsfElectron.eSeedClusterOverP() );
01550     h2_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(),  bestGsfElectron.eSeedClusterOverP() );
01551     h2_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(),  bestGsfElectron.eSeedClusterOverP() );
01552     h2_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(),  bestGsfElectron.eSeedClusterOverP() );
01553     h1_ele_EoPout->Fill( bestGsfElectron.eSeedClusterOverPout() );
01554     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg->Fill( bestGsfElectron.eSeedClusterOverPout() );
01555     if (bestGsfElectron.isEB()) h1_ele_EoPout_barrel->Fill( bestGsfElectron.eSeedClusterOverPout() );
01556     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg_barrel->Fill( bestGsfElectron.eSeedClusterOverPout() );
01557     if (bestGsfElectron.isEE()) h1_ele_EoPout_endcaps->Fill( bestGsfElectron.eSeedClusterOverPout() );
01558     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EoPout_eg_endcaps->Fill( bestGsfElectron.eSeedClusterOverPout() );
01559     h2_ele_EoPoutVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout() );
01560     h2_ele_EoPoutVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout() );
01561     h2_ele_EoPoutVsE->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout() );
01562     h1_ele_EeleOPout->Fill( bestGsfElectron.eEleClusterOverPout() );
01563     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg->Fill( bestGsfElectron.eEleClusterOverPout() );
01564     if (bestGsfElectron.isEB()) h1_ele_EeleOPout_barrel->Fill( bestGsfElectron.eEleClusterOverPout() );
01565     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg_barrel->Fill( bestGsfElectron.eEleClusterOverPout() );
01566     if (bestGsfElectron.isEE()) h1_ele_EeleOPout_endcaps->Fill( bestGsfElectron.eEleClusterOverPout() );
01567     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_EeleOPout_eg_endcaps->Fill( bestGsfElectron.eEleClusterOverPout() );
01568     h2_ele_EeleOPoutVsEta->Fill( bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout() );
01569     h2_ele_EeleOPoutVsPhi->Fill( bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout() );
01570     h2_ele_EeleOPoutVsE->Fill( bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout() );
01571     h1_ele_dEtaSc_propVtx->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01572     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01573     if (bestGsfElectron.isEB()) h1_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01574     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01575     if (bestGsfElectron.isEE())h1_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01576     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01577     h2_ele_dEtaScVsEta_propVtx->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01578     h2_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01579     h2_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
01580     h1_ele_dPhiSc_propVtx->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01581     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01582     if (bestGsfElectron.isEB()) h1_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01583     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01584     if (bestGsfElectron.isEE())h1_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01585     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01586     h2_ele_dPhiScVsEta_propVtx->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01587     h2_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01588     h2_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
01589     h1_ele_dEtaCl_propOut->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01590     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01591     if (bestGsfElectron.isEB()) h1_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01592     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01593     if (bestGsfElectron.isEE()) h1_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01594     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01595     h2_ele_dEtaClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01596     h2_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01597     h2_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
01598     h1_ele_dPhiCl_propOut->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01599     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01600     if (bestGsfElectron.isEB()) h1_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01601     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01602     if (bestGsfElectron.isEE()) h1_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01603     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01604     h2_ele_dPhiClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01605     h2_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01606     h2_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
01607     h1_ele_dEtaEleCl_propOut->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01608     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01609     if (bestGsfElectron.isEB()) h1_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01610     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01611     if (bestGsfElectron.isEE()) h1_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01612     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dEtaEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01613     h2_ele_dEtaEleClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01614     h2_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01615     h2_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
01616     h1_ele_dPhiEleCl_propOut->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01617     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01618     if (bestGsfElectron.isEB()) h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01619     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01620     if (bestGsfElectron.isEE()) h1_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01621     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_dPhiEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01622     h2_ele_dPhiEleClVsEta_propOut->Fill( bestGsfElectron.eta(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01623     h2_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01624     h2_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(),bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
01625     h1_ele_HoE->Fill(bestGsfElectron.hcalOverEcal());
01626     h1_ele_HoE_bc->Fill(bestGsfElectron.hcalOverEcalBc());
01627     if (bestGsfElectron.isEB()) h1_ele_HoE_bc_barrel->Fill(bestGsfElectron.hcalOverEcalBc());
01628     if (bestGsfElectron.isEE()) h1_ele_HoE_bc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc());
01629     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg->Fill(bestGsfElectron.hcalOverEcal());
01630     if (bestGsfElectron.isEB()) h1_ele_HoE_barrel->Fill(bestGsfElectron.hcalOverEcal());
01631     if (bestGsfElectron.isEB()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg_barrel->Fill(bestGsfElectron.hcalOverEcal());
01632     if (bestGsfElectron.isEE()) h1_ele_HoE_endcaps->Fill(bestGsfElectron.hcalOverEcal());
01633     if (bestGsfElectron.isEE()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_HoE_eg_endcaps->Fill(bestGsfElectron.hcalOverEcal());
01634     if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap()&& !bestGsfElectron.isEBEEGap() &&
01635         !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap()) h1_ele_HoE_fiducial->Fill(bestGsfElectron.hcalOverEcal());
01636     h2_ele_HoEVsEta->Fill( bestGsfElectron.eta(),bestGsfElectron.hcalOverEcal());
01637     h2_ele_HoEVsPhi->Fill(bestGsfElectron.phi(),bestGsfElectron.hcalOverEcal());
01638     h2_ele_HoEVsE->Fill(bestGsfElectron.caloEnergy(),bestGsfElectron.hcalOverEcal());
01639 
01640     //classes
01641     int eleClass = bestGsfElectron.classification();
01642     if (bestGsfElectron.isEE()) eleClass+=10;
01643     h1_ele_classes->Fill(eleClass);
01644 
01645     if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEB())  h1_scl_EoEtrueGolden_barrel->Fill(sclRef->energy()/mcIter->p());
01646     if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEE())  h1_scl_EoEtrueGolden_endcaps->Fill(sclRef->energy()/mcIter->p());
01647     if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEB())  h1_scl_EoEtrueShowering_barrel->Fill(sclRef->energy()/mcIter->p());
01648     if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEE())  h1_scl_EoEtrueShowering_endcaps->Fill(sclRef->energy()/mcIter->p());
01649 
01650     //eleClass = eleClass%100; // get rid of barrel/endcap distinction
01651     h1_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
01652     if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_eta_golden->Fill(std::abs(bestGsfElectron.eta()));
01653     if (bestGsfElectron.classification() == GsfElectron::BIGBREM) h1_ele_eta_bbrem->Fill(std::abs(bestGsfElectron.eta()));
01654     if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_eta_shower->Fill(std::abs(bestGsfElectron.eta()));
01655 
01656     // fbrem
01657 
01658     double fbrem_mode =  bestGsfElectron.fbrem();
01659     h1_ele_fbrem->Fill(fbrem_mode);
01660 
01661     if (bestGsfElectron.isEB())
01662      {
01663       double fbrem_mode_barrel = bestGsfElectron.fbrem();
01664       h1_ele_fbrem_barrel->Fill(fbrem_mode_barrel);
01665      }
01666 
01667     if (bestGsfElectron.isEE())
01668      {
01669       double fbrem_mode_endcaps = bestGsfElectron.fbrem();
01670       h1_ele_fbrem_endcaps->Fill(fbrem_mode_endcaps);
01671      }
01672 
01673     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_fbrem_eg->Fill(fbrem_mode);
01674     p1_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(),fbrem_mode);
01675 
01676     if (!readAOD_) // track extra does not exist in AOD
01677      {
01678       double fbrem_mean =  1. - bestGsfElectron.gsfTrack()->outerMomentum().R()/bestGsfElectron.gsfTrack()->innerMomentum().R() ;
01679       p1_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(),fbrem_mean) ;
01680      }
01681 
01682     //
01683 
01684     if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
01685     if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R());
01686     if (!readAOD_) // track extra not available in AOD
01687      {
01688       if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
01689       if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R());
01690      }
01691     if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
01692     if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), bestGsfElectron.trackMomentumAtVtx().Rho());
01693     if (!readAOD_) // track extra not available in AOD
01694      {
01695       if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
01696       if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho());
01697      }
01698 
01699     // provenance and pflow data
01700     h1_ele_mva->Fill(bestGsfElectron.mva());
01701     if (bestGsfElectron.isEB()) h1_ele_mva_barrel->Fill(bestGsfElectron.mva());
01702     if (bestGsfElectron.isEE()) h1_ele_mva_endcaps->Fill(bestGsfElectron.mva());
01703     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_mva_eg->Fill(bestGsfElectron.mva());
01704     if (bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(1.);
01705     if (bestGsfElectron.trackerDrivenSeed()) h1_ele_provenance->Fill(-1.);
01706     if (bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(0.);
01707     if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(-2.);
01708     if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(2.);
01709 
01710     if (bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(1.);
01711     if (bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(-1.);
01712     if ((bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(0.);
01713     if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(-2.);
01714     if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEB()) h1_ele_provenance_barrel->Fill(2.);
01715     if (bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(1.);
01716     if (bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(-1.);
01717     if ((bestGsfElectron.trackerDrivenSeed()||bestGsfElectron.ecalDrivenSeed()) && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(0.);
01718     if (bestGsfElectron.trackerDrivenSeed()&&!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(-2.);
01719     if (!bestGsfElectron.trackerDrivenSeed()&&bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.isEE()) h1_ele_provenance_endcaps->Fill(2.);
01720 
01721     if (bestGsfElectron.isGsfCtfScPixChargeConsistent()) h1_ele_chargeInfo->Fill(-1.0);
01722     if (bestGsfElectron.isGsfScPixChargeConsistent()) h1_ele_chargeInfo->Fill(0.);
01723     if (bestGsfElectron.isGsfCtfChargeConsistent()) h1_ele_chargeInfo->Fill(1.0);
01724 
01725     // Pflow isolation
01726     h1_ele_chargedHadronIso->Fill(bestGsfElectron.pfIsolationVariables().chargedHadronIso);
01727     if (bestGsfElectron.isEB()) h1_ele_chargedHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().chargedHadronIso);
01728     if (bestGsfElectron.isEE()) h1_ele_chargedHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().chargedHadronIso);
01729 
01730     h1_ele_neutralHadronIso->Fill(bestGsfElectron.pfIsolationVariables().neutralHadronIso);
01731     if (bestGsfElectron.isEB()) h1_ele_neutralHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().neutralHadronIso);
01732     if (bestGsfElectron.isEE()) h1_ele_neutralHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().neutralHadronIso);
01733 
01734     h1_ele_photonIso->Fill(bestGsfElectron.pfIsolationVariables().photonIso);
01735     if (bestGsfElectron.isEB()) h1_ele_photonIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().photonIso);
01736     if (bestGsfElectron.isEE()) h1_ele_photonIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().photonIso);
01737 
01738     // isolation
01739     h1_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
01740     if (bestGsfElectron.isEB()) h1_ele_tkSumPt_dr03_barrel->Fill(bestGsfElectron.dr03TkSumPt());
01741     if (bestGsfElectron.isEE()) h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt());
01742     h1_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
01743     if (bestGsfElectron.isEB()) h1_ele_ecalRecHitSumEt_dr03_barrel->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
01744     if (bestGsfElectron.isEE()) h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
01745     h1_ele_hcalTowerSumEt_dr03_depth1->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
01746     if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
01747     if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEt());
01748     h1_ele_hcalTowerSumEt_dr03_depth2->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
01749     if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
01750     if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEt());
01751     h1_ele_hcalTowerSumEtBc_dr03_depth1->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEtBc());
01752     if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEtBc());
01753     if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalDepth1TowerSumEtBc());
01754     h1_ele_hcalTowerSumEtBc_dr03_depth2->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEtBc());
01755     if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEtBc());
01756     if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalDepth2TowerSumEtBc());
01757     h1_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
01758     if (bestGsfElectron.isEB()) h1_ele_tkSumPt_dr04_barrel->Fill(bestGsfElectron.dr04TkSumPt());
01759     if (bestGsfElectron.isEE()) h1_ele_tkSumPt_dr04_endcaps->Fill(bestGsfElectron.dr04TkSumPt());
01760     h1_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
01761     if (bestGsfElectron.isEB()) h1_ele_ecalRecHitSumEt_dr04_barrel->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
01762     if (bestGsfElectron.isEE()) h1_ele_ecalRecHitSumEt_dr04_endcaps->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
01763     h1_ele_hcalTowerSumEt_dr04_depth1->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
01764     if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
01765     if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEt());
01766     h1_ele_hcalTowerSumEt_dr04_depth2->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
01767     if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEt_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
01768     if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEt_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEt());
01769 
01770     h1_ele_hcalTowerSumEtBc_dr04_depth1->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEtBc());
01771     if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEtBc());
01772     if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalDepth1TowerSumEtBc());
01773     h1_ele_hcalTowerSumEtBc_dr04_depth2->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEtBc());
01774     if (bestGsfElectron.isEB()) h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEtBc());
01775     if (bestGsfElectron.isEE()) h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalDepth2TowerSumEtBc());
01776 
01777     h1_ele_hcalDepth1OverEcalBc->Fill(bestGsfElectron.hcalDepth1OverEcalBc());
01778     if (bestGsfElectron.isEB()) h1_ele_hcalDepth1OverEcalBc_barrel->Fill(bestGsfElectron.hcalDepth1OverEcalBc());
01779     if (bestGsfElectron.isEE()) h1_ele_hcalDepth1OverEcalBc_endcaps->Fill(bestGsfElectron.hcalDepth1OverEcalBc());
01780     h1_ele_hcalDepth2OverEcalBc->Fill(bestGsfElectron.hcalDepth2OverEcalBc());
01781     if (bestGsfElectron.isEB()) h1_ele_hcalDepth2OverEcalBc_barrel->Fill(bestGsfElectron.hcalDepth2OverEcalBc());
01782     if (bestGsfElectron.isEE()) h1_ele_hcalDepth2OverEcalBc_endcaps->Fill(bestGsfElectron.hcalDepth2OverEcalBc());
01783 
01784     // isolation : difference with iso deposits
01785     if ( isoFromDepsTk03Handle.isValid() )
01786      { h1_ele_dIso_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt()-((*isoFromDepsTk03Handle)[bestGsfElectronRef])) ; }
01787     if ( isoFromDepsTk04Handle.isValid() )
01788      { h1_ele_dIso_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt()-((*isoFromDepsTk04Handle)[bestGsfElectronRef])) ; }
01789     if ( isoFromDepsEcalFull03Handle.isValid() )
01790      { h1_ele_dIso_ecalFullRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt()-((*isoFromDepsEcalFull03Handle)[bestGsfElectronRef])) ; }
01791     if ( isoFromDepsEcalFull04Handle.isValid() )
01792      { h1_ele_dIso_ecalFullRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt()-((*isoFromDepsEcalFull04Handle)[bestGsfElectronRef])) ; }
01793     if ( isoFromDepsEcalReduced03Handle.isValid() )
01794      { h1_ele_dIso_ecalReducedRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt()-((*isoFromDepsEcalReduced03Handle)[bestGsfElectronRef])) ; }
01795     if ( isoFromDepsEcalReduced04Handle.isValid() )
01796      { h1_ele_dIso_ecalReducedRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt()-((*isoFromDepsEcalReduced04Handle)[bestGsfElectronRef])) ; }
01797     if ( isoFromDepsHcal03Handle.isValid() )
01798      { h1_ele_dIso_hcalTowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalTowerSumEt()-((*isoFromDepsHcal03Handle)[bestGsfElectronRef])) ; }
01799     if ( isoFromDepsHcal04Handle.isValid() )
01800      { h1_ele_dIso_hcalTowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalTowerSumEt()-((*isoFromDepsHcal04Handle)[bestGsfElectronRef])) ; }
01801 
01802     // conversion rejection
01803     int flags = bestGsfElectron.convFlags() ;
01804     if (flags==-9999) { flags=-1 ; }
01805     h1_ele_convFlags->Fill(flags);
01806     if (flags>=0.)
01807      {
01808       h1_ele_convDist->Fill( bestGsfElectron.convDist() );
01809       h1_ele_convDcot->Fill( bestGsfElectron.convDcot() );
01810       h1_ele_convRadius->Fill( bestGsfElectron.convRadius() );
01811      }
01812 
01813    } // loop over mc particle
01814   h1_mcNum->Fill(mcNum) ;
01815   h1_eleNum->Fill(eleNum) ;
01816  }
01817 
01818