Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:59

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