Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 07:59:48

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "ActsExamples/EventData/Track.hpp"
0012 #include "ActsExamples/Framework/DataHandle.hpp"
0013 #include "ActsExamples/Io/Podio/PodioInputConverter.hpp"
0014 
0015 #include <string>
0016 
0017 namespace ActsExamples {
0018 
0019 /// Read in a track collection as EDM4hep from a @c podio::Frame.
0020 class EDM4hepTrackInputConverter : public PodioInputConverter {
0021  public:
0022   struct Config {
0023     std::string inputFrame;
0024     /// Input track collection name in edm4hep
0025     std::string inputTracks = "ActsTracks";
0026     /// Output track collection
0027     std::string outputTracks;
0028     /// Magnetic field along the z axis (needed for the conversion of
0029     /// parameters)
0030     double Bz{};
0031   };
0032 
0033   /// constructor
0034   /// @param config is the configuration object
0035   /// @param level is the output logging level
0036   explicit EDM4hepTrackInputConverter(
0037       const Config& config,
0038       std::unique_ptr<const Acts::Logger> logger = nullptr);
0039 
0040   /// Readonly access to the config
0041   const Config& config() const { return m_cfg; }
0042 
0043   ProcessCode convert(const AlgorithmContext& ctx,
0044                       const podio::Frame& frame) const final;
0045 
0046  private:
0047   Config m_cfg;
0048 
0049   WriteDataHandle<ConstTrackContainer> m_outputTracks{this, "OutputTracks"};
0050 };
0051 
0052 }  // namespace ActsExamples