Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-01-13 23:40:11

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