Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-13 07:54:07

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023-2025, Simon Gardner
0003 
0004 #pragma once
0005 
0006 // Event Model related classes
0007 #include <edm4eic/TrackParametersCollection.h>
0008 #include <edm4eic/TrackCollection.h>
0009 #include <algorithms/fardetectors/FarDetectorLinearProjection.h>
0010 #include <extensions/jana/JOmniFactory.h>
0011 #include <spdlog/logger.h>
0012 
0013 namespace eicrecon {
0014 
0015 class FarDetectorLinearProjection_factory
0016     : public JOmniFactory<FarDetectorLinearProjection_factory, FarDetectorLinearProjectionConfig> {
0017 
0018 public:
0019   using AlgoT = eicrecon::FarDetectorLinearProjection;
0020 
0021 private:
0022   std::unique_ptr<AlgoT> m_algo;
0023 
0024   PodioInput<edm4eic::Track> m_tracks_input{this};
0025   PodioOutput<edm4eic::TrackParameters> m_tracks_output{this};
0026 
0027   ParameterRef<std::vector<float>> plane_position{this, "planePosition", config().plane_position};
0028   ParameterRef<std::vector<float>> plane_a{this, "planeA", config().plane_a};
0029   ParameterRef<std::vector<float>> plane_b{this, "planeB", config().plane_b};
0030 
0031 public:
0032   void Configure() {
0033     m_algo = std::make_unique<AlgoT>(GetPrefix());
0034     m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0035     m_algo->applyConfig(config());
0036     m_algo->init();
0037   }
0038 
0039   void ChangeRun(int32_t /* run_number */) {}
0040 
0041   void Process(int32_t /* run_number */, uint64_t /* event_number */) {
0042     m_algo->process({m_tracks_input()}, {m_tracks_output().get()});
0043   }
0044 };
0045 
0046 } // namespace eicrecon