EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
CalorimeterClusterShape_factory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2025 Derek Anderson
3
4#pragma once
5
6#include <edm4eic/EDM4eicVersion.h>
10
11namespace eicrecon {
12
14 : public JOmniFactory<CalorimeterClusterShape_factory, CalorimeterClusterShapeConfig> {
15
16public:
18
19private:
20 // algorithm to run
21 std::unique_ptr<AlgoT> m_algo;
22
23 // input collections
24 PodioInput<edm4eic::Cluster> m_clusters_input{this};
25 PodioInput<edm4eic::MCRecoClusterParticleAssociation> m_assocs_input{this};
26
27 // output collections
28 PodioOutput<edm4eic::Cluster> m_clusters_output{this};
29#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
30 PodioOutput<edm4eic::MCRecoClusterParticleLink> m_links_output{this};
31#endif
32 PodioOutput<edm4eic::MCRecoClusterParticleAssociation> m_assocs_output{this};
33
34 // parameter bindings
35 ParameterRef<bool> m_longitudinalShowerInfoAvailable{this, "longitudinalShowerInfoAvailable",
36 config().longitudinalShowerInfoAvailable};
37 ParameterRef<std::string> m_energyWeight{this, "energyWeight", config().energyWeight};
38 ParameterRef<double> m_sampFrac{this, "sampFrac", config().sampFrac};
39 ParameterRef<std::vector<double>> m_logWeightBaseCoeffs{this, "logWeightBaseCoeffs",
40 config().logWeightBaseCoeffs};
41 ParameterRef<double> m_logWeightBase_Eref{this, "logWeightBase_Eref",
42 config().logWeightBase_Eref};
43 ParameterRef<double> m_logWeightBase{this, "logWeightBase", config().logWeightBase};
44
45 // services
46 Service<AlgorithmsInit_service> m_algoInitSvc{this};
47
48public:
49 void Configure() {
50 m_algo = std::make_unique<AlgoT>(GetPrefix());
51 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
52 m_algo->applyConfig(config());
53 m_algo->init();
54 }
55
56 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
57 m_algo->process({m_clusters_input(), m_assocs_input()}, {m_clusters_output().get(),
58#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
59 m_links_output().get(),
60#endif
61 m_assocs_output().get()});
62 }
63
64}; // end CalorimeterClusterShape_factory
65
66} // namespace eicrecon
Definition JOmniFactory.h:30
CalorimeterClusterShapeConfig & config()
Retrieve reference to embedded config object.
Definition JOmniFactory.h:576
std::shared_ptr< spdlog::logger > & logger()
Retrieve reference to already-configured logger.
Definition JOmniFactory.h:573
Definition CalorimeterClusterShape_factory.h:14
void Configure()
Definition CalorimeterClusterShape_factory.h:49
void Process(int32_t, uint64_t)
Definition CalorimeterClusterShape_factory.h:56
Calculate cluster shapes for provided clusters.
Definition CalorimeterClusterShape.h:48
-client
Definition CalorimeterClusterRecoCoG.cc:37