Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:53:27

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2022 Sylvester Joosten
0003 
0004 #pragma once
0005 
0006 #include <algorithms/algorithm.h>
0007 #include <edm4eic/ClusterCollection.h>
0008 #include <edm4eic/MCRecoClusterParticleAssociationCollection.h>
0009 #include <string>
0010 #include <string_view>
0011 
0012 #include "EnergyPositionClusterMergerConfig.h"
0013 #include "algorithms/interfaces/WithPodConfig.h"
0014 
0015 namespace eicrecon {
0016 
0017 using EnergyPositionClusterMergerAlgorithm = algorithms::Algorithm<
0018     algorithms::Input<
0019         edm4eic::ClusterCollection, edm4eic::MCRecoClusterParticleAssociationCollection,
0020         edm4eic::ClusterCollection, edm4eic::MCRecoClusterParticleAssociationCollection>,
0021     algorithms::Output<edm4eic::ClusterCollection,
0022                        edm4eic::MCRecoClusterParticleAssociationCollection>>;
0023 
0024 /** Simple algorithm to merge the energy measurement from cluster1 with the position
0025   * measurement of cluster2 (in case matching clusters are found). If not, it will
0026   * propagate the raw cluster from cluster1 or cluster2
0027   *
0028   * Matching occurs based on the cluster phi, eta and E variables, with tolerances
0029   * defined in the options file. A negative tolerance effectively disables
0030   * a check. The energy tolerance is defined as a relative number (e.g. 0.1)
0031   *
0032   * In case of ambiguity the closest cluster is merged.
0033   *
0034   * \ingroup reco
0035   */
0036 class EnergyPositionClusterMerger : public EnergyPositionClusterMergerAlgorithm,
0037                                     public WithPodConfig<EnergyPositionClusterMergerConfig> {
0038 
0039 public:
0040   EnergyPositionClusterMerger(std::string_view name)
0041       : EnergyPositionClusterMergerAlgorithm{
0042             name,
0043             {"energyClusterCollection", "energyClusterAssociations", "positionClusterCollection",
0044              "positionClusterAssociations"},
0045             {"outputClusterCollection", "outputClusterAssociations"},
0046             "Merge energy and position clusters if matching."} {}
0047 
0048 public:
0049   void init() {}
0050 
0051   void process(const Input& input, const Output& output) const final;
0052 };
0053 
0054 } // namespace eicrecon