ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
FlavorTagInference
Root
TowerLoader.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 "
FlavorTagInference/TowerLoader.h
"
6
#include "
xAODBase/IParticle.h
"
7
#include <vector>
8
#include <stdexcept>
9
10
namespace
FlavorTagInference
{
11
12
TowerLoader::TowerLoader
(
13
const
ConstituentsInputConfig
& cfg,
14
const
FTagOptions
& options
15
):
16
IConstituentsLoader
(cfg),
17
m_sortVar
([](
const
xAOD
::
CaloCluster
* p,
const
xAOD
::
IParticle
&) {
18
return
p->pt();
19
}),
20
m_seqGetter(
getter_utils::SeqGetter<xAOD::CaloCluster>
(
21
cfg.inputs, options))
22
{
23
m_used_remap = m_seqGetter.getUsedRemap();
24
m_name = cfg.name;
25
}
26
27
TowerLoader::Towers
TowerLoader::getTowersFromJet
(
28
const
xAOD::IParticle
&
jet
29
)
const
30
{
31
// Single-hop: jet -> GhostTower ElementLinks -> CaloCluster
32
static
const
SG::AuxElement::ConstAccessor<PartLinks> acc(
"GhostTower"
);
33
34
Towers
towers;
35
36
if
(!acc.isAvailable(
jet
)) {
37
return
towers;
38
}
39
40
for
(
const
ElementLink<IPC>
& link : acc(
jet
)) {
41
if
(!link.isValid()) {
42
throw
std::logic_error(
"invalid GhostTower link in TowerLoader"
);
43
}
44
const
auto
* cluster =
dynamic_cast<
const
xAOD::CaloCluster
*
>
(*link);
45
if
(cluster) {
46
towers.push_back(cluster);
47
}
48
}
49
50
// Sort by pT descending
51
std::sort
(towers.begin(), towers.end(),
52
[
this
, &
jet
](
const
xAOD::CaloCluster
*
a
,
const
xAOD::CaloCluster
* b) {
53
return m_sortVar(a, jet) > m_sortVar(b, jet);
54
});
55
56
return
towers;
57
}
58
59
Inputs
TowerLoader::getData
(
const
xAOD::IParticle
&
jet
)
const
{
60
Towers
sorted_towers =
getTowersFromJet
(
jet
);
61
return
m_seqGetter
.getFeats(
jet
, sorted_towers);
62
}
63
64
const
FTagDataDependencyNames
&
TowerLoader::getDependencies
()
const
{
65
return
m_deps
;
66
}
67
const
std::set<std::string>&
TowerLoader::getUsedRemap
()
const
{
68
return
m_used_remap
;
69
}
70
const
std::string&
TowerLoader::getName
()
const
{
71
return
m_name
;
72
}
73
const
ConstituentsType
&
TowerLoader::getType
()
const
{
74
return
m_config
.type;
75
}
76
77
}
IParticle.h
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
TowerLoader.h
CaloCluster
Principal data class for CaloCell clusters.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
FlavorTagInference::IConstituentsLoader::m_config
ConstituentsInputConfig m_config
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:100
FlavorTagInference::IConstituentsLoader::m_used_remap
std::set< std::string > m_used_remap
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:101
FlavorTagInference::IConstituentsLoader::m_name
std::string m_name
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:102
FlavorTagInference::IConstituentsLoader::IConstituentsLoader
IConstituentsLoader(const ConstituentsInputConfig &cfg)
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:86
FlavorTagInference::IConstituentsLoader::m_deps
FTagDataDependencyNames m_deps
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:99
FlavorTagInference::TowerLoader::getDependencies
const FTagDataDependencyNames & getDependencies() const override
Definition
TowerLoader.cxx:64
FlavorTagInference::TowerLoader::getTowersFromJet
Towers getTowersFromJet(const xAOD::IParticle &jet) const
Definition
TowerLoader.cxx:27
FlavorTagInference::TowerLoader::getUsedRemap
const std::set< std::string > & getUsedRemap() const override
Definition
TowerLoader.cxx:67
FlavorTagInference::TowerLoader::m_seqGetter
getter_utils::SeqGetter< xAOD::CaloCluster > m_seqGetter
Definition
TowerLoader.h:40
FlavorTagInference::TowerLoader::m_sortVar
SortVar m_sortVar
Definition
TowerLoader.h:39
FlavorTagInference::TowerLoader::Towers
std::vector< const xAOD::CaloCluster * > Towers
Definition
TowerLoader.h:35
FlavorTagInference::TowerLoader::getName
const std::string & getName() const override
Definition
TowerLoader.cxx:70
FlavorTagInference::TowerLoader::getData
Inputs getData(const xAOD::IParticle &jet) const override
Definition
TowerLoader.cxx:59
FlavorTagInference::TowerLoader::TowerLoader
TowerLoader(const ConstituentsInputConfig &cfg, const FTagOptions &options)
Definition
TowerLoader.cxx:12
FlavorTagInference::TowerLoader::getType
const ConstituentsType & getType() const override
Definition
TowerLoader.cxx:73
FlavorTagInference::getter_utils::SeqGetter
Template class to extract features from sequence of constituents.
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/CustomGetterUtils.h:70
IParticle
Definition
Event/EventKernel/EventKernel/IParticle.h:43
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
const
FlavorTagInference
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition
CaloClusterLoader.h:27
FlavorTagInference::ConstituentsType
ConstituentsType
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:48
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition
DVL_algorithms.h:554
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
FlavorTagInference::ConstituentsInputConfig
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:67
FlavorTagInference::FTagDataDependencyNames
Definition
FTagDataDependencyNames.h:12
FlavorTagInference::FTagOptions
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/DataPrepUtilities.h:45
Generated on
for ATLAS Offline Software by
1.16.1