Skip to content

Commit

Permalink
Code format checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jainshilpi committed Feb 7, 2022
1 parent 9317de2 commit fdcfde2
Show file tree
Hide file tree
Showing 6 changed files with 231 additions and 257 deletions.
6 changes: 2 additions & 4 deletions DataFormats/EgammaCandidates/interface/Photon.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,11 +581,9 @@ namespace reco {

///MVA based beam halo tagger - trained for EE and for pT > 200 GeV
float haloTaggerMVAVal() const { return haloTaggerMVAVal_; }

///set the haloTaggerMVAVal here
void setHaloTaggerMVAVal(float x) {
haloTaggerMVAVal_ = x;
}
void setHaloTaggerMVAVal(float x) { haloTaggerMVAVal_ = x; }

private:
/// check overlap with another candidate
Expand Down
10 changes: 7 additions & 3 deletions DataFormats/EgammaCandidates/src/Photon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
using namespace reco;

Photon::Photon(const LorentzVector& p4, const Point& caloPos, const PhotonCoreRef& core, const Point& vtx)
: RecoCandidate(0, p4, vtx, 22), caloPosition_(caloPos), photonCore_(core), pixelSeed_(false),haloTaggerMVAVal_(-999) {}
: RecoCandidate(0, p4, vtx, 22),
caloPosition_(caloPos),
photonCore_(core),
pixelSeed_(false),
haloTaggerMVAVal_(-999) {}

Photon::Photon(const Photon& rhs)
: RecoCandidate(rhs),
Expand All @@ -19,8 +23,8 @@ Photon::Photon(const Photon& rhs)
saturationInfo_(rhs.saturationInfo_),
eCorrections_(rhs.eCorrections_),
mipVariableBlock_(rhs.mipVariableBlock_),
pfIsolation_(rhs.pfIsolation_),
haloTaggerMVAVal_(rhs.haloTaggerMVAVal_) {}
pfIsolation_(rhs.pfIsolation_),
haloTaggerMVAVal_(rhs.haloTaggerMVAVal_) {}

Photon::~Photon() {}

Expand Down
6 changes: 3 additions & 3 deletions RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ GEDPhotonProducer::GEDPhotonProducer(const edm::ParameterSet& config, const Cach

if (recoStep_.isFinal() && runMVABasedHaloTagger_) {
edm::ParameterSet mvaBasedHaloVariableSet = config.getParameter<edm::ParameterSet>("mvaBasedHaloVariableSet");
photonMVABasedHaloTagger_ = std::make_unique<PhotonMVABasedHaloTagger>(mvaBasedHaloVariableSet, consumesCollector());

photonMVABasedHaloTagger_ =
std::make_unique<PhotonMVABasedHaloTagger>(mvaBasedHaloVariableSet, consumesCollector());
}

///Get the set for PF cluster isolation calculator
Expand Down Expand Up @@ -1068,7 +1068,7 @@ void GEDPhotonProducer::fillPhotonCollection(edm::Event& evt,
reco::Photon newCandidate(*phoRef);
iSC++;

if (runMVABasedHaloTagger_) { ///sets values only for EE, for EB it always returns 1
if (runMVABasedHaloTagger_) { ///sets values only for EE, for EB it always returns 1
float BHmva = photonMVABasedHaloTagger_->calculateMVA(&newCandidate, evt, es);
newCandidate.setHaloTaggerMVAVal(BHmva);
}
Expand Down
6 changes: 3 additions & 3 deletions RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ PhotonProducer::PhotonProducer(const edm::ParameterSet& config)

if (runMVABasedHaloTagger_) {
edm::ParameterSet mvaBasedHaloVariableSet = config.getParameter<edm::ParameterSet>("mvaBasedHaloVariableSet");
photonMVABasedHaloTagger_ = std::make_unique<PhotonMVABasedHaloTagger>(mvaBasedHaloVariableSet, consumesCollector());
photonMVABasedHaloTagger_ =
std::make_unique<PhotonMVABasedHaloTagger>(mvaBasedHaloVariableSet, consumesCollector());
}


// Register the product
produces<reco::PhotonCollection>(PhotonCollection_);
Expand Down Expand Up @@ -498,7 +498,7 @@ void PhotonProducer::fillPhotonCollection(edm::Event& evt,
newCandidate.setMIPVariables(mipVar);
}

if (runMVABasedHaloTagger_) { ///sets values only for EE, for EB it always returns 1
if (runMVABasedHaloTagger_) { ///sets values only for EE, for EB it always returns 1
double BHmva = photonMVABasedHaloTagger_->calculateMVA(&newCandidate, evt, es);
newCandidate.setHaloTaggerMVAVal(BHmva);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "CondFormats/GBRForest/interface/GBRForest.h"
#include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h"
#include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHcalIsolation.h"
#include "CondFormats/EcalObjects/interface/EcalPFRecHitThresholds.h"
#include "CondFormats/EcalObjects/interface/EcalPFRecHitThresholds.h"
#include "CondFormats/DataRecord/interface/EcalPFRecHitThresholdsRcd.h"
#include <vector>

Expand All @@ -29,64 +29,52 @@ class PhotonMVABasedHaloTagger {
PhotonMVABasedHaloTagger(const edm::ParameterSet& conf, edm::ConsumesCollector&& iC);
virtual ~PhotonMVABasedHaloTagger(){};

double calculateMVA(const reco::Photon* pho,
const edm::Event&iEvent,
const edm::EventSetup& es
);


double calculateMVA(const reco::Photon* pho, const edm::Event& iEvent, const edm::EventSetup& es);

void calphoClusCoordinECAL(const CaloGeometry* geo,
const reco::Photon*,
const EcalPFRecHitThresholds *thresholds,
edm::Handle<EcalRecHitCollection> ecalrechitCollHandle
);

const reco::Photon*,
const EcalPFRecHitThresholds* thresholds,
edm::Handle<EcalRecHitCollection> ecalrechitCollHandle);

void calmatchedHBHECoordForBothHypothesis(const CaloGeometry* geo,
const reco::Photon*,
edm::Handle<HBHERecHitCollection> hbheHitHandle
);


const reco::Photon*,
edm::Handle<HBHERecHitCollection> hbheHitHandle);

void calmatchedESCoordForBothHypothesis(const CaloGeometry* geo,
const reco::Photon*,
edm::Handle<EcalRecHitCollection> esrechitCollHandle
);

double calAngleBetweenEEAndSubDet(int nhits,
double subdetClusX,
double subdetClusY,
double subdetClusZ);

const reco::Photon*,
edm::Handle<EcalRecHitCollection> esrechitCollHandle);

double calAngleBetweenEEAndSubDet(int nhits, double subdetClusX, double subdetClusY, double subdetClusZ);

private:
int hcalClusNhits_samedPhi_, hcalClusNhits_samedR_;
int ecalClusNhits_, preshowerNhits_samedPhi_, preshowerNhits_samedR_;
double hcalClusX_samedPhi_, hcalClusY_samedPhi_, hcalClusZ_samedPhi_, hcalClusX_samedR_, hcalClusY_samedR_, hcalClusZ_samedR_;
int ecalClusNhits_, preshowerNhits_samedPhi_, preshowerNhits_samedR_;
double hcalClusX_samedPhi_, hcalClusY_samedPhi_, hcalClusZ_samedPhi_, hcalClusX_samedR_, hcalClusY_samedR_,
hcalClusZ_samedR_;
double hcalClusE_samedPhi_, hcalClusE_samedR_;

double ecalClusX_, ecalClusY_, ecalClusZ_;
double preshowerX_samedPhi_, preshowerY_samedPhi_, preshowerZ_samedPhi_, preshowerX_samedR_, preshowerY_samedR_, preshowerZ_samedR_;
double preshowerX_samedPhi_, preshowerY_samedPhi_, preshowerZ_samedPhi_, preshowerX_samedR_, preshowerY_samedR_,
preshowerZ_samedR_;
double ecalClusE_, preshowerE_samedPhi_, preshowerE_samedR_;
double noiseThrES_;

EgammaHcalIsolation::arrayHB recHitEThresholdHB_;
EgammaHcalIsolation::arrayHE recHitEThresholdHE_;

std::string trainingFileName_;
std::string trainingFileName_;

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geometryToken_;
const edm::ESGetToken<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd> ecalPFRechitThresholdsToken_;
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_;
edm::ESHandle<CaloGeometry> pG_;
edm::EDGetTokenT<double> rhoLabel_;

edm::ESHandle<CaloGeometry> pG_;
edm::EDGetTokenT<double> rhoLabel_;
edm::EDGetTokenT<EcalRecHitCollection> EBecalCollection_;
edm::EDGetTokenT<EcalRecHitCollection> EEecalCollection_;
edm::EDGetTokenT<EcalRecHitCollection> ESCollection_;
edm::EDGetTokenT<HBHERecHitCollection> HBHERecHitsCollection_;
std::unique_ptr<const GBRForest> gbr_;

};

#endif // PhotonMVABasedHaloTagger_H
Loading

0 comments on commit fdcfde2

Please sign in to comment.