/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
RecoTracker/LSTCore/interface/LSTESData.h
81 строка
4 KB
Andres Rios Tascon
Added LSTGeometry package and associated ESProducer
22 май 2026, 15:39
22 май 2026, 15:39
f954f8e
Код
Авторство
О чём код?
#ifndef RecoTracker_LSTCore_interface_LSTESData_h #define RecoTracker_LSTCore_interface_LSTESData_h #include "RecoTracker/LSTCore/interface/Common.h" #include "RecoTracker/LSTCore/interface/EndcapGeometryDevHostCollection.h" #include "RecoTracker/LSTCore/interface/ModulesHostCollection.h" #include "RecoTracker/LSTCore/interface/PixelMap.h" #include "RecoTracker/LSTGeometry/interface/Geometry.h" #include "HeterogeneousCore/AlpakaInterface/interface/CopyToDevice.h" #include <memory> namespace lst { template <typename TDev> struct LSTESData { uint16_t nModules; uint16_t nLowerModules; unsigned int nPixels; unsigned int nEndCapMap; // Using shared_ptr so that for the serial backend all streams can use the same data std::shared_ptr<const PortableCollection<TDev, ModulesSoABlocks>> modules; std::shared_ptr<const PortableCollection<TDev, EndcapGeometryDevSoA>> endcapGeometry; // Host-side object that is shared between the LSTESData<TDev> objects for different devices std::shared_ptr<const PixelMap> pixelMapping; LSTESData(uint16_t const& nModulesIn, uint16_t const& nLowerModulesIn, unsigned int const& nPixelsIn, unsigned int const& nEndCapMapIn, std::shared_ptr<const PortableCollection<TDev, ModulesSoABlocks>> modulesIn, std::shared_ptr<const PortableCollection<TDev, EndcapGeometryDevSoA>> endcapGeometryIn, std::shared_ptr<const PixelMap> const& pixelMappingIn) : nModules(nModulesIn), nLowerModules(nLowerModulesIn), nPixels(nPixelsIn), nEndCapMap(nEndCapMapIn), modules(std::move(modulesIn)), endcapGeometry(std::move(endcapGeometryIn)), pixelMapping(pixelMappingIn) {} }; std::unique_ptr<LSTESData<alpaka_common::DevHost>> loadAndFillESDataHost(std::string& ptCutLabel); std::unique_ptr<LSTESData<alpaka_common::DevHost>> fillESDataHost(lstgeometry::Geometry const& lstg); } // namespace lst namespace cms::alpakatools { template <> struct CopyToDevice<lst::LSTESData<alpaka_common::DevHost>> { template <typename TQueue> static lst::LSTESData<alpaka::Dev<TQueue>> copyAsync(TQueue& queue, lst::LSTESData<alpaka_common::DevHost> const& srcData) { using TDev = alpaka::Dev<TQueue>; std::shared_ptr<const PortableCollection<TDev, lst::ModulesSoABlocks>> deviceModules; std::shared_ptr<const PortableCollection<TDev, lst::EndcapGeometryDevSoA>> deviceEndcapGeometry; if constexpr (std::is_same_v<TDev, alpaka_common::DevHost>) { deviceModules = srcData.modules; deviceEndcapGeometry = srcData.endcapGeometry; } else { deviceModules = std::make_shared<PortableCollection<TDev, lst::ModulesSoABlocks>>( CopyToDevice<PortableHostCollection<lst::ModulesSoABlocks>>::copyAsync(queue, *srcData.modules)); deviceEndcapGeometry = std::make_shared<PortableCollection<TDev, lst::EndcapGeometryDevSoA>>( CopyToDevice<PortableHostCollection<lst::EndcapGeometryDevSoA>>::copyAsync(queue, *srcData.endcapGeometry)); } return lst::LSTESData<alpaka::Dev<TQueue>>(srcData.nModules, srcData.nLowerModules, srcData.nPixels, srcData.nEndCapMap, std::move(deviceModules), std::move(deviceEndcapGeometry), srcData.pixelMapping); } }; } // namespace cms::alpakatools #endif