File indexing completed on 2025-01-18 09:55:44
0001
0002
0003 #pragma once
0004
0005 #include "algorithms/tracking/AmbiguitySolver.h"
0006 #include "algorithms/tracking/AmbiguitySolverConfig.h"
0007 #include "extensions/jana/JOmniFactory.h"
0008 #include "extensions/spdlog/SpdlogMixin.h"
0009 #include <ActsExamples/EventData/Track.hpp>
0010 #include <JANA/JEvent.h>
0011 #include <memory>
0012 #include <string>
0013 #include <utility>
0014 #include <vector>
0015
0016 namespace eicrecon {
0017
0018 class AmbiguitySolver_factory
0019 : public JOmniFactory<AmbiguitySolver_factory, AmbiguitySolverConfig> {
0020
0021 private:
0022 using AlgoT = eicrecon::AmbiguitySolver;
0023 std::unique_ptr<AlgoT> m_algo;
0024
0025 Input<ActsExamples::ConstTrackContainer> m_acts_tracks_input {this};
0026 PodioInput<edm4eic::Measurement2D> m_measurements_input {this};
0027 Output<ActsExamples::ConstTrackContainer> m_acts_tracks_output {this};
0028 Output<ActsExamples::Trajectories> m_acts_trajectories_output {this};
0029
0030 ParameterRef<std::uint32_t> m_maximumSharedHits{this, "maximumSharedHits", config().maximum_shared_hits,
0031 "Maximum number of shared hits allowed"};
0032 ParameterRef<std::uint32_t> m_maximumIterations{this, "maximumIterations", config().maximum_iterations,
0033 "Maximum number of iterations"};
0034 ParameterRef<std::size_t> m_nMeasurementsMin{
0035 this, "nMeasurementsMin", config().n_measurements_min,
0036 "Number of measurements required for further reconstruction"};
0037
0038 public:
0039 void Configure() {
0040 m_algo = std::make_unique<AlgoT>();
0041 m_algo->applyConfig(config());
0042 m_algo->init(logger());
0043 }
0044
0045 void ChangeRun(int64_t run_number) {}
0046
0047 void Process(int64_t run_number, uint64_t event_number) {
0048 std::tie(m_acts_tracks_output(),m_acts_trajectories_output()) = m_algo->process(m_acts_tracks_input(),*m_measurements_input());
0049 }
0050 } ;
0051
0052 }