ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
JetAnalysisAlgorithms
Root
JvtUpdateAlg.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
8
//
9
// includes
10
//
11
12
#include <
JetAnalysisAlgorithms/JvtUpdateAlg.h
>
13
14
//
15
// method implementations
16
//
17
18
namespace
CP
19
{
20
21
StatusCode JvtUpdateAlg ::
22
initialize ()
23
{
24
if
(
m_decorationName
.empty())
25
{
26
ANA_MSG_ERROR
(
"decoration name set to empty string, not allowed"
);
27
return
StatusCode::FAILURE;
28
}
29
m_decorationAccessor
.emplace (
m_decorationName
);
30
31
ANA_CHECK
(
m_jvtTool
.retrieve());
32
ANA_CHECK
(
m_jetHandle
.initialize (
m_systematicsList
));
33
ANA_CHECK
(
m_preselection
.initialize (
m_systematicsList
,
m_jetHandle
,
SG::AllowEmpty
));
34
ANA_CHECK
(
m_systematicsList
.initialize());
35
return
StatusCode::SUCCESS;
36
}
37
38
39
40
StatusCode JvtUpdateAlg ::
41
execute (
const
EventContext& ctx)
42
{
43
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
44
{
45
xAOD::JetContainer
*jets =
nullptr
;
46
ANA_CHECK
(
m_jetHandle
.getCopy (jets, sys, ctx));
47
for
(
xAOD::Jet
*
jet
: *jets)
48
{
49
// Set default value for jets that fail preselection
50
(*m_decorationAccessor) (*jet) = -1.;
51
if
(
m_preselection
.getBool (*
jet
, sys))
52
{
53
// manually update jvt decoration using the tool
54
const
float
jvt =
m_jvtTool
->updateJvt (*
jet
);
55
(*m_decorationAccessor) (*jet) = jvt;
56
}
57
}
58
}
59
return
StatusCode::SUCCESS;
60
}
61
}
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg,...)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:295
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:325
JvtUpdateAlg.h
CP::JvtUpdateAlg::m_jetHandle
SysCopyHandle< xAOD::JetContainer > m_jetHandle
the jet collection we run on
Definition
JvtUpdateAlg.h:44
CP::JvtUpdateAlg::m_decorationName
Gaudi::Property< std::string > m_decorationName
the name of the decoration we create
Definition
JvtUpdateAlg.h:54
CP::JvtUpdateAlg::m_jvtTool
ToolHandle< IJetUpdateJvt > m_jvtTool
the update tool
Definition
JvtUpdateAlg.h:36
CP::JvtUpdateAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition
JvtUpdateAlg.h:49
CP::JvtUpdateAlg::m_decorationAccessor
std::optional< SG::Accessor< float > > m_decorationAccessor
the decoration accessor we use
Definition
JvtUpdateAlg.h:58
CP::JvtUpdateAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
JvtUpdateAlg.h:40
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:29
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0