From a1446cb22b19ef34da49bbcb5ff15d2d29807f36 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Tue, 7 Dec 2021 16:17:34 +0100 Subject: [PATCH 1/8] Tests_Reduction_V1 : plugins part --- .../plugins/ElectronMcFakeValidator.cc | 299 ++++++------- .../ElectronMcMiniAODSignalValidator.cc | 2 +- .../plugins/ElectronMcSignalPostValidator.cc | 2 +- .../plugins/ElectronMcSignalValidator.cc | 394 +++++++----------- 4 files changed, 274 insertions(+), 423 deletions(-) diff --git a/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc index 2b286619100f9..fb0f2871cc5b5 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc @@ -606,10 +606,10 @@ void ElectronMcFakeValidator::bookHistograms(DQMStore::IBooker &iBooker, edm::Ru eta_min, eta_max, "", - "Events", - "ELE_LOGY E1 P"); + "Events");//, + //"ELE_LOGY E1 P"); h1_ele_vertexPt_all = bookH1withSumw2( - iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events", "ELE_LOGY E1 P"); + iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events");//, "ELE_LOGY E1 P"); h1_ele_mee_all = bookH1withSumw2(iBooker, "mee_all", "ele pairs invariant mass, all reco electrons", @@ -2615,7 +2615,7 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event h2_ele_PoPmatchingObjectVsPt->Fill(bestGsfElectron.py(), bestGsfElectron.p() / moIter->energy()); if (isEBflag) h1_ele_PoPmatchingObject_barrel->Fill(bestGsfElectron.p() / moIter->energy()); - if (isEEflag) + else if (isEEflag) h1_ele_PoPmatchingObject_endcaps->Fill(bestGsfElectron.p() / moIter->energy()); // supercluster related distributions @@ -2631,39 +2631,33 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event h2_scl_EtVsPhi_->Fill(sclRef->phi(), sclRef->energy() * (Rt / R)); if (isEBflag) h1_scl_EoEmatchingObject_barrel->Fill(sclRef->energy() / moIter->energy()); - if (isEEflag) + else if (isEEflag) { h1_scl_EoEmatchingObject_endcaps->Fill(sclRef->energy() / moIter->energy()); + h1_scl_ESFrac_endcaps->Fill(sclRef->preshowerEnergy() / sclRef->rawEnergy()); + } h1_scl_Eta_->Fill(sclRef->eta()); h2_scl_EtaVsPhi_->Fill(sclRef->phi(), sclRef->eta()); h1_scl_Phi_->Fill(sclRef->phi()); - if (isEEflag) - h1_scl_ESFrac_endcaps->Fill(sclRef->preshowerEnergy() / sclRef->rawEnergy()); } h1_scl_SigIEtaIEta_->Fill(bestGsfElectron.scSigmaIEtaIEta()); - if (isEBflag) - h1_scl_SigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta()); - if (isEEflag) - h1_scl_SigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta()); h1_scl_full5x5_sigmaIetaIeta_->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); - if (isEBflag) - h1_scl_full5x5_sigmaIetaIeta_barrel_->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); - if (isEEflag) - h1_scl_full5x5_sigmaIetaIeta_endcaps_->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); h1_scl_E1x5_->Fill(bestGsfElectron.scE1x5()); - if (isEBflag) - h1_scl_E1x5_barrel_->Fill(bestGsfElectron.scE1x5()); - if (isEEflag) - h1_scl_E1x5_endcaps_->Fill(bestGsfElectron.scE1x5()); h1_scl_E2x5max_->Fill(bestGsfElectron.scE2x5Max()); - if (isEBflag) - h1_scl_E2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max()); - if (isEEflag) - h1_scl_E2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max()); h1_scl_E5x5_->Fill(bestGsfElectron.scE5x5()); - if (isEBflag) + if (isEBflag) { + h1_scl_SigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta()); + h1_scl_full5x5_sigmaIetaIeta_barrel_->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); + h1_scl_E1x5_barrel_->Fill(bestGsfElectron.scE1x5()); + h1_scl_E2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max()); h1_scl_E5x5_barrel_->Fill(bestGsfElectron.scE5x5()); - if (isEEflag) + } + else if (isEEflag) { + h1_scl_SigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta()); + h1_scl_full5x5_sigmaIetaIeta_endcaps_->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); + h1_scl_E1x5_endcaps_->Fill(bestGsfElectron.scE1x5()); + h1_scl_E2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max()); h1_scl_E5x5_endcaps_->Fill(bestGsfElectron.scE5x5()); + } // track related distributions h1_ele_ambiguousTracks->Fill(bestGsfElectron.ambiguousGsfTracksSize()); @@ -2748,95 +2742,76 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event } // match distributions h1_ele_EoP->Fill(bestGsfElectron.eSuperClusterOverP()); - if (isEBflag) - h1_ele_EoP_barrel->Fill(bestGsfElectron.eSuperClusterOverP()); - if (isEEflag) - h1_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP()); h2_ele_EoPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSuperClusterOverP()); h2_ele_EoPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSuperClusterOverP()); h2_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSuperClusterOverP()); h1_ele_EseedOP->Fill(bestGsfElectron.eSeedClusterOverP()); - if (isEBflag) - h1_ele_EseedOP_barrel->Fill(bestGsfElectron.eSeedClusterOverP()); - if (isEEflag) - h1_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP()); h2_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverP()); h2_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverP()); h2_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverP()); h1_ele_EoPout->Fill(bestGsfElectron.eSeedClusterOverPout()); - if (isEBflag) - h1_ele_EoPout_barrel->Fill(bestGsfElectron.eSeedClusterOverPout()); - if (isEEflag) - h1_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout()); h2_ele_EoPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout()); h2_ele_EoPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout()); h2_ele_EoPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout()); h1_ele_EeleOPout->Fill(bestGsfElectron.eEleClusterOverPout()); - if (isEBflag) - h1_ele_EeleOPout_barrel->Fill(bestGsfElectron.eEleClusterOverPout()); - if (isEEflag) - h1_ele_EeleOPout_endcaps->Fill(bestGsfElectron.eEleClusterOverPout()); h2_ele_EeleOPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout()); h2_ele_EeleOPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout()); h2_ele_EeleOPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout()); h1_ele_dEtaSc_propVtx->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); - if (isEBflag) - h1_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); - if (isEEflag) - h1_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); h2_ele_dEtaScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); h2_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); h2_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); h1_ele_dPhiSc_propVtx->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); - if (isEBflag) - h1_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); - if (isEEflag) - h1_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); h2_ele_dPhiScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); h2_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); h2_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); h1_ele_dEtaCl_propOut->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); - if (isEBflag) - h1_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); - if (isEEflag) - h1_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); h2_ele_dEtaClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); h2_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); h2_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); h1_ele_dPhiCl_propOut->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); - if (isEBflag) - h1_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); - if (isEEflag) - h1_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h2_ele_dPhiClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h2_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h2_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h1_ele_dEtaEleCl_propOut->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); - if (isEBflag) - h1_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); - if (isEEflag) - h1_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); h2_ele_dEtaEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); h2_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); h2_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); h1_ele_dPhiEleCl_propOut->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); - if (isEBflag) - h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); - if (isEEflag) - h1_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h2_ele_dPhiEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h2_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h2_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h1_ele_HoE->Fill(bestGsfElectron.hadronicOverEm()); h1_ele_HoE_bc->Fill(bestGsfElectron.hcalOverEcalBc()); - if (isEBflag) + if (isEBflag) { + h1_ele_EoP_barrel->Fill(bestGsfElectron.eSuperClusterOverP()); + h1_ele_EseedOP_barrel->Fill(bestGsfElectron.eSeedClusterOverP()); + h1_ele_EoPout_barrel->Fill(bestGsfElectron.eSeedClusterOverPout()); + h1_ele_EeleOPout_barrel->Fill(bestGsfElectron.eEleClusterOverPout()); + h1_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); + h1_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); + h1_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); + h1_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); + h1_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); + h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h1_ele_HoE_bc_barrel->Fill(bestGsfElectron.hcalOverEcalBc()); - if (isEEflag) - h1_ele_HoE_bc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc()); - if (isEBflag) h1_ele_HoE_barrel->Fill(bestGsfElectron.hadronicOverEm()); - if (isEEflag) + } + else if (isEEflag) { + h1_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP()); + h1_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP()); + h1_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout()); + h1_ele_EeleOPout_endcaps->Fill(bestGsfElectron.eEleClusterOverPout()); + h1_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); + h1_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); + h1_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); + h1_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); + h1_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); + h1_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); + h1_ele_HoE_bc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc()); h1_ele_HoE_endcaps->Fill(bestGsfElectron.hadronicOverEm()); + } + if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap() && !bestGsfElectron.isEBEEGap() && !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap()) h1_ele_HoE_fiducial->Fill(bestGsfElectron.hadronicOverEm()); @@ -2863,26 +2838,17 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event double fbrem_mode = bestGsfElectron.fbrem(); h1_ele_fbrem->Fill(fbrem_mode); p1_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(), fbrem_mode); - - if (isEBflag) { - double fbrem_mode_barrel = bestGsfElectron.fbrem(); - h1_ele_fbrem_barrel->Fill(fbrem_mode_barrel); - } - - if (isEEflag) { - double fbrem_mode_endcaps = bestGsfElectron.fbrem(); - h1_ele_fbrem_endcaps->Fill(fbrem_mode_endcaps); - } - double superclusterfbrem_mode = bestGsfElectron.superClusterFbrem(); h1_ele_superclusterfbrem->Fill(superclusterfbrem_mode); - if (isEBflag) { + double fbrem_mode_barrel = bestGsfElectron.fbrem(); + h1_ele_fbrem_barrel->Fill(fbrem_mode_barrel); double superclusterfbrem_mode_barrel = bestGsfElectron.superClusterFbrem(); h1_ele_superclusterfbrem_barrel->Fill(superclusterfbrem_mode_barrel); } - - if (isEEflag) { + else if (isEEflag) { + double fbrem_mode_endcaps = bestGsfElectron.fbrem(); + h1_ele_fbrem_endcaps->Fill(fbrem_mode_endcaps); double superclusterfbrem_mode_endcaps = bestGsfElectron.superClusterFbrem(); h1_ele_superclusterfbrem_endcaps->Fill(superclusterfbrem_mode_endcaps); } @@ -2892,49 +2858,45 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event double fbrem_mean = 1. - bestGsfElectron.gsfTrack()->outerMomentum().R() / bestGsfElectron.gsfTrack()->innerMomentum().R(); p1_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(), fbrem_mean); - } - - // - if (bestGsfElectron.classification() == GsfElectron::GOLDEN) - h2_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(), - bestGsfElectron.trackMomentumAtVtx().R()); - if (bestGsfElectron.classification() == GsfElectron::SHOWERING) - h2_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(), - bestGsfElectron.trackMomentumAtVtx().R()); - if (!readAOD_) // track extra does not exist in AOD if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R()); - if (!readAOD_) // track extra does not exist in AOD if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(), bestGsfElectron.gsfTrack()->innerMomentum().R()); - if (bestGsfElectron.classification() == GsfElectron::GOLDEN) - h2_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), - bestGsfElectron.trackMomentumAtVtx().Rho()); - if (bestGsfElectron.classification() == GsfElectron::SHOWERING) - h2_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), - bestGsfElectron.trackMomentumAtVtx().Rho()); - if (!readAOD_) // track extra does not exist in AOD if (bestGsfElectron.classification() == GsfElectron::GOLDEN) h2_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho()); - if (!readAOD_) // track extra does not exist in AOD if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(), bestGsfElectron.gsfTrack()->innerMomentum().Rho()); + } + if (bestGsfElectron.classification() == GsfElectron::GOLDEN) + h2_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), + bestGsfElectron.trackMomentumAtVtx().Rho()); + if (bestGsfElectron.classification() == GsfElectron::SHOWERING) + h2_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(), + bestGsfElectron.trackMomentumAtVtx().Rho()); + if (bestGsfElectron.classification() == GsfElectron::GOLDEN) + h2_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(), + bestGsfElectron.trackMomentumAtVtx().R()); + if (bestGsfElectron.classification() == GsfElectron::SHOWERING) + h2_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(), + bestGsfElectron.trackMomentumAtVtx().R()); + h1_ele_mva->Fill(bestGsfElectron.mva_e_pi()); - if (isEBflag) - h1_ele_mva_barrel->Fill(bestGsfElectron.mva_e_pi()); - if (isEEflag) - h1_ele_mva_endcaps->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_isolated->Fill(bestGsfElectron.mva_Isolated()); - if (isEBflag) + if (isEBflag) { + h1_ele_mva_barrel->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_barrel_isolated->Fill(bestGsfElectron.mva_Isolated()); - if (isEEflag) + } + else if (isEEflag) { + h1_ele_mva_endcaps->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_endcaps_isolated->Fill(bestGsfElectron.mva_Isolated()); + } + if (bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(1.); if (bestGsfElectron.trackerDrivenSeed()) @@ -2968,114 +2930,85 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event // Pflow isolation h1_ele_chargedHadronIso->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt); - if (isEBflag) - h1_ele_chargedHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt); - if (isEEflag) - h1_ele_chargedHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt); - h1_ele_neutralHadronIso->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt); - if (isEBflag) - h1_ele_neutralHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt); - if (isEEflag) - h1_ele_neutralHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt); - h1_ele_photonIso->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt); - if (isEBflag) + if (isEBflag) { + h1_ele_chargedHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt); + h1_ele_neutralHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt); h1_ele_photonIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt); - if (isEEflag) + } + else if (isEEflag) { + h1_ele_chargedHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt); + h1_ele_neutralHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt); h1_ele_photonIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt); + } // -- pflow over pT h1_ele_chargedHadronRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / bestGsfElectron.pt()); - if (isEBflag) - h1_ele_chargedHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / - bestGsfElectron.pt()); - if (isEEflag) - h1_ele_chargedHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / - bestGsfElectron.pt()); - h1_ele_neutralHadronRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt()); - if (isEBflag) + h1_ele_photonRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); + if (isEBflag) { + h1_ele_chargedHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / + bestGsfElectron.pt()); h1_ele_neutralHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt()); - if (isEEflag) - h1_ele_neutralHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / - bestGsfElectron.pt()); - - h1_ele_photonRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); - if (isEBflag) h1_ele_photonRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); - if (isEEflag) + } + else if (isEEflag) { + h1_ele_chargedHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / + bestGsfElectron.pt()); + h1_ele_neutralHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / + bestGsfElectron.pt()); h1_ele_photonRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); + } // isolation h1_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt()); - if (isEBflag) - h1_ele_tkSumPt_dr03_barrel->Fill(bestGsfElectron.dr03TkSumPt()); - if (isEEflag) - h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt()); h1_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); - if (isEBflag) - h1_ele_ecalRecHitSumEt_dr03_barrel->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); - if (isEEflag) - h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); h1_ele_hcalTowerSumEt_dr03_depth1->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); - if (isEBflag) - h1_ele_hcalTowerSumEt_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); - if (isEEflag) - h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); h1_ele_hcalTowerSumEt_dr03_depth2->Fill(bestGsfElectron.dr03HcalTowerSumEt(2)); h1_ele_hcalTowerSumEtBc_dr03_depth1->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1)); - if (isEBflag) - h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1)); - if (isEEflag) - h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1)); h1_ele_hcalTowerSumEtBc_dr03_depth2->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2)); - if (isEBflag) - h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2)); - if (isEEflag) - h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2)); h1_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt()); - if (isEBflag) - h1_ele_tkSumPt_dr04_barrel->Fill(bestGsfElectron.dr04TkSumPt()); - if (isEEflag) - h1_ele_tkSumPt_dr04_endcaps->Fill(bestGsfElectron.dr04TkSumPt()); h1_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt()); - if (isEBflag) - h1_ele_ecalRecHitSumEt_dr04_barrel->Fill(bestGsfElectron.dr04EcalRecHitSumEt()); - if (isEEflag) - h1_ele_ecalRecHitSumEt_dr04_endcaps->Fill(bestGsfElectron.dr04EcalRecHitSumEt()); h1_ele_hcalTowerSumEt_dr04_depth1->Fill(bestGsfElectron.dr04HcalTowerSumEt(1)); - if (isEBflag) - h1_ele_hcalTowerSumEt_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEt(1)); - if (isEEflag) - h1_ele_hcalTowerSumEt_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEt(1)); h1_ele_hcalTowerSumEt_dr04_depth2->Fill(bestGsfElectron.dr04HcalTowerSumEt(2)); h1_ele_hcalTowerSumEtBc_dr04_depth1->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1)); - if (isEBflag) - h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1)); - if (isEEflag) - h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1)); h1_ele_hcalTowerSumEtBc_dr04_depth2->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); - if (isEBflag) - h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); - if (isEEflag) - h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); - h1_ele_hcalDepth1OverEcalBc->Fill(bestGsfElectron.hcalOverEcalBc(1)); - if (isEBflag) - h1_ele_hcalDepth1OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(1)); - if (isEEflag) - h1_ele_hcalDepth1OverEcalBc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc(1)); h1_ele_hcalDepth2OverEcalBc->Fill(bestGsfElectron.hcalOverEcalBc(2)); - if (isEBflag) + if (isEBflag) { + h1_ele_tkSumPt_dr03_barrel->Fill(bestGsfElectron.dr03TkSumPt()); + h1_ele_ecalRecHitSumEt_dr03_barrel->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); + h1_ele_hcalTowerSumEt_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); + h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1)); + h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2)); + h1_ele_tkSumPt_dr04_barrel->Fill(bestGsfElectron.dr04TkSumPt()); + h1_ele_ecalRecHitSumEt_dr04_barrel->Fill(bestGsfElectron.dr04EcalRecHitSumEt()); + h1_ele_hcalTowerSumEt_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEt(1)); + h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1)); + h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); + h1_ele_hcalDepth1OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(1)); h1_ele_hcalDepth2OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(2)); - if (isEEflag) + } + else if (isEEflag) { + h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt()); + h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); + h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); + h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1)); + h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2)); + h1_ele_tkSumPt_dr04_endcaps->Fill(bestGsfElectron.dr04TkSumPt()); + h1_ele_ecalRecHitSumEt_dr04_endcaps->Fill(bestGsfElectron.dr04EcalRecHitSumEt()); + h1_ele_hcalTowerSumEt_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEt(1)); + h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1)); + h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); + h1_ele_hcalDepth1OverEcalBc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc(1)); h1_ele_hcalDepth2OverEcalBc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc(2)); + } // conversion rejection int flags = bestGsfElectron.convFlags(); diff --git a/Validation/RecoEgamma/plugins/ElectronMcMiniAODSignalValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcMiniAODSignalValidator.cc index d4f530bca4316..6822d1bc6e748 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcMiniAODSignalValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcMiniAODSignalValidator.cc @@ -609,7 +609,7 @@ void ElectronMcSignalValidatorMiniAOD::analyze(const edm::Event& iEvent, const e } // supercluster related distributions - if (isEEflag) { + else if (isEEflag) { h1_scl_SigIEtaIEta_mAOD_endcaps->Fill(bestGsfElectron.scSigmaIEtaIEta()); h1_ele_dEtaSc_propVtx_mAOD_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); h1_ele_dPhiCl_propOut_mAOD_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); diff --git a/Validation/RecoEgamma/plugins/ElectronMcSignalPostValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcSignalPostValidator.cc index 2d83cae52106e..8436bc5c16029 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcSignalPostValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcSignalPostValidator.cc @@ -27,7 +27,7 @@ void ElectronMcSignalPostValidator::finalize(DQMStore::IBooker& iBooker, DQMStor bookH1andDivide(iBooker, iGetter, "absetaEff", "mc_AbsEta_matched", "mc_AbsEta", "|#eta|", "Efficiency", ""); bookH1andDivide(iBooker, iGetter, "ptEff", "mc_Pt_matched", "mc_Pt", "p_{T} (GeV/c)", "Efficiency", ""); bookH1andDivide(iBooker, iGetter, "phiEff", "mc_Phi_matched", "mc_Phi", "#phi (rad)", "Efficiency", ""); - bookH2andDivide(iBooker, iGetter, "ptEtaEff", "mc_PtEta_matched", "mc_PtEta", "#eta", "p_{T} (GeV/c)", ""); + //bookH2andDivide(iBooker, iGetter, "ptEtaEff", "mc_PtEta_matched", "mc_PtEta", "#eta", "p_{T} (GeV/c)", ""); edm::LogInfo("ElectronMcSignalPostValidator::finalize") << "q-misid calculation"; bookH1andDivide(iBooker, iGetter, "etaQmisid", "mc_Eta_matched_qmisid", "mc_Eta", "#eta", "q misId", ""); diff --git a/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc index 2ad72414b2d13..c797f5da745ed 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc @@ -871,7 +871,7 @@ void ElectronMcSignalValidator::bookHistograms(DQMStore::IBooker &iBooker, edm:: "Events", "ELE_LOGY E1 P"); h1_ele_vertexPt_all = bookH1withSumw2( - iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events", "ELE_LOGY E1 P"); + iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events");//, "ELE_LOGY E1 P"); h1_ele_Et_all = bookH1withSumw2(iBooker, "Et_all", "ele ecal E_{T}, all reco electrons", @@ -888,8 +888,8 @@ void ElectronMcSignalValidator::bookHistograms(DQMStore::IBooker &iBooker, edm:: eta_min, eta_max, "", - "Events", - "ELE_LOGY E1 P"); + "Events");//, + //"ELE_LOGY E1 P"); h1_ele_TIP_all = bookH1withSumw2(iBooker, "TIP_all", "ele vertex transverse radius, all reco electrons", @@ -3555,7 +3555,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve if (isEBflag) h2_scl_EoEtrueVsrecOfflineVertices_barrel->Fill((*vertexCollectionHandle).size(), bestGsfElectron.ecalEnergy() / mcIter->p()); - if (isEEflag) + else if (isEEflag) h2_scl_EoEtrueVsrecOfflineVertices_endcaps->Fill((*vertexCollectionHandle).size(), bestGsfElectron.ecalEnergy() / mcIter->p()); @@ -3579,18 +3579,10 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h2_ele_vertexTIPVsPhi->Fill(bestGsfElectron.phi(), d); h2_ele_vertexTIPVsPt->Fill(bestGsfElectron.pt(), d); h1_ele_EtaMnEtaTrue->Fill(bestGsfElectron.eta() - mcIter->eta()); - if (isEBflag) - h1_ele_EtaMnEtaTrue_barrel->Fill(bestGsfElectron.eta() - mcIter->eta()); - if (isEEflag) - h1_ele_EtaMnEtaTrue_endcaps->Fill(bestGsfElectron.eta() - mcIter->eta()); h2_ele_EtaMnEtaTrueVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eta() - mcIter->eta()); h2_ele_EtaMnEtaTrueVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta() - mcIter->eta()); h2_ele_EtaMnEtaTrueVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.eta() - mcIter->eta()); h1_ele_PhiMnPhiTrue->Fill(bestGsfElectron.phi() - mcIter->phi()); - if (isEBflag) - h1_ele_PhiMnPhiTrue_barrel->Fill(bestGsfElectron.phi() - mcIter->phi()); - if (isEEflag) - h1_ele_PhiMnPhiTrue_endcaps->Fill(bestGsfElectron.phi() - mcIter->phi()); h1_ele_PhiMnPhiTrue2->Fill(bestGsfElectron.phi() - mcIter->phi()); h2_ele_PhiMnPhiTrueVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.phi() - mcIter->phi()); h2_ele_PhiMnPhiTrueVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.phi() - mcIter->phi()); @@ -3601,11 +3593,25 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h2_ele_PoPtrueVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.p() / mcIter->p()); h2_ele_PoPtrueVsPt->Fill(bestGsfElectron.py(), bestGsfElectron.p() / mcIter->p()); h2_ele_sigmaIetaIetaVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.scSigmaIEtaIEta()); - - if (isEBflag) + h1_ele_ecalEnergyError->Fill(bestGsfElectron.correctedEcalEnergyError()); + h1_ele_combinedP4Error->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION)); + if (isEBflag){ + h1_ele_EtaMnEtaTrue_barrel->Fill(bestGsfElectron.eta() - mcIter->eta()); + h1_ele_PhiMnPhiTrue_barrel->Fill(bestGsfElectron.phi() - mcIter->phi()); h1_ele_PoPtrue_barrel->Fill(bestGsfElectron.p() / mcIter->p()); - if (isEEflag) + h1_ele_PtoPttrue_barrel->Fill(bestGsfElectron.pt() / mcIter->pt()); + h1_ele_combinedP4Error_barrel->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION)); + } + else if (isEEflag) { + h1_ele_EtaMnEtaTrue_endcaps->Fill(bestGsfElectron.eta() - mcIter->eta()); + h1_ele_PhiMnPhiTrue_endcaps->Fill(bestGsfElectron.phi() - mcIter->phi()); h1_ele_PoPtrue_endcaps->Fill(bestGsfElectron.p() / mcIter->p()); + h1_ele_PtoPttrue_endcaps->Fill(bestGsfElectron.pt() / mcIter->pt()); + h1_ele_ecalEnergyError_barrel->Fill(bestGsfElectron.correctedEcalEnergyError()); + h1_ele_ecalEnergyError_endcaps->Fill(bestGsfElectron.correctedEcalEnergyError()); + h1_ele_combinedP4Error_endcaps->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION)); + } + if (isEBflag && bestGsfElectron.classification() == GsfElectron::GOLDEN) h1_ele_PoPtrue_golden_barrel->Fill(bestGsfElectron.p() / mcIter->p()); if (isEEflag && bestGsfElectron.classification() == GsfElectron::GOLDEN) @@ -3614,29 +3620,19 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_ele_PoPtrue_showering_barrel->Fill(bestGsfElectron.p() / mcIter->p()); if (isEEflag && bestGsfElectron.classification() == GsfElectron::SHOWERING) h1_ele_PoPtrue_showering_endcaps->Fill(bestGsfElectron.p() / mcIter->p()); - if (isEBflag) - h1_ele_PtoPttrue_barrel->Fill(bestGsfElectron.pt() / mcIter->pt()); - if (isEEflag) - h1_ele_PtoPttrue_endcaps->Fill(bestGsfElectron.pt() / mcIter->pt()); - h1_ele_ecalEnergyError->Fill(bestGsfElectron.correctedEcalEnergyError()); - if (isEBflag) - h1_ele_ecalEnergyError_barrel->Fill(bestGsfElectron.correctedEcalEnergyError()); - if (isEEflag) - h1_ele_ecalEnergyError_endcaps->Fill(bestGsfElectron.correctedEcalEnergyError()); - h1_ele_combinedP4Error->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION)); - if (isEBflag) - h1_ele_combinedP4Error_barrel->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION)); - if (isEEflag) - h1_ele_combinedP4Error_endcaps->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION)); // supercluster related distributions reco::SuperClusterRef sclRef = bestGsfElectron.superCluster(); h1_scl_En->Fill(bestGsfElectron.ecalEnergy()); - if (isEBflag) + if (isEBflag) { h1_scl_EoEtrue_barrel->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); - if (isEEflag) + h1_scl_EoEtrue_barrel_new->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); + } + else if (isEEflag) { h1_scl_EoEtrue_endcaps->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); + h1_scl_EoEtrue_endcaps_new->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); + } if (isEBflag && bestGsfElectron.isEBEtaGap()) h1_scl_EoEtrue_barrel_etagap->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); if (isEBflag && bestGsfElectron.isEBPhiGap()) @@ -3647,10 +3643,6 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_scl_EoEtrue_endcaps_deegap->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); if (isEEflag && bestGsfElectron.isEERingGap()) h1_scl_EoEtrue_endcaps_ringgap->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); - if (isEBflag) - h1_scl_EoEtrue_barrel_new->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); - if (isEEflag) - h1_scl_EoEtrue_endcaps_new->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); if (isEBflag && bestGsfElectron.isEBEtaGap()) h1_scl_EoEtrue_barrel_new_etagap->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); if (isEBflag && bestGsfElectron.isEBPhiGap()) @@ -3671,42 +3663,36 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h2_scl_EtaVsPhi->Fill(sclRef->phi(), sclRef->eta()); h1_scl_Phi->Fill(sclRef->phi()); h1_scl_SigEtaEta->Fill(bestGsfElectron.scSigmaEtaEta()); - if (isEBflag) - h1_scl_SigEtaEta_barrel->Fill(bestGsfElectron.scSigmaEtaEta()); - if (isEEflag) - h1_scl_SigEtaEta_endcaps->Fill(bestGsfElectron.scSigmaEtaEta()); h1_scl_SigIEtaIEta->Fill(bestGsfElectron.scSigmaIEtaIEta()); - if (isEBflag) + h1_scl_full5x5_sigmaIetaIeta->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); + h1_scl_E1x5->Fill(bestGsfElectron.scE1x5()); + h1_scl_E2x5max->Fill(bestGsfElectron.scE2x5Max()); + h1_scl_E5x5->Fill(bestGsfElectron.scE5x5()); + if (isEBflag) { + h1_scl_SigEtaEta_barrel->Fill(bestGsfElectron.scSigmaEtaEta()); h1_scl_SigIEtaIEta_barrel->Fill(bestGsfElectron.scSigmaIEtaIEta()); - if (isEEflag) + h1_scl_full5x5_sigmaIetaIeta_barrel->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); + h1_scl_E1x5_barrel->Fill(bestGsfElectron.scE1x5()); + h1_scl_E2x5max_barrel->Fill(bestGsfElectron.scE2x5Max()); + h1_scl_E5x5_barrel->Fill(bestGsfElectron.scE5x5()); + } + else if (isEEflag) { + h1_scl_SigEtaEta_endcaps->Fill(bestGsfElectron.scSigmaEtaEta()); h1_scl_SigIEtaIEta_endcaps->Fill(bestGsfElectron.scSigmaIEtaIEta()); + h1_scl_full5x5_sigmaIetaIeta_endcaps->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); + h1_scl_E1x5_endcaps->Fill(bestGsfElectron.scE1x5()); + h1_scl_E2x5max_endcaps->Fill(bestGsfElectron.scE2x5Max()); + h1_scl_E5x5_endcaps->Fill(bestGsfElectron.scE5x5()); + } + if (passMiniAODSelection) { // Pt > 5. h1_scl_SigIEtaIEta_mAOD->Fill(bestGsfElectron.scSigmaIEtaIEta()); if (isEBflag) h1_scl_SigIEtaIEta_mAOD_barrel->Fill(bestGsfElectron.scSigmaIEtaIEta()); - if (isEEflag) + else if (isEEflag) h1_scl_SigIEtaIEta_mAOD_endcaps->Fill(bestGsfElectron.scSigmaIEtaIEta()); } - h1_scl_full5x5_sigmaIetaIeta->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); - if (isEBflag) - h1_scl_full5x5_sigmaIetaIeta_barrel->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); - if (isEEflag) - h1_scl_full5x5_sigmaIetaIeta_endcaps->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); - h1_scl_E1x5->Fill(bestGsfElectron.scE1x5()); - if (isEBflag) - h1_scl_E1x5_barrel->Fill(bestGsfElectron.scE1x5()); - if (isEEflag) - h1_scl_E1x5_endcaps->Fill(bestGsfElectron.scE1x5()); - h1_scl_E2x5max->Fill(bestGsfElectron.scE2x5Max()); - if (isEBflag) - h1_scl_E2x5max_barrel->Fill(bestGsfElectron.scE2x5Max()); - if (isEEflag) - h1_scl_E2x5max_endcaps->Fill(bestGsfElectron.scE2x5Max()); - h1_scl_E5x5->Fill(bestGsfElectron.scE5x5()); - if (isEBflag) - h1_scl_E5x5_barrel->Fill(bestGsfElectron.scE5x5()); - if (isEEflag) - h1_scl_E5x5_endcaps->Fill(bestGsfElectron.scE5x5()); + float pfEnergy = 0.; if (!bestGsfElectron.parentSuperCluster().isNull()) pfEnergy = bestGsfElectron.parentSuperCluster()->energy(); @@ -3723,7 +3709,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_scl_bcl_EtotoEtrue->Fill(Etot / mcIter->p()); if (isEBflag) h1_scl_bcl_EtotoEtrue_barrel->Fill(Etot / mcIter->p()); - if (isEEflag) + else if (isEEflag) h1_scl_bcl_EtotoEtrue_endcaps->Fill(Etot / mcIter->p()); // track related distributions @@ -3734,32 +3720,31 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve if (!readAOD_) // track extra does not exist in AOD { h1_ele_foundHits->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits()); - if (isEBflag) - h1_ele_foundHits_barrel->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits()); - if (isEEflag) - h1_ele_foundHits_endcaps->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits()); h2_ele_foundHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits()); - if (passMiniAODSelection) { // Pt > 5. - h2_ele_foundHitsVsEta_mAOD->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits()); - } h2_ele_foundHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits()); h2_ele_foundHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits()); h1_ele_lostHits->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits()); - if (isEBflag) - h1_ele_lostHits_barrel->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits()); - if (isEEflag) - h1_ele_lostHits_endcaps->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits()); h2_ele_lostHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits()); h2_ele_lostHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits()); h2_ele_lostHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits()); h1_ele_chi2->Fill(bestGsfElectron.gsfTrack()->normalizedChi2()); - if (isEBflag) - h1_ele_chi2_barrel->Fill(bestGsfElectron.gsfTrack()->normalizedChi2()); - if (isEEflag) - h1_ele_chi2_endcaps->Fill(bestGsfElectron.gsfTrack()->normalizedChi2()); h2_ele_chi2VsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2()); h2_ele_chi2VsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2()); h2_ele_chi2VsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2()); + if (isEBflag) { + h1_ele_foundHits_barrel->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits()); + h1_ele_lostHits_barrel->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits()); + h1_ele_chi2_barrel->Fill(bestGsfElectron.gsfTrack()->normalizedChi2()); + } + else if (isEEflag) { + h1_ele_foundHits_endcaps->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits()); + h1_ele_lostHits_endcaps->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits()); + h1_ele_chi2_endcaps->Fill(bestGsfElectron.gsfTrack()->normalizedChi2()); + } + + if (passMiniAODSelection) { // Pt > 5. + h2_ele_foundHitsVsEta_mAOD->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits()); + } } // from gsf track interface, hence using mean if (!readAOD_) // track extra does not exist in AOD @@ -3831,122 +3816,92 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve // match distributions h1_ele_EoP->Fill(bestGsfElectron.eSuperClusterOverP()); - if (isEBflag) - h1_ele_EoP_barrel->Fill(bestGsfElectron.eSuperClusterOverP()); - if (isEEflag) - h1_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP()); h2_ele_EoPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSuperClusterOverP()); h2_ele_EoPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSuperClusterOverP()); h2_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSuperClusterOverP()); h1_ele_EseedOP->Fill(bestGsfElectron.eSeedClusterOverP()); - if (isEBflag) - h1_ele_EseedOP_barrel->Fill(bestGsfElectron.eSeedClusterOverP()); - if (isEEflag) - h1_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP()); h2_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverP()); h2_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverP()); h2_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverP()); h1_ele_EoPout->Fill(bestGsfElectron.eSeedClusterOverPout()); - if (isEBflag) - h1_ele_EoPout_barrel->Fill(bestGsfElectron.eSeedClusterOverPout()); - if (isEEflag) - h1_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout()); h2_ele_EoPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout()); h2_ele_EoPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout()); h2_ele_EoPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout()); h1_ele_EeleOPout->Fill(bestGsfElectron.eEleClusterOverPout()); - if (isEBflag) - h1_ele_EeleOPout_barrel->Fill(bestGsfElectron.eEleClusterOverPout()); - if (isEEflag) - h1_ele_EeleOPout_endcaps->Fill(bestGsfElectron.eEleClusterOverPout()); h2_ele_EeleOPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout()); h2_ele_EeleOPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout()); h2_ele_EeleOPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout()); h1_ele_dEtaSc_propVtx->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); - if (passMiniAODSelection) { // Pt > 5. - h1_ele_dEtaSc_propVtx_mAOD->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); - } - if (isEBflag) - h1_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); - if (isEEflag) - h1_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); - if (passMiniAODSelection) { // Pt > 5. - if (isEBflag) - h1_ele_dEtaSc_propVtx_mAOD_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); - if (isEEflag) - h1_ele_dEtaSc_propVtx_mAOD_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); - } h2_ele_dEtaScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); h2_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); h2_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); h1_ele_dPhiSc_propVtx->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); - if (isEBflag) - h1_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); - if (isEEflag) - h1_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); h2_ele_dPhiScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); h2_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); h2_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); h1_ele_dEtaCl_propOut->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); - if (isEBflag) - h1_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); - if (isEEflag) - h1_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); h2_ele_dEtaClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); h2_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); h2_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); h1_ele_dPhiCl_propOut->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); - if (passMiniAODSelection) { // Pt > 5. - h1_ele_dPhiCl_propOut_mAOD->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); - } - if (isEBflag) - h1_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); - if (isEEflag) - h1_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); - if (passMiniAODSelection) { // Pt > 5. - if (isEBflag) - h1_ele_dPhiCl_propOut_mAOD_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); - if (isEEflag) - h1_ele_dPhiCl_propOut_mAOD_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); - } h2_ele_dPhiClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h2_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h2_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h1_ele_dEtaEleCl_propOut->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); - if (isEBflag) - h1_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); - if (isEEflag) - h1_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); h2_ele_dEtaEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); h2_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); h2_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); h1_ele_dPhiEleCl_propOut->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); - if (isEBflag) - h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); - if (isEEflag) - h1_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h2_ele_dPhiEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h2_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h2_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h1_ele_HoE->Fill(bestGsfElectron.hcalOverEcal()); - if (passMiniAODSelection) { // Pt > 5. - h1_ele_HoE_mAOD->Fill(bestGsfElectron.hcalOverEcal()); - } h1_ele_HoE_bc->Fill(bestGsfElectron.hcalOverEcalBc()); if (isEBflag) { + h1_ele_EoP_barrel->Fill(bestGsfElectron.eSuperClusterOverP()); + h1_ele_EseedOP_barrel->Fill(bestGsfElectron.eSeedClusterOverP()); + h1_ele_EoPout_barrel->Fill(bestGsfElectron.eSeedClusterOverPout()); + h1_ele_EeleOPout_barrel->Fill(bestGsfElectron.eEleClusterOverPout()); + h1_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); + h1_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); + h1_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); + h1_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); + h1_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); + h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h1_ele_HoE_bc_barrel->Fill(bestGsfElectron.hcalOverEcalBc()); h1_ele_HoE_barrel->Fill(bestGsfElectron.hcalOverEcal()); } - if (isEEflag) { + else if (isEEflag) { + h1_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP()); + h1_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP()); + h1_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout()); + h1_ele_EeleOPout_endcaps->Fill(bestGsfElectron.eEleClusterOverPout()); + h1_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); + h1_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx()); + h1_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo()); + h1_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); + h1_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo()); + h1_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h1_ele_HoE_bc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc()); h1_ele_HoE_endcaps->Fill(bestGsfElectron.hcalOverEcal()); } + if (passMiniAODSelection) { // Pt > 5. - if (isEBflag) + h1_ele_dEtaSc_propVtx_mAOD->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); + h1_ele_dPhiCl_propOut_mAOD->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); + h1_ele_HoE_mAOD->Fill(bestGsfElectron.hcalOverEcal()); + if (isEBflag) { + h1_ele_dEtaSc_propVtx_mAOD_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); + h1_ele_dPhiCl_propOut_mAOD_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h1_ele_HoE_mAOD_barrel->Fill(bestGsfElectron.hcalOverEcal()); - if (isEEflag) + } + else if (isEEflag) { + h1_ele_dEtaSc_propVtx_mAOD_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); + h1_ele_dPhiCl_propOut_mAOD_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h1_ele_HoE_mAOD_endcaps->Fill(bestGsfElectron.hcalOverEcal()); + } } + if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap() && !bestGsfElectron.isEBEEGap() && !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap()) h1_ele_HoE_fiducial->Fill(bestGsfElectron.hcalOverEcal()); @@ -3992,8 +3947,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_ele_fbrem_mAOD_barrel->Fill(fbrem_mode_barrel); } } - - if (isEEflag) { + else if (isEEflag) { double fbrem_mode_endcaps = bestGsfElectron.fbrem(); h1_ele_fbrem_endcaps->Fill(fbrem_mode_endcaps); if (passMiniAODSelection) { // Pt > 5. @@ -4008,8 +3962,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve double superclusterfbrem_mode_barrel = bestGsfElectron.superClusterFbrem(); h1_ele_superclusterfbrem_barrel->Fill(superclusterfbrem_mode_barrel); } - - if (isEEflag) { + else if (isEEflag) { double superclusterfbrem_mode_endcaps = bestGsfElectron.superClusterFbrem(); h1_ele_superclusterfbrem_endcaps->Fill(superclusterfbrem_mode_endcaps); } @@ -4058,15 +4011,15 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve // provenance and pflow data h1_ele_mva->Fill(bestGsfElectron.mva_e_pi()); - if (isEBflag) - h1_ele_mva_barrel->Fill(bestGsfElectron.mva_e_pi()); - if (isEEflag) - h1_ele_mva_endcaps->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_isolated->Fill(bestGsfElectron.mva_Isolated()); - if (isEBflag) + if (isEBflag) { + h1_ele_mva_barrel->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_barrel_isolated->Fill(bestGsfElectron.mva_Isolated()); - if (isEEflag) + } + else if (isEEflag) { + h1_ele_mva_endcaps->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_endcaps_isolated->Fill(bestGsfElectron.mva_Isolated()); + } if (bestGsfElectron.ecalDrivenSeed()) h1_ele_provenance->Fill(1.); if (bestGsfElectron.trackerDrivenSeed()) @@ -4110,13 +4063,14 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_ele_chargedHadronIso->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt); h1_ele_neutralHadronIso->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt); h1_ele_photonIso->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt); + h1_ele_photonRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); if (isEBflag) { h1_ele_chargedHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt); h1_ele_neutralHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt); h1_ele_photonIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt); } - if (isEEflag) { + else if (isEEflag) { h1_ele_chargedHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt); h1_ele_neutralHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt); h1_ele_photonIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt); @@ -4125,130 +4079,94 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve // -- pflow over pT h1_ele_chargedHadronRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / bestGsfElectron.pt()); - if (isEBflag) - h1_ele_chargedHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / - bestGsfElectron.pt()); - if (isEEflag) - h1_ele_chargedHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / - bestGsfElectron.pt()); - if (passMiniAODSelection) { // Pt > 5. - h1_ele_chargedHadronRelativeIso_mAOD->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / - bestGsfElectron.pt()); - if (isEBflag) - h1_ele_chargedHadronRelativeIso_mAOD_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / - bestGsfElectron.pt()); - if (isEEflag) - h1_ele_chargedHadronRelativeIso_mAOD_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / - bestGsfElectron.pt()); - } - h1_ele_neutralHadronRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt()); - if (isEBflag) + if (isEBflag) { + h1_ele_chargedHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / + bestGsfElectron.pt()); h1_ele_neutralHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt()); - if (isEEflag) + h1_ele_photonRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); + } + else if (isEEflag) { + h1_ele_chargedHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / + bestGsfElectron.pt()); h1_ele_neutralHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt()); + h1_ele_photonRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); + } if (passMiniAODSelection) { // Pt > 5. + h1_ele_chargedHadronRelativeIso_mAOD->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / + bestGsfElectron.pt()); h1_ele_neutralHadronRelativeIso_mAOD->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt()); - if (isEBflag) + h1_ele_photonRelativeIso_mAOD->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); + if (isEBflag) { + h1_ele_chargedHadronRelativeIso_mAOD_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / + bestGsfElectron.pt()); h1_ele_neutralHadronRelativeIso_mAOD_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt()); - if (isEEflag) - h1_ele_neutralHadronRelativeIso_mAOD_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / - bestGsfElectron.pt()); - } - - h1_ele_photonRelativeIso->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); - if (isEBflag) - h1_ele_photonRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); - if (isEEflag) - h1_ele_photonRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); - if (passMiniAODSelection) { // Pt > 5. - h1_ele_photonRelativeIso_mAOD->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); - if (isEBflag) h1_ele_photonRelativeIso_mAOD_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); - if (isEEflag) + } + else if (isEEflag) { + h1_ele_chargedHadronRelativeIso_mAOD_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / + bestGsfElectron.pt()); + h1_ele_neutralHadronRelativeIso_mAOD_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / + bestGsfElectron.pt()); h1_ele_photonRelativeIso_mAOD_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); + } } // isolation h1_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt()); - if (isEBflag) - h1_ele_tkSumPt_dr03_barrel->Fill(bestGsfElectron.dr03TkSumPt()); - if (isEEflag) - h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt()); h1_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); - if (isEBflag) - h1_ele_ecalRecHitSumEt_dr03_barrel->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); - if (isEEflag) - h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); h1_ele_hcalTowerSumEt_dr03_depth1->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); - if (isEBflag) - h1_ele_hcalTowerSumEt_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); - if (isEEflag) - h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); h1_ele_hcalTowerSumEt_dr03_depth2->Fill(bestGsfElectron.dr03HcalTowerSumEt(2)); - if (isEBflag) - h1_ele_hcalTowerSumEt_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEt(2)); - if (isEEflag) - h1_ele_hcalTowerSumEt_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEt(2)); h1_ele_hcalTowerSumEtBc_dr03_depth1->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1)); - if (isEBflag) - h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1)); - if (isEEflag) - h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1)); h1_ele_hcalTowerSumEtBc_dr03_depth2->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2)); - if (isEBflag) - h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2)); - if (isEEflag) - h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2)); h1_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt()); - if (isEBflag) - h1_ele_tkSumPt_dr04_barrel->Fill(bestGsfElectron.dr04TkSumPt()); - if (isEEflag) - h1_ele_tkSumPt_dr04_endcaps->Fill(bestGsfElectron.dr04TkSumPt()); h1_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt()); - if (isEBflag) - h1_ele_ecalRecHitSumEt_dr04_barrel->Fill(bestGsfElectron.dr04EcalRecHitSumEt()); - if (isEEflag) - h1_ele_ecalRecHitSumEt_dr04_endcaps->Fill(bestGsfElectron.dr04EcalRecHitSumEt()); h1_ele_hcalTowerSumEt_dr04_depth1->Fill(bestGsfElectron.dr04HcalTowerSumEt(1)); - if (isEBflag) - h1_ele_hcalTowerSumEt_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEt(1)); - if (isEEflag) - h1_ele_hcalTowerSumEt_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEt(1)); h1_ele_hcalTowerSumEt_dr04_depth2->Fill(bestGsfElectron.dr04HcalTowerSumEt(2)); - if (isEBflag) - h1_ele_hcalTowerSumEt_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEt(2)); - if (isEEflag) - h1_ele_hcalTowerSumEt_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEt(2)); - h1_ele_hcalTowerSumEtBc_dr04_depth1->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1)); h1_ele_hcalTowerSumEtBc_dr04_depth2->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); - if (isEBflag) { - h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1)); - h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); - } - if (isEEflag) { - h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1)); - h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); - } - h1_ele_hcalDepth1OverEcalBc->Fill(bestGsfElectron.hcalOverEcalBc(1)); h1_ele_hcalDepth2OverEcalBc->Fill(bestGsfElectron.hcalOverEcalBc(2)); if (isEBflag) { + h1_ele_tkSumPt_dr03_barrel->Fill(bestGsfElectron.dr03TkSumPt()); + h1_ele_ecalRecHitSumEt_dr03_barrel->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); + h1_ele_hcalTowerSumEt_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); + h1_ele_hcalTowerSumEt_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEt(2)); + h1_ele_hcalTowerSumEtBc_dr03_depth1_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1)); + h1_ele_hcalTowerSumEtBc_dr03_depth2_barrel->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2)); + h1_ele_tkSumPt_dr04_barrel->Fill(bestGsfElectron.dr04TkSumPt()); + h1_ele_ecalRecHitSumEt_dr04_barrel->Fill(bestGsfElectron.dr04EcalRecHitSumEt()); + h1_ele_hcalTowerSumEt_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEt(1)); + h1_ele_hcalTowerSumEt_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEt(2)); + h1_ele_hcalTowerSumEtBc_dr04_depth1_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1)); + h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); h1_ele_hcalDepth1OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(1)); h1_ele_hcalDepth2OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(2)); } - if (isEEflag) { + else if (isEEflag) { + h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt()); + h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); + h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); + h1_ele_hcalTowerSumEt_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEt(2)); + h1_ele_hcalTowerSumEtBc_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(1)); + h1_ele_hcalTowerSumEtBc_dr03_depth2_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEtBc(2)); + h1_ele_tkSumPt_dr04_endcaps->Fill(bestGsfElectron.dr04TkSumPt()); + h1_ele_ecalRecHitSumEt_dr04_endcaps->Fill(bestGsfElectron.dr04EcalRecHitSumEt()); + h1_ele_hcalTowerSumEt_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEt(1)); + h1_ele_hcalTowerSumEt_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEt(2)); + h1_ele_hcalTowerSumEtBc_dr04_depth1_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(1)); + h1_ele_hcalTowerSumEtBc_dr04_depth2_endcaps->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); h1_ele_hcalDepth1OverEcalBc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc(1)); h1_ele_hcalDepth2OverEcalBc_endcaps->Fill(bestGsfElectron.hcalOverEcalBc(2)); } + // conversion rejection int flags = bestGsfElectron.convFlags(); if (flags == -9999) { From e6a8ea1ef86233db2e91c043ced66cdbf750bd51 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Tue, 7 Dec 2021 16:23:26 +0100 Subject: [PATCH 2/8] PR Tests_Reduction_V1 : test part --- .../test/ElectronMcFakePostValidation_cfg.py | 17 +++++++- ...ronMcFakeValidation_gedGsfElectrons_cfg.py | 39 ++++++++++++++----- ...ectronMcSignalPostValidationMiniAOD_cfg.py | 8 +++- ...lectronMcSignalPostValidationPt1000_cfg.py | 20 +++++++++- .../ElectronMcSignalPostValidation_cfg.py | 6 ++- .../ElectronMcSignalValidationMiniAOD_cfg.py | 10 ++++- ...nalValidationPt1000_gedGsfElectrons_cfg.py | 35 +++++++++++++---- ...nMcSignalValidation_gedGsfElectrons_cfg.py | 13 ++++--- .../test/electronValidationCheck_Env.py | 2 +- 9 files changed, 117 insertions(+), 33 deletions(-) diff --git a/Validation/RecoEgamma/test/ElectronMcFakePostValidation_cfg.py b/Validation/RecoEgamma/test/ElectronMcFakePostValidation_cfg.py index d61d3b1df16e7..caecead0dc720 100644 --- a/Validation/RecoEgamma/test/ElectronMcFakePostValidation_cfg.py +++ b/Validation/RecoEgamma/test/ElectronMcFakePostValidation_cfg.py @@ -12,6 +12,9 @@ if cmsEnv.beginTag() == 'Run2_2017': from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 process = cms.Process("electronPostValidation",Run2_2017) +elif cmsEnv.beginTag() == 'Run3': + from Configuration.Eras.Era_Run3_cff import Run3 + process = cms.Process('electronValidation', Run3) else: from Configuration.Eras.Era_Phase2_cff import Phase2 process = cms.Process('electronPostValidation',Phase2) @@ -34,10 +37,22 @@ from DQMServices.Components.DQMStoreStats_cfi import * dqmStoreStats.runOnEndJob = cms.untracked.bool(True) +# others +# import of standard configurations +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.Geometry.GeometryExtended2026D76Reco_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.DQMSaverAtRunEnd_cff') +process.load('Configuration.StandardSequences.Harvesting_cff') + process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) +print('= inputPostFile : %s' % os.environ['inputPostFile']) t1 = os.environ['inputPostFile'].split('.') -localFileInput = os.environ['inputPostFile'].replace(".root", "_a.root") # +localFileInput = os.environ['inputPostFile']#.replace(".root", "_a.root") # # Source process.source = cms.Source ("PoolSource",fileNames = cms.untracked.vstring("file:" + localFileInput), secondaryFileNames = cms.untracked.vstring(),) diff --git a/Validation/RecoEgamma/test/ElectronMcFakeValidation_gedGsfElectrons_cfg.py b/Validation/RecoEgamma/test/ElectronMcFakeValidation_gedGsfElectrons_cfg.py index 11bed6fd5f5a8..c59c7f1cb6262 100644 --- a/Validation/RecoEgamma/test/ElectronMcFakeValidation_gedGsfElectrons_cfg.py +++ b/Validation/RecoEgamma/test/ElectronMcFakeValidation_gedGsfElectrons_cfg.py @@ -1,25 +1,38 @@ +from __future__ import print_function import sys import os -import DQMOffline.EGamma.electronDataDiscovery as dd import FWCore.ParameterSet.Config as cms +print('Number of arguments:', len(sys.argv), 'arguments.') +print('Argument List:', str(sys.argv)) +# first arg : cmsRun +# second arg : name of the _cfg file +# third arg : sample name (ex. ZEE_14) + from electronValidationCheck_Env import env + cmsEnv = env() # be careful, cmsEnv != cmsenv. cmsEnv is local cmsEnv.checkSample() # check the sample value cmsEnv.checkValues() +import DQMOffline.EGamma.electronDataDiscovery as dd + if cmsEnv.beginTag() == 'Run2_2017': from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 - process = cms.Process("electronValidation",Run2_2017) + process = cms.Process("electronValidation", Run2_2017) +elif cmsEnv.beginTag() == 'Run3': + from Configuration.Eras.Era_Run3_cff import Run3 + process = cms.Process('electronValidation', Run3) else: from Configuration.Eras.Era_Phase2_cff import Phase2 - process = cms.Process('electronValidation',Phase2) + process = cms.Process('electronValidation', Phase2) process.DQMStore = cms.Service("DQMStore") process.load("DQMServices.Components.DQMStoreStats_cfi") from DQMServices.Components.DQMStoreStats_cfi import * + dqmStoreStats.runOnEndJob = cms.untracked.bool(True) #max_skipped = 165 @@ -27,8 +40,13 @@ process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(max_number)) #process.source = cms.Source ("PoolSource",skipEvents = cms.untracked.uint32(max_skipped), fileNames = cms.untracked.vstring(),secondaryFileNames = cms.untracked.vstring()) -process.source = cms.Source ("PoolSource", fileNames = cms.untracked.vstring(),secondaryFileNames = cms.untracked.vstring()) # std value -process.source.fileNames.extend(dd.search()) # to be commented for local run only +data = os.environ['data'] +flist = dd.getCMSdata(data) +print(flist) +process.source = cms.Source("PoolSource", fileNames=cms.untracked.vstring(*flist)) + +# process.source = cms.Source ("PoolSource", fileNames = cms.untracked.vstring(),secondaryFileNames = cms.untracked.vstring()) # std value +# process.source.fileNames.extend(dd.search()) # to be commented for local run only #process.source = cms.Source ("PoolSource", # fileNames = cms.untracked.vstring( @@ -59,7 +77,8 @@ from Configuration.AlCa.autoCond import autoCond #process.GlobalTag.globaltag = os.environ['TEST_GLOBAL_TAG']#+'::All' -process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v2' +process.GlobalTag.globaltag = '122X_mcRun4_realistic_v1' +#process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v2' #process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v0' #process.GlobalTag.globaltag = '93X_mc2017_realistic_v1' @@ -73,10 +92,10 @@ process.load("DQMServices.Components.DQMEnvironment_cfi") process.EDM = cms.OutputModule("PoolOutputModule", -outputCommands = cms.untracked.vstring('drop *',"keep *_MEtoEDMConverter_*_*"), -fileName = cms.untracked.string(os.environ['outputFile'].replace(".root", "_a.root")) -#fileName = cms.untracked.string('electronHistos.ValFullZEEStartup_13_gedGsfE_a.root') # for local run only -) + outputCommands = cms.untracked.vstring('drop *',"keep *_MEtoEDMConverter_*_*"), + fileName = cms.untracked.string(os.environ['outputFile'])#.replace(".root", "_a.root")) + #fileName = cms.untracked.string('electronHistos.ValFullZEEStartup_13_gedGsfE_a.root') # for local run only + ) process.electronMcFakeValidator.InputFolderName = cms.string("EgammaV/ElectronMcFakeValidator") process.electronMcFakeValidator.OutputFolderName = cms.string("EgammaV/ElectronMcFakeValidator") diff --git a/Validation/RecoEgamma/test/ElectronMcSignalPostValidationMiniAOD_cfg.py b/Validation/RecoEgamma/test/ElectronMcSignalPostValidationMiniAOD_cfg.py index f9522aa0006b1..cd96800710653 100644 --- a/Validation/RecoEgamma/test/ElectronMcSignalPostValidationMiniAOD_cfg.py +++ b/Validation/RecoEgamma/test/ElectronMcSignalPostValidationMiniAOD_cfg.py @@ -12,6 +12,9 @@ if cmsEnv.beginTag() == 'Run2_2017': from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 process = cms.Process("electronPostValidation",Run2_2017) +elif cmsEnv.beginTag() == 'Run3': + from Configuration.Eras.Era_Run3_cff import Run3 + process = cms.Process('electronValidation', Run3) else: from Configuration.Eras.Era_Phase2_cff import Phase2 process = cms.Process('electronPostValidation',Phase2) @@ -52,7 +55,7 @@ print('= inputPostFile : %s' % os.environ['inputPostFile']) t1 = os.environ['inputPostFile'].split('.') -localFileInput = os.environ['inputPostFile'].replace(".root", "_a.root") # +localFileInput = os.environ['inputPostFile']#.replace(".root", "_a.root") # # Source process.source = cms.Source ("PoolSource",fileNames = cms.untracked.vstring("file:" + localFileInput), secondaryFileNames = cms.untracked.vstring(),) @@ -62,7 +65,8 @@ from Configuration.AlCa.autoCond import autoCond #process.GlobalTag.globaltag = os.environ['TEST_GLOBAL_TAG']#+'::All' -process.GlobalTag.globaltag = '113X_mcRun4_realistic_v4' +process.GlobalTag.globaltag = '122X_mcRun4_realistic_v1' +#process.GlobalTag.globaltag = '113X_mcRun4_realistic_v4' #process.GlobalTag.globaltag = '93X_mc2017_realistic_v1' process.dqmSaver.workflow = '/electronHistos/' + t1[1] + '/RECO3' diff --git a/Validation/RecoEgamma/test/ElectronMcSignalPostValidationPt1000_cfg.py b/Validation/RecoEgamma/test/ElectronMcSignalPostValidationPt1000_cfg.py index d0219927a5e5a..cb72a0501bff5 100644 --- a/Validation/RecoEgamma/test/ElectronMcSignalPostValidationPt1000_cfg.py +++ b/Validation/RecoEgamma/test/ElectronMcSignalPostValidationPt1000_cfg.py @@ -12,6 +12,9 @@ if cmsEnv.beginTag() == 'Run2_2017': from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 process = cms.Process("electronPostValidation",Run2_2017) +elif cmsEnv.beginTag() == 'Run3': + from Configuration.Eras.Era_Run3_cff import Run3 + process = cms.Process('electronValidation', Run3) else: from Configuration.Eras.Era_Phase2_cff import Phase2 process = cms.Process('electronPostValidation',Phase2) @@ -31,13 +34,24 @@ # actually read in the DQM root file process.load("DQMServices.Components.DQMFileReader_cfi") +# others +# import of standard configurations +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('SimGeneral.MixingModule.mixNoPU_cfi') +process.load('Configuration.Geometry.GeometryExtended2026D76Reco_cff') +process.load('Configuration.StandardSequences.MagneticField_cff') +process.load('Configuration.StandardSequences.DQMSaverAtRunEnd_cff') +process.load('Configuration.StandardSequences.Harvesting_cff') + from DQMServices.Components.DQMStoreStats_cfi import * dqmStoreStats.runOnEndJob = cms.untracked.bool(True) process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) t1 = os.environ['inputPostFile'].split('.') -localFileInput = os.environ['inputPostFile'].replace(".root", "_a.root") # +localFileInput = os.environ['inputPostFile']#.replace(".root", "_a.root") # # Source process.source = cms.Source ("PoolSource",fileNames = cms.untracked.vstring("file:" + localFileInput), secondaryFileNames = cms.untracked.vstring(),) @@ -47,7 +61,9 @@ from Configuration.AlCa.autoCond import autoCond #process.GlobalTag.globaltag = os.environ['TEST_GLOBAL_TAG']#+'::All' -process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v2' +process.GlobalTag.globaltag = '122X_mcRun4_realistic_v1' +#process.GlobalTag.globaltag = '122X_mcRun4_realistic_v1' +#process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v2' #process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v0' #process.GlobalTag.globaltag = '93X_mc2017_realistic_v1' diff --git a/Validation/RecoEgamma/test/ElectronMcSignalPostValidation_cfg.py b/Validation/RecoEgamma/test/ElectronMcSignalPostValidation_cfg.py index d53c23a668657..dfadbb6411e21 100644 --- a/Validation/RecoEgamma/test/ElectronMcSignalPostValidation_cfg.py +++ b/Validation/RecoEgamma/test/ElectronMcSignalPostValidation_cfg.py @@ -12,6 +12,9 @@ if cmsEnv.beginTag() == 'Run2_2017': from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 process = cms.Process("electronPostValidation",Run2_2017) +elif cmsEnv.beginTag() == 'Run3': + from Configuration.Eras.Era_Run3_cff import Run3 + process = cms.Process('electronValidation', Run3) else: from Configuration.Eras.Era_Phase2_cff import Phase2 process = cms.Process('electronPostValidation',Phase2) @@ -42,7 +45,6 @@ process.load('Configuration.StandardSequences.DQMSaverAtRunEnd_cff') process.load('Configuration.StandardSequences.Harvesting_cff') - from DQMServices.Components.DQMStoreStats_cfi import * dqmStoreStats.runOnEndJob = cms.untracked.bool(True) @@ -50,7 +52,7 @@ print('= inputPostFile : %s' % os.environ['inputPostFile']) t1 = os.environ['inputPostFile'].split('.') -localFileInput = os.environ['inputPostFile'].replace("_a.root", ".root") # +localFileInput = os.environ['inputPostFile']#.replace(".root", "_a.root") # # Source process.source = cms.Source ("PoolSource",fileNames = cms.untracked.vstring("file:" + localFileInput), secondaryFileNames = cms.untracked.vstring(),) diff --git a/Validation/RecoEgamma/test/ElectronMcSignalValidationMiniAOD_cfg.py b/Validation/RecoEgamma/test/ElectronMcSignalValidationMiniAOD_cfg.py index f111d70173726..c0f594db75982 100644 --- a/Validation/RecoEgamma/test/ElectronMcSignalValidationMiniAOD_cfg.py +++ b/Validation/RecoEgamma/test/ElectronMcSignalValidationMiniAOD_cfg.py @@ -11,6 +11,7 @@ # third arg : sample name (ex. ZEE_14) from electronValidationCheck_Env import env + cmsEnv = env() # be careful, cmsEnv != cmsenv. cmsEnv is local cmsEnv.checkSample() # check the sample value @@ -21,6 +22,9 @@ if cmsEnv.beginTag() == 'Run2_2017': from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 process = cms.Process("electronValidation",Run2_2017) +elif cmsEnv.beginTag() == 'Run3': + from Configuration.Eras.Era_Run3_cff import Run3 + process = cms.Process('electronValidation', Run3) else: from Configuration.Eras.Era_Phase2_cff import Phase2 process = cms.Process('electronValidation',Phase2) @@ -38,6 +42,7 @@ data = os.environ['data'] flist = dd.getCMSdata(data) +print(flist) process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(*flist)) #process.source = cms.Source ("PoolSource", @@ -71,7 +76,8 @@ from Configuration.AlCa.autoCond import autoCond #process.GlobalTag.globaltag = os.environ['TEST_GLOBAL_TAG']#+'::All' -process.GlobalTag.globaltag = '113X_mcRun4_realistic_v4' +process.GlobalTag.globaltag = '122X_mcRun4_realistic_v1' +#process.GlobalTag.globaltag = '113X_mcRun4_realistic_v4' #process.GlobalTag.globaltag = '93X_mc2017_realistic_v1' # FOR DATA REDONE FROM RAW, ONE MUST HIDE IsoFromDeps @@ -94,7 +100,7 @@ process.EDM = cms.OutputModule("PoolOutputModule", outputCommands = cms.untracked.vstring('drop *',"keep *_MEtoEDMConverter_*_*"), #fileName = cms.untracked.string(TEST_HISTOS_FILE) -fileName = cms.untracked.string(os.environ['outputFile'].replace(".root", "_a.root")) +fileName = cms.untracked.string(os.environ['outputFile'])#.replace(".root", "_a.root")) ) process.electronMcSignalValidatorMiniAOD.InputFolderName = cms.string("EgammaV/ElectronMcSignalValidatorMiniAOD") diff --git a/Validation/RecoEgamma/test/ElectronMcSignalValidationPt1000_gedGsfElectrons_cfg.py b/Validation/RecoEgamma/test/ElectronMcSignalValidationPt1000_gedGsfElectrons_cfg.py index b299ea78ff99a..d1e39accb893a 100644 --- a/Validation/RecoEgamma/test/ElectronMcSignalValidationPt1000_gedGsfElectrons_cfg.py +++ b/Validation/RecoEgamma/test/ElectronMcSignalValidationPt1000_gedGsfElectrons_cfg.py @@ -1,18 +1,30 @@ +from __future__ import print_function import sys import os -import DQMOffline.EGamma.electronDataDiscovery as dd import FWCore.ParameterSet.Config as cms +print('Number of arguments:', len(sys.argv), 'arguments.') +print('Argument List:', str(sys.argv)) +# first arg : cmsRun +# second arg : name of the _cfg file +# third arg : sample name (ex. ZEE_14) + from electronValidationCheck_Env import env + cmsEnv = env() # be careful, cmsEnv != cmsenv. cmsEnv is local cmsEnv.checkSample() # check the sample value cmsEnv.checkValues() +import DQMOffline.EGamma.electronDataDiscovery as dd + if cmsEnv.beginTag() == 'Run2_2017': from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 process = cms.Process("electronValidation",Run2_2017) +elif cmsEnv.beginTag() == 'Run3': + from Configuration.Eras.Era_Run3_cff import Run3 + process = cms.Process('electronValidation', Run3) else: from Configuration.Eras.Era_Phase2_cff import Phase2 process = cms.Process('electronValidation',Phase2) @@ -20,6 +32,7 @@ process.DQMStore = cms.Service("DQMStore") process.load("DQMServices.Components.DQMStoreStats_cfi") from DQMServices.Components.DQMStoreStats_cfi import * + dqmStoreStats.runOnEndJob = cms.untracked.bool(True) #max_skipped = 165 @@ -27,8 +40,13 @@ process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(max_number)) #process.source = cms.Source ("PoolSource",skipEvents = cms.untracked.uint32(max_skipped), fileNames = cms.untracked.vstring(),secondaryFileNames = cms.untracked.vstring()) -process.source = cms.Source ("PoolSource", fileNames = cms.untracked.vstring(),secondaryFileNames = cms.untracked.vstring()) # std value -process.source.fileNames.extend(dd.search()) # to be commented for local run only +data = os.environ['data'] +flist = dd.getCMSdata(data) +print(flist) +process.source = cms.Source("PoolSource", fileNames=cms.untracked.vstring(*flist)) + +#process.source = cms.Source ("PoolSource", fileNames = cms.untracked.vstring(),secondaryFileNames = cms.untracked.vstring()) # std value +#process.source.fileNames.extend(dd.search()) # to be commented for local run only #process.source = cms.Source ("PoolSource", # fileNames = cms.untracked.vstring( @@ -58,7 +76,8 @@ from Configuration.AlCa.autoCond import autoCond #process.GlobalTag.globaltag = os.environ['TEST_GLOBAL_TAG']#+'::All' -process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v2' +process.GlobalTag.globaltag = '122X_mcRun4_realistic_v1' +#process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v2' #process.GlobalTag.globaltag = '93X_upgrade2023_realistic_v0' #process.GlobalTag.globaltag = '93X_mc2017_realistic_v1' @@ -72,10 +91,10 @@ process.load("DQMServices.Components.DQMEnvironment_cfi") process.EDM = cms.OutputModule("PoolOutputModule", -outputCommands = cms.untracked.vstring('drop *',"keep *_MEtoEDMConverter_*_*"), -fileName = cms.untracked.string(os.environ['outputFile'].replace(".root", "_a.root")) -#fileName = cms.untracked.string('electronHistos.ValFullZEEStartup_13_gedGsfE_a.root') # for local run only -) + outputCommands = cms.untracked.vstring('drop *',"keep *_MEtoEDMConverter_*_*"), + fileName = cms.untracked.string(os.environ['outputFile'])#.replace(".root", "_a.root")) + #fileName = cms.untracked.string('electronHistos.ValFullZEEStartup_13_gedGsfE_a.root') # for local run only + ) process.electronMcSignalValidatorPt1000.InputFolderName = cms.string("EgammaV/ElectronMcSignalValidatorPt1000") process.electronMcSignalValidatorPt1000.OutputFolderName = cms.string("EgammaV/ElectronMcSignalValidatorPt1000") diff --git a/Validation/RecoEgamma/test/ElectronMcSignalValidation_gedGsfElectrons_cfg.py b/Validation/RecoEgamma/test/ElectronMcSignalValidation_gedGsfElectrons_cfg.py index d4a5bbfc4d014..122720db073cd 100644 --- a/Validation/RecoEgamma/test/ElectronMcSignalValidation_gedGsfElectrons_cfg.py +++ b/Validation/RecoEgamma/test/ElectronMcSignalValidation_gedGsfElectrons_cfg.py @@ -21,11 +21,12 @@ if cmsEnv.beginTag() == 'Run2_2017': from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 - process = cms.Process("electronValidation", Run2_2017) +elif cmsEnv.beginTag() == 'Run3': + from Configuration.Eras.Era_Run3_cff import Run3 + process = cms.Process('electronValidation', Run3) else: from Configuration.Eras.Era_Phase2_cff import Phase2 - process = cms.Process('electronValidation', Phase2) process.DQMStore = cms.Service("DQMStore") @@ -41,6 +42,7 @@ data = os.environ['data'] flist = dd.getCMSdata(data) +print(flist) process.source = cms.Source("PoolSource", fileNames=cms.untracked.vstring(*flist)) # process.source = cms.Source ("PoolSource", fileNames = cms.untracked.vstring(),secondaryFileNames = cms.untracked.vstring()) # std value @@ -86,7 +88,8 @@ from Configuration.AlCa.autoCond import autoCond # process.GlobalTag.globaltag = os.environ['TEST_GLOBAL_TAG'] + '::All' -process.GlobalTag.globaltag = '113X_mcRun4_realistic_v4' +#process.GlobalTag.globaltag = '120X_mcRun3_2021_realistic_v1' +process.GlobalTag.globaltag = '122X_mcRun4_realistic_v1' # process.GlobalTag.globaltag = '113X_mcRun3_2021_realistic_v4' # process.GlobalTag.globaltag = '93X_mc2017_realistic_v1' # process.GlobalTag.globaltag = '92X_upgrade2017_realistic_v10' @@ -102,7 +105,7 @@ process.EDM = cms.OutputModule("PoolOutputModule", outputCommands=cms.untracked.vstring('drop *', "keep *_MEtoEDMConverter_*_*"), - fileName=cms.untracked.string(os.environ['outputFile'].replace(".root", "_a.root")) + fileName=cms.untracked.string(os.environ['outputFile'])#.replace("_a.root", ".root")) # fileName = cms.untracked.string('electronHistos.ValFullZEEStartup_13_gedGsfE_a.root') # for local run only ) @@ -114,4 +117,4 @@ process.outpath = cms.EndPath( process.EDM, -) \ No newline at end of file +) diff --git a/Validation/RecoEgamma/test/electronValidationCheck_Env.py b/Validation/RecoEgamma/test/electronValidationCheck_Env.py index 46b50f1dce084..126460ce4d889 100644 --- a/Validation/RecoEgamma/test/electronValidationCheck_Env.py +++ b/Validation/RecoEgamma/test/electronValidationCheck_Env.py @@ -29,7 +29,7 @@ def dd_tier(self): return dd_tier def tag_startup(self): - tag_startup = '113X_mcRun4_realistic_v4_2026D76noPU' + tag_startup = '122X_mcRun4_realistic_v1_2026D77noPU' # tag_startup = '113X_mcRun3_2021_realistic_v7' # tag_startup = '93X_upgrade2023_realistic_v2_2023D17PU140' # tag_startup = '93X_upgrade2023_realistic_v0_D17PU200' From 8ac476894e334e83b9105e0e154d52a7f6d02ee3 Mon Sep 17 00:00:00 2001 From: Chiron Date: Tue, 7 Dec 2021 16:52:23 +0100 Subject: [PATCH 3/8] Update ElectronMcSignalValidator.cc --- Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc index c797f5da745ed..a5037d7dbe24f 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc @@ -871,7 +871,7 @@ void ElectronMcSignalValidator::bookHistograms(DQMStore::IBooker &iBooker, edm:: "Events", "ELE_LOGY E1 P"); h1_ele_vertexPt_all = bookH1withSumw2( - iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events");//, "ELE_LOGY E1 P"); + iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events"); h1_ele_Et_all = bookH1withSumw2(iBooker, "Et_all", "ele ecal E_{T}, all reco electrons", @@ -888,8 +888,7 @@ void ElectronMcSignalValidator::bookHistograms(DQMStore::IBooker &iBooker, edm:: eta_min, eta_max, "", - "Events");//, - //"ELE_LOGY E1 P"); + "Events"); h1_ele_TIP_all = bookH1withSumw2(iBooker, "TIP_all", "ele vertex transverse radius, all reco electrons", From 88e87e4488424c0459af7fe0d7ea77979c622b39 Mon Sep 17 00:00:00 2001 From: Chiron Date: Tue, 7 Dec 2021 16:53:10 +0100 Subject: [PATCH 4/8] Update ElectronMcFakeValidator.cc --- Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc index fb0f2871cc5b5..d22f4b8051713 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc @@ -606,8 +606,7 @@ void ElectronMcFakeValidator::bookHistograms(DQMStore::IBooker &iBooker, edm::Ru eta_min, eta_max, "", - "Events");//, - //"ELE_LOGY E1 P"); + "Events"); h1_ele_vertexPt_all = bookH1withSumw2( iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events");//, "ELE_LOGY E1 P"); h1_ele_mee_all = bookH1withSumw2(iBooker, From 940128a56e59e565c492d5639c957048613e9e8a Mon Sep 17 00:00:00 2001 From: Chiron Date: Tue, 7 Dec 2021 16:53:38 +0100 Subject: [PATCH 5/8] Update ElectronMcFakeValidator.cc --- Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc index d22f4b8051713..02c594e913d3e 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc @@ -608,7 +608,7 @@ void ElectronMcFakeValidator::bookHistograms(DQMStore::IBooker &iBooker, edm::Ru "", "Events"); h1_ele_vertexPt_all = bookH1withSumw2( - iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events");//, "ELE_LOGY E1 P"); + iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events"); h1_ele_mee_all = bookH1withSumw2(iBooker, "mee_all", "ele pairs invariant mass, all reco electrons", From afde24579230c03e5e10c555327efc60fc0e6e93 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Tue, 7 Dec 2021 17:07:09 +0100 Subject: [PATCH 6/8] Tests_Reduction_V1 : plugins part, code-check corrections --- .../plugins/ElectronMcFakeValidator.cc | 23 ++++------- .../plugins/ElectronMcSignalValidator.cc | 40 +++++++------------ 2 files changed, 22 insertions(+), 41 deletions(-) diff --git a/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc index fb0f2871cc5b5..61462d9718f8d 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc @@ -2650,8 +2650,7 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event h1_scl_E1x5_barrel_->Fill(bestGsfElectron.scE1x5()); h1_scl_E2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max()); h1_scl_E5x5_barrel_->Fill(bestGsfElectron.scE5x5()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_scl_SigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta()); h1_scl_full5x5_sigmaIetaIeta_endcaps_->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); h1_scl_E1x5_endcaps_->Fill(bestGsfElectron.scE1x5()); @@ -2796,8 +2795,7 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h1_ele_HoE_bc_barrel->Fill(bestGsfElectron.hcalOverEcalBc()); h1_ele_HoE_barrel->Fill(bestGsfElectron.hadronicOverEm()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP()); h1_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP()); h1_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout()); @@ -2845,8 +2843,7 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event h1_ele_fbrem_barrel->Fill(fbrem_mode_barrel); double superclusterfbrem_mode_barrel = bestGsfElectron.superClusterFbrem(); h1_ele_superclusterfbrem_barrel->Fill(superclusterfbrem_mode_barrel); - } - else if (isEEflag) { + } else if (isEEflag) { double fbrem_mode_endcaps = bestGsfElectron.fbrem(); h1_ele_fbrem_endcaps->Fill(fbrem_mode_endcaps); double superclusterfbrem_mode_endcaps = bestGsfElectron.superClusterFbrem(); @@ -2885,14 +2882,13 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event if (bestGsfElectron.classification() == GsfElectron::SHOWERING) h2_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(), bestGsfElectron.trackMomentumAtVtx().R()); - + h1_ele_mva->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_isolated->Fill(bestGsfElectron.mva_Isolated()); if (isEBflag) { h1_ele_mva_barrel->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_barrel_isolated->Fill(bestGsfElectron.mva_Isolated()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_mva_endcaps->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_endcaps_isolated->Fill(bestGsfElectron.mva_Isolated()); } @@ -2936,8 +2932,7 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event h1_ele_chargedHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt); h1_ele_neutralHadronIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt); h1_ele_photonIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_chargedHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt); h1_ele_neutralHadronIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt); h1_ele_photonIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt); @@ -2956,8 +2951,7 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event bestGsfElectron.pt()); h1_ele_photonRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_chargedHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / bestGsfElectron.pt()); h1_ele_neutralHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / @@ -2994,8 +2988,7 @@ void ElectronMcFakeValidator::analyze(const edm::Event &iEvent, const edm::Event h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); h1_ele_hcalDepth1OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(1)); h1_ele_hcalDepth2OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(2)); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt()); h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); diff --git a/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc index c797f5da745ed..2dc2cbe457ec2 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc @@ -3595,14 +3595,13 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h2_ele_sigmaIetaIetaVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.scSigmaIEtaIEta()); h1_ele_ecalEnergyError->Fill(bestGsfElectron.correctedEcalEnergyError()); h1_ele_combinedP4Error->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION)); - if (isEBflag){ + if (isEBflag) { h1_ele_EtaMnEtaTrue_barrel->Fill(bestGsfElectron.eta() - mcIter->eta()); h1_ele_PhiMnPhiTrue_barrel->Fill(bestGsfElectron.phi() - mcIter->phi()); h1_ele_PoPtrue_barrel->Fill(bestGsfElectron.p() / mcIter->p()); h1_ele_PtoPttrue_barrel->Fill(bestGsfElectron.pt() / mcIter->pt()); h1_ele_combinedP4Error_barrel->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION)); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_EtaMnEtaTrue_endcaps->Fill(bestGsfElectron.eta() - mcIter->eta()); h1_ele_PhiMnPhiTrue_endcaps->Fill(bestGsfElectron.phi() - mcIter->phi()); h1_ele_PoPtrue_endcaps->Fill(bestGsfElectron.p() / mcIter->p()); @@ -3628,8 +3627,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve if (isEBflag) { h1_scl_EoEtrue_barrel->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); h1_scl_EoEtrue_barrel_new->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_scl_EoEtrue_endcaps->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); h1_scl_EoEtrue_endcaps_new->Fill(bestGsfElectron.ecalEnergy() / mcIter->p()); } @@ -3675,8 +3673,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_scl_E1x5_barrel->Fill(bestGsfElectron.scE1x5()); h1_scl_E2x5max_barrel->Fill(bestGsfElectron.scE2x5Max()); h1_scl_E5x5_barrel->Fill(bestGsfElectron.scE5x5()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_scl_SigEtaEta_endcaps->Fill(bestGsfElectron.scSigmaEtaEta()); h1_scl_SigIEtaIEta_endcaps->Fill(bestGsfElectron.scSigmaIEtaIEta()); h1_scl_full5x5_sigmaIetaIeta_endcaps->Fill(bestGsfElectron.full5x5_sigmaIetaIeta()); @@ -3735,13 +3732,12 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_ele_foundHits_barrel->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits()); h1_ele_lostHits_barrel->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits()); h1_ele_chi2_barrel->Fill(bestGsfElectron.gsfTrack()->normalizedChi2()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_foundHits_endcaps->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits()); h1_ele_lostHits_endcaps->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits()); h1_ele_chi2_endcaps->Fill(bestGsfElectron.gsfTrack()->normalizedChi2()); } - + if (passMiniAODSelection) { // Pt > 5. h2_ele_foundHitsVsEta_mAOD->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits()); } @@ -3870,8 +3866,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo()); h1_ele_HoE_bc_barrel->Fill(bestGsfElectron.hcalOverEcalBc()); h1_ele_HoE_barrel->Fill(bestGsfElectron.hcalOverEcal()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP()); h1_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP()); h1_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout()); @@ -3894,8 +3889,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_ele_dEtaSc_propVtx_mAOD_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); h1_ele_dPhiCl_propOut_mAOD_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h1_ele_HoE_mAOD_barrel->Fill(bestGsfElectron.hcalOverEcal()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_dEtaSc_propVtx_mAOD_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx()); h1_ele_dPhiCl_propOut_mAOD_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo()); h1_ele_HoE_mAOD_endcaps->Fill(bestGsfElectron.hcalOverEcal()); @@ -3946,8 +3940,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve if (passMiniAODSelection) { // Pt > 5. h1_ele_fbrem_mAOD_barrel->Fill(fbrem_mode_barrel); } - } - else if (isEEflag) { + } else if (isEEflag) { double fbrem_mode_endcaps = bestGsfElectron.fbrem(); h1_ele_fbrem_endcaps->Fill(fbrem_mode_endcaps); if (passMiniAODSelection) { // Pt > 5. @@ -3961,8 +3954,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve if (isEBflag) { double superclusterfbrem_mode_barrel = bestGsfElectron.superClusterFbrem(); h1_ele_superclusterfbrem_barrel->Fill(superclusterfbrem_mode_barrel); - } - else if (isEEflag) { + } else if (isEEflag) { double superclusterfbrem_mode_endcaps = bestGsfElectron.superClusterFbrem(); h1_ele_superclusterfbrem_endcaps->Fill(superclusterfbrem_mode_endcaps); } @@ -4015,8 +4007,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve if (isEBflag) { h1_ele_mva_barrel->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_barrel_isolated->Fill(bestGsfElectron.mva_Isolated()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_mva_endcaps->Fill(bestGsfElectron.mva_e_pi()); h1_ele_mva_endcaps_isolated->Fill(bestGsfElectron.mva_Isolated()); } @@ -4087,8 +4078,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_ele_neutralHadronRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / bestGsfElectron.pt()); h1_ele_photonRelativeIso_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_chargedHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / bestGsfElectron.pt()); h1_ele_neutralHadronRelativeIso_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / @@ -4108,8 +4098,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve bestGsfElectron.pt()); h1_ele_photonRelativeIso_mAOD_barrel->Fill(bestGsfElectron.pfIsolationVariables().sumPhotonEt / bestGsfElectron.pt()); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_chargedHadronRelativeIso_mAOD_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumChargedHadronPt / bestGsfElectron.pt()); h1_ele_neutralHadronRelativeIso_mAOD_endcaps->Fill(bestGsfElectron.pfIsolationVariables().sumNeutralHadronEt / @@ -4149,8 +4138,7 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_ele_hcalTowerSumEtBc_dr04_depth2_barrel->Fill(bestGsfElectron.dr04HcalTowerSumEtBc(2)); h1_ele_hcalDepth1OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(1)); h1_ele_hcalDepth2OverEcalBc_barrel->Fill(bestGsfElectron.hcalOverEcalBc(2)); - } - else if (isEEflag) { + } else if (isEEflag) { h1_ele_tkSumPt_dr03_endcaps->Fill(bestGsfElectron.dr03TkSumPt()); h1_ele_ecalRecHitSumEt_dr03_endcaps->Fill(bestGsfElectron.dr03EcalRecHitSumEt()); h1_ele_hcalTowerSumEt_dr03_depth1_endcaps->Fill(bestGsfElectron.dr03HcalTowerSumEt(1)); From 384e7d1191b179763109f30fb8bf7302d47b0142 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Tue, 7 Dec 2021 17:08:42 +0100 Subject: [PATCH 7/8] Tests_Reduction_V1 : plugins part, code-check corrections --- .../RecoEgamma/plugins/ElectronMcFakeValidator.cc | 14 ++++---------- .../plugins/ElectronMcSignalValidator.cc | 14 ++++---------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc index 85e5373bbafe6..dcb961c7dd9b4 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcFakeValidator.cc @@ -599,16 +599,10 @@ void ElectronMcFakeValidator::bookHistograms(DQMStore::IBooker &iBooker, edm::Ru "H/E", "Events", "ELE_LOGY E1 P"); - h1_ele_vertexEta_all = bookH1withSumw2(iBooker, - "vertexEta_all", - "ele eta, all reco electrons", - eta_nbin, - eta_min, - eta_max, - "", - "Events"); - h1_ele_vertexPt_all = bookH1withSumw2( - iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events"); + h1_ele_vertexEta_all = bookH1withSumw2( + iBooker, "vertexEta_all", "ele eta, all reco electrons", eta_nbin, eta_min, eta_max, "", "Events"); + h1_ele_vertexPt_all = + bookH1withSumw2(iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events"); h1_ele_mee_all = bookH1withSumw2(iBooker, "mee_all", "ele pairs invariant mass, all reco electrons", diff --git a/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc index b08a5aa322c7e..79a41a4e89bb6 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc @@ -870,8 +870,8 @@ void ElectronMcSignalValidator::bookHistograms(DQMStore::IBooker &iBooker, edm:: "H/E", "Events", "ELE_LOGY E1 P"); - h1_ele_vertexPt_all = bookH1withSumw2( - iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events"); + h1_ele_vertexPt_all = + bookH1withSumw2(iBooker, "vertexPt_all", "ele p_{T}, all reco electrons", pteff_nbin, 5., pt_max, "", "Events"); h1_ele_Et_all = bookH1withSumw2(iBooker, "Et_all", "ele ecal E_{T}, all reco electrons", @@ -881,14 +881,8 @@ void ElectronMcSignalValidator::bookHistograms(DQMStore::IBooker &iBooker, edm:: "E_{T} (GeV)", "Events", "ELE_LOGY E1 P"); - h1_ele_vertexEta_all = bookH1withSumw2(iBooker, - "vertexEta_all", - "ele eta, all reco electrons", - eta_nbin, - eta_min, - eta_max, - "", - "Events"); + h1_ele_vertexEta_all = bookH1withSumw2( + iBooker, "vertexEta_all", "ele eta, all reco electrons", eta_nbin, eta_min, eta_max, "", "Events"); h1_ele_TIP_all = bookH1withSumw2(iBooker, "TIP_all", "ele vertex transverse radius, all reco electrons", From 30ff4cec849fdf57450dc93d708dc1e2b484ec16 Mon Sep 17 00:00:00 2001 From: Chiron Date: Wed, 8 Dec 2021 14:05:44 +0100 Subject: [PATCH 8/8] Update ElectronMcSignalValidator.cc move h1_ele_ecalEnergyError_barrel->Fill(bestGsfElectron.correctedEcalEnergyError()); line which was in isEEflag test instead of isEBflag test. --- Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc b/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc index 79a41a4e89bb6..b15a26e0aef77 100644 --- a/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc +++ b/Validation/RecoEgamma/plugins/ElectronMcSignalValidator.cc @@ -3593,13 +3593,13 @@ void ElectronMcSignalValidator::analyze(const edm::Event &iEvent, const edm::Eve h1_ele_PhiMnPhiTrue_barrel->Fill(bestGsfElectron.phi() - mcIter->phi()); h1_ele_PoPtrue_barrel->Fill(bestGsfElectron.p() / mcIter->p()); h1_ele_PtoPttrue_barrel->Fill(bestGsfElectron.pt() / mcIter->pt()); + h1_ele_ecalEnergyError_barrel->Fill(bestGsfElectron.correctedEcalEnergyError()); h1_ele_combinedP4Error_barrel->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION)); } else if (isEEflag) { h1_ele_EtaMnEtaTrue_endcaps->Fill(bestGsfElectron.eta() - mcIter->eta()); h1_ele_PhiMnPhiTrue_endcaps->Fill(bestGsfElectron.phi() - mcIter->phi()); h1_ele_PoPtrue_endcaps->Fill(bestGsfElectron.p() / mcIter->p()); h1_ele_PtoPttrue_endcaps->Fill(bestGsfElectron.pt() / mcIter->pt()); - h1_ele_ecalEnergyError_barrel->Fill(bestGsfElectron.correctedEcalEnergyError()); h1_ele_ecalEnergyError_endcaps->Fill(bestGsfElectron.correctedEcalEnergyError()); h1_ele_combinedP4Error_endcaps->Fill(bestGsfElectron.p4Error(bestGsfElectron.P4_COMBINATION)); }