Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-09 07:53:23

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2024 - 2025, Simon Gardner
0003 
0004 #pragma once
0005 
0006 #include <algorithms/algorithm.h>
0007 #include <edm4eic/TensorCollection.h>
0008 #include <edm4eic/TrackParametersCollection.h>
0009 #include <edm4hep/MCParticleCollection.h>
0010 #include <mutex>
0011 #include <optional>
0012 #include <string>
0013 #include <string_view>
0014 
0015 #include "algorithms/fardetectors/FarDetectorTransportationPreMLConfig.h"
0016 #include "algorithms/interfaces/WithPodConfig.h"
0017 
0018 namespace eicrecon {
0019 
0020 using FarDetectorTransportationPreMLAlgorithm = algorithms::Algorithm<
0021     algorithms::Input<edm4eic::TrackParametersCollection,
0022                       std::optional<edm4hep::MCParticleCollection>,
0023                       std::optional<edm4hep::MCParticleCollection>>,
0024     algorithms::Output<edm4eic::TensorCollection, std::optional<edm4eic::TensorCollection>>>;
0025 
0026 class FarDetectorTransportationPreML : public FarDetectorTransportationPreMLAlgorithm,
0027                                        public WithPodConfig<FarDetectorTransportationPreMLConfig> {
0028 
0029 public:
0030   FarDetectorTransportationPreML(std::string_view name)
0031       : FarDetectorTransportationPreMLAlgorithm{
0032             name,
0033             {"TrackParameters", "ScatteredElectrons", "BeamElectrons"},
0034             {"outputFeatureTensor", "outputTargetTensor"},
0035             "Create tensor for input to far-detector magnetic transportation ML."} {}
0036 
0037   void init() final;
0038   void process(const Input&, const Output&) const final;
0039 
0040 private:
0041   mutable float m_beamE = 10.0;
0042   mutable std::once_flag m_initBeamE;
0043 };
0044 
0045 } // namespace eicrecon