9#include <unordered_set>
23 return [](
const CC* p,
const Jet&) {
return p->pt();};
25 throw std::logic_error(
"Unknown sort function");
56 static const SG::AuxElement::ConstAccessor<PartLinks> acc(
"constituentLinks");
58 std::vector<std::pair<double, const xAOD::CaloCluster*>> clusters;
59 std::unordered_set<const xAOD::CaloCluster*> seen;
62 if (!link.isValid()) {
64 throw std::logic_error(
"invalid constituentLink in CaloClusterLoader");
71 for (
const auto* other : flow->otherObjects()) {
77 if (seen.insert(cluster).second) {
85 for (
const auto* grandOther : intermediate->otherObjects()) {
86 if (!grandOther) {
continue; }
88 if (cluster && seen.insert(cluster).second) {
97 std::sort(clusters.begin(), clusters.end(), std::greater<>());
100 sorted_clusters.reserve(clusters.size());
101 for (
const auto& cl : clusters) {
102 sorted_clusters.push_back(cl.second);
104 return sorted_clusters;
Principal data class for CaloCell clusters.
ElementLink implementation for ROOT usage.
CaloClusters getCaloClustersFromJet(const xAOD::IParticle &jet) const
Inputs getData(const xAOD::IParticle &jet) const override
CaloClusterSortVar m_caloClusterSortVar
getter_utils::SeqGetter< xAOD::CaloCluster > m_seqGetter
const std::string & getName() const override
CaloClusterSortVar caloClusterSortVar(ConstituentsSortOrder)
const FTagDataDependencyNames & getDependencies() const override
std::function< double(const xAOD::CaloCluster *, const Jet &)> CaloClusterSortVar
std::vector< const xAOD::CaloCluster * > CaloClusters
CaloClusterLoader(const ConstituentsInputConfig &cfg, const FTagOptions &options)
const ConstituentsType & getType() const override
const std::set< std::string > & getUsedRemap() const override
ConstituentsInputConfig m_config
std::set< std::string > m_used_remap
IConstituentsLoader(const ConstituentsInputConfig &cfg)
FTagDataDependencyNames m_deps
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.
FlowElement_v1 FlowElement
Definition of the current "pfo version".