Skip to content

Commit

Permalink
second round of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jainshilpi committed Feb 27, 2022
1 parent b901548 commit 95736cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class CacheData {
config.outputDim = pset_dnn.getParameter<uint>("outputDim");
const auto useEBModelInGap = pset_dnn.getParameter<bool>("useEBModelInGap");
photonDNNEstimator = std::make_unique<PhotonDNNEstimator>(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<bool>("runMVABasedHaloTagger");
edm::ParameterSet mvaBasedHaloVariableSet = conf.getParameter<edm::ParameterSet>("mvaBasedHaloVariableSet");
auto trainingFileName_ = mvaBasedHaloVariableSet.getParameter<edm::FileInPath>(("trainingFileName")).fullPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class PhotonMVABasedHaloTagger {
const edm::Event& iEvent,
const edm::EventSetup& es);


private:
void calphoClusCoordinECAL(const CaloGeometry* geo,
const reco::Photon*,
Expand All @@ -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_,
Expand Down Expand Up @@ -78,16 +76,15 @@ class PhotonMVABasedHaloTagger {
edm::EDGetTokenT<HBHERecHitCollection> 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
14 changes: 8 additions & 6 deletions RecoEgamma/PhotonIdentification/src/PhotonMVABasedHaloTagger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 95736cc

Please sign in to comment.