Skip to content

Commit

Permalink
Merge pull request #45470 from Sam-Harper/EGRegHOverEFix_1410pre5
Browse files Browse the repository at this point in the history
Use uncorrected H/E for electron energy regressions
  • Loading branch information
cmsbuild authored Jul 16, 2024
2 parents 751fa4f + fd2862a commit b08e6a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion RecoEgamma/EgammaTools/plugins/EGRegressionModifierV3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class EGRegressionModifierV3 : public ModifyObjectValueBase {
edm::EDGetTokenT<double> rhoToken_;

bool useClosestToCentreSeedCrysDef_;
bool useBuggedHOverE_; //this allows us to use the regression corrected H/E which is incorrect wrong
float maxRawEnergyForLowPtEBSigma_;
float maxRawEnergyForLowPtEESigma_;
edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeomToken_;
Expand All @@ -74,6 +75,7 @@ EGRegressionModifierV3::EGRegressionModifierV3(const edm::ParameterSet& conf, ed
rhoValue_(0.),
rhoToken_(cc.consumes(conf.getParameter<edm::InputTag>("rhoTag"))),
useClosestToCentreSeedCrysDef_(conf.getParameter<bool>("useClosestToCentreSeedCrysDef")),
useBuggedHOverE_(conf.getParameter<bool>("useBuggedHOverE")),
maxRawEnergyForLowPtEBSigma_(conf.getParameter<double>("maxRawEnergyForLowPtEBSigma")),
maxRawEnergyForLowPtEESigma_(conf.getParameter<double>("maxRawEnergyForLowPtEESigma")) {
if (conf.exists("eleRegs")) {
Expand Down Expand Up @@ -219,7 +221,8 @@ std::array<float, 32> EGRegressionModifierV3::getRegData(const reco::GsfElectron
data[2] = superClus->phiWidth();
data[3] = superClus->seed()->energy() / rawEnergy;
data[4] = ssFull5x5.e5x5 / rawEnergy;
data[5] = ele.hcalOverEcalBc();
//the full5x5 is not regression corrected and thus is the correct one to use
data[5] = useBuggedHOverE_ ? ele.hcalOverEcalBc() : ele.full5x5_hcalOverEcalBc();
data[6] = rhoValue_;
data[7] = seedClus->eta() - superClus->position().Eta();
data[8] = reco::deltaPhi(seedClus->phi(), superClus->position().Phi());
Expand Down
2 changes: 2 additions & 0 deletions RecoEgamma/EgammaTools/python/regressionModifier_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
modifierName = cms.string('EGRegressionModifierV3'),
rhoTag = cms.InputTag('fixedGridRhoFastjetAllTmp'),
useClosestToCentreSeedCrysDef = cms.bool(False),
useBuggedHOverE = cms.bool(False),
maxRawEnergyForLowPtEBSigma = cms.double(-1),
maxRawEnergyForLowPtEESigma = cms.double(1200.),
eleRegs = cms.PSet(
Expand Down Expand Up @@ -94,6 +95,7 @@
modifierName = cms.string('EGRegressionModifierV3'),
rhoTag = cms.InputTag('fixedGridRhoFastjetAllTmp'),
useClosestToCentreSeedCrysDef = cms.bool(False),
useBuggedHOverE = cms.bool(False),
maxRawEnergyForLowPtEBSigma = cms.double(-1),
maxRawEnergyForLowPtEESigma = cms.double(1200.),
eleRegs = cms.PSet(
Expand Down

0 comments on commit b08e6a8

Please sign in to comment.