File indexing completed on 2025-12-16 10:13:04
0001
0002
0003
0004 #pragma once
0005
0006 #include <algorithms/algorithm.h>
0007 #include <edm4eic/ClusterCollection.h>
0008 #include <edm4eic/MCRecoClusterParticleAssociationCollection.h>
0009 #include <edm4hep/MCParticleCollection.h>
0010 #include <map>
0011 #include <string>
0012 #include <string_view>
0013
0014 #include "algorithms/interfaces/WithPodConfig.h"
0015
0016 namespace eicrecon {
0017
0018 using TruthEnergyPositionClusterMergerAlgorithm = algorithms::Algorithm<
0019 algorithms::Input<edm4hep::MCParticleCollection, edm4eic::ClusterCollection,
0020 edm4eic::MCRecoClusterParticleAssociationCollection,
0021 edm4eic::ClusterCollection,
0022 edm4eic::MCRecoClusterParticleAssociationCollection>,
0023 algorithms::Output<edm4eic::ClusterCollection,
0024 edm4eic::MCRecoClusterParticleAssociationCollection>>;
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 class TruthEnergyPositionClusterMerger : public TruthEnergyPositionClusterMergerAlgorithm,
0035 public WithPodConfig<NoConfig> {
0036
0037 public:
0038 TruthEnergyPositionClusterMerger(std::string_view name)
0039 : TruthEnergyPositionClusterMergerAlgorithm{
0040 name,
0041 {"mcParticles", "energyClusterCollection", "energyClusterAssociations",
0042 "positionClusterCollection", "positionClusterAssociations"},
0043 {"outputClusterCollection", "outputClusterAssociations"},
0044 "Merge energy and position clusters based on truth."} {}
0045
0046 public:
0047 void init() {}
0048
0049 void process(const Input& input, const Output& output) const final;
0050
0051
0052
0053 std::map<int, edm4eic::Cluster>
0054 indexedClusters(const edm4eic::ClusterCollection& clusters,
0055 const edm4eic::MCRecoClusterParticleAssociationCollection& associations) const;
0056 };
0057
0058 }