Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:55:18

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/TrackCollection.h>
0009 #include <edm4eic/MCRecoTrackParticleAssociationCollection.h>
0010 #include <edm4hep/MCParticleCollection.h>
0011 #include <mutex>
0012 #include <optional>
0013 #include <string>
0014 #include <string_view>
0015 
0016 #include "algorithms/fardetectors/FarDetectorTransportationPreMLConfig.h"
0017 #include "algorithms/interfaces/WithPodConfig.h"
0018 
0019 namespace eicrecon {
0020 
0021 using FarDetectorTransportationPreMLAlgorithm = algorithms::Algorithm<
0022     algorithms::Input<edm4eic::TrackCollection,
0023                       std::optional<edm4eic::MCRecoTrackParticleAssociationCollection>,
0024                       std::optional<edm4hep::MCParticleCollection>>,
0025     algorithms::Output<edm4eic::TensorCollection, std::optional<edm4eic::TensorCollection>>>;
0026 
0027 class FarDetectorTransportationPreML : public FarDetectorTransportationPreMLAlgorithm,
0028                                        public WithPodConfig<FarDetectorTransportationPreMLConfig> {
0029 
0030 public:
0031   FarDetectorTransportationPreML(std::string_view name)
0032       : FarDetectorTransportationPreMLAlgorithm{
0033             name,
0034             {"tracks", "trackAssociations", "beamElectrons"},
0035             {"outputFeatureTensor", "outputTargetTensor"},
0036             "Create tensor for input to far-detector magnetic transportation ML."} {}
0037 
0038   void init() final;
0039   void process(const Input&, const Output&) const final;
0040 
0041 private:
0042   mutable float m_beamE = 10.0;
0043   mutable std::once_flag m_initBeamE;
0044 };
0045 
0046 } // namespace eicrecon