EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
ImagingClusterReco.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2022 - 2024, Sylvester Joosten, Chao Peng, Wouter Deconinck, David Lawrence, Derek Anderson
3
4/*
5 * Reconstruct the cluster/layer info for imaging calorimeter
6 * Logarithmic weighting is used to describe energy deposit in transverse direction
7 *
8 * Author: Chao Peng (ANL), 06/02/2021
9 */
10
11#pragma once
12
13#include <algorithms/algorithm.h>
14#include <edm4eic/CalorimeterHitCollection.h>
15#include <edm4eic/EDM4eicVersion.h>
16#include <edm4eic/ClusterCollection.h>
17#include <edm4eic/MCRecoCalorimeterHitAssociationCollection.h>
18#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
19#include <edm4eic/MCRecoCalorimeterHitLinkCollection.h>
20#include <podio/LinkNavigator.h>
21#endif
22#include <edm4eic/MCRecoClusterParticleAssociationCollection.h>
23#include <edm4eic/ProtoClusterCollection.h>
24#include <edm4hep/CaloHitContribution.h>
25// Event Model related classes
26#include <edm4hep/MCParticleCollection.h>
27#include <iterator>
28#include <string>
29#include <string_view>
30#include <utility>
31#include <vector>
32
35
36#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
37#include <edm4eic/MCRecoClusterParticleLinkCollection.h>
38#endif
39
40namespace eicrecon {
41
43 algorithms::Algorithm<algorithms::Input<edm4eic::ProtoClusterCollection,
44#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
45 edm4eic::MCRecoCalorimeterHitLinkCollection,
46#endif
47 edm4eic::MCRecoCalorimeterHitAssociationCollection>,
48 algorithms::Output<edm4eic::ClusterCollection,
49#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
50 edm4eic::MCRecoClusterParticleLinkCollection,
51#endif
52 edm4eic::MCRecoClusterParticleAssociationCollection,
53 edm4eic::ClusterCollection>>;
54
63 public WithPodConfig<ImagingClusterRecoConfig> {
64
65public:
66 ImagingClusterReco(std::string_view name)
68 {"inputProtoClusterCollection",
69#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
70 "mcRawHitLinks",
71#endif
72 "mcRawHitAssocations"},
73 {"outputClusterCollection",
74#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
75 "outputClusterLinks",
76#endif
77 "outputClusterAssociations", "outputLayerCollection"},
78 "Reconstruct the cluster/layer info for imaging calorimeter."} {
79 }
80
81public:
82 void init() {}
83
84 void process(const Input& input, const Output& output) const final;
85
86private:
87 std::vector<edm4eic::MutableCluster>
88 reconstruct_cluster_layers(const edm4eic::ProtoCluster& pcl) const;
89
90 edm4eic::MutableCluster
91 reconstruct_layer(const std::vector<std::pair<const edm4eic::CalorimeterHit, float>>& hits) const;
92
93 edm4eic::MutableCluster reconstruct_cluster(const edm4eic::ProtoCluster& pcl) const;
94
95 std::pair<double /* polar */, double /* azimuthal */>
96 fit_track(const std::vector<edm4eic::MutableCluster>& layers) const;
97
98 void associate_mc_particles(
99 const edm4eic::Cluster& cl,
100 const edm4eic::MCRecoCalorimeterHitAssociationCollection* mchitassociations,
101#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
102 const podio::LinkNavigator<edm4eic::MCRecoCalorimeterHitLinkCollection>& link_nav,
103 edm4eic::MCRecoClusterParticleLinkCollection* links,
104#endif
105 edm4eic::MCRecoClusterParticleAssociationCollection* assocs) const;
106
107 edm4hep::MCParticle get_primary(const edm4hep::CaloHitContribution& contrib) const;
108};
109
110} // namespace eicrecon
Definition ImagingClusterReco.h:63
ImagingClusterReco(std::string_view name)
Definition ImagingClusterReco.h:66
void init()
Definition ImagingClusterReco.h:82
Definition WithPodConfig.h:22
-client
Definition CalorimeterClusterRecoCoG.cc:37
algorithms::Algorithm< algorithms::Input< edm4eic::ProtoClusterCollection, edm4eic::MCRecoCalorimeterHitLinkCollection, edm4eic::MCRecoCalorimeterHitAssociationCollection >, algorithms::Output< edm4eic::ClusterCollection, edm4eic::MCRecoClusterParticleLinkCollection, edm4eic::MCRecoClusterParticleAssociationCollection, edm4eic::ClusterCollection > > ImagingClusterRecoAlgorithm
Definition ImagingClusterReco.h:53