Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-31 23:14:22

0001 
0002 // user include files
0003 #include "Validation/RecoEgamma/plugins/ElectronMcFakeValidator.h"
0004 
0005 #include "RecoEgamma/EgammaElectronAlgos/interface/ElectronUtilities.h"
0006 
0007 #include "DQMServices/Core/interface/DQMStore.h"
0008 
0009 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
0010 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0011 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
0012 #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
0013 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
0014 #include "DataFormats/EgammaReco/interface/ElectronSeed.h"
0015 #include "DataFormats/EgammaReco/interface/ElectronSeedFwd.h"
0016 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0017 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0018 #include "DataFormats/JetReco/interface/GenJetCollection.h"
0019 
0020 #include "DataFormats/Common/interface/Handle.h"
0021 #include "DataFormats/Common/interface/ValueMap.h"
0022 
0023 #include "DataFormats/VertexReco/interface/Vertex.h"
0024 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0025 
0026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0027 #include "FWCore/Framework/interface/Event.h"
0028 #include "FWCore/Framework/interface/MakerMacros.h"
0029 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0030 
0031 #include "CLHEP/Units/GlobalPhysicalConstants.h"
0032 #include "TMath.h"
0033 #include "TFile.h"
0034 #include "TH1F.h"
0035 #include "TH1I.h"
0036 #include "TH2F.h"
0037 #include "TProfile.h"
0038 #include "TTree.h"
0039 #include <vector>
0040 #include <iostream>
0041 
0042 using namespace reco;
0043 
0044 ElectronMcFakeValidator::ElectronMcFakeValidator(const edm::ParameterSet &conf) : ElectronDqmAnalyzerBase(conf) {
0045   electronCollection_ = consumes<reco::GsfElectronCollection>(conf.getParameter<edm::InputTag>("electronCollection"));
0046   electronCollectionEndcaps_ =
0047       consumes<reco::GsfElectronCollection>(conf.getParameter<edm::InputTag>("electronCollectionEndcaps"));
0048   electronCoreCollection_ =
0049       consumes<reco::GsfElectronCoreCollection>(conf.getParameter<edm::InputTag>("electronCoreCollection"));
0050   electronTrackCollection_ =
0051       consumes<reco::GsfTrackCollection>(conf.getParameter<edm::InputTag>("electronTrackCollection"));
0052   electronSeedCollection_ =
0053       consumes<reco::ElectronSeedCollection>(conf.getParameter<edm::InputTag>("electronSeedCollection"));
0054   matchingObjectCollection_ =
0055       consumes<reco::GenJetCollection>(conf.getParameter<edm::InputTag>("matchingObjectCollection"));
0056   offlineVerticesCollection_ =
0057       consumes<reco::VertexCollection>(conf.getParameter<edm::InputTag>("offlinePrimaryVertices"));
0058 
0059   beamSpotTag_ = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("beamSpot"));
0060   readAOD_ = conf.getParameter<bool>("readAOD");
0061 
0062   isoFromDepsTk03Tag_ = consumes<edm::ValueMap<double>>(conf.getParameter<edm::InputTag>("isoFromDepsTk03"));
0063   isoFromDepsTk04Tag_ = consumes<edm::ValueMap<double>>(conf.getParameter<edm::InputTag>("isoFromDepsTk04"));
0064   isoFromDepsEcalFull03Tag_ =
0065       consumes<edm::ValueMap<double>>(conf.getParameter<edm::InputTag>("isoFromDepsEcalFull03"));
0066   isoFromDepsEcalFull04Tag_ =
0067       consumes<edm::ValueMap<double>>(conf.getParameter<edm::InputTag>("isoFromDepsEcalFull04"));
0068   isoFromDepsEcalReduced03Tag_ =
0069       consumes<edm::ValueMap<double>>(conf.getParameter<edm::InputTag>("isoFromDepsEcalReduced03"));
0070   isoFromDepsEcalReduced04Tag_ =
0071       consumes<edm::ValueMap<double>>(conf.getParameter<edm::InputTag>("isoFromDepsEcalReduced04"));
0072   isoFromDepsHcal03Tag_ = consumes<edm::ValueMap<double>>(conf.getParameter<edm::InputTag>("isoFromDepsHcal03"));
0073   isoFromDepsHcal04Tag_ = consumes<edm::ValueMap<double>>(conf.getParameter<edm::InputTag>("isoFromDepsHcal04"));
0074 
0075   maxPt_ = conf.getParameter<double>("MaxPt");
0076   maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
0077   deltaR2_ = conf.getParameter<double>("DeltaR") * conf.getParameter<double>("DeltaR");
0078   inputFile_ = conf.getParameter<std::string>("InputFile");
0079   outputFile_ = conf.getParameter<std::string>("OutputFile");
0080   inputInternalPath_ = conf.getParameter<std::string>("InputFolderName");
0081   outputInternalPath_ = conf.getParameter<std::string>("OutputFolderName");
0082 
0083   // histos bining and limits
0084 
0085   edm::ParameterSet histosSet = conf.getParameter<edm::ParameterSet>("histosCfg");
0086 
0087   xyz_nbin = histosSet.getParameter<int>("Nbinxyz");
0088 
0089   p_nbin = histosSet.getParameter<int>("Nbinp");
0090   p2D_nbin = histosSet.getParameter<int>("Nbinp2D");
0091   p_max = histosSet.getParameter<double>("Pmax");
0092 
0093   pt_nbin = histosSet.getParameter<int>("Nbinpt");
0094   pt2D_nbin = histosSet.getParameter<int>("Nbinpt2D");
0095   pteff_nbin = histosSet.getParameter<int>("Nbinpteff");
0096   pt_max = histosSet.getParameter<double>("Ptmax");
0097 
0098   fhits_nbin = histosSet.getParameter<int>("Nbinfhits");
0099   fhits_max = histosSet.getParameter<double>("Fhitsmax");
0100 
0101   lhits_nbin = histosSet.getParameter<int>("Nbinlhits");
0102   lhits_max = histosSet.getParameter<double>("Lhitsmax");
0103 
0104   eop_nbin = histosSet.getParameter<int>("Nbineop");
0105   eop2D_nbin = histosSet.getParameter<int>("Nbineop2D");
0106   eop_max = histosSet.getParameter<double>("Eopmax");
0107   eopmaxsht = histosSet.getParameter<double>("Eopmaxsht");
0108 
0109   eta_nbin = histosSet.getParameter<int>("Nbineta");
0110   eta2D_nbin = histosSet.getParameter<int>("Nbineta2D");
0111   eta_min = histosSet.getParameter<double>("Etamin");
0112   eta_max = histosSet.getParameter<double>("Etamax");
0113 
0114   deta_nbin = histosSet.getParameter<int>("Nbindeta");
0115   deta_min = histosSet.getParameter<double>("Detamin");
0116   deta_max = histosSet.getParameter<double>("Detamax");
0117 
0118   detamatch_nbin = histosSet.getParameter<int>("Nbindetamatch");
0119   detamatch2D_nbin = histosSet.getParameter<int>("Nbindetamatch2D");
0120   detamatch_min = histosSet.getParameter<double>("Detamatchmin");
0121   detamatch_max = histosSet.getParameter<double>("Detamatchmax");
0122 
0123   phi_nbin = histosSet.getParameter<int>("Nbinphi");
0124   phi2D_nbin = histosSet.getParameter<int>("Nbinphi2D");
0125   phi_min = histosSet.getParameter<double>("Phimin");
0126   phi_max = histosSet.getParameter<double>("Phimax");
0127 
0128   dphi_nbin = histosSet.getParameter<int>("Nbindphi");
0129   dphi_min = histosSet.getParameter<double>("Dphimin");
0130   dphi_max = histosSet.getParameter<double>("Dphimax");
0131 
0132   dphimatch_nbin = histosSet.getParameter<int>("Nbindphimatch");
0133   dphimatch2D_nbin = histosSet.getParameter<int>("Nbindphimatch2D");
0134   dphimatch_min = histosSet.getParameter<double>("Dphimatchmin");
0135   dphimatch_max = histosSet.getParameter<double>("Dphimatchmax");
0136 
0137   mee_nbin = histosSet.getParameter<int>("Nbinmee");
0138   mee_min = histosSet.getParameter<double>("Meemin");
0139   mee_max = histosSet.getParameter<double>("Meemax");
0140 
0141   hoe_nbin = histosSet.getParameter<int>("Nbinhoe");
0142   hoe_min = histosSet.getParameter<double>("Hoemin");
0143   hoe_max = histosSet.getParameter<double>("Hoemax");
0144 
0145   popmatching_nbin = histosSet.getParameter<int>("Nbinpopmatching");
0146   popmatching_min = histosSet.getParameter<double>("Popmatchingmin");
0147   popmatching_max = histosSet.getParameter<double>("Popmatchingmax");
0148 
0149   set_EfficiencyFlag = histosSet.getParameter<bool>("EfficiencyFlag");
0150   set_StatOverflowFlag = histosSet.getParameter<bool>("StatOverflowFlag");
0151 
0152   opv_nbin = histosSet.getParameter<int>("NbinOPV");
0153   opv_min = histosSet.getParameter<double>("OPV_min");
0154   opv_max = histosSet.getParameter<double>("OPV_max");
0155 
0156   ele_nbin = histosSet.getParameter<int>("NbinELE");
0157   ele_min = histosSet.getParameter<double>("ELE_min");
0158   ele_max = histosSet.getParameter<double>("ELE_max");
0159 
0160   core_nbin = histosSet.getParameter<int>("NbinCORE");
0161   core_min = histosSet.getParameter<double>("CORE_min");
0162   core_max = histosSet.getParameter<double>("CORE_max");
0163 
0164   track_nbin = histosSet.getParameter<int>("NbinTRACK");
0165   track_min = histosSet.getParameter<double>("TRACK_min");
0166   track_max = histosSet.getParameter<double>("TRACK_max");
0167 
0168   seed_nbin = histosSet.getParameter<int>("NbinSEED");
0169   seed_min = histosSet.getParameter<double>("SEED_min");
0170   seed_max = histosSet.getParameter<double>("SEED_max");
0171 
0172   // so to please coverity
0173   h1_matchingObjectNum = nullptr;
0174   h1_recEleNum_ = nullptr;
0175   h1_recCoreNum_ = nullptr;
0176   h1_recTrackNum_ = nullptr;
0177   h1_recSeedNum_ = nullptr;
0178   h1_recOfflineVertices_ = nullptr;
0179 
0180   h1_matchingObjectEta = nullptr;
0181   h1_matchingObjectAbsEta = nullptr;
0182   h1_matchingObjectP = nullptr;
0183   h1_matchingObjectPt = nullptr;
0184   h1_matchingObjectPhi = nullptr;
0185   h1_matchingObjectZ = nullptr;
0186 
0187   h1_ele_EoverP_all = nullptr;
0188   h1_ele_EseedOP_all = nullptr;
0189   h1_ele_EoPout_all = nullptr;
0190   h1_ele_EeleOPout_all = nullptr;
0191   h1_ele_dEtaSc_propVtx_all = nullptr;
0192   h1_ele_dPhiSc_propVtx_all = nullptr;
0193   h1_ele_dEtaCl_propOut_all = nullptr;
0194   h1_ele_dPhiCl_propOut_all = nullptr;
0195   h1_ele_TIP_all = nullptr;
0196   h1_ele_HoE_all = nullptr;
0197   h1_ele_vertexEta_all = nullptr;
0198   h1_ele_vertexPt_all = nullptr;
0199   h1_ele_mee_all = nullptr;
0200   h1_ele_mee_os = nullptr;
0201 
0202   h2_ele_E2mnE1vsMee_all = nullptr;
0203   h2_ele_E2mnE1vsMee_egeg_all = nullptr;
0204 
0205   h1_ele_matchingObjectEta_matched = nullptr;
0206   h1_ele_matchingObjectAbsEta_matched = nullptr;
0207   h1_ele_matchingObjectPt_matched = nullptr;
0208   h1_ele_matchingObjectPhi_matched = nullptr;
0209   h1_ele_matchingObjectZ_matched = nullptr;
0210 
0211   h1_ele_charge = nullptr;
0212   h2_ele_chargeVsEta = nullptr;
0213   h2_ele_chargeVsPhi = nullptr;
0214   h2_ele_chargeVsPt = nullptr;
0215   h1_ele_vertexP = nullptr;
0216   h1_ele_vertexPt = nullptr;
0217   h2_ele_vertexPtVsEta = nullptr;
0218   h2_ele_vertexPtVsPhi = nullptr;
0219   h1_ele_vertexEta = nullptr;
0220   h2_ele_vertexEtaVsPhi = nullptr;
0221   h1_ele_vertexAbsEta = nullptr;
0222   h1_ele_vertexPhi = nullptr;
0223   h1_ele_vertexX = nullptr;
0224   h1_ele_vertexY = nullptr;
0225   h1_ele_vertexZ = nullptr;
0226   h1_ele_vertexTIP = nullptr;
0227   h2_ele_vertexTIPVsEta = nullptr;
0228   h2_ele_vertexTIPVsPhi = nullptr;
0229   h2_ele_vertexTIPVsPt = nullptr;
0230 
0231   h1_ele_PoPmatchingObject = nullptr;
0232   h2_ele_PoPmatchingObjectVsEta = nullptr;
0233   h2_ele_PoPmatchingObjectVsPhi = nullptr;
0234   h2_ele_PoPmatchingObjectVsPt = nullptr;
0235   h1_ele_PoPmatchingObject_barrel = nullptr;
0236   h1_ele_PoPmatchingObject_endcaps = nullptr;
0237 
0238   h1_ele_EtaMnEtamatchingObject = nullptr;
0239   h2_ele_EtaMnEtamatchingObjectVsEta = nullptr;
0240   h2_ele_EtaMnEtamatchingObjectVsPhi = nullptr;
0241   h2_ele_EtaMnEtamatchingObjectVsPt = nullptr;
0242   h1_ele_PhiMnPhimatchingObject = nullptr;
0243   h1_ele_PhiMnPhimatchingObject2 = nullptr;
0244   h2_ele_PhiMnPhimatchingObjectVsEta = nullptr;
0245   h2_ele_PhiMnPhimatchingObjectVsPhi = nullptr;
0246   h2_ele_PhiMnPhimatchingObjectVsPt = nullptr;
0247 
0248   h1_scl_En_ = nullptr;
0249   h1_scl_EoEmatchingObject_barrel = nullptr;
0250   h1_scl_EoEmatchingObject_endcaps = nullptr;
0251   h1_scl_Et_ = nullptr;
0252   h2_scl_EtVsEta_ = nullptr;
0253   h2_scl_EtVsPhi_ = nullptr;
0254   h2_scl_EtaVsPhi_ = nullptr;
0255   h1_scl_Eta_ = nullptr;
0256   h1_scl_Phi_ = nullptr;
0257 
0258   h1_scl_SigIEtaIEta_ = nullptr;
0259   h1_scl_SigIEtaIEta_barrel_ = nullptr;
0260   h1_scl_SigIEtaIEta_endcaps_ = nullptr;
0261   h1_scl_full5x5_sigmaIetaIeta_ = nullptr;
0262   h1_scl_full5x5_sigmaIetaIeta_barrel_ = nullptr;
0263   h1_scl_full5x5_sigmaIetaIeta_endcaps_ = nullptr;
0264   h1_scl_E1x5_ = nullptr;
0265   h1_scl_E1x5_barrel_ = nullptr;
0266   h1_scl_E1x5_endcaps_ = nullptr;
0267   h1_scl_E2x5max_ = nullptr;
0268   h1_scl_E2x5max_barrel_ = nullptr;
0269   h1_scl_E2x5max_endcaps_ = nullptr;
0270   h1_scl_E5x5_ = nullptr;
0271   h1_scl_E5x5_barrel_ = nullptr;
0272   h1_scl_E5x5_endcaps_ = nullptr;
0273 
0274   h1_ele_ambiguousTracks = nullptr;
0275   h2_ele_ambiguousTracksVsEta = nullptr;
0276   h2_ele_ambiguousTracksVsPhi = nullptr;
0277   h2_ele_ambiguousTracksVsPt = nullptr;
0278   h1_ele_foundHits = nullptr;
0279   h1_ele_foundHits_barrel = nullptr;
0280   h1_ele_foundHits_endcaps = nullptr;
0281   h2_ele_foundHitsVsEta = nullptr;
0282   h2_ele_foundHitsVsPhi = nullptr;
0283   h2_ele_foundHitsVsPt = nullptr;
0284   h1_ele_lostHits = nullptr;
0285   h1_ele_lostHits_barrel = nullptr;
0286   h1_ele_lostHits_endcaps = nullptr;
0287   h2_ele_lostHitsVsEta = nullptr;
0288   h2_ele_lostHitsVsPhi = nullptr;
0289   h2_ele_lostHitsVsPt = nullptr;
0290   h1_ele_chi2 = nullptr;
0291   h1_ele_chi2_barrel = nullptr;
0292   h1_ele_chi2_endcaps = nullptr;
0293   h2_ele_chi2VsEta = nullptr;
0294   h2_ele_chi2VsPhi = nullptr;
0295   h2_ele_chi2VsPt = nullptr;
0296 
0297   h1_ele_PinMnPout = nullptr;
0298   h1_ele_PinMnPout_mode = nullptr;
0299   h2_ele_PinMnPoutVsEta_mode = nullptr;
0300   h2_ele_PinMnPoutVsPhi_mode = nullptr;
0301   h2_ele_PinMnPoutVsPt_mode = nullptr;
0302   h2_ele_PinMnPoutVsE_mode = nullptr;
0303   h2_ele_PinMnPoutVsChi2_mode = nullptr;
0304 
0305   h1_ele_outerP = nullptr;
0306   h1_ele_outerP_mode = nullptr;
0307   h2_ele_outerPVsEta_mode = nullptr;
0308   h1_ele_outerPt = nullptr;
0309   h1_ele_outerPt_mode = nullptr;
0310   h2_ele_outerPtVsEta_mode = nullptr;
0311   h2_ele_outerPtVsPhi_mode = nullptr;
0312   h2_ele_outerPtVsPt_mode = nullptr;
0313   h1_ele_EoP = nullptr;
0314   h1_ele_EoP_barrel = nullptr;
0315   h1_ele_EoP_endcaps = nullptr;
0316   h2_ele_EoPVsEta = nullptr;
0317   h2_ele_EoPVsPhi = nullptr;
0318   h2_ele_EoPVsE = nullptr;
0319   h1_ele_EseedOP = nullptr;
0320   h1_ele_EseedOP_barrel = nullptr;
0321   h1_ele_EseedOP_endcaps = nullptr;
0322   h2_ele_EseedOPVsEta = nullptr;
0323   h2_ele_EseedOPVsPhi = nullptr;
0324   h2_ele_EseedOPVsE = nullptr;
0325   h1_ele_EoPout = nullptr;
0326   h1_ele_EoPout_barrel = nullptr;
0327   h1_ele_EoPout_endcaps = nullptr;
0328   h2_ele_EoPoutVsEta = nullptr;
0329   h2_ele_EoPoutVsPhi = nullptr;
0330   h2_ele_EoPoutVsE = nullptr;
0331   h1_ele_EeleOPout = nullptr;
0332   h1_ele_EeleOPout_barrel = nullptr;
0333   h1_ele_EeleOPout_endcaps = nullptr;
0334   h2_ele_EeleOPoutVsEta = nullptr;
0335   h2_ele_EeleOPoutVsPhi = nullptr;
0336   h2_ele_EeleOPoutVsE = nullptr;
0337 
0338   h1_ele_dEtaSc_propVtx = nullptr;
0339   h1_ele_dEtaSc_propVtx_barrel = nullptr;
0340   h1_ele_dEtaSc_propVtx_endcaps = nullptr;
0341   h2_ele_dEtaScVsEta_propVtx = nullptr;
0342   h2_ele_dEtaScVsPhi_propVtx = nullptr;
0343   h2_ele_dEtaScVsPt_propVtx = nullptr;
0344   h1_ele_dPhiSc_propVtx = nullptr;
0345   h1_ele_dPhiSc_propVtx_barrel = nullptr;
0346   h1_ele_dPhiSc_propVtx_endcaps = nullptr;
0347   h2_ele_dPhiScVsEta_propVtx = nullptr;
0348   h2_ele_dPhiScVsPhi_propVtx = nullptr;
0349   h2_ele_dPhiScVsPt_propVtx = nullptr;
0350   h1_ele_dEtaCl_propOut = nullptr;
0351   h1_ele_dEtaCl_propOut_barrel = nullptr;
0352   h1_ele_dEtaCl_propOut_endcaps = nullptr;
0353   h2_ele_dEtaClVsEta_propOut = nullptr;
0354   h2_ele_dEtaClVsPhi_propOut = nullptr;
0355   h2_ele_dEtaClVsPt_propOut = nullptr;
0356   h1_ele_dPhiCl_propOut = nullptr;
0357   h1_ele_dPhiCl_propOut_barrel = nullptr;
0358   h1_ele_dPhiCl_propOut_endcaps = nullptr;
0359   h2_ele_dPhiClVsEta_propOut = nullptr;
0360   h2_ele_dPhiClVsPhi_propOut = nullptr;
0361   h2_ele_dPhiClVsPt_propOut = nullptr;
0362   h1_ele_dEtaEleCl_propOut = nullptr;
0363   h1_ele_dEtaEleCl_propOut_barrel = nullptr;
0364   h1_ele_dEtaEleCl_propOut_endcaps = nullptr;
0365   h2_ele_dEtaEleClVsEta_propOut = nullptr;
0366   h2_ele_dEtaEleClVsPhi_propOut = nullptr;
0367   h2_ele_dEtaEleClVsPt_propOut = nullptr;
0368   h1_ele_dPhiEleCl_propOut = nullptr;
0369   h1_ele_dPhiEleCl_propOut_barrel = nullptr;
0370   h1_ele_dPhiEleCl_propOut_endcaps = nullptr;
0371   h2_ele_dPhiEleClVsEta_propOut = nullptr;
0372   h2_ele_dPhiEleClVsPhi_propOut = nullptr;
0373   h2_ele_dPhiEleClVsPt_propOut = nullptr;
0374 
0375   h1_ele_seed_subdet2_ = nullptr;
0376   h1_ele_seed_mask_ = nullptr;
0377   h1_ele_seed_mask_bpix_ = nullptr;
0378   h1_ele_seed_mask_fpix_ = nullptr;
0379   h1_ele_seed_mask_tec_ = nullptr;
0380   h1_ele_seed_dphi2_ = nullptr;
0381   h2_ele_seed_dphi2VsEta_ = nullptr;
0382   h2_ele_seed_dphi2VsPt_ = nullptr;
0383   h1_ele_seed_dphi2pos_ = nullptr;
0384   h2_ele_seed_dphi2posVsEta_ = nullptr;
0385   h2_ele_seed_dphi2posVsPt_ = nullptr;
0386   h1_ele_seed_drz2_ = nullptr;
0387   h2_ele_seed_drz2VsEta_ = nullptr;
0388   h2_ele_seed_drz2VsPt_ = nullptr;
0389   h1_ele_seed_drz2pos_ = nullptr;
0390   h2_ele_seed_drz2posVsEta_ = nullptr;
0391   h2_ele_seed_drz2posVsPt_ = nullptr;
0392 
0393   h1_ele_classes = nullptr;
0394   h1_ele_eta = nullptr;
0395   h1_ele_eta_golden = nullptr;
0396   h1_ele_eta_bbrem = nullptr;
0397   h1_ele_eta_narrow = nullptr;
0398   h1_ele_eta_shower = nullptr;
0399 
0400   h1_ele_HoE = nullptr;
0401   h1_ele_HoE_barrel = nullptr;
0402   h1_ele_HoE_endcaps = nullptr;
0403   h1_ele_HoE_fiducial = nullptr;
0404   h2_ele_HoEVsEta = nullptr;
0405   h2_ele_HoEVsPhi = nullptr;
0406   h2_ele_HoEVsE = nullptr;
0407   h1_scl_ESFrac_endcaps = nullptr;
0408 
0409   h1_ele_fbrem = nullptr;
0410   p1_ele_fbremVsEta_mode = nullptr;
0411   p1_ele_fbremVsEta_mean = nullptr;
0412   h1_ele_superclusterfbrem = nullptr;
0413   h1_ele_superclusterfbrem_barrel = nullptr;
0414   h1_ele_superclusterfbrem_endcaps = nullptr;
0415   h2_ele_PinVsPoutGolden_mode = nullptr;
0416   h2_ele_PinVsPoutShowering_mode = nullptr;
0417   h2_ele_PinVsPoutGolden_mean = nullptr;
0418   h2_ele_PinVsPoutShowering_mean = nullptr;
0419   h2_ele_PtinVsPtoutGolden_mode = nullptr;
0420   h2_ele_PtinVsPtoutShowering_mode = nullptr;
0421   h2_ele_PtinVsPtoutGolden_mean = nullptr;
0422   h2_ele_PtinVsPtoutShowering_mean = nullptr;
0423   h1_scl_EoEmatchingObjectGolden_barrel = nullptr;
0424   h1_scl_EoEmatchingObjectGolden_endcaps = nullptr;
0425   h1_scl_EoEmatchingObjectShowering_barrel = nullptr;
0426   h1_scl_EoEmatchingObjectShowering_endcaps = nullptr;
0427 
0428   h1_ele_mva = nullptr;
0429   h1_ele_mva_isolated = nullptr;
0430   h1_ele_provenance = nullptr;
0431 
0432   h1_ele_tkSumPt_dr03 = nullptr;
0433   h1_ele_tkSumPt_dr03_barrel = nullptr;
0434   h1_ele_tkSumPt_dr03_endcaps = nullptr;
0435   h1_ele_ecalRecHitSumEt_dr03 = nullptr;
0436   h1_ele_ecalRecHitSumEt_dr03_barrel = nullptr;
0437   h1_ele_ecalRecHitSumEt_dr03_endcaps = nullptr;
0438   h1_ele_hcalTowerSumEt_dr03_depth1 = nullptr;
0439   h1_ele_hcalTowerSumEt_dr03_depth1_barrel = nullptr;
0440   h1_ele_hcalTowerSumEt_dr03_depth1_endcaps = nullptr;
0441   h1_ele_hcalTowerSumEt_dr03_depth2 = nullptr;
0442   h1_ele_tkSumPt_dr04 = nullptr;
0443   h1_ele_tkSumPt_dr04_barrel = nullptr;
0444   h1_ele_tkSumPt_dr04_endcaps = nullptr;
0445   h1_ele_ecalRecHitSumEt_dr04 = nullptr;
0446   h1_ele_ecalRecHitSumEt_dr04_barrel = nullptr;
0447   h1_ele_ecalRecHitSumEt_dr04_endcaps = nullptr;
0448   h1_ele_hcalTowerSumEt_dr04_depth1 = nullptr;
0449   h1_ele_hcalTowerSumEt_dr04_depth1_barrel = nullptr;
0450   h1_ele_hcalTowerSumEt_dr04_depth1_endcaps = nullptr;
0451   h1_ele_hcalTowerSumEt_dr04_depth2 = nullptr;
0452 
0453   h1_ele_convFlags = nullptr;
0454   h1_ele_convFlags_all = nullptr;
0455   h1_ele_convDist = nullptr;
0456   h1_ele_convDist_all = nullptr;
0457   h1_ele_convDcot = nullptr;
0458   h1_ele_convDcot_all = nullptr;
0459   h1_ele_convRadius = nullptr;
0460   h1_ele_convRadius_all = nullptr;
0461 }
0462 
0463 void ElectronMcFakeValidator::bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &) {
0464   iBooker.setCurrentFolder(outputInternalPath_);
0465 
0466   setBookIndex(-1);
0467   setBookPrefix("h");
0468   setBookEfficiencyFlag(set_EfficiencyFlag);
0469   setBookStatOverflowFlag(set_StatOverflowFlag);
0470 
0471   // matching object type
0472   std::string matchingObjectType;
0473   matchingObjectType = "GenJet";
0474 
0475   std::string htitle = "# " + matchingObjectType + "s", xtitle = "N_{" + matchingObjectType + "}";
0476   h1_matchingObjectNum = bookH1withSumw2(iBooker, "matchingObjectNum", htitle, fhits_nbin, 0., fhits_max, xtitle);
0477 
0478   // rec event collections sizes
0479   h1_recEleNum_ = bookH1(iBooker, "recEleNum", "# rec electrons", ele_nbin, ele_min, ele_max, "N_{ele}");
0480   h1_recCoreNum_ = bookH1(iBooker, "recCoreNum", "# rec electron cores", core_nbin, core_min, core_max, "N_{core}");
0481   h1_recTrackNum_ = bookH1(iBooker, "recTrackNum", "# rec gsf tracks", track_nbin, track_min, track_max, "N_{track}");
0482   h1_recSeedNum_ = bookH1(iBooker, "recSeedNum", "# rec electron seeds", seed_nbin, seed_min, seed_max, "N_{seed}");
0483   h1_recOfflineVertices_ = bookH1(
0484       iBooker, "recOfflineVertices", "# rec Offline Primary Vertices", opv_nbin, opv_min, opv_max, "N_{Vertices}");
0485 
0486   // mc
0487   h1_matchingObjectEta =
0488       bookH1withSumw2(iBooker, "matchingObject_eta", matchingObjectType + " #eta", eta_nbin, eta_min, eta_max, "#eta");
0489   h1_matchingObjectAbsEta =
0490       bookH1withSumw2(iBooker, "matchingObject_abseta", matchingObjectType + " |#eta|", eta_nbin / 2, 0., eta_max);
0491   h1_matchingObjectP =
0492       bookH1withSumw2(iBooker, "matchingObject_P", matchingObjectType + " p", p_nbin, 0., p_max, "p (GeV/c)");
0493   h1_matchingObjectPt =
0494       bookH1withSumw2(iBooker, "matchingObject_Pt", matchingObjectType + " pt", pteff_nbin, 5., pt_max);
0495   h1_matchingObjectPhi =
0496       bookH1withSumw2(iBooker, "matchingObject_phi", matchingObjectType + " phi", phi_nbin, phi_min, phi_max);
0497   h1_matchingObjectZ = bookH1withSumw2(iBooker, "matchingObject_z", matchingObjectType + " z", xyz_nbin, -25, 25);
0498 
0499   setBookPrefix("h_ele");
0500 
0501   // all electrons
0502   h1_ele_EoverP_all = bookH1withSumw2(iBooker,
0503                                       "EoverP_all",
0504                                       "ele E/P_{vertex}, all reco electrons",
0505                                       eop_nbin,
0506                                       0.,
0507                                       eop_max,
0508                                       "E/P_{vertex}",
0509                                       "Events",
0510                                       "ELE_LOGY E1 P");
0511   h1_ele_EseedOP_all = bookH1withSumw2(iBooker,
0512                                        "EseedOP_all",
0513                                        "ele E_{seed}/P_{vertex}, all reco electrons",
0514                                        eop_nbin,
0515                                        0.,
0516                                        eop_max,
0517                                        "E_{seed}/P_{vertex}",
0518                                        "Events",
0519                                        "ELE_LOGY E1 P");
0520   h1_ele_EoPout_all = bookH1withSumw2(iBooker,
0521                                       "EoPout_all",
0522                                       "ele E_{seed}/P_{out}, all reco electrons",
0523                                       eop_nbin,
0524                                       0.,
0525                                       eop_max,
0526                                       "E_{seed}/P_{out}",
0527                                       "Events",
0528                                       "ELE_LOGY E1 P");
0529   h1_ele_EeleOPout_all = bookH1withSumw2(iBooker,
0530                                          "EeleOPout_all",
0531                                          "ele E_{ele}/P_{out}, all reco electrons",
0532                                          eop_nbin,
0533                                          0.,
0534                                          eop_max,
0535                                          "E_{ele}/P_{out}",
0536                                          "Events",
0537                                          "ELE_LOGY E1 P");
0538   h1_ele_dEtaSc_propVtx_all = bookH1withSumw2(iBooker,
0539                                               "dEtaSc_propVtx_all",
0540                                               "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",
0541                                               detamatch_nbin,
0542                                               detamatch_min,
0543                                               detamatch_max,
0544                                               "#eta_{sc} - #eta_{tr}",
0545                                               "Events",
0546                                               "ELE_LOGY E1 P");
0547   h1_ele_dPhiSc_propVtx_all = bookH1withSumw2(iBooker,
0548                                               "dPhiSc_propVtx_all",
0549                                               "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons",
0550                                               dphimatch_nbin,
0551                                               dphimatch_min,
0552                                               dphimatch_max,
0553                                               "#phi_{sc} - #phi_{tr} (rad)",
0554                                               "Events",
0555                                               "ELE_LOGY E1 P");
0556   h1_ele_dEtaCl_propOut_all = bookH1withSumw2(iBooker,
0557                                               "dEtaCl_propOut_all",
0558                                               "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",
0559                                               detamatch_nbin,
0560                                               detamatch_min,
0561                                               detamatch_max,
0562                                               "#eta_{sc} - #eta_{tr}",
0563                                               "Events",
0564                                               "ELE_LOGY E1 P");
0565   h1_ele_dPhiCl_propOut_all = bookH1withSumw2(iBooker,
0566                                               "dPhiCl_propOut_all",
0567                                               "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons",
0568                                               dphimatch_nbin,
0569                                               dphimatch_min,
0570                                               dphimatch_max,
0571                                               "#phi_{sc} - #phi_{tr} (rad)",
0572                                               "Events",
0573                                               "ELE_LOGY E1 P");
0574   h1_ele_TIP_all = bookH1withSumw2(iBooker,
0575                                    "TIP_all",
0576                                    "ele vertex transverse radius, all reco electrons",
0577                                    100,
0578                                    0.,
0579                                    0.2,
0580                                    "r_{T} (cm)",
0581                                    "Events",
0582                                    "ELE_LOGY E1 P");
0583   h1_ele_HoE_all = bookH1withSumw2(iBooker,
0584                                    "HoE_all",
0585                                    "ele hadronic energy / em energy, all reco electrons",
0586                                    hoe_nbin,
0587                                    hoe_min,
0588                                    hoe_max,
0589                                    "H/E",
0590                                    "Events",
0591                                    "ELE_LOGY E1 P");
0592   h1_ele_HoE_bc_all = bookH1withSumw2(iBooker,
0593                                       "HoE_bc_all",
0594                                       "ele hadronic energy / em energy, all reco electrons, behind cluster",
0595                                       hoe_nbin,
0596                                       hoe_min,
0597                                       hoe_max,
0598                                       "H/E",
0599                                       "Events",
0600                                       "ELE_LOGY E1 P");
0601   h1_ele_vertexEta_all = bookH1withSumw2(
0602       iBooker, "vertexEta_all", "ele eta, all reco electrons", eta_nbin, eta_min, eta_max, "", "Events");
0603   h1_ele_vertexPt_all =
0604       bookH1withSumw2(iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events");
0605   h1_ele_mee_all = bookH1withSumw2(iBooker,
0606                                    "mee_all",
0607                                    "ele pairs invariant mass, all reco electrons",
0608                                    mee_nbin,
0609                                    mee_min,
0610                                    mee_max,
0611                                    "m_{ee} (GeV/c^{2})");
0612   h1_ele_mee_os = bookH1withSumw2(iBooker,
0613                                   "mee_os",
0614                                   "ele pairs invariant mass, opp. sign",
0615                                   mee_nbin,
0616                                   mee_min,
0617                                   mee_max,
0618                                   "m_{e^{+}e^{-}} (GeV/c^{2})");
0619 
0620   // duplicates
0621   h2_ele_E2mnE1vsMee_all = bookH2(iBooker,
0622                                   "E2mnE1vsMee_all",
0623                                   "E2 - E1 vs ele pairs invariant mass, all electrons",
0624                                   mee_nbin,
0625                                   mee_min,
0626                                   mee_max,
0627                                   100,
0628                                   -50.,
0629                                   50.,
0630                                   "m_{e^{+}e^{-}} (GeV/c^{2})",
0631                                   "E2 - E1 (GeV)");
0632   h2_ele_E2mnE1vsMee_egeg_all = bookH2(iBooker,
0633                                        "E2mnE1vsMee_egeg_all",
0634                                        "E2 - E1 vs ele pairs invariant mass, ecal driven pairs, all electrons",
0635                                        mee_nbin,
0636                                        mee_min,
0637                                        mee_max,
0638                                        100,
0639                                        -50.,
0640                                        50.,
0641                                        "m_{e^{+}e^{-}} (GeV/c^{2})",
0642                                        "E2 - E1 (GeV)");
0643 
0644   // matched electrons
0645 
0646   htitle = "Efficiency vs matching " + matchingObjectType + " ";
0647   h1_ele_matchingObjectEta_matched =
0648       bookH1withSumw2(iBooker, "matchingObjectEta_matched", htitle + "#eta", eta_nbin, eta_min, eta_max);
0649   h1_ele_matchingObjectAbsEta_matched =
0650       bookH1withSumw2(iBooker, "matchingObjectAbsEta_matched", htitle + "|#eta|", eta_nbin / 2, 0., eta_max);
0651   h1_ele_matchingObjectPt_matched =
0652       bookH1(iBooker, "matchingObjectPt_matched", htitle + "p_{T}", pteff_nbin, 5., pt_max);
0653   h1_ele_matchingObjectPhi_matched =
0654       bookH1withSumw2(iBooker, "matchingObjectPhi_matched", htitle + "phi", phi_nbin, phi_min, phi_max);
0655   h1_ele_matchingObjectZ_matched = bookH1withSumw2(iBooker, "matchingObjectZ_matched", htitle + "z", xyz_nbin, -25, 25);
0656 
0657   h1_ele_charge = bookH1withSumw2(iBooker, "charge", "ele charge", 5, -2.5, 2.5, "charge");
0658   h2_ele_chargeVsEta = bookH2(iBooker, "chargeVsEta", "ele charge vs eta", eta2D_nbin, eta_min, eta_max, 5, -2., 2.);
0659   h2_ele_chargeVsPhi = bookH2(iBooker, "chargeVsPhi", "ele charge vs phi", phi2D_nbin, phi_min, phi_max, 5, -2., 2.);
0660   h2_ele_chargeVsPt = bookH2(iBooker, "chargeVsPt", "ele charge vs pt", pt_nbin, 0., 100., 5, -2., 2.);
0661   h1_ele_vertexP = bookH1withSumw2(iBooker, "vertexP", "ele momentum", p_nbin, 0., p_max, "p_{vertex} (GeV/c)");
0662   h1_ele_vertexPt =
0663       bookH1withSumw2(iBooker, "vertexPt", "ele transverse momentum", pt_nbin, 0., pt_max, "p_{T vertex} (GeV/c)");
0664   h2_ele_vertexPtVsEta = bookH2(
0665       iBooker, "vertexPtVsEta", "ele transverse momentum vs eta", eta2D_nbin, eta_min, eta_max, pt2D_nbin, 0., pt_max);
0666   h2_ele_vertexPtVsPhi = bookH2(
0667       iBooker, "vertexPtVsPhi", "ele transverse momentum vs phi", phi2D_nbin, phi_min, phi_max, pt2D_nbin, 0., pt_max);
0668   h1_ele_vertexEta = bookH1withSumw2(iBooker, "vertexEta", "ele momentum eta", eta_nbin, eta_min, eta_max, "#eta");
0669   h2_ele_vertexEtaVsPhi = bookH2(
0670       iBooker, "vertexEtaVsPhi", "ele momentum eta vs phi", eta2D_nbin, eta_min, eta_max, phi2D_nbin, phi_min, phi_max);
0671   h1_ele_vertexPhi =
0672       bookH1withSumw2(iBooker, "vertexPhi", "ele  momentum #phi", phi_nbin, phi_min, phi_max, "#phi (rad)");
0673   h1_ele_vertexX = bookH1withSumw2(iBooker, "vertexX", "ele vertex x", xyz_nbin, -0.6, 0.6, "x (cm)");
0674   h1_ele_vertexY = bookH1withSumw2(iBooker, "vertexY", "ele vertex y", xyz_nbin, -0.6, 0.6, "y (cm)");
0675   h1_ele_vertexZ = bookH1withSumw2(iBooker, "vertexZ", "ele vertex z", xyz_nbin, -25, 25, "z (cm)");
0676   h1_ele_vertexTIP = bookH1withSumw2(iBooker,
0677                                      "vertexTIP",
0678                                      "ele transverse impact parameter (wrt gen vtx)",
0679                                      90,
0680                                      0.,
0681                                      0.15,
0682                                      "TIP (cm)",
0683                                      "Events",
0684                                      "ELE_LOGY E1 P");
0685   h2_ele_vertexTIPVsEta = bookH2(iBooker,
0686                                  "vertexTIPVsEta",
0687                                  "ele transverse impact parameter (wrt gen vtx) vs eta",
0688                                  eta2D_nbin,
0689                                  eta_min,
0690                                  eta_max,
0691                                  45,
0692                                  0.,
0693                                  0.15,
0694                                  "#eta",
0695                                  "TIP (cm)");
0696   h2_ele_vertexTIPVsPhi = bookH2(iBooker,
0697                                  "vertexTIPVsPhi",
0698                                  "ele transverse impact parameter (wrt gen vtx) vs phi",
0699                                  phi2D_nbin,
0700                                  phi_min,
0701                                  phi_max,
0702                                  45,
0703                                  0.,
0704                                  0.15,
0705                                  "#phi (rad)",
0706                                  "TIP (cm)");
0707   h2_ele_vertexTIPVsPt = bookH2(iBooker,
0708                                 "vertexTIPVsPt",
0709                                 "ele transverse impact parameter (wrt gen vtx) vs transverse momentum",
0710                                 pt2D_nbin,
0711                                 0.,
0712                                 pt_max,
0713                                 45,
0714                                 0.,
0715                                 0.15,
0716                                 "p_{T} (GeV/c)",
0717                                 "TIP (cm)");
0718 
0719   htitle = "Electron / Matching " + matchingObjectType + ", momemtum";
0720   xtitle = "P / P_{" + matchingObjectType + "}";
0721   h1_ele_PoPmatchingObject =
0722       bookH1withSumw2(iBooker, "PoPmatchingObject", htitle, popmatching_nbin, popmatching_min, popmatching_max, xtitle);
0723   h2_ele_PoPmatchingObjectVsEta = bookH2(iBooker,
0724                                          "PoPmatchingObjectVsEta",
0725                                          htitle + ",vs eta",
0726                                          eta2D_nbin,
0727                                          eta_min,
0728                                          eta_max,
0729                                          50,
0730                                          popmatching_min,
0731                                          popmatching_max);
0732   h2_ele_PoPmatchingObjectVsPhi = bookH2(iBooker,
0733                                          "PoPmatchingObjectVsPhi",
0734                                          htitle + ",vs phi",
0735                                          phi2D_nbin,
0736                                          phi_min,
0737                                          phi_max,
0738                                          50,
0739                                          popmatching_min,
0740                                          popmatching_max);
0741   h2_ele_PoPmatchingObjectVsPt = bookH2(
0742       iBooker, "PoPmatchingObjectVsPt", htitle + ",vs eta", pt2D_nbin, 0., pt_max, 50, popmatching_min, popmatching_max);
0743   h1_ele_PoPmatchingObject_barrel = bookH1withSumw2(iBooker,
0744                                                     "PoPmatchingObject_barrel",
0745                                                     htitle + ", barrel",
0746                                                     popmatching_nbin,
0747                                                     popmatching_min,
0748                                                     popmatching_max,
0749                                                     xtitle);
0750   h1_ele_PoPmatchingObject_endcaps = bookH1withSumw2(iBooker,
0751                                                      "PoPmatchingObject_endcaps",
0752                                                      htitle + ", endcaps",
0753                                                      popmatching_nbin,
0754                                                      popmatching_min,
0755                                                      popmatching_max,
0756                                                      xtitle);
0757   htitle = "Ele - " + matchingObjectType + ", ";
0758   xtitle = "#eta - #eta_{" + matchingObjectType + "}";
0759   h1_ele_EtaMnEtamatchingObject =
0760       bookH1withSumw2(iBooker, "EtamatchingObjectEtaTrue", htitle + "eta", deta_nbin, deta_min, deta_max, xtitle);
0761   h2_ele_EtaMnEtamatchingObjectVsEta = bookH2(iBooker,
0762                                               "EtaMnEtamatchingObjectVsEta",
0763                                               htitle + "eta, vs eta",
0764                                               eta2D_nbin,
0765                                               eta_min,
0766                                               eta_max,
0767                                               deta_nbin / 2,
0768                                               deta_min,
0769                                               deta_max);
0770   h2_ele_EtaMnEtamatchingObjectVsPhi = bookH2(iBooker,
0771                                               "EtaMnEtamatchingObjectVsPhi",
0772                                               htitle + "eta, vs phi",
0773                                               phi2D_nbin,
0774                                               phi_min,
0775                                               phi_max,
0776                                               deta_nbin / 2,
0777                                               deta_min,
0778                                               deta_max);
0779   h2_ele_EtaMnEtamatchingObjectVsPt = bookH2(iBooker,
0780                                              "EtaMnEtamatchingObjectVsPt",
0781                                              htitle + "eta,, vs pt",
0782                                              pt_nbin,
0783                                              0.,
0784                                              pt_max,
0785                                              deta_nbin / 2,
0786                                              deta_min,
0787                                              deta_max);
0788   xtitle = "#phi - #phi_{" + matchingObjectType + "} (rad)";
0789   h1_ele_PhiMnPhimatchingObject =
0790       bookH1withSumw2(iBooker, "PhiMnPhimatchingObject", htitle + "phi", dphi_nbin, dphi_min, dphi_max, xtitle);
0791   h1_ele_PhiMnPhimatchingObject2 =
0792       bookH1(iBooker, "PhiMnPhimatchingObject2", htitle + "phi", dphimatch2D_nbin, dphimatch_min, dphimatch_max);
0793   h2_ele_PhiMnPhimatchingObjectVsEta = bookH2(iBooker,
0794                                               "PhiMnPhimatchingObjectVsEta",
0795                                               htitle + "phi, vs eta",
0796                                               eta2D_nbin,
0797                                               eta_min,
0798                                               eta_max,
0799                                               dphi_nbin / 2,
0800                                               dphi_min,
0801                                               dphi_max);
0802   h2_ele_PhiMnPhimatchingObjectVsPhi = bookH2(iBooker,
0803                                               "PhiMnPhimatchingObjectVsPhi",
0804                                               htitle + "phi, vs phi",
0805                                               phi2D_nbin,
0806                                               phi_min,
0807                                               phi_max,
0808                                               dphi_nbin / 2,
0809                                               dphi_min,
0810                                               dphi_max);
0811   h2_ele_PhiMnPhimatchingObjectVsPt = bookH2(iBooker,
0812                                              "PhiMnPhimatchingObjectVsPt",
0813                                              htitle + "phi, vs pt",
0814                                              pt2D_nbin,
0815                                              0.,
0816                                              pt_max,
0817                                              dphi_nbin / 2,
0818                                              dphi_min,
0819                                              dphi_max);
0820 
0821   // matched electron, superclusters
0822 
0823   setBookPrefix("h_scl");
0824 
0825   h1_scl_En_ = bookH1withSumw2(iBooker, "energy", "ele supercluster energy", p_nbin, 0., p_max);
0826   htitle = "Ele supercluster / " + matchingObjectType + ", energy";
0827   xtitle = "E/E_{" + matchingObjectType + "}";
0828   h1_scl_EoEmatchingObject_barrel =
0829       bookH1withSumw2(iBooker, "EoEmatchingObject_barrel", htitle + ", barrel", 50, 0.2, 1.2, xtitle);
0830   h1_scl_EoEmatchingObject_endcaps =
0831       bookH1withSumw2(iBooker, "EoEmatchingObject_endcaps", htitle + ", endcaps", 50, 0.2, 1.2, xtitle);
0832   h1_scl_Et_ = bookH1withSumw2(iBooker, "et", "ele supercluster transverse energy", pt_nbin, 0., pt_max);
0833   h2_scl_EtVsEta_ = bookH2(iBooker,
0834                            "etVsEta",
0835                            "ele supercluster transverse energy vs eta",
0836                            eta2D_nbin,
0837                            eta_min,
0838                            eta_max,
0839                            pt_nbin,
0840                            0.,
0841                            pt_max);
0842   h2_scl_EtVsPhi_ = bookH2(iBooker,
0843                            "etVsPhi",
0844                            "ele supercluster transverse energy vs phi",
0845                            phi2D_nbin,
0846                            phi_min,
0847                            phi_max,
0848                            pt_nbin,
0849                            0.,
0850                            pt_max);
0851   h2_scl_EtaVsPhi_ = bookH2(
0852       iBooker, "etaVsPhi", "ele supercluster eta vs phi", phi2D_nbin, phi_min, phi_max, eta2D_nbin, eta_min, eta_max);
0853   h1_scl_Eta_ = bookH1withSumw2(iBooker, "eta", "ele supercluster eta", eta_nbin, eta_min, eta_max);
0854   h1_scl_Phi_ = bookH1withSumw2(iBooker, "phi", "ele supercluster phi", phi_nbin, phi_min, phi_max);
0855   h1_scl_SigIEtaIEta_ = bookH1withSumw2(iBooker,
0856                                         "sigietaieta",
0857                                         "ele supercluster sigma ieta ieta",
0858                                         100,
0859                                         0.,
0860                                         0.05,
0861                                         "#sigma_{i#eta i#eta}",
0862                                         "Events",
0863                                         "ELE_LOGY E1 P");
0864   h1_scl_SigIEtaIEta_barrel_ = bookH1withSumw2(iBooker,
0865                                                "sigietaieta_barrel",
0866                                                "ele supercluster sigma ieta ieta, barrel",
0867                                                100,
0868                                                0.,
0869                                                0.05,
0870                                                "#sigma_{i#eta i#eta}",
0871                                                "Events",
0872                                                "ELE_LOGY E1 P");
0873   h1_scl_SigIEtaIEta_endcaps_ = bookH1withSumw2(iBooker,
0874                                                 "sigietaieta_endcaps",
0875                                                 "ele supercluster sigma ieta ieta, endcaps",
0876                                                 100,
0877                                                 0.,
0878                                                 0.05,
0879                                                 "#sigma_{i#eta i#eta}",
0880                                                 "Events",
0881                                                 "ELE_LOGY E1 P");
0882   h1_scl_full5x5_sigmaIetaIeta_ = bookH1withSumw2(iBooker,
0883                                                   "full5x5_sigietaieta",
0884                                                   "ele supercluster full5x5 sigma ieta ieta",
0885                                                   100,
0886                                                   0.,
0887                                                   0.05,
0888                                                   "#sigma_{i#eta i#eta}",
0889                                                   "Events",
0890                                                   "ELE_LOGY E1 P");
0891   h1_scl_full5x5_sigmaIetaIeta_barrel_ = bookH1withSumw2(iBooker,
0892                                                          "full5x5_sigietaieta_barrel",
0893                                                          "ele supercluster full5x5 sigma ieta ieta, barrel",
0894                                                          100,
0895                                                          0.,
0896                                                          0.05,
0897                                                          "#sigma_{i#eta i#eta}",
0898                                                          "Events",
0899                                                          "ELE_LOGY E1 P");
0900   h1_scl_full5x5_sigmaIetaIeta_endcaps_ = bookH1withSumw2(iBooker,
0901                                                           "full5x5_sigietaieta_endcaps",
0902                                                           "ele supercluster full5x5 sigma ieta ieta, endcaps",
0903                                                           100,
0904                                                           0.,
0905                                                           0.05,
0906                                                           "#sigma_{i#eta i#eta}",
0907                                                           "Events",
0908                                                           "ELE_LOGY E1 P");
0909   h1_scl_E1x5_ = bookH1withSumw2(
0910       iBooker, "E1x5", "ele supercluster energy in 1x5", p_nbin, 0., p_max, "E1x5 (GeV)", "Events", "ELE_LOGY E1 P");
0911   h1_scl_E1x5_barrel_ = bookH1withSumw2(iBooker,
0912                                         "E1x5_barrel",
0913                                         "ele supercluster energy in 1x5 barrel",
0914                                         p_nbin,
0915                                         0.,
0916                                         p_max,
0917                                         "E1x5 (GeV)",
0918                                         "Events",
0919                                         "ELE_LOGY E1 P");
0920   h1_scl_E1x5_endcaps_ = bookH1withSumw2(iBooker,
0921                                          "E1x5_endcaps",
0922                                          "ele supercluster energy in 1x5 endcaps",
0923                                          p_nbin,
0924                                          0.,
0925                                          p_max,
0926                                          "E1x5 (GeV)",
0927                                          "Events",
0928                                          "ELE_LOGY E1 P");
0929   h1_scl_E2x5max_ = bookH1withSumw2(iBooker,
0930                                     "E2x5max",
0931                                     "ele supercluster energy in 2x5 max",
0932                                     p_nbin,
0933                                     0.,
0934                                     p_max,
0935                                     "E2x5 (GeV)",
0936                                     "Events",
0937                                     "ELE_LOGY E1 P");
0938   h1_scl_E2x5max_barrel_ = bookH1withSumw2(iBooker,
0939                                            "E2x5max_barrel",
0940                                            "ele supercluster energy in 2x5 _max barrel",
0941                                            p_nbin,
0942                                            0.,
0943                                            p_max,
0944                                            "E2x5 (GeV)",
0945                                            "Events",
0946                                            "ELE_LOGY E1 P");
0947   h1_scl_E2x5max_endcaps_ = bookH1withSumw2(iBooker,
0948                                             "E2x5max_endcaps",
0949                                             "ele supercluster energy in 2x5 _max endcaps",
0950                                             p_nbin,
0951                                             0.,
0952                                             p_max,
0953                                             "E2x5 (GeV)",
0954                                             "Events",
0955                                             "ELE_LOGY E1 P");
0956   h1_scl_E5x5_ = bookH1withSumw2(
0957       iBooker, "E5x5", "ele supercluster energy in 5x5", p_nbin, 0., p_max, "E5x5 (GeV)", "Events", "ELE_LOGY E1 P");
0958   h1_scl_E5x5_barrel_ = bookH1withSumw2(iBooker,
0959                                         "E5x5_barrel",
0960                                         "ele supercluster energy in 5x5 barrel",
0961                                         p_nbin,
0962                                         0.,
0963                                         p_max,
0964                                         "E5x5 (GeV)",
0965                                         "Events",
0966                                         "ELE_LOGY E1 P");
0967   h1_scl_E5x5_endcaps_ = bookH1withSumw2(iBooker,
0968                                          "E5x5_endcaps",
0969                                          "ele supercluster energy in 5x5 endcaps",
0970                                          p_nbin,
0971                                          0.,
0972                                          p_max,
0973                                          "E5x5 (GeV)",
0974                                          "Events",
0975                                          "ELE_LOGY E1 P");
0976 
0977   // matched electron, gsf tracks
0978 
0979   setBookPrefix("h_ele");
0980 
0981   h1_ele_ambiguousTracks = bookH1withSumw2(iBooker,
0982                                            "ambiguousTracks",
0983                                            "ele # ambiguous tracks",
0984                                            5,
0985                                            0.,
0986                                            5.,
0987                                            "N_{ambiguous tracks}",
0988                                            "Events",
0989                                            "ELE_LOGY E1 P");
0990   h2_ele_ambiguousTracksVsEta = bookH2(
0991       iBooker, "ambiguousTracksVsEta", "ele # ambiguous tracks  vs eta", eta2D_nbin, eta_min, eta_max, 5, 0., 5.);
0992   h2_ele_ambiguousTracksVsPhi = bookH2(
0993       iBooker, "ambiguousTracksVsPhi", "ele # ambiguous tracks  vs phi", phi2D_nbin, phi_min, phi_max, 5, 0., 5.);
0994   h2_ele_ambiguousTracksVsPt =
0995       bookH2(iBooker, "ambiguousTracksVsPt", "ele # ambiguous tracks vs pt", pt2D_nbin, 0., pt_max, 5, 0., 5.);
0996   h1_ele_foundHits =
0997       bookH1withSumw2(iBooker, "foundHits", "ele track # found hits", fhits_nbin, 0., fhits_max, "N_{hits}");
0998   h2_ele_foundHitsVsEta = bookH2(iBooker,
0999                                  "foundHitsVsEta",
1000                                  "ele track # found hits vs eta",
1001                                  eta2D_nbin,
1002                                  eta_min,
1003                                  eta_max,
1004                                  fhits_nbin,
1005                                  0.,
1006                                  fhits_max);
1007   h2_ele_foundHitsVsPhi = bookH2(iBooker,
1008                                  "foundHitsVsPhi",
1009                                  "ele track # found hits vs phi",
1010                                  phi2D_nbin,
1011                                  phi_min,
1012                                  phi_max,
1013                                  fhits_nbin,
1014                                  0.,
1015                                  fhits_max);
1016   h2_ele_foundHitsVsPt = bookH2(
1017       iBooker, "foundHitsVsPt", "ele track # found hits vs pt", pt2D_nbin, 0., pt_max, fhits_nbin, 0., fhits_max);
1018   h1_ele_lostHits = bookH1withSumw2(iBooker, "lostHits", "ele track # lost hits", 5, 0., 5., "N_{lost hits}");
1019   h2_ele_lostHitsVsEta = bookH2(
1020       iBooker, "lostHitsVsEta", "ele track # lost hits vs eta", eta2D_nbin, eta_min, eta_max, lhits_nbin, 0., lhits_max);
1021   h2_ele_lostHitsVsPhi = bookH2(
1022       iBooker, "lostHitsVsPhi", "ele track # lost hits vs eta", phi2D_nbin, phi_min, phi_max, lhits_nbin, 0., lhits_max);
1023   h2_ele_lostHitsVsPt =
1024       bookH2(iBooker, "lostHitsVsPt", "ele track # lost hits vs eta", pt2D_nbin, 0., pt_max, lhits_nbin, 0., lhits_max);
1025   h1_ele_chi2 =
1026       bookH1withSumw2(iBooker, "chi2", "ele track #chi^{2}", 100, 0., 15., "#Chi^{2}", "Events", "ELE_LOGY E1 P");
1027   h2_ele_chi2VsEta =
1028       bookH2(iBooker, "chi2VsEta", "ele track #chi^{2} vs eta", eta2D_nbin, eta_min, eta_max, 50, 0., 15.);
1029   h2_ele_chi2VsPhi =
1030       bookH2(iBooker, "chi2VsPhi", "ele track #chi^{2} vs phi", phi2D_nbin, phi_min, phi_max, 50, 0., 15.);
1031   h2_ele_chi2VsPt = bookH2(iBooker, "chi2VsPt", "ele track #chi^{2} vs pt", pt2D_nbin, 0., pt_max, 50, 0., 15.);
1032   h1_ele_PinMnPout = bookH1withSumw2(iBooker,
1033                                      "PinMnPout",
1034                                      "ele track inner p - outer p, mean of GSF components",
1035                                      p_nbin,
1036                                      0.,
1037                                      200.,
1038                                      "P_{vertex} - P_{out} (GeV/c)");
1039   h1_ele_PinMnPout_mode = bookH1withSumw2(iBooker,
1040                                           "PinMnPout_mode",
1041                                           "ele track inner p - outer p, mode of GSF components",
1042                                           p_nbin,
1043                                           0.,
1044                                           100.,
1045                                           "P_{vertex} - P_{out}, mode of GSF components (GeV/c)");
1046   h2_ele_PinMnPoutVsEta_mode = bookH2(iBooker,
1047                                       "PinMnPoutVsEta_mode",
1048                                       "ele track inner p - outer p vs eta, mode of GSF components",
1049                                       eta2D_nbin,
1050                                       eta_min,
1051                                       eta_max,
1052                                       p2D_nbin,
1053                                       0.,
1054                                       100.);
1055   h2_ele_PinMnPoutVsPhi_mode = bookH2(iBooker,
1056                                       "PinMnPoutVsPhi_mode",
1057                                       "ele track inner p - outer p vs phi, mode of GSF components",
1058                                       phi2D_nbin,
1059                                       phi_min,
1060                                       phi_max,
1061                                       p2D_nbin,
1062                                       0.,
1063                                       100.);
1064   h2_ele_PinMnPoutVsPt_mode = bookH2(iBooker,
1065                                      "PinMnPoutVsPt_mode",
1066                                      "ele track inner p - outer p vs pt, mode of GSF components",
1067                                      pt2D_nbin,
1068                                      0.,
1069                                      pt_max,
1070                                      p2D_nbin,
1071                                      0.,
1072                                      100.);
1073   h2_ele_PinMnPoutVsE_mode = bookH2(iBooker,
1074                                     "PinMnPoutVsE_mode",
1075                                     "ele track inner p - outer p vs E, mode of GSF components",
1076                                     p2D_nbin,
1077                                     0.,
1078                                     200.,
1079                                     p2D_nbin,
1080                                     0.,
1081                                     100.);
1082   h2_ele_PinMnPoutVsChi2_mode = bookH2(iBooker,
1083                                        "PinMnPoutVsChi2_mode",
1084                                        "ele track inner p - outer p vs track chi2, mode of GSF components",
1085                                        50,
1086                                        0.,
1087                                        20.,
1088                                        p2D_nbin,
1089                                        0.,
1090                                        100.);
1091   h1_ele_outerP = bookH1withSumw2(
1092       iBooker, "outerP", "ele track outer p, mean of GSF components", p_nbin, 0., p_max, "P_{out} (GeV/c)");
1093   h1_ele_outerP_mode = bookH1withSumw2(
1094       iBooker, "outerP_mode", "ele track outer p, mode of GSF components", p_nbin, 0., p_max, "P_{out} (GeV/c)");
1095   h2_ele_outerPVsEta_mode =
1096       bookH2(iBooker, "outerPVsEta_mode", "ele track outer p vs eta mode", eta2D_nbin, eta_min, eta_max, 50, 0., p_max);
1097   h1_ele_outerPt = bookH1withSumw2(
1098       iBooker, "outerPt", "ele track outer p_{T}, mean of GSF components", pt_nbin, 0., pt_max, "P_{T out} (GeV/c)");
1099   h1_ele_outerPt_mode = bookH1withSumw2(iBooker,
1100                                         "outerPt_mode",
1101                                         "ele track outer p_{T}, mode of GSF components",
1102                                         pt_nbin,
1103                                         0.,
1104                                         pt_max,
1105                                         "P_{T out} (GeV/c)");
1106   h2_ele_outerPtVsEta_mode = bookH2(iBooker,
1107                                     "outerPtVsEta_mode",
1108                                     "ele track outer p_{T} vs eta, mode of GSF components",
1109                                     eta2D_nbin,
1110                                     eta_min,
1111                                     eta_max,
1112                                     pt2D_nbin,
1113                                     0.,
1114                                     pt_max);
1115   h2_ele_outerPtVsPhi_mode = bookH2(iBooker,
1116                                     "outerPtVsPhi_mode",
1117                                     "ele track outer p_{T} vs phi, mode of GSF components",
1118                                     phi2D_nbin,
1119                                     phi_min,
1120                                     phi_max,
1121                                     pt2D_nbin,
1122                                     0.,
1123                                     pt_max);
1124   h2_ele_outerPtVsPt_mode = bookH2(iBooker,
1125                                    "outerPtVsPt_mode",
1126                                    "ele track outer p_{T} vs pt, mode of GSF components",
1127                                    pt2D_nbin,
1128                                    0.,
1129                                    100.,
1130                                    pt2D_nbin,
1131                                    0.,
1132                                    pt_max);
1133 
1134   // matched electrons, matching
1135   h1_ele_EoP = bookH1withSumw2(
1136       iBooker, "EoP", "ele E/P_{vertex}", eop_nbin, 0., eop_max, "E/P_{vertex}", "Events", "ELE_LOGY E1 P");
1137   h1_ele_EoP_barrel = bookH1withSumw2(iBooker,
1138                                       "EoP_barrel",
1139                                       "ele E/P_{vertex} barrel",
1140                                       eop_nbin,
1141                                       0.,
1142                                       eop_max,
1143                                       "E/P_{vertex}",
1144                                       "Events",
1145                                       "ELE_LOGY E1 P");
1146   h1_ele_EoP_endcaps = bookH1withSumw2(iBooker,
1147                                        "EoP_endcaps",
1148                                        "ele E/P_{vertex} endcaps",
1149                                        eop_nbin,
1150                                        0.,
1151                                        eop_max,
1152                                        "E/P_{vertex}",
1153                                        "Events",
1154                                        "ELE_LOGY E1 P");
1155   h2_ele_EoPVsEta =
1156       bookH2(iBooker, "EoPVsEta", "ele E/P_{vertex} vs eta", eta2D_nbin, eta_min, eta_max, eop2D_nbin, 0., eopmaxsht);
1157   h2_ele_EoPVsPhi =
1158       bookH2(iBooker, "EoPVsPhi", "ele E/P_{vertex} vs phi", phi2D_nbin, phi_min, phi_max, eop2D_nbin, 0., eopmaxsht);
1159   h2_ele_EoPVsE = bookH2(iBooker, "EoPVsE", "ele E/P_{vertex} vs E", 50, 0., p_max, 50, 0., 5.);
1160   h1_ele_EseedOP = bookH1withSumw2(iBooker,
1161                                    "EseedOP",
1162                                    "ele E_{seed}/P_{vertex}",
1163                                    eop_nbin,
1164                                    0.,
1165                                    eop_max,
1166                                    "E_{seed}/P_{vertex}",
1167                                    "Events",
1168                                    "ELE_LOGY E1 P");
1169   h1_ele_EseedOP_barrel = bookH1withSumw2(iBooker,
1170                                           "EseedOP_barrel",
1171                                           "ele E_{seed}/P_{vertex} barrel",
1172                                           eop_nbin,
1173                                           0.,
1174                                           eop_max,
1175                                           "E_{seed}/P_{vertex}",
1176                                           "Events",
1177                                           "ELE_LOGY E1 P");
1178   h1_ele_EseedOP_endcaps = bookH1withSumw2(iBooker,
1179                                            "EseedOP_endcaps",
1180                                            "ele E_{seed}/P_{vertex} endcaps",
1181                                            eop_nbin,
1182                                            0.,
1183                                            eop_max,
1184                                            "E_{seed}/P_{vertex}",
1185                                            "Events",
1186                                            "ELE_LOGY E1 P");
1187   h2_ele_EseedOPVsEta = bookH2(iBooker,
1188                                "EseedOPVsEta",
1189                                "ele E_{seed}/P_{vertex} vs eta",
1190                                eta2D_nbin,
1191                                eta_min,
1192                                eta_max,
1193                                eop2D_nbin,
1194                                0.,
1195                                eopmaxsht);
1196   h2_ele_EseedOPVsPhi = bookH2(iBooker,
1197                                "EseedOPVsPhi",
1198                                "ele E_{seed}/P_{vertex} vs phi",
1199                                phi2D_nbin,
1200                                phi_min,
1201                                phi_max,
1202                                eop2D_nbin,
1203                                0.,
1204                                eopmaxsht);
1205   h2_ele_EseedOPVsE = bookH2(iBooker, "EseedOPVsE", "ele E_{seed}/P_{vertex} vs E", 50, 0., p_max, 50, 0., 5.);
1206   h1_ele_EoPout = bookH1withSumw2(
1207       iBooker, "EoPout", "ele E_{seed}/P_{out}", eop_nbin, 0., eop_max, "E_{seed}/P_{out}", "Events", "ELE_LOGY E1 P");
1208   h1_ele_EoPout_barrel = bookH1withSumw2(iBooker,
1209                                          "EoPout_barrel",
1210                                          "ele E_{seed}/P_{out} barrel",
1211                                          eop_nbin,
1212                                          0.,
1213                                          eop_max,
1214                                          "E_{seed}/P_{out}",
1215                                          "Events",
1216                                          "ELE_LOGY E1 P");
1217   h1_ele_EoPout_endcaps = bookH1withSumw2(iBooker,
1218                                           "EoPout_endcaps",
1219                                           "ele E_{seed}/P_{out} endcaps",
1220                                           eop_nbin,
1221                                           0.,
1222                                           eop_max,
1223                                           "E_{seed}/P_{out}",
1224                                           "Events",
1225                                           "ELE_LOGY E1 P");
1226   h2_ele_EoPoutVsEta = bookH2(
1227       iBooker, "EoPoutVsEta", "ele E_{seed}/P_{out} vs eta", eta2D_nbin, eta_min, eta_max, eop2D_nbin, 0., eopmaxsht);
1228   h2_ele_EoPoutVsPhi = bookH2(
1229       iBooker, "EoPoutVsPhi", "ele E_{seed}/P_{out} vs phi", phi2D_nbin, phi_min, phi_max, eop2D_nbin, 0., eopmaxsht);
1230   h2_ele_EoPoutVsE =
1231       bookH2(iBooker, "EoPoutVsE", "ele E_{seed}/P_{out} vs E", p2D_nbin, 0., p_max, eop2D_nbin, 0., eopmaxsht);
1232   h1_ele_EeleOPout = bookH1withSumw2(
1233       iBooker, "EeleOPout", "ele E_{ele}/P_{out}", eop_nbin, 0., eop_max, "E_{ele}/P_{out}", "Events", "ELE_LOGY E1 P");
1234   h1_ele_EeleOPout_barrel = bookH1withSumw2(iBooker,
1235                                             "EeleOPout_barrel",
1236                                             "ele E_{ele}/P_{out} barrel",
1237                                             eop_nbin,
1238                                             0.,
1239                                             eop_max,
1240                                             "E_{ele}/P_{out}",
1241                                             "Events",
1242                                             "ELE_LOGY E1 P");
1243   h1_ele_EeleOPout_endcaps = bookH1withSumw2(iBooker,
1244                                              "EeleOPout_endcaps",
1245                                              "ele E_{ele}/P_{out} endcaps",
1246                                              eop_nbin,
1247                                              0.,
1248                                              eop_max,
1249                                              "E_{ele}/P_{out}",
1250                                              "Events",
1251                                              "ELE_LOGY E1 P");
1252   h2_ele_EeleOPoutVsEta = bookH2(
1253       iBooker, "EeleOPoutVsEta", "ele E_{ele}/P_{out} vs eta", eta2D_nbin, eta_min, eta_max, eop2D_nbin, 0., eopmaxsht);
1254   h2_ele_EeleOPoutVsPhi = bookH2(
1255       iBooker, "EeleOPoutVsPhi", "ele E_{ele}/P_{out} vs phi", phi2D_nbin, phi_min, phi_max, eop2D_nbin, 0., eopmaxsht);
1256   h2_ele_EeleOPoutVsE =
1257       bookH2(iBooker, "EeleOPoutVsE", "ele E_{ele}/P_{out} vs E", p2D_nbin, 0., p_max, eop2D_nbin, 0., eopmaxsht);
1258   h1_ele_dEtaSc_propVtx = bookH1withSumw2(iBooker,
1259                                           "dEtaSc_propVtx",
1260                                           "ele #eta_{sc} - #eta_{tr}, prop from vertex",
1261                                           detamatch_nbin,
1262                                           detamatch_min,
1263                                           detamatch_max,
1264                                           "#eta_{sc} - #eta_{tr}",
1265                                           "Events",
1266                                           "ELE_LOGY E1 P");
1267   h1_ele_dEtaSc_propVtx_barrel = bookH1withSumw2(iBooker,
1268                                                  "dEtaSc_propVtx_barrel",
1269                                                  "ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",
1270                                                  detamatch_nbin,
1271                                                  detamatch_min,
1272                                                  detamatch_max,
1273                                                  "#eta_{sc} - #eta_{tr}",
1274                                                  "Events",
1275                                                  "ELE_LOGY E1 P");
1276   h1_ele_dEtaSc_propVtx_endcaps = bookH1withSumw2(iBooker,
1277                                                   "dEtaSc_propVtx_endcaps",
1278                                                   "ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",
1279                                                   detamatch_nbin,
1280                                                   detamatch_min,
1281                                                   detamatch_max,
1282                                                   "#eta_{sc} - #eta_{tr}",
1283                                                   "Events",
1284                                                   "ELE_LOGY E1 P");
1285   h2_ele_dEtaScVsEta_propVtx = bookH2(iBooker,
1286                                       "dEtaScVsEta_propVtx",
1287                                       "ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",
1288                                       eta2D_nbin,
1289                                       eta_min,
1290                                       eta_max,
1291                                       detamatch2D_nbin,
1292                                       detamatch_min,
1293                                       detamatch_max);
1294   h2_ele_dEtaScVsPhi_propVtx = bookH2(iBooker,
1295                                       "dEtaScVsPhi_propVtx",
1296                                       "ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",
1297                                       phi2D_nbin,
1298                                       phi_min,
1299                                       phi_max,
1300                                       detamatch2D_nbin,
1301                                       detamatch_min,
1302                                       detamatch_max);
1303   h2_ele_dEtaScVsPt_propVtx = bookH2(iBooker,
1304                                      "dEtaScVsPt_propVtx",
1305                                      "ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",
1306                                      pt2D_nbin,
1307                                      0.,
1308                                      pt_max,
1309                                      detamatch2D_nbin,
1310                                      detamatch_min,
1311                                      detamatch_max);
1312   h1_ele_dPhiSc_propVtx = bookH1withSumw2(iBooker,
1313                                           "dPhiSc_propVtx",
1314                                           "ele #phi_{sc} - #phi_{tr}, prop from vertex",
1315                                           dphimatch_nbin,
1316                                           dphimatch_min,
1317                                           dphimatch_max,
1318                                           "#phi_{sc} - #phi_{tr} (rad)",
1319                                           "Events",
1320                                           "ELE_LOGY E1 P");
1321   h1_ele_dPhiSc_propVtx_barrel = bookH1withSumw2(iBooker,
1322                                                  "dPhiSc_propVtx_barrel",
1323                                                  "ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",
1324                                                  dphimatch_nbin,
1325                                                  dphimatch_min,
1326                                                  dphimatch_max,
1327                                                  "#phi_{sc} - #phi_{tr} (rad)",
1328                                                  "Events",
1329                                                  "ELE_LOGY E1 P");
1330   h1_ele_dPhiSc_propVtx_endcaps = bookH1withSumw2(iBooker,
1331                                                   "dPhiSc_propVtx_endcaps",
1332                                                   "ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",
1333                                                   dphimatch_nbin,
1334                                                   dphimatch_min,
1335                                                   dphimatch_max,
1336                                                   "#phi_{sc} - #phi_{tr} (rad)",
1337                                                   "Events",
1338                                                   "ELE_LOGY E1 P");
1339   h2_ele_dPhiScVsEta_propVtx = bookH2(iBooker,
1340                                       "dPhiScVsEta_propVtx",
1341                                       "ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",
1342                                       eta2D_nbin,
1343                                       eta_min,
1344                                       eta_max,
1345                                       dphimatch2D_nbin,
1346                                       dphimatch_min,
1347                                       dphimatch_max);
1348   h2_ele_dPhiScVsPhi_propVtx = bookH2(iBooker,
1349                                       "dPhiScVsPhi_propVtx",
1350                                       "ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",
1351                                       phi2D_nbin,
1352                                       phi_min,
1353                                       phi_max,
1354                                       dphimatch2D_nbin,
1355                                       dphimatch_min,
1356                                       dphimatch_max);
1357   h2_ele_dPhiScVsPt_propVtx = bookH2(iBooker,
1358                                      "dPhiScVsPt_propVtx",
1359                                      "ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",
1360                                      pt2D_nbin,
1361                                      0.,
1362                                      pt_max,
1363                                      dphimatch2D_nbin,
1364                                      dphimatch_min,
1365                                      dphimatch_max);
1366   h1_ele_dEtaCl_propOut = bookH1withSumw2(iBooker,
1367                                           "dEtaCl_propOut",
1368                                           "ele #eta_{cl} - #eta_{tr}, prop from outermost",
1369                                           detamatch_nbin,
1370                                           detamatch_min,
1371                                           detamatch_max,
1372                                           "#eta_{seedcl} - #eta_{tr}",
1373                                           "Events",
1374                                           "ELE_LOGY E1 P");
1375   h1_ele_dEtaCl_propOut_barrel = bookH1withSumw2(iBooker,
1376                                                  "dEtaCl_propOut_barrel",
1377                                                  "ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",
1378                                                  detamatch_nbin,
1379                                                  detamatch_min,
1380                                                  detamatch_max,
1381                                                  "#eta_{seedcl} - #eta_{tr}",
1382                                                  "Events",
1383                                                  "ELE_LOGY E1 P");
1384   h1_ele_dEtaCl_propOut_endcaps = bookH1withSumw2(iBooker,
1385                                                   "dEtaCl_propOut_endcaps",
1386                                                   "ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",
1387                                                   detamatch_nbin,
1388                                                   detamatch_min,
1389                                                   detamatch_max,
1390                                                   "#eta_{seedcl} - #eta_{tr}",
1391                                                   "Events",
1392                                                   "ELE_LOGY E1 P");
1393   h2_ele_dEtaClVsEta_propOut = bookH2(iBooker,
1394                                       "dEtaClVsEta_propOut",
1395                                       "ele #eta_{cl} - #eta_{tr} vs eta, prop from out",
1396                                       eta2D_nbin,
1397                                       eta_min,
1398                                       eta_max,
1399                                       detamatch2D_nbin,
1400                                       detamatch_min,
1401                                       detamatch_max);
1402   h2_ele_dEtaClVsPhi_propOut = bookH2(iBooker,
1403                                       "dEtaClVsPhi_propOut",
1404                                       "ele #eta_{cl} - #eta_{tr} vs phi, prop from out",
1405                                       phi2D_nbin,
1406                                       phi_min,
1407                                       phi_max,
1408                                       detamatch2D_nbin,
1409                                       detamatch_min,
1410                                       detamatch_max);
1411   h2_ele_dEtaClVsPt_propOut = bookH2(iBooker,
1412                                      "dEtaScVsPt_propOut",
1413                                      "ele #eta_{cl} - #eta_{tr} vs pt, prop from out",
1414                                      pt2D_nbin,
1415                                      0.,
1416                                      pt_max,
1417                                      detamatch2D_nbin,
1418                                      detamatch_min,
1419                                      detamatch_max);
1420   h1_ele_dPhiCl_propOut = bookH1withSumw2(iBooker,
1421                                           "dPhiCl_propOut",
1422                                           "ele #phi_{cl} - #phi_{tr}, prop from outermost",
1423                                           dphimatch_nbin,
1424                                           dphimatch_min,
1425                                           dphimatch_max,
1426                                           "#phi_{seedcl} - #phi_{tr} (rad)",
1427                                           "Events",
1428                                           "ELE_LOGY E1 P");
1429   h1_ele_dPhiCl_propOut_barrel = bookH1withSumw2(iBooker,
1430                                                  "dPhiCl_propOut_barrel",
1431                                                  "ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",
1432                                                  dphimatch_nbin,
1433                                                  dphimatch_min,
1434                                                  dphimatch_max,
1435                                                  "#phi_{seedcl} - #phi_{tr} (rad)",
1436                                                  "Events",
1437                                                  "ELE_LOGY E1 P");
1438   h1_ele_dPhiCl_propOut_endcaps = bookH1withSumw2(iBooker,
1439                                                   "dPhiCl_propOut_endcaps",
1440                                                   "ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",
1441                                                   dphimatch_nbin,
1442                                                   dphimatch_min,
1443                                                   dphimatch_max,
1444                                                   "#phi_{seedcl} - #phi_{tr} (rad)",
1445                                                   "Events",
1446                                                   "ELE_LOGY E1 P");
1447   h2_ele_dPhiClVsEta_propOut = bookH2(iBooker,
1448                                       "dPhiClVsEta_propOut",
1449                                       "ele #phi_{cl} - #phi_{tr} vs eta, prop from out",
1450                                       eta2D_nbin,
1451                                       eta_min,
1452                                       eta_max,
1453                                       dphimatch2D_nbin,
1454                                       dphimatch_min,
1455                                       dphimatch_max);
1456   h2_ele_dPhiClVsPhi_propOut = bookH2(iBooker,
1457                                       "dPhiClVsPhi_propOut",
1458                                       "ele #phi_{cl} - #phi_{tr} vs phi, prop from out",
1459                                       phi2D_nbin,
1460                                       phi_min,
1461                                       phi_max,
1462                                       dphimatch2D_nbin,
1463                                       dphimatch_min,
1464                                       dphimatch_max);
1465   h2_ele_dPhiClVsPt_propOut = bookH2(iBooker,
1466                                      "dPhiSClsPt_propOut",
1467                                      "ele #phi_{cl} - #phi_{tr} vs pt, prop from out",
1468                                      pt2D_nbin,
1469                                      0.,
1470                                      pt_max,
1471                                      dphimatch2D_nbin,
1472                                      dphimatch_min,
1473                                      dphimatch_max);
1474   h1_ele_dEtaEleCl_propOut = bookH1withSumw2(iBooker,
1475                                              "dEtaEleCl_propOut",
1476                                              "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",
1477                                              detamatch_nbin,
1478                                              detamatch_min,
1479                                              detamatch_max,
1480                                              "#eta_{elecl} - #eta_{tr}",
1481                                              "Events",
1482                                              "ELE_LOGY E1 P");
1483   h1_ele_dEtaEleCl_propOut_barrel = bookH1withSumw2(iBooker,
1484                                                     "dEtaEleCl_propOut_barrel",
1485                                                     "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",
1486                                                     detamatch_nbin,
1487                                                     detamatch_min,
1488                                                     detamatch_max,
1489                                                     "#eta_{elecl} - #eta_{tr}",
1490                                                     "Events",
1491                                                     "ELE_LOGY E1 P");
1492   h1_ele_dEtaEleCl_propOut_endcaps = bookH1withSumw2(iBooker,
1493                                                      "dEtaEleCl_propOut_endcaps",
1494                                                      "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",
1495                                                      detamatch_nbin,
1496                                                      detamatch_min,
1497                                                      detamatch_max,
1498                                                      "#eta_{elecl} - #eta_{tr}",
1499                                                      "Events",
1500                                                      "ELE_LOGY E1 P");
1501   h2_ele_dEtaEleClVsEta_propOut = bookH2(iBooker,
1502                                          "dEtaEleClVsEta_propOut",
1503                                          "ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",
1504                                          eta2D_nbin,
1505                                          eta_min,
1506                                          eta_max,
1507                                          detamatch2D_nbin,
1508                                          detamatch_min,
1509                                          detamatch_max);
1510   h2_ele_dEtaEleClVsPhi_propOut = bookH2(iBooker,
1511                                          "dEtaEleClVsPhi_propOut",
1512                                          "ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",
1513                                          phi2D_nbin,
1514                                          phi_min,
1515                                          phi_max,
1516                                          detamatch2D_nbin,
1517                                          detamatch_min,
1518                                          detamatch_max);
1519   h2_ele_dEtaEleClVsPt_propOut = bookH2(iBooker,
1520                                         "dEtaScVsPt_propOut",
1521                                         "ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",
1522                                         pt2D_nbin,
1523                                         0.,
1524                                         pt_max,
1525                                         detamatch2D_nbin,
1526                                         detamatch_min,
1527                                         detamatch_max);
1528   h1_ele_dPhiEleCl_propOut = bookH1withSumw2(iBooker,
1529                                              "dPhiEleCl_propOut",
1530                                              "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",
1531                                              dphimatch_nbin,
1532                                              dphimatch_min,
1533                                              dphimatch_max,
1534                                              "#phi_{elecl} - #phi_{tr} (rad)",
1535                                              "Events",
1536                                              "ELE_LOGY E1 P");
1537   h1_ele_dPhiEleCl_propOut_barrel = bookH1withSumw2(iBooker,
1538                                                     "dPhiEleCl_propOut_barrel",
1539                                                     "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",
1540                                                     dphimatch_nbin,
1541                                                     dphimatch_min,
1542                                                     dphimatch_max,
1543                                                     "#phi_{elecl} - #phi_{tr} (rad)",
1544                                                     "Events",
1545                                                     "ELE_LOGY E1 P");
1546   h1_ele_dPhiEleCl_propOut_endcaps = bookH1withSumw2(iBooker,
1547                                                      "dPhiEleCl_propOut_endcaps",
1548                                                      "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",
1549                                                      dphimatch_nbin,
1550                                                      dphimatch_min,
1551                                                      dphimatch_max,
1552                                                      "#phi_{elecl} - #phi_{tr} (rad)",
1553                                                      "Events",
1554                                                      "ELE_LOGY E1 P");
1555   h2_ele_dPhiEleClVsEta_propOut = bookH2(iBooker,
1556                                          "dPhiEleClVsEta_propOut",
1557                                          "ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",
1558                                          eta2D_nbin,
1559                                          eta_min,
1560                                          eta_max,
1561                                          dphimatch2D_nbin,
1562                                          dphimatch_min,
1563                                          dphimatch_max);
1564   h2_ele_dPhiEleClVsPhi_propOut = bookH2(iBooker,
1565                                          "dPhiEleClVsPhi_propOut",
1566                                          "ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",
1567                                          phi2D_nbin,
1568                                          phi_min,
1569                                          phi_max,
1570                                          dphimatch2D_nbin,
1571                                          dphimatch_min,
1572                                          dphimatch_max);
1573   h2_ele_dPhiEleClVsPt_propOut = bookH2(iBooker,
1574                                         "dPhiSEleClsPt_propOut",
1575                                         "ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",
1576                                         pt2D_nbin,
1577                                         0.,
1578                                         pt_max,
1579                                         dphimatch2D_nbin,
1580                                         dphimatch_min,
1581                                         dphimatch_max);
1582   h1_ele_HoE = bookH1withSumw2(
1583       iBooker, "HoE", "ele hadronic energy / em energy", hoe_nbin, hoe_min, hoe_max, "H/E", "Events", "ELE_LOGY E1 P");
1584   h1_ele_HoE_barrel = bookH1withSumw2(iBooker,
1585                                       "HoE_barrel",
1586                                       "ele hadronic energy / em energy, barrel",
1587                                       hoe_nbin,
1588                                       hoe_min,
1589                                       hoe_max,
1590                                       "H/E",
1591                                       "Events",
1592                                       "ELE_LOGY E1 P");
1593   h1_ele_HoE_endcaps = bookH1withSumw2(iBooker,
1594                                        "HoE_endcaps",
1595                                        "ele hadronic energy / em energy, endcaps",
1596                                        hoe_nbin,
1597                                        hoe_min,
1598                                        hoe_max,
1599                                        "H/E",
1600                                        "Events",
1601                                        "ELE_LOGY E1 P");
1602   h1_ele_HoE_bc = bookH1withSumw2(iBooker,
1603                                   "HoE_bc",
1604                                   "ele hadronic energy / em energy behind cluster",
1605                                   hoe_nbin,
1606                                   hoe_min,
1607                                   hoe_max,
1608                                   "H/E",
1609                                   "Events",
1610                                   "ELE_LOGY E1 P");
1611   h1_ele_HoE_bc_barrel = bookH1withSumw2(iBooker,
1612                                          "HoE_bc_barrel",
1613                                          "ele hadronic energy / em energy, behind cluster barrel",
1614                                          hoe_nbin,
1615                                          hoe_min,
1616                                          hoe_max,
1617                                          "H/E",
1618                                          "Events",
1619                                          "ELE_LOGY E1 P");
1620   h1_ele_HoE_bc_endcaps = bookH1withSumw2(iBooker,
1621                                           "HoE_bc_endcaps",
1622                                           "ele hadronic energy / em energy, behind cluster, endcaps",
1623                                           hoe_nbin,
1624                                           hoe_min,
1625                                           hoe_max,
1626                                           "H/E",
1627                                           "Events",
1628                                           "ELE_LOGY E1 P");
1629   h1_ele_hcalDepth1OverEcalBc = bookH1withSumw2(iBooker,
1630                                                 "hcalDepth1OverEcalBc",
1631                                                 "hcalDepth1OverEcalBc",
1632                                                 hoe_nbin,
1633                                                 hoe_min,
1634                                                 hoe_max,
1635                                                 "H/E",
1636                                                 "Events",
1637                                                 "ELE_LOGY E1 P");
1638   h1_ele_hcalDepth1OverEcalBc_barrel = bookH1withSumw2(iBooker,
1639                                                        "hcalDepth1OverEcalBc_barrel",
1640                                                        "hcalDepth1OverEcalBc_barrel",
1641                                                        hoe_nbin,
1642                                                        hoe_min,
1643                                                        hoe_max,
1644                                                        "H/E",
1645                                                        "Events",
1646                                                        "ELE_LOGY E1 P");
1647   h1_ele_hcalDepth1OverEcalBc_endcaps = bookH1withSumw2(iBooker,
1648                                                         "hcalDepth1OverEcalBc_endcaps",
1649                                                         "hcalDepth1OverEcalBc_endcaps",
1650                                                         hoe_nbin,
1651                                                         hoe_min,
1652                                                         hoe_max,
1653                                                         "H/E",
1654                                                         "Events",
1655                                                         "ELE_LOGY E1 P");
1656   h1_ele_hcalDepth2OverEcalBc = bookH1withSumw2(iBooker,
1657                                                 "hcalDepth2OverEcalBc",
1658                                                 "hcalDepth2OverEcalBc",
1659                                                 hoe_nbin,
1660                                                 hoe_min,
1661                                                 hoe_max,
1662                                                 "H/E",
1663                                                 "Events",
1664                                                 "ELE_LOGY E1 P");
1665   h1_ele_hcalDepth2OverEcalBc_barrel = bookH1withSumw2(iBooker,
1666                                                        "hcalDepth2OverEcalBc_barrel",
1667                                                        "hcalDepth2OverEcalBc_barrel",
1668                                                        hoe_nbin,
1669                                                        hoe_min,
1670                                                        hoe_max,
1671                                                        "H/E",
1672                                                        "Events",
1673                                                        "ELE_LOGY E1 P");
1674   h1_ele_hcalDepth2OverEcalBc_endcaps = bookH1withSumw2(iBooker,
1675                                                         "hcalDepth2OverEcalBc_endcaps",
1676                                                         "hcalDepth2OverEcalBc_endcaps",
1677                                                         hoe_nbin,
1678                                                         hoe_min,
1679                                                         hoe_max,
1680                                                         "H/E",
1681                                                         "Events",
1682                                                         "ELE_LOGY E1 P");
1683   h1_ele_HoE_fiducial = bookH1withSumw2(iBooker,
1684                                         "HoE_fiducial",
1685                                         "ele hadronic energy / em energy, fiducial region",
1686                                         hoe_nbin,
1687                                         hoe_min,
1688                                         hoe_max,
1689                                         "H/E",
1690                                         "Events",
1691                                         "ELE_LOGY E1 P");
1692   h2_ele_HoEVsEta = bookH2(iBooker,
1693                            "HoEVsEta",
1694                            "ele hadronic energy / em energy vs eta",
1695                            eta_nbin,
1696                            eta_min,
1697                            eta_max,
1698                            hoe_nbin,
1699                            hoe_min,
1700                            hoe_max);
1701   h2_ele_HoEVsPhi = bookH2(iBooker,
1702                            "HoEVsPhi",
1703                            "ele hadronic energy / em energy vs phi",
1704                            phi2D_nbin,
1705                            phi_min,
1706                            phi_max,
1707                            hoe_nbin,
1708                            hoe_min,
1709                            hoe_max);
1710   h2_ele_HoEVsE =
1711       bookH2(iBooker, "HoEVsE", "ele hadronic energy / em energy vs E", p_nbin, 0., 300., hoe_nbin, hoe_min, hoe_max);
1712   setBookPrefix("h_scl");
1713   h1_scl_ESFrac_endcaps = bookH1withSumw2(iBooker,
1714                                           "ESFrac_endcaps",
1715                                           "Preshower over SC raw energy , endcaps",
1716                                           100,
1717                                           0.,
1718                                           0.8,
1719                                           "E_{PS} / E^{raw}_{SC}",
1720                                           "Events",
1721                                           "ELE_LOGY E1 P");
1722 
1723   // seeds
1724   setBookPrefix("h_ele");
1725   h1_ele_seed_subdet2_ =
1726       bookH1withSumw2(iBooker, "seedSubdet2", "ele seed subdet 2nd layer", 11, -0.5, 10.5, "2nd hit subdet Id");
1727   h1_ele_seed_mask_ = bookH1withSumw2(iBooker, "seedMask", "ele seed hits mask", 13, -0.5, 12.5);
1728   h1_ele_seed_mask_bpix_ =
1729       bookH1withSumw2(iBooker, "seedMask_Bpix", "ele seed hits mask when subdet2 is bpix", 13, -0.5, 12.5);
1730   h1_ele_seed_mask_fpix_ =
1731       bookH1withSumw2(iBooker, "seedMask_Fpix", "ele seed hits mask when subdet2 is bpix", 13, -0.5, 12.5);
1732   h1_ele_seed_mask_tec_ =
1733       bookH1withSumw2(iBooker, "seedMask_Tec", "ele seed hits mask when subdet2 is bpix", 13, -0.5, 12.5);
1734   h1_ele_seed_dphi2_ = bookH1withSumw2(
1735       iBooker, "seedDphi2", "ele seed dphi 2nd layer", 50, -0.003, +0.003, "#phi_{hit}-#phi_{pred} (rad)");
1736   h2_ele_seed_dphi2VsEta_ = bookH2(
1737       iBooker, "seedDphi2_VsEta", "ele seed dphi 2nd layer vs eta", eta2D_nbin, eta_min, eta_max, 50, -0.003, +0.003);
1738   h2_ele_seed_dphi2VsPt_ =
1739       bookH2(iBooker, "seedDphi2_VsPt", "ele seed dphi 2nd layer vs pt", pt2D_nbin, 0., pt_max, 50, -0.003, +0.003);
1740   h1_ele_seed_dphi2pos_ = bookH1withSumw2(
1741       iBooker, "seedDphi2Pos", "ele seed dphi 2nd layer positron", 50, -0.003, +0.003, "#phi_{hit}-#phi_{pred} (rad)");
1742   h2_ele_seed_dphi2posVsEta_ = bookH2(iBooker,
1743                                       "seedDphi2Pos_VsEta",
1744                                       "ele seed dphi 2nd layer positron vs eta",
1745                                       eta2D_nbin,
1746                                       eta_min,
1747                                       eta_max,
1748                                       50,
1749                                       -0.003,
1750                                       +0.003);
1751   h2_ele_seed_dphi2posVsPt_ = bookH2(
1752       iBooker, "seedDphi2Pos_VsPt", "ele seed dphi 2nd layer positron vs pt", pt2D_nbin, 0., pt_max, 50, -0.003, +0.003);
1753   h1_ele_seed_drz2_ = bookH1withSumw2(
1754       iBooker, "seedDrz2", "ele seed dr (dz) 2nd layer", 50, -0.03, +0.03, "r(z)_{hit}-r(z)_{pred} (cm)");
1755   h2_ele_seed_drz2VsEta_ = bookH2(
1756       iBooker, "seedDrz2_VsEta", "ele seed dr/dz 2nd layer vs eta", eta2D_nbin, eta_min, eta_max, 50, -0.03, +0.03);
1757   h2_ele_seed_drz2VsPt_ =
1758       bookH2(iBooker, "seedDrz2_VsPt", "ele seed dr/dz 2nd layer vs pt", pt2D_nbin, 0., pt_max, 50, -0.03, +0.03);
1759   h1_ele_seed_drz2pos_ = bookH1withSumw2(
1760       iBooker, "seedDrz2Pos", "ele seed dr (dz) 2nd layer positron", 50, -0.03, +0.03, "r(z)_{hit}-r(z)_{pred} (cm)");
1761   h2_ele_seed_drz2posVsEta_ = bookH2(iBooker,
1762                                      "seedDrz2Pos_VsEta",
1763                                      "ele seed dr/dz 2nd layer positron vs eta",
1764                                      eta2D_nbin,
1765                                      eta_min,
1766                                      eta_max,
1767                                      50,
1768                                      -0.03,
1769                                      +0.03);
1770   h2_ele_seed_drz2posVsPt_ = bookH2(
1771       iBooker, "seedDrz2Pos_VsPt", "ele seed dr/dz 2nd layer positron vs pt", pt2D_nbin, 0., pt_max, 50, -0.03, +0.03);
1772 
1773   // classes
1774   h1_ele_classes = bookH1withSumw2(iBooker, "classes", "ele classes", 20, 0.0, 20., "class Id");
1775   h1_ele_eta = bookH1withSumw2(iBooker, "eta", "ele electron eta", eta_nbin / 2, 0.0, eta_max);
1776   h1_ele_eta_golden = bookH1withSumw2(iBooker, "eta_golden", "ele electron eta golden", eta_nbin / 2, 0.0, eta_max);
1777   h1_ele_eta_bbrem = bookH1withSumw2(iBooker, "eta_bbrem", "ele electron eta bbrem", eta_nbin / 2, 0.0, eta_max);
1778   h1_ele_eta_shower = bookH1withSumw2(iBooker, "eta_shower", "ele electron eta showering", eta_nbin / 2, 0.0, eta_max);
1779   h2_ele_PinVsPoutGolden_mode = bookH2(iBooker,
1780                                        "PinVsPoutGolden_mode",
1781                                        "ele track inner p vs outer p vs eta, golden, mode of GSF components",
1782                                        p2D_nbin,
1783                                        0.,
1784                                        p_max,
1785                                        50,
1786                                        0.,
1787                                        p_max);
1788   h2_ele_PinVsPoutShowering_mode = bookH2(iBooker,
1789                                           "PinVsPoutShowering_mode",
1790                                           "ele track inner p vs outer p vs eta, showering, mode of GSF components",
1791                                           p2D_nbin,
1792                                           0.,
1793                                           p_max,
1794                                           50,
1795                                           0.,
1796                                           p_max);
1797   h2_ele_PinVsPoutGolden_mean = bookH2(iBooker,
1798                                        "PinVsPoutGolden_mean",
1799                                        "ele track inner p vs outer p vs eta, golden, mean of GSF components",
1800                                        p2D_nbin,
1801                                        0.,
1802                                        p_max,
1803                                        50,
1804                                        0.,
1805                                        p_max);
1806   h2_ele_PinVsPoutShowering_mean = bookH2(iBooker,
1807                                           "PinVsPoutShowering_mean",
1808                                           "ele track inner p vs outer p vs eta, showering, mean of GSF components",
1809                                           p2D_nbin,
1810                                           0.,
1811                                           p_max,
1812                                           50,
1813                                           0.,
1814                                           p_max);
1815   h2_ele_PtinVsPtoutGolden_mode = bookH2(iBooker,
1816                                          "PtinVsPtoutGolden_mode",
1817                                          "ele track inner pt vs outer pt vs eta, golden, mode of GSF components",
1818                                          pt2D_nbin,
1819                                          0.,
1820                                          pt_max,
1821                                          50,
1822                                          0.,
1823                                          pt_max);
1824   h2_ele_PtinVsPtoutShowering_mode = bookH2(iBooker,
1825                                             "PtinVsPtoutShowering_mode",
1826                                             "ele track inner pt vs outer pt vs eta, showering, mode of GSF components",
1827                                             pt2D_nbin,
1828                                             0.,
1829                                             pt_max,
1830                                             50,
1831                                             0.,
1832                                             pt_max);
1833   h2_ele_PtinVsPtoutGolden_mean = bookH2(iBooker,
1834                                          "PtinVsPtoutGolden_mean",
1835                                          "ele track inner pt vs outer pt vs eta, golden, mean of GSF components",
1836                                          pt2D_nbin,
1837                                          0.,
1838                                          pt_max,
1839                                          50,
1840                                          0.,
1841                                          pt_max);
1842   h2_ele_PtinVsPtoutShowering_mean = bookH2(iBooker,
1843                                             "PtinVsPtoutShowering_mean",
1844                                             "ele track inner pt vs outer pt vs eta, showering, mean of GSF components",
1845                                             pt2D_nbin,
1846                                             0.,
1847                                             pt_max,
1848                                             50,
1849                                             0.,
1850                                             pt_max);
1851   setBookPrefix("h_scl");
1852   h1_scl_EoEmatchingObjectGolden_barrel = bookH1withSumw2(iBooker,
1853                                                           "EoEmatchingObject_golden_barrel",
1854                                                           "ele supercluster energy / gen energy, golden, barrel",
1855                                                           popmatching_nbin,
1856                                                           popmatching_min,
1857                                                           popmatching_max);
1858   h1_scl_EoEmatchingObjectGolden_endcaps = bookH1withSumw2(iBooker,
1859                                                            "EoEmatchingObject_golden_endcaps",
1860                                                            "ele supercluster energy / gen energy, golden, endcaps",
1861                                                            popmatching_nbin,
1862                                                            popmatching_min,
1863                                                            popmatching_max);
1864   h1_scl_EoEmatchingObjectShowering_barrel = bookH1withSumw2(iBooker,
1865                                                              "EoEmatchingObject_showering_barrel",
1866                                                              "ele supercluster energy / gen energy, showering, barrel",
1867                                                              popmatching_nbin,
1868                                                              popmatching_min,
1869                                                              popmatching_max);
1870   h1_scl_EoEmatchingObjectShowering_endcaps =
1871       bookH1withSumw2(iBooker,
1872                       "EoEmatchingObject_showering_endcaps",
1873                       "ele supercluster energy / gen energy, showering, endcaps",
1874                       popmatching_nbin,
1875                       popmatching_min,
1876                       popmatching_max);
1877   setBookPrefix("h_ele");
1878 
1879   // isolation
1880   h1_ele_tkSumPt_dr03 = bookH1withSumw2(iBooker,
1881                                         "tkSumPt_dr03",
1882                                         "tk isolation sum, dR=0.3",
1883                                         100,
1884                                         0.0,
1885                                         20.,
1886                                         "TkIsoSum, cone 0.3 (GeV/c)",
1887                                         "Events",
1888                                         "ELE_LOGY E1 P");
1889   h1_ele_tkSumPt_dr03_barrel = bookH1withSumw2(iBooker,
1890                                                "tkSumPt_dr03_barrel",
1891                                                "tk isolation sum, dR=0.3, barrel",
1892                                                100,
1893                                                0.0,
1894                                                20.,
1895                                                "TkIsoSum, cone 0.3 (GeV/c)",
1896                                                "Events",
1897                                                "ELE_LOGY E1 P");
1898   h1_ele_tkSumPt_dr03_endcaps = bookH1withSumw2(iBooker,
1899                                                 "tkSumPt_dr03_endcaps",
1900                                                 "tk isolation sum, dR=0.3, endcaps",
1901                                                 100,
1902                                                 0.0,
1903                                                 20.,
1904                                                 "TkIsoSum, cone 0.3 (GeV/c)",
1905                                                 "Events",
1906                                                 "ELE_LOGY E1 P");
1907   h1_ele_ecalRecHitSumEt_dr03 = bookH1withSumw2(iBooker,
1908                                                 "ecalRecHitSumEt_dr03",
1909                                                 "ecal isolation sum, dR=0.3",
1910                                                 100,
1911                                                 0.0,
1912                                                 20.,
1913                                                 "EcalIsoSum, cone 0.3 (GeV)",
1914                                                 "Events",
1915                                                 "ELE_LOGY E1 P");
1916   h1_ele_ecalRecHitSumEt_dr03_barrel = bookH1withSumw2(iBooker,
1917                                                        "ecalRecHitSumEt_dr03_barrel",
1918                                                        "ecal isolation sum, dR=0.3, barrel",
1919                                                        100,
1920                                                        0.0,
1921                                                        20.,
1922                                                        "EcalIsoSum, cone 0.3 (GeV)",
1923                                                        "Events",
1924                                                        "ELE_LOGY E1 P");
1925   h1_ele_ecalRecHitSumEt_dr03_endcaps = bookH1withSumw2(iBooker,
1926                                                         "ecalRecHitSumEt_dr03_endcaps",
1927                                                         "ecal isolation sum, dR=0.3, endcaps",
1928                                                         100,
1929                                                         0.0,
1930                                                         20.,
1931                                                         "EcalIsoSum, cone 0.3 (GeV)",
1932                                                         "Events",
1933                                                         "ELE_LOGY E1 P");
1934   h1_ele_hcalTowerSumEt_dr03_depth1 = bookH1withSumw2(iBooker,
1935                                                       "hcalTowerSumEt_dr03_depth1",
1936                                                       "hcal depth1 isolation sum, dR=0.3",
1937                                                       100,
1938                                                       0.0,
1939                                                       20.,
1940                                                       "Hcal1IsoSum, cone 0.3 (GeV)",
1941                                                       "Events",
1942                                                       "ELE_LOGY E1 P");
1943   h1_ele_hcalTowerSumEt_dr03_depth1_barrel = bookH1withSumw2(iBooker,
1944                                                              "hcalTowerSumEt_dr03_depth1_barrel",
1945                                                              "hcal depth1 isolation sum, dR=0.3, barrel",
1946                                                              100,
1947                                                              0.0,
1948                                                              20.,
1949                                                              "Hcal1IsoSum, cone 0.3 (GeV)",
1950                                                              "Events",
1951                                                              "ELE_LOGY E1 P");
1952   h1_ele_hcalTowerSumEt_dr03_depth1_endcaps = bookH1withSumw2(iBooker,
1953                                                               "hcalTowerSumEt_dr03_depth1_endcaps",
1954                                                               "hcal depth1 isolation sum, dR=0.3, endcaps",
1955                                                               100,
1956                                                               0.0,
1957                                                               20.,
1958                                                               "Hcal1IsoSum, cone 0.3 (GeV)",
1959                                                               "Events",
1960                                                               "ELE_LOGY E1 P");
1961   h1_ele_hcalTowerSumEt_dr03_depth2 = bookH1withSumw2(iBooker,
1962                                                       "hcalTowerSumEt_dr03_depth2",
1963                                                       "hcal depth2 isolation sum, dR=0.3",
1964                                                       100,
1965                                                       0.0,
1966                                                       20.,
1967                                                       "Hcal2IsoSum, cone 0.3 (GeV)",
1968                                                       "Events",
1969                                                       "ELE_LOGY E1 P");
1970   h1_ele_tkSumPt_dr04 = bookH1withSumw2(iBooker,
1971                                         "tkSumPt_dr04",
1972                                         "tk isolation sum, dR=0.4",
1973                                         100,
1974                                         0.0,
1975                                         20.,
1976                                         "TkIsoSum, cone 0.4 (GeV/c)",
1977                                         "Events",
1978                                         "ELE_LOGY E1 P");
1979   h1_ele_tkSumPt_dr04_barrel = bookH1withSumw2(iBooker,
1980                                                "tkSumPt_dr04_barrel",
1981                                                "tk isolation sum, dR=0.4, barrel",
1982                                                100,
1983                                                0.0,
1984                                                20.,
1985                                                "TkIsoSum, cone 0.4 (GeV/c)",
1986                                                "Events",
1987                                                "ELE_LOGY E1 P");
1988   h1_ele_tkSumPt_dr04_endcaps = bookH1withSumw2(iBooker,
1989                                                 "tkSumPt_dr04_endcaps",
1990                                                 "tk isolation sum, dR=0.4, endcaps",
1991                                                 100,
1992                                                 0.0,
1993                                                 20.,
1994                                                 "TkIsoSum, cone 0.4 (GeV/c)",
1995                                                 "Events",
1996                                                 "ELE_LOGY E1 P");
1997   h1_ele_ecalRecHitSumEt_dr04 = bookH1withSumw2(iBooker,
1998                                                 "ecalRecHitSumEt_dr04",
1999                                                 "ecal isolation sum, dR=0.4",
2000                                                 100,
2001                                                 0.0,
2002                                                 20.,
2003                                                 "EcalIsoSum, cone 0.4 (GeV)",
2004                                                 "Events",
2005                                                 "ELE_LOGY E1 P");
2006   h1_ele_ecalRecHitSumEt_dr04_barrel = bookH1withSumw2(iBooker,
2007                                                        "ecalRecHitSumEt_dr04_barrel",
2008                                                        "ecal isolation sum, dR=0.4, barrel",
2009                                                        100,
2010                                                        0.0,
2011                                                        20.,
2012                                                        "EcalIsoSum, cone 0.4 (GeV)",
2013                                                        "Events",
2014                                                        "ELE_LOGY E1 P");
2015   h1_ele_ecalRecHitSumEt_dr04_endcaps = bookH1withSumw2(iBooker,
2016                                                         "ecalRecHitSumEt_dr04_endcaps",
2017                                                         "ecal isolation sum, dR=0.4, endcaps",
2018                                                         100,
2019                                                         0.0,
2020                                                         20.,
2021                                                         "EcalIsoSum, cone 0.4 (GeV)",
2022                                                         "Events",
2023                                                         "ELE_LOGY E1 P");
2024   h1_ele_hcalTowerSumEt_dr04_depth1 = bookH1withSumw2(iBooker,
2025                                                       "hcalTowerSumEt_dr04_depth1",
2026                                                       "hcal depth1 isolation sum, dR=0.4",
2027                                                       100,
2028                                                       0.0,
2029                                                       20.,
2030                                                       "Hcal1IsoSum, cone 0.4 (GeV)",
2031                                                       "Events",
2032                                                       "ELE_LOGY E1 P");
2033   h1_ele_hcalTowerSumEt_dr04_depth1_barrel = bookH1withSumw2(iBooker,
2034                                                              "hcalTowerSumEt_dr04_depth1_barrel",
2035                                                              "hcal depth1 isolation sum, dR=0.4, barrel",
2036                                                              100,
2037                                                              0.0,
2038                                                              20.,
2039                                                              "Hcal1IsoSum, cone 0.4 (GeV)",
2040                                                              "Events",
2041                                                              "ELE_LOGY E1 P");
2042   h1_ele_hcalTowerSumEt_dr04_depth1_endcaps = bookH1withSumw2(iBooker,
2043                                                               "hcalTowerSumEt_dr04_depth1_endcaps",
2044                                                               "hcal depth1 isolation sum, dR=0.4, endcaps",
2045                                                               100,
2046                                                               0.0,
2047                                                               20.,
2048                                                               "Hcal1IsoSum, cone 0.4 (GeV)",
2049                                                               "Events",
2050                                                               "ELE_LOGY E1 P");
2051   h1_ele_hcalTowerSumEt_dr04_depth2 = bookH1withSumw2(iBooker,
2052                                                       "hcalTowerSumEt_dr04_depth2",
2053                                                       "hcal depth2 isolation sum, dR=0.4",
2054                                                       100,
2055                                                       0.0,
2056                                                       20.,
2057                                                       "Hcal2IsoSum, cone 0.4 (GeV)",
2058                                                       "Events",
2059                                                       "ELE_LOGY E1 P");
2060 
2061   // newHCAL
2062   // isolation new hcal
2063   h1_ele_hcalTowerSumEtBc_dr03_depth1 = bookH1withSumw2(iBooker,
2064                                                         "hcalTowerSumEtBc_dr03_depth1",
2065                                                         "hcal depth1 isolation sum behind cluster, dR=0.3",
2066                                                         100,
2067                                                         0.0,
2068                                                         20.,
2069                                                         "Hcal1IsoSum, cone 0.3 (GeV)",
2070                                                         "Events",
2071                                                         "ELE_LOGY E1 P");
2072   h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel =
2073       bookH1withSumw2(iBooker,
2074                       "hcalTowerSumEtBc_dr03_depth1_barrel",
2075                       "hcal depth1 isolation sum behind cluster, dR=0.3, barrel",
2076                       100,
2077                       0.0,
2078                       20.,
2079                       "Hcal1IsoSum, cone 0.3 (GeV)",
2080                       "Events",
2081                       "ELE_LOGY E1 P");
2082   h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps =
2083       bookH1withSumw2(iBooker,
2084                       "hcalTowerSumEtBc_dr03_depth1_endcaps",
2085                       "hcal depth1 isolation sum behind cluster, dR=0.3, endcaps",
2086                       100,
2087                       0.0,
2088                       20.,
2089                       "Hcal1IsoSum, cone 0.3 (GeV)",
2090                       "Events",
2091                       "ELE_LOGY E1 P");
2092 
2093   h1_ele_hcalTowerSumEtBc_dr04_depth1 = bookH1withSumw2(iBooker,
2094                                                         "hcalTowerSumEtBc_dr04_depth1",
2095                                                         "hcal depth1 isolation sum behind cluster, dR=0.4",
2096                                                         100,
2097                                                         0.0,
2098                                                         20.,
2099                                                         "Hcal1IsoSum, cone 0.4 (GeV)",
2100                                                         "Events",
2101                                                         "ELE_LOGY E1 P");
2102   h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel =
2103       bookH1withSumw2(iBooker,
2104                       "hcalTowerSumEtBc_dr04_depth1_barrel",
2105                       "hcal depth1 isolation sum behind cluster, dR=0.4, barrel",
2106                       100,
2107                       0.0,
2108                       20.,
2109                       "Hcal1IsoSum, cone 0.4 (GeV)",
2110                       "Events",
2111                       "ELE_LOGY E1 P");
2112   h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps =
2113       bookH1withSumw2(iBooker,
2114                       "hcalTowerSumEtBc_dr04_depth1_endcaps",
2115                       "hcal depth1 isolation sum behind cluster, dR=0.4, endcaps",
2116                       100,
2117                       0.0,
2118                       20.,
2119                       "Hcal1IsoSum, cone 0.4 (GeV)",
2120                       "Events",
2121                       "ELE_LOGY E1 P");
2122 
2123   h1_ele_hcalTowerSumEtBc_dr03_depth2 = bookH1withSumw2(iBooker,
2124                                                         "hcalTowerSumEtBc_dr03_depth2",
2125                                                         "hcal depth2 isolation sum behind cluster, dR=0.3",
2126                                                         100,
2127                                                         0.0,
2128                                                         20.,
2129                                                         "Hcal1IsoSum, cone 0.3 (GeV)",
2130                                                         "Events",
2131                                                         "ELE_LOGY E1 P");
2132   h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel =
2133       bookH1withSumw2(iBooker,
2134                       "hcalTowerSumEtBc_dr03_depth2_barrel",
2135                       "hcal depth2 isolation sum behind cluster, dR=0.3, barrel",
2136                       100,
2137                       0.0,
2138                       20.,
2139                       "Hcal1IsoSum, cone 0.3 (GeV)",
2140                       "Events",
2141                       "ELE_LOGY E1 P");
2142   h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps =
2143       bookH1withSumw2(iBooker,
2144                       "hcalTowerSumEtBc_dr03_depth2_endcaps",
2145                       "hcal depth2 isolation sum behind cluster, dR=0.3, endcaps",
2146                       100,
2147                       0.0,
2148                       20.,
2149                       "Hcal1IsoSum, cone 0.3 (GeV)",
2150                       "Events",
2151                       "ELE_LOGY E1 P");
2152 
2153   h1_ele_hcalTowerSumEtBc_dr04_depth2 = bookH1withSumw2(iBooker,
2154                                                         "hcalTowerSumEtBc_dr04_depth2",
2155                                                         "hcal depth2 isolation sum behind cluster, dR=0.4",
2156                                                         100,
2157                                                         0.0,
2158                                                         20.,
2159                                                         "Hcal1IsoSum, cone 0.4 (GeV)",
2160                                                         "Events",
2161                                                         "ELE_LOGY E1 P");
2162   h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel =
2163       bookH1withSumw2(iBooker,
2164                       "hcalTowerSumEtBc_dr04_depth2_barrel",
2165                       "hcal depth2 isolation sum behind cluster, dR=0.4, barrel",
2166                       100,
2167                       0.0,
2168                       20.,
2169                       "Hcal1IsoSum, cone 0.4 (GeV)",
2170                       "Events",
2171                       "ELE_LOGY E1 P");
2172   h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps =
2173       bookH1withSumw2(iBooker,
2174                       "hcalTowerSumEtBc_dr04_depth2_endcaps",
2175                       "hcal depth2 isolation sum behind cluster, dR=0.4, endcaps",
2176                       100,
2177                       0.0,
2178                       20.,
2179                       "Hcal1IsoSum, cone 0.4 (GeV)",
2180                       "Events",
2181                       "ELE_LOGY E1 P");
2182 
2183   // fbrem
2184   h1_ele_fbrem = bookH1withSumw2(
2185       iBooker, "fbrem", "ele brem fraction, mode of GSF components", 100, 0., 1., "P_{in} - P_{out} / P_{in}");
2186   h1_ele_fbrem_barrel = bookH1withSumw2(iBooker,
2187                                         "fbrem_barrel",
2188                                         "ele brem fraction for barrel, mode of GSF components",
2189                                         100,
2190                                         0.,
2191                                         1.,
2192                                         "P_{in} - P_{out} / P_{in}");
2193   h1_ele_fbrem_endcaps = bookH1withSumw2(iBooker,
2194                                          "fbrem_endcaps",
2195                                          "ele brem franction for endcaps, mode of GSF components",
2196                                          100,
2197                                          0.,
2198                                          1.,
2199                                          "P_{in} - P_{out} / P_{in}");
2200   p1_ele_fbremVsEta_mode = bookP1(iBooker,
2201                                   "fbremvsEtamode",
2202                                   "mean ele brem fraction vs eta, mode of GSF components",
2203                                   eta2D_nbin,
2204                                   eta_min,
2205                                   eta_max,
2206                                   0.,
2207                                   1.,
2208                                   "#eta",
2209                                   "<P_{in} - P_{out} / P_{in}>");
2210   p1_ele_fbremVsEta_mean = bookP1(iBooker,
2211                                   "fbremvsEtamean",
2212                                   "mean ele brem fraction vs eta, mean of GSF components",
2213                                   eta2D_nbin,
2214                                   eta_min,
2215                                   eta_max,
2216                                   0.,
2217                                   1.,
2218                                   "#eta",
2219                                   "<P_{in} - P_{out} / P_{in}>");
2220   h1_ele_superclusterfbrem =
2221       bookH1withSumw2(iBooker, "superclusterfbrem", "supercluster brem fraction", 100, 0., 1., "1 - E_{ele} / E_{SC}");
2222   h1_ele_superclusterfbrem_barrel = bookH1withSumw2(
2223       iBooker, "superclusterfbrem_barrel", "supercluster brem fraction for barrel", 100, 0., 1., "1 - E_{ele} / E_{SC}");
2224   h1_ele_superclusterfbrem_endcaps = bookH1withSumw2(iBooker,
2225                                                      "superclusterfbrem_endcaps",
2226                                                      "supercluster brem franction for endcaps",
2227                                                      100,
2228                                                      0.,
2229                                                      1.,
2230                                                      "1 - E_{ele} / E_{SC}");
2231   // e/g et pflow electrons
2232   h1_ele_mva = bookH1withSumw2(iBooker, "mva", "ele identification mva", 100, -1., 1.);
2233   h1_ele_mva_barrel = bookH1withSumw2(iBooker, "mva_barrel", "ele identification mva barrel", 100, -1., 1.);
2234   h1_ele_mva_endcaps = bookH1withSumw2(iBooker, "mva_endcaps", "ele identification mva endcaps", 100, -1., 1.);
2235   h1_ele_mva_isolated = bookH1withSumw2(iBooker, "mva_isolated", "ele identification mva isolated", 100, -1., 1.);
2236   h1_ele_mva_barrel_isolated =
2237       bookH1withSumw2(iBooker, "mva_isolated_barrel", "ele identification mva isolated barrel", 100, -1., 1.);
2238   h1_ele_mva_endcaps_isolated =
2239       bookH1withSumw2(iBooker, "mva_isolated_endcaps", "ele identification mva isolated endcaps", 100, -1., 1.);
2240   h1_ele_provenance = bookH1withSumw2(iBooker, "provenance", "ele provenance", 5, -2., 3.);
2241   h1_ele_provenance_barrel = bookH1withSumw2(iBooker, "provenance_barrel", "ele provenance barrel", 5, -2., 3.);
2242   h1_ele_provenance_endcaps = bookH1withSumw2(iBooker, "provenance_endcaps", "ele provenance endcaps", 5, -2., 3.);
2243 
2244   // pflow isolation variables
2245   h1_ele_chargedHadronIso = bookH1withSumw2(
2246       iBooker, "chargedHadronIso", "chargedHadronIso", 100, 0.0, 20., "chargedHadronIso", "Events", "ELE_LOGY E1 P");
2247   h1_ele_chargedHadronIso_barrel = bookH1withSumw2(iBooker,
2248                                                    "chargedHadronIso_barrel",
2249                                                    "chargedHadronIso for barrel",
2250                                                    100,
2251                                                    0.0,
2252                                                    20.,
2253                                                    "chargedHadronIso_barrel",
2254                                                    "Events",
2255                                                    "ELE_LOGY E1 P");
2256   h1_ele_chargedHadronIso_endcaps = bookH1withSumw2(iBooker,
2257                                                     "chargedHadronIso_endcaps",
2258                                                     "chargedHadronIso for endcaps",
2259                                                     100,
2260                                                     0.0,
2261                                                     20.,
2262                                                     "chargedHadronIso_endcaps",
2263                                                     "Events",
2264                                                     "ELE_LOGY E1 P");
2265   h1_ele_neutralHadronIso = bookH1withSumw2(
2266       iBooker, "neutralHadronIso", "neutralHadronIso", 21, 0.0, 20., "neutralHadronIso", "Events", "ELE_LOGY E1 P");
2267   h1_ele_neutralHadronIso_barrel = bookH1withSumw2(iBooker,
2268                                                    "neutralHadronIso_barrel",
2269                                                    "neutralHadronIso for barrel",
2270                                                    21,
2271                                                    0.0,
2272                                                    20.,
2273                                                    "neutralHadronIso_barrel",
2274                                                    "Events",
2275                                                    "ELE_LOGY E1 P");
2276   h1_ele_neutralHadronIso_endcaps = bookH1withSumw2(iBooker,
2277                                                     "neutralHadronIso_endcaps",
2278                                                     "neutralHadronIso for endcaps",
2279                                                     21,
2280                                                     0.0,
2281                                                     20.,
2282                                                     "neutralHadronIso_endcaps",
2283                                                     "Events",
2284                                                     "ELE_LOGY E1 P");
2285   h1_ele_photonIso =
2286       bookH1withSumw2(iBooker, "photonIso", "photonIso", 100, 0.0, 20., "photonIso", "Events", "ELE_LOGY E1 P");
2287   h1_ele_photonIso_barrel = bookH1withSumw2(
2288       iBooker, "photonIso_barrel", "photonIso for barrel", 100, 0.0, 20., "photonIso_barrel", "Events", "ELE_LOGY E1 P");
2289   h1_ele_photonIso_endcaps = bookH1withSumw2(iBooker,
2290                                              "photonIso_endcaps",
2291                                              "photonIso for endcaps",
2292                                              100,
2293                                              0.0,
2294                                              20.,
2295                                              "photonIso_endcaps",
2296                                              "Events",
2297                                              "ELE_LOGY E1 P");
2298   // -- pflow over pT
2299   h1_ele_chargedHadronRelativeIso = bookH1withSumw2(iBooker,
2300                                                     "chargedHadronRelativeIso",
2301                                                     "chargedHadronRelativeIso",
2302                                                     100,
2303                                                     0.0,
2304                                                     2.,
2305                                                     "chargedHadronRelativeIso",
2306                                                     "Events",
2307                                                     "ELE_LOGY E1 P");
2308   h1_ele_chargedHadronRelativeIso_barrel = bookH1withSumw2(iBooker,
2309                                                            "chargedHadronRelativeIso_barrel",
2310                                                            "chargedHadronRelativeIso for barrel",
2311                                                            100,
2312                                                            0.0,
2313                                                            2.,
2314                                                            "chargedHadronRelativeIso_barrel",
2315                                                            "Events",
2316                                                            "ELE_LOGY E1 P");
2317   h1_ele_chargedHadronRelativeIso_endcaps = bookH1withSumw2(iBooker,
2318                                                             "chargedHadronRelativeIso_endcaps",
2319                                                             "chargedHadronRelativeIso for endcaps",
2320                                                             100,
2321                                                             0.0,
2322                                                             2.,
2323                                                             "chargedHadronRelativeIso_endcaps",
2324                                                             "Events",
2325                                                             "ELE_LOGY E1 P");
2326   h1_ele_neutralHadronRelativeIso = bookH1withSumw2(iBooker,
2327                                                     "neutralHadronRelativeIso",
2328                                                     "neutralHadronRelativeIso",
2329                                                     100,
2330                                                     0.0,
2331                                                     2.,
2332                                                     "neutralHadronRelativeIso",
2333                                                     "Events",
2334                                                     "ELE_LOGY E1 P");
2335   h1_ele_neutralHadronRelativeIso_barrel = bookH1withSumw2(iBooker,
2336                                                            "neutralHadronRelativeIso_barrel",
2337                                                            "neutralHadronRelativeIso for barrel",
2338                                                            100,
2339                                                            0.0,
2340                                                            2.,
2341                                                            "neutralHadronRelativeIso_barrel",
2342                                                            "Events",
2343                                                            "ELE_LOGY E1 P");
2344   h1_ele_neutralHadronRelativeIso_endcaps = bookH1withSumw2(iBooker,
2345                                                             "neutralHadronRelativeIso_endcaps",
2346                                                             "neutralHadronRelativeIso for endcaps",
2347                                                             100,
2348                                                             0.0,
2349                                                             2.,
2350                                                             "neutralHadronRelativeIso_endcaps",
2351                                                             "Events",
2352                                                             "ELE_LOGY E1 P");
2353   h1_ele_photonRelativeIso = bookH1withSumw2(
2354       iBooker, "photonRelativeIso", "photonRelativeIso", 100, 0.0, 2., "photonRelativeIso", "Events", "ELE_LOGY E1 P");
2355   h1_ele_photonRelativeIso_barrel = bookH1withSumw2(iBooker,
2356                                                     "photonRelativeIso_barrel",
2357                                                     "photonRelativeIso for barrel",
2358                                                     100,
2359                                                     0.0,
2360                                                     2.,
2361                                                     "photonRelativeIso_barrel",
2362                                                     "Events",
2363                                                     "ELE_LOGY E1 P");
2364   h1_ele_photonRelativeIso_endcaps = bookH1withSumw2(iBooker,
2365                                                      "photonRelativeIso_endcaps",
2366                                                      "photonRelativeIso for endcaps",
2367                                                      100,
2368                                                      0.0,
2369                                                      2.,
2370                                                      "photonRelativeIso_endcaps",
2371                                                      "Events",
2372                                                      "ELE_LOGY E1 P");
2373 
2374   // conversion rejection information
2375   h1_ele_convFlags = bookH1withSumw2(iBooker, "convFlags", "conversion rejection flag", 5, -2.5, 2.5);
2376   h1_ele_convFlags_all =
2377       bookH1withSumw2(iBooker, "convFlags_all", "conversion rejection flag, all electrons", 5, -2.5, 2.5);
2378   h1_ele_convDist = bookH1withSumw2(iBooker, "convDist", "distance to the conversion partner", 100, -15., 15.);
2379   h1_ele_convDist_all =
2380       bookH1withSumw2(iBooker, "convDist_all", "distance to the conversion partner, all electrons", 100, -15., 15.);
2381   h1_ele_convDcot = bookH1withSumw2(
2382       iBooker, "convDcot", "difference of cot(angle) with the conversion partner", 100, -CLHEP::pi / 2., CLHEP::pi / 2.);
2383   h1_ele_convDcot_all = bookH1withSumw2(iBooker,
2384                                         "convDcot_all",
2385                                         "difference of cot(angle) with the conversion partner, all electrons",
2386                                         100,
2387                                         -CLHEP::pi / 2.,
2388                                         CLHEP::pi / 2.);
2389   h1_ele_convRadius = bookH1withSumw2(iBooker, "convRadius", "signed conversion radius", 100, 0., 130.);
2390   h1_ele_convRadius_all =
2391       bookH1withSumw2(iBooker, "convRadius_all", "signed conversion radius, all electrons", 100, 0., 130.);
2392 }
2393 
2394 ElectronMcFakeValidator::~ElectronMcFakeValidator() {}
2395 
2396 //=========================================================================
2397 // Main methods
2398 //=========================================================================
2399 
2400 void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
2401   // get reco electrons
2402   auto gsfElectrons = iEvent.getHandle(electronCollection_);
2403   auto gsfElectronsEndcaps = iEvent.getHandle(electronCollectionEndcaps_);
2404   auto gsfElectronCores = iEvent.getHandle(electronCoreCollection_);
2405   auto gsfElectronTracks = iEvent.getHandle(electronTrackCollection_);
2406   auto gsfElectronSeeds = iEvent.getHandle(electronSeedCollection_);
2407 
2408   // get gen jets
2409   auto genJets = iEvent.getHandle(matchingObjectCollection_);
2410 
2411   // get the beamspot from the Event:
2412   auto recoBeamSpotHandle = iEvent.getHandle(beamSpotTag_);
2413   const BeamSpot bs = *recoBeamSpotHandle;
2414 
2415   auto isoFromDepsTk03Handle = iEvent.getHandle(isoFromDepsTk03Tag_);
2416   auto isoFromDepsTk04Handle = iEvent.getHandle(isoFromDepsTk04Tag_);
2417   auto isoFromDepsEcalFull03Handle = iEvent.getHandle(isoFromDepsEcalFull03Tag_);
2418   auto isoFromDepsEcalFull04Handle = iEvent.getHandle(isoFromDepsEcalFull04Tag_);
2419   auto isoFromDepsEcalReduced03Handle = iEvent.getHandle(isoFromDepsEcalReduced03Tag_);
2420   auto isoFromDepsEcalReduced04Handle = iEvent.getHandle(isoFromDepsEcalReduced04Tag_);
2421   auto isoFromDepsHcal03Handle = iEvent.getHandle(isoFromDepsHcal03Tag_);
2422   auto isoFromDepsHcal04Handle = iEvent.getHandle(isoFromDepsHcal04Tag_);
2423 
2424   auto vertexCollectionHandle = iEvent.getHandle(offlineVerticesCollection_);
2425   if (!vertexCollectionHandle.isValid()) {
2426     edm::LogInfo("ElectronMcFakeValidator::analyze") << "vertexCollectionHandle KO";
2427   } else {
2428     edm::LogInfo("ElectronMcFakeValidator::analyze") << "vertexCollectionHandle OK";
2429   }
2430 
2431   edm::LogInfo("ElectronMcFakeValidator::analyze")
2432       << "Treating event " << iEvent.id() << " with " << gsfElectrons.product()->size() << " electrons";
2433   edm::LogInfo("ElectronMcSignalValidator::analyze")
2434       << "Treating event " << iEvent.id() << " with " << gsfElectronsEndcaps.product()->size() << " electrons";
2435 
2436   h1_recEleNum_->Fill((*gsfElectrons).size());
2437   h1_recCoreNum_->Fill((*gsfElectronCores).size());
2438   h1_recTrackNum_->Fill((*gsfElectronTracks).size());
2439   h1_recSeedNum_->Fill((*gsfElectronSeeds).size());
2440   h1_recOfflineVertices_->Fill((*vertexCollectionHandle).size());
2441 
2442   reco::GsfElectronCollection::const_iterator gsfIter;
2443   std::vector<reco::GsfElectron>::const_iterator gsfIter3;
2444   std::vector<reco::GsfElectron>::const_iterator gsfIter4;
2445 
2446   //===============================================
2447   // get a vector with EB  & EE
2448   //===============================================
2449   std::vector<reco::GsfElectron> localCollection;
2450   int iBarrels = 0;
2451   int iEndcaps = 0;
2452 
2453   // looking for EB
2454   for (gsfIter = gsfElectrons->begin(); gsfIter != gsfElectrons->end(); gsfIter++) {
2455     if (gsfIter->isEB()) {
2456       localCollection.push_back(*gsfIter);
2457       iBarrels += 1;
2458     }
2459   }
2460 
2461   // looking for EE
2462   for (gsfIter = gsfElectronsEndcaps->begin(); gsfIter != gsfElectronsEndcaps->end(); gsfIter++) {
2463     if (gsfIter->isEE()) {
2464       localCollection.push_back(*gsfIter);
2465       iEndcaps += 1;
2466     }
2467   }
2468 
2469   // all rec electrons
2470   for (gsfIter3 = localCollection.begin(); gsfIter3 != localCollection.end(); gsfIter3++) {
2471     // preselect electrons
2472     if (gsfIter3->pt() > maxPt_ || std::abs(gsfIter3->eta()) > maxAbsEta_)
2473       continue;
2474 
2475     h1_ele_EoverP_all->Fill(gsfIter3->eSuperClusterOverP());
2476     h1_ele_EseedOP_all->Fill(gsfIter3->eSeedClusterOverP());
2477     h1_ele_EoPout_all->Fill(gsfIter3->eSeedClusterOverPout());
2478     h1_ele_EeleOPout_all->Fill(gsfIter3->eEleClusterOverPout());
2479     h1_ele_dEtaSc_propVtx_all->Fill(gsfIter3->deltaEtaSuperClusterTrackAtVtx());
2480     h1_ele_dPhiSc_propVtx_all->Fill(gsfIter3->deltaPhiSuperClusterTrackAtVtx());
2481     h1_ele_dEtaCl_propOut_all->Fill(gsfIter3->deltaEtaSeedClusterTrackAtCalo());
2482     h1_ele_dPhiCl_propOut_all->Fill(gsfIter3->deltaPhiSeedClusterTrackAtCalo());
2483     h1_ele_HoE_all->Fill(gsfIter3->hadronicOverEm());
2484     h1_ele_HoE_bc_all->Fill(gsfIter3->hcalOverEcalBc());
2485     double d = gsfIter3->vertex().x() * gsfIter3->vertex().x() + gsfIter3->vertex().y() * gsfIter3->vertex().y();
2486     h1_ele_TIP_all->Fill(sqrt(d));
2487     h1_ele_vertexEta_all->Fill(gsfIter3->eta());
2488     h1_ele_vertexPt_all->Fill(gsfIter3->pt());
2489     float enrj1 = gsfIter3->ecalEnergy();
2490 
2491     // mee
2492     for (gsfIter4 = gsfIter3 + 1; gsfIter4 != localCollection.end(); gsfIter4++) {
2493       math::XYZTLorentzVector p12 = (*gsfIter3).p4() + (*gsfIter4).p4();
2494       float mee2 = p12.Dot(p12);
2495       h1_ele_mee_all->Fill(sqrt(mee2));
2496       float enrj2 = gsfIter4->ecalEnergy();
2497       h2_ele_E2mnE1vsMee_all->Fill(sqrt(mee2), enrj2 - enrj1);
2498       if (gsfIter3->ecalDrivenSeed() && gsfIter4->ecalDrivenSeed()) {
2499         h2_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2), enrj2 - enrj1);
2500       }
2501       if (gsfIter3->charge() * gsfIter4->charge() < 0.) {
2502         h1_ele_mee_os->Fill(sqrt(mee2));
2503       }
2504     }
2505 
2506     // conversion rejection
2507     int flags = gsfIter3->convFlags();
2508     if (flags == -9999) {
2509       flags = -1;
2510     }
2511     h1_ele_convFlags_all->Fill(flags);
2512     if (flags >= 0.) {
2513       h1_ele_convDist_all->Fill(gsfIter3->convDist());
2514       h1_ele_convDcot_all->Fill(gsfIter3->convDcot());
2515       h1_ele_convRadius_all->Fill(gsfIter3->convRadius());
2516     }
2517   }
2518 
2519   // association matching object-reco electrons
2520   int matchingObjectNum = 0;
2521   reco::GenJetCollection::const_iterator moIter;
2522   for (moIter = genJets->begin(); moIter != genJets->end(); ++moIter) {
2523     // number of matching objects
2524     matchingObjectNum++;
2525 
2526     if (moIter->energy() / cosh(moIter->eta()) > maxPt_ || std::abs(moIter->eta()) > maxAbsEta_) {
2527       continue;
2528     }
2529 
2530     h1_matchingObjectEta->Fill(moIter->eta());
2531     h1_matchingObjectAbsEta->Fill(std::abs(moIter->eta()));
2532     h1_matchingObjectP->Fill(moIter->energy());
2533     h1_matchingObjectPt->Fill(moIter->energy() / cosh(moIter->eta()));
2534     h1_matchingObjectPhi->Fill(moIter->phi());
2535     h1_matchingObjectZ->Fill(moIter->vz());
2536 
2537     // looking for the best matching gsf electron
2538     bool okGsfFound = false;
2539     double gsfOkRatio = 999999.;
2540     bool isEBflag = false;
2541     bool isEEflag = false;
2542 
2543     // find best matched electron
2544     reco::GsfElectron bestGsfElectron;
2545 
2546     for (gsfIter3 = localCollection.begin(); gsfIter3 != localCollection.end(); gsfIter3++) {
2547       double dphi = gsfIter3->phi() - moIter->phi();
2548       if (std::abs(dphi) > CLHEP::pi) {
2549         dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
2550       }
2551       double deltaR2 = (gsfIter3->eta() - moIter->eta()) * (gsfIter3->eta() - moIter->eta()) + dphi * dphi;
2552       if (deltaR2 < deltaR2_) {
2553         double tmpGsfRatio = gsfIter3->p() / moIter->energy();
2554         if (std::abs(tmpGsfRatio - 1) < std::abs(gsfOkRatio - 1)) {
2555           gsfOkRatio = tmpGsfRatio;
2556           bestGsfElectron = *gsfIter3;
2557           okGsfFound = true;
2558         }
2559       }
2560     }  // loop over rec ele to look for the best one
2561 
2562     // analysis when the matching object is matched by a rec electron
2563     if (okGsfFound) {
2564       isEBflag = bestGsfElectron.isEB();
2565       isEEflag = bestGsfElectron.isEE();
2566       // electron related distributions
2567       h1_ele_charge->Fill(bestGsfElectron.charge());
2568       h2_ele_chargeVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.charge());
2569       h2_ele_chargeVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.charge());
2570       h2_ele_chargeVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.charge());
2571       h1_ele_vertexP->Fill(bestGsfElectron.p());
2572       h1_ele_vertexPt->Fill(bestGsfElectron.pt());
2573       h2_ele_vertexPtVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.pt());
2574       h2_ele_vertexPtVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.pt());
2575       h1_ele_vertexEta->Fill(bestGsfElectron.eta());
2576       // generated distributions for matched electrons
2577       h1_ele_matchingObjectPt_matched->Fill(moIter->energy() / cosh(moIter->eta()));
2578       h1_ele_matchingObjectPhi_matched->Fill(moIter->phi());
2579       h1_ele_matchingObjectAbsEta_matched->Fill(std::abs(moIter->eta()));
2580       h1_ele_matchingObjectEta_matched->Fill(moIter->eta());
2581       h2_ele_vertexEtaVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta());
2582       h1_ele_vertexPhi->Fill(bestGsfElectron.phi());
2583       h1_ele_vertexX->Fill(bestGsfElectron.vertex().x());
2584       h1_ele_vertexY->Fill(bestGsfElectron.vertex().y());
2585       h1_ele_vertexZ->Fill(bestGsfElectron.vertex().z());
2586       h1_ele_matchingObjectZ_matched->Fill(moIter->vz());
2587       double d =
2588           (bestGsfElectron.vertex().x() - bs.position().x()) * (bestGsfElectron.vertex().x() - bs.position().x()) +
2589           (bestGsfElectron.vertex().y() - bs.position().y()) * (bestGsfElectron.vertex().y() - bs.position().y());
2590       d = sqrt(d);
2591       h1_ele_vertexTIP->Fill(d);
2592       h2_ele_vertexTIPVsEta->Fill(bestGsfElectron.eta(), d);
2593       h2_ele_vertexTIPVsPhi->Fill(bestGsfElectron.phi(), d);
2594       h2_ele_vertexTIPVsPt->Fill(bestGsfElectron.pt(), d);
2595       h1_ele_EtaMnEtamatchingObject->Fill(bestGsfElectron.eta() - moIter->eta());
2596       h2_ele_EtaMnEtamatchingObjectVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eta() - moIter->eta());
2597       h2_ele_EtaMnEtamatchingObjectVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta() - moIter->eta());
2598       h2_ele_EtaMnEtamatchingObjectVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.eta() - moIter->eta());
2599       h1_ele_PhiMnPhimatchingObject->Fill(bestGsfElectron.phi() - moIter->phi());
2600       h1_ele_PhiMnPhimatchingObject2->Fill(bestGsfElectron.phi() - moIter->phi());
2601       h2_ele_PhiMnPhimatchingObjectVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.phi() - moIter->phi());
2602       h2_ele_PhiMnPhimatchingObjectVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.phi() - moIter->phi());
2603       h2_ele_PhiMnPhimatchingObjectVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.phi() - moIter->phi());
2604       h1_ele_PoPmatchingObject->Fill(bestGsfElectron.p() / moIter->energy());
2605       h2_ele_PoPmatchingObjectVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.p() / moIter->energy());
2606       h2_ele_PoPmatchingObjectVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.p() / moIter->energy());
2607       h2_ele_PoPmatchingObjectVsPt->Fill(bestGsfElectron.py(), bestGsfElectron.p() / moIter->energy());
2608       if (isEBflag)
2609         h1_ele_PoPmatchingObject_barrel->Fill(bestGsfElectron.p() / moIter->energy());
2610       else if (isEEflag)
2611         h1_ele_PoPmatchingObject_endcaps->Fill(bestGsfElectron.p() / moIter->energy());
2612 
2613       // supercluster related distributions
2614       reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
2615       if (!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.trackerDrivenSeed())
2616         sclRef = bestGsfElectron.parentSuperCluster();
2617       if (sclRef.isNonnull()) {
2618         h1_scl_En_->Fill(sclRef->energy());
2619         double R = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
2620         double Rt = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
2621         h1_scl_Et_->Fill(sclRef->energy() * (Rt / R));
2622         h2_scl_EtVsEta_->Fill(sclRef->eta(), sclRef->energy() * (Rt / R));
2623         h2_scl_EtVsPhi_->Fill(sclRef->phi(), sclRef->energy() * (Rt / R));
2624         if (isEBflag)
2625           h1_scl_EoEmatchingObject_barrel->Fill(sclRef->energy() / moIter->energy());
2626         else if (isEEflag) {
2627           h1_scl_EoEmatchingObject_endcaps->Fill(sclRef->energy() / moIter->energy());
2628           h1_scl_ESFrac_endcaps->Fill(sclRef->preshowerEnergy() / sclRef->rawEnergy());
2629         }
2630         h1_scl_Eta_->Fill(sclRef->eta());
2631         h2_scl_EtaVsPhi_->Fill(sclRef->phi(), sclRef->eta());
2632         h1_scl_Phi_->Fill(sclRef->phi());
2633       }
2634       h1_scl_SigIEtaIEta_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2635       h1_scl_full5x5_sigmaIetaIeta_->Fill(bestGsfElectron.full5x5_sigmaIetaIeta());
2636       h1_scl_E1x5_->Fill(bestGsfElectron.scE1x5());
2637       h1_scl_E2x5max_->Fill(bestGsfElectron.scE2x5Max());
2638       h1_scl_E5x5_->Fill(bestGsfElectron.scE5x5());
2639       if (isEBflag) {
2640         h1_scl_SigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2641         h1_scl_full5x5_sigmaIetaIeta_barrel_->Fill(bestGsfElectron.full5x5_sigmaIetaIeta());
2642         h1_scl_E1x5_barrel_->Fill(bestGsfElectron.scE1x5());
2643         h1_scl_E2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max());
2644         h1_scl_E5x5_barrel_->Fill(bestGsfElectron.scE5x5());
2645       } else if (isEEflag) {
2646         h1_scl_SigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2647         h1_scl_full5x5_sigmaIetaIeta_endcaps_->Fill(bestGsfElectron.full5x5_sigmaIetaIeta());
2648         h1_scl_E1x5_endcaps_->Fill(bestGsfElectron.scE1x5());
2649         h1_scl_E2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max());
2650         h1_scl_E5x5_endcaps_->Fill(bestGsfElectron.scE5x5());
2651       }
2652 
2653       // track related distributions
2654       h1_ele_ambiguousTracks->Fill(bestGsfElectron.ambiguousGsfTracksSize());
2655       h2_ele_ambiguousTracksVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize());
2656       h2_ele_ambiguousTracksVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize());
2657       h2_ele_ambiguousTracksVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize());
2658       if (!readAOD_) {  // track extra does not exist in AOD
2659         h1_ele_foundHits->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits());
2660         h2_ele_foundHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits());
2661         h2_ele_foundHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits());
2662         h2_ele_foundHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits());
2663         h1_ele_lostHits->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits());
2664         h2_ele_lostHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits());
2665         h2_ele_lostHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits());
2666         h2_ele_lostHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits());
2667         h1_ele_chi2->Fill(bestGsfElectron.gsfTrack()->normalizedChi2());
2668         h2_ele_chi2VsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2());
2669         h2_ele_chi2VsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2());
2670         h2_ele_chi2VsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2());
2671       }
2672       // from gsf track interface, hence using mean
2673       if (!readAOD_) {  // track extra does not exist in AOD
2674         h1_ele_PinMnPout->Fill(bestGsfElectron.gsfTrack()->innerMomentum().R() -
2675                                bestGsfElectron.gsfTrack()->outerMomentum().R());
2676         h1_ele_outerP->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R());
2677         h1_ele_outerPt->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho());
2678       }
2679       // from electron interface, hence using mode
2680       h1_ele_PinMnPout_mode->Fill(bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2681       h2_ele_PinMnPoutVsEta_mode->Fill(
2682           bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2683       h2_ele_PinMnPoutVsPhi_mode->Fill(
2684           bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2685       h2_ele_PinMnPoutVsPt_mode->Fill(
2686           bestGsfElectron.pt(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2687       h2_ele_PinMnPoutVsE_mode->Fill(bestGsfElectron.caloEnergy(),
2688                                      bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2689       if (!readAOD_)  // track extra does not exist in AOD
2690         h2_ele_PinMnPoutVsChi2_mode->Fill(
2691             bestGsfElectron.gsfTrack()->normalizedChi2(),
2692             bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2693       h1_ele_outerP_mode->Fill(bestGsfElectron.trackMomentumOut().R());
2694       h2_ele_outerPVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().R());
2695       h1_ele_outerPt_mode->Fill(bestGsfElectron.trackMomentumOut().Rho());
2696       h2_ele_outerPtVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().Rho());
2697       h2_ele_outerPtVsPhi_mode->Fill(bestGsfElectron.phi(), bestGsfElectron.trackMomentumOut().Rho());
2698       h2_ele_outerPtVsPt_mode->Fill(bestGsfElectron.pt(), bestGsfElectron.trackMomentumOut().Rho());
2699 
2700       if (!readAOD_) {  // track extra does not exist in AOD
2701         edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
2702         ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>();
2703         h1_ele_seed_subdet2_->Fill(elseed->subDet(1));
2704         h1_ele_seed_mask_->Fill(elseed->hitsMask());
2705         if (elseed->subDet(1) == 1) {
2706           h1_ele_seed_mask_bpix_->Fill(elseed->hitsMask());
2707         } else if (elseed->subDet(1) == 2) {
2708           h1_ele_seed_mask_fpix_->Fill(elseed->hitsMask());
2709         } else if (elseed->subDet(1) == 6) {
2710           h1_ele_seed_mask_tec_->Fill(elseed->hitsMask());
2711         }
2712 
2713         if (elseed->dPhiNeg(1) != std::numeric_limits<float>::infinity()) {
2714           h1_ele_seed_dphi2_->Fill(elseed->dPhiNeg(1));
2715           h2_ele_seed_dphi2VsEta_->Fill(bestGsfElectron.eta(), elseed->dPhiNeg(1));
2716           h2_ele_seed_dphi2VsPt_->Fill(bestGsfElectron.pt(), elseed->dPhiNeg(1));
2717         }
2718         if (elseed->dPhiPos(1) != std::numeric_limits<float>::infinity()) {
2719           h1_ele_seed_dphi2pos_->Fill(elseed->dPhiPos(1));
2720           h2_ele_seed_dphi2posVsEta_->Fill(bestGsfElectron.eta(), elseed->dPhiPos(1));
2721           h2_ele_seed_dphi2posVsPt_->Fill(bestGsfElectron.pt(), elseed->dPhiPos(1));
2722         }
2723         if (elseed->dRZNeg(1) != std::numeric_limits<float>::infinity()) {
2724           h1_ele_seed_drz2_->Fill(elseed->dRZNeg(1));
2725           h2_ele_seed_drz2VsEta_->Fill(bestGsfElectron.eta(), elseed->dRZNeg(1));
2726           h2_ele_seed_drz2VsPt_->Fill(bestGsfElectron.pt(), elseed->dRZNeg(1));
2727         }
2728         if (elseed->dRZPos(1) != std::numeric_limits<float>::infinity()) {
2729           h1_ele_seed_drz2pos_->Fill(elseed->dRZPos(1));
2730           h2_ele_seed_drz2posVsEta_->Fill(bestGsfElectron.eta(), elseed->dRZPos(1));
2731           h2_ele_seed_drz2posVsPt_->Fill(bestGsfElectron.pt(), elseed->dRZPos(1));
2732         }
2733       }
2734       // match distributions
2735       h1_ele_EoP->Fill(bestGsfElectron.eSuperClusterOverP());
2736       h2_ele_EoPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSuperClusterOverP());
2737       h2_ele_EoPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSuperClusterOverP());
2738       h2_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSuperClusterOverP());
2739       h1_ele_EseedOP->Fill(bestGsfElectron.eSeedClusterOverP());
2740       h2_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverP());
2741       h2_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverP());
2742       h2_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverP());
2743       h1_ele_EoPout->Fill(bestGsfElectron.eSeedClusterOverPout());
2744       h2_ele_EoPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout());
2745       h2_ele_EoPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout());
2746       h2_ele_EoPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout());
2747       h1_ele_EeleOPout->Fill(bestGsfElectron.eEleClusterOverPout());
2748       h2_ele_EeleOPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout());
2749       h2_ele_EeleOPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout());
2750       h2_ele_EeleOPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout());
2751       h1_ele_dEtaSc_propVtx->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2752       h2_ele_dEtaScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2753       h2_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2754       h2_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2755       h1_ele_dPhiSc_propVtx->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2756       h2_ele_dPhiScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2757       h2_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2758       h2_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2759       h1_ele_dEtaCl_propOut->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2760       h2_ele_dEtaClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2761       h2_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2762       h2_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2763       h1_ele_dPhiCl_propOut->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2764       h2_ele_dPhiClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2765       h2_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2766       h2_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2767       h1_ele_dEtaEleCl_propOut->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2768       h2_ele_dEtaEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2769       h2_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2770       h2_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2771       h1_ele_dPhiEleCl_propOut->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2772       h2_ele_dPhiEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2773       h2_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2774       h2_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2775       h1_ele_HoE->Fill(bestGsfElectron.hadronicOverEm());
2776       h1_ele_HoE_bc->Fill(bestGsfElectron.hcalOverEcalBc());
2777       if (isEBflag) {
2778         h1_ele_EoP_barrel->Fill(bestGsfElectron.eSuperClusterOverP());
2779         h1_ele_EseedOP_barrel->Fill(bestGsfElectron.eSeedClusterOverP());
2780         h1_ele_EoPout_barrel->Fill(bestGsfElectron.eSeedClusterOverPout());
2781         h1_ele_EeleOPout_barrel->Fill(bestGsfElectron.eEleClusterOverPout());
2782         h1_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2783         h1_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2784         h1_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2785         h1_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2786         h1_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2787         h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2788         h1_ele_HoE_bc_barrel->Fill(bestGsfElectron.hcalOverEcalBc());
2789         h1_ele_HoE_barrel->Fill(bestGsfElectron.hadronicOverEm());
2790       } else if (isEEflag) {
2791         h1_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP());
2792         h1_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP());
2793         h1_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout());
2794         h1_ele_EeleOPout_endcaps->Fill(bestGsfElectron.eEleClusterOverPout());
2795         h1_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2796         h1_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2797         h1_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2798         h1_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2799         h1_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2800         h1_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2801         h1_ele_HoE_bc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc());
2802         h1_ele_HoE_endcaps->Fill(bestGsfElectron.hadronicOverEm());
2803       }
2804 
2805       if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap() && !bestGsfElectron.isEBEEGap() &&
2806           !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap())
2807         h1_ele_HoE_fiducial->Fill(bestGsfElectron.hadronicOverEm());
2808       h2_ele_HoEVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.hadronicOverEm());
2809       h2_ele_HoEVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.hadronicOverEm());
2810       h2_ele_HoEVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.hadronicOverEm());
2811 
2812       //classes
2813       int eleClass = bestGsfElectron.classification();
2814       if (isEEflag)
2815         eleClass += 10;
2816       h1_ele_classes->Fill(eleClass);
2817 
2818       h1_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
2819       if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2820         h1_ele_eta_golden->Fill(std::abs(bestGsfElectron.eta()));
2821       if (bestGsfElectron.classification() == GsfElectron::BIGBREM)
2822         h1_ele_eta_bbrem->Fill(std::abs(bestGsfElectron.eta()));
2823       if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2824         h1_ele_eta_shower->Fill(std::abs(bestGsfElectron.eta()));
2825 
2826       // fbrem
2827 
2828       double fbrem_mode = bestGsfElectron.fbrem();
2829       h1_ele_fbrem->Fill(fbrem_mode);
2830       p1_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(), fbrem_mode);
2831       double superclusterfbrem_mode = bestGsfElectron.superClusterFbrem();
2832       h1_ele_superclusterfbrem->Fill(superclusterfbrem_mode);
2833       if (isEBflag) {
2834         double fbrem_mode_barrel = bestGsfElectron.fbrem();
2835         h1_ele_fbrem_barrel->Fill(fbrem_mode_barrel);
2836         double superclusterfbrem_mode_barrel = bestGsfElectron.superClusterFbrem();
2837         h1_ele_superclusterfbrem_barrel->Fill(superclusterfbrem_mode_barrel);
2838       } else if (isEEflag) {
2839         double fbrem_mode_endcaps = bestGsfElectron.fbrem();
2840         h1_ele_fbrem_endcaps->Fill(fbrem_mode_endcaps);
2841         double superclusterfbrem_mode_endcaps = bestGsfElectron.superClusterFbrem();
2842         h1_ele_superclusterfbrem_endcaps->Fill(superclusterfbrem_mode_endcaps);
2843       }
2844 
2845       if (!readAOD_)  // track extra does not exist in AOD
2846       {
2847         double fbrem_mean =
2848             1. - bestGsfElectron.gsfTrack()->outerMomentum().R() / bestGsfElectron.gsfTrack()->innerMomentum().R();
2849         p1_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(), fbrem_mean);
2850 
2851         if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2852           h2_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(),
2853                                             bestGsfElectron.gsfTrack()->innerMomentum().R());
2854         if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2855           h2_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(),
2856                                                bestGsfElectron.gsfTrack()->innerMomentum().R());
2857         if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2858           h2_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(),
2859                                               bestGsfElectron.gsfTrack()->innerMomentum().Rho());
2860         if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2861           h2_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(),
2862                                                  bestGsfElectron.gsfTrack()->innerMomentum().Rho());
2863       }
2864       if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2865         h2_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(),
2866                                             bestGsfElectron.trackMomentumAtVtx().Rho());
2867       if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2868         h2_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(),
2869                                                bestGsfElectron.trackMomentumAtVtx().Rho());
2870 
2871       if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2872         h2_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(),
2873                                           bestGsfElectron.trackMomentumAtVtx().R());
2874       if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2875         h2_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(),
2876                                              bestGsfElectron.trackMomentumAtVtx().R());
2877 
2878       h1_ele_mva->Fill(bestGsfElectron.mva_e_pi());
2879       h1_ele_mva_isolated->Fill(bestGsfElectron.mva_Isolated());
2880       if (isEBflag) {
2881         h1_ele_mva_barrel->Fill(bestGsfElectron.mva_e_pi());
2882         h1_ele_mva_barrel_isolated->Fill(bestGsfElectron.mva_Isolated());
2883       } else if (isEEflag) {
2884         h1_ele_mva_endcaps->Fill(bestGsfElectron.mva_e_pi());
2885         h1_ele_mva_endcaps_isolated->Fill(bestGsfElectron.mva_Isolated());
2886       }
2887 
2888       if (bestGsfElectron.ecalDrivenSeed())
2889         h1_ele_provenance->Fill(1.);
2890       if (bestGsfElectron.trackerDrivenSeed())
2891         h1_ele_provenance->Fill(-1.);
2892       if (bestGsfElectron.trackerDrivenSeed() || bestGsfElectron.ecalDrivenSeed())
2893         h1_ele_provenance->Fill(0.);
2894       if (bestGsfElectron.trackerDrivenSeed() && !bestGsfElectron.ecalDrivenSeed())
2895         h1_ele_provenance->Fill(-2.);
2896       if (!bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.ecalDrivenSeed())
2897         h1_ele_provenance->Fill(2.);
2898       if (bestGsfElectron.ecalDrivenSeed() && isEBflag)
2899         h1_ele_provenance_barrel->Fill(1.);
2900       if (bestGsfElectron.trackerDrivenSeed() && isEBflag)
2901         h1_ele_provenance_barrel->Fill(-1.);
2902       if ((bestGsfElectron.trackerDrivenSeed() || bestGsfElectron.ecalDrivenSeed()) && isEBflag)
2903         h1_ele_provenance_barrel->Fill(0.);
2904       if (bestGsfElectron.trackerDrivenSeed() && !bestGsfElectron.ecalDrivenSeed() && isEBflag)
2905         h1_ele_provenance_barrel->Fill(-2.);
2906       if (!bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.ecalDrivenSeed() && isEBflag)
2907         h1_ele_provenance_barrel->Fill(2.);
2908       if (bestGsfElectron.ecalDrivenSeed() && isEEflag)
2909         h1_ele_provenance_endcaps->Fill(1.);
2910       if (bestGsfElectron.trackerDrivenSeed() && isEEflag)
2911         h1_ele_provenance_endcaps->Fill(-1.);
2912       if ((bestGsfElectron.trackerDrivenSeed() || bestGsfElectron.ecalDrivenSeed()) && isEEflag)
2913         h1_ele_provenance_endcaps->Fill(0.);
2914       if (bestGsfElectron.trackerDrivenSeed() && !bestGsfElectron.ecalDrivenSeed() && isEEflag)
2915         h1_ele_provenance_endcaps->Fill(-2.);
2916       if (!bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.ecalDrivenSeed() && isEEflag)
2917         h1_ele_provenance_endcaps->Fill(2.);
2918 
2919       // Pflow isolation
2920       h1_ele_chargedHadronIso->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt);
2921       h1_ele_neutralHadronIso->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt);
2922       h1_ele_photonIso->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt);
2923       if (isEBflag) {
2924         h1_ele_chargedHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt);
2925         h1_ele_neutralHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt);
2926         h1_ele_photonIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt);
2927       } else if (isEEflag) {
2928         h1_ele_chargedHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt);
2929         h1_ele_neutralHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt);
2930         h1_ele_photonIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt);
2931       }
2932 
2933       // -- pflow over pT
2934       h1_ele_chargedHadronRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt /
2935                                             bestGsfElectron.pt());
2936       h1_ele_neutralHadronRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt /
2937                                             bestGsfElectron.pt());
2938       h1_ele_photonRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt());
2939       if (isEBflag) {
2940         h1_ele_chargedHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt /
2941                                                      bestGsfElectron.pt());
2942         h1_ele_neutralHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt /
2943                                                      bestGsfElectron.pt());
2944         h1_ele_photonRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt /
2945                                               bestGsfElectron.pt());
2946       } else if (isEEflag) {
2947         h1_ele_chargedHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt /
2948                                                       bestGsfElectron.pt());
2949         h1_ele_neutralHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt /
2950                                                       bestGsfElectron.pt());
2951         h1_ele_photonRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt /
2952                                                bestGsfElectron.pt());
2953       }
2954 
2955       // isolation
2956       h1_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
2957       h1_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
2958       h1_ele_hcalTowerSumEt_dr03_depth1->Fill(bestGsfElectron.dr03HcalTowerSumEt(1));
2959       h1_ele_hcalTowerSumEt_dr03_depth2->Fill(bestGsfElectron.dr03HcalTowerSumEt(2));
2960       h1_ele_hcalTowerSumEtBc_dr03_depth1->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1));
2961       h1_ele_hcalTowerSumEtBc_dr03_depth2->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2));
2962       h1_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
2963       h1_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
2964       h1_ele_hcalTowerSumEt_dr04_depth1->Fill(bestGsfElectron.dr04HcalTowerSumEt(1));
2965       h1_ele_hcalTowerSumEt_dr04_depth2->Fill(bestGsfElectron.dr04HcalTowerSumEt(2));
2966       h1_ele_hcalTowerSumEtBc_dr04_depth1->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1));
2967       h1_ele_hcalTowerSumEtBc_dr04_depth2->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2));
2968       h1_ele_hcalDepth1OverEcalBc->Fill(bestGsfElectron.hcalOverEcalBc(1));
2969       h1_ele_hcalDepth2OverEcalBc->Fill(bestGsfElectron.hcalOverEcalBc(2));
2970       if (isEBflag) {
2971         h1_ele_tkSumPt_dr03_barrel->Fill(bestGsfElectron.dr03TkSumPt());
2972         h1_ele_ecalRecHitSumEt_dr03_barrel->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
2973         h1_ele_hcalTowerSumEt_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEt(1));
2974         h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1));
2975         h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2));
2976         h1_ele_tkSumPt_dr04_barrel->Fill(bestGsfElectron.dr04TkSumPt());
2977         h1_ele_ecalRecHitSumEt_dr04_barrel->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
2978         h1_ele_hcalTowerSumEt_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEt(1));
2979         h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1));
2980         h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2));
2981         h1_ele_hcalDepth1OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(1));
2982         h1_ele_hcalDepth2OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(2));
2983       } else if (isEEflag) {
2984         h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt());
2985         h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
2986         h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEt(1));
2987         h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1));
2988         h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2));
2989         h1_ele_tkSumPt_dr04_endcaps->Fill(bestGsfElectron.dr04TkSumPt());
2990         h1_ele_ecalRecHitSumEt_dr04_endcaps->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
2991         h1_ele_hcalTowerSumEt_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEt(1));
2992         h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1));
2993         h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2));
2994         h1_ele_hcalDepth1OverEcalBc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc(1));
2995         h1_ele_hcalDepth2OverEcalBc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc(2));
2996       }
2997 
2998       // conversion rejection
2999       int flags = bestGsfElectron.convFlags();
3000       if (flags == -9999) {
3001         flags = -1;
3002       }
3003       h1_ele_convFlags->Fill(flags);
3004       if (flags >= 0.) {
3005         h1_ele_convDist->Fill(bestGsfElectron.convDist());
3006         h1_ele_convDcot->Fill(bestGsfElectron.convDcot());
3007         h1_ele_convRadius->Fill(bestGsfElectron.convRadius());
3008       }
3009 
3010     }  // gsf electron found
3011 
3012   }  // loop overmatching object
3013 
3014   h1_matchingObjectNum->Fill(matchingObjectNum);
3015 }