ATLAS Offline Software
Loading...
Searching...
No Matches
XbbEfficiencyAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
27 return StatusCode::SUCCESS;
28 }
29
30 StatusCode XbbEfficiencyAlg :: execute()
31 {
32 for (const auto& sys : m_systematicsList.systematicsVector())
33 {
34 const xAOD::JetContainer *jets = nullptr;
35 ANA_CHECK (m_jetHandle.retrieve (jets, sys));
36
37 for (const xAOD::Jet *jet : *jets)
38 {
39 float sf = 0.;
40 if (m_preselection.getBool (*jet, sys))
41 {
42 (void)m_efficiencyTool->getScaleFactor (*jet, sf, sys);
43 }
44 m_scaleFactorDecoration.set (*jet, sf, sys);
45 }
46 }
47 return StatusCode::SUCCESS;
48 }
49}
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
ToolHandle< IBTaggingEfficiencyJsonTool > m_efficiencyTool
the efficiency json tool
SysListHandle m_systematicsList
the systematics list we run
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.
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".