ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkHI
src
HIJetAugmentationTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
HIJetAugmentationTool.h
"
6
#include "
AsgDataHandles/WriteDecorHandle.h
"
7
#include <format>
8
9
namespace
DerivationFramework
10
{
11
HIJetAugmentationTool::HIJetAugmentationTool
(
const
std::string& t,
12
const
std::string& n,
13
const
IInterface* p ) : base_class(t,n,p)
14
{
15
}
16
17
// Destructor
18
HIJetAugmentationTool::~HIJetAugmentationTool
()
19
{
20
}
21
22
// Athena initialize and finalize
23
StatusCode
HIJetAugmentationTool::initialize
()
24
{
25
ATH_CHECK
(
m_eventInfoKey
.initialize());
26
ATH_CHECK
(
m_hiJet_key
.initialize());
27
ATH_CHECK
(
m_caloJet_key
.initialize());
28
ATH_CHECK
(
m_jvtUpdateTool
.retrieve());
29
30
m_jvtMatchedKey
=
m_hiJet_key
.key() +
"."
+
m_jvtMatchedKey
.key();
31
ATH_CHECK
(
m_jvtMatchedKey
.initialize());
32
m_jvtMediumPassedKey
=
m_hiJet_key
.key() +
"."
+
m_jvtMediumPassedKey
.key();
33
ATH_CHECK
(
m_jvtMediumPassedKey
.initialize());
34
m_jvtTightPassedKey
=
m_hiJet_key
.key() +
"."
+
m_jvtTightPassedKey
.key();
35
ATH_CHECK
(
m_jvtTightPassedKey
.initialize());
36
37
ATH_MSG_INFO
(
"DeltaRJetMatching = "
<<
m_deltaR
.value());
38
39
40
return
StatusCode::SUCCESS;
41
}
42
43
StatusCode
HIJetAugmentationTool::finalize
()
44
{
45
46
ATH_CHECK
(
m_jvtUpdateTool
->finalize());
47
48
return
StatusCode::SUCCESS;
49
}
50
51
double
deltaR
(
double
eta1,
double
eta2,
double
phi1,
double
phi2) {
52
double
deltaPhi
= TVector2::Phi_mpi_pi(phi1 - phi2);
53
double
deltaEta = eta1 - eta2;
54
return
std::sqrt(deltaEta * deltaEta +
deltaPhi
*
deltaPhi
);
55
}
56
57
StatusCode
HIJetAugmentationTool::addBranches
(
const
EventContext &ctx)
const
{
58
SG::ReadHandle<xAOD::EventInfo>
eventInfo(
m_eventInfoKey
, ctx);
59
60
// Load jet containers
61
SG::ReadHandle<xAOD::JetContainer>
hiJets(
m_hiJet_key
, ctx);
62
if
(!hiJets.
isValid
()) {
63
ATH_MSG_ERROR
(
"Couldn't retrieve JetContainer with key "
<<
m_hiJet_key
);
64
return
StatusCode::FAILURE;
65
}
66
SG::ReadHandle<xAOD::JetContainer>
caloJets(
m_caloJet_key
, ctx);
67
if
(!caloJets.
isValid
()) {
68
ATH_MSG_ERROR
(
"Couldn't retrieve JetContainer with key "
69
<<
m_caloJet_key
);
70
return
StatusCode::FAILURE;
71
}
72
73
// calibrate topo jets
74
//
75
76
77
SG::WriteDecorHandle<xAOD::JetContainer, float>
jvtMatchedHandle(
m_jvtMatchedKey
,ctx);
78
SG::WriteDecorHandle<xAOD::JetContainer, bool>
jvtMediumPassedHandle(
m_jvtMediumPassedKey
,ctx);
79
SG::WriteDecorHandle<xAOD::JetContainer, bool>
jvtTightPassedHandle(
m_jvtTightPassedKey
,ctx);
80
81
// first loop over calibrated HI jets
82
for
(
const
auto
*hjet : *hiJets) {
83
float
mindR = 999.;
84
float
matchedEta = 999.;
85
float
matchedJvt = -1;
86
// temporary HI jvt selection
87
bool
passJvtMedium =
false
;
88
bool
passJvtTight =
false
;
89
// second loop over topo jets
90
for
(
const
auto
*tjet : *caloJets) {
91
float
newjvt =
m_jvtUpdateTool
->updateJvt(*tjet);
92
93
// perform the matching
94
float
dR =
95
deltaR
(tjet->eta(), hjet->eta(), hjet->phi(), tjet->phi());
96
97
if
(dR <
m_deltaR
.value() && dR < mindR) {
98
mindR = dR;
99
matchedJvt = newjvt;
100
matchedEta = tjet->eta();
101
}
102
}
103
104
if
(mindR <
m_deltaR
.value()) {
105
(jvtMatchedHandle)(*hjet) = matchedJvt;
106
// HI jet sub-group pre-recommendation for JVT: https://atlas-heavy-ions.docs.cern.ch/Jets/jetselection/
107
// applying JVT selection on EMTopo jet matched to HI jet
108
// using selections from: https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/PileupJetRecommendations#JVT
109
if
(std::abs(matchedEta) < 2.4) {
110
passJvtMedium = matchedJvt > 0.59;
111
passJvtTight = matchedJvt > 0.91;
112
}
else
if
(std::abs(matchedEta) < 2.5) {
113
passJvtMedium = matchedJvt > 0.11;
114
passJvtTight =
true
;
// no tight JVT in this region
115
}
else
{
116
passJvtMedium =
true
;
117
passJvtTight =
true
;
118
}
119
(jvtMediumPassedHandle)(*hjet) = passJvtMedium;
120
(jvtTightPassedHandle)(*hjet) = passJvtTight;
121
122
}
else
{
123
(jvtMatchedHandle)(*hjet) = -1;
124
(jvtMediumPassedHandle)(*hjet) =
false
;
125
(jvtTightPassedHandle)(*hjet) =
false
;
126
}
127
}
128
129
return
StatusCode::SUCCESS;
130
}
131
}
132
133
deltaPhi
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Definition
AmgMatrixBasePlugin.h:112
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
WriteDecorHandle.h
Handle class for adding a decoration to an object.
HIJetAugmentationTool.h
DerivationFramework::HIJetAugmentationTool::m_jvtUpdateTool
PublicToolHandle< IJetUpdateJvt > m_jvtUpdateTool
JVT update tool.
Definition
HIJetAugmentationTool.h:51
DerivationFramework::HIJetAugmentationTool::m_jvtTightPassedKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvtTightPassedKey
Definition
HIJetAugmentationTool.h:62
DerivationFramework::HIJetAugmentationTool::finalize
StatusCode finalize()
Definition
HIJetAugmentationTool.cxx:43
DerivationFramework::HIJetAugmentationTool::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const
Definition
HIJetAugmentationTool.cxx:57
DerivationFramework::HIJetAugmentationTool::m_jvtMatchedKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvtMatchedKey
Definition
HIJetAugmentationTool.h:56
DerivationFramework::HIJetAugmentationTool::m_jvtMediumPassedKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvtMediumPassedKey
Definition
HIJetAugmentationTool.h:59
DerivationFramework::HIJetAugmentationTool::m_caloJet_key
SG::ReadHandleKey< xAOD::JetContainer > m_caloJet_key
Definition
HIJetAugmentationTool.h:47
DerivationFramework::HIJetAugmentationTool::HIJetAugmentationTool
HIJetAugmentationTool(const std::string &t, const std::string &n, const IInterface *p)
Definition
HIJetAugmentationTool.cxx:11
DerivationFramework::HIJetAugmentationTool::~HIJetAugmentationTool
~HIJetAugmentationTool()
Definition
HIJetAugmentationTool.cxx:18
DerivationFramework::HIJetAugmentationTool::m_hiJet_key
SG::ReadHandleKey< xAOD::JetContainer > m_hiJet_key
Definition
HIJetAugmentationTool.h:45
DerivationFramework::HIJetAugmentationTool::m_deltaR
Gaudi::Property< float > m_deltaR
Definition
HIJetAugmentationTool.h:40
DerivationFramework::HIJetAugmentationTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition
HIJetAugmentationTool.h:43
DerivationFramework::HIJetAugmentationTool::initialize
StatusCode initialize()
Definition
HIJetAugmentationTool.cxx:23
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:66
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
DerivationFramework::deltaR
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition
HIJetAugmentationTool.cxx:51
Generated on
for ATLAS Offline Software by
1.17.0