Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-06 08:35:13

0001 // Created by Shujie Li
0002 // Subject to the terms in the LICENSE file found in the top-level directory.
0003 //
0004 
0005 #pragma once
0006 
0007 #include <JANA/JEvent.h>
0008 #include <edm4eic/Measurement2DCollection.h>
0009 #include <memory>
0010 #include <string>
0011 #include <utility>
0012 #include <vector>
0013 
0014 #include "algorithms/interfaces/WithPodConfig.h"
0015 #include "algorithms/tracking/TrackerMeasurementFromHits.h"
0016 #include "extensions/jana/JOmniFactory.h"
0017 #include "services/geometry/acts/ACTSGeo_service.h"
0018 #include "services/geometry/dd4hep/DD4hep_service.h"
0019 
0020 namespace eicrecon {
0021 
0022 class TrackerMeasurementFromHits_factory : public JOmniFactory<TrackerMeasurementFromHits_factory> {
0023 
0024 private:
0025   using AlgoT = eicrecon::TrackerMeasurementFromHits;
0026   std::unique_ptr<AlgoT> m_algo;
0027 
0028   PodioInput<edm4eic::TrackerHit> m_hits_input{this};
0029   PodioOutput<edm4eic::Measurement2D> m_measurements_output{this};
0030 
0031   Service<DD4hep_service> m_DD4hepSvc{this};
0032   Service<ACTSGeo_service> m_ACTSGeoSvc{this};
0033 
0034 public:
0035   void Configure() {
0036     m_algo = std::make_unique<AlgoT>();
0037     m_algo->init(m_DD4hepSvc().detector(), m_DD4hepSvc().converter(),
0038                  m_ACTSGeoSvc().actsGeoProvider(), logger());
0039   }
0040 
0041   void ChangeRun(int32_t /* run_number */) {}
0042 
0043   void Process(int32_t /* run_number */, uint64_t /* event_number */) {
0044     m_measurements_output() = m_algo->produce(*m_hits_input());
0045   }
0046 };
0047 
0048 } // namespace eicrecon