Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-05 23:51:18

0001 #ifndef DataFormats_Track_interface_TracksDevice_h
0002 #define DataFormats_Track_interface_TracksDevice_h
0003 
0004 #include <cstdint>
0005 
0006 #include <alpaka/alpaka.hpp>
0007 
0008 #include "DataFormats/Common/interface/Uninitialized.h"
0009 #include "DataFormats/Portable/interface/PortableDeviceCollection.h"
0010 #include "DataFormats/TrackSoA/interface/TrackDefinitions.h"
0011 #include "DataFormats/TrackSoA/interface/TracksSoA.h"
0012 
0013 // TODO: The class is created via inheritance of the PortableCollection.
0014 // This is generally discouraged, and should be done via composition.
0015 // See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306
0016 template <typename TrackerTraits, typename TDev>
0017 class TracksDevice : public PortableDeviceCollection<reco::TrackLayout<TrackerTraits>, TDev> {
0018 public:
0019   static constexpr int32_t S = TrackerTraits::maxNumberOfTuples;  //TODO: this could be made configurable at runtime
0020 
0021   TracksDevice(edm::Uninitialized)
0022       : PortableDeviceCollection<reco::TrackLayout<TrackerTraits>, TDev>{edm::kUninitialized} {
0023   }  // necessary for ROOT dictionaries
0024 
0025   using PortableDeviceCollection<reco::TrackLayout<TrackerTraits>, TDev>::view;
0026   using PortableDeviceCollection<reco::TrackLayout<TrackerTraits>, TDev>::const_view;
0027   using PortableDeviceCollection<reco::TrackLayout<TrackerTraits>, TDev>::buffer;
0028 
0029   // Constructor which specifies the SoA size
0030   template <typename TQueue>
0031   explicit TracksDevice(TQueue& queue) : PortableDeviceCollection<reco::TrackLayout<TrackerTraits>, TDev>(S, queue) {}
0032 };
0033 
0034 namespace pixelTrack {
0035 
0036   template <typename TDev>
0037   using TracksDevicePhase1 = TracksDevice<pixelTopology::Phase1, TDev>;
0038   template <typename TDev>
0039   using TracksDeviceHIonPhase1 = TracksDevice<pixelTopology::HIonPhase1, TDev>;
0040   template <typename TDev>
0041   using TracksDevicePhase2 = TracksDevice<pixelTopology::Phase2, TDev>;
0042 
0043 }  // namespace pixelTrack
0044 
0045 #endif  // DataFormats_Track_TracksDevice_H