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());
1073 ATH_MSG_ERROR(
"Failed to build calo-group for combined mass component: " << component.
name.Data());
1080 if (caloComps.size() != caloMassDefs.size())
1082 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());
1087 for (
size_t iComp = 0; iComp < caloComps.size(); ++iComp)
1093 caloCompH.
name = caloComps.at(iComp);
1098 ATH_MSG_ERROR(
"Failed to parse calo mass definition " << iComp <<
" (" << caloMassDefs.at(iComp).Data() <<
") for combined mass component: " << component.
name.Data());
1128 ATH_MSG_ERROR(
"Failed to build TA-group for combined mass component: " << component.
name.Data());
1135 if (TAComps.size() != TAMassDefs.size())
1137 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());
1142 for (
size_t iComp = 0; iComp < TAComps.size(); ++iComp)
1148 TACompH.
name = TAComps.at(iComp);
1153 ATH_MSG_ERROR(
"Failed to parse TA mass definition " << iComp <<
" (" << TAMassDefs.at(iComp).Data() <<
") for combined mass component: " << component.
name.Data());
1169 if (cmuc->
setTATerm(TAGroup).isFailure())
1177 else if (component.
name.Contains(
"Large",TString::kIgnoreCase) && component.
name.Contains(
"Topology",TString::kIgnoreCase))
1187 ATH_MSG_ERROR(Form(
"No LargeRJetTruthLabels specified for Large-R jet topology component %s",component.
name.Data()));
1237 ATH_MSG_ERROR(
"Failed to find the type of component to build: " << component.
name.Data());
1253 return baseNames.find(systematic.
basename()) != baseNames.end();
1280 const std::set<CompScaleVar::TypeEnum> scaleVars = systematic.
getScaleVars();
1282 for (
size_t iFilter = 0; iFilter <
m_systFilters.size(); ++iFilter)
1286 passesFilter =
true;
1307 ATH_MSG_ERROR(
"Failed to add systematic to list of recommended systematics: " << systematic.
name());
1308 return StatusCode::FAILURE;
1311 return StatusCode::SUCCESS;
1323 std::string remappedName = systConfig.
name();
1324 size_t found = remappedName.find(
"_PseudoData");
1325 if (found != std::string::npos) {
1326 remappedName.erase(found, std::string(
"_PseudoData").
length());
1332 return StatusCode::FAILURE;
1337 return StatusCode::FAILURE;
1343 return StatusCode::FAILURE;
1348 return StatusCode::SUCCESS;
1354 std::unordered_map<CP::SystematicSet,CP::SystematicSet>::iterator iter =
m_systFilterMap.find(systConfig);
1356 filteredSet = iter->second;
1361 return StatusCode::FAILURE;
1365 return StatusCode::SUCCESS;
1371 std::unordered_map<CP::SystematicSet,UncertaintySet*>::iterator iter =
m_systSetMap.find(filteredSet);
1376 uncSet = iter->second;
1384 ATH_MSG_ERROR(
"Failed to create UncertaintySet for filtered CP::SystematicSet: " << filteredSet.
name());
1386 return StatusCode::FAILURE;
1388 m_systSetMap.insert(std::make_pair(filteredSet,uncSet));
1391 return StatusCode::SUCCESS;
1405 if (
release.BeginsWith(
"2011_"))
1407 else if (
release.BeginsWith(
"2012_"))
1409 else if (
release.BeginsWith(
"2015_") ||
release.BeginsWith(
"2016"))
1419 ATH_MSG_FATAL(
"Tool must be initialized before calling getRefMu");
1424 ATH_MSG_FATAL(
"Tool contains a histogram for refMu, cannot return float");
1434 ATH_MSG_FATAL(
"Tool must be initialized before calling getRefNPV");
1439 ATH_MSG_FATAL(
"Tool contains a histogram for refNPV, cannot return float");
1449 ATH_MSG_FATAL(
"Tool must be initialized before calling getRefMu");
1459 ATH_MSG_FATAL(
"Tool must be initialized before calling getRefNPV");
1470 ATH_MSG_FATAL(
"Tool must be initialized before calling getNumComponents");
1486 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentIndex");
1490 for (
size_t iComp = 0; iComp <
m_groups.size(); ++iComp)
1491 if (
m_groups.at(iComp)->getName().CompareTo(name,TString::kIgnoreCase) == 0)
1494 ATH_MSG_ERROR(
"Failed to find index for requested component: " << name.Data());
1502 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentName");
1517 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentDesc");
1532 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentCategory");
1547 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentIsReducible");
1562 ATH_MSG_FATAL(
"Tool must be initialized before asking for information pertaining to a given component index");
1563 return StatusCode::FAILURE;
1569 return StatusCode::FAILURE;
1573 return StatusCode::SUCCESS;
1578 return varSet.size() == 1 && *(varSet.begin()) == var;
1674 if (!eInfo)
return false;
1675 return getValidity(
index,
jet,*eInfo,scaleVar);
1681 ATH_MSG_FATAL(
"Tool must be initialized before calling getValidity");
1703 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());
1725 return getUncertainty(
index,
jet,*eInfo,scaleVar);
1731 ATH_MSG_FATAL(
"Tool must be initialized before calling getUncertainty");
1757 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());
1778 if (!eInfo)
return false;
1779 return getValidUncertainty(
index,unc,
jet,*eInfo,scaleVar);
1785 ATH_MSG_FATAL(
"Tool must be initialized before calling getValidUncertainty");
1808 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());
1831 ATH_MSG_FATAL(
"Tool must be initialized before calling getNominalResolution");
1836 ATH_MSG_ERROR(
"The ResolutionHelper class was not created");
1841 std::tuple<const UncertaintyHistogram*,CompParametrization::TypeEnum,CompMassDef::TypeEnum> resolution =
m_resHelper->getNominalResolution(smearType,topology,readMC);
1849 ATH_MSG_ERROR(
"Parametrization involves mass but mass def is unknown");
1854 return readHistoFromParam(
jet,*std::get<0>(resolution),std::get<1>(resolution),std::get<2>(resolution));
1882 value = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.Eta());
1885 value = histo.getValue(jet4vec.Pt()*
m_energyScale,fabs(jet4vec.Eta()));
1891 value = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.M()/jet4vec.Pt());
1894 value = histo.getValue(jet4vec.Pt()*
m_energyScale,log(jet4vec.M()/jet4vec.Pt()));
1897 value = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.M()/jet4vec.Pt(),jet4vec.Eta());
1900 value = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.M()/jet4vec.Pt(),fabs(jet4vec.Eta()));
1909 value = histo.getValue(jet4vec.E()*
m_energyScale,log(jet4vec.M()/jet4vec.E()));
1912 value = histo.getValue(jet4vec.E()*
m_energyScale,log(jet4vec.M()/jet4vec.E()),jet4vec.Eta());
1915 value = histo.getValue(jet4vec.E()*
m_energyScale,log(jet4vec.M()/jet4vec.E()),fabs(jet4vec.Eta()));
1918 ATH_MSG_ERROR(
"Failed to read histogram due to unknown parametrization type in " <<
getName());
1935 if (caloRes == 0 || TARes == 0)
return 0;
1937 const double caloFactor = (caloRes == 0) ? 0 : 1./(caloRes*caloRes);
1938 const double TAFactor = ( TARes == 0) ? 0 : 1./(TARes*TARes);
1940 if (caloFactor + TAFactor == 0)
return 0;
1942 return caloFactor/(caloFactor+TAFactor);
1956 if (caloRes == 0 || TARes == 0)
return 0;
1958 const double caloFactor = 1./(caloRes*caloRes);
1959 const double TAFactor = 1./(TARes*TARes);
1961 if (caloFactor + TAFactor == 0)
return 0;
1963 return TAFactor/(caloFactor+TAFactor);
1976 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentCategories");
1983 std::unordered_set<std::string> categories;
1984 for (
size_t iComp = 0; iComp <
m_groups.size(); ++iComp)
1988 std::vector<std::string> categoryStrings;
1989 for (std::unordered_set<std::string>::const_iterator iter = categories.begin() ; iter != categories.end(); ++iter)
1990 categoryStrings.push_back(*iter);
1992 return categoryStrings;
1999 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentsInCategory");
2012 std::vector<size_t> components;
2013 for (
size_t iComp = 0; iComp <
m_groups.size(); ++iComp)
2014 if (
m_groups.at(iComp)->getCategory() == categoryEnum)
2015 components.push_back(iComp);
2024 ATH_MSG_FATAL(
"Tool must be initialized before calling getComponentNamesInCategory");
2029 std::vector<std::string> names;
2030 for (
size_t iComp = 0; iComp < components.size(); ++iComp)
2043TH2D* JetUncertaintiesTool::getPtCorrelationMatrix
ATLAS_NOT_THREAD_SAFE (
const int numBins,
const double minPt,
const double maxPt,
const double valEta)
2045 return getPtCorrelationMatrix(numBins,minPt,maxPt,valEta,valEta);
2048TH2D* JetUncertaintiesTool::getPtCorrelationMatrix
ATLAS_NOT_THREAD_SAFE (
const int numBins,
const double minPt,
const double maxPt,
const double valEta1,
const double valEta2)
2052 ATH_MSG_FATAL(
"Tool must be initialized before calling getCorrelationMatrix");
2056 std::cout <<
"Creating with max values " << valEta1 <<
" " << valEta2 << std::endl;
2057 CorrelationMatrix corrMat(Form(
"%s_varpt_eta%.2f_eta%.2f",m_name.c_str(),valEta1,valEta2),numBins,minPt*m_energyScale,maxPt*m_energyScale,valEta1,valEta2);
2063TH2D* JetUncertaintiesTool::getEtaCorrelationMatrix
ATLAS_NOT_THREAD_SAFE (
const int numBins,
const double minEta,
const double maxEta,
const double valPt)
2065 return getEtaCorrelationMatrix(numBins,minEta,maxEta,valPt,valPt);
2068TH2D* JetUncertaintiesTool::getEtaCorrelationMatrix
ATLAS_NOT_THREAD_SAFE (
const int numBins,
const double minEta,
const double maxEta,
const double valPt1,
const double valPt2)
2072 ATH_MSG_FATAL(
"Tool must be initialized before calling getCorrelationMatrix");
2076 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);
2077 if (corrMat.initializeForEta(*this).isFailure())
2079 return new TH2D(*corrMat.getMatrix());
2093 return applyCorrection(
jet,*eInfo);
2100 ATH_MSG_FATAL(
"Tool must be initialized before calling applyCorrection");
2112 std::vector< std::pair<CompScaleVar::TypeEnum,double> > uncSet;
2113 const std::vector< std::pair<CompScaleVar::TypeEnum,bool> > validitySet =
m_currentUncSet->getValidUncertaintySet(uncSet,
jet,eInfo);
2116 bool allValid =
true;
2117 for (
size_t iVar = 0; iVar < validitySet.size(); ++iVar)
2119 const bool validity = validitySet.at(iVar).second;
2134 std::vector<CompScaleVar::TypeEnum> scaleVars =
m_currentUncSet->getScaleVars();
2135 bool hasMassRes =
false;
2136 bool hasPtRes =
false;
2137 bool hasFvRes =
false;
2144 ATH_MSG_ERROR(
"Varying both absolute and relative mass resolution components simultaneously is not supported");
2154 ATH_MSG_ERROR(
"Varying both absolute and relative pT resolution components simultaneously is not supported");
2164 ATH_MSG_ERROR(
"Varying both absolute and relative four-vector resolution components simultaneously is not supported");
2173 for (
size_t iVar = 0; iVar < uncSet.size(); ++iVar)
2177 const double shift = 1 + uncSet.at(iVar).second;
2178 const double smear = uncSet.at(iVar).second;
2182 double smearingFactor = 1;
2244 ATH_MSG_ERROR(
"Smearing the mass without specifying the topology is not supported");
2250 ATH_MSG_ERROR(
"Smearing the mass using multiple topology definitions is not supported");
2279 return correctedCopy(input,output,*eInfo);
2300 return applyContainerCorrection(inputs,*eInfo);
2308 for (
size_t iJet = 0; iJet < inputs.size(); ++iJet)
2323 if (nc_this->applySystematicVariation(syst) != StatusCode::SUCCESS)
2326 if (
evtStore()->retrieve(eInfo,
"EventInfo").isFailure()) {
2327 ATH_MSG_ERROR(
"Failed to retrieve EventInfo in applyContainerCorrection");
2336 static const SG::AuxElement::ConstAccessor<float> accNPV(
"NPV");
2337 static const SG::AuxElement::Decorator<float> decNPV(
"NPV");
2340 static const std::string eiName =
"EventInfo";
2342 if (evtStore()->retrieve(ei, eiName).isFailure())
2344 ATH_MSG_ERROR(
"Failed to retrieve default EventInfo object");
2349 if (accNPV.isAvailable(*ei)) {
2355 if (evtStore()->retrieve(vertices,
"PrimaryVertices").isFailure())
2357 ATH_MSG_ERROR(
"Failed to retrieve default NPV value from PrimaryVertices");
2363 for (itr = vertices->
begin(); itr != vertices->
end(); ++itr)
2364 if ( (*itr)->nTrackParticles() > 1)
2496 else if (variation < 0 && !m_resHelper->smearOnlyMC())
2502 const double sigmaNom = std::max(sigmaMC,sigmaData);
2510 const double sigmaSmear = sqrt(pow(sigmaNom + fabs(variation)*relativeFactor,2) - pow(sigmaNom,2));
2514 ATH_MSG_ERROR(
"A seed of 1e5 times the jet phi is used in JetCalibTools so using it here leads to correlated smearing");
2524 if(seed == 0) seed =
m_isData ? 34545654 : 45583453;
2525 m_rand.SetSeed(seed);
2530 double smearingFactor = -1;
2531 while (smearingFactor < 0)
2532 smearingFactor = m_rand.Gaus(1.,sigmaSmear);
2533 return smearingFactor;
2545 static const SG::AuxElement::Accessor<float> accD12(
"Split12");
2548 if (accD12.isAvailable(constJet))
2550 const float value = accD12(constJet);
2551 accD12(
jet) = shift*value;
2552 return StatusCode::SUCCESS;
2555 ATH_MSG_ERROR(
"Split12 moment (D12) is not available on the jet, please make sure to set Split12 before calling the tool");
2556 return StatusCode::FAILURE;
2561 static const SG::AuxElement::Accessor<float> accD23(
"Split23");
2564 if (accD23.isAvailable(constJet))
2566 const float value = accD23(constJet);
2567 accD23(
jet) = shift*value;
2568 return StatusCode::SUCCESS;
2571 ATH_MSG_ERROR(
"Split23 moment (D23) is not available on the jet, please make sure to set Split23 before calling the tool");
2572 return StatusCode::FAILURE;
2577 static const SG::AuxElement::Accessor<float> accTau1(
"Tau1");
2578 static const SG::AuxElement::Accessor<float> accTau2(
"Tau2");
2579 static const SG::AuxElement::Accessor<float> accTau21(
"Tau21");
2580 static const bool Tau21wasAvailable = accTau21.isAvailable(
jet);
2581 static const bool TauNNwasAvailable = accTau2.isAvailable(
jet) && accTau1.isAvailable(
jet);
2584 if (Tau21wasAvailable)
2586 if (!accTau21.isAvailable(
jet))
2588 ATH_MSG_ERROR(
"The Tau21 moment was previously available but is not available on this jet. This functionality is not supported.");
2589 return StatusCode::FAILURE;
2591 const float value = accTau21(constJet);
2592 accTau21(
jet) = shift*value;
2593 return StatusCode::SUCCESS;
2595 if (TauNNwasAvailable)
2597 if (! (accTau2.isAvailable(
jet) && accTau1.isAvailable(
jet)) )
2599 ATH_MSG_ERROR(
"The Tau2 and Tau1 moments were previously available but are not available on this jet. This functionality is not supported.");
2600 return StatusCode::FAILURE;
2602 const float tau2 = accTau2(constJet);
2603 const float tau1 = accTau1(constJet);
2604 accTau21(
jet) = fabs(tau1) > 1.e-6 ? shift*(tau2/tau1) : -999;
2605 return StatusCode::SUCCESS;
2620 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.");
2621 return StatusCode::FAILURE;
2626 static const SG::AuxElement::Accessor<float> accTau2(
"Tau2");
2627 static const SG::AuxElement::Accessor<float> accTau3(
"Tau3");
2628 static const SG::AuxElement::Accessor<float> accTau32(
"Tau32");
2629 static const bool Tau32wasAvailable = accTau32.isAvailable(
jet);
2630 static const bool TauNNwasAvailable = accTau3.isAvailable(
jet) && accTau2.isAvailable(
jet);
2633 if (Tau32wasAvailable)
2635 if (!accTau32.isAvailable(
jet))
2637 ATH_MSG_ERROR(
"The Tau32 moment was previously available but is not available on this jet. This functionality is not supported.");
2638 return StatusCode::FAILURE;
2640 const float value = accTau32(constJet);
2641 accTau32(
jet) = shift*value;
2642 return StatusCode::SUCCESS;
2644 if (TauNNwasAvailable)
2646 if (! (accTau3.isAvailable(
jet) && accTau2.isAvailable(
jet)) )
2648 ATH_MSG_ERROR(
"The Tau3 and Tau2 moments were previously available but are not available on this jet. This functionality is not supported.");
2649 return StatusCode::FAILURE;
2651 const float tau3 = accTau3(constJet);
2652 const float tau2 = accTau2(constJet);
2653 accTau32(
jet) = fabs(tau2) > 1.e-6 ? shift*(tau3/tau2) : -999;
2654 return StatusCode::SUCCESS;
2669 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");
2670 return StatusCode::FAILURE;
2675 static const SG::AuxElement::Accessor<float> accTau1wta(
"Tau1_wta");
2676 static const SG::AuxElement::Accessor<float> accTau2wta(
"Tau2_wta");
2677 static const SG::AuxElement::Accessor<float> accTau21wta(
"Tau21_wta");
2678 static const SG::AuxElement::Accessor<float> accTau1WTA(
"Tau1_WTA");
2679 static const SG::AuxElement::Accessor<float> accTau2WTA(
"Tau2_WTA");
2680 static const SG::AuxElement::Accessor<float> accTau21WTA(
"Tau21_WTA");
2681 static const bool Tau21wtawasAvailable = accTau21wta.isAvailable(
jet);
2682 static const bool Tau21WTAwasAvailable = accTau21WTA.isAvailable(
jet);
2683 static const bool TauNNwtawasAvailable = accTau2wta.isAvailable(
jet) && accTau1wta.isAvailable(
jet);
2684 static const bool TauNNWTAwasAvailable = accTau2WTA.isAvailable(
jet) && accTau1WTA.isAvailable(
jet);
2687 if (Tau21wtawasAvailable)
2689 if (!accTau21wta.isAvailable(
jet))
2691 ATH_MSG_ERROR(
"The Tau21_wta moment was previously available but is not available on this jet. This functionality is not supported.");
2692 return StatusCode::FAILURE;
2694 const float value = accTau21wta(constJet);
2695 accTau21wta(
jet) = shift*value;
2696 return StatusCode::SUCCESS;
2698 if (Tau21WTAwasAvailable)
2700 if (!accTau21WTA.isAvailable(
jet))
2702 ATH_MSG_ERROR(
"The Tau21_WTA moment was previously available but is not available on this jet. This functionality is not supported.");
2703 return StatusCode::FAILURE;
2705 const float value = accTau21WTA(constJet);
2706 accTau21WTA(
jet) = shift*value;
2707 return StatusCode::SUCCESS;
2709 if (TauNNwtawasAvailable)
2711 if (! (accTau2wta.isAvailable(
jet) && accTau1wta.isAvailable(
jet)) )
2713 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.");
2714 return StatusCode::FAILURE;
2716 const float tau2 = accTau2wta(constJet);
2717 const float tau1 = accTau1wta(constJet);
2718 accTau21wta(
jet) = fabs(tau1) > 1.e-6 ? shift*(tau2/tau1) : -999;
2719 return StatusCode::SUCCESS;
2721 if (TauNNWTAwasAvailable)
2723 if (! (accTau2WTA.isAvailable(
jet) && accTau1WTA.isAvailable(
jet)) )
2725 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.");
2726 return StatusCode::FAILURE;
2728 const float tau2 = accTau2WTA(constJet);
2729 const float tau1 = accTau1WTA(constJet);
2730 accTau21WTA(
jet) = fabs(tau1) > 1.e-6 ? shift*(tau2/tau1) : -999;
2731 return StatusCode::SUCCESS;
2734 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");
2735 return StatusCode::FAILURE;
2739 static const SG::AuxElement::Accessor<float> accTau2wta(
"Tau2_wta");
2740 static const SG::AuxElement::Accessor<float> accTau3wta(
"Tau3_wta");
2741 static const SG::AuxElement::Accessor<float> accTau32wta(
"Tau32_wta");
2742 static const SG::AuxElement::Accessor<float> accTau2WTA(
"Tau2_WTA");
2743 static const SG::AuxElement::Accessor<float> accTau3WTA(
"Tau3_WTA");
2744 static const SG::AuxElement::Accessor<float> accTau32WTA(
"Tau32_WTA");
2745 static const bool Tau32wtawasAvailable = accTau32wta.isAvailable(
jet);
2746 static const bool Tau32WTAwasAvailable = accTau32WTA.isAvailable(
jet);
2747 static const bool TauNNwtawasAvailable = accTau3wta.isAvailable(
jet) && accTau2wta.isAvailable(
jet);
2748 static const bool TauNNWTAwasAvailable = accTau3WTA.isAvailable(
jet) && accTau2WTA.isAvailable(
jet);
2751 if (Tau32wtawasAvailable)
2753 if (!accTau32wta.isAvailable(
jet))
2755 ATH_MSG_ERROR(
"The Tau32_wta moment was previously available but is not available on this jet. This functionality is not supported.");
2756 return StatusCode::FAILURE;
2758 const float value = accTau32wta(constJet);
2759 accTau32wta(
jet) = shift*value;
2760 return StatusCode::SUCCESS;
2762 if (Tau32WTAwasAvailable)
2764 if (!accTau32WTA.isAvailable(
jet))
2766 ATH_MSG_ERROR(
"The Tau32_WTA moment was previously available but is not available on this jet. This functionality is not supported.");
2767 return StatusCode::FAILURE;
2769 const float value = accTau32WTA(constJet);
2770 accTau32WTA(
jet) = shift*value;
2771 return StatusCode::SUCCESS;
2773 if (TauNNwtawasAvailable)
2775 if (! (accTau3wta.isAvailable(
jet) && accTau2wta.isAvailable(
jet)) )
2777 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.");
2778 return StatusCode::FAILURE;
2780 const float tau3 = accTau3wta(constJet);
2781 const float tau2 = accTau2wta(constJet);
2782 accTau32wta(
jet) = fabs(tau2) > 1.e-6 ? shift*(tau3/tau2) : -999;
2783 return StatusCode::SUCCESS;
2785 if (TauNNWTAwasAvailable)
2787 if (! (accTau3WTA.isAvailable(
jet) && accTau2WTA.isAvailable(
jet)) )
2789 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.");
2790 return StatusCode::FAILURE;
2792 const float tau3 = accTau3WTA(constJet);
2793 const float tau2 = accTau2WTA(constJet);
2794 accTau32WTA(
jet) = fabs(tau2) > 1.e-6 ? shift*(tau3/tau2) : -999;
2795 return StatusCode::SUCCESS;
2822 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");
2823 return StatusCode::FAILURE;
2828 static const SG::AuxElement::Accessor<float> accD2(
"D2");
2829 static const SG::AuxElement::Accessor<float> accECF1(
"ECF1");
2830 static const SG::AuxElement::Accessor<float> accECF2(
"ECF2");
2831 static const SG::AuxElement::Accessor<float> accECF3(
"ECF3");
2832 static const bool D2wasAvailable = accD2.isAvailable(
jet);
2833 static const bool ECFwasAvailable = accECF1.isAvailable(
jet) && accECF2.isAvailable(
jet) && accECF3.isAvailable(
jet);
2838 if (!accD2.isAvailable(
jet))
2840 ATH_MSG_ERROR(
"The D2 moment was previously available but is not available on this jet. This functionality is not supported.");
2841 return StatusCode::FAILURE;
2843 const float value = accD2(constJet);
2844 accD2(
jet) = shift*value;
2845 return StatusCode::SUCCESS;
2847 if (ECFwasAvailable)
2849 if (! (accECF1.isAvailable(constJet) && accECF2.isAvailable(constJet) && accECF3.isAvailable(constJet)) )
2851 ATH_MSG_ERROR(
"The ECF1, ECF2, and ECF3 moments were previously available but are not available on this jet. This functionality is not supported.");
2852 return StatusCode::FAILURE;
2854 const float ecf1 = accECF1(constJet);
2855 const float ecf2 = accECF2(constJet);
2856 const float ecf3 = accECF3(constJet);
2857 accD2(
jet) = fabs(ecf2) > 1.e-6 ? shift * (pow(ecf1/ecf2,3)*ecf3) : -999;
2858 return StatusCode::SUCCESS;
2876 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");
2877 return StatusCode::FAILURE;
2882 static const SG::AuxElement::Accessor<float> accC2(
"C2");
2883 static const SG::AuxElement::Accessor<float> accECF1(
"ECF1");
2884 static const SG::AuxElement::Accessor<float> accECF2(
"ECF2");
2885 static const SG::AuxElement::Accessor<float> accECF3(
"ECF3");
2886 static const bool C2wasAvailable = accC2.isAvailable(
jet);
2887 static const bool ECFwasAvailable = accECF1.isAvailable(
jet) && accECF2.isAvailable(
jet) && accECF3.isAvailable(
jet);
2892 if (!accC2.isAvailable(
jet))
2894 ATH_MSG_ERROR(
"The C2 moment was previously available but is not available on this jet. This functionality is not supported.");
2895 return StatusCode::FAILURE;
2897 const float value = accC2(constJet);
2898 accC2(
jet) = shift*value;
2899 return StatusCode::SUCCESS;
2901 if (ECFwasAvailable)
2903 if (! (accECF1.isAvailable(constJet) && accECF2.isAvailable(constJet) && accECF3.isAvailable(constJet)) )
2905 ATH_MSG_ERROR(
"The ECF1, ECF2, and ECF3 moments were previously available but are not available on this jet. This functionality is not supported.");
2906 return StatusCode::FAILURE;
2908 const float ecf1 = accECF1(constJet);
2909 const float ecf2 = accECF2(constJet);
2910 const float ecf3 = accECF3(constJet);
2911 accC2(
jet) = fabs(ecf2) > 1.e-6 ? shift * (ecf3*ecf1/pow(ecf2,2)) : -999;
2912 return StatusCode::SUCCESS;
2915 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");
2916 return StatusCode::FAILURE;
2921 static const SG::AuxElement::Accessor<float> accQw(
"Qw");
2924 if (accQw.isAvailable(constJet))
2926 const float value = accQw(constJet);
2927 accQw(
jet) = shift*value;
2928 return StatusCode::SUCCESS;
2931 ATH_MSG_ERROR(
"Qw moment is not available on the jet, please make sure to set Qw before calling the tool");
2932 return StatusCode::FAILURE;
2939 if (TagScaleFactorwasAvailable)
2943 ATH_MSG_ERROR(
"TagScaleFactor was previously available but is not available on this jet. This functionality is not supported.");
2944 return StatusCode::FAILURE;
2947 if ( value < 1e-5 ) {
2949 return StatusCode::SUCCESS;
2961 if ( shift*value < 0.0 ){
2966 return StatusCode::SUCCESS;
2971 if ( shift*value < 0.0 ){
2977 return StatusCode::SUCCESS;
2982 if ( shift*value < 0.0 ){
2987 return StatusCode::SUCCESS;
2991 ATH_MSG_ERROR(
"TagScaleFactor is not available on the jet, please make sure you called BoostedJetTaggers tag() function before calling this function.");
2992 return StatusCode::FAILURE;
2999 if (TagScaleFactorwasAvailable)
3003 ATH_MSG_ERROR(
"TagScaleFactor was previously available but is not available on this jet. This functionality is not supported.");
3004 return StatusCode::FAILURE;
3007 if ( value < 1e-5 ) {
3009 return StatusCode::SUCCESS;
3016 float sigeffSF = 1.0;
3017 float updated_efficiency =
efficiency + shift;
3019 if ( updated_efficiency < 1e-5 ) updated_efficiency=1e-5;
3020 if ( updated_efficiency > 1.0-1e-5 ) updated_efficiency=1.0-1e-5;
3027 return StatusCode::SUCCESS;
3031 if ( std::abs(effSF - 1.0) < 1e-5 && std::abs(shift)>0 ) {
3036 float variatedIneffSFsig = (1. - sigeffSF*updated_efficiency)/(1. - updated_efficiency);
3041 return StatusCode::SUCCESS;
3046 return StatusCode::SUCCESS;
3050 ATH_MSG_ERROR(
"TagScaleFactor is not available on the jet, please make sure you called BoostedJetTaggers tag() function before calling this function.");
3051 return StatusCode::FAILURE;
#define ATH_MSG_WARNING(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.
StatusCode addSystematicToRecommended(const SystematicVariation &systematic)
description: add a systematic to the recommended set
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
void registerSystematic(const SystematicVariation &systematic)
description: add a systematic to the global registry set
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 StatusCode addComponent(UncertaintyComponent *component)
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.