ATLAS Offline Software
Loading...
Searching...
No Matches
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
11namespace AthCUDAExamples {
12
14template <typename BASE>
15struct 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
44using 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
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130
vecmem::edm::container< TrackParticleInterface, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float > > TrackParticleContainer
SoA, GPU friendly TrackParticleContainer.
Interface for the VecMem based GPU friendly TrackParticleContainer.
VECMEM_HOST_AND_DEVICE auto & theta()
Get the polar angles of the tracks (non-const)
VECMEM_HOST_AND_DEVICE const auto & theta() const
Get the polar angles of the tracks (const)
VECMEM_HOST_AND_DEVICE const auto & qOverP() const
Get the inverse momenta of the tracks (const)
VECMEM_HOST_AND_DEVICE const auto & phi() const
Get the azimuthal angles of the tracks (const)
VECMEM_HOST_AND_DEVICE auto & qOverP()
Get the inverse momenta of the tracks (non-const)
VECMEM_HOST_AND_DEVICE auto & phi()
Get the azimuthal angles of the tracks (non-const)