Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-28 07:57:56

0001 // Created by Alex Jentsch
0002 // Subject to the terms in the LICENSE file found in the top-level directory.
0003 //
0004 
0005 #pragma once
0006 
0007 #include <DDRec/CellIDPositionConverter.h>
0008 #include "services/algorithms_init/AlgorithmsInit_service.h"
0009 #include "algorithms/fardetectors/PolynomialMatrixReconstruction.h"
0010 #include "algorithms/fardetectors/PolynomialMatrixReconstructionConfig.h"
0011 
0012 // Event Model related classes
0013 #include <edm4eic/ReconstructedParticleCollection.h>
0014 #include <edm4eic/TrackerHitCollection.h>
0015 #include <edm4hep/SimTrackerHitCollection.h>
0016 #include <edm4hep/MCParticleCollection.h>
0017 
0018 #include "extensions/jana/JOmniFactory.h"
0019 
0020 namespace eicrecon {
0021 
0022 class PolynomialMatrixReconstruction_factory
0023     : public JOmniFactory<PolynomialMatrixReconstruction_factory,
0024                           PolynomialMatrixReconstructionConfig> {
0025 
0026 public:
0027   using AlgoT = eicrecon::PolynomialMatrixReconstruction;
0028 
0029 private:
0030   std::unique_ptr<AlgoT> m_algo;
0031 
0032   PodioInput<edm4hep::MCParticle> m_mcparts_input{this};
0033   PodioInput<edm4eic::TrackerHit> m_hits_input{this};
0034   PodioOutput<edm4eic::ReconstructedParticle> m_tracks_output{this};
0035 
0036   Service<DD4hep_service> m_geoSvc{this};
0037 
0038   ParameterRef<float> partMass{this, "partMass", config().partMass};
0039   ParameterRef<float> partCharge{this, "partCharge", config().partCharge};
0040   ParameterRef<long long> partPDG{this, "partPDG", config().partPDG};
0041 
0042   ParameterRef<double> crossingAngle{this, "crossingAngle", config().crossingAngle};
0043 
0044   ParameterRef<double> hit1minZ{this, "hit1minZ", config().hit1minZ};
0045   ParameterRef<double> hit1maxZ{this, "hit1maxZ", config().hit1maxZ};
0046   ParameterRef<double> hit2minZ{this, "hit2minZ", config().hit2minZ};
0047   ParameterRef<double> hit2maxZ{this, "hit2maxZ", config().hit2maxZ};
0048 
0049   ParameterRef<std::string> readout{this, "readout", config().readout};
0050 
0051   ParameterRef<bool> requireBeamProton{this, "requireBeamProton", config().requireBeamProton};
0052 
0053   Service<AlgorithmsInit_service> m_algorithmsInit{this};
0054 
0055 public:
0056   void Configure() {
0057     m_algo = std::make_unique<AlgoT>(GetPrefix());
0058     m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
0059     m_algo->applyConfig(config());
0060     m_algo->init();
0061   }
0062 
0063   void Process(int32_t /* run_number */, uint64_t /* event_number */) {
0064     m_algo->process({m_mcparts_input(), m_hits_input()}, {m_tracks_output().get()});
0065   }
0066 };
0067 
0068 } // namespace eicrecon