File indexing completed on 2026-12-03 09:53:00
0001
0002
0003
0004 #pragma once
0005
0006 #include "algorithms/reco/ChargedLambdaReconstruction.h"
0007 #include "algorithms/reco/ChargedLambdaReconstructionConfig.h"
0008 #include "extensions/jana/JOmniFactory.h"
0009 #include "services/algorithms_init/AlgorithmsInit_service.h"
0010
0011 namespace eicrecon {
0012
0013 class ChargedLambdaReconstruction_factory
0014 : public JOmniFactory<ChargedLambdaReconstruction_factory, ChargedLambdaReconstructionConfig> {
0015
0016 public:
0017 using AlgoT = eicrecon::ChargedLambdaReconstruction;
0018
0019 private:
0020 std::unique_ptr<AlgoT> m_algo;
0021
0022 PodioInput<edm4eic::ReconstructedParticle> m_charged_input{this};
0023 PodioInput<edm4eic::ReconstructedParticle> m_roman_pot_input{this};
0024 PodioInput<edm4eic::ReconstructedParticle> m_off_momentum_input{this};
0025
0026 PodioOutput<edm4eic::ReconstructedParticle> m_lambda_output{this};
0027
0028 ParameterRef<double> m_opening_angle_max{this, "openingAngleMax", config().openingAngleMax,
0029 "maximum opening angle between the daughters [rad]"};
0030 ParameterRef<double> m_pair_theta_max{this, "pairThetaMax", config().pairThetaMax,
0031 "maximum polar angle of the summed pair momentum [rad]"};
0032 ParameterRef<double> m_dca_max{this, "dcaMax", config().dcaMax,
0033 "maximum distance of closest approach of the track lines [mm]"};
0034 ParameterRef<double> m_vertex_z_min{this, "vertexZMin", config().vertexZMin,
0035 "minimum z of the decay-vertex proxy [mm]"};
0036 ParameterRef<double> m_vertex_z_max{this, "vertexZMax", config().vertexZMax,
0037 "maximum z of the decay-vertex proxy [mm]"};
0038 ParameterRef<double> m_pointing_max{this, "pointingMax", config().pointingMax,
0039 "maximum pointing angle to the decay-vertex proxy [rad]"};
0040 ParameterRef<double> m_mom_asym_min{this, "momAsymMin", config().momAsymMin,
0041 "minimum momentum asymmetry (p_p - p_pi)/(p_p + p_pi)"};
0042 ParameterRef<double> m_mass_window{this, "massWindow", config().massWindow,
0043 "half-width of the invariant-mass window [GeV]"};
0044
0045 Service<AlgorithmsInit_service> m_algorithmsInit{this};
0046
0047 public:
0048 void Configure() {
0049 m_algo = std::make_unique<AlgoT>(GetPrefix());
0050 m_algo->level((algorithms::LogLevel)logger()->level());
0051
0052 m_algo->applyConfig(config());
0053 m_algo->init();
0054 }
0055
0056 void Process(int32_t , uint64_t ) {
0057 m_algo->process({m_charged_input(), m_roman_pot_input(), m_off_momentum_input()},
0058 {m_lambda_output().get()});
0059 }
0060 };
0061
0062 }