ATLAS Offline Software
Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 //
3 // Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
4 //
5 #ifndef ATHEXCUDA_TRACKPARTICLECONTAINER_H
6 #define ATHEXCUDA_TRACKPARTICLECONTAINER_H
7 
8 // VecMem include(s).
9 #include <vecmem/edm/container.hpp>
10 
11 namespace AthCUDAExamples {
12 
14 template <typename BASE>
15 struct TrackParticleInterface : public BASE {
16 
18  using BASE::BASE;
19 
21  VECMEM_HOST_AND_DEVICE
22  const auto& theta() const { return BASE::template get<0>(); }
24  VECMEM_HOST_AND_DEVICE
25  auto& theta() { return BASE::template get<0>(); }
26 
28  VECMEM_HOST_AND_DEVICE
29  const auto& phi() const { return BASE::template get<1>(); }
31  VECMEM_HOST_AND_DEVICE
32  auto& phi() { return BASE::template get<1>(); }
33 
35  VECMEM_HOST_AND_DEVICE
36  const auto& qOverP() const { return BASE::template get<2>(); }
38  VECMEM_HOST_AND_DEVICE
39  auto& qOverP() { return BASE::template get<2>(); }
40 
41 }; // struct TrackParticleInterface
42 
44 using TrackParticleContainer = vecmem::edm::container<
45  TrackParticleInterface, vecmem::edm::type::vector<float>,
46  vecmem::edm::type::vector<float>, vecmem::edm::type::vector<float>>;
47 
48 } // namespace AthCUDAExamples
49 
50 #endif // ATHEXCUDA_TRACKPARTICLECONTAINER_H
AthCUDAExamples::TrackParticleInterface::theta
VECMEM_HOST_AND_DEVICE auto & theta()
Get the polar angles of the tracks (non-const)
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:25
AthCUDAExamples::TrackParticleContainer
vecmem::edm::container< TrackParticleInterface, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float > > TrackParticleContainer
SoA, GPU friendly TrackParticleContainer.
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:46
taskman.template
dictionary template
Definition: taskman.py:317
AthCUDAExamples::TrackParticleInterface
Interface for the VecMem based GPU friendly TrackParticleContainer.
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:15
AthCUDAExamples
Definition: cudaMultiply.h:11
AthCUDAExamples::TrackParticleInterface::phi
VECMEM_HOST_AND_DEVICE const auto & phi() const
Get the azimuthal angles of the tracks (const)
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:29
AthCUDAExamples::TrackParticleInterface::qOverP
VECMEM_HOST_AND_DEVICE const auto & qOverP() const
Get the inverse momenta of the tracks (const)
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:36
AthCUDAExamples::TrackParticleInterface::qOverP
VECMEM_HOST_AND_DEVICE auto & qOverP()
Get the inverse momenta of the tracks (non-const)
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:39
AthCUDAExamples::TrackParticleInterface::theta
VECMEM_HOST_AND_DEVICE const auto & theta() const
Get the polar angles of the tracks (const)
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:22
AthCUDAExamples::TrackParticleInterface::phi
VECMEM_HOST_AND_DEVICE auto & phi()
Get the azimuthal angles of the tracks (non-const)
Definition: Control/AthenaExamples/AthExCUDA/src/TrackParticleContainer.h:32