Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-12-03 09:52:58

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2024 Wouter Deconinck
0003 
0004 #pragma once
0005 
0006 #include "algorithms/calorimetry/CalorimeterHitToTrackerHit.h"
0007 #include "services/algorithms_init/AlgorithmsInit_service.h"
0008 #include "extensions/jana/JOmniFactory.h"
0009 
0010 namespace eicrecon {
0011 
0012 class CalorimeterHitToTrackerHit_factory
0013     : public JOmniFactory<CalorimeterHitToTrackerHit_factory, CalorimeterHitToTrackerHitConfig> {
0014 
0015 private:
0016 public:
0017   using AlgoT = eicrecon::CalorimeterHitToTrackerHit;
0018 
0019 private:
0020   std::unique_ptr<AlgoT> m_algo;
0021 
0022   PodioInput<edm4eic::CalorimeterHit> m_calorimeter_hits_input{this};
0023   PodioOutput<edm4eic::TrackerHit> m_tracker_hits_output{this};
0024 
0025   ParameterRef<double> m_timeError{this, "timeError", config().timeError};
0026 
0027   Service<AlgorithmsInit_service> m_algorithmsInit{this};
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 Process(int32_t /* run_number */, uint64_t /* event_number */) {
0038     m_algo->process({m_calorimeter_hits_input()}, {m_tracker_hits_output().get()});
0039   }
0040 };
0041 
0042 } // namespace eicrecon