EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
CalorimeterClusterRecoCoG_factory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2023 - 2025, Chao Peng, Sylvester Joosten, Whitney Armstrong, Wouter Deconinck, Nathan Brei, Sebouh Paul, Dmitry Kalinkin, Derek Anderson
3
4#pragma once
5
6#include <edm4eic/EDM4eicVersion.h>
10
11namespace eicrecon {
12
14 : public JOmniFactory<CalorimeterClusterRecoCoG_factory, CalorimeterClusterRecoCoGConfig> {
15
16public:
18
19private:
20 std::unique_ptr<AlgoT> m_algo;
21
22 PodioInput<edm4eic::ProtoCluster> m_proto_input{this};
23#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
24 PodioInput<edm4eic::MCRecoCalorimeterHitLink, true> m_mchitlinks_input{
25 this}; // Optional: for truth associations
26#endif
27 PodioInput<edm4eic::MCRecoCalorimeterHitAssociation, true> m_mchitassocs_input{
28 this}; // Optional: for truth associations
29
30 PodioOutput<edm4eic::Cluster> m_cluster_output{this};
31#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
32 PodioOutput<edm4eic::MCRecoClusterParticleLink> m_links_output{this};
33#endif
34 PodioOutput<edm4eic::MCRecoClusterParticleAssociation> m_assoc_output{this};
35
36 ParameterRef<std::string> m_energyWeight{this, "energyWeight", config().energyWeight};
37 ParameterRef<double> m_samplingFraction{this, "samplingFraction", config().sampFrac};
38 ParameterRef<double> m_logWeightBase{this, "logWeightBase", config().logWeightBase};
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<bool> m_enableEtaBounds{this, "enableEtaBounds", config().enableEtaBounds};
44
45 Service<AlgorithmsInit_service> m_algorithmsInit{this};
46
47public:
48 void Configure() {
49 m_algo = std::make_unique<AlgoT>(GetPrefix());
50 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
51 m_algo->applyConfig(config());
52 m_algo->init();
53 }
54
55 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
56 m_algo->process({m_proto_input(),
57#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
58 m_mchitlinks_input(),
59#endif
60 m_mchitassocs_input()},
61 {m_cluster_output().get(),
62#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
63 m_links_output().get(),
64#endif
65 m_assoc_output().get()});
66 }
67};
68
69} // namespace eicrecon
Definition JOmniFactory.h:30
CalorimeterClusterRecoCoGConfig & 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 CalorimeterClusterRecoCoG_factory.h:14
void Configure()
Definition CalorimeterClusterRecoCoG_factory.h:48
void Process(int32_t, uint64_t)
Definition CalorimeterClusterRecoCoG_factory.h:55
Definition CalorimeterClusterRecoCoG.h:74
-client
Definition CalorimeterClusterRecoCoG.cc:37