Skip to content

Commit

Permalink
fix code-format conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wassmer committed Nov 18, 2021
1 parent df8cc3e commit 295e635
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 36 deletions.
3 changes: 2 additions & 1 deletion DataFormats/PatCandidates/src/MET.cc
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ void MET::setUncShift(double px, double py, double sumEt, METUncertainty shift,
// which is performed independently
shift = (MET::METUncertainty)(METUncertainty::METUncertaintySize + shift + 1);
const PackedMETUncertainty &ref = corrections_[METCorrectionType::Smear];
uncertainties_[shift].set(px - ref.dpx() - this->px(), py - ref.dpy() - this->py(), sumEt - ref.dsumEt() - this->sumEt() );
uncertainties_[shift].set(
px - ref.dpx() - this->px(), py - ref.dpy() - this->py(), sumEt - ref.dsumEt() - this->sumEt());
} else
uncertainties_[shift].set(px - this->px(), py - this->py(), sumEt - this->sumEt());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,10 @@ namespace PFJetMETcorrInputProducer_namespace {
// therefore general template just returns 1
// specialized template for pat::Jets returns desired userFloat value if available
template <typename T>
class RetrieveJerT
{
public:
RetrieveJerT(){}
float operator()(const T& jet) const
{
return 1.0;
}
class RetrieveJerT {
public:
RetrieveJerT() {}
float operator()(const T& jet) const { return 1.0; }
};

} // namespace PFJetMETcorrInputProducer_namespace
Expand Down Expand Up @@ -213,7 +209,7 @@ class PFJetMETcorrInputProducerT : public edm::stream::EDProducer<> {
corrJetP4 = jetCorrExtractor_(jet, jetCorr.product(), jetCorrEtaMax_, &rawJetP4);
// retrieve JER factors in case of pat::Jets (done via specialized template defined for pat::Jets) and apply it
const static PFJetMETcorrInputProducer_namespace::RetrieveJerT<T> retrieveJER{};
corrJetP4*=retrieveJER(jet);
corrJetP4 *= retrieveJER(jet);

if (corrJetP4.pt() > type1JetPtThreshold_) {
reco::Candidate::LorentzVector rawJetP4offsetCorr = rawJetP4;
Expand Down
2 changes: 1 addition & 1 deletion PhysicsTools/PatUtils/interface/SmearedJetProducerT.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> {
}

T smearedJet = jet;
SmearedJetProducer_namespace::SmearJet(smearedJet,smearFactor);
SmearedJetProducer_namespace::SmearJet(smearedJet, smearFactor);

if (m_debug) {
std::cout << "smeared jet (" << smearFactor << "): pt: " << smearedJet.pt() << " eta: " << smearedJet.eta()
Expand Down
24 changes: 11 additions & 13 deletions PhysicsTools/PatUtils/plugins/PATPFJetMETcorrInputProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ namespace PFJetMETcorrInputProducer_namespace {
else
uncorrected_jet = jet.p4();
// remove JER correction factor from pat::Jets
if(jet.hasUserFloat("SmearFactor")) {
uncorrected_jet*=(1.0/jet.userFloat("SmearFactor"));
if (jet.hasUserFloat("SmearFactor")) {
uncorrected_jet *= (1.0 / jet.userFloat("SmearFactor"));
}
return uncorrected_jet;
}
Expand All @@ -40,17 +40,15 @@ namespace PFJetMETcorrInputProducer_namespace {
// retrieve JER factor if it was saved previously
// otherwise just return 1
template <>
class RetrieveJerT<pat::Jet>
{
public:
RetrieveJerT(){}
float operator()(const pat::Jet& jet) const
{
if(jet.hasUserFloat("SmearFactor")) {
return jet.userFloat("SmearFactor");
}
else return 1.0;
}
class RetrieveJerT<pat::Jet> {
public:
RetrieveJerT() {}
float operator()(const pat::Jet& jet) const {
if (jet.hasUserFloat("SmearFactor")) {
return jet.userFloat("SmearFactor");
} else
return 1.0;
}
};

} // namespace PFJetMETcorrInputProducer_namespace
Expand Down
24 changes: 12 additions & 12 deletions PhysicsTools/PatUtils/plugins/SmearedJetProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
#include "DataFormats/PatCandidates/interface/Jet.h"

namespace SmearedJetProducer_namespace {
// template function to apply JER
template <typename T>
void SmearJet(T& jet, float smearfactor) {
jet.scaleEnergy(smearfactor);
}
// template specialization for pat::Jets to store the JER factor
template <>
void SmearJet<pat::Jet>(pat::Jet& jet, float smearfactor) {
jet.scaleEnergy(smearfactor);
jet.addUserFloat("SmearFactor",smearfactor);
}
}
// template function to apply JER
template <typename T>
void SmearJet(T& jet, float smearfactor) {
jet.scaleEnergy(smearfactor);
}
// template specialization for pat::Jets to store the JER factor
template <>
void SmearJet<pat::Jet>(pat::Jet& jet, float smearfactor) {
jet.scaleEnergy(smearfactor);
jet.addUserFloat("SmearFactor", smearfactor);
}
} // namespace SmearedJetProducer_namespace

#include "PhysicsTools/PatUtils/interface/SmearedJetProducerT.h"

Expand Down

0 comments on commit 295e635

Please sign in to comment.