Skip to content

Commit

Permalink
Merge pull request #8949 from bendavid/ecalpfcluscorHighEnergyFix
Browse files Browse the repository at this point in the history
Fix for high energy behaviour of ecal pfcluster corrections
  • Loading branch information
cmsbuild committed May 6, 2015
2 parents 6029fae + 33e06c4 commit b4b5c63
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class PFClusterEMEnergyCorrector {
private:
bool _applyCrackCorrections;
bool _applyMVACorrections;
double _maxPtForMVAEvaluation;

bool autoDetectBunchSpacing_;
int bunchSpacingManual_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ void CorrectedECALPFClusterProducer::fillDescriptions(edm::ConfigurationDescript
edm::ParameterSetDescription psd0;
psd0.add<bool>("applyCrackCorrections",false);
psd0.add<bool>("applyMVACorrections",false);
psd0.add<double>("maxPtForMVAEvaluation",-99.);
psd0.add<std::string>("algoName","PFClusterEMEnergyCorrector");
psd0.add<edm::InputTag>("recHitsEBLabel",edm::InputTag("ecalRecHit","EcalRecHitsEB"));
psd0.add<edm::InputTag>("recHitsEELabel",edm::InputTag("ecalRecHit","EcalRecHitsEE"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
algoName = cms.string("PFClusterEMEnergyCorrector"),
applyCrackCorrections = cms.bool(False),
applyMVACorrections = cms.bool(True),
maxPtForMVAEvaluation = cms.double(90.),
recHitsEBLabel = cms.InputTag('ecalRecHit', 'EcalRecHitsEB'),
recHitsEELabel = cms.InputTag('ecalRecHit', 'EcalRecHitsEE'),
autoDetectBunchSpacing = cms.bool(True),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ PFClusterEMEnergyCorrector::PFClusterEMEnergyCorrector(const edm::ParameterSet&

_applyCrackCorrections = conf.getParameter<bool>("applyCrackCorrections");
_applyMVACorrections = conf.getParameter<bool>("applyMVACorrections");
_maxPtForMVAEvaluation = conf.getParameter<double>("maxPtForMVAEvaluation");


if (_applyMVACorrections) {
Expand Down Expand Up @@ -184,6 +185,13 @@ void PFClusterEMEnergyCorrector::correctEnergies(const edm::Event &evt, const ed
double e = cluster.energy();
double pt = cluster.pt();

//limit raw energy value used to evaluate corrections
//to avoid bad extrapolation
double evale = e;
if (_maxPtForMVAEvaluation>0. && pt>_maxPtForMVAEvaluation) {
evale *= _maxPtForMVAEvaluation/pt;
}

double invE = (e == 0.) ? 0. : 1./e; //guard against dividing by 0.

int size = lazyTool.n5x5(cluster);
Expand Down Expand Up @@ -246,7 +254,7 @@ void PFClusterEMEnergyCorrector::correctEnergies(const edm::Event &evt, const ed
}

//fill array for forest evaluation
eval[0] = e;
eval[0] = evale;
eval[1] = ietaix;
eval[2] = iphiiy;
if (!iseb) {
Expand Down

0 comments on commit b4b5c63

Please sign in to comment.