Skip to content
Snippets Groups Projects
Commit dda8567e authored by Baptiste Ravina's avatar Baptiste Ravina Committed by Frank Winklmeier
Browse files

CPAlgorithms: add truth-b-label to jets for JES uncertainties

CPAlgorithms: add truth-b-label to jets for JES uncertainties
parent e4de25cb
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@
#include <SystematicsHandles/SysCopyHandle.h>
#include <SystematicsHandles/SysListHandle.h>
#include <optional>
namespace CP
{
/// \brief an algorithm for calling \ref ICPJetUncertaintiesTool
......@@ -69,6 +71,11 @@ namespace CP
private:
std::vector<CP::SystematicSet> m_systematicsVectorOnlyJERPseudoData;
private:
Gaudi::Property<std::string> m_isJESbtag {this, "isJESbtagLabel", "IsBjet", "The label to apply to truth b-tagged jets, for JES flavour uncertainties"};
std::optional<SG::AuxElement::Decorator<char>> m_decIsJESbtag;
std::optional<SG::AuxElement::Accessor<int>> m_accTruthLabel;
};
}
......
......@@ -44,6 +44,10 @@ namespace CP
ANA_CHECK (m_systematicsList.initialize());
ANA_CHECK (m_outOfValidity.initialize());
if (!m_isJESbtag.empty()) m_decIsJESbtag.emplace(m_isJESbtag);
const std::string labelB = "PartonTruthLabelID";
m_accTruthLabel.emplace(labelB);
// CPU-optimisation: differentiate the systematics for the two tools
// in initialisation rather than execution
for (const auto&sys : m_systematicsList.systematicsVector())
......@@ -70,6 +74,10 @@ namespace CP
ANA_CHECK (m_jetHandle.getCopy (jets, sys));
for (xAOD::Jet *jet : *jets)
{
// we need to tell the JES flavour uncertainty tool whether each jet is b-tagged at truth-level
if (m_decIsJESbtag) {
(*m_decIsJESbtag)(*jet) = (*m_accTruthLabel)(*jet) == 5 ;
}
if (m_preselection.getBool (*jet, sys))
{
ANA_CHECK_CORRECTION (m_outOfValidity, *jet, m_uncertaintiesTool->applyCorrection (*jet));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment