Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
PhysicsAnalysis
DerivationFramework
DerivationFrameworkMuons
src
MuonJetDrTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Finds the nearest jet and adds its info to the muon.
6
#include "
MuonJetDrTool.h
"
7
8
#include "
FourMomUtils/xAODP4Helpers.h
"
9
#include "
StoreGate/WriteDecorHandle.h
"
10
// Constructor
11
DerivationFramework::MuonJetDrTool::MuonJetDrTool
(
const
std::string&
t
,
const
std::string&
n
,
const
IInterface*
p
) : base_class(
t
,
n
,
p
) {
12
}
13
StatusCode
DerivationFramework::MuonJetDrTool::initialize
() {
14
ATH_CHECK
(m_muonSGKey.initialize());
15
ATH_CHECK
(m_jetSGKey.initialize());
16
m_jetDR_SGKey = m_muonSGKey.key() +
"."
+ m_jetDR_SGKey.key();
17
ATH_CHECK
(m_jetDR_SGKey.initialize());
18
return
StatusCode::SUCCESS;
19
}
20
StatusCode
DerivationFramework::MuonJetDrTool::addBranches
()
const
{
21
const
EventContext& ctx = Gaudi::Hive::currentContext();
22
23
// Retrieve main muonicle collection
24
SG::ReadHandle<xAOD::MuonContainer>
muons{m_muonSGKey, ctx};
25
if
(!muons.isValid()) {
26
ATH_MSG_FATAL
(
"Failed to retrive container "
<< m_muonSGKey.fullKey());
27
return
StatusCode::FAILURE;
28
}
29
SG::ReadHandle<xAOD::JetContainer>
jets
{m_jetSGKey, ctx};
30
if
(!
jets
.isValid()) {
31
ATH_MSG_FATAL
(
"Failed to retrieve "
<< m_jetSGKey.fullKey());
32
return
StatusCode::FAILURE;
33
}
34
SG::WriteDecorHandle<xAOD::MuonContainer, float>
decorator_jetdR{m_jetDR_SGKey, ctx};
35
36
for
(
auto
muon : *muons) {
37
double
new_jetdR = FLT_MAX;
38
bool
found
{
false
};
39
for
(
auto
jet
: *
jets
) {
40
if
(
jet
->pt() <= m_jetMinPt)
continue
;
41
new_jetdR =
std::min
(
xAOD::P4Helpers::deltaR
(
jet
, muon), new_jetdR);
42
found
=
true
;
43
}
44
decorator_jetdR(*muon) =
found
? new_jetdR : -1;
45
}
46
return
StatusCode::SUCCESS;
47
}
DerivationFramework::MuonJetDrTool::initialize
virtual StatusCode initialize() override
Definition:
MuonJetDrTool.cxx:13
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition:
AthMsgStreamMacros.h:34
DerivationFramework::MuonJetDrTool::MuonJetDrTool
MuonJetDrTool(const std::string &t, const std::string &n, const IInterface *p)
Constructor with parameters.
Definition:
MuonJetDrTool.cxx:11
SG::ReadHandle
Definition:
StoreGate/StoreGate/ReadHandle.h:67
xAODP4Helpers.h
min
constexpr double min()
Definition:
ap_fixedTest.cxx:26
defineDB.jets
jets
Definition:
JetTagCalibration/share/defineDB.py:24
read_hist_ntuple.t
t
Definition:
read_hist_ntuple.py:5
python.utils.AtlRunQueryDQUtils.p
p
Definition:
AtlRunQueryDQUtils.py:210
jet
Definition:
JetCalibTools_PlotJESFactors.cxx:23
xAOD::P4Helpers::deltaR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Definition:
xAODP4Helpers.h:150
beamspotman.n
n
Definition:
beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::MuonJetDrTool::addBranches
virtual StatusCode addBranches() const override
Definition:
MuonJetDrTool.cxx:20
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition:
StoreGate/StoreGate/WriteDecorHandle.h:100
WriteDecorHandle.h
Handle class for adding a decoration to an object.
ATH_CHECK
#define ATH_CHECK
Definition:
AthCheckMacros.h:40
checkTriggerxAOD.found
found
Definition:
checkTriggerxAOD.py:328
MuonJetDrTool.h
Generated on Sun Apr 20 2025 21:15:43 for ATLAS Offline Software by
1.8.18