ATLAS Offline Software
Loading...
Searching...
No Matches
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
7#include <vector>
8#include <stdexcept>
9
10namespace FlavorTagInference {
11
13 const ConstituentsInputConfig& cfg,
14 const FTagOptions& options
15 ):
18 return p->pt();
19 }),
21 cfg.inputs, options))
22 {
23 m_used_remap = m_seqGetter.getUsedRemap();
24 m_name = cfg.name;
25 }
26
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
60 Towers sorted_towers = getTowersFromJet(jet);
61 return m_seqGetter.getFeats(jet, sorted_towers);
62 }
63
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 }
74 return m_config.type;
75 }
76
77}
static Double_t a
Principal data class for CaloCell clusters.
const FTagDataDependencyNames & getDependencies() const override
Towers getTowersFromJet(const xAOD::IParticle &jet) const
const std::set< std::string > & getUsedRemap() const override
getter_utils::SeqGetter< xAOD::CaloCluster > m_seqGetter
Definition TowerLoader.h:40
std::vector< const xAOD::CaloCluster * > Towers
Definition TowerLoader.h:35
const std::string & getName() const override
Inputs getData(const xAOD::IParticle &jet) const override
TowerLoader(const ConstituentsInputConfig &cfg, const FTagOptions &options)
const ConstituentsType & getType() const override
Class providing the definition of the 4-vector interface.
This file contains "getter" functions used for accessing tagger inputs from the EDM.
std::pair< std::vector< float >, std::vector< int64_t > > Inputs
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.