ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
FlavorTagInference
Root
HitsLoader.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 "
FlavorTagInference/HitsLoader.h
"
6
#include "
xAODPFlow/FlowElement.h
"
7
#include "
FlavorTagInference/StringUtils.h
"
8
9
namespace
FlavorTagInference
{
10
11
12
HitsLoader::HitsLoader
(
13
const
ConstituentsInputConfig
& cfg,
14
const
FTagOptions
& options
15
):
16
IConstituentsLoader
(cfg),
17
m_seqGetter
(
getter_utils
::SeqGetter<
xAOD
::TrackMeasurementValidation>(
18
cfg.inputs, options))
19
{
20
SG::AuxElement::ConstAccessor<HitLinks>
acc(
"hitsAssociatedWithJet"
);
21
m_associator
= [acc](
const
xAOD::IParticle
&
jet
) ->
TMVV
{
22
TMVV
hits;
23
for
(
const
ElementLink<TMC>
& link : acc(
jet
)){
24
if
(!link.isValid()) {
25
throw
std::logic_error(
"invalid hits link"
);
26
}
27
hits.push_back(*link);
28
}
29
return
hits;
30
};
31
32
m_used_remap
=
m_seqGetter
.getUsedRemap();
33
m_name
= cfg.name;
34
}
35
36
std::vector<const xAOD::TrackMeasurementValidation*>
HitsLoader::getHitsFromJet
(
37
const
xAOD::IParticle
&
jet
38
)
const
39
{
40
std::vector<const xAOD::TrackMeasurementValidation*> hits;
41
for
(
const
xAOD::TrackMeasurementValidation
*tp :
m_associator
(
jet
)) {
42
hits.push_back(tp);
43
}
44
return
hits;
45
}
46
47
std::tuple<Inputs, std::vector<const xAOD::IParticle*>>
HitsLoader::getData
(
48
const
xAOD::IParticle
&
jet
)
const
{
49
Hits
sorted_hits =
getHitsFromJet
(
jet
);
50
std::vector<const xAOD::IParticle*> dummy;
51
return
std::make_tuple(
m_seqGetter
.getFeats(
jet
, sorted_hits), dummy);
52
}
53
54
const
FTagDataDependencyNames
&
HitsLoader::getDependencies
()
const
{
55
return
m_deps
;
56
}
57
const
std::set<std::string>&
HitsLoader::getUsedRemap
()
const
{
58
return
m_used_remap
;
59
}
60
const
std::string&
HitsLoader::getName
()
const
{
61
return
m_name
;
62
}
63
const
ConstituentsType
&
HitsLoader::getType
()
const
{
64
return
m_config
.type;
65
}
66
67
}
FlowElement.h
HitsLoader.h
StringUtils.h
ElementLink
ElementLink implementation for ROOT usage.
Definition
AthLinks/ElementLink.h:123
FlavorTagInference::HitsLoader::getUsedRemap
const std::set< std::string > & getUsedRemap() const override
Definition
HitsLoader.cxx:57
FlavorTagInference::HitsLoader::getDependencies
const FTagDataDependencyNames & getDependencies() const override
Definition
HitsLoader.cxx:54
FlavorTagInference::HitsLoader::getType
const ConstituentsType & getType() const override
Definition
HitsLoader.cxx:63
FlavorTagInference::HitsLoader::HitsLoader
HitsLoader(const ConstituentsInputConfig &, const FTagOptions &options)
Definition
HitsLoader.cxx:12
FlavorTagInference::HitsLoader::Hits
std::vector< const xAOD::TrackMeasurementValidation * > Hits
Definition
HitsLoader.h:52
FlavorTagInference::HitsLoader::getName
const std::string & getName() const override
Definition
HitsLoader.cxx:60
FlavorTagInference::HitsLoader::getHitsFromJet
std::vector< const xAOD::TrackMeasurementValidation * > getHitsFromJet(const xAOD::IParticle &jet) const
Definition
HitsLoader.cxx:36
FlavorTagInference::HitsLoader::getData
std::tuple< Inputs, std::vector< const xAOD::IParticle * > > getData(const xAOD::IParticle &jet) const override
Definition
HitsLoader.cxx:47
FlavorTagInference::HitsLoader::m_seqGetter
getter_utils::SeqGetter< xAOD::TrackMeasurementValidation > m_seqGetter
Definition
HitsLoader.h:66
FlavorTagInference::HitsLoader::m_associator
std::function< TMVV(const Jet &)> m_associator
Definition
HitsLoader.h:67
FlavorTagInference::HitsLoader::TMVV
std::vector< const xAOD::TrackMeasurementValidation * > TMVV
Definition
HitsLoader.h:61
FlavorTagInference::IConstituentsLoader::m_config
ConstituentsInputConfig m_config
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:96
FlavorTagInference::IConstituentsLoader::m_used_remap
std::set< std::string > m_used_remap
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:97
FlavorTagInference::IConstituentsLoader::m_name
std::string m_name
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:98
FlavorTagInference::IConstituentsLoader::IConstituentsLoader
IConstituentsLoader(const ConstituentsInputConfig &cfg)
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:83
FlavorTagInference::IConstituentsLoader::m_deps
FTagDataDependencyNames m_deps
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:95
SG::AuxElement::ConstAccessor
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition
AuxElement.h:569
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
FlavorTagInference::getter_utils
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/CustomGetterUtils.h:39
FlavorTagInference
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:27
FlavorTagInference::ConstituentsType
ConstituentsType
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:48
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
xAOD::TrackMeasurementValidation
TrackMeasurementValidation_v1 TrackMeasurementValidation
Reference the current persistent version:
Definition
TrackMeasurementValidation.h:13
FlavorTagInference::ConstituentsInputConfig
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:64
FlavorTagInference::FTagDataDependencyNames
Definition
FTagDataDependencyNames.h:12
FlavorTagInference::FTagOptions
Definition
PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/DataPrepUtilities.h:45
Generated on
for ATLAS Offline Software by
1.14.0