File indexing completed on 2025-07-14 08:14:37
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 namespace eicrecon {
0022
0023 using MatchClustersAlgorithm = algorithms::Algorithm<
0024 algorithms::Input<edm4hep::MCParticleCollection, edm4eic::ReconstructedParticleCollection,
0025 edm4eic::MCRecoParticleAssociationCollection, edm4eic::ClusterCollection,
0026 edm4eic::MCRecoClusterParticleAssociationCollection>,
0027 algorithms::Output<edm4eic::ReconstructedParticleCollection,
0028 edm4eic::MCRecoParticleAssociationCollection>>;
0029
0030 class MatchClusters : public MatchClustersAlgorithm {
0031
0032 public:
0033 MatchClusters(std::string_view name)
0034 : MatchClustersAlgorithm{name,
0035 {"MCParticles", "CentralTracks", "CentralTrackAssociations",
0036 "EcalClusters", "EcalClusterAssociations"},
0037 {"ReconstructedParticles", "ReconstructedParticleAssociations"},
0038 "Match tracks with clusters, and assign associations."} {}
0039
0040 void init() final{};
0041 void process(const Input&, const Output&) const final;
0042
0043 private:
0044
0045
0046 std::map<int, edm4eic::Cluster>
0047 indexedClusters(const edm4eic::ClusterCollection* clusters,
0048 const edm4eic::MCRecoClusterParticleAssociationCollection* associations) const;
0049
0050
0051
0052 static edm4eic::MutableReconstructedParticle
0053 reconstruct_neutral(const edm4eic::Cluster* cluster, const double mass, const int32_t pdg);
0054 };
0055
0056 }