Back to home page

EIC code displayed by LXR

 
 

    


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

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 :
0023         public JOmniFactory<TrackerMeasurementFromHits_factory> {
0024 
0025 private:
0026     using AlgoT = eicrecon::TrackerMeasurementFromHits;
0027     std::unique_ptr<AlgoT> m_algo;
0028 
0029     PodioInput<edm4eic::TrackerHit> m_hits_input {this};
0030     PodioOutput<edm4eic::Measurement2D> m_measurements_output {this};
0031 
0032     Service<DD4hep_service> m_DD4hepSvc {this};
0033     Service<ACTSGeo_service> m_ACTSGeoSvc {this};
0034 
0035 public:
0036     void Configure() {
0037         m_algo = std::make_unique<AlgoT>();
0038         m_algo->init(m_DD4hepSvc().detector(), m_DD4hepSvc().converter(), m_ACTSGeoSvc().actsGeoProvider(), logger());
0039     }
0040 
0041     void ChangeRun(int64_t run_number) {
0042     }
0043 
0044     void Process(int64_t run_number, uint64_t event_number) {
0045         m_measurements_output() = m_algo->produce(*m_hits_input());
0046     }
0047 };
0048 
0049 } // eicrecon