Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:27:43

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2023 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/EventData/SourceLink.hpp"
0012 #include "Acts/Geometry/GeometryIdentifier.hpp"
0013 #include "Acts/Geometry/TrackingGeometry.hpp"
0014 #include "Acts/Plugins/Podio/PodioDynamicColumns.hpp"
0015 #include "Acts/Utilities/HashedString.hpp"
0016 #include "Acts/Utilities/Helpers.hpp"
0017 
0018 #include <limits>
0019 #include <memory>
0020 
0021 #include <podio/Frame.h>
0022 
0023 namespace ActsPodioEdm {
0024 class Surface;
0025 }
0026 
0027 namespace Acts {
0028 namespace PodioUtil {
0029 
0030 using Identifier = uint64_t;
0031 constexpr Identifier kNoIdentifier = std::numeric_limits<Identifier>::max();
0032 constexpr int kNoSurface = -1;
0033 
0034 // @TODO: We might want to consider making this a type erased type that's not an interface
0035 class ConversionHelper {
0036  public:
0037   virtual std::optional<Identifier> surfaceToIdentifier(
0038       const Surface& surface) const = 0;
0039   virtual const Surface* identifierToSurface(Identifier identifier) const = 0;
0040 
0041   virtual Identifier sourceLinkToIdentifier(const SourceLink& sl) = 0;
0042   virtual SourceLink identifierToSourceLink(Identifier identifier) const = 0;
0043 };
0044 
0045 std::shared_ptr<const Surface> convertSurfaceFromPodio(
0046     const ConversionHelper& helper, const ActsPodioEdm::Surface& surface);
0047 
0048 ActsPodioEdm::Surface convertSurfaceToPodio(const ConversionHelper& helper,
0049                                             const Acts::Surface& surface);
0050 }  // namespace PodioUtil
0051 
0052 namespace podio_detail {
0053 /// This is used by both the track and track state container, so the
0054 /// implementation is shared here
0055 void recoverDynamicColumns(
0056     const podio::Frame& frame, const std::string& stem,
0057     std::unordered_map<HashedString,
0058                        std::unique_ptr<podio_detail::ConstDynamicColumnBase>>&
0059         dynamic);
0060 }  // namespace podio_detail
0061 }  // namespace Acts