Commit cf2eda1e authored by Nils Erik Krumnack's avatar Nils Erik Krumnack
Browse files

Merge branch '21.2-jer-unc-updates' into '21.2'

Preparing for updated small-R JER uncertainties

See merge request atlas/athena!22755
parents de001907 9df699d9
......@@ -23,7 +23,7 @@ class ResolutionHelper : public asg::AsgMessaging
public:
ResolutionHelper(const std::string& name, const std::string& jetDef);
ResolutionHelper(const ResolutionHelper& toCopy);
virtual StatusCode initialize(TEnv& settings, TFile* histFile);
virtual StatusCode initialize(TEnv& settings, TFile* histFile, const TString& MCtype);
virtual ~ResolutionHelper();
// Information retrieval
......@@ -85,7 +85,7 @@ class ResolutionHelper : public asg::AsgMessaging
CompMassDef::TypeEnum m_mTopNomMassDefMC;
// Helper methods
StatusCode parseInput(TEnv& settings, TFile* histFile, const TString& key, const TString& defaultValue, UncertaintyHistogram*& hist, CompParametrization::TypeEnum& param, CompMassDef::TypeEnum& massDef);
StatusCode parseInput(TEnv& settings, TFile* histFile, const TString& key, const TString& defaultValue, UncertaintyHistogram*& hist, CompParametrization::TypeEnum& param, CompMassDef::TypeEnum& massDef,const TString& MCtype);
};
......
......@@ -67,7 +67,7 @@ JetUncertaintiesTool::JetUncertaintiesTool(const std::string& name)
, m_jetDef("")
, m_mcType("")
, m_configFile("")
, m_calibArea("CalibArea-06")
, m_calibArea("CalibArea-07")
, m_path("")
, m_analysisFile("")
, m_analysisHistPattern("")
......@@ -499,7 +499,7 @@ StatusCode JetUncertaintiesTool::initialize()
// Attempt to read in nominal resolution information
// There may be no such information - this is perfectly normal
m_resHelper = new ResolutionHelper(m_name+"_RH",m_jetDef);
if(m_resHelper->initialize(settings,histFile).isFailure())
if(m_resHelper->initialize(settings,histFile,m_mcType.c_str()).isFailure())
return StatusCode::FAILURE;
// Prepare for reading components and groups
......@@ -2397,8 +2397,9 @@ double JetUncertaintiesTool::getSmearingFactor(const xAOD::Jet& jet, const CompS
// We have the smearing factor, so prepare to smear
// If the user specified a seed, then use it
// If not, then use the jet's phi times 10^5
const long long int seed = m_userSeed != 0 ? m_userSeed : 1.e+5*fabs(jet.phi());
// If not, then use the jet's phi times 1*10^5 in MC, 1.23*10^5 in (pseudo-)data
// Difference in seed between allows for easy use of pseudo-data
const long long int seed = m_userSeed != 0 ? m_userSeed : (m_isData ? 1.23e+5 : 1.00e+5)*fabs(jet.phi());
m_rand.SetSeed(seed);
// Calculate and return the smearing factor
......
......@@ -118,7 +118,7 @@ ResolutionHelper::~ResolutionHelper()
JESUNC_SAFE_DELETE(m_mTopNomHistMC);
}
StatusCode ResolutionHelper::parseInput(TEnv& settings, TFile* histFile, const TString& key, const TString& defaultValue, UncertaintyHistogram*& hist, CompParametrization::TypeEnum& param, CompMassDef::TypeEnum& massDef)
StatusCode ResolutionHelper::parseInput(TEnv& settings, TFile* histFile, const TString& key, const TString& defaultValue, UncertaintyHistogram*& hist, CompParametrization::TypeEnum& param, CompMassDef::TypeEnum& massDef, const TString& MCtype)
{
// Get the string
TString value = settings.GetValue(key,defaultValue);
......@@ -179,8 +179,12 @@ StatusCode ResolutionHelper::parseInput(TEnv& settings, TFile* histFile, const T
}
}
// Replace generic MCTYPE string with the user-specified type if applicable
TString histName = splitValue.at(0);
histName.ReplaceAll("MCTYPE",MCtype);
// Create the histogram
hist = new UncertaintyHistogram(splitValue.at(0)+"_"+m_jetDef.c_str(),interp);
hist = new UncertaintyHistogram(histName+"_"+m_jetDef.c_str(),interp);
// Initialize the histogram
if (hist->initialize(histFile).isFailure())
......@@ -192,7 +196,7 @@ StatusCode ResolutionHelper::parseInput(TEnv& settings, TFile* histFile, const T
return StatusCode::SUCCESS;
}
StatusCode ResolutionHelper::initialize(TEnv& settings, TFile* histFile)
StatusCode ResolutionHelper::initialize(TEnv& settings, TFile* histFile, const TString& MCtype)
{
if (m_isInit)
{
......@@ -222,9 +226,9 @@ StatusCode ResolutionHelper::initialize(TEnv& settings, TFile* histFile)
// Start with nominal pT resolution
if (parseInput(settings,histFile,"NominalPtResData","",m_ptNomHistData,m_ptNomParamData,m_ptNomMassDefData).isFailure())
if (parseInput(settings,histFile,"NominalPtResData","",m_ptNomHistData,m_ptNomParamData,m_ptNomMassDefData,MCtype).isFailure())
return StatusCode::FAILURE;
if (parseInput(settings,histFile,"NominalPtResMC","",m_ptNomHistMC,m_ptNomParamMC,m_ptNomMassDefMC).isFailure())
if (parseInput(settings,histFile,"NominalPtResMC","",m_ptNomHistMC,m_ptNomParamMC,m_ptNomMassDefMC,MCtype).isFailure())
return StatusCode::FAILURE;
if (m_ptNomHistData && !m_ptNomHistMC)
{
......@@ -233,9 +237,9 @@ StatusCode ResolutionHelper::initialize(TEnv& settings, TFile* histFile)
}
// Now the nominal four-vector resolution
if (parseInput(settings,histFile,"NominalFourVecResData","",m_fvNomHistData,m_fvNomParamData,m_fvNomMassDefData).isFailure())
if (parseInput(settings,histFile,"NominalFourVecResData","",m_fvNomHistData,m_fvNomParamData,m_fvNomMassDefData,MCtype).isFailure())
return StatusCode::FAILURE;
if (parseInput(settings,histFile,"NominalFourVecResMC","",m_fvNomHistMC,m_fvNomParamMC,m_fvNomMassDefMC).isFailure())
if (parseInput(settings,histFile,"NominalFourVecResMC","",m_fvNomHistMC,m_fvNomParamMC,m_fvNomMassDefMC,MCtype).isFailure())
return StatusCode::FAILURE;
if (m_fvNomHistData && !m_fvNomHistMC)
{
......@@ -248,9 +252,9 @@ StatusCode ResolutionHelper::initialize(TEnv& settings, TFile* histFile)
// Lots of code duplication, but time is of the essence, and it works
// QCD topology
if (parseInput(settings,histFile,"NominalMassResDataQCD","",m_mQCDNomHistData,m_mQCDNomParamData,m_mQCDNomMassDefData).isFailure())
if (parseInput(settings,histFile,"NominalMassResDataQCD","",m_mQCDNomHistData,m_mQCDNomParamData,m_mQCDNomMassDefData,MCtype).isFailure())
return StatusCode::FAILURE;
if (parseInput(settings,histFile,"NominalMassResMCQCD","",m_mQCDNomHistMC,m_mQCDNomParamMC,m_mQCDNomMassDefMC).isFailure())
if (parseInput(settings,histFile,"NominalMassResMCQCD","",m_mQCDNomHistMC,m_mQCDNomParamMC,m_mQCDNomMassDefMC,MCtype).isFailure())
return StatusCode::FAILURE;
if (m_mQCDNomHistData && !m_mQCDNomHistMC)
{
......@@ -259,9 +263,9 @@ StatusCode ResolutionHelper::initialize(TEnv& settings, TFile* histFile)
}
// WZ topology
if (parseInput(settings,histFile,"NominalMassResDataWZ","",m_mWZNomHistData,m_mWZNomParamData,m_mWZNomMassDefData).isFailure())
if (parseInput(settings,histFile,"NominalMassResDataWZ","",m_mWZNomHistData,m_mWZNomParamData,m_mWZNomMassDefData,MCtype).isFailure())
return StatusCode::FAILURE;
if (parseInput(settings,histFile,"NominalMassResMCWZ","",m_mWZNomHistMC,m_mWZNomParamMC,m_mWZNomMassDefMC).isFailure())
if (parseInput(settings,histFile,"NominalMassResMCWZ","",m_mWZNomHistMC,m_mWZNomParamMC,m_mWZNomMassDefMC,MCtype).isFailure())
return StatusCode::FAILURE;
if (m_mWZNomHistData && !m_mWZNomHistMC)
{
......@@ -270,9 +274,9 @@ StatusCode ResolutionHelper::initialize(TEnv& settings, TFile* histFile)
}
// Hbb topology
if (parseInput(settings,histFile,"NominalMassResDataHbb","",m_mHbbNomHistData,m_mHbbNomParamData,m_mHbbNomMassDefData).isFailure())
if (parseInput(settings,histFile,"NominalMassResDataHbb","",m_mHbbNomHistData,m_mHbbNomParamData,m_mHbbNomMassDefData,MCtype).isFailure())
return StatusCode::FAILURE;
if (parseInput(settings,histFile,"NominalMassResMCHbb","",m_mHbbNomHistMC,m_mHbbNomParamMC,m_mHbbNomMassDefMC).isFailure())
if (parseInput(settings,histFile,"NominalMassResMCHbb","",m_mHbbNomHistMC,m_mHbbNomParamMC,m_mHbbNomMassDefMC,MCtype).isFailure())
return StatusCode::FAILURE;
if (m_mHbbNomHistData && !m_mHbbNomHistMC)
{
......@@ -281,9 +285,9 @@ StatusCode ResolutionHelper::initialize(TEnv& settings, TFile* histFile)
}
// Top topology
if (parseInput(settings,histFile,"NominalMassResDataTop","",m_mTopNomHistData,m_mTopNomParamData,m_mTopNomMassDefData).isFailure())
if (parseInput(settings,histFile,"NominalMassResDataTop","",m_mTopNomHistData,m_mTopNomParamData,m_mTopNomMassDefData,MCtype).isFailure())
return StatusCode::FAILURE;
if (parseInput(settings,histFile,"NominalMassResMCTop","",m_mTopNomHistMC,m_mTopNomParamMC,m_mTopNomMassDefMC).isFailure())
if (parseInput(settings,histFile,"NominalMassResMCTop","",m_mTopNomHistMC,m_mTopNomParamMC,m_mTopNomMassDefMC,MCtype).isFailure())
return StatusCode::FAILURE;
if (m_mTopNomHistData && !m_mTopNomHistMC)
{
......
......@@ -3269,6 +3269,47 @@ function JER_August2018 \
}
function JER_Fall_2018_Compare \
{
scaleVar="FourVecResAbs"
jetdef="EMTopo"
jetDefinition="AntiKt4${jetdef};AntiKt4${jetdef};AntiKt4${jetdef}"
MCtype="MC16"
CalibArea=""
configFile="rel21/Fall2018/R4_GlobalReduction_SimpleJER.config;rel21/Fall2018/R4_GlobalReduction_FullJER.config;rel21/Fall2018/R4_AllNuisanceParameters_AllJERNP.config"
outFile="JER-Fall2018-${MCtype}-Compare-${jetdef}.pdf"
compList="JER#@JER#@JER#"
compLabels="Total JER uncertainty, ${jetdef}, 7NP@Total JER uncertainty, ${jetdef}, 12NP@Total JER uncertainty, ${jetdef}, All NP"
options="prefix=JET_;fixedEtaVals=0;fixedPtVals=25;drawTotal=false;scaleVar=${scaleVar};IsData=false"
}
function JER_Fall_2018_Nominal \
{
scaleVar="FourVecResAbs"
jetDefinition="AntiKt4EMTopo;AntiKt4EMPFlow"
MCtype="MC16"
CalibArea=""
configFile="rel21/Fall2018/R4_GlobalReduction_SimpleJER.config;rel21/Summer2018/R4_GlobalReduction_SimpleJER.config"
outFile="JER-Fall2018-${MCtype}-Nominal.pdf"
compList="NOMINALRESMC;NOMINALRESDATA@NOMINALRESMC;NOMINALRESDATA"
compLabels="Nominal MC JER, EMTopo;Nominal data JER, EMTopo@Nominal MC JER, EMPFlow;Nominal data JER,EMPFlow"
options="prefix=JET_;fixedEtaVals=0;fixedPtVals=25;drawTotal=false;scaleVar=${scaleVar};IsData=false;axisMax=0.4"
}
function JER_Fall2018 \
{
scaleVar="FourVecResAbs"
jetDefinition="AntiKt4EMTopo;AntiKt4EMPFlow"
MCtype="MC16"
CalibArea=""
configFile="rel21/Fall2018/R4_AllNuisanceParameters_AllJERNP.config"
outFile="JER-Fall2018-${MCtype}-Recommendations.pdf"
compList="JER_DataVsMC_#;JER_N_#;JER_dijet_c#,JER_dijet_j#,JER_dijet_m#,JER_dijet_p#;JER_dijet_stat#"
compLabels="Nominal data vs MC difference;Noise term, random cones method;Dijet #it{in situ} JER (systematics);Dijet #it{in situ} JER (statistics)"
options="prefix=JET_;fixedEtaVals=0.202;fixedPtVals=40;scaleVar=${scaleVar};IsData=false;axisMax=0.05"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment