ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
14//
15// method implementations
16//
17
18namespace 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 }
30
31 ANA_CHECK (m_jvtTool.retrieve());
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}
#define ANA_MSG_ERROR(xmsg,...)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
SysCopyHandle< xAOD::JetContainer > m_jetHandle
the jet collection we run on
Gaudi::Property< std::string > m_decorationName
the name of the decoration we create
ToolHandle< IJetUpdateJvt > m_jvtTool
the update tool
SysReadSelectionHandle m_preselection
the preselection we apply to our input
std::optional< SG::Accessor< float > > m_decorationAccessor
the decoration accessor we use
SysListHandle m_systematicsList
the systematics list we run
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".