Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:03:05

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