ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
ParticleJetTools
Root
JetFlavourInfo.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
ParticleJetTools/JetFlavourInfo.h
"
6
7
#include <vector>
8
#include <string>
9
10
using
xAOD::IParticle
;
11
using
xAOD::JetFlavourLabelType
;
12
13
int
14
xAOD::GAFinalHadronFlavourLabel
(
const
xAOD::Jet
*
jet
) {
15
16
const
std::string labelB =
"GhostBHadronsFinal"
;
17
const
std::string labelC =
"GhostCHadronsFinal"
;
18
const
std::string labelTau =
"GhostTausFinal"
;
19
20
std::vector<const IParticle*> ghostB;
21
if
(
jet
->getAssociatedObjects<
IParticle
>(labelB, ghostB) && ghostB.size() > 0)
return
5;
22
std::vector<const IParticle*> ghostC;
23
if
(
jet
->getAssociatedObjects<
IParticle
>(labelC, ghostC) && ghostC.size() > 0)
return
4;
24
std::vector<const IParticle*> ghostTau;
25
if
(
jet
->getAssociatedObjects<
IParticle
>(labelTau, ghostTau) && ghostTau.size() > 0)
return
15;
26
return
0;
27
}
28
29
int
30
xAOD::GAInitialHadronFlavourLabel
(
const
xAOD::Jet
*
jet
) {
31
32
const
std::string labelB =
"GhostBHadronsInitial"
;
33
const
std::string labelC =
"GhostCHadronsInitial"
;
34
const
std::string labelTau =
"GhostTausFinal"
;
35
36
std::vector<const IParticle*> ghostB;
37
if
(
jet
->getAssociatedObjects<
IParticle
>(labelB, ghostB) && ghostB.size() > 0)
return
5;
38
std::vector<const IParticle*> ghostC;
39
if
(
jet
->getAssociatedObjects<
IParticle
>(labelC, ghostC) && ghostC.size() > 0)
return
4;
40
std::vector<const IParticle*> ghostTau;
41
if
(
jet
->getAssociatedObjects<
IParticle
>(labelTau, ghostTau) && ghostTau.size() > 0)
return
15;
42
return
0;
43
}
44
45
int
46
xAOD::GAFinalPartonFlavourLabel
(
const
xAOD::Jet
*
jet
) {
47
48
const
std::string labelB =
"GhostBQuarksFinal"
;
49
const
std::string labelC =
"GhostCQuarksFinal"
;
50
const
std::string labelTau =
"GhostTausFinal"
;
51
52
std::vector<const IParticle*> ghostB;
53
if
(
jet
->getAssociatedObjects<
IParticle
>(labelB, ghostB) && ghostB.size() > 0)
return
5;
54
std::vector<const IParticle*> ghostC;
55
if
(
jet
->getAssociatedObjects<
IParticle
>(labelC, ghostC) && ghostC.size() > 0)
return
4;
56
std::vector<const IParticle*> ghostTau;
57
if
(
jet
->getAssociatedObjects<
IParticle
>(labelTau, ghostTau) && ghostTau.size() > 0)
return
15;
58
return
0;
59
}
60
61
int
62
xAOD::ExclusiveConeHadronFlavourLabel
(
const
xAOD::Jet
*
jet
) {
63
// default label means "invalid"
64
int
label
= -1;
65
66
// We don't check the return value, as we would not be able to handle it gracefully anyway
67
jet
->getAttribute(
"HadronConeExclTruthLabelID"
,
label
);
68
return
label
;
69
}
70
71
int
72
xAOD::ExclusiveConeDoubleHadronFlavourLabel
(
const
xAOD::Jet
*
jet
) {
73
// default label means "invalid"
74
int
label
= -1;
75
76
// We don't check the return value, as we would not be able to handle it gracefully anyway
77
jet
->getAttribute(
"HadronConeExclExtendedTruthLabelID"
,
label
);
78
return
label
;
79
}
80
81
int
xAOD::jetFlavourLabel
(
const
xAOD::Jet
*
jet
,
JetFlavourLabelType
t) {
82
83
switch
(t) {
84
case
GAFinalHadron
:
return
GAFinalHadronFlavourLabel
(
jet
);
break
;
85
case
GAInitialHadron
:
return
GAInitialHadronFlavourLabel
(
jet
);
break
;
86
case
GAFinalParton
:
return
GAFinalPartonFlavourLabel
(
jet
);
break
;
87
case
ExclConeHadron
:
default
:
return
ExclusiveConeHadronFlavourLabel
(
jet
);
88
}
89
}
JetFlavourInfo.h
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
label
std::string label(const std::string &format, int i)
Definition
label.h:19
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::GAInitialHadronFlavourLabel
int GAInitialHadronFlavourLabel(const xAOD::Jet *jet)
Definition
JetFlavourInfo.cxx:30
xAOD::GAFinalPartonFlavourLabel
int GAFinalPartonFlavourLabel(const xAOD::Jet *jet)
Definition
JetFlavourInfo.cxx:46
xAOD::jetFlavourLabel
int jetFlavourLabel(const xAOD::Jet *jet, JetFlavourLabelType=ExclConeHadron)
Definition
JetFlavourInfo.cxx:81
xAOD::GAFinalHadronFlavourLabel
int GAFinalHadronFlavourLabel(const xAOD::Jet *jet)
Definition
JetFlavourInfo.cxx:14
xAOD::ExclusiveConeDoubleHadronFlavourLabel
int ExclusiveConeDoubleHadronFlavourLabel(const xAOD::Jet *jet)
Definition
JetFlavourInfo.cxx:72
xAOD::JetFlavourLabelType
JetFlavourLabelType
Definition
JetFlavourInfo.h:31
xAOD::GAFinalParton
@ GAFinalParton
Definition
JetFlavourInfo.h:31
xAOD::GAInitialHadron
@ GAInitialHadron
Definition
JetFlavourInfo.h:31
xAOD::ExclConeHadron
@ ExclConeHadron
Definition
JetFlavourInfo.h:31
xAOD::GAFinalHadron
@ GAFinalHadron
Definition
JetFlavourInfo.h:31
xAOD::ExclusiveConeHadronFlavourLabel
int ExclusiveConeHadronFlavourLabel(const xAOD::Jet *jet)
Definition
JetFlavourInfo.cxx:62
Generated on
for ATLAS Offline Software by
1.17.0