48#include "TDirectory.h"
54#include <unordered_set>
128 ATH_MSG_ERROR(Form(
"Failed to pre-set applySystematicVariation to no variation"));
134 ,
m_name(toCopy.m_name+
"_copy")
165 , m_rand(toCopy.m_rand)
179 for (
size_t iGroup = 0; iGroup < toCopy.m_groups.size(); ++iGroup)
183 ATH_MSG_ERROR(Form(
"Failed to re-set applySystematicVariation in new tool copy"));
190 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
204 std::unordered_map<CP::SystematicSet,UncertaintySet*>::iterator iter;
218 return StatusCode::FAILURE;
222 return StatusCode::SUCCESS;
231 return StatusCode::FAILURE;
235 return StatusCode::SUCCESS;
244 return StatusCode::FAILURE;
247 ATH_MSG_INFO(Form(
"Preparing to initialize the JetUncertaintiesTool named %s",
m_name.c_str()));
250 TDirectory* currentDir = gDirectory;
255 if (configFilePath ==
"")
258 return StatusCode::FAILURE;
262 if (settings.ReadFile(configFilePath.Data(),kEnvGlobal))
264 ATH_MSG_ERROR(
"Cannot read config file: " << configFilePath.Data());
265 return StatusCode::FAILURE;
269 ATH_MSG_INFO(Form(
"================================================"));
275 ATH_MSG_INFO(Form(
" Location: %s",configFilePath.Data()));
279 m_release = settings.GetValue(
"UncertaintyRelease",
"UNKNOWN");
283 TString allowedJetDefStr = settings.GetValue(
"SupportedJetDefs",
"");
284 if (allowedJetDefStr ==
"")
286 ATH_MSG_ERROR(
"Cannot find supported jet definitions in config");
287 return StatusCode::FAILURE;
290 bool foundJetDef =
false;
291 for (
size_t iDef = 0; iDef < allowedJetDefs.size(); ++iDef)
292 if (!allowedJetDefs.at(iDef).CompareTo(
m_jetDef.c_str(),TString::kIgnoreCase))
301 return StatusCode::FAILURE;
306 TString allowedMCtypeStr = settings.GetValue(
"SupportedMCTypes",
"");
307 if (allowedMCtypeStr ==
"")
310 return StatusCode::FAILURE;
313 bool foundMCtype =
false;
314 for (
size_t iType = 0; iType < allowedMCtypes.size(); ++iType)
315 if (!allowedMCtypes.at(iType).CompareTo(
m_mcType.c_str(),TString::kIgnoreCase))
318 m_mcType = allowedMCtypes.at(iType);
324 return StatusCode::FAILURE;
330 TString histFileName = settings.GetValue(
"UncertaintyRootFile",
"");
331 if (histFileName ==
"")
334 return StatusCode::FAILURE;
336 ATH_MSG_INFO(Form(
" UncertaintyFile: \"%s\"",histFileName.Data()));
340 if (histFilePath ==
"")
342 ATH_MSG_ERROR(
"Cannot find the path of the uncertainty histogram file");
343 return StatusCode::FAILURE;
345 ATH_MSG_INFO(Form(
" Location: %s",histFilePath.Data()));
348 TFile* histFile =
new TFile(histFilePath,
"READ");
349 if (!histFile || histFile->IsZombie())
351 ATH_MSG_ERROR(
"Cannot open uncertainty histogram file: " << histFileName.Data());
352 return StatusCode::FAILURE;
358 m_defAnaFile = settings.GetValue(
"AnalysisRootFile",
"");
366 if (analysisFilePath ==
"")
368 ATH_MSG_ERROR(
"Cannot find the path of the analysis histogram file");
369 return StatusCode::FAILURE;
371 ATH_MSG_INFO(Form(
" Location: %s",analysisFilePath.Data()));
378 if (analysisFilePath ==
"")
380 ATH_MSG_ERROR(
"Cannot find the path of the default analysis histogram file");
381 return StatusCode::FAILURE;
383 ATH_MSG_INFO(Form(
" Location: %s",analysisFilePath.Data()));
392 std::string validHistForFile = settings.GetValue(
"FileValidHistogram",
"");
393 if (validHistForFile !=
"")
396 std::string validHistForFileParam = settings.GetValue(
"FileValidHistParam",
"");
397 if (validHistForFileParam ==
"")
399 ATH_MSG_ERROR(
"Specified a FileValidHistogram without an accompanying FileValidHistParam: " << validHistForFile);
400 return StatusCode::FAILURE;
412 return StatusCode::FAILURE;
418 const TString caloMassWeight = TString(settings.GetValue(
"CombMassWeightCaloHist",
""));
419 const TString TAMassWeight = TString(settings.GetValue(
"CombMassWeightTAHist",
""));
420 if (caloMassWeight !=
"" && TAMassWeight !=
"")
426 return StatusCode::FAILURE;
428 return StatusCode::FAILURE;
431 const TString combMassParam = TString(settings.GetValue(
"CombMassWeightParam",
"PtMass"));
435 ATH_MSG_ERROR(
"Unexpected combined mass parametrization: " << combMassParam.Data());
436 return StatusCode::FAILURE;
439 ATH_MSG_INFO(
" Found and loaded combined mass weight factors");
445 const TString caloWeightMassDef = settings.GetValue(
"CombMassWeightCaloMassDef",
"Calo");
446 const TString TAWeightMassDef = settings.GetValue(
"CombMassWeightTAMassDef",
"TA");
447 if (caloWeightMassDef !=
"")
452 if (TAWeightMassDef !=
"")
458 else if (caloMassWeight !=
"" && TAMassWeight ==
"")
460 ATH_MSG_ERROR(
" Found combined mass weight factors for the calo term, but not the TA term");
461 return StatusCode::FAILURE;
463 else if (caloMassWeight ==
"" && TAMassWeight !=
"")
465 ATH_MSG_ERROR(
" Found combined mass weight factors for the TA term, but not the calo term");
466 return StatusCode::FAILURE;
471 m_name_EffSF = TString(settings.GetValue(
"TagSFEffName",
"temp_effSF"));
472 m_name_Efficiency = TString(settings.GetValue(
"TagEfficiencyName",
"temp_efficiency"));
473 m_name_TagResult = TString(settings.GetValue(
"TagResultName",
"temp_accept")).ReplaceAll(
"accept",
"Tagged");
486 std::string refNPV = settings.GetValue(
"Pileup.NPVRef",
"");
487 std::string refMu = settings.GetValue(
"Pileup.MuRef",
"");
488 if ( (refNPV !=
"" && refMu ==
"") || (refNPV ==
"" && refMu !=
"") )
491 return StatusCode::FAILURE;
493 else if ( refNPV !=
"" && refMu !=
"")
503 return StatusCode::FAILURE;
512 return StatusCode::FAILURE;
520 std::string varString =
"";
521 for (
size_t iFilter = 0; iFilter <
m_systFilters.size(); ++iFilter)
525 ATH_MSG_ERROR(
"Unable to parse VariablesToShift due to unknown variable, please check for typos: " <<
m_systFilters.at(iFilter));
526 return StatusCode::FAILURE;
528 if (!varString.empty())
532 ATH_MSG_INFO(Form(
" VariablesToShift: %s",varString.c_str()));
539 return StatusCode::FAILURE;
549 ATH_MSG_INFO(Form(
"%6s %-40s : %s",
"",
"JES uncert. comp.",
"Description"));
550 ATH_MSG_INFO(Form(
"%6s %-40s -%s",
"",
"-----------------",
"-----------"));
551 for (
size_t iGroup = 0; iGroup < 999; ++iGroup)
554 const TString prefix = Form(
"JESGroup.%zu.",iGroup);
558 if (helper.initialize(settings).isFailure())
559 return StatusCode::FAILURE;
562 if (!helper.isGroup())
continue;
571 return StatusCode::FAILURE;
573 for (
size_t iComp = 0; iComp < 999; ++iComp)
576 const TString prefix = Form(
"JESComponent.%zu.",iComp);
580 if (helper.initialize(settings).isFailure())
581 return StatusCode::FAILURE;
584 if (!helper.isComponent() && !helper.isCompGroup())
594 helper.setComponentJetDefSuffix(
m_jetDef);
598 return StatusCode::FAILURE;
603 size_t numCompsBeforeMerger = 0;
604 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup) {
605 numCompsBeforeMerger +=
m_groups.at(iGroup)->getNumComponents();
617 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
619 const int groupNum =
m_groups.at(iGroup)->getGroupNum();
620 const int subgroupNum =
m_groups.at(iGroup)->getSubgroupNum();
624 if (!groupNum || !subgroupNum)
continue;
627 if (groupNum == subgroupNum)
629 ATH_MSG_ERROR(Form(
"Specified group %d (%s) as the parent of itself, blocking for safety",groupNum,
m_groups.at(iGroup)->getName().Data()));
630 return StatusCode::FAILURE;
634 for (
size_t iParentGroup = 0; iParentGroup <
m_groups.size(); ++iParentGroup)
636 if (iParentGroup == iGroup)
continue;
638 const int parentGroupNum =
m_groups.at(iParentGroup)->getGroupNum();
639 if (parentGroupNum == subgroupNum)
642 if (
m_groups.at(iParentGroup)->addSubgroup(
m_groups.at(iGroup)).isFailure())
644 ATH_MSG_ERROR(Form(
"Failed to add group %d (%s) as a subgroup of group %d (%s)",groupNum,
m_groups.at(iGroup)->getName().Data(),parentGroupNum,
m_groups.at(iParentGroup)->getName().Data()));
645 return StatusCode::FAILURE;
653 std::vector<UncertaintyGroup*> localGroupVec;
654 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
655 localGroupVec.push_back(
m_groups.at(iGroup));
658 for (
size_t iGroup = 0; iGroup < localGroupVec.size(); ++iGroup)
661 if (!localGroupVec.at(iGroup)->getSubgroupNum())
662 m_groups.push_back(localGroupVec.at(iGroup));
667 size_t numCompsAfterMerger = 0;
668 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup) {
669 numCompsAfterMerger +=
m_groups.at(iGroup)->getNumComponents();
680 if (numCompsBeforeMerger != numCompsAfterMerger)
682 ATH_MSG_ERROR(Form(
"Something went wrong merging groups: %zu before merger and %zu after merger",numCompsBeforeMerger,numCompsAfterMerger));
683 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
687 return StatusCode::FAILURE;
694 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
696 if (
m_groups.at(iGroup)->getNumComponents() == 0)
699 return StatusCode::FAILURE;
701 if (
m_groups.at(iGroup)->initialize(histFile).isFailure())
702 return StatusCode::FAILURE;
715 return StatusCode::FAILURE;
717 if (systVar.
basename().find(
"JER") != std::string::npos) {
720 return StatusCode::FAILURE;
728 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
730 std::set<CompScaleVar::TypeEnum> scaleVars =
m_groups.at(iGroup)->getScaleVars();
738 return StatusCode::FAILURE;
746 for (
size_t iFilter = 0; iFilter <
m_systFilters.size(); ++iFilter)
748 bool filterIsSane =
false;
749 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
759 ATH_MSG_ERROR(
" One of the specified VariablesToShift is not associated with any components, please check for typos: " <<
m_systFilters.at(iFilter));
760 return StatusCode::FAILURE;
766 size_t numCompInGroups = 0;
767 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
768 numCompInGroups +=
m_groups.at(iGroup)->getNumComponents();
778 ATH_MSG_INFO(Form(
"================================================"));
783 gDirectory = currentDir;
801 if (group.groupNum == 0)
803 ATH_MSG_ERROR(
"Group number was not specified for group: " << group.name.Data());
804 return StatusCode::FAILURE;
806 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
807 if (
m_groups.at(iGroup)->getGroupNum() == group.groupNum)
809 ATH_MSG_ERROR(
"Group number matches previous group (" <<
m_groups.at(iGroup)->getName().Data() <<
"): " << group.name.Data());
810 return StatusCode::FAILURE;
817 ATH_MSG_ERROR(
"Failed to build new group: " << group.name.Data());
818 return StatusCode::FAILURE;
822 if (!
m_groups.back()->getSubgroupNum())
824 size_t numGroups = 0;
825 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
826 if (!
m_groups.at(iGroup)->getSubgroupNum())
830 ,
m_groups.back()->getDesc().Data() ));
832 return StatusCode::SUCCESS;
837 const bool isSimpleGroup = helper.isCompGroup();
841 ATH_MSG_DEBUG(Form(
"Starting to process %s named %s",isSimpleGroup?
"simple component group":
"standard component",component.
name.Data()));
850 ATH_MSG_ERROR(
"Failed to build simple group for component: " << component.
name.Data());
851 return StatusCode::FAILURE;
853 const size_t groupIndex =
m_groups.size();
855 ATH_MSG_DEBUG(Form(
"Created new group \"%s\" for a simple component at index %zu",simpleGroup->
getName().Data(),groupIndex));
857 if (!
m_groups.back()->getSubgroupNum())
859 size_t numGroups = 0;
860 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
861 if (!
m_groups.at(iGroup)->getSubgroupNum())
865 ,
m_groups.back()->getDesc().Data() ));
875 return StatusCode::FAILURE;
877 if (
m_groups.at(groupIndex)->addComponent(compObject).isFailure())
878 return StatusCode::FAILURE;
879 ATH_MSG_DEBUG(Form(
"Added single component \"%s\" to simple group \"%s\" (index %zu)",compObject->
getName().Data(),
m_groups.at(groupIndex)->getName().Data(),groupIndex));
883 for (
size_t iSubComp = 0; iSubComp < component.
subComps.size(); ++iSubComp)
894 return StatusCode::FAILURE;
896 if (
m_groups.at(groupIndex)->addComponent(subCompObject).isFailure())
897 return StatusCode::FAILURE;
898 ATH_MSG_DEBUG(Form(
"Added component \"%s\" (%zu of %zu) to simple group \"%s\" (index %zu)",subCompObject->
getName().Data(),iSubComp+1,component.
subComps.size(),
m_groups.at(groupIndex)->getName().Data(),groupIndex));
904 size_t groupIndex = 0;
907 ATH_MSG_ERROR(
"No groups exist to add the component to: " << component.
name.Data());
908 return StatusCode::FAILURE;
910 for (
size_t iGroup = 0; iGroup <
m_groups.size(); ++iGroup)
919 return StatusCode::FAILURE;
926 return StatusCode::FAILURE;
928 if (
m_groups.at(groupIndex)->addComponent(compObject).isFailure())
929 return StatusCode::FAILURE;
930 ATH_MSG_DEBUG(Form(
"Added component \"%s\" to group \"%s\" (index %zu)",compObject->
getName().Data(),
m_groups.at(groupIndex)->getName().Data(),groupIndex));
933 return StatusCode::SUCCESS;
939 if (component.
name ==
"")
941 ATH_MSG_ERROR(
"Attempting to create a component with no name");
946 ATH_MSG_ERROR(
"Attempting to create a component with no parametrization: " << component.
name.Data());
951 ATH_MSG_ERROR(
"Attempting to create a component with no variable to scale: " << component.
name.Data());
964 ATH_MSG_ERROR(
"Attempted to create pileup component without NPV reference value: " << component.
name.Data());
969 ATH_MSG_ERROR(
"Attempted to create pileup component without mu reference value: " << component.
name.Data());
995 ATH_MSG_ERROR(
"Attempting to create a flavour uncertainty component without having specified an AnalysisRootFile");
1018 else if (component.
name.Contains(
"PunchThrough",TString::kIgnoreCase))
1029 else if (component.
name.Contains(
"Closeby",TString::kIgnoreCase))
1045 ATH_MSG_ERROR(
"Asking to create a combined mass term without specifying weights: " << component.
name.Data());
1070 auto caloGroup = std::make_unique<UncertaintyGroup>(caloGroupH);
1075 if (caloComps.size() != caloMassDefs.size())
1077 ATH_MSG_ERROR(
"Unbalanced number of calo mass terms and calo mass definitions, " << caloComps.size() <<
" vs " << caloMassDefs.size() <<
" for combined mass component: " << component.
name.Data());
1082 for (
size_t iComp = 0; iComp < caloComps.size(); ++iComp)
1088 caloCompH.
name = caloComps.at(iComp);
1093 ATH_MSG_ERROR(
"Failed to parse calo mass definition " << iComp <<
" (" << caloMassDefs.at(iComp).Data() <<
") for combined mass component: " << component.
name.Data());
1102 if (caloGroup->addComponent(caloComp).isFailure())
1107 if (
auto p = caloGroup.release(); cmuc->
setCaloTerm(p).isFailure()){
1122 auto TAGroup = std::make_unique<UncertaintyGroup>(TAGroupH);
1128 if (TAComps.size() != TAMassDefs.size())
1130 ATH_MSG_ERROR(
"Unbalanced number of TA mass terms and TA mass definitions, " << TAComps.size() <<
" vs " << TAMassDefs.size() <<
" for combined mass component: " << component.
name.Data());
1135 for (
size_t iComp = 0; iComp < TAComps.size(); ++iComp)
1141 TACompH.
name = TAComps.at(iComp);
1146 ATH_MSG_ERROR(
"Failed to parse TA mass definition " << iComp <<
" (" << TAMassDefs.at(iComp).Data() <<
") for combined mass component: " << component.
name.Data());
1157 if (TAGroup->addComponent(TAComp).isFailure())
1162 if (
auto p = TAGroup.release(); cmuc->
setTATerm(p).isFailure()){
1172 else if (component.
name.Contains(
"Large",TString::kIgnoreCase) && component.
name.Contains(
"Topology",TString::kIgnoreCase))
1182 ATH_MSG_ERROR(Form(
"No LargeRJetTruthLabels specified for Large-R jet topology component %s",component.
name.Data()));
1232 ATH_MSG_ERROR(
"Failed to find the type of component to build: " << component.
name.Data());
1248 return baseNames.find(systematic.
basename()) != baseNames.end();
1275 const std::set<CompScaleVar::TypeEnum> scaleVars = systematic.
getScaleVars();
1277 for (
size_t iFilter = 0; iFilter <
m_systFilters.size(); ++iFilter)
1281 passesFilter =
true;
1295 registry.registerSystematic(systematic);
1300 if (registry.addSystematicToRecommended(systematic) != StatusCode::SUCCESS)
1302 ATH_MSG_ERROR(
"Failed to add systematic to list of recommended systematics: " << systematic.
name());
1303 return StatusCode::FAILURE;
1306 return StatusCode::SUCCESS;
1318 std::string remappedName = systConfig.
name();
1319 size_t found = remappedName.find(
"_PseudoData");
1320 if (found != std::string::npos) {
1321 remappedName.erase(found, std::string(
"_PseudoData").
length());
1327 return StatusCode::FAILURE;
1332 return StatusCode::FAILURE;
1338 return StatusCode::FAILURE;
1343 return StatusCode::SUCCESS;
1349 std::unordered_map<CP::SystematicSet,CP::SystematicSet>::iterator iter =
m_systFilterMap.find(systConfig);
1351 filteredSet = iter->second;
1356 return StatusCode::FAILURE;
1360 return StatusCode::SUCCESS;
1366 std::unordered_map<CP::SystematicSet,UncertaintySet*>::iterator iter =
m_systSetMap.find(filteredSet);
1371 uncSet = iter->second;
1379 ATH_MSG_ERROR(
"Failed to create UncertaintySet for filtered CP::SystematicSet: " << filteredSet.
name());
1381 return StatusCode::FAILURE;
1383 m_systSetMap.insert(std::make_pair(filteredSet,uncSet));
1386 return StatusCode::SUCCESS;
1400 if (
release.BeginsWith(
"2011_"))
1402 else if (
release.BeginsWith(
"2012_"))
1404 else if (
release.BeginsWith(
"2015_") ||
release.BeginsWith(
"2016"))
1414 ATH_MSG_FATAL(
"Tool must be initialized before calling getRefMu");
1419 ATH_MSG_FATAL(
"Tool contains a histogram for refMu, cannot return float");
1429 ATH_MSG_FATAL(
"Tool must be initialized before calling getRefNPV");
1434 ATH_MSG_FATAL(
"Tool contains a histogram for refNPV, cannot return float");
1444 ATH_MSG_FATAL(
"Tool must be initialized before calling getRefMu");
1454 ATH_MSG_FATAL(
"Tool must be initialized before calling getRefNPV");
1465 ATH_MSG_FATAL(
"Tool must be initialized before calling getNumComponents");
1481 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentIndex");
1485 for (
size_t iComp = 0; iComp <
m_groups.size(); ++iComp)
1486 if (
m_groups.at(iComp)->getName().CompareTo(name,TString::kIgnoreCase) == 0)
1489 ATH_MSG_ERROR(
"Failed to find index for requested component: " << name.Data());
1497 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentName");
1512 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentDesc");
1527 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentCategory");
1542 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentIsReducible");
1557 ATH_MSG_FATAL(
"Tool must be initialized before asking for information pertaining to a given component index");
1558 return StatusCode::FAILURE;
1564 return StatusCode::FAILURE;
1568 return StatusCode::SUCCESS;
1573 return varSet.size() == 1 && *(varSet.begin()) == var;
1669 if (!eInfo)
return false;
1670 return getValidity(
index,
jet,*eInfo,scaleVar);
1676 ATH_MSG_FATAL(
"Tool must be initialized before calling getValidity");
1698 ATH_MSG_ERROR(
"Asked for the validity of a set which scales multiple variables without specifying the variable of interest:" <<
m_groups.at(
index)->getName().Data());
1720 return getUncertainty(
index,
jet,*eInfo,scaleVar);
1726 ATH_MSG_FATAL(
"Tool must be initialized before calling getUncertainty");
1752 ATH_MSG_ERROR(
"Asked for the uncertainty of a set which scales multiple variables without specifying the variable of interest:" <<
m_groups.at(
index)->getName().Data());
1773 if (!eInfo)
return false;
1774 return getValidUncertainty(
index,unc,
jet,*eInfo,scaleVar);
1780 ATH_MSG_FATAL(
"Tool must be initialized before calling getValidUncertainty");
1803 ATH_MSG_ERROR(
"Asked for the valid uncertainty of a set which scales multiple variables without specifying the variable of interest:" <<
m_groups.at(
index)->getName().Data());
1826 ATH_MSG_FATAL(
"Tool must be initialized before calling getNominalResolution");
1831 ATH_MSG_ERROR(
"The ResolutionHelper class was not created");
1836 std::tuple<const UncertaintyHistogram*,CompParametrization::TypeEnum,CompMassDef::TypeEnum> resolution =
m_resHelper->getNominalResolution(smearType,topology,readMC);
1844 ATH_MSG_ERROR(
"Parametrization involves mass but mass def is unknown");
1849 return readHistoFromParam(
jet,*std::get<0>(resolution),std::get<1>(resolution),std::get<2>(resolution));
1877 value = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.Eta());
1880 value = histo.getValue(jet4vec.Pt()*
m_energyScale,fabs(jet4vec.Eta()));
1886 value = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.M()/jet4vec.Pt());
1889 value = histo.getValue(jet4vec.Pt()*
m_energyScale,log(jet4vec.M()/jet4vec.Pt()));
1892 value = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.M()/jet4vec.Pt(),jet4vec.Eta());
1895 value = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.M()/jet4vec.Pt(),fabs(jet4vec.Eta()));
1904 value = histo.getValue(jet4vec.E()*
m_energyScale,log(jet4vec.M()/jet4vec.E()));
1907 value = histo.getValue(jet4vec.E()*
m_energyScale,log(jet4vec.M()/jet4vec.E()),jet4vec.Eta());
1910 value = histo.getValue(jet4vec.E()*
m_energyScale,log(jet4vec.M()/jet4vec.E()),fabs(jet4vec.Eta()));
1913 ATH_MSG_ERROR(
"Failed to read histogram due to unknown parametrization type in " <<
getName());
1930 if (caloRes == 0 || TARes == 0)
return 0;
1932 const double caloFactor = (caloRes == 0) ? 0 : 1./(caloRes*caloRes);
1933 const double TAFactor = ( TARes == 0) ? 0 : 1./(TARes*TARes);
1935 if (caloFactor + TAFactor == 0)
return 0;
1937 return caloFactor/(caloFactor+TAFactor);
1951 if (caloRes == 0 || TARes == 0)
return 0;
1953 const double caloFactor = 1./(caloRes*caloRes);
1954 const double TAFactor = 1./(TARes*TARes);
1956 if (caloFactor + TAFactor == 0)
return 0;
1958 return TAFactor/(caloFactor+TAFactor);
1971 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentCategories");
1978 std::unordered_set<std::string> categories;
1979 for (
size_t iComp = 0; iComp <
m_groups.size(); ++iComp)
1983 std::vector<std::string> categoryStrings;
1984 for (std::unordered_set<std::string>::const_iterator iter = categories.begin() ; iter != categories.end(); ++iter)
1985 categoryStrings.push_back(*iter);
1987 return categoryStrings;
1994 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentsInCategory");
2007 std::vector<size_t> components;
2008 for (
size_t iComp = 0; iComp <
m_groups.size(); ++iComp)
2009 if (
m_groups.at(iComp)->getCategory() == categoryEnum)
2010 components.push_back(iComp);
2019 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentNamesInCategory");
2024 std::vector<std::string> names;
2025 for (
size_t iComp = 0; iComp < components.size(); ++iComp)
2038TH2D* JetUncertaintiesTool::getPtCorrelationMatrix
ATLAS_NOT_THREAD_SAFE (
const int numBins,
const double minPt,
const double maxPt,
const double valEta)
2040 return getPtCorrelationMatrix(numBins,minPt,maxPt,valEta,valEta);
2043TH2D* JetUncertaintiesTool::getPtCorrelationMatrix
ATLAS_NOT_THREAD_SAFE (
const int numBins,
const double minPt,
const double maxPt,
const double valEta1,
const double valEta2)
2047 ATH_MSG_FATAL(
"Tool must be initialized before calling getCorrelationMatrix");
2051 std::cout <<
"Creating with max values " << valEta1 <<
" " << valEta2 << std::endl;
2052 CorrelationMatrix corrMat(Form(
"%s_varpt_eta%.2f_eta%.2f",m_name.c_str(),valEta1,valEta2),numBins,minPt*m_energyScale,maxPt*m_energyScale,valEta1,valEta2);
2058TH2D* JetUncertaintiesTool::getEtaCorrelationMatrix
ATLAS_NOT_THREAD_SAFE (
const int numBins,
const double minEta,
const double maxEta,
const double valPt)
2060 return getEtaCorrelationMatrix(numBins,minEta,maxEta,valPt,valPt);
2063TH2D* JetUncertaintiesTool::getEtaCorrelationMatrix
ATLAS_NOT_THREAD_SAFE (
const int numBins,
const double minEta,
const double maxEta,
const double valPt1,
const double valPt2)
2067 ATH_MSG_FATAL(
"Tool must be initialized before calling getCorrelationMatrix");
2071 CorrelationMatrix corrMat(Form(
"%s_vareta_pt%.1f_pt%.1f",
m_name.c_str(),valPt1/1.e3,valPt2/1.e3),numBins,minEta,maxEta,valPt1*m_energyScale,valPt2*m_energyScale);
2072 if (corrMat.initializeForEta(*this).isFailure())
2074 return new TH2D(*corrMat.getMatrix());
2088 return applyCorrection(
jet,*eInfo);
2095 ATH_MSG_FATAL(
"Tool must be initialized before calling applyCorrection");
2107 std::vector< std::pair<CompScaleVar::TypeEnum,double> > uncSet;
2108 const std::vector< std::pair<CompScaleVar::TypeEnum,bool> > validitySet =
m_currentUncSet->getValidUncertaintySet(uncSet,
jet,eInfo);
2111 bool allValid =
true;
2112 for (
size_t iVar = 0; iVar < validitySet.size(); ++iVar)
2114 const bool validity = validitySet.at(iVar).second;
2129 std::vector<CompScaleVar::TypeEnum> scaleVars =
m_currentUncSet->getScaleVars();
2130 bool hasMassRes =
false;
2131 bool hasPtRes =
false;
2132 bool hasFvRes =
false;
2139 ATH_MSG_ERROR(
"Varying both absolute and relative mass resolution components simultaneously is not supported");
2149 ATH_MSG_ERROR(
"Varying both absolute and relative pT resolution components simultaneously is not supported");
2159 ATH_MSG_ERROR(
"Varying both absolute and relative four-vector resolution components simultaneously is not supported");
2168 for (
size_t iVar = 0; iVar < uncSet.size(); ++iVar)
2172 const double shift = 1 + uncSet.at(iVar).second;
2173 const double smear = uncSet.at(iVar).second;
2177 double smearingFactor = 1;
2239 ATH_MSG_ERROR(
"Smearing the mass without specifying the topology is not supported");
2245 ATH_MSG_ERROR(
"Smearing the mass using multiple topology definitions is not supported");
2274 return correctedCopy(input,output,*eInfo);
2295 return applyContainerCorrection(inputs,*eInfo);
2303 for (
size_t iJet = 0; iJet < inputs.size(); ++iJet)
2318 if (nc_this->applySystematicVariation(syst) != StatusCode::SUCCESS)
2321 if (
evtStore()->retrieve(eInfo,
"EventInfo").isFailure()) {
2322 ATH_MSG_ERROR(
"Failed to retrieve EventInfo in applyContainerCorrection");
2331 static const SG::AuxElement::ConstAccessor<float> accNPV(
"NPV");
2332 static const SG::AuxElement::Decorator<float> decNPV(
"NPV");
2335 static const std::string eiName =
"EventInfo";
2337 if (evtStore()->retrieve(ei, eiName).isFailure())
2339 ATH_MSG_ERROR(
"Failed to retrieve default EventInfo object");
2344 if (accNPV.isAvailable(*ei)) {
2350 if (evtStore()->retrieve(vertices,
"PrimaryVertices").isFailure())
2352 ATH_MSG_ERROR(
"Failed to retrieve default NPV value from PrimaryVertices");
2358 for (itr = vertices->
begin(); itr != vertices->
end(); ++itr)
2359 if ( (*itr)->nTrackParticles() > 1)
2491 else if (variation < 0 && !m_resHelper->smearOnlyMC())
2497 const double sigmaNom = std::max(sigmaMC,sigmaData);
2505 const double sigmaSmear = sqrt(pow(sigmaNom + fabs(variation)*relativeFactor,2) - pow(sigmaNom,2));
2509 ATH_MSG_ERROR(
"A seed of 1e5 times the jet phi is used in JetCalibTools so using it here leads to correlated smearing");
2519 if(seed == 0) seed =
m_isData ? 34545654 : 45583453;
2520 m_rand.SetSeed(seed);
2525 double smearingFactor = -1;
2526 while (smearingFactor < 0)
2527 smearingFactor = m_rand.Gaus(1.,sigmaSmear);
2528 return smearingFactor;
2540 static const SG::AuxElement::Accessor<float> accD12(
"Split12");
2543 if (accD12.isAvailable(constJet))
2545 const float value = accD12(constJet);
2546 accD12(
jet) = shift*value;
2547 return StatusCode::SUCCESS;
2550 ATH_MSG_ERROR(
"Split12 moment (D12) is not available on the jet, please make sure to set Split12 before calling the tool");
2551 return StatusCode::FAILURE;
2556 static const SG::AuxElement::Accessor<float> accD23(
"Split23");
2559 if (accD23.isAvailable(constJet))
2561 const float value = accD23(constJet);
2562 accD23(
jet) = shift*value;
2563 return StatusCode::SUCCESS;
2566 ATH_MSG_ERROR(
"Split23 moment (D23) is not available on the jet, please make sure to set Split23 before calling the tool");
2567 return StatusCode::FAILURE;
2572 static const SG::AuxElement::Accessor<float> accTau1(
"Tau1");
2573 static const SG::AuxElement::Accessor<float> accTau2(
"Tau2");
2574 static const SG::AuxElement::Accessor<float> accTau21(
"Tau21");
2575 static const bool Tau21wasAvailable = accTau21.isAvailable(
jet);
2576 static const bool TauNNwasAvailable = accTau2.isAvailable(
jet) && accTau1.isAvailable(
jet);
2579 if (Tau21wasAvailable)
2581 if (!accTau21.isAvailable(
jet))
2583 ATH_MSG_ERROR(
"The Tau21 moment was previously available but is not available on this jet. This functionality is not supported.");
2584 return StatusCode::FAILURE;
2586 const float value = accTau21(constJet);
2587 accTau21(
jet) = shift*value;
2588 return StatusCode::SUCCESS;
2590 if (TauNNwasAvailable)
2592 if (! (accTau2.isAvailable(
jet) && accTau1.isAvailable(
jet)) )
2594 ATH_MSG_ERROR(
"The Tau2 and Tau1 moments were previously available but are not available on this jet. This functionality is not supported.");
2595 return StatusCode::FAILURE;
2597 const float tau2 = accTau2(constJet);
2598 const float tau1 = accTau1(constJet);
2599 accTau21(
jet) = fabs(tau1) > 1.e-6 ? shift*(tau2/tau1) : -999;
2600 return StatusCode::SUCCESS;
2615 ATH_MSG_ERROR(
"Neither Tau21 nor Tau1+Tau2 moments are available on the jet, please make sure one of these options is available before calling the tool.");
2616 return StatusCode::FAILURE;
2621 static const SG::AuxElement::Accessor<float> accTau2(
"Tau2");
2622 static const SG::AuxElement::Accessor<float> accTau3(
"Tau3");
2623 static const SG::AuxElement::Accessor<float> accTau32(
"Tau32");
2624 static const bool Tau32wasAvailable = accTau32.isAvailable(
jet);
2625 static const bool TauNNwasAvailable = accTau3.isAvailable(
jet) && accTau2.isAvailable(
jet);
2628 if (Tau32wasAvailable)
2630 if (!accTau32.isAvailable(
jet))
2632 ATH_MSG_ERROR(
"The Tau32 moment was previously available but is not available on this jet. This functionality is not supported.");
2633 return StatusCode::FAILURE;
2635 const float value = accTau32(constJet);
2636 accTau32(
jet) = shift*value;
2637 return StatusCode::SUCCESS;
2639 if (TauNNwasAvailable)
2641 if (! (accTau3.isAvailable(
jet) && accTau2.isAvailable(
jet)) )
2643 ATH_MSG_ERROR(
"The Tau3 and Tau2 moments were previously available but are not available on this jet. This functionality is not supported.");
2644 return StatusCode::FAILURE;
2646 const float tau3 = accTau3(constJet);
2647 const float tau2 = accTau2(constJet);
2648 accTau32(
jet) = fabs(tau2) > 1.e-6 ? shift*(tau3/tau2) : -999;
2649 return StatusCode::SUCCESS;
2664 ATH_MSG_ERROR(
"Neither Tau32 nor Tau2+Tau3 moments are available on the jet, please make sure one of these options is available before calling the tool");
2665 return StatusCode::FAILURE;
2670 static const SG::AuxElement::Accessor<float> accTau1wta(
"Tau1_wta");
2671 static const SG::AuxElement::Accessor<float> accTau2wta(
"Tau2_wta");
2672 static const SG::AuxElement::Accessor<float> accTau21wta(
"Tau21_wta");
2673 static const SG::AuxElement::Accessor<float> accTau1WTA(
"Tau1_WTA");
2674 static const SG::AuxElement::Accessor<float> accTau2WTA(
"Tau2_WTA");
2675 static const SG::AuxElement::Accessor<float> accTau21WTA(
"Tau21_WTA");
2676 static const bool Tau21wtawasAvailable = accTau21wta.isAvailable(
jet);
2677 static const bool Tau21WTAwasAvailable = accTau21WTA.isAvailable(
jet);
2678 static const bool TauNNwtawasAvailable = accTau2wta.isAvailable(
jet) && accTau1wta.isAvailable(
jet);
2679 static const bool TauNNWTAwasAvailable = accTau2WTA.isAvailable(
jet) && accTau1WTA.isAvailable(
jet);
2682 if (Tau21wtawasAvailable)
2684 if (!accTau21wta.isAvailable(
jet))
2686 ATH_MSG_ERROR(
"The Tau21_wta moment was previously available but is not available on this jet. This functionality is not supported.");
2687 return StatusCode::FAILURE;
2689 const float value = accTau21wta(constJet);
2690 accTau21wta(
jet) = shift*value;
2691 return StatusCode::SUCCESS;
2693 if (Tau21WTAwasAvailable)
2695 if (!accTau21WTA.isAvailable(
jet))
2697 ATH_MSG_ERROR(
"The Tau21_WTA moment was previously available but is not available on this jet. This functionality is not supported.");
2698 return StatusCode::FAILURE;
2700 const float value = accTau21WTA(constJet);
2701 accTau21WTA(
jet) = shift*value;
2702 return StatusCode::SUCCESS;
2704 if (TauNNwtawasAvailable)
2706 if (! (accTau2wta.isAvailable(
jet) && accTau1wta.isAvailable(
jet)) )
2708 ATH_MSG_ERROR(
"The Tau2_wta and Tau1_wta moments were previously available but are not available on this jet. This functionality is not supported.");
2709 return StatusCode::FAILURE;
2711 const float tau2 = accTau2wta(constJet);
2712 const float tau1 = accTau1wta(constJet);
2713 accTau21wta(
jet) = fabs(tau1) > 1.e-6 ? shift*(tau2/tau1) : -999;
2714 return StatusCode::SUCCESS;
2716 if (TauNNWTAwasAvailable)
2718 if (! (accTau2WTA.isAvailable(
jet) && accTau1WTA.isAvailable(
jet)) )
2720 ATH_MSG_ERROR(
"The Tau2_WTA and Tau1_WTA moments were previously available but are not available on this jet. This functionality is not supported.");
2721 return StatusCode::FAILURE;
2723 const float tau2 = accTau2WTA(constJet);
2724 const float tau1 = accTau1WTA(constJet);
2725 accTau21WTA(
jet) = fabs(tau1) > 1.e-6 ? shift*(tau2/tau1) : -999;
2726 return StatusCode::SUCCESS;
2729 ATH_MSG_ERROR(
"Neither Tau21_wta nor Tau1_wta+Tau2_wta moments are available on the jet, please make sure one of these options is available before calling the tool");
2730 return StatusCode::FAILURE;
2734 static const SG::AuxElement::Accessor<float> accTau2wta(
"Tau2_wta");
2735 static const SG::AuxElement::Accessor<float> accTau3wta(
"Tau3_wta");
2736 static const SG::AuxElement::Accessor<float> accTau32wta(
"Tau32_wta");
2737 static const SG::AuxElement::Accessor<float> accTau2WTA(
"Tau2_WTA");
2738 static const SG::AuxElement::Accessor<float> accTau3WTA(
"Tau3_WTA");
2739 static const SG::AuxElement::Accessor<float> accTau32WTA(
"Tau32_WTA");
2740 static const bool Tau32wtawasAvailable = accTau32wta.isAvailable(
jet);
2741 static const bool Tau32WTAwasAvailable = accTau32WTA.isAvailable(
jet);
2742 static const bool TauNNwtawasAvailable = accTau3wta.isAvailable(
jet) && accTau2wta.isAvailable(
jet);
2743 static const bool TauNNWTAwasAvailable = accTau3WTA.isAvailable(
jet) && accTau2WTA.isAvailable(
jet);
2746 if (Tau32wtawasAvailable)
2748 if (!accTau32wta.isAvailable(
jet))
2750 ATH_MSG_ERROR(
"The Tau32_wta moment was previously available but is not available on this jet. This functionality is not supported.");
2751 return StatusCode::FAILURE;
2753 const float value = accTau32wta(constJet);
2754 accTau32wta(
jet) = shift*value;
2755 return StatusCode::SUCCESS;
2757 if (Tau32WTAwasAvailable)
2759 if (!accTau32WTA.isAvailable(
jet))
2761 ATH_MSG_ERROR(
"The Tau32_WTA moment was previously available but is not available on this jet. This functionality is not supported.");
2762 return StatusCode::FAILURE;
2764 const float value = accTau32WTA(constJet);
2765 accTau32WTA(
jet) = shift*value;
2766 return StatusCode::SUCCESS;
2768 if (TauNNwtawasAvailable)
2770 if (! (accTau3wta.isAvailable(
jet) && accTau2wta.isAvailable(
jet)) )
2772 ATH_MSG_ERROR(
"The Tau3_wta and Tau2_wta moments were previously available but are not available on this jet. This functionality is not supported.");
2773 return StatusCode::FAILURE;
2775 const float tau3 = accTau3wta(constJet);
2776 const float tau2 = accTau2wta(constJet);
2777 accTau32wta(
jet) = fabs(tau2) > 1.e-6 ? shift*(tau3/tau2) : -999;
2778 return StatusCode::SUCCESS;
2780 if (TauNNWTAwasAvailable)
2782 if (! (accTau3WTA.isAvailable(
jet) && accTau2WTA.isAvailable(
jet)) )
2784 ATH_MSG_ERROR(
"The Tau3_WTA and Tau2_WTA moments were previously available but are not available on this jet. This functionality is not supported.");
2785 return StatusCode::FAILURE;
2787 const float tau3 = accTau3WTA(constJet);
2788 const float tau2 = accTau2WTA(constJet);
2789 accTau32WTA(
jet) = fabs(tau2) > 1.e-6 ? shift*(tau3/tau2) : -999;
2790 return StatusCode::SUCCESS;
2817 ATH_MSG_ERROR(
"Neither Tau32_wta nor Tau2_wta+Tau3_wta moments are available on the jet, please make sure one of these options is available before calling the tool");
2818 return StatusCode::FAILURE;
2823 static const SG::AuxElement::Accessor<float> accD2(
"D2");
2824 static const SG::AuxElement::Accessor<float> accECF1(
"ECF1");
2825 static const SG::AuxElement::Accessor<float> accECF2(
"ECF2");
2826 static const SG::AuxElement::Accessor<float> accECF3(
"ECF3");
2827 static const bool D2wasAvailable = accD2.isAvailable(
jet);
2828 static const bool ECFwasAvailable = accECF1.isAvailable(
jet) && accECF2.isAvailable(
jet) && accECF3.isAvailable(
jet);
2833 if (!accD2.isAvailable(
jet))
2835 ATH_MSG_ERROR(
"The D2 moment was previously available but is not available on this jet. This functionality is not supported.");
2836 return StatusCode::FAILURE;
2838 const float value = accD2(constJet);
2839 accD2(
jet) = shift*value;
2840 return StatusCode::SUCCESS;
2842 if (ECFwasAvailable)
2844 if (! (accECF1.isAvailable(constJet) && accECF2.isAvailable(constJet) && accECF3.isAvailable(constJet)) )
2846 ATH_MSG_ERROR(
"The ECF1, ECF2, and ECF3 moments were previously available but are not available on this jet. This functionality is not supported.");
2847 return StatusCode::FAILURE;
2849 const float ecf1 = accECF1(constJet);
2850 const float ecf2 = accECF2(constJet);
2851 const float ecf3 = accECF3(constJet);
2852 accD2(
jet) = fabs(ecf2) > 1.e-6 ? shift * (pow(ecf1/ecf2,3)*ecf3) : -999;
2853 return StatusCode::SUCCESS;
2871 ATH_MSG_ERROR(
"Neither D2 nor ECF1+ECF2+ECF3 moments are available on the jet, please make sure one of these options is available before calling the tool");
2872 return StatusCode::FAILURE;
2877 static const SG::AuxElement::Accessor<float> accC2(
"C2");
2878 static const SG::AuxElement::Accessor<float> accECF1(
"ECF1");
2879 static const SG::AuxElement::Accessor<float> accECF2(
"ECF2");
2880 static const SG::AuxElement::Accessor<float> accECF3(
"ECF3");
2881 static const bool C2wasAvailable = accC2.isAvailable(
jet);
2882 static const bool ECFwasAvailable = accECF1.isAvailable(
jet) && accECF2.isAvailable(
jet) && accECF3.isAvailable(
jet);
2887 if (!accC2.isAvailable(
jet))
2889 ATH_MSG_ERROR(
"The C2 moment was previously available but is not available on this jet. This functionality is not supported.");
2890 return StatusCode::FAILURE;
2892 const float value = accC2(constJet);
2893 accC2(
jet) = shift*value;
2894 return StatusCode::SUCCESS;
2896 if (ECFwasAvailable)
2898 if (! (accECF1.isAvailable(constJet) && accECF2.isAvailable(constJet) && accECF3.isAvailable(constJet)) )
2900 ATH_MSG_ERROR(
"The ECF1, ECF2, and ECF3 moments were previously available but are not available on this jet. This functionality is not supported.");
2901 return StatusCode::FAILURE;
2903 const float ecf1 = accECF1(constJet);
2904 const float ecf2 = accECF2(constJet);
2905 const float ecf3 = accECF3(constJet);
2906 accC2(
jet) = fabs(ecf2) > 1.e-6 ? shift * (ecf3*ecf1/pow(ecf2,2)) : -999;
2907 return StatusCode::SUCCESS;
2910 ATH_MSG_ERROR(
"Neither C2 nor ECF1+ECF2+ECF3 moments are available on the jet, please make sure one of these options is available before calling the tool");
2911 return StatusCode::FAILURE;
2916 static const SG::AuxElement::Accessor<float> accQw(
"Qw");
2919 if (accQw.isAvailable(constJet))
2921 const float value = accQw(constJet);
2922 accQw(
jet) = shift*value;
2923 return StatusCode::SUCCESS;
2926 ATH_MSG_ERROR(
"Qw moment is not available on the jet, please make sure to set Qw before calling the tool");
2927 return StatusCode::FAILURE;
2934 if (TagScaleFactorwasAvailable)
2938 ATH_MSG_ERROR(
"TagScaleFactor was previously available but is not available on this jet. This functionality is not supported.");
2939 return StatusCode::FAILURE;
2942 if ( value < 1e-5 ) {
2944 return StatusCode::SUCCESS;
2956 if ( shift*value < 0.0 ){
2961 return StatusCode::SUCCESS;
2966 if ( shift*value < 0.0 ){
2972 return StatusCode::SUCCESS;
2977 if ( shift*value < 0.0 ){
2982 return StatusCode::SUCCESS;
2986 ATH_MSG_ERROR(
"TagScaleFactor is not available on the jet, please make sure you called BoostedJetTaggers tag() function before calling this function.");
2987 return StatusCode::FAILURE;
2994 if (TagScaleFactorwasAvailable)
2998 ATH_MSG_ERROR(
"TagScaleFactor was previously available but is not available on this jet. This functionality is not supported.");
2999 return StatusCode::FAILURE;
3002 if ( value < 1e-5 ) {
3004 return StatusCode::SUCCESS;
3011 float sigeffSF = 1.0;
3012 float updated_efficiency =
efficiency + shift;
3014 if ( updated_efficiency < 1e-5 ) updated_efficiency=1e-5;
3015 if ( updated_efficiency > 1.0-1e-5 ) updated_efficiency=1.0-1e-5;
3022 return StatusCode::SUCCESS;
3026 if ( std::abs(effSF - 1.0) < 1e-5 && std::abs(shift)>0 ) {
3031 float variatedIneffSFsig = (1. - sigeffSF*updated_efficiency)/(1. - updated_efficiency);
3036 return StatusCode::SUCCESS;
3041 return StatusCode::SUCCESS;
3045 ATH_MSG_ERROR(
"TagScaleFactor is not available on the jet, please make sure you called BoostedJetTaggers tag() function before calling this function.");
3046 return StatusCode::FAILURE;
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
#define JESUNC_ERROR_CODE
#define JESUNC_SAFE_DELETE(T)
#define ATLAS_CTORDTOR_NOT_THREAD_SAFE
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
Return value from object correction CP tools.
@ Error
Some error happened during the object correction.
@ OutOfValidityRange
Input object is out of validity range.
@ Ok
The correction was done successfully.
This module implements the central registry for handling systematic uncertainties with CP tools.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Class to wrap a set of SystematicVariations.
std::string name() const
returns: the systematics joined into a single string.
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
std::string basename() const
description: the base name, i.e.
const std::string & name() const
description: the full systematics name, for use in strings, etc.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual StatusCode setCaloTerm(UncertaintyGroup *caloComp)
virtual StatusCode setCombWeightParam(const CompParametrization::TypeEnum param)
virtual StatusCode setTAWeights(const UncertaintyHistogram *TAWeights)
virtual StatusCode setCombWeightMassDefs(const CompMassDef::TypeEnum caloMassDef, const CompMassDef::TypeEnum TAMassDef)
virtual StatusCode setCaloWeights(const UncertaintyHistogram *caloWeights)
virtual StatusCode setTATerm(UncertaintyGroup *TAComp)
PileupComp::TypeEnum pileupType
CompScaleVar::TypeEnum scaleVar
CompMassDef::TypeEnum massDef
std::vector< TString > uncNames
std::vector< LargeRJetTruthLabel::TypeEnum > LargeRJetTruthLabels
FlavourComp::TypeEnum flavourType
CompParametrization::TypeEnum parametrization
CombMassComp::TypeEnum combMassType
std::vector< TString > subComps
virtual const TH2D * getMatrix() const
virtual StatusCode initializeForPt(const JetUncertaintiesTool &uncTool)
CompCorrelation::TypeEnum correlation
CompCategory::TypeEnum category
JetFourMomAccessor is an extension of JetAttributeAccessor::AccessorWrapper<xAOD::JetFourMom_t> Acces...
virtual TString getName() const
virtual TString getName() const
virtual bool isAlwaysZero() const
virtual std::set< CompScaleVar::TypeEnum > getScaleVars() const
virtual StatusCode initialize(const CP::SystematicSet &systConfig, const std::vector< UncertaintyGroup * > &groups)
static std::string release
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
std::string m_name
The primary name part of this expression.
TypeEnum stringToEnum(const TString &type)
TString enumToString(const TypeEnum type)
TypeEnum stringToEnum(const TString &type)
TString getJetScaleString(const TypeEnum type)
TString enumToString(const TypeEnum type)
TypeEnum stringToEnum(const TString &type)
bool includesMass(const TypeEnum type)
TString enumToString(const TypeEnum type)
TypeEnum stringToEnum(const TString &type)
bool isRelResolutionType(const TypeEnum type)
bool isResolutionType(const TypeEnum type)
TString enumToString(const TypeEnum type)
bool isTypeObjFromString(const std::string &str)
bool getTypeObjFromString(const std::string &str, T &obj)
bool vectorize(const TString &str, const TString &sep, std::vector< T > &result)
TString findFilePath(const TString &fileName, const TString &path="", const TString &calibArea="")
Jet_v1 Jet
Definition of the current "jet version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.