ATLAS Offline Software
Loading...
Searching...
No Matches
XbbEfficiencyAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
9
10namespace CP
11{
12 StatusCode XbbEfficiencyAlg :: initialize()
13 {
14 if (m_scaleFactorDecoration.empty())
15 {
16 ANA_MSG_ERROR ("no scale factor decoration name set");
17 return StatusCode::FAILURE;
18 }
19
20 ANA_CHECK (m_efficiencyTool.retrieve());
25 ANA_CHECK (m_systematicsList.initialize());
26 ANA_CHECK (m_outOfValidity.initialize());
27
28 return StatusCode::SUCCESS;
29 }
30
31 StatusCode XbbEfficiencyAlg :: execute(const EventContext& ctx)
32 {
33 for (const auto& sys : m_systematicsList.systematicsVector())
34 {
35 const xAOD::JetContainer *jets = nullptr;
36 ANA_CHECK (m_jetHandle.retrieve (jets, sys, ctx));
37
38 for (const xAOD::Jet *jet : *jets)
39 {
40 float sf = 0.;
41 if (m_preselection.getBool (*jet, sys))
42 {
43 ANA_CHECK_CORRECTION (m_outOfValidity, *jet, m_efficiencyTool->getScaleFactor (*jet, sf, sys));
44 if (!m_outOfValidity.get(*jet))
45 sf = invalidScaleFactor();
46 }
47 m_scaleFactorDecoration.set (*jet, sf, sys);
48 }
49 }
50 return StatusCode::SUCCESS;
51 }
52}
#define ANA_MSG_ERROR(xmsg,...)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
#define ANA_CHECK_CORRECTION(helper, object, expr)
a helper check macro to work with OutOfValidityHelper
ToolHandle< IBTaggingEfficiencyJsonTool > m_efficiencyTool
the efficiency json tool
SysListHandle m_systematicsList
the systematics list we run
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
SysReadSelectionHandle m_preselection
the preselection we apply to our input
SysWriteDecorHandle< float > m_scaleFactorDecoration
the decoration for the Xbb SF
SysReadHandle< xAOD::JetContainer > m_jetHandle
the jet collection we run on
Select isolated Photons, Electrons and Muons.
constexpr float invalidScaleFactor()
the decoration value to use if there is no valid scale factor decoration
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".