EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
ReconstructedElectrons_factory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2022 - 2025 Daniel Brandenburg, Wouter Deconinck
3
4#pragma once
5
7
9
10namespace eicrecon {
11
13 : public JOmniFactory<ReconstructedElectrons_factory, ElectronReconstructionConfig> {
14public:
16
17private:
18 // Underlying algorithm
19 std::unique_ptr<AlgoT> m_algo;
20
21 // Declare inputs
22 PodioInput<edm4eic::ReconstructedParticle> m_in_rc_particles{this, "ReconstructedParticles"};
23
24 // Declare outputs
25 PodioOutput<edm4eic::ReconstructedParticle> m_out_reco_particles{this};
26
27 // Declare parameters
28 ParameterRef<double> m_min_energy_over_momentum{this, "minEnergyOverMomentum",
29 config().min_energy_over_momentum};
30 ParameterRef<double> m_max_energy_over_momentum{this, "maxEnergyOverMomentum",
31 config().max_energy_over_momentum};
32
33public:
34 void Configure() {
35 // This is called when the factory is instantiated.
36 // Use this callback to make sure the algorithm is configured.
37 // The logger, parameters, and services have all been fetched before this is called
38 m_algo = std::make_unique<AlgoT>(GetPrefix());
39 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
40
41 // Pass config object to algorithm
42 m_algo->applyConfig(config());
43
44 m_algo->init();
45 }
46
47 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
48 // This is called on every event.
49 // Use this callback to call your Algorithm using all inputs and outputs
50 // The inputs will have already been fetched for you at this point.
51 m_algo->process({m_in_rc_particles()}, {m_out_reco_particles().get()});
52
53 logger()->debug("Found {} reconstructed electron candidates", m_out_reco_particles()->size());
54 }
55};
56} // namespace eicrecon
Definition JOmniFactory.h:30
ElectronReconstructionConfig & 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 ElectronReconstruction.h:21
Definition ReconstructedElectrons_factory.h:13
void Configure()
Definition ReconstructedElectrons_factory.h:34
void Process(int32_t, uint64_t)
Definition ReconstructedElectrons_factory.h:47
-client
Definition CalorimeterClusterRecoCoG.cc:37