Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-05-15 07:57:13

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/EDM4hep/EDM4hepInputConverter.hpp"
0014 
0015 #include <string>
0016 
0017 namespace podio {
0018 class Frame;
0019 }
0020 
0021 namespace ActsExamples {
0022 
0023 /// Read in a track collection as EDM4hep from a @c podio::Frame.
0024 class EDM4hepTrackInputConverter : public EDM4hepInputConverter {
0025  public:
0026   struct Config {
0027     std::string inputFrame;
0028     /// Input track collection name in edm4hep
0029     std::string inputTracks = "ActsTracks";
0030     /// Output track collection
0031     std::string outputTracks;
0032     /// Magnetic field along the z axis (needed for the conversion of
0033     /// parameters)
0034     double Bz;
0035   };
0036 
0037   /// constructor
0038   /// @param config is the configuration object
0039   /// @param level is the output logging level
0040   explicit EDM4hepTrackInputConverter(
0041       const Config& config, Acts::Logging::Level level = Acts::Logging::INFO);
0042 
0043   /// Readonly access to the config
0044   const Config& config() const { return m_cfg; }
0045 
0046   ProcessCode convert(const AlgorithmContext& ctx,
0047                       const podio::Frame& frame) const final;
0048 
0049  private:
0050   Config m_cfg;
0051 
0052   WriteDataHandle<ConstTrackContainer> m_outputTracks{this, "OutputTracks"};
0053 };
0054 
0055 }  // namespace ActsExamples