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-2025 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
= std::make_unique
30
<
SG::Accessor<float>
> (
m_decorationName
);
31
32
ANA_CHECK
(
m_jvtTool
.retrieve());
33
ANA_CHECK
(
m_jetHandle
.initialize (
m_systematicsList
));
34
ANA_CHECK
(
m_preselection
.initialize (
m_systematicsList
,
m_jetHandle
,
SG::AllowEmpty
));
35
ANA_CHECK
(
m_systematicsList
.initialize());
36
return
StatusCode::SUCCESS;
37
}
38
39
40
41
StatusCode JvtUpdateAlg ::
42
execute (
const
EventContext& ctx)
43
{
44
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
45
{
46
xAOD::JetContainer
*jets =
nullptr
;
47
ANA_CHECK
(
m_jetHandle
.getCopy (jets, sys, ctx));
48
for
(
xAOD::Jet
*
jet
: *jets)
49
{
50
// Set default value for jets that fail preselection
51
(*m_decorationAccessor) (*jet) = -1.;
52
if
(
m_preselection
.getBool (*
jet
, sys))
53
{
54
// manually update jvt decoration using the tool
55
const
float
jvt =
m_jvtTool
->updateJvt (*
jet
);
56
(*m_decorationAccessor) (*jet) = jvt;
57
}
58
}
59
}
60
return
StatusCode::SUCCESS;
61
}
62
}
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
JvtUpdateAlg.h
CP::JvtUpdateAlg::m_decorationAccessor
std::unique_ptr< SG::Accessor< float > > m_decorationAccessor
the decoration accessor we use
Definition
JvtUpdateAlg.h:57
CP::JvtUpdateAlg::m_jetHandle
SysCopyHandle< xAOD::JetContainer > m_jetHandle
the jet collection we run on
Definition
JvtUpdateAlg.h:43
CP::JvtUpdateAlg::m_decorationName
Gaudi::Property< std::string > m_decorationName
the name of the decoration we create
Definition
JvtUpdateAlg.h:53
CP::JvtUpdateAlg::m_jvtTool
ToolHandle< IJetUpdateJvt > m_jvtTool
the update tool
Definition
JvtUpdateAlg.h:35
CP::JvtUpdateAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition
JvtUpdateAlg.h:48
CP::JvtUpdateAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
JvtUpdateAlg.h:39
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition
Control/AthContainers/AthContainers/Accessor.h:68
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
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