Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 09:39:00

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<
0022       edm4eic::TrackParametersCollection,
0023       std::optional<edm4hep::MCParticleCollection>,
0024       std::optional<edm4hep::MCParticleCollection>
0025     >,
0026     algorithms::Output<
0027       edm4eic::TensorCollection,
0028       std::optional<edm4eic::TensorCollection>
0029     >
0030   >;
0031 
0032   class FarDetectorTransportationPreML
0033   : public FarDetectorTransportationPreMLAlgorithm,
0034     public WithPodConfig<FarDetectorTransportationPreMLConfig> {
0035 
0036   public:
0037       FarDetectorTransportationPreML(std::string_view name)
0038         : FarDetectorTransportationPreMLAlgorithm{name,
0039                               {"TrackParameters","ScatteredElectrons","BeamElectrons"},
0040                               {"outputFeatureTensor", "outputTargetTensor"},
0041                               "Create tensor for input to far-detector magnetic transportation ML."} {}
0042 
0043 
0044       void init() final;
0045       void process(const Input&, const Output&);
0046 
0047   private:
0048     mutable float m_beamE = 10.0;
0049     mutable std::once_flag m_initBeamE;
0050 
0051   };
0052 
0053 } // eicrecon