Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-07 08:28:00

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2026 Subhadip Pal
0003 
0004 #pragma once
0005 
0006 #include <algorithms/algorithm.h>
0007 #include <edm4eic/ClusterCollection.h>
0008 #include <edm4eic/ReconstructedParticleCollection.h>
0009 #include <cstddef>
0010 #include <string>
0011 #include <string_view>
0012 #include <vector>
0013 
0014 #include "CaloRemnantCombinerConfig.h"
0015 #include "algorithms/interfaces/WithPodConfig.h"
0016 
0017 namespace eicrecon {
0018 
0019 using CaloRemnantCombinerAlgorithm =
0020     algorithms::Algorithm<algorithms::Input<edm4eic::ClusterCollection, edm4eic::ClusterCollection>,
0021                           algorithms::Output<edm4eic::ReconstructedParticleCollection>>;
0022 
0023 // ==========================================================================
0024 // Calorimeter Remnant Cluster Combiner
0025 // ==========================================================================
0026 /*! An algorithm which takes multiple calorimeter cluster collections and combines them into
0027  *  neutral-particle candidates based on distance matching.
0028  */
0029 class CaloRemnantCombiner : public CaloRemnantCombinerAlgorithm,
0030                             public WithPodConfig<CaloRemnantCombinerConfig> {
0031 
0032 public:
0033   CaloRemnantCombiner(std::string_view name)
0034       : CaloRemnantCombinerAlgorithm{name,
0035                                      {"ECalClusters", "HCalClusters"},
0036                                      {"NeutralParticleCandidate"},
0037                                      "make neutral candidates from remnant clusters"} {}
0038 
0039   void process(const Input&, const Output&) const final;
0040 
0041 private:
0042   std::vector<std::size_t>
0043   move_cluster_indices_for_merging(const edm4eic::ClusterCollection& clusters, auto& remaining,
0044                                    std::size_t seed_cluster_index, double delta_r_add,
0045                                    const edm4eic::ClusterCollection& seed) const;
0046 };
0047 
0048 } // namespace eicrecon