File indexing completed on 2025-12-16 10:13:06
0001
0002
0003
0004
0005
0006
0007
0008 #pragma once
0009
0010 #include <algorithms/algorithm.h>
0011 #include <edm4eic/ClusterCollection.h>
0012 #include <edm4eic/MCRecoClusterParticleAssociationCollection.h>
0013 #include <edm4eic/MCRecoParticleAssociationCollection.h>
0014 #include <edm4eic/ReconstructedParticleCollection.h>
0015 #include <edm4hep/MCParticleCollection.h>
0016 #include <stdint.h>
0017 #include <map>
0018 #include <string>
0019 #include <string_view>
0020
0021 #include "algorithms/interfaces/WithPodConfig.h"
0022
0023 namespace eicrecon {
0024
0025 using MatchClustersAlgorithm = algorithms::Algorithm<
0026 algorithms::Input<edm4hep::MCParticleCollection, edm4eic::ReconstructedParticleCollection,
0027 edm4eic::MCRecoParticleAssociationCollection, edm4eic::ClusterCollection,
0028 edm4eic::MCRecoClusterParticleAssociationCollection>,
0029 algorithms::Output<edm4eic::ReconstructedParticleCollection,
0030 edm4eic::MCRecoParticleAssociationCollection>>;
0031
0032 class MatchClusters : public MatchClustersAlgorithm, public WithPodConfig<NoConfig> {
0033
0034 public:
0035 MatchClusters(std::string_view name)
0036 : MatchClustersAlgorithm{name,
0037 {"MCParticles", "CentralTracks", "CentralTrackAssociations",
0038 "EcalClusters", "EcalClusterAssociations"},
0039 {"ReconstructedParticles", "ReconstructedParticleAssociations"},
0040 "Match tracks with clusters, and assign associations."} {}
0041
0042 void init() final {};
0043 void process(const Input&, const Output&) const final;
0044
0045 private:
0046
0047
0048 std::map<int, edm4eic::Cluster>
0049 indexedClusters(const edm4eic::ClusterCollection* clusters,
0050 const edm4eic::MCRecoClusterParticleAssociationCollection* associations) const;
0051
0052
0053
0054 static edm4eic::MutableReconstructedParticle
0055 reconstruct_neutral(const edm4eic::Cluster* cluster, const double mass, const int32_t pdg);
0056 };
0057
0058 }