File indexing completed on 2025-07-01 07:56:32
0001
0002
0003
0004 #pragma once
0005
0006 #include "extensions/jana/JOmniFactory.h"
0007
0008 #include "algorithms/reco/ElectronReconstruction.h"
0009
0010 namespace eicrecon {
0011
0012 class ReconstructedElectrons_factory
0013 : public JOmniFactory<ReconstructedElectrons_factory, ElectronReconstructionConfig> {
0014 private:
0015
0016 std::unique_ptr<eicrecon::ElectronReconstruction> m_algo;
0017
0018
0019 PodioInput<edm4eic::ReconstructedParticle> m_in_rc_particles{this, "ReconstructedParticles"};
0020
0021
0022 PodioOutput<edm4eic::ReconstructedParticle> m_out_reco_particles{this};
0023
0024
0025 ParameterRef<double> m_min_energy_over_momentum{this, "minEnergyOverMomentum",
0026 config().min_energy_over_momentum};
0027 ParameterRef<double> m_max_energy_over_momentum{this, "maxEnergyOverMomentum",
0028 config().max_energy_over_momentum};
0029
0030
0031
0032
0033 public:
0034 void Configure() {
0035
0036
0037
0038 m_algo = std::make_unique<eicrecon::ElectronReconstruction>();
0039
0040
0041 m_algo->applyConfig(config());
0042
0043
0044
0045
0046 m_algo->init(logger());
0047 }
0048
0049 void ChangeRun(int32_t ) {
0050
0051
0052
0053
0054 }
0055
0056 void Process(int32_t , uint64_t ) {
0057
0058
0059
0060 auto output = m_algo->execute(m_in_rc_particles());
0061
0062 logger()->debug("Found {} reconstructed electron candidates", output->size());
0063
0064 m_out_reco_particles() = std::move(output);
0065
0066 }
0067 };
0068 }