File indexing completed on 2024-09-28 07:02:56
0001
0002
0003
0004 #pragma once
0005
0006 #include <algorithms/algorithm.h>
0007 #include <edm4eic/ClusterCollection.h>
0008 #include <edm4eic/ReconstructedParticleCollection.h>
0009 #include <spdlog/logger.h>
0010 #include <memory>
0011 #include <optional>
0012 #include <string> // for basic_string
0013 #include <string_view> // for string_view
0014 #include <vector>
0015
0016 #include "algorithms/interfaces/WithPodConfig.h"
0017 #include "algorithms/reco/FarForwardNeutronReconstructionConfig.h"
0018
0019 namespace eicrecon {
0020
0021 using FarForwardNeutronReconstructionAlgorithm = algorithms::Algorithm<
0022 algorithms::Input<
0023 const edm4eic::ClusterCollection,
0024 std::optional<edm4eic::ClusterCollection>
0025 >,
0026 algorithms::Output<
0027 edm4eic::ReconstructedParticleCollection
0028 >
0029 >;
0030 class FarForwardNeutronReconstruction :
0031 public FarForwardNeutronReconstructionAlgorithm,
0032 public WithPodConfig<FarForwardNeutronReconstructionConfig> {
0033 public:
0034 FarForwardNeutronReconstruction(std::string_view name)
0035 : FarForwardNeutronReconstructionAlgorithm{name,
0036 {"inputClustersHcal", "inputClustersEcal"},
0037 {"outputNeutrons"},
0038 "Merges all HCAL (and optionally also ECAL) clusters in a collection into a neutron candidate"} {}
0039
0040 void init() final;
0041 void process(const Input&, const Output&) const final;
0042 double calc_corr(double Etot, const std::vector<double>&) const;
0043 private:
0044 std::shared_ptr<spdlog::logger> m_log;
0045 double m_neutron{0.93956542052};
0046
0047 };
0048 }