Skip to content

Commit

Permalink
Merge pull request cms-sw#15 from mmarionncern/MM_JERUncAndMETSig_311016
Browse files Browse the repository at this point in the history
Cleaning of the code, backport of 81X branch
  • Loading branch information
mmarionncern authored Nov 7, 2016
2 parents 7c5d712 + 209728c commit 6fcb6dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
12 changes: 6 additions & 6 deletions PhysicsTools/PatUtils/interface/SmearedJetProducerT.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> {
m_genJetMatcher = std::make_shared<pat::GenJetMatcher>(cfg, consumesCollector());

std::int32_t variation = cfg.getParameter<std::int32_t>("variation");
_nomVar=1;
m_nomVar=1;
if (variation == 0)
m_systematic_variation = Variation::NOMINAL;
else if (variation == 1)
Expand All @@ -140,11 +140,11 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> {
m_systematic_variation = Variation::DOWN;
else if (variation == 101) {
m_systematic_variation = Variation::NOMINAL;
_nomVar=1;
m_nomVar=1;
}
else if (variation == -101) {
m_systematic_variation = Variation::NOMINAL;
_nomVar=-1;
m_nomVar=-1;
}
else
throw edm::Exception(edm::errors::ConfigFileReadError, "Invalid value for 'variation' parameter. Only -1, 0, 1 or 101, -101 are supported.");
Expand Down Expand Up @@ -243,7 +243,7 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> {
}

double dPt = jet.pt() - genJet->pt();
smearFactor = 1 + _nomVar*(jer_sf - 1.) * dPt / jet.pt();
smearFactor = 1 + m_nomVar*(jer_sf - 1.) * dPt / jet.pt();

} else if (jer_sf > 1) {
/*
Expand All @@ -256,7 +256,7 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> {
}

std::normal_distribution<> d(0, sigma);
smearFactor = 1. + _nomVar*d(m_random_generator);
smearFactor = 1. + m_nomVar*d(m_random_generator);
} else if (m_debug) {
std::cout << "Impossible to smear this jet" << std::endl;
}
Expand Down Expand Up @@ -308,6 +308,6 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> {

GreaterByPt<T> jetPtComparator;

int _nomVar;
int m_nomVar;
};
#endif
16 changes: 7 additions & 9 deletions RecoMET/METAlgorithms/src/METSignificance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ Description: [one line class summary]

metsig::METSignificance::METSignificance(const edm::ParameterSet& iConfig) {

// if(iConfig.exists("parameters")) {
edm::ParameterSet cfgParams = iConfig.getParameter<edm::ParameterSet>("parameters");
edm::ParameterSet cfgParams = iConfig.getParameter<edm::ParameterSet>("parameters");

double dRmatch = cfgParams.getParameter<double>("dRMatch");
dR2match_ = dRmatch*dRmatch;
double dRmatch = cfgParams.getParameter<double>("dRMatch");
dR2match_ = dRmatch*dRmatch;

jetThreshold_ = cfgParams.getParameter<double>("jetThreshold");
jetEtas_ = cfgParams.getParameter<std::vector<double> >("jeta");
jetParams_ = cfgParams.getParameter<std::vector<double> >("jpar");
pjetParams_ = cfgParams.getParameter<std::vector<double> >("pjpar");
// }
jetThreshold_ = cfgParams.getParameter<double>("jetThreshold");
jetEtas_ = cfgParams.getParameter<std::vector<double> >("jeta");
jetParams_ = cfgParams.getParameter<std::vector<double> >("jpar");
pjetParams_ = cfgParams.getParameter<std::vector<double> >("pjpar");

}

Expand Down

0 comments on commit 6fcb6dd

Please sign in to comment.