ATLAS Offline Software
Loading...
Searching...
No Matches
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
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 }
29 m_decorationAccessor = std::make_unique
31
32 ANA_CHECK (m_jvtTool.retrieve());
35 ANA_CHECK (m_systematicsList.initialize());
36 return StatusCode::SUCCESS;
37 }
38
39
40
41 StatusCode JvtUpdateAlg ::
42 execute ()
43 {
44 for (const auto& sys : m_systematicsList.systematicsVector())
45 {
46 xAOD::JetContainer *jets = nullptr;
47 ANA_CHECK (m_jetHandle.getCopy (jets, sys));
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}
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
std::unique_ptr< SG::Accessor< float > > m_decorationAccessor
the decoration accessor we use
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
SysListHandle m_systematicsList
the systematics list we run
Helper class to provide type-safe access to aux data.
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".