File indexing completed on 2026-06-17 07:50:49
0001
0002
0003
0004 #pragma once
0005 #include <DD4hep/Detector.h>
0006 #include <algorithms/algorithm.h>
0007 #include <algorithms/geo.h>
0008 #include <edm4eic/ReconstructedParticleCollection.h>
0009 #include <spdlog/logger.h>
0010 #include <gsl/pointers>
0011 #include <memory>
0012 #include <string> // for basic_string
0013 #include <string_view> // for string_view
0014
0015 #include "algorithms/interfaces/WithPodConfig.h"
0016 #include "services/particle/ParticleSvc.h"
0017 #include "algorithms/reco/LambdaReconstructionConfig.h"
0018
0019 namespace eicrecon {
0020
0021 using LambdaReconstructionAlgorithm = algorithms::Algorithm<
0022 algorithms::Input<const edm4eic::ReconstructedParticleCollection,
0023 const edm4eic::ReconstructedParticleCollection,
0024 const edm4eic::ReconstructedParticleCollection,
0025 const edm4eic::ReconstructedParticleCollection>,
0026
0027 algorithms::Output<edm4eic::ReconstructedParticleCollection,
0028 edm4eic::ReconstructedParticleCollection>>;
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 class LambdaReconstruction : public LambdaReconstructionAlgorithm,
0049 public WithPodConfig<LambdaReconstructionConfig> {
0050 public:
0051 LambdaReconstruction(std::string_view name)
0052 : LambdaReconstructionAlgorithm{
0053 name,
0054
0055 {"inputNeutralsHcal", "inputNeutralsB0", "inputNeutralsEcalEndCapP",
0056 "inputNeutralsLFHCAL"},
0057
0058 {"outputLambdas", "outputLambdaDecayProductsCM"},
0059
0060 "Reconstructs lambda candidates and their decay products (in the CM frame) from the "
0061 "reconstructed neutrons and photons"} {}
0062
0063 void init() final;
0064 void process(const Input&, const Output&) const final;
0065
0066 private:
0067 std::shared_ptr<spdlog::logger> m_log;
0068 const algorithms::ParticleSvc& m_particleSvc = algorithms::ParticleSvc::instance();
0069 const dd4hep::Detector* m_detector{algorithms::GeoSvc::instance().detector()};
0070 double m_zMax{0};
0071
0072 bool reconstruct_from_triplet(const edm4eic::ReconstructedParticle& n_in,
0073 const edm4eic::ReconstructedParticle& g1_in,
0074 const edm4eic::ReconstructedParticle& g2_in,
0075 edm4eic::ReconstructedParticleCollection* out_lambdas,
0076 edm4eic::ReconstructedParticleCollection* out_decay_products) const;
0077 };
0078 }