ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
ParticleJetTools
Root
JetPartonTruthLabel.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
ParticleJetTools/JetPartonTruthLabel.h
"
6
#include "
xAODTruth/TruthParticle.h
"
7
#include "
TruthUtils/HepMCHelpers.h
"
8
9
using namespace
std
;
10
using namespace
Analysis
;
11
12
int
JetPartonTruthLabel::modifyJet
(
xAOD::Jet
&
jet
)
const
{
13
ATH_MSG_VERBOSE
(
"In "
<< name() <<
"::modifyJet()"
);
14
15
int
label
= -1;
16
int
extended_label = -1;
17
double
e_max = 0;
18
double
pt_max = 0;
19
double
dr_max = 0;
20
21
vector<const xAOD::TruthParticle*> partons;
22
bool
success =
jet
.getAssociatedObjects(
"GhostPartons"
, partons);
23
if
(success) {
24
for
(
auto
it = partons.begin(); it != partons.end(); it++) {
25
if
(
MC::isTop
(*it))
continue
;
// Skip top
26
27
if
((*it)->e() > e_max) {
28
label
= (*it)->absPdgId();
29
extended_label = (*it)->pdgId();
30
e_max = (*it)->e();
31
pt_max = (*it)->pt();
32
dr_max = (*it)->p4().DeltaR(
jet
.p4());
33
}
34
}
35
}
36
37
jet
.setAttribute(
"PartonTruthLabelID"
,
label
);
38
jet
.setAttribute(
"PartonExtendedTruthLabelID"
, extended_label);
39
jet
.setAttribute(
"PartonTruthLabelPt"
, pt_max);
40
jet
.setAttribute(
"PartonTruthLabelEnergy"
, e_max);
41
jet
.setAttribute(
"PartonTruthLabelDR"
, dr_max);
42
43
return
0;
44
}
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
TruthParticle.h
HepMCHelpers.h
ATLAS-specific HepMC functions.
JetPartonTruthLabel.h
Analysis::JetPartonTruthLabel::modifyJet
int modifyJet(xAOD::Jet &jet) const
Modify a single jet. This is obsolete and set to be removed.
Definition
JetPartonTruthLabel.cxx:12
label
std::string label(const std::string &format, int i)
Definition
label.h:19
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition
IConstituent.h:25
MC::isTop
bool isTop(const T &p)
Definition
HepMCHelpers.h:192
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
std
STL namespace.
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
Generated on
for ATLAS Offline Software by
1.17.0