124 TString value = settings.GetValue(key,defaultValue);
128 return StatusCode::SUCCESS;
131 if (!value.Contains(
","))
133 ATH_MSG_ERROR(
"Key of " << key.Data() <<
" has an unexpected value format (missing comma): " << value.Data());
134 return StatusCode::FAILURE;
139 if (splitValue.size() < 3)
141 ATH_MSG_ERROR(
"Key of " << key.Data() <<
" has unexpected value format (less than 3 strings): " << value.Data());
142 return StatusCode::FAILURE;
144 else if (splitValue.size() > 4)
146 ATH_MSG_ERROR(
"Key of " << key.Data() <<
" has unexpected value format (more than 4 strings): " << value.Data());
147 return StatusCode::FAILURE;
154 ATH_MSG_ERROR(
"Key of " << key.Data() <<
" has unexpected parametrization value: " << splitValue.at(1));
155 return StatusCode::FAILURE;
162 ATH_MSG_ERROR(
"Key of " << key.Data() <<
" has unexpected interpolation type: " << splitValue.at(2));
163 return StatusCode::FAILURE;
169 if (splitValue.size() != 4)
171 ATH_MSG_ERROR(
"Key of " << key.Data() <<
" has unexpected value format (missing mass definition): " << value.Data());
172 return StatusCode::FAILURE;
177 ATH_MSG_ERROR(
"Key of " << key.Data() <<
" has unexpected mass definition: " << splitValue.at(3));
178 return StatusCode::FAILURE;
183 TString histName = splitValue.at(0);
184 histName.ReplaceAll(
"MCTYPE",MCtype);
190 if (hist->initialize(histFile).isFailure())
191 return StatusCode::FAILURE;
194 ATH_MSG_INFO(Form(
" %s: \"%s\"",key.Data(),value.Data()));
196 return StatusCode::SUCCESS;
204 return StatusCode::FAILURE;
230 return StatusCode::FAILURE;
232 return StatusCode::FAILURE;
235 ATH_MSG_ERROR(
"There should never be a nominal data resolution without a nominal MC resolution (pT)");
236 return StatusCode::FAILURE;
241 return StatusCode::FAILURE;
243 return StatusCode::FAILURE;
246 ATH_MSG_ERROR(
"There should never be a nominal data resolution without a nominal MC resolution (four-vector)");
247 return StatusCode::FAILURE;
256 return StatusCode::FAILURE;
258 return StatusCode::FAILURE;
261 ATH_MSG_ERROR(
"There should never be a nominal data resolution without a nominal MC resolution (four-vector)");
262 return StatusCode::FAILURE;
267 return StatusCode::FAILURE;
269 return StatusCode::FAILURE;
272 ATH_MSG_ERROR(
"There should never be a nominal data resolution without a nominal MC resolution (four-vector)");
273 return StatusCode::FAILURE;
278 return StatusCode::FAILURE;
280 return StatusCode::FAILURE;
283 ATH_MSG_ERROR(
"There should never be a nominal data resolution without a nominal MC resolution (four-vector)");
284 return StatusCode::FAILURE;
289 return StatusCode::FAILURE;
291 return StatusCode::FAILURE;
294 ATH_MSG_ERROR(
"There should never be a nominal data resolution without a nominal MC resolution (four-vector)");
295 return StatusCode::FAILURE;
299 TString smearType = settings.GetValue(
"ResolutionSmearOnlyMC",
"");
302 if (!smearType.CompareTo(
"true",TString::kIgnoreCase))
304 else if (!smearType.CompareTo(
"false",TString::kIgnoreCase))
308 ATH_MSG_ERROR(
"The value of ResolutionSmearOnlyMC doesn't look like the expected boolean: " << smearType.Data());
309 return StatusCode::FAILURE;
319 ATH_MSG_ERROR(
"Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for pT");
320 return StatusCode::FAILURE;
324 ATH_MSG_ERROR(
"Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for fourvec");
325 return StatusCode::FAILURE;
329 ATH_MSG_ERROR(
"Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for mQCD");
330 return StatusCode::FAILURE;
334 ATH_MSG_ERROR(
"Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for mWZ");
335 return StatusCode::FAILURE;
339 ATH_MSG_ERROR(
"Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for mHbb");
340 return StatusCode::FAILURE;
344 ATH_MSG_ERROR(
"Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for mTop");
345 return StatusCode::FAILURE;
351 return StatusCode::SUCCESS;
363 ATH_MSG_ERROR(
"Asking for the nominal resolution before initialization");
437 ATH_MSG_ERROR(
"Mass resolution depends on a single jet topology, not a mixed topology");
443 ATH_MSG_ERROR(
"Mass resolution depends on the jet topology, which was not specified");
484 ATH_MSG_ERROR(
"Asked for the smearing factor for a non-resolution component");
487 return std::tuple<const UncertaintyHistogram*,CompParametrization::TypeEnum,CompMassDef::TypeEnum>(resolution,param,massDef);
494 throw std::runtime_error(
"Asking for nominal resolution information before initialization");
528 throw std::runtime_error(Form(
"Unexpected topology type, cannot determine if relevant info exists: %s",
JetTopology::enumToString(topology).
Data()));
#define JESUNC_SAFE_DELETE(T)
AsgMessaging(const std::string &name)
Constructor with a name.
UncertaintyHistogram * m_mWZNomHistMC
UncertaintyHistogram * m_ptNomHistMC
CompMassDef::TypeEnum m_mHbbNomMassDefMC
UncertaintyHistogram * m_mQCDNomHistData
virtual StatusCode initialize(TEnv &settings, TFile *histFile, const TString &MCtype)
CompMassDef::TypeEnum m_fvNomMassDefData
CompParametrization::TypeEnum m_ptNomParamMC
CompParametrization::TypeEnum m_mHbbNomParamData
CompParametrization::TypeEnum m_mQCDNomParamMC
CompMassDef::TypeEnum m_mQCDNomMassDefData
UncertaintyHistogram * m_mQCDNomHistMC
CompMassDef::TypeEnum m_mHbbNomMassDefData
std::tuple< const UncertaintyHistogram *, CompParametrization::TypeEnum, CompMassDef::TypeEnum > getNominalResolution(const CompScaleVar::TypeEnum smearType, const JetTopology::TypeEnum topology, const bool readMC) const
virtual ~ResolutionHelper()
CompParametrization::TypeEnum m_mWZNomParamData
UncertaintyHistogram * m_mTopNomHistMC
bool hasRelevantInfo(const CompScaleVar::TypeEnum type, const JetTopology::TypeEnum topology) const
CompMassDef::TypeEnum m_mWZNomMassDefMC
CompParametrization::TypeEnum m_fvNomParamData
CompMassDef::TypeEnum m_ptNomMassDefMC
UncertaintyHistogram * m_mHbbNomHistMC
CompMassDef::TypeEnum m_mTopNomMassDefData
CompMassDef::TypeEnum m_mWZNomMassDefData
CompMassDef::TypeEnum m_ptNomMassDefData
CompParametrization::TypeEnum m_fvNomParamMC
UncertaintyHistogram * m_mTopNomHistData
CompParametrization::TypeEnum m_mQCDNomParamData
CompParametrization::TypeEnum m_mTopNomParamData
UncertaintyHistogram * m_mHbbNomHistData
StatusCode parseInput(TEnv &settings, TFile *histFile, const TString &key, const TString &defaultValue, UncertaintyHistogram *&hist, CompParametrization::TypeEnum ¶m, CompMassDef::TypeEnum &massDef, const TString &MCtype)
CompMassDef::TypeEnum m_mTopNomMassDefMC
UncertaintyHistogram * m_fvNomHistMC
CompMassDef::TypeEnum m_mQCDNomMassDefMC
CompParametrization::TypeEnum m_mWZNomParamMC
UncertaintyHistogram * m_fvNomHistData
CompParametrization::TypeEnum m_mHbbNomParamMC
CompMassDef::TypeEnum m_fvNomMassDefMC
CompParametrization::TypeEnum m_ptNomParamData
ResolutionHelper(const std::string &name, const std::string &jetDef)
CompParametrization::TypeEnum m_mTopNomParamMC
UncertaintyHistogram * m_ptNomHistData
UncertaintyHistogram * m_mWZNomHistData
TypeEnum stringToEnum(const TString &type)
TypeEnum stringToEnum(const TString &type)
bool includesMass(const TypeEnum type)
TString enumToString(const TypeEnum type)
TypeEnum stringToEnum(const TString &type)
TString enumToString(const TypeEnum type)
bool vectorize(const TString &str, const TString &sep, std::vector< T > &result)