diff --git a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc index 48fd0656704c7..e2cad868ccab1 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc @@ -69,8 +69,8 @@ class CacheData { config.outputDim = pset_dnn.getParameter("outputDim"); const auto useEBModelInGap = pset_dnn.getParameter("useEBModelInGap"); photonDNNEstimator = std::make_unique(config, useEBModelInGap); - ///for MVA based beam halo tagger in the EE } + ///for MVA based beam halo tagger in the EE const auto runMVABasedHaloTagger = conf.getParameter("runMVABasedHaloTagger"); edm::ParameterSet mvaBasedHaloVariableSet = conf.getParameter("mvaBasedHaloVariableSet"); auto trainingFileName_ = mvaBasedHaloVariableSet.getParameter(("trainingFileName")).fullPath(); diff --git a/RecoEgamma/PhotonIdentification/interface/PhotonMVABasedHaloTagger.h b/RecoEgamma/PhotonIdentification/interface/PhotonMVABasedHaloTagger.h index 1942a6d1a6e8a..935bd9e5fead4 100644 --- a/RecoEgamma/PhotonIdentification/interface/PhotonMVABasedHaloTagger.h +++ b/RecoEgamma/PhotonIdentification/interface/PhotonMVABasedHaloTagger.h @@ -33,7 +33,6 @@ class PhotonMVABasedHaloTagger { const edm::Event& iEvent, const edm::EventSetup& es); - private: void calphoClusCoordinECAL(const CaloGeometry* geo, const reco::Photon*, @@ -50,7 +49,6 @@ class PhotonMVABasedHaloTagger { double calAngleBetweenEEAndSubDet(int nhits, double subdetClusX, double subdetClusY, double subdetClusZ); - int hcalClusNhits_samedPhi_, hcalClusNhits_samedR_; int ecalClusNhits_, preshowerNhits_samedPhi_, preshowerNhits_samedR_; double hcalClusX_samedPhi_, hcalClusY_samedPhi_, hcalClusZ_samedPhi_, hcalClusX_samedR_, hcalClusY_samedR_, @@ -78,16 +76,15 @@ class PhotonMVABasedHaloTagger { edm::EDGetTokenT HBHERecHitsCollection_; ///values of dR etc to cluster the hits in various sub-detectors - static constexpr float dr2Max_ECALClus_ = 0.2*0.2; - static constexpr float rho2Min_ECALpos_ = 31 * 31; //cm - static constexpr float rho2Max_ECALpos_ = 172 * 172; //cm - static constexpr float dRho2Max_HCALClus_SamePhi_ = 26 * 26; //cm + static constexpr float dr2Max_ECALClus_ = 0.2 * 0.2; + static constexpr float rho2Min_ECALpos_ = 31 * 31; //cm + static constexpr float rho2Max_ECALpos_ = 172 * 172; //cm + static constexpr float dRho2Max_HCALClus_SamePhi_ = 26 * 26; //cm static constexpr float dPhiMax_HCALClus_SamePhi_ = 0.15; static constexpr float dR2Max_HCALClus_SamePhi_ = 0.15 * 0.15; - static constexpr float dRho2Max_ESClus_ = 2.2 * 2.2; //cm - static constexpr float dXY_ESClus_SamePhi_ = 1; ///cm - static constexpr float dXY_ESClus_SamedR_ = 1; ///cm - + static constexpr float dRho2Max_ESClus_ = 2.2 * 2.2; //cm + static constexpr float dXY_ESClus_SamePhi_ = 1; ///cm + static constexpr float dXY_ESClus_SamedR_ = 1; ///cm }; #endif // PhotonMVABasedHaloTagger_H diff --git a/RecoEgamma/PhotonIdentification/src/PhotonMVABasedHaloTagger.cc b/RecoEgamma/PhotonIdentification/src/PhotonMVABasedHaloTagger.cc index a5a642555aff5..ce78c50564a19 100644 --- a/RecoEgamma/PhotonIdentification/src/PhotonMVABasedHaloTagger.cc +++ b/RecoEgamma/PhotonIdentification/src/PhotonMVABasedHaloTagger.cc @@ -206,9 +206,10 @@ void PhotonMVABasedHaloTagger::calmatchedHBHECoordForBothHypothesis(const CaloGe int depth = det.depth(); if ((det.subdet() == HcalBarrel and (depth < 1 or depth > int(recHitEThresholdHB_.size()))) or - (det.subdet() == HcalEndcap and (depth < 1 or depth > int(recHitEThresholdHE_.size())))){ + (det.subdet() == HcalEndcap and (depth < 1 or depth > int(recHitEThresholdHE_.size())))) { edm::LogWarning("PhotonMVABasedHaloTagger") - << " hit in subdet " << det.subdet() << " has an unaccounted for depth of " << depth << "!! Leaving this hit!!"; + << " hit in subdet " << det.subdet() << " has an unaccounted for depth of " << depth + << "!! Leaving this hit!!"; continue; } @@ -226,9 +227,10 @@ void PhotonMVABasedHaloTagger::calmatchedHBHECoordForBothHypothesis(const CaloGe bool isRHBehindECAL = false; double dRho2 = pow(rhX - ecalClusX_, 2) + pow(rhY - ecalClusY_, 2); - + ///only valid for the EE; this is 26 cm; hit within 3x3 of HCAL centered at the EECAL xtal - if (rho2 >= rho2Min_ECALpos_ && rho2 <= rho2Max_ECALpos_ && dRho2 <= dRho2Max_HCALClus_SamePhi_ && std::abs(dPhi) < dPhiMax_HCALClus_SamePhi_) { + if (rho2 >= rho2Min_ECALpos_ && rho2 <= rho2Max_ECALpos_ && dRho2 <= dRho2Max_HCALClus_SamePhi_ && + std::abs(dPhi) < dPhiMax_HCALClus_SamePhi_) { hcalClusX_samedPhi_ += rhX * rhE; hcalClusY_samedPhi_ += rhY * rhE; hcalClusZ_samedPhi_ += rhZ * rhE; @@ -240,7 +242,8 @@ void PhotonMVABasedHaloTagger::calmatchedHBHECoordForBothHypothesis(const CaloGe double dR2 = reco::deltaR2(phoSCEta, phoSCPhi, rhEta, rhPhi); - if (dR2 < dR2Max_HCALClus_SamePhi_ && !isRHBehindECAL) { ///dont use hits which are just behind the ECAL in the same phi region + if (dR2 < dR2Max_HCALClus_SamePhi_ && + !isRHBehindECAL) { ///dont use hits which are just behind the ECAL in the same phi region hcalClusX_samedR_ += rhX * rhE; hcalClusY_samedR_ += rhY * rhE; hcalClusZ_samedR_ += rhZ * rhE; @@ -320,7 +323,6 @@ void PhotonMVABasedHaloTagger::calmatchedESCoordForBothHypothesis(const CaloGeom double dRho2 = pow(rhX - ecalClusX_, 2) + pow(rhY - ecalClusY_, 2); if (dRho2 < tmpDiffdRho && dRho2 < dRho2Max_ESClus_) { - tmpDiffdRho = dRho2; matchX_samephi = rhX; matchY_samephi = rhY;