EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
FarDetectorTrackerCluster_factory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2023 - 2025, Simon Gardner
3
4#pragma once
5
9
10namespace eicrecon {
11
13 : public JOmniFactory<FarDetectorTrackerCluster_factory, FarDetectorTrackerClusterConfig> {
14
15public:
17
18private:
19 std::unique_ptr<AlgoT> m_algo;
20
21 VariadicPodioInput<edm4eic::TrackerHit> m_raw_hits_input{this};
22 VariadicPodioOutput<edm4eic::Measurement2D> m_clustered_hits_output{this};
23
24 Service<AlgorithmsInit_service> m_algorithmsInit{this};
25
26 ParameterRef<std::string> m_readout{this, "readoutClass", config().readout};
27 ParameterRef<std::string> m_x_field{this, "xField", config().x_field};
28 ParameterRef<std::string> m_y_field{this, "yField", config().y_field};
29 ParameterRef<double> m_hit_time_limit{this, "hitTimeLimit", config().hit_time_limit};
30
31public:
33 void Configure() {
34
35 m_algo = std::make_unique<AlgoT>(GetPrefix());
36 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
37 // Setup algorithm
38 m_algo->applyConfig(config());
39 m_algo->init();
40 }
41
42 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
43 std::vector<gsl::not_null<edm4eic::Measurement2DCollection*>> clustered_collections;
44 for (const auto& clustered : m_clustered_hits_output()) {
45 clustered_collections.push_back(
46 gsl::not_null<edm4eic::Measurement2DCollection*>(clustered.get()));
47 }
48
49 auto in1 = m_raw_hits_input();
50 std::vector<gsl::not_null<const edm4eic::TrackerHitCollection*>> in2;
51 std::copy(in1.cbegin(), in1.cend(), std::back_inserter(in2));
52
53 m_algo->process(in2, clustered_collections);
54 }
55};
56
57} // namespace eicrecon
Definition JOmniFactory.h:30
FarDetectorTrackerClusterConfig & 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 FarDetectorTrackerCluster_factory.h:13
void Configure()
Definition FarDetectorTrackerCluster_factory.h:33
void Process(int32_t, uint64_t)
Definition FarDetectorTrackerCluster_factory.h:42
Definition FarDetectorTrackerCluster.h:26
-client
Definition CalorimeterClusterRecoCoG.cc:37