diff --git a/Validation/RecoEgamma/plugins/PhotonValidator.cc b/Validation/RecoEgamma/plugins/PhotonValidator.cc index c2d35d267bcd7..a9839fa778fcf 100644 --- a/Validation/RecoEgamma/plugins/PhotonValidator.cc +++ b/Validation/RecoEgamma/plugins/PhotonValidator.cc @@ -152,6 +152,8 @@ PhotonValidator::PhotonValidator(const edm::ParameterSet& pset) nRecConvAss_ = 0; nRecConvAssWithEcal_ = 0; nInvalidPCA_ = 0; + + } PhotonValidator::~PhotonValidator() {} @@ -1190,11 +1192,11 @@ void PhotonValidator::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& // histname = "ecalRecHitSumEtConeDR04"; h_ecalRecHitSumEtConeDR04_[0][0] = - iBooker.book1D(histname + "All", "ecalRecHitSumEtDR04: All Ecal", etBin, etMin, 20.); + iBooker.book1D(histname + "All", "ecalRecHitSumEtDR04: All Ecal", etBin, etMin, 50.); h_ecalRecHitSumEtConeDR04_[0][1] = - iBooker.book1D(histname + "Barrel", "ecalRecHitSumEtDR04: Barrel ", etBin, etMin, 20.); + iBooker.book1D(histname + "Barrel", "ecalRecHitSumEtDR04: Barrel ", etBin, etMin, 50.); h_ecalRecHitSumEtConeDR04_[0][2] = - iBooker.book1D(histname + "Endcap", "ecalRecHitSumEtDR04: Endcap ", etBin, etMin, 20.); + iBooker.book1D(histname + "Endcap", "ecalRecHitSumEtDR04: Endcap ", etBin, etMin, 50.); // if (!isRunCentrally_) { @@ -1295,20 +1297,20 @@ void PhotonValidator::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& // histname = "hcalTowerSumEtConeDR04"; h_hcalTowerSumEtConeDR04_[0][0] = - iBooker.book1D(histname + "All", "hcalTowerSumEtConeDR04: All Ecal", etBin, etMin, 20.); + iBooker.book1D(histname + "All", "hcalTowerSumEtConeDR04: All Ecal", etBin, etMin, 50.); h_hcalTowerSumEtConeDR04_[0][1] = - iBooker.book1D(histname + "Barrel", "hcalTowerSumEtConeDR04: Barrel ", etBin, etMin, 20.); + iBooker.book1D(histname + "Barrel", "hcalTowerSumEtConeDR04: Barrel ", etBin, etMin, 50.); h_hcalTowerSumEtConeDR04_[0][2] = - iBooker.book1D(histname + "Endcap", "hcalTowerSumEtConeDR04: Endcap ", etBin, etMin, 20.); + iBooker.book1D(histname + "Endcap", "hcalTowerSumEtConeDR04: Endcap ", etBin, etMin, 50.); // histname = "hcalTowerBcSumEtConeDR04"; if (!isRunCentrally_) h_hcalTowerBcSumEtConeDR04_[0][0] = - iBooker.book1D(histname + "All", "hcalTowerBcSumEtConeDR04: All Ecal", etBin, etMin, 20.); + iBooker.book1D(histname + "All", "hcalTowerBcSumEtConeDR04: All Ecal", etBin, etMin, 50.); h_hcalTowerBcSumEtConeDR04_[0][1] = - iBooker.book1D(histname + "Barrel", "hcalTowerBcSumEtConeDR04: Barrel ", etBin, etMin, 20.); + iBooker.book1D(histname + "Barrel", "hcalTowerBcSumEtConeDR04: Barrel ", etBin, etMin, 50.); h_hcalTowerBcSumEtConeDR04_[0][2] = - iBooker.book1D(histname + "Endcap", "hcalTowerBcSumEtConeDR04: Endcap ", etBin, etMin, 20.); + iBooker.book1D(histname + "Endcap", "hcalTowerBcSumEtConeDR04: Endcap ", etBin, etMin, 50.); // if (!isRunCentrally_) { @@ -2032,11 +2034,15 @@ void PhotonValidator::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& iBooker.book1D(histname + "Barrel", "dR(pho,cand) Neutral Hadrons : Barrel", etBin, etMin, 0.7); h_dRPhoPFcand_NeuHad_Cleaned_[2] = iBooker.book1D(histname + "Endcap", "dR(pho,cand) Neutral Hadrons : Endcap", etBin, etMin, 0.7); + h_dRPhoPFcand_NeuHad_Cleaned_[3] = + iBooker.book1D(histname + "Barrel_1", "dR(pho,cand) Neutral Hadrons : Barrel |eta| <=1", etBin, etMin, 0.7); + h_dRPhoPFcand_NeuHad_Cleaned_[4] = + iBooker.book1D(histname + "Barrel_2", "dR(pho,cand) Neutral Hadrons : Barrel |eta | > 1", etBin, etMin, 0.7); histname = "dRPhoPFcand_Pho_Cleaned"; h_dRPhoPFcand_Pho_Cleaned_[0] = - iBooker.book1D(histname + "All", "dR(pho,cand) Photons : All Ecal", etBin, etMin, 0.7); + iBooker.book1D(histname + "All", "dR(pho,cand) Photons : All Ecal", etBin, etMin, 0.7); h_dRPhoPFcand_Pho_Cleaned_[1] = - iBooker.book1D(histname + "Barrel", "dR(pho,cand) Photons : Barrel", etBin, etMin, 0.7); + iBooker.book1D(histname + "Barrel", "dR(pho,cand) Photons : Barrel", etBin, etMin, 0.7); h_dRPhoPFcand_Pho_Cleaned_[2] = iBooker.book1D(histname + "Endcap", "dR(pho,cand) Photons : Endcap", etBin, etMin, 0.7); @@ -2069,6 +2075,7 @@ void PhotonValidator::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& iBooker.book1D(histname + "Barrel", "dR(pho,cand) Charged Hadrons : Barrel", etBin, etMin, 0.7); h_dRPhoPFcand_ChHad_unCleaned_[2] = iBooker.book1D(histname + "Endcap", "dR(pho,cand) Charged Hadrons : Endcap", etBin, etMin, 0.7); + histname = "dRPhoPFcand_NeuHad_unCleaned"; h_dRPhoPFcand_NeuHad_unCleaned_[0] = iBooker.book1D(histname + "All", "dR(pho,cand) Neutral Hadrons : All Ecal", etBin, etMin, 0.7); @@ -2076,6 +2083,12 @@ void PhotonValidator::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& iBooker.book1D(histname + "Barrel", "dR(pho,cand) Neutral Hadrons : Barrel", etBin, etMin, 0.7); h_dRPhoPFcand_NeuHad_unCleaned_[2] = iBooker.book1D(histname + "Endcap", "dR(pho,cand) Neutral Hadrons : Endcap", etBin, etMin, 0.7); + h_dRPhoPFcand_NeuHad_unCleaned_[3] = + iBooker.book1D(histname + "Barrel_1", "dR(pho,cand) Neutral Hadrons : Barrel |eta| <=1 ", etBin, etMin, 0.7); + h_dRPhoPFcand_NeuHad_unCleaned_[4] = + iBooker.book1D(histname + "Barrel_2", "dR(pho,cand) Neutral Hadrons : Barrel |eta| > 1", etBin, etMin, 0.7); + + histname = "dRPhoPFcand_Pho_unCleaned"; h_dRPhoPFcand_Pho_unCleaned_[0] = iBooker.book1D(histname + "All", "dR(pho,cand) Photons: All Ecal", etBin, etMin, 0.7); @@ -2257,26 +2270,26 @@ void PhotonValidator::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& // histname = "ecalRecHitSumEtConeDR04"; h_ecalRecHitSumEtConeDR04_miniAOD_[0][0] = - iBooker.book1D(histname + "All_miniAOD", "ecalRecHitSumEtDR04: All Ecal", etBin, etMin, 20.); + iBooker.book1D(histname + "All_miniAOD", "ecalRecHitSumEtDR04: All Ecal", etBin, etMin, 50.); h_ecalRecHitSumEtConeDR04_miniAOD_[0][1] = - iBooker.book1D(histname + "Barrel_miniAOD", "ecalRecHitSumEtDR04: Barrel ", etBin, etMin, 20.); + iBooker.book1D(histname + "Barrel_miniAOD", "ecalRecHitSumEtDR04: Barrel ", etBin, etMin, 50.); h_ecalRecHitSumEtConeDR04_miniAOD_[0][2] = - iBooker.book1D(histname + "Endcap_miniAOD", "ecalRecHitSumEtDR04: Endcap ", etBin, etMin, 20.); + iBooker.book1D(histname + "Endcap_miniAOD", "ecalRecHitSumEtDR04: Endcap ", etBin, etMin, 50.); histname = "hcalTowerSumEtConeDR04"; h_hcalTowerSumEtConeDR04_miniAOD_[0][0] = - iBooker.book1D(histname + "All_miniAOD", "hcalTowerSumEtConeDR04: All Ecal", etBin, etMin, 20.); + iBooker.book1D(histname + "All_miniAOD", "hcalTowerSumEtConeDR04: All Ecal", etBin, etMin, 50.); h_hcalTowerSumEtConeDR04_miniAOD_[0][1] = - iBooker.book1D(histname + "Barrel_miniAOD", "hcalTowerSumEtConeDR04: Barrel ", etBin, etMin, 20.); + iBooker.book1D(histname + "Barrel_miniAOD", "hcalTowerSumEtConeDR04: Barrel ", etBin, etMin, 50.); h_hcalTowerSumEtConeDR04_miniAOD_[0][2] = - iBooker.book1D(histname + "Endcap_miniAOD", "hcalTowerSumEtConeDR04: Endcap ", etBin, etMin, 20.); + iBooker.book1D(histname + "Endcap_miniAOD", "hcalTowerSumEtConeDR04: Endcap ", etBin, etMin, 50.); // histname = "hcalTowerBcSumEtConeDR04"; h_hcalTowerBcSumEtConeDR04_miniAOD_[0][0] = - iBooker.book1D(histname + "All_miniAOD", "hcalTowerBcSumEtConeDR04: All Ecal", etBin, etMin, 20.); + iBooker.book1D(histname + "All_miniAOD", "hcalTowerBcSumEtConeDR04: All Ecal", etBin, etMin, 50.); h_hcalTowerBcSumEtConeDR04_miniAOD_[0][1] = - iBooker.book1D(histname + "Barrel_miniAOD", "hcalTowerBcSumEtConeDR04: Barrel ", etBin, etMin, 20.); + iBooker.book1D(histname + "Barrel_miniAOD", "hcalTowerBcSumEtConeDR04: Barrel ", etBin, etMin, 50.); h_hcalTowerBcSumEtConeDR04_miniAOD_[0][2] = - iBooker.book1D(histname + "Endcap_miniAOD", "hcalTowerBcSumEtConeDR04: Endcap ", etBin, etMin, 20.); + iBooker.book1D(histname + "Endcap_miniAOD", "hcalTowerBcSumEtConeDR04: Endcap ", etBin, etMin, 50.); histname = "isoTrkSolidConeDR04"; h_isoTrkSolidConeDR04_miniAOD_[0][0] = iBooker.book1D(histname + "All_miniAOD", "isoTrkSolidConeDR04: All Ecal", etBin, etMin, etMax * 0.1); @@ -3162,9 +3175,14 @@ void PhotonValidator::dqmBeginRun(edm::Run const& r, edm::EventSetup const& theE theMF_ = theEventSetup.getHandle(magneticFieldToken_); thePhotonMCTruthFinder_ = std::make_unique(); + + + } -void PhotonValidator::dqmEndRun(edm::Run const& r, edm::EventSetup const&) { thePhotonMCTruthFinder_.reset(); } +void PhotonValidator::dqmEndRun(edm::Run const& r, edm::EventSetup const&) { + +thePhotonMCTruthFinder_.reset(); } void PhotonValidator::analyze(const edm::Event& e, const edm::EventSetup& esup) { thePhotonMCTruthFinder_->clear(); @@ -3570,6 +3588,8 @@ void PhotonValidator::analyze(const edm::Event& e, const edm::EventSetup& esup) } // } + + for (std::vector::const_iterator mcPho = mcPhotons.begin(); mcPho != mcPhotons.end(); mcPho++) { if ((*mcPho).fourMomentum().et() < minPhoEtCut_) continue; @@ -3591,6 +3611,8 @@ void PhotonValidator::analyze(const edm::Event& e, const edm::EventSetup& esup) mcPhi_ = phiNormalization(mcPhi); mcEta_ = (*mcPho).fourMomentum().pseudoRapidity(); mcEta_ = etaTransformation(mcEta_, (*mcPho).primaryVertex().z()); + + mcConvR_ = (*mcPho).vertex().perp(); mcConvX_ = (*mcPho).vertex().x(); mcConvY_ = (*mcPho).vertex().y(); @@ -3724,7 +3746,9 @@ void PhotonValidator::analyze(const edm::Event& e, const edm::EventSetup& esup) if (!matched) continue; - bool phoIsInBarrel = false; + bool phoIsInBarrel = false; // full barrel + bool phoIsInBarrel1 = false; // |eta| <=1 + bool phoIsInBarrel2 = false; // |eta| >1 bool phoIsInEndcap = false; bool phoIsInEndcapP = false; bool phoIsInEndcapM = false; @@ -3740,6 +3764,14 @@ void PhotonValidator::analyze(const edm::Event& e, const edm::EventSetup& esup) if (matchingPho->superCluster()->position().eta() < 0) phoIsInEndcapM = true; } + if ( fabs(matchingPho->superCluster()->position().eta()) <= 1) { + phoIsInBarrel1 = true; + } else if ( fabs(matchingPho->superCluster()->position().eta()) > 1 ) { + phoIsInBarrel2 = true; + } + + + edm::Handle ecalRecHitHandle; if (phoIsInBarrel) { @@ -4174,12 +4206,20 @@ void PhotonValidator::analyze(const edm::Event& e, const edm::EventSetup& esup) if (type == reco::PFCandidate::h0) { SumPtIsoValNh += pfCandRef->pt(); h_dRPhoPFcand_NeuHad_unCleaned_[0]->Fill(dR); - if (phoIsInBarrel) + if (phoIsInBarrel) { h_dRPhoPFcand_NeuHad_unCleaned_[1]->Fill(dR); - else - h_dRPhoPFcand_NeuHad_unCleaned_[2]->Fill(dR); - } - if (type == reco::PFCandidate::gamma) { + if (phoIsInBarrel1) { + h_dRPhoPFcand_NeuHad_unCleaned_[3]->Fill(dR); + } + if (phoIsInBarrel2) { + h_dRPhoPFcand_NeuHad_unCleaned_[4]->Fill(dR); + } + } else { + h_dRPhoPFcand_NeuHad_Cleaned_[2]->Fill(dR); + } + } + + if (type == reco::PFCandidate::gamma) { SumPtIsoValPh += pfCandRef->pt(); h_dRPhoPFcand_Pho_unCleaned_[0]->Fill(dR); if (phoIsInBarrel) @@ -4187,7 +4227,8 @@ void PhotonValidator::analyze(const edm::Event& e, const edm::EventSetup& esup) else h_dRPhoPFcand_Pho_unCleaned_[2]->Fill(dR); } - ////////// acces the value map to access the PFCandidates in overlap with the photon which need to be excluded from the isolation + + ////////// acces the value map to access the PFCandidates in overlap with the photon which need to be excluded from the isolation bool skip = false; for (std::vector::const_iterator i = phoToParticleBasedIsoMap[matchingPho].begin(); i != phoToParticleBasedIsoMap[matchingPho].end(); @@ -4197,6 +4238,7 @@ void PhotonValidator::analyze(const edm::Event& e, const edm::EventSetup& esup) } } // loop over the PFCandidates flagged as overlapping with the photon + if (skip) continue; if (type == reco::PFCandidate::h) { @@ -4210,11 +4252,18 @@ void PhotonValidator::analyze(const edm::Event& e, const edm::EventSetup& esup) if (type == reco::PFCandidate::h0) { SumPtIsoValCleanNh += pfCandRef->pt(); h_dRPhoPFcand_NeuHad_Cleaned_[0]->Fill(dR); - if (phoIsInBarrel) + if (phoIsInBarrel) { h_dRPhoPFcand_NeuHad_Cleaned_[1]->Fill(dR); - else - h_dRPhoPFcand_NeuHad_Cleaned_[2]->Fill(dR); - } + if (phoIsInBarrel1) { + h_dRPhoPFcand_NeuHad_Cleaned_[3]->Fill(dR); + } + if (phoIsInBarrel2) { + h_dRPhoPFcand_NeuHad_Cleaned_[4]->Fill(dR); + } + } else { + h_dRPhoPFcand_NeuHad_Cleaned_[2]->Fill(dR); + } + } if (type == reco::PFCandidate::gamma) { SumPtIsoValCleanPh += pfCandRef->pt(); h_dRPhoPFcand_Pho_Cleaned_[0]->Fill(dR); @@ -4822,6 +4871,8 @@ void PhotonValidator::analyze(const edm::Event& e, const edm::EventSetup& esup) } // End loop over generated particles } // End loop over simulated Photons + + if (!isRunCentrally_) { h_nSimPho_[0]->Fill(float(nSimPho_[0])); h_nSimPho_[1]->Fill(float(nSimPho_[1])); @@ -5509,4 +5560,4 @@ float PhotonValidator::etaTransformation(float EtaParticle, float Zvertex) { //---Return the result return ETA; //---end -} \ No newline at end of file +} diff --git a/Validation/RecoEgamma/plugins/PhotonValidator.h b/Validation/RecoEgamma/plugins/PhotonValidator.h index d9aebd64718b0..57a8de334413a 100644 --- a/Validation/RecoEgamma/plugins/PhotonValidator.h +++ b/Validation/RecoEgamma/plugins/PhotonValidator.h @@ -77,6 +77,7 @@ class PhotonValidator : public DQMOneEDAnalyzer<> { std::string fName_; edm::ESHandle theMF_; + int verbosity_; int nEvt_; int nEntry_; @@ -343,10 +344,10 @@ class PhotonValidator : public DQMOneEDAnalyzer<> { MonitorElement* h_pfMva_[3]; //// particle based isolation from ValueMap MonitorElement* h_dRPhoPFcand_ChHad_Cleaned_[3]; - MonitorElement* h_dRPhoPFcand_NeuHad_Cleaned_[3]; + MonitorElement* h_dRPhoPFcand_NeuHad_Cleaned_[5]; MonitorElement* h_dRPhoPFcand_Pho_Cleaned_[3]; MonitorElement* h_dRPhoPFcand_ChHad_unCleaned_[3]; - MonitorElement* h_dRPhoPFcand_NeuHad_unCleaned_[3]; + MonitorElement* h_dRPhoPFcand_NeuHad_unCleaned_[5]; MonitorElement* h_dRPhoPFcand_Pho_unCleaned_[3]; MonitorElement* h_SumPtOverPhoPt_ChHad_Cleaned_[3]; MonitorElement* h_SumPtOverPhoPt_NeuHad_Cleaned_[3];