File indexing completed on 2025-07-05 08:52:40
0001
0002
0003
0004 #pragma once
0005 #include <DD4hep/Detector.h>
0006 #include <algorithms/algorithm.h>
0007 #include <algorithms/geo.h>
0008 #include <edm4eic/ClusterCollection.h>
0009 #include <edm4eic/ReconstructedParticleCollection.h>
0010 #include <spdlog/logger.h>
0011 #include <gsl/pointers>
0012 #include <memory>
0013 #include <string> // for basic_string
0014 #include <string_view> // for string_view
0015 #include <vector>
0016
0017 #include "algorithms/interfaces/ParticleSvc.h"
0018 #include "algorithms/interfaces/WithPodConfig.h"
0019 #include "algorithms/reco/FarForwardNeutralsReconstructionConfig.h"
0020
0021 namespace eicrecon {
0022
0023 using FarForwardNeutralsReconstructionAlgorithm =
0024 algorithms::Algorithm<algorithms::Input<const edm4eic::ClusterCollection>,
0025 algorithms::Output<edm4eic::ReconstructedParticleCollection>>;
0026 class FarForwardNeutralsReconstruction
0027 : public FarForwardNeutralsReconstructionAlgorithm,
0028 public WithPodConfig<FarForwardNeutralsReconstructionConfig> {
0029 public:
0030 FarForwardNeutralsReconstruction(std::string_view name)
0031 : FarForwardNeutralsReconstructionAlgorithm{name,
0032 {"inputClustersHcal"},
0033 {"outputNeutrals"},
0034 "Merges all HCAL clusters in a collection into a "
0035 "neutron candidate and photon candidates "} {}
0036
0037 void init() final;
0038 void process(const Input&, const Output&) const final;
0039
0040 private:
0041 static double calc_corr(double Etot, const std::vector<double>&);
0042 bool isGamma(const edm4eic::Cluster& cluster) const;
0043
0044 std::shared_ptr<spdlog::logger> m_log;
0045 const algorithms::ParticleSvc& m_particleSvc = algorithms::ParticleSvc::instance();
0046 const dd4hep::Detector* m_detector{algorithms::GeoSvc::instance().detector()};
0047 double m_gammaZMax{0};
0048 };
0049 }