New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JER MET uncertainties and METSignifiance re-estimation #16435
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,14 +131,23 @@ 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; | ||
if (variation == 0) | ||
m_systematic_variation = Variation::NOMINAL; | ||
else if (variation == 1) | ||
m_systematic_variation = Variation::UP; | ||
else if (variation == -1) | ||
m_systematic_variation = Variation::DOWN; | ||
else if (variation == 101) { | ||
m_systematic_variation = Variation::NOMINAL; | ||
_nomVar=1; | ||
} | ||
else if (variation == -101) { | ||
m_systematic_variation = Variation::NOMINAL; | ||
_nomVar=-1; | ||
} | ||
else | ||
throw edm::Exception(edm::errors::ConfigFileReadError, "Invalid value for 'variation' parameter. Only -1, 0 or 1 are supported."); | ||
throw edm::Exception(edm::errors::ConfigFileReadError, "Invalid value for 'variation' parameter. Only -1, 0, 1 or 101, -101 are supported."); | ||
} | ||
|
||
produces<JetCollection>(); | ||
|
@@ -234,7 +243,7 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> { | |
} | ||
|
||
double dPt = jet.pt() - genJet->pt(); | ||
smearFactor = 1 + (jer_sf - 1.) * dPt / jet.pt(); | ||
smearFactor = 1 + _nomVar*(jer_sf - 1.) * dPt / jet.pt(); | ||
|
||
} else if (jer_sf > 1) { | ||
/* | ||
|
@@ -247,7 +256,7 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> { | |
} | ||
|
||
std::normal_distribution<> d(0, sigma); | ||
smearFactor = 1. + d(m_random_generator); | ||
smearFactor = 1. + _nomVar*d(m_random_generator); | ||
} else if (m_debug) { | ||
std::cout << "Impossible to smear this jet" << std::endl; | ||
} | ||
|
@@ -298,5 +307,7 @@ class SmearedJetProducerT : public edm::stream::EDProducer<> { | |
std::mt19937 m_random_generator; | ||
|
||
GreaterByPt<T> jetPtComparator; | ||
|
||
int _nomVar; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. leading underscore is frowned upon. Please change to |
||
}; | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,16 +20,18 @@ Description: [one line class summary] | |
|
||
metsig::METSignificance::METSignificance(const edm::ParameterSet& iConfig) { | ||
|
||
edm::ParameterSet cfgParams = iConfig.getParameter<edm::ParameterSet>("parameters"); | ||
// if(iConfig.exists("parameters")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this commented out code needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like this commented out "if" is also the reason for the unnecessary re-indentation of the code in metsig::METSignificance::METSignificance There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed anymore, forgot to remove it during the development period, going to be removed |
||
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"); | ||
|
||
} | ||
|
||
metsig::METSignificance::~METSignificance() { | ||
|
@@ -172,7 +174,7 @@ metsig::METSignificance::getCovariance(const edm::View<reco::Jet>& jets, | |
} | ||
|
||
double | ||
metsig::METSignificance::getSignificance(const reco::METCovMatrix& cov, const reco::MET& met) const { | ||
metsig::METSignificance::getSignificance(const reco::METCovMatrix& cov, const reco::MET& met) { | ||
|
||
// covariance matrix determinant | ||
double det = cov(0,0)*cov(1,1) - cov(0,1)*cov(1,0); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably missing something.
What is the purpose of this "101" shift?
For +/-101 we get the same NOMINAL jet_sf value and you will smear by the full
+/- |jet_sf -1|
while the systematics on the JER can be smaller or larger
Looking at
https://twiki.cern.ch/twiki/bin/view/CMS/JetResolution#JER_Scaling_factors_and_Uncertai
for eta 0 to 0.5 JER SF is 1.122 +-0.026 or "jer_sf - 1 = 0.122 +-0.026".
So, smearing by +-0.122 in this case is not meaningful, but maybe there is some other use case outside the nominal definition of JER.
Please clarify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slava77 Here the total semaring factor is basically smear by 1-0.122 or 1+0.122. This is the same logic as the previous code, but the scale factor is used instead of the uncertainties associated to the scale factor