EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
TruthEnergyPositionClusterMerger.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2022 Sylvester Joosten
3
4#pragma once
5
6#include <algorithms/algorithm.h>
7#include <edm4eic/ClusterCollection.h>
8#include <edm4eic/EDM4eicVersion.h>
9#include <edm4eic/MCRecoClusterParticleAssociationCollection.h>
10#include <edm4hep/MCParticleCollection.h>
11#include <map>
12#include <string>
13#include <string_view>
14
16
17#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
18#include <edm4eic/MCRecoClusterParticleLinkCollection.h>
19#endif
20
21namespace eicrecon {
22
23using TruthEnergyPositionClusterMergerAlgorithm = algorithms::Algorithm<
24 algorithms::Input<edm4hep::MCParticleCollection, edm4eic::ClusterCollection,
25 edm4eic::MCRecoClusterParticleAssociationCollection,
26 edm4eic::ClusterCollection,
27 edm4eic::MCRecoClusterParticleAssociationCollection>,
28 algorithms::Output<edm4eic::ClusterCollection,
29#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
30 edm4eic::MCRecoClusterParticleLinkCollection,
31#endif
32 edm4eic::MCRecoClusterParticleAssociationCollection>>;
33
43 public WithPodConfig<NoConfig> {
44
45public:
46 TruthEnergyPositionClusterMerger(std::string_view name)
48 name,
49 {"mcParticles", "energyClusterCollection", "energyClusterAssociations",
50 "positionClusterCollection", "positionClusterAssociations"},
51 {"outputClusterCollection",
52#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
53 "outputClusterLinks",
54#endif
55 "outputClusterAssociations"},
56 "Merge energy and position clusters based on truth."} {
57 }
58
59public:
60 void init() {}
61
62 void process(const Input& input, const Output& output) const final;
63
64 // get a map of MCParticle index --> cluster
65 // input: cluster_collections --> list of handles to all cluster collections
66 std::map<int, edm4eic::Cluster>
67 indexedClusters(const edm4eic::ClusterCollection& clusters,
68 const edm4eic::MCRecoClusterParticleAssociationCollection& associations) const;
69};
70
71} // namespace eicrecon
Definition TruthEnergyPositionClusterMerger.h:43
TruthEnergyPositionClusterMerger(std::string_view name)
Definition TruthEnergyPositionClusterMerger.h:46
void init()
Definition TruthEnergyPositionClusterMerger.h:60
Definition WithPodConfig.h:22
-client
Definition CalorimeterClusterRecoCoG.cc:37
algorithms::Algorithm< algorithms::Input< edm4hep::MCParticleCollection, edm4eic::ClusterCollection, edm4eic::MCRecoClusterParticleAssociationCollection, edm4eic::ClusterCollection, edm4eic::MCRecoClusterParticleAssociationCollection >, algorithms::Output< edm4eic::ClusterCollection, edm4eic::MCRecoClusterParticleLinkCollection, edm4eic::MCRecoClusterParticleAssociationCollection > > TruthEnergyPositionClusterMergerAlgorithm
Definition TruthEnergyPositionClusterMerger.h:32