ATLAS Offline Software
DiTauEfficiencyCorrectionsAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 //
10 // includes
11 //
12 
14 
15 //
16 // method implementations
17 //
18 
19 namespace CP
20 {
21 
23  initialize ()
24  {
26  {
27  ANA_MSG_ERROR ("no scale factor decoration name set");
28  return StatusCode::FAILURE;
29  }
30 
38  return StatusCode::SUCCESS;
39  }
40 
41 
42 
44  execute ()
45  {
46  for (const auto& sys : m_systematicsList.systematicsVector())
47  {
48  ANA_CHECK (m_efficiencyCorrectionsTool->applySystematicVariation (sys));
49  const xAOD::DiTauJetContainer *taus = nullptr;
51  for (const xAOD::DiTauJet *tau : *taus)
52  {
53  if (m_preselection.getBool (*tau, sys))
54  {
55  double sf = 0;
56  ANA_CHECK_CORRECTION (m_outOfValidity, *tau, m_efficiencyCorrectionsTool->getEfficiencyScaleFactor (*tau, sf));
58  } else {
60  }
61  }
62  }
63  return StatusCode::SUCCESS;
64  }
65 }
CP::SysWriteDecorHandle::set
void set(const SG::AuxElement &object, const T &value, const CP::SystematicSet &sys) const
set the object decoration for the given systematic
CP::DiTauEfficiencyCorrectionsAlg::m_scaleFactorDecoration
SysWriteDecorHandle< float > m_scaleFactorDecoration
the decoration for the muon scale factor
Definition: DiTauEfficiencyCorrectionsAlg.h:58
DiTauEfficiencyCorrectionsAlg.h
CP::SysListHandle::addSystematics
StatusCode addSystematics(const CP::SystematicSet &recommended, const CP::SystematicSet &affecting)
register a set of affecting variables for the current algorithm (usually obtained from an CP::ISystem...
Definition: SysListHandle.cxx:48
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP::SysReadHandle::retrieve
::StatusCode retrieve(const T *&object, const CP::SystematicSet &sys) const
retrieve the object for the given name
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
CP::DiTauEfficiencyCorrectionsAlg::m_tauHandle
SysReadHandle< xAOD::DiTauJetContainer > m_tauHandle
the tau collection we run on
Definition: DiTauEfficiencyCorrectionsAlg.h:44
CP::DiTauEfficiencyCorrectionsAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition: DiTauEfficiencyCorrectionsAlg.h:49
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::DiTauEfficiencyCorrectionsAlg::execute
StatusCode execute() override
Definition: DiTauEfficiencyCorrectionsAlg.cxx:44
CP::DiTauEfficiencyCorrectionsAlg::m_outOfValidity
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
Definition: DiTauEfficiencyCorrectionsAlg.h:54
CP::invalidScaleFactor
constexpr float invalidScaleFactor()
the decoration value to use if there is no valid scale factor decoration
Definition: SysWriteDecorHandle.h:31
CP::SysReadHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle)
initialize this handle
CP::SysListHandle::initialize
::StatusCode initialize()
intialize this property
Definition: SysListHandle.cxx:69
CP::SysReadSelectionHandle::getBool
bool getBool(const SG::AuxElement &element, const CP::SystematicSet &sys) const
get the selection as a bool
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::SysWriteDecorHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize this handle
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
CP::DiTauEfficiencyCorrectionsAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition: DiTauEfficiencyCorrectionsAlg.h:40
ANA_CHECK_CORRECTION
#define ANA_CHECK_CORRECTION(helper, object, expr)
a helper check macro to work with OutOfValidityHelper
Definition: OutOfValidityHelper.h:132
CP::DiTauEfficiencyCorrectionsAlg::m_efficiencyCorrectionsTool
ToolHandle< TauAnalysisTools::IDiTauEfficiencyCorrectionsTool > m_efficiencyCorrectionsTool
the smearing tool
Definition: DiTauEfficiencyCorrectionsAlg.h:36
CP::SysWriteDecorHandle::empty
virtual bool empty() const noexcept override
whether we have a name configured
CP::OutOfValidityHelper::initialize
::StatusCode initialize()
standard initialize
Definition: OutOfValidityHelper.cxx:25
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
CP::SysReadSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysReadSelectionHandle.cxx:34
xAOD::DiTauJet_v1
Definition: DiTauJet_v1.h:31
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
CP::DiTauEfficiencyCorrectionsAlg::initialize
StatusCode initialize() override
Definition: DiTauEfficiencyCorrectionsAlg.cxx:23