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