Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:13:08

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2025 Tristan Protzman
0003 
0004 #pragma once
0005 
0006 #include <spdlog/logger.h>
0007 #include "extensions/jana/JOmniFactory.h"
0008 
0009 #include "algorithms/reco/TrackClusterMatch.h"
0010 #include "algorithms/reco/TrackClusterMatchConfig.h"
0011 #include "services/geometry/dd4hep/DD4hep_service.h"
0012 
0013 namespace eicrecon {
0014 class TrackClusterMatch_factory
0015     : public JOmniFactory<TrackClusterMatch_factory, TrackClusterMatchConfig> {
0016 private:
0017   // Underlying algorithm
0018   std::unique_ptr<eicrecon::TrackClusterMatch> m_algo;
0019 
0020   // Declare inputs
0021   PodioInput<edm4eic::TrackSegment> m_tracks{this};
0022   PodioInput<edm4eic::Cluster> m_clusters{this};
0023 
0024   // Declare outputs
0025   PodioOutput<edm4eic::TrackClusterMatch> m_matched_particles{this};
0026 
0027   // Declare parameters
0028   ParameterRef<double> m_matching_distance{this, "matchingDistance", config().matching_distance};
0029 
0030 public:
0031   void Configure() {
0032     m_algo = std::make_unique<eicrecon::TrackClusterMatch>(GetPrefix());
0033     m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0034     m_algo->applyConfig(config());
0035     m_algo->init();
0036   }
0037 
0038   void Process(int32_t /* run_number */, uint64_t /* event_number */) {
0039     m_algo->process({m_tracks(), m_clusters()}, {m_matched_particles().get()});
0040   }
0041 };
0042 } // namespace eicrecon