File indexing completed on 2025-02-22 09:39:00
0001
0002
0003
0004 #pragma once
0005
0006 #include <algorithms/algorithm.h>
0007 #include <edm4eic/ReconstructedParticleCollection.h>
0008 #include <edm4eic/TensorCollection.h>
0009 #include <edm4hep/MCParticleCollection.h>
0010 #include <mutex>
0011 #include <optional>
0012 #include <string>
0013 #include <string_view>
0014
0015 #include "algorithms/fardetectors/FarDetectorTransportationPostMLConfig.h"
0016 #include "algorithms/interfaces/WithPodConfig.h"
0017
0018 namespace eicrecon {
0019
0020 using FarDetectorTransportationPostMLAlgorithm =
0021 algorithms::Algorithm<
0022 algorithms::Input<
0023 edm4eic::TensorCollection,
0024 std::optional<edm4hep::MCParticleCollection>
0025 >,
0026 algorithms::Output<
0027 edm4eic::ReconstructedParticleCollection
0028 >
0029 >;
0030
0031 class FarDetectorTransportationPostML
0032 : public FarDetectorTransportationPostMLAlgorithm,
0033 public WithPodConfig<FarDetectorTransportationPostMLConfig> {
0034
0035 public:
0036 FarDetectorTransportationPostML(std::string_view name)
0037 : FarDetectorTransportationPostMLAlgorithm{name,
0038 {"inputPredictionsTensor"},
0039 {"outputParticles"},
0040 "Convert ML output tensor into reconstructed electron"} {
0041 }
0042
0043 void init() final;
0044 void process(const Input&, const Output&) const final;
0045
0046 private:
0047 mutable float m_beamE = 10.0;
0048 mutable std::once_flag m_initBeamE;
0049
0050 };
0051
0052 }