diff --git a/CUDADataFormats/BeamSpot/BuildFile.xml b/CUDADataFormats/BeamSpot/BuildFile.xml
deleted file mode 100644
index f639ac4de6f9b..0000000000000
--- a/CUDADataFormats/BeamSpot/BuildFile.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/BeamSpot/interface/BeamSpotCUDA.h b/CUDADataFormats/BeamSpot/interface/BeamSpotCUDA.h
deleted file mode 100644
index 7b04fac67b9f1..0000000000000
--- a/CUDADataFormats/BeamSpot/interface/BeamSpotCUDA.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef CUDADataFormats_BeamSpot_interface_BeamSpotCUDA_h
-#define CUDADataFormats_BeamSpot_interface_BeamSpotCUDA_h
-
-#include
-
-#include "DataFormats/BeamSpot/interface/BeamSpotPOD.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
-
-class BeamSpotCUDA {
-public:
- // default constructor, required by cms::cuda::Product
- BeamSpotCUDA() = default;
-
- // constructor that allocates cached device memory on the given CUDA stream
- BeamSpotCUDA(cudaStream_t stream) { data_d_ = cms::cuda::make_device_unique(stream); }
-
- // movable, non-copiable
- BeamSpotCUDA(BeamSpotCUDA const&) = delete;
- BeamSpotCUDA(BeamSpotCUDA&&) = default;
- BeamSpotCUDA& operator=(BeamSpotCUDA const&) = delete;
- BeamSpotCUDA& operator=(BeamSpotCUDA&&) = default;
-
- BeamSpotPOD* data() { return data_d_.get(); }
- BeamSpotPOD const* data() const { return data_d_.get(); }
-
- cms::cuda::device::unique_ptr& ptr() { return data_d_; }
- cms::cuda::device::unique_ptr const& ptr() const { return data_d_; }
-
-private:
- cms::cuda::device::unique_ptr data_d_;
-};
-
-#endif // CUDADataFormats_BeamSpot_interface_BeamSpotCUDA_h
diff --git a/CUDADataFormats/BeamSpot/src/classes.h b/CUDADataFormats/BeamSpot/src/classes.h
deleted file mode 100644
index 5aebe536f8a01..0000000000000
--- a/CUDADataFormats/BeamSpot/src/classes.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef CUDADataFormats_BeamSpot_classes_h
-#define CUDADataFormats_BeamSpot_classes_h
-
-#include "CUDADataFormats/Common/interface/Product.h"
-#include "CUDADataFormats/BeamSpot/interface/BeamSpotCUDA.h"
-#include "DataFormats/Common/interface/Wrapper.h"
-
-#endif // CUDADataFormats_BeamSpot_classes_h
diff --git a/CUDADataFormats/BeamSpot/src/classes_def.xml b/CUDADataFormats/BeamSpot/src/classes_def.xml
deleted file mode 100644
index 198edeebe7c73..0000000000000
--- a/CUDADataFormats/BeamSpot/src/classes_def.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/CUDADataFormats/SiPixelCluster/BuildFile.xml b/CUDADataFormats/SiPixelCluster/BuildFile.xml
deleted file mode 100644
index 1bf72a85ddc0a..0000000000000
--- a/CUDADataFormats/SiPixelCluster/BuildFile.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/SiPixelCluster/interface/SiPixelClustersCUDA.h b/CUDADataFormats/SiPixelCluster/interface/SiPixelClustersCUDA.h
deleted file mode 100644
index 7f461bef6d2f9..0000000000000
--- a/CUDADataFormats/SiPixelCluster/interface/SiPixelClustersCUDA.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef CUDADataFormats_SiPixelCluster_interface_SiPixelClustersCUDA_h
-#define CUDADataFormats_SiPixelCluster_interface_SiPixelClustersCUDA_h
-
-#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/cudaCompat.h"
-
-#include "DataFormats/SoATemplate/interface/SoALayout.h"
-#include "CUDADataFormats/Common/interface/PortableDeviceCollection.h"
-
-#include
-
-GENERATE_SOA_LAYOUT(SiPixelClustersCUDALayout,
- SOA_COLUMN(uint32_t, moduleStart),
- SOA_COLUMN(uint32_t, clusInModule),
- SOA_COLUMN(uint32_t, moduleId),
- SOA_COLUMN(uint32_t, clusModuleStart))
-
-using SiPixelClustersCUDASoA = SiPixelClustersCUDALayout<>;
-using SiPixelClustersCUDASOAView = SiPixelClustersCUDALayout<>::View;
-using SiPixelClustersCUDASOAConstView = SiPixelClustersCUDALayout<>::ConstView;
-
-// TODO: The class is created via inheritance of the PortableDeviceCollection.
-// This is generally discouraged, and should be done via composition, i.e.,
-// by adding a public class attribute like:
-// cms::cuda::Portabledevicecollection> collection;
-// See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306
-class SiPixelClustersCUDA : public cms::cuda::PortableDeviceCollection> {
-public:
- SiPixelClustersCUDA() = default;
- ~SiPixelClustersCUDA() = default;
-
- explicit SiPixelClustersCUDA(size_t maxModules, cudaStream_t stream)
- : PortableDeviceCollection>(maxModules + 1, stream) {}
-
- SiPixelClustersCUDA(SiPixelClustersCUDA &&) = default;
- SiPixelClustersCUDA &operator=(SiPixelClustersCUDA &&) = default;
-
- void setNClusters(uint32_t nClusters, int32_t offsetBPIX2) {
- nClusters_h = nClusters;
- offsetBPIX2_h = offsetBPIX2;
- }
-
- uint32_t nClusters() const { return nClusters_h; }
- int32_t offsetBPIX2() const { return offsetBPIX2_h; }
-
-private:
- uint32_t nClusters_h = 0;
- int32_t offsetBPIX2_h = 0;
-};
-
-#endif // CUDADataFormats_SiPixelCluster_interface_SiPixelClustersCUDA_h
diff --git a/CUDADataFormats/SiPixelCluster/interface/gpuClusteringConstants.h b/CUDADataFormats/SiPixelCluster/interface/gpuClusteringConstants.h
deleted file mode 100644
index 923ebaaa5446c..0000000000000
--- a/CUDADataFormats/SiPixelCluster/interface/gpuClusteringConstants.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef CUDADataFormats_SiPixelCluster_interface_gpuClusteringConstants_h
-#define CUDADataFormats_SiPixelCluster_interface_gpuClusteringConstants_h
-
-#include
-#include
-
-namespace gpuClustering {
-#ifdef GPU_SMALL_EVENTS
- // kept for testing and debugging
- constexpr uint32_t maxHitsInIter() { return 64; }
-#else
- // optimized for real data PU 50
- // tested on MC events with 55-75 pileup events
- constexpr uint32_t maxHitsInIter() { return 160; } //TODO better tuning for PU 140-200
-#endif
-
- constexpr uint16_t clusterThresholdLayerOne = 2000;
- constexpr uint16_t clusterThresholdOtherLayers = 4000;
-
- constexpr uint32_t maxNumDigis = 3 * 256 * 1024; // @PU=200 µ=530 σ=50k this is >4σ away
- constexpr uint16_t maxNumModules = 4000;
-
- constexpr uint16_t invalidModuleId = std::numeric_limits::max() - 1;
- constexpr int invalidClusterId = -9999;
- static_assert(invalidModuleId > maxNumModules); // invalidModuleId must be > maxNumModules
-
-} // namespace gpuClustering
-
-#endif // CUDADataFormats_SiPixelCluster_interface_gpuClusteringConstants_h
diff --git a/CUDADataFormats/SiPixelCluster/src/classes.h b/CUDADataFormats/SiPixelCluster/src/classes.h
deleted file mode 100644
index 3eee5a1fce009..0000000000000
--- a/CUDADataFormats/SiPixelCluster/src/classes.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef CUDADataFormats_SiPixelCluster_src_classes_h
-#define CUDADataFormats_SiPixelCluster_src_classes_h
-
-#include "CUDADataFormats/Common/interface/Product.h"
-#include "CUDADataFormats/SiPixelCluster/interface/SiPixelClustersCUDA.h"
-#include "DataFormats/Common/interface/Wrapper.h"
-
-#endif // CUDADataFormats_SiPixelCluster_src_classes_h
diff --git a/CUDADataFormats/SiPixelCluster/src/classes_def.xml b/CUDADataFormats/SiPixelCluster/src/classes_def.xml
deleted file mode 100644
index 70decb9f27df7..0000000000000
--- a/CUDADataFormats/SiPixelCluster/src/classes_def.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/CUDADataFormats/SiPixelDigi/BuildFile.xml b/CUDADataFormats/SiPixelDigi/BuildFile.xml
deleted file mode 100644
index 784f42c4441a4..0000000000000
--- a/CUDADataFormats/SiPixelDigi/BuildFile.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/SiPixelDigi/interface/SiPixelDigiErrorsCUDA.h b/CUDADataFormats/SiPixelDigi/interface/SiPixelDigiErrorsCUDA.h
deleted file mode 100644
index eff550feeb22e..0000000000000
--- a/CUDADataFormats/SiPixelDigi/interface/SiPixelDigiErrorsCUDA.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef CUDADataFormats_SiPixelDigi_interface_SiPixelDigiErrorsCUDA_h
-#define CUDADataFormats_SiPixelDigi_interface_SiPixelDigiErrorsCUDA_h
-
-#include
-
-#include "DataFormats/SiPixelRawData/interface/SiPixelErrorCompact.h"
-#include "DataFormats/SiPixelRawData/interface/SiPixelFormatterErrors.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/SimpleVector.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h"
-
-class SiPixelDigiErrorsCUDA {
-public:
- using SiPixelErrorCompactVector = cms::cuda::SimpleVector;
-
- SiPixelDigiErrorsCUDA() = default;
- explicit SiPixelDigiErrorsCUDA(size_t maxFedWords, SiPixelFormatterErrors errors, cudaStream_t stream);
- ~SiPixelDigiErrorsCUDA() = default;
-
- SiPixelDigiErrorsCUDA(const SiPixelDigiErrorsCUDA&) = delete;
- SiPixelDigiErrorsCUDA& operator=(const SiPixelDigiErrorsCUDA&) = delete;
- SiPixelDigiErrorsCUDA(SiPixelDigiErrorsCUDA&&) = default;
- SiPixelDigiErrorsCUDA& operator=(SiPixelDigiErrorsCUDA&&) = default;
-
- const SiPixelFormatterErrors& formatterErrors() const { return formatterErrors_h; }
-
- SiPixelErrorCompactVector* error() { return error_d.get(); }
- SiPixelErrorCompactVector const* error() const { return error_d.get(); }
-
- using HostDataError = std::pair>;
- HostDataError dataErrorToHostAsync(cudaStream_t stream) const;
-
- void copyErrorToHostAsync(cudaStream_t stream);
- int nErrorWords() const { return nErrorWords_; }
-
-private:
- cms::cuda::device::unique_ptr data_d;
- cms::cuda::device::unique_ptr error_d;
- cms::cuda::host::unique_ptr error_h;
- SiPixelFormatterErrors formatterErrors_h;
- int nErrorWords_ = 0;
-};
-
-#endif // CUDADataFormats_SiPixelDigi_interface_SiPixelDigiErrorsCUDA_h
diff --git a/CUDADataFormats/SiPixelDigi/interface/SiPixelDigisCUDA.h b/CUDADataFormats/SiPixelDigi/interface/SiPixelDigisCUDA.h
deleted file mode 100644
index 3beeaa4830c83..0000000000000
--- a/CUDADataFormats/SiPixelDigi/interface/SiPixelDigisCUDA.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef CUDADataFormats_SiPixelDigi_interface_SiPixelDigisCUDA_h
-#define CUDADataFormats_SiPixelDigi_interface_SiPixelDigisCUDA_h
-
-#include
-
-#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/cudaCompat.h"
-#include "CUDADataFormats/Common/interface/PortableDeviceCollection.h"
-#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h"
-#include "DataFormats/SoATemplate/interface/SoALayout.h"
-
-// TODO: The class is created via inheritance of the PortableDeviceCollection.
-// This is generally discouraged, and should be done via composition.
-// See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306
-class SiPixelDigisCUDA : public cms::cuda::PortableDeviceCollection {
-public:
- SiPixelDigisCUDA() = default;
- explicit SiPixelDigisCUDA(size_t maxFedWords, cudaStream_t stream)
- : PortableDeviceCollection(maxFedWords + 1, stream) {}
-
- ~SiPixelDigisCUDA() = default;
-
- SiPixelDigisCUDA(SiPixelDigisCUDA &&) = default;
- SiPixelDigisCUDA &operator=(SiPixelDigisCUDA &&) = default;
-
- void setNModulesDigis(uint32_t nModules, uint32_t nDigis) {
- nModules_h = nModules;
- nDigis_h = nDigis;
- }
-
- uint32_t nModules() const { return nModules_h; }
- uint32_t nDigis() const { return nDigis_h; }
-
-private:
- uint32_t nModules_h = 0;
- uint32_t nDigis_h = 0;
-};
-
-#endif // CUDADataFormats_SiPixelDigi_interface_SiPixelDigisCUDA_h
diff --git a/CUDADataFormats/SiPixelDigi/src/SiPixelDigiErrorsCUDA.cc b/CUDADataFormats/SiPixelDigi/src/SiPixelDigiErrorsCUDA.cc
deleted file mode 100644
index e81b1b2b592af..0000000000000
--- a/CUDADataFormats/SiPixelDigi/src/SiPixelDigiErrorsCUDA.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-#include
-
-#include "CUDADataFormats/SiPixelDigi/interface/SiPixelDigiErrorsCUDA.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/copyAsync.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/memsetAsync.h"
-
-SiPixelDigiErrorsCUDA::SiPixelDigiErrorsCUDA(size_t maxFedWords, SiPixelFormatterErrors errors, cudaStream_t stream)
- : data_d(cms::cuda::make_device_unique(maxFedWords, stream)),
- error_d(cms::cuda::make_device_unique(stream)),
- error_h(cms::cuda::make_host_unique(stream)),
- formatterErrors_h(std::move(errors)),
- nErrorWords_(maxFedWords) {
- assert(maxFedWords != 0);
- cms::cuda::memsetAsync(data_d, 0x00, maxFedWords, stream);
-
- cms::cuda::make_SimpleVector(error_h.get(), maxFedWords, data_d.get());
- assert(error_h->empty());
- assert(error_h->capacity() == static_cast(maxFedWords));
-
- cms::cuda::copyAsync(error_d, error_h, stream);
-}
-
-void SiPixelDigiErrorsCUDA::copyErrorToHostAsync(cudaStream_t stream) {
- cms::cuda::copyAsync(error_h, error_d, stream);
-}
-
-SiPixelDigiErrorsCUDA::HostDataError SiPixelDigiErrorsCUDA::dataErrorToHostAsync(cudaStream_t stream) const {
- // On one hand size() could be sufficient. On the other hand, if
- // someone copies the SimpleVector<>, (s)he might expect the data
- // buffer to actually have space for capacity() elements.
- auto data = cms::cuda::make_host_unique(error_h->capacity(), stream);
-
- // but transfer only the required amount
- if (not error_h->empty()) {
- cms::cuda::copyAsync(data, data_d, error_h->size(), stream);
- }
- auto err = *error_h;
- err.set_data(data.get());
- return HostDataError(err, std::move(data));
-}
diff --git a/CUDADataFormats/SiPixelDigi/src/classes.h b/CUDADataFormats/SiPixelDigi/src/classes.h
deleted file mode 100644
index fc5d318fad688..0000000000000
--- a/CUDADataFormats/SiPixelDigi/src/classes.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef CUDADataFormats_SiPixelDigi_src_classes_h
-#define CUDADataFormats_SiPixelDigi_src_classes_h
-
-#include "CUDADataFormats/Common/interface/Product.h"
-#include "CUDADataFormats/SiPixelDigi/interface/SiPixelDigiErrorsCUDA.h"
-#include "CUDADataFormats/SiPixelDigi/interface/SiPixelDigisCUDA.h"
-#include "DataFormats/Common/interface/Wrapper.h"
-
-#endif // CUDADataFormats_SiPixelDigi_src_classes_h
diff --git a/CUDADataFormats/SiPixelDigi/src/classes_def.xml b/CUDADataFormats/SiPixelDigi/src/classes_def.xml
deleted file mode 100644
index ff775afdc2046..0000000000000
--- a/CUDADataFormats/SiPixelDigi/src/classes_def.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/Track/BuildFile.xml b/CUDADataFormats/Track/BuildFile.xml
deleted file mode 100644
index cf07e3b540f24..0000000000000
--- a/CUDADataFormats/Track/BuildFile.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/Track/README.md b/CUDADataFormats/Track/README.md
deleted file mode 100644
index 8f66d9e4c4467..0000000000000
--- a/CUDADataFormats/Track/README.md
+++ /dev/null
@@ -1,50 +0,0 @@
-# Track CUDA Data Formats
-
-`CUDADataFormat`s meant to be used on Host (CPU) or Device (CUDA GPU) for
-storing information about `Track`s created during the Pixel-local Reconstruction
-chain. It stores data in an SoA manner. It combines the data contained in the
-deprecated `TrackSoAHeterogeneousT` and `TrajectoryStateSoAT` classes.
-
-The host format is inheriting from `CUDADataFormats/Common/interface/PortableHostCollection.h`,
-while the device format is inheriting from `CUDADataFormats/Common/interface/PortableDeviceCollection.h`
-
-Both formats use the same SoA Layout (`TrackSoAHeterogeneousLayout`) which is generated
-via the `GENERATE_SOA_LAYOUT` macro in the `PixelTrackUtilities.h` file.
-
-## Notes
-
--`hitIndices` and `detIndices`, instances of `HitContainer`, have been added into the
-layout as `SOA_SCALAR`s, meaning that they manage their own data independently from the SoA
-`Layout`. This could be improved in the future, if `HitContainer` (aka a `OneToManyAssoc` of fixed size)
-is replaced, but there don't seem to be any conflicts in including it in the `Layout` like this.
-- Host and Device classes should **not** be created via inheritance, as they're done here,
-but via composition. See [this discussion](https://github.com/cms-sw/cmssw/pull/40465#discussion_r1066039309).
-
-## TrackSoAHeterogeneousHost
-
-The version of the data format to be used for storing `Track` data on the CPU.
-Instances of this class are to be used for:
-
-- Having a place to copy data to host from device, via `cudaMemcpy`, or
-- Running host-side algorithms using data stored in an SoA manner.
-
-## TrackSoAHeterogeneousDevice
-
-The version of the data format to be used for storing `Track` data on the GPU.
-
-Instances of `TrackSoAHeterogeneousDevice` are to be created on host and be
-used on device only. To do so, the instance's `view()` method is to be called
-to pass a `View` to any kernel launched. Accessing data from the `view()` is not
-possible on the host side.
-
-## Utilities
-
-`PixelTrackUtilities.h` contains a collection of methods which were originally
-defined as class methods inside either `TrackSoAHeterogeneousT` and `TrajectoryStateSoAT`
-which have been adapted to operate on `View` instances, so that they are callable
-from within `__global__` kernels, on both CPU and CPU.
-
-## Use case
-
-See `test/TrackSoAHeterogeneous_test.cpp` for a simple example of instantiation,
-processing and copying from device to host.
diff --git a/CUDADataFormats/Track/interface/PixelTrackUtilities.h b/CUDADataFormats/Track/interface/PixelTrackUtilities.h
deleted file mode 100644
index 6d7ea258be8d2..0000000000000
--- a/CUDADataFormats/Track/interface/PixelTrackUtilities.h
+++ /dev/null
@@ -1,243 +0,0 @@
-#ifndef CUDADataFormats_Track_PixelTrackUtilities_h
-#define CUDADataFormats_Track_PixelTrackUtilities_h
-
-#include
-#include
-#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/HistoContainer.h"
-#include "DataFormats/SoATemplate/interface/SoALayout.h"
-
-namespace pixelTrack {
-
- enum class Quality : uint8_t { bad = 0, edup, dup, loose, strict, tight, highPurity, notQuality };
- constexpr uint32_t qualitySize{uint8_t(Quality::notQuality)};
- const std::string qualityName[qualitySize]{"bad", "edup", "dup", "loose", "strict", "tight", "highPurity"};
- inline Quality qualityByName(std::string const &name) {
- auto qp = std::find(qualityName, qualityName + qualitySize, name) - qualityName;
- return static_cast(qp);
- }
-
-} // namespace pixelTrack
-
-template
-struct TrackSoA {
- static constexpr int32_t S = TrackerTraits::maxNumberOfTuples;
- static constexpr int32_t H = TrackerTraits::avgHitsPerTrack;
- // Aliases in order to not confuse the GENERATE_SOA_LAYOUT
- // macro with weird colons and angled brackets.
- using Vector5f = Eigen::Matrix;
- using Vector15f = Eigen::Matrix;
- using Quality = pixelTrack::Quality;
-
- using hindex_type = uint32_t;
-
- using HitContainer = cms::cuda::OneToManyAssoc;
-
- GENERATE_SOA_LAYOUT(TrackSoALayout,
- SOA_COLUMN(Quality, quality),
- SOA_COLUMN(float, chi2),
- SOA_COLUMN(int8_t, nLayers),
- SOA_COLUMN(float, eta),
- SOA_COLUMN(float, pt),
- SOA_EIGEN_COLUMN(Vector5f, state),
- SOA_EIGEN_COLUMN(Vector15f, covariance),
- SOA_SCALAR(int, nTracks),
- SOA_SCALAR(HitContainer, hitIndices),
- SOA_SCALAR(HitContainer, detIndices))
-};
-
-// Methods that operate on View and ConstView of the TrackSoA, and cannot be class methods.
-
-template
-struct TracksUtilities {
- using TrackSoAView = typename TrackSoA::template TrackSoALayout<>::View;
- using TrackSoAConstView = typename TrackSoA::template TrackSoALayout<>::ConstView;
- using hindex_type = typename TrackSoA::hindex_type;
-
- // State at the Beam spot
- // phi,tip,1/pt,cotan(theta),zip
- static __host__ __device__ inline float charge(const TrackSoAConstView &tracks, int32_t i) {
- return std::copysign(1.f, tracks[i].state()(2));
- }
-
- static constexpr __host__ __device__ inline float phi(const TrackSoAConstView &tracks, int32_t i) {
- return tracks[i].state()(0);
- }
-
- static constexpr __host__ __device__ inline float tip(const TrackSoAConstView &tracks, int32_t i) {
- return tracks[i].state()(1);
- }
-
- static constexpr __host__ __device__ inline float zip(const TrackSoAConstView &tracks, int32_t i) {
- return tracks[i].state()(4);
- }
-
- static constexpr __host__ __device__ inline bool isTriplet(const TrackSoAConstView &tracks, int i) {
- return tracks[i].nLayers() == 3;
- }
-
- template
- static constexpr __host__ __device__ inline void copyFromCircle(
- TrackSoAView &tracks, V3 const &cp, M3 const &ccov, V2 const &lp, M2 const &lcov, float b, int32_t i) {
- tracks[i].state() << cp.template cast(), lp.template cast();
-
- tracks[i].state()(2) = tracks[i].state()(2) * b;
- auto cov = tracks[i].covariance();
- cov(0) = ccov(0, 0);
- cov(1) = ccov(0, 1);
- cov(2) = b * float(ccov(0, 2));
- cov(4) = cov(3) = 0;
- cov(5) = ccov(1, 1);
- cov(6) = b * float(ccov(1, 2));
- cov(8) = cov(7) = 0;
- cov(9) = b * b * float(ccov(2, 2));
- cov(11) = cov(10) = 0;
- cov(12) = lcov(0, 0);
- cov(13) = lcov(0, 1);
- cov(14) = lcov(1, 1);
- }
-
- template
- static constexpr __host__ __device__ inline void copyFromDense(TrackSoAView &tracks,
- V5 const &v,
- M5 const &cov,
- int32_t i) {
- tracks[i].state() = v.template cast();
- for (int j = 0, ind = 0; j < 5; ++j)
- for (auto k = j; k < 5; ++k)
- tracks[i].covariance()(ind++) = cov(j, k);
- }
-
- template
- static constexpr __host__ __device__ inline void copyToDense(const TrackSoAConstView &tracks,
- V5 &v,
- M5 &cov,
- int32_t i) {
- v = tracks[i].state().template cast();
- for (int j = 0, ind = 0; j < 5; ++j) {
- cov(j, j) = tracks[i].covariance()(ind++);
- for (auto k = j + 1; k < 5; ++k)
- cov(k, j) = cov(j, k) = tracks[i].covariance()(ind++);
- }
- }
-
- static constexpr __host__ __device__ inline int computeNumberOfLayers(const TrackSoAConstView &tracks, int32_t i) {
- auto pdet = tracks.detIndices().begin(i);
- int nl = 1;
- auto ol = pixelTopology::getLayer(*pdet);
- for (; pdet < tracks.detIndices().end(i); ++pdet) {
- auto il = pixelTopology::getLayer(*pdet);
- if (il != ol)
- ++nl;
- ol = il;
- }
- return nl;
- }
-
- static constexpr __host__ __device__ inline int nHits(const TrackSoAConstView &tracks, int i) {
- return tracks.detIndices().size(i);
- }
-};
-
-namespace pixelTrack {
-
- template
- struct QualityCutsT {};
-
- template
- struct QualityCutsT> {
- using TrackSoAView = typename TrackSoA::template TrackSoALayout<>::View;
- using TrackSoAConstView = typename TrackSoA::template TrackSoALayout<>::ConstView;
- using tracksHelper = TracksUtilities;
- // chi2 cut = chi2Scale * (chi2Coeff[0] + pT/GeV * (chi2Coeff[1] + pT/GeV * (chi2Coeff[2] + pT/GeV * chi2Coeff[3])))
- float chi2Coeff[4];
- float chi2MaxPt; // GeV
- float chi2Scale;
-
- struct Region {
- float maxTip; // cm
- float minPt; // GeV
- float maxZip; // cm
- };
-
- Region triplet;
- Region quadruplet;
-
- __device__ __forceinline__ bool isHP(const TrackSoAConstView &tracks, int nHits, int it) const {
- // impose "region cuts" based on the fit results (phi, Tip, pt, cotan(theta)), Zip)
- // default cuts:
- // - for triplets: |Tip| < 0.3 cm, pT > 0.5 GeV, |Zip| < 12.0 cm
- // - for quadruplets: |Tip| < 0.5 cm, pT > 0.3 GeV, |Zip| < 12.0 cm
- // (see CAHitNtupletGeneratorGPU.cc)
- auto const ®ion = (nHits > 3) ? quadruplet : triplet;
- return (std::abs(tracksHelper::tip(tracks, it)) < region.maxTip) and (tracks.pt(it) > region.minPt) and
- (std::abs(tracksHelper::zip(tracks, it)) < region.maxZip);
- }
-
- __device__ __forceinline__ bool strictCut(const TrackSoAConstView &tracks, int it) const {
- auto roughLog = [](float x) {
- // max diff [0.5,12] at 1.25 0.16143
- // average diff 0.0662998
- union IF {
- uint32_t i;
- float f;
- };
- IF z;
- z.f = x;
- uint32_t lsb = 1 < 21;
- z.i += lsb;
- z.i >>= 21;
- auto f = z.i & 3;
- int ex = int(z.i >> 2) - 127;
-
- // log2(1+0.25*f)
- // averaged over bins
- const float frac[4] = {0.160497f, 0.452172f, 0.694562f, 0.901964f};
- return float(ex) + frac[f];
- };
-
- float pt = std::min(tracks.pt(it), chi2MaxPt);
- float chi2Cut = chi2Scale * (chi2Coeff[0] + roughLog(pt) * chi2Coeff[1]);
- if (tracks.chi2(it) >= chi2Cut) {
-#ifdef NTUPLE_FIT_DEBUG
- printf("Bad chi2 %d pt %f eta %f chi2 %f\n", it, tracks.pt(it), tracks.eta(it), tracks.chi2(it));
-#endif
- return true;
- }
- return false;
- }
- };
-
- template
- struct QualityCutsT> {
- using TrackSoAView = typename TrackSoA::template TrackSoALayout<>::View;
- using TrackSoAConstView = typename TrackSoA::template TrackSoALayout<>::ConstView;
- using tracksHelper = TracksUtilities;
-
- float maxChi2;
- float minPt;
- float maxTip;
- float maxZip;
-
- __device__ __forceinline__ bool isHP(const TrackSoAConstView &tracks, int nHits, int it) const {
- return (std::abs(tracksHelper::tip(tracks, it)) < maxTip) and (tracks.pt(it) > minPt) and
- (std::abs(tracksHelper::zip(tracks, it)) < maxZip);
- }
- __device__ __forceinline__ bool strictCut(const TrackSoAConstView &tracks, int it) const {
- return tracks.chi2(it) >= maxChi2;
- }
- };
-
-} // namespace pixelTrack
-
-template
-using TrackLayout = typename TrackSoA::template TrackSoALayout<>;
-template
-using TrackSoAView = typename TrackSoA::template TrackSoALayout<>::View;
-template
-using TrackSoAConstView = typename TrackSoA::template TrackSoALayout<>::ConstView;
-
-template struct TracksUtilities;
-template struct TracksUtilities;
-
-#endif
diff --git a/CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h b/CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h
deleted file mode 100644
index 04d286a767ab0..0000000000000
--- a/CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef CUDADataFormats_Track_TrackHeterogeneousDevice_H
-#define CUDADataFormats_Track_TrackHeterogeneousDevice_H
-
-#include
-
-#include "CUDADataFormats/Track/interface/PixelTrackUtilities.h"
-#include "CUDADataFormats/Common/interface/PortableDeviceCollection.h"
-
-#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h"
-
-// TODO: The class is created via inheritance of the PortableDeviceCollection.
-// This is generally discouraged, and should be done via composition.
-// See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306
-template
-class TrackSoAHeterogeneousDevice : public cms::cuda::PortableDeviceCollection> {
-public:
- using cms::cuda::PortableDeviceCollection>::view;
- using cms::cuda::PortableDeviceCollection>::const_view;
- using cms::cuda::PortableDeviceCollection>::buffer;
- using cms::cuda::PortableDeviceCollection>::bufferSize;
-
- TrackSoAHeterogeneousDevice() = default; // cms::cuda::Product needs this
-
- // Constructor which specifies the SoA size
- explicit TrackSoAHeterogeneousDevice(cudaStream_t stream)
- : cms::cuda::PortableDeviceCollection>(TrackerTraits::maxNumberOfTuples, stream) {}
-};
-
-namespace pixelTrack {
-
- using TrackSoADevicePhase1 = TrackSoAHeterogeneousDevice;
- using TrackSoADevicePhase2 = TrackSoAHeterogeneousDevice;
- using TrackSoADeviceHIonPhase1 = TrackSoAHeterogeneousDevice;
-
-} // namespace pixelTrack
-
-#endif // CUDADataFormats_Track_TrackHeterogeneousT_H
diff --git a/CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h b/CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h
deleted file mode 100644
index 39e83491e1769..0000000000000
--- a/CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef CUDADataFormats_Track_TrackHeterogeneousHost_H
-#define CUDADataFormats_Track_TrackHeterogeneousHost_H
-
-#include
-
-#include "CUDADataFormats/Track/interface/PixelTrackUtilities.h"
-#include "CUDADataFormats/Common/interface/PortableHostCollection.h"
-
-// TODO: The class is created via inheritance of the PortableHostCollection.
-// This is generally discouraged, and should be done via composition.
-// See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306
-template
-class TrackSoAHeterogeneousHost : public cms::cuda::PortableHostCollection> {
-public:
- static constexpr int32_t S = TrackerTraits::maxNumberOfTuples; //TODO: this could be made configurable at runtime
- explicit TrackSoAHeterogeneousHost() : cms::cuda::PortableHostCollection>(S) {}
-
- using cms::cuda::PortableHostCollection>::view;
- using cms::cuda::PortableHostCollection>::const_view;
- using cms::cuda::PortableHostCollection>::buffer;
- using cms::cuda::PortableHostCollection>::bufferSize;
-
- // Constructor which specifies the SoA size
- explicit TrackSoAHeterogeneousHost(cudaStream_t stream)
- : cms::cuda::PortableHostCollection>(S, stream) {}
-};
-
-namespace pixelTrack {
-
- using TrackSoAHostPhase1 = TrackSoAHeterogeneousHost;
- using TrackSoAHostPhase2 = TrackSoAHeterogeneousHost;
- using TrackSoAHostHIonPhase1 = TrackSoAHeterogeneousHost;
-} // namespace pixelTrack
-
-#endif // CUDADataFormats_Track_TrackHeterogeneousT_H
diff --git a/CUDADataFormats/Track/src/classes.h b/CUDADataFormats/Track/src/classes.h
deleted file mode 100644
index 2e07adddcddd0..0000000000000
--- a/CUDADataFormats/Track/src/classes.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef CUDADataFormats_Track_src_classes_h
-#define CUDADataFormats_Track_src_classes_h
-
-#include "CUDADataFormats/Common/interface/Product.h"
-#include "CUDADataFormats/Common/interface/HostProduct.h"
-
-#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h"
-#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h"
-
-#include "DataFormats/Common/interface/Wrapper.h"
-
-#endif // CUDADataFormats_Track_src_classes_h
diff --git a/CUDADataFormats/Track/src/classes_def.xml b/CUDADataFormats/Track/src/classes_def.xml
deleted file mode 100644
index 5314f3f20b0d7..0000000000000
--- a/CUDADataFormats/Track/src/classes_def.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/Track/test/BuildFile.xml b/CUDADataFormats/Track/test/BuildFile.xml
deleted file mode 100644
index 32256c87ed577..0000000000000
--- a/CUDADataFormats/Track/test/BuildFile.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/Track/test/TrackSoAHeterogeneous_test.cpp b/CUDADataFormats/Track/test/TrackSoAHeterogeneous_test.cpp
deleted file mode 100644
index dafa75e2e18d7..0000000000000
--- a/CUDADataFormats/Track/test/TrackSoAHeterogeneous_test.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- Simple test for the pixelTrack::TrackSoA data structure
- which inherits from PortableDeviceCollection.
-
- Creates an instance of the class (automatically allocates
- memory on device), passes the view of the SoA data to
- the CUDA kernels which:
- - Fill the SoA with data.
- - Verify that the data written is correct.
-
- Then, the SoA data are copied back to Host, where
- a temporary host-side view (tmp_view) is created using
- the same Layout to access the data on host and print it.
- */
-
-#include
-#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h"
-#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/requireDevices.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
-
-#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h"
-
-namespace testTrackSoA {
-
- template
- void runKernels(TrackSoAView &tracks_view, cudaStream_t stream);
-}
-
-int main() {
- cms::cudatest::requireDevices();
-
- cudaStream_t stream;
- cudaCheck(cudaStreamCreateWithFlags(&stream, cudaStreamNonBlocking));
-
- // Inner scope to deallocate memory before destroying the stream
- {
- // Instantiate tracks on device. PortableDeviceCollection allocates
- // SoA on device automatically.
- TrackSoAHeterogeneousDevice tracks_d(stream);
- testTrackSoA::runKernels(tracks_d.view(), stream);
-
- // Instantate tracks on host. This is where the data will be
- // copied to from device.
- TrackSoAHeterogeneousHost tracks_h(stream);
-
- cudaCheck(cudaMemcpyAsync(
- tracks_h.buffer().get(), tracks_d.const_buffer().get(), tracks_d.bufferSize(), cudaMemcpyDeviceToHost, stream));
- cudaCheck(cudaStreamSynchronize(stream));
-
- // Print results
- std::cout << "pt"
- << "\t"
- << "eta"
- << "\t"
- << "chi2"
- << "\t"
- << "quality"
- << "\t"
- << "nLayers"
- << "\t"
- << "hitIndices off" << std::endl;
-
- for (int i = 0; i < 10; ++i) {
- std::cout << tracks_h.view()[i].pt() << "\t" << tracks_h.view()[i].eta() << "\t" << tracks_h.view()[i].chi2()
- << "\t" << (int)tracks_h.view()[i].quality() << "\t" << (int)tracks_h.view()[i].nLayers() << "\t"
- << tracks_h.view().hitIndices().off[i] << std::endl;
- }
- }
- cudaCheck(cudaStreamDestroy(stream));
-
- return 0;
-}
diff --git a/CUDADataFormats/Track/test/TrackSoAHeterogeneous_test.cu b/CUDADataFormats/Track/test/TrackSoAHeterogeneous_test.cu
deleted file mode 100644
index 8e8595eb43e94..0000000000000
--- a/CUDADataFormats/Track/test/TrackSoAHeterogeneous_test.cu
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "CUDADataFormats/Track/interface/PixelTrackUtilities.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/OneToManyAssoc.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
-
-namespace testTrackSoA {
-
- // Kernel which fills the TrackSoAView with data
- // to test writing to it
- template
- __global__ void fill(TrackSoAView tracks_view) {
- int i = threadIdx.x;
- if (i == 0) {
- tracks_view.nTracks() = 420;
- }
-
- for (int j = i; j < tracks_view.metadata().size(); j += blockDim.x) {
- tracks_view[j].pt() = (float)j;
- tracks_view[j].eta() = (float)j;
- tracks_view[j].chi2() = (float)j;
- tracks_view[j].quality() = (pixelTrack::Quality)(j % 256);
- tracks_view[j].nLayers() = j % 128;
- tracks_view.hitIndices().off[j] = j;
- }
- }
-
- // Kernel which reads from the TrackSoAView to verify
- // that it was written correctly from the fill kernel
- template
- __global__ void verify(TrackSoAConstView tracks_view) {
- int i = threadIdx.x;
-
- if (i == 0) {
- printf("SoA size: % d, block dims: % d\n", tracks_view.metadata().size(), blockDim.x);
- assert(tracks_view.nTracks() == 420);
- }
- for (int j = i; j < tracks_view.metadata().size(); j += blockDim.x) {
- assert(abs(tracks_view[j].pt() - (float)j) < .0001);
- assert(abs(tracks_view[j].eta() - (float)j) < .0001);
- assert(abs(tracks_view[j].chi2() - (float)j) < .0001);
- assert(tracks_view[j].quality() == (pixelTrack::Quality)(j % 256));
- assert(tracks_view[j].nLayers() == j % 128);
- assert(tracks_view.hitIndices().off[j] == j);
- }
- }
-
- // Host function which invokes the two kernels above
- template
- void runKernels(TrackSoAView& tracks_view, cudaStream_t stream) {
- fill<<<1, 1024, 0, stream>>>(tracks_view);
- cudaCheck(cudaGetLastError());
- cudaCheck(cudaDeviceSynchronize());
-
- verify<<<1, 1024, 0, stream>>>(tracks_view);
- cudaCheck(cudaGetLastError());
- cudaCheck(cudaDeviceSynchronize());
- }
-
- template void runKernels(TrackSoAView& tracks_view,
- cudaStream_t stream);
- template void runKernels(TrackSoAView& tracks_view,
- cudaStream_t stream);
-
-} // namespace testTrackSoA
diff --git a/CUDADataFormats/Track/test/TrajectoryStateSOA_t.cpp b/CUDADataFormats/Track/test/TrajectoryStateSOA_t.cpp
deleted file mode 100644
index d6ff539a642b0..0000000000000
--- a/CUDADataFormats/Track/test/TrajectoryStateSOA_t.cpp
+++ /dev/null
@@ -1 +0,0 @@
-#include "TrajectoryStateSOA_t.h"
diff --git a/CUDADataFormats/Track/test/TrajectoryStateSOA_t.cu b/CUDADataFormats/Track/test/TrajectoryStateSOA_t.cu
deleted file mode 100644
index d6ff539a642b0..0000000000000
--- a/CUDADataFormats/Track/test/TrajectoryStateSOA_t.cu
+++ /dev/null
@@ -1 +0,0 @@
-#include "TrajectoryStateSOA_t.h"
diff --git a/CUDADataFormats/Track/test/TrajectoryStateSOA_t.h b/CUDADataFormats/Track/test/TrajectoryStateSOA_t.h
deleted file mode 100644
index 6ba0eaa5c986e..0000000000000
--- a/CUDADataFormats/Track/test/TrajectoryStateSOA_t.h
+++ /dev/null
@@ -1,85 +0,0 @@
-#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h"
-#include "CUDADataFormats/Track/interface/PixelTrackUtilities.h"
-#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h"
-#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h"
-
-using Vector5d = Eigen::Matrix;
-using Matrix5d = Eigen::Matrix;
-using helper = TracksUtilities;
-
-__host__ __device__ Matrix5d loadCov(Vector5d const& e) {
- Matrix5d cov;
- for (int i = 0; i < 5; ++i)
- cov(i, i) = e(i) * e(i);
- for (int i = 0; i < 5; ++i) {
- for (int j = 0; j < i; ++j) {
- double v = 0.3 * std::sqrt(cov(i, i) * cov(j, j)); // this makes the matrix pos defined
- cov(i, j) = (i + j) % 2 ? -0.4 * v : 0.1 * v;
- cov(j, i) = cov(i, j);
- }
- }
- return cov;
-}
-
-template
-__global__ void testTSSoA(TrackSoAView ts) {
- Vector5d par0;
- par0 << 0.2, 0.1, 3.5, 0.8, 0.1;
- Vector5d e0;
- e0 << 0.01, 0.01, 0.035, -0.03, -0.01;
- auto cov0 = loadCov(e0);
-
- int first = threadIdx.x + blockIdx.x * blockDim.x;
-
- for (int i = first; i < ts.metadata().size(); i += blockDim.x * gridDim.x) {
- helper::copyFromDense(ts, par0, cov0, i);
- Vector5d par1;
- Matrix5d cov1;
- helper::copyToDense(ts, par1, cov1, i);
- Vector5d delV = par1 - par0;
- Matrix5d delM = cov1 - cov0;
- for (int j = 0; j < 5; ++j) {
- assert(std::abs(delV(j)) < 1.e-5);
- for (auto k = j; k < 5; ++k) {
- assert(cov0(k, j) == cov0(j, k));
- assert(cov1(k, j) == cov1(j, k));
- assert(std::abs(delM(k, j)) < 1.e-5);
- }
- }
- }
-}
-
-#ifdef __CUDACC__
-#include "HeterogeneousCore/CUDAUtilities/interface/requireDevices.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
-#endif
-
-int main() {
-#ifdef __CUDACC__
- cms::cudatest::requireDevices();
- cudaStream_t stream;
- cudaCheck(cudaStreamCreateWithFlags(&stream, cudaStreamNonBlocking));
-#endif
-
-#ifdef __CUDACC__
- // Since we are going to copy data from ts_d to ts_h, we
- // need to initialize the Host collection with a stream.
- TrackSoAHeterogeneousHost ts_h(stream);
- TrackSoAHeterogeneousDevice ts_d(stream);
-#else
- // If CUDA is not available, Host collection must not be initialized
- // with a stream.
- TrackSoAHeterogeneousHost ts_h;
-#endif
-
-#ifdef __CUDACC__
- testTSSoA<<<1, 64, 0, stream>>>(ts_d.view());
- cudaCheck(cudaGetLastError());
- cudaCheck(cudaMemcpyAsync(
- ts_h.buffer().get(), ts_d.const_buffer().get(), ts_d.bufferSize(), cudaMemcpyDeviceToHost, stream));
- cudaCheck(cudaGetLastError());
- cudaCheck(cudaStreamSynchronize(stream));
-#else
- testTSSoA(ts_h.view());
-#endif
-}
diff --git a/CUDADataFormats/TrackingRecHit/BuildFile.xml b/CUDADataFormats/TrackingRecHit/BuildFile.xml
deleted file mode 100644
index 388d342a44497..0000000000000
--- a/CUDADataFormats/TrackingRecHit/BuildFile.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/TrackingRecHit/interface/SiPixelHitStatus.h b/CUDADataFormats/TrackingRecHit/interface/SiPixelHitStatus.h
deleted file mode 100644
index 13322ce3952b7..0000000000000
--- a/CUDADataFormats/TrackingRecHit/interface/SiPixelHitStatus.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef CUDADataFormats_TrackingRecHit_interface_SiPixelHitStatus_H
-#define CUDADataFormats_TrackingRecHit_interface_SiPixelHitStatus_H
-
-#include
-
-// more information on bit fields : https://en.cppreference.com/w/cpp/language/bit_field
-struct SiPixelHitStatus {
- bool isBigX : 1; // ∈[0,1]
- bool isOneX : 1; // ∈[0,1]
- bool isBigY : 1; // ∈[0,1]
- bool isOneY : 1; // ∈[0,1]
- uint8_t qBin : 3; // ∈[0,1,...,7]
-};
-
-struct SiPixelHitStatusAndCharge {
- SiPixelHitStatus status;
- uint32_t charge : 24;
-};
-
-#endif
diff --git a/CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoADevice.h b/CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoADevice.h
deleted file mode 100644
index 89a70369fa08f..0000000000000
--- a/CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoADevice.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef CUDADataFormats_RecHits_TrackingRecHitsDevice_h
-#define CUDADataFormats_RecHits_TrackingRecHitsDevice_h
-
-#include
-
-#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitsUtilities.h"
-#include "CUDADataFormats/Common/interface/PortableDeviceCollection.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
-
-template
-class TrackingRecHitSoADevice : public cms::cuda::PortableDeviceCollection> {
-public:
- using hitSoA = TrackingRecHitSoA;
- //Need to decorate the class with the inherited portable accessors being now a template
- using cms::cuda::PortableDeviceCollection>::view;
- using cms::cuda::PortableDeviceCollection>::const_view;
- using cms::cuda::PortableDeviceCollection>::buffer;
- using cms::cuda::PortableDeviceCollection>::bufferSize;
-
- TrackingRecHitSoADevice() = default; // cms::cuda::Product needs this
-
- using AverageGeometry = typename hitSoA::AverageGeometry;
- using ParamsOnGPU = typename hitSoA::ParamsOnGPU;
-
- // Constructor which specifies the SoA size
- explicit TrackingRecHitSoADevice(uint32_t nHits,
- int32_t offsetBPIX2,
- ParamsOnGPU const* cpeParams,
- uint32_t const* hitsModuleStart,
- cudaStream_t stream)
- : cms::cuda::PortableDeviceCollection>(nHits, stream),
- offsetBPIX2_(offsetBPIX2) {
- cudaCheck(cudaMemcpyAsync(&(view().nHits()), &nHits, sizeof(uint32_t), cudaMemcpyDefault, stream));
- // hitsModuleStart is on Device
- cudaCheck(cudaMemcpyAsync(view().hitsModuleStart().data(),
- hitsModuleStart,
- sizeof(uint32_t) * int(TrackerTraits::numberOfModules + 1),
- cudaMemcpyDefault,
- stream));
- cudaCheck(cudaMemcpyAsync(&(view().offsetBPIX2()), &offsetBPIX2, sizeof(int32_t), cudaMemcpyDefault, stream));
-
- // cpeParams argument is a pointer to device memory, copy
- // its contents into the Layout.
- cudaCheck(cudaMemcpyAsync(&(view().cpeParams()), cpeParams, int(sizeof(ParamsOnGPU)), cudaMemcpyDefault, stream));
- }
-
- cms::cuda::host::unique_ptr localCoordToHostAsync(cudaStream_t stream) const {
- auto ret = cms::cuda::make_host_unique(4 * nHits(), stream);
- size_t rowSize = sizeof(float) * nHits();
-
- size_t srcPitch = ptrdiff_t(view().yLocal()) - ptrdiff_t(view().xLocal());
- cudaCheck(
- cudaMemcpy2DAsync(ret.get(), rowSize, view().xLocal(), srcPitch, rowSize, 4, cudaMemcpyDeviceToHost, stream));
-
- return ret;
- } //move to utilities
-
- cms::cuda::host::unique_ptr hitsModuleStartToHostAsync(cudaStream_t stream) const {
- auto ret = cms::cuda::make_host_unique(TrackerTraits::numberOfModules + 1, stream);
- cudaCheck(cudaMemcpyAsync(ret.get(),
- view().hitsModuleStart().data(),
- sizeof(uint32_t) * (TrackerTraits::numberOfModules + 1),
- cudaMemcpyDefault,
- stream));
- return ret;
- }
-
- uint32_t nHits() const { return view().metadata().size(); }
- uint32_t offsetBPIX2() const {
- return offsetBPIX2_;
- } //offsetBPIX2 is used on host functions so is useful to have it also stored in the class and not only in the layout
-private:
- uint32_t offsetBPIX2_ = 0;
-};
-
-//Classes definition for Phase1/Phase2, to make the classes_def lighter. Not actually used in the code.
-using TrackingRecHitSoADevicePhase1 = TrackingRecHitSoADevice;
-using TrackingRecHitSoADevicePhase2 = TrackingRecHitSoADevice;
-using TrackingRecHitSoADeviceHIonPhase1 = TrackingRecHitSoADevice;
-
-#endif // CUDADataFormats_Track_TrackHeterogeneousT_H
diff --git a/CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoAHost.h b/CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoAHost.h
deleted file mode 100644
index bfac27b2b71e6..0000000000000
--- a/CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoAHost.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef CUDADataFormats_RecHits_TrackingRecHitsHost_h
-#define CUDADataFormats_RecHits_TrackingRecHitsHost_h
-
-#include
-
-#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitsUtilities.h"
-#include "CUDADataFormats/Common/interface/PortableHostCollection.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
-
-template
-class TrackingRecHitSoAHost : public cms::cuda::PortableHostCollection> {
-public:
- using hitSoA = TrackingRecHitSoA;
- //Need to decorate the class with the inherited portable accessors being now a template
- using cms::cuda::PortableHostCollection>::view;
- using cms::cuda::PortableHostCollection>::const_view;
- using cms::cuda::PortableHostCollection>::buffer;
- using cms::cuda::PortableHostCollection>::bufferSize;
-
- TrackingRecHitSoAHost() = default;
-
- using AverageGeometry = typename hitSoA::AverageGeometry;
- using ParamsOnGPU = typename hitSoA::ParamsOnGPU;
- using PhiBinnerStorageType = typename hitSoA::PhiBinnerStorageType;
- using PhiBinner = typename hitSoA::PhiBinner;
-
- // This SoA Host is used basically only for DQM
- // so we just need a slim constructor
- explicit TrackingRecHitSoAHost(uint32_t nHits)
- : cms::cuda::PortableHostCollection>(nHits) {}
-
- explicit TrackingRecHitSoAHost(uint32_t nHits, cudaStream_t stream)
- : cms::cuda::PortableHostCollection>(nHits, stream) {}
-
- explicit TrackingRecHitSoAHost(uint32_t nHits,
- int32_t offsetBPIX2,
- ParamsOnGPU const* cpeParams,
- uint32_t const* hitsModuleStart)
- : cms::cuda::PortableHostCollection>(nHits), offsetBPIX2_(offsetBPIX2) {
- view().nHits() = nHits;
- std::copy(hitsModuleStart, hitsModuleStart + TrackerTraits::numberOfModules + 1, view().hitsModuleStart().begin());
- memcpy(&(view().cpeParams()), cpeParams, sizeof(ParamsOnGPU));
- view().offsetBPIX2() = offsetBPIX2;
- }
-
- explicit TrackingRecHitSoAHost(uint32_t nHits,
- int32_t offsetBPIX2,
- ParamsOnGPU const* cpeParams,
- uint32_t const* hitsModuleStart,
- cudaStream_t stream)
- : cms::cuda::PortableHostCollection>(nHits, stream),
- offsetBPIX2_(offsetBPIX2) {
- view().nHits() = nHits;
- std::copy(hitsModuleStart, hitsModuleStart + TrackerTraits::numberOfModules + 1, view().hitsModuleStart().begin());
- memcpy(&(view().cpeParams()), cpeParams, sizeof(ParamsOnGPU));
- view().offsetBPIX2() = offsetBPIX2;
- }
-
- uint32_t nHits() const { return view().metadata().size(); }
- uint32_t offsetBPIX2() const {
- return offsetBPIX2_;
- } //offsetBPIX2 is used on host functions so is useful to have it also stored in the class and not only in the layout
-private:
- uint32_t offsetBPIX2_ = 0;
-};
-
-using TrackingRecHitSoAHostPhase1 = TrackingRecHitSoAHost;
-using TrackingRecHitSoAHostPhase2 = TrackingRecHitSoAHost;
-using TrackingRecHitSoAHostHIonPhase1 = TrackingRecHitSoAHost;
-
-#endif // CUDADataFormats_Track_TrackHeterogeneousT_H
diff --git a/CUDADataFormats/TrackingRecHit/interface/TrackingRecHitsUtilities.h b/CUDADataFormats/TrackingRecHit/interface/TrackingRecHitsUtilities.h
deleted file mode 100644
index 7e28cb97becc8..0000000000000
--- a/CUDADataFormats/TrackingRecHit/interface/TrackingRecHitsUtilities.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef CUDADataFormats_RecHits_TrackingRecHitsUtilities_h
-#define CUDADataFormats_RecHits_TrackingRecHitsUtilities_h
-
-#include
-#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/HistoContainer.h"
-#include "DataFormats/SoATemplate/interface/SoALayout.h"
-#include "RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforGPU.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h"
-#include "SiPixelHitStatus.h"
-
-template
-struct TrackingRecHitSoA {
- using hindex_type = typename TrackerTraits::hindex_type;
- using PhiBinner = cms::cuda::HistoContainer; //28 for phase2 geometry
-
- using PhiBinnerStorageType = typename PhiBinner::index_type;
- using AverageGeometry = pixelTopology::AverageGeometryT;
- using ParamsOnGPU = pixelCPEforGPU::ParamsOnGPUT;
-
- using HitLayerStartArray = std::array;
- using HitModuleStartArray = std::array;
-
- //Is it better to have two split?
- GENERATE_SOA_LAYOUT(TrackingRecHitSoALayout,
- SOA_COLUMN(float, xLocal),
- SOA_COLUMN(float, yLocal),
- SOA_COLUMN(float, xerrLocal),
- SOA_COLUMN(float, yerrLocal),
- SOA_COLUMN(float, xGlobal),
- SOA_COLUMN(float, yGlobal),
- SOA_COLUMN(float, zGlobal),
- SOA_COLUMN(float, rGlobal),
- SOA_COLUMN(int16_t, iphi),
- SOA_COLUMN(SiPixelHitStatusAndCharge, chargeAndStatus),
- SOA_COLUMN(int16_t, clusterSizeX),
- SOA_COLUMN(int16_t, clusterSizeY),
- SOA_COLUMN(uint16_t, detectorIndex),
-
- SOA_SCALAR(uint32_t, nHits),
- SOA_SCALAR(int32_t, offsetBPIX2),
- //These above could be separated in a specific
- //layout since they don't depends on the template
- //for the moment I'm keeping them here
- SOA_COLUMN(PhiBinnerStorageType, phiBinnerStorage),
- SOA_SCALAR(HitModuleStartArray, hitsModuleStart),
- SOA_SCALAR(HitLayerStartArray, hitsLayerStart),
- SOA_SCALAR(ParamsOnGPU, cpeParams),
- SOA_SCALAR(AverageGeometry, averageGeometry),
- SOA_SCALAR(PhiBinner, phiBinner));
-};
-
-template
-using TrackingRecHitLayout = typename TrackingRecHitSoA::template TrackingRecHitSoALayout<>;
-template
-using TrackingRecHitSoAView = typename TrackingRecHitSoA::template TrackingRecHitSoALayout<>::View;
-template
-using TrackingRecHitSoAConstView =
- typename TrackingRecHitSoA::template TrackingRecHitSoALayout<>::ConstView;
-
-#endif
diff --git a/CUDADataFormats/TrackingRecHit/src/classes.h b/CUDADataFormats/TrackingRecHit/src/classes.h
deleted file mode 100644
index 1f494d0517450..0000000000000
--- a/CUDADataFormats/TrackingRecHit/src/classes.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef CUDADataFormats_TrackingRecHit_src_classes_h
-#define CUDADataFormats_TrackingRecHit_src_classes_h
-
-#include "CUDADataFormats/Common/interface/Product.h"
-#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoAHost.h"
-#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoADevice.h"
-#include "DataFormats/Common/interface/Wrapper.h"
-
-#endif // CUDADataFormats_TrackingRecHit_src_classes_h
diff --git a/CUDADataFormats/TrackingRecHit/src/classes_def.xml b/CUDADataFormats/TrackingRecHit/src/classes_def.xml
deleted file mode 100644
index dfc2c6d748e0f..0000000000000
--- a/CUDADataFormats/TrackingRecHit/src/classes_def.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/TrackingRecHit/test/BuildFile.xml b/CUDADataFormats/TrackingRecHit/test/BuildFile.xml
deleted file mode 100644
index 7baacbac416a1..0000000000000
--- a/CUDADataFormats/TrackingRecHit/test/BuildFile.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/TrackingRecHit/test/TrackingRecHitSoA_test.cpp b/CUDADataFormats/TrackingRecHit/test/TrackingRecHitSoA_test.cpp
deleted file mode 100644
index 146bb9133d9d8..0000000000000
--- a/CUDADataFormats/TrackingRecHit/test/TrackingRecHitSoA_test.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoAHost.h"
-#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoADevice.h"
-
-#include "HeterogeneousCore/CUDAUtilities/interface/copyAsync.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/requireDevices.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/allocate_device.h"
-#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h"
-
-namespace testTrackingRecHitSoA {
-
- template
- void runKernels(TrackingRecHitSoADevice& hits, cudaStream_t stream);
-
-}
-
-int main() {
- using ParamsOnGPU = TrackingRecHitSoADevice::ParamsOnGPU;
- cms::cudatest::requireDevices();
-
- cudaStream_t stream;
- cudaCheck(cudaStreamCreateWithFlags(&stream, cudaStreamDefault));
-
- // inner scope to deallocate memory before destroying the stream
- {
- uint32_t nHits = 2000;
- int32_t offset = 100;
- uint32_t moduleStart[1856];
-
- for (size_t i = 0; i < 1856; i++) {
- moduleStart[i] = i * 2;
- }
- ParamsOnGPU* cpeParams_d;
- cudaCheck(cudaMalloc(&cpeParams_d, sizeof(ParamsOnGPU)));
- TrackingRecHitSoADevice tkhit(nHits, offset, cpeParams_d, &moduleStart[0], stream);
-
- testTrackingRecHitSoA::runKernels(tkhit, stream);
- printf("tkhit hits %d \n", tkhit.nHits());
- auto test = tkhit.localCoordToHostAsync(stream);
- printf("test[9] %.2f\n", test[9]);
-
- auto ret = tkhit.hitsModuleStartToHostAsync(stream);
- printf("mods[9] %d\n", ret[9]);
- cudaCheck(cudaFree(cpeParams_d));
- }
-
- cudaCheck(cudaStreamDestroy(stream));
-
- return 0;
-}
diff --git a/CUDADataFormats/TrackingRecHit/test/TrackingRecHitSoA_test.cu b/CUDADataFormats/TrackingRecHit/test/TrackingRecHitSoA_test.cu
deleted file mode 100644
index 48e8dea96911e..0000000000000
--- a/CUDADataFormats/TrackingRecHit/test/TrackingRecHitSoA_test.cu
+++ /dev/null
@@ -1,64 +0,0 @@
-#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitsUtilities.h"
-#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoADevice.h"
-
-namespace testTrackingRecHitSoA {
-
- template
- __global__ void fill(TrackingRecHitSoAView soa) {
- int i = threadIdx.x;
- int j = blockIdx.x;
- if (i == 0 and j == 0) {
- soa.offsetBPIX2() = 22;
- soa[10].xLocal() = 1.11;
- }
-
- soa[i].iphi() = i % 10;
- soa.hitsLayerStart()[j] = j;
- __syncthreads();
- }
-
- template
- __global__ void show(TrackingRecHitSoAView soa) {
- int i = threadIdx.x;
- int j = blockIdx.x;
-
- if (i == 0 and j == 0) {
- printf("nbins = %d \n", soa.phiBinner().nbins());
- printf("offsetBPIX %d ->%d \n", i, soa.offsetBPIX2());
- printf("nHits %d ->%d \n", i, soa.nHits());
- printf("hitsModuleStart %d ->%d \n", i, soa.hitsModuleStart().at(28));
- }
-
- if (i < 10) // can be increased to soa.nHits() for debugging
- printf("iPhi %d ->%d \n", i, soa[i].iphi());
-
- if (j * blockDim.x + i < 10) // can be increased to soa.phiBinner().nbins() for debugging
- printf(">bin size %d ->%d \n", j * blockDim.x + i, soa.phiBinner().size(j * blockDim.x + i));
- __syncthreads();
- }
-
- template
- void runKernels(TrackingRecHitSoADevice& hits, cudaStream_t stream) {
- printf("> RUN!\n");
- fill<<<10, 100, 0, stream>>>(hits.view());
-
- cudaCheck(cudaDeviceSynchronize());
- cms::cuda::fillManyFromVector(&(hits.view().phiBinner()),
- 10,
- hits.view().iphi(),
- hits.view().hitsLayerStart().data(),
- 2000,
- 256,
- hits.view().phiBinnerStorage(),
- stream);
- cudaCheck(cudaDeviceSynchronize());
- show<<<10, 1000, 0, stream>>>(hits.view());
- cudaCheck(cudaDeviceSynchronize());
- }
-
- template void runKernels(TrackingRecHitSoADevice& hits,
- cudaStream_t stream);
- template void runKernels(TrackingRecHitSoADevice& hits,
- cudaStream_t stream);
-
-} // namespace testTrackingRecHitSoA
diff --git a/CUDADataFormats/Vertex/BuildFile.xml b/CUDADataFormats/Vertex/BuildFile.xml
deleted file mode 100644
index c6b918ec4b12b..0000000000000
--- a/CUDADataFormats/Vertex/BuildFile.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/CUDADataFormats/Vertex/README.md b/CUDADataFormats/Vertex/README.md
deleted file mode 100644
index 3e495d15f776e..0000000000000
--- a/CUDADataFormats/Vertex/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# Vertex CUDA Data Formats
-
-`CUDADataFormat`s meant to be used on Host (CPU) or Device (CUDA GPU) for
-storing information about vertices created during the Pixel-local Reconstruction
-chain. It stores data in an SoA manner. It contains the data that was previously
-contained in the deprecated `ZVertexSoA` class.
-
-The host format is inheriting from `CUDADataFormats/Common/interface/PortableHostCollection.h`,
-while the device format is inheriting from `CUDADataFormats/Common/interface/PortableDeviceCollection.h`
-
-Both formats use the same SoA Layout (`ZVertexSoAHeterogeneousLayout`) which is generated
-via the `GENERATE_SOA_LAYOUT` macro in the `ZVertexUtilities.h` file.
-
-## Notes
-
-- Initially, `ZVertexSoA` had distinct array sizes for each attribute (e.g. `zv` was `MAXVTX` elements
-long, `ndof` was `MAXTRACKS` elements long). All columns are now of uniform `MAXTRACKS` size,
-meaning that there will be some wasted space (appx. 190kB).
-- Host and Device classes should **not** be created via inheritance, as they're done here,
-but via composition. See [this discussion](https://github.com/cms-sw/cmssw/pull/40465#discussion_r1066039309).
-
-## ZVertexHeterogeneousHost
-
-The version of the data format to be used for storing vertex data on the CPU.
-Instances of this class are to be used for:
-
-- Having a place to copy data to host from device, via `cudaMemcpy`, or
-- Running host-side algorithms using data stored in an SoA manner.
-
-## ZVertexHeterogeneousDevice
-
-The version of the data format to be used for storing vertex data on the GPU.
-
-Instances of `ZVertexHeterogeneousDevice` are to be created on host and be
-used on device only. To do so, the instance's `view()` method is to be called
-to pass a `View` to any kernel launched. Accessing data from the `view()` is not
-possible on the host side.
-
-## Utilities
-
-Apart from `ZVertexSoAHeterogeneousLayout`, `ZVertexUtilities.h` also contains
-a collection of methods which were originally
-defined as class methods inside the `ZVertexSoA` class
-which have been adapted to operate on `View` instances, so that they are callable
-from within `__global__` kernels, on both CPU and CPU.
diff --git a/CUDADataFormats/Vertex/interface/ZVertexHeterogeneous.h b/CUDADataFormats/Vertex/interface/ZVertexHeterogeneous.h
deleted file mode 100644
index 417a960951fb1..0000000000000
--- a/CUDADataFormats/Vertex/interface/ZVertexHeterogeneous.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef CUDADataFormatsVertexZVertexHeterogeneous_H
-#define CUDADataFormatsVertexZVertexHeterogeneous_H
-
-#include "CUDADataFormats/Vertex/interface/ZVertexSoA.h"
-#include "CUDADataFormats/Common/interface/HeterogeneousSoA.h"
-
-using ZVertexHeterogeneous = HeterogeneousSoA;
-#ifndef __CUDACC__
-#include "CUDADataFormats/Common/interface/Product.h"
-using ZVertexCUDAProduct = cms::cuda::Product;
-#endif
-
-#endif
diff --git a/CUDADataFormats/Vertex/interface/ZVertexSoA.h b/CUDADataFormats/Vertex/interface/ZVertexSoA.h
deleted file mode 100644
index 95106050f3d7a..0000000000000
--- a/CUDADataFormats/Vertex/interface/ZVertexSoA.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef CUDADataFormats_Vertex_ZVertexSoA_h
-#define CUDADataFormats_Vertex_ZVertexSoA_h
-
-#include
-#include "HeterogeneousCore/CUDAUtilities/interface/cudaCompat.h"
-
-// SOA for vertices
-// These vertices are clusterized and fitted only along the beam line (z)
-// to obtain their global coordinate the beam spot position shall be added (eventually correcting for the beam angle as well)
-struct ZVertexSoA {
- static constexpr uint32_t MAXTRACKS = 128 * 1024;
- static constexpr uint32_t MAXVTX = 1024;
-
- int16_t idv[MAXTRACKS]; // vertex index for each associated (original) track (-1 == not associate)
- float zv[MAXVTX]; // output z-posistion of found vertices
- float wv[MAXVTX]; // output weight (1/error^2) on the above
- float chi2[MAXVTX]; // vertices chi2
- float ptv2[MAXVTX]; // vertices pt^2
- int32_t ndof[MAXTRACKS]; // vertices number of dof (reused as workspace for the number of nearest neighbours FIXME)
- uint16_t sortInd[MAXVTX]; // sorted index (by pt2) ascending
- uint32_t nvFinal; // the number of vertices
-
- __host__ __device__ void init() { nvFinal = 0; }
-};
-
-#endif // CUDADataFormats_Vertex_ZVertexSoA_h
diff --git a/CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousDevice.h b/CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousDevice.h
deleted file mode 100644
index ae662d7fd5f9a..0000000000000
--- a/CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousDevice.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef CUDADataFormats_Vertex_ZVertexHeterogeneousDevice_H
-#define CUDADataFormats_Vertex_ZVertexHeterogeneousDevice_H
-
-#include "CUDADataFormats/Vertex/interface/ZVertexUtilities.h"
-#include "CUDADataFormats/Common/interface/PortableDeviceCollection.h"
-
-// TODO: The class is created via inheritance of the PortableDeviceCollection.
-// This is generally discouraged, and should be done via composition.
-// See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306
-template
-class ZVertexSoAHeterogeneousDevice : public cms::cuda::PortableDeviceCollection> {
-public:
- ZVertexSoAHeterogeneousDevice() = default; // cms::cuda::Product needs this
-
- // Constructor which specifies the SoA size
- explicit ZVertexSoAHeterogeneousDevice(cudaStream_t stream)
- : PortableDeviceCollection>(S, stream) {}
-};
-
-using ZVertexSoADevice = ZVertexSoAHeterogeneousDevice;
-
-#endif // CUDADataFormats_Vertex_ZVertexHeterogeneousDevice_H
diff --git a/CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousHost.h b/CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousHost.h
deleted file mode 100644
index 6b62d615e1d11..0000000000000
--- a/CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousHost.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef CUDADataFormats_Vertex_ZVertexHeterogeneousHost_H
-#define CUDADataFormats_Vertex_ZVertexHeterogeneousHost_H
-
-#include
-
-#include "CUDADataFormats/Vertex/interface/ZVertexUtilities.h"
-#include "CUDADataFormats/Common/interface/PortableHostCollection.h"
-
-// TODO: The class is created via inheritance of the PortableHostCollection.
-// This is generally discouraged, and should be done via composition.
-// See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306
-template
-class ZVertexSoAHeterogeneousHost : public cms::cuda::PortableHostCollection> {
-public:
- explicit ZVertexSoAHeterogeneousHost() : cms::cuda::PortableHostCollection>(S) {}
-
- // Constructor which specifies the SoA size and CUDA stream
- explicit ZVertexSoAHeterogeneousHost(cudaStream_t stream)
- : PortableHostCollection>(S, stream) {}
-};
-
-using ZVertexSoAHost = ZVertexSoAHeterogeneousHost;
-
-#endif // CUDADataFormats_Vertex_ZVertexHeterogeneousHost_H
diff --git a/CUDADataFormats/Vertex/interface/ZVertexUtilities.h b/CUDADataFormats/Vertex/interface/ZVertexUtilities.h
deleted file mode 100644
index 2403652377971..0000000000000
--- a/CUDADataFormats/Vertex/interface/ZVertexUtilities.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef CUDADataFormats_Vertex_ZVertexUtilities_h
-#define CUDADataFormats_Vertex_ZVertexUtilities_h
-
-#include
-#include "DataFormats/SoATemplate/interface/SoALayout.h"
-
-GENERATE_SOA_LAYOUT(ZVertexSoAHeterogeneousLayout,
- SOA_COLUMN(int16_t, idv),
- SOA_COLUMN(float, zv),
- SOA_COLUMN(float, wv),
- SOA_COLUMN(float, chi2),
- SOA_COLUMN(float, ptv2),
- SOA_COLUMN(int32_t, ndof),
- SOA_COLUMN(uint16_t, sortInd),
- SOA_SCALAR(uint32_t, nvFinal))
-
-// Previous ZVertexSoA class methods.
-// They operate on View and ConstView of the ZVertexSoA.
-namespace zVertex {
- // Common types for both Host and Device code
- using ZVertexSoALayout = ZVertexSoAHeterogeneousLayout<>;
- using ZVertexSoAView = ZVertexSoAHeterogeneousLayout<>::View;
- using ZVertexSoAConstView = ZVertexSoAHeterogeneousLayout<>::ConstView;
-
- namespace utilities {
-
- static constexpr uint32_t MAXTRACKS = 128 * 1024;
- static constexpr uint32_t MAXVTX = 1024;
-
- __host__ __device__ inline void init(ZVertexSoAView &vertices) { vertices.nvFinal() = 0; }
-
- } // namespace utilities
-} // namespace zVertex
-
-#endif
diff --git a/CUDADataFormats/Vertex/src/classes.h b/CUDADataFormats/Vertex/src/classes.h
deleted file mode 100644
index 0340affffa06c..0000000000000
--- a/CUDADataFormats/Vertex/src/classes.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef CUDADataFormats_Vertex_src_classes_h
-#define CUDADataFormats_Vertex_src_classes_h
-
-#include "CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousDevice.h"
-#include "CUDADataFormats/Vertex/interface/ZVertexSoAHeterogeneousHost.h"
-#include "CUDADataFormats/Common/interface/Product.h"
-#include "DataFormats/Common/interface/Wrapper.h"
-
-#endif // CUDADataFormats_Vertex_src_classes_h
diff --git a/CUDADataFormats/Vertex/src/classes_def.xml b/CUDADataFormats/Vertex/src/classes_def.xml
deleted file mode 100644
index 63bd5a1cc94a7..0000000000000
--- a/CUDADataFormats/Vertex/src/classes_def.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/CalibTracker/SiPixelESProducers/interface/SiPixelROCsStatusAndMappingWrapper.h b/CalibTracker/SiPixelESProducers/interface/SiPixelROCsStatusAndMappingWrapper.h
deleted file mode 100644
index f7555a75d9bec..0000000000000
--- a/CalibTracker/SiPixelESProducers/interface/SiPixelROCsStatusAndMappingWrapper.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef CalibTracker_SiPixelESProducers_interface_SiPixelROCsStatusAndMappingWrapper_h
-#define CalibTracker_SiPixelESProducers_interface_SiPixelROCsStatusAndMappingWrapper_h
-
-#include
-
-#include
-
-#include "CondFormats/SiPixelObjects/interface/SiPixelROCsStatusAndMapping.h"
-#include "HeterogeneousCore/CUDACore/interface/ESProduct.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
-
-class SiPixelFedCablingMap;
-class TrackerGeometry;
-class SiPixelQuality;
-
-class SiPixelROCsStatusAndMappingWrapper {
-public:
- SiPixelROCsStatusAndMappingWrapper(SiPixelFedCablingMap const &cablingMap,
- TrackerGeometry const &trackerGeom,
- SiPixelQuality const *badPixelInfo);
- ~SiPixelROCsStatusAndMappingWrapper();
-
- bool hasQuality() const { return hasQuality_; }
-
- // returns pointer to GPU memory
- const SiPixelROCsStatusAndMapping *getGPUProductAsync(cudaStream_t cudaStream) const;
-
- // returns pointer to GPU memory
- const unsigned char *getModToUnpAllAsync(cudaStream_t cudaStream) const;
- cms::cuda::device::unique_ptr getModToUnpRegionalAsync(std::set const &modules,
- cudaStream_t cudaStream) const;
-
-private:
- const SiPixelFedCablingMap *cablingMap_;
- std::vector> modToUnpDefault;
- unsigned int size;
- bool hasQuality_;
-
- SiPixelROCsStatusAndMapping *cablingMapHost = nullptr; // pointer to struct in CPU
-
- struct GPUData {
- ~GPUData();
- SiPixelROCsStatusAndMapping *cablingMapDevice = nullptr; // pointer to struct in GPU
- };
- cms::cuda::ESProduct gpuData_;
-
- struct ModulesToUnpack {
- ~ModulesToUnpack();
- unsigned char *modToUnpDefault = nullptr; // pointer to GPU
- };
- cms::cuda::ESProduct modToUnp_;
-};
-
-#endif // CalibTracker_SiPixelESProducers_interface_SiPixelROCsStatusAndMappingWrapper_h
diff --git a/CalibTracker/SiPixelESProducers/plugins/SiPixelROCsStatusAndMappingWrapperESProducer.cc b/CalibTracker/SiPixelESProducers/plugins/SiPixelROCsStatusAndMappingWrapperESProducer.cc
deleted file mode 100644
index 9c37860ca9ffe..0000000000000
--- a/CalibTracker/SiPixelESProducers/plugins/SiPixelROCsStatusAndMappingWrapperESProducer.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-#include
-
-#include "CalibTracker/SiPixelESProducers/interface/SiPixelROCsStatusAndMappingWrapper.h"
-#include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h"
-#include "CondFormats/DataRecord/interface/SiPixelQualityRcd.h"
-#include "FWCore/Framework/interface/ESProducer.h"
-#include "FWCore/Framework/interface/ESTransientHandle.h"
-#include "FWCore/Framework/interface/EventSetup.h"
-#include "FWCore/Framework/interface/ModuleFactory.h"
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
-#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
-#include "RecoTracker/Record/interface/CkfComponentsRecord.h" // TODO: eventually use something more limited
-
-class SiPixelROCsStatusAndMappingWrapperESProducer : public edm::ESProducer {
-public:
- explicit SiPixelROCsStatusAndMappingWrapperESProducer(const edm::ParameterSet& iConfig);
- std::unique_ptr produce(const CkfComponentsRecord& iRecord);
-
- static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
-
-private:
- edm::ESGetToken cablingMapToken_;
- edm::ESGetToken qualityToken_;
- edm::ESGetToken geometryToken_;
- bool useQuality_;
-};
-
-SiPixelROCsStatusAndMappingWrapperESProducer::SiPixelROCsStatusAndMappingWrapperESProducer(
- const edm::ParameterSet& iConfig)
- : useQuality_(iConfig.getParameter("UseQualityInfo")) {
- auto const& component = iConfig.getParameter("ComponentName");
- auto cc = setWhatProduced(this, component);
- cablingMapToken_ = cc.consumes(edm::ESInputTag{"", iConfig.getParameter("CablingMapLabel")});
- if (useQuality_) {
- qualityToken_ = cc.consumes();
- }
- geometryToken_ = cc.consumes();
-}
-
-void SiPixelROCsStatusAndMappingWrapperESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
- edm::ParameterSetDescription desc;
- desc.add("ComponentName", "");
- desc.add("CablingMapLabel", "")->setComment("CablingMap label");
- desc.add("UseQualityInfo", false);
- descriptions.addWithDefaultLabel(desc);
-}
-
-std::unique_ptr SiPixelROCsStatusAndMappingWrapperESProducer::produce(
- const CkfComponentsRecord& iRecord) {
- auto cablingMap = iRecord.getTransientHandle(cablingMapToken_);
-
- const SiPixelQuality* quality = nullptr;
- if (useQuality_) {
- auto qualityInfo = iRecord.getTransientHandle(qualityToken_);
- quality = qualityInfo.product();
- }
-
- auto geom = iRecord.getTransientHandle(geometryToken_);
-
- return std::make_unique(*cablingMap, *geom, quality);
-}
-
-#include "FWCore/Framework/interface/MakerMacros.h"
-#include "FWCore/Utilities/interface/typelookup.h"
-#include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h"
-
-DEFINE_FWK_EVENTSETUP_MODULE(SiPixelROCsStatusAndMappingWrapperESProducer);
diff --git a/CalibTracker/SiPixelESProducers/src/ES_SiPixelROCsStatusAndMappingWrapper.cc b/CalibTracker/SiPixelESProducers/src/ES_SiPixelROCsStatusAndMappingWrapper.cc
deleted file mode 100644
index 45767102b5958..0000000000000
--- a/CalibTracker/SiPixelESProducers/src/ES_SiPixelROCsStatusAndMappingWrapper.cc
+++ /dev/null
@@ -1,4 +0,0 @@
-#include "CalibTracker/SiPixelESProducers/interface/SiPixelROCsStatusAndMappingWrapper.h"
-#include "FWCore/Utilities/interface/typelookup.h"
-
-TYPELOOKUP_DATA_REG(SiPixelROCsStatusAndMappingWrapper);
diff --git a/CalibTracker/SiPixelESProducers/src/SiPixelROCsStatusAndMappingWrapper.cc b/CalibTracker/SiPixelESProducers/src/SiPixelROCsStatusAndMappingWrapper.cc
deleted file mode 100644
index 665d31b97ead2..0000000000000
--- a/CalibTracker/SiPixelESProducers/src/SiPixelROCsStatusAndMappingWrapper.cc
+++ /dev/null
@@ -1,171 +0,0 @@
-// C++ includes
-#include
-#include
-#include
-#include
-
-// CUDA includes
-#include
-
-// CMSSW includes
-#include "CUDADataFormats/SiPixelCluster/interface/gpuClusteringConstants.h"
-#include "CalibTracker/SiPixelESProducers/interface/SiPixelROCsStatusAndMappingWrapper.h"
-#include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h"
-#include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingTree.h"
-#include "CondFormats/SiPixelObjects/interface/SiPixelQuality.h"
-#include "FWCore/MessageLogger/interface/MessageLogger.h"
-#include "Geometry/CommonDetUnit/interface/GeomDetType.h"
-#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
-#include "HeterogeneousCore/CUDAUtilities/interface/host_unique_ptr.h"
-
-SiPixelROCsStatusAndMappingWrapper::SiPixelROCsStatusAndMappingWrapper(SiPixelFedCablingMap const& cablingMap,
- TrackerGeometry const& trackerGeom,
- SiPixelQuality const* badPixelInfo)
- : cablingMap_(&cablingMap), modToUnpDefault(pixelgpudetails::MAX_SIZE), hasQuality_(badPixelInfo != nullptr) {
- cudaCheck(cudaMallocHost(&cablingMapHost, sizeof(SiPixelROCsStatusAndMapping)));
-
- std::vector const& fedIds = cablingMap.fedIds();
- std::unique_ptr const& cabling = cablingMap.cablingTree();
-
- unsigned int startFed = *(fedIds.begin());
- unsigned int endFed = *(fedIds.end() - 1);
-
- sipixelobjects::CablingPathToDetUnit path;
- int index = 1;
-
- for (unsigned int fed = startFed; fed <= endFed; fed++) {
- for (unsigned int link = 1; link <= pixelgpudetails::MAX_LINK; link++) {
- for (unsigned int roc = 1; roc <= pixelgpudetails::MAX_ROC; roc++) {
- path = {fed, link, roc};
- const sipixelobjects::PixelROC* pixelRoc = cabling->findItem(path);
- cablingMapHost->fed[index] = fed;
- cablingMapHost->link[index] = link;
- cablingMapHost->roc[index] = roc;
- if (pixelRoc != nullptr) {
- cablingMapHost->rawId[index] = pixelRoc->rawId();
- cablingMapHost->rocInDet[index] = pixelRoc->idInDetUnit();
- modToUnpDefault[index] = false;
- if (badPixelInfo != nullptr)
- cablingMapHost->badRocs[index] = badPixelInfo->IsRocBad(pixelRoc->rawId(), pixelRoc->idInDetUnit());
- else
- cablingMapHost->badRocs[index] = false;
- } else { // store some dummy number
- cablingMapHost->rawId[index] = gpuClustering::invalidModuleId;
- cablingMapHost->rocInDet[index] = gpuClustering::invalidModuleId;
- cablingMapHost->badRocs[index] = true;
- modToUnpDefault[index] = true;
- }
- index++;
- }
- }
- } // end of FED loop
-
- // Given FedId, Link and idinLnk; use the following formula
- // to get the rawId and idinDU
- // index = (FedID-1200) * MAX_LINK* MAX_ROC + (Link-1)* MAX_ROC + idinLnk;
- // where, MAX_LINK = 48, MAX_ROC = 8 for Phase1 as mentioned Danek's email
- // FedID varies between 1200 to 1338 (In total 108 FED's)
- // Link varies between 1 to 48
- // idinLnk varies between 1 to 8
-
- for (int i = 1; i < index; i++) {
- if (cablingMapHost->rawId[i] == gpuClustering::invalidModuleId) {
- cablingMapHost->moduleId[i] = gpuClustering::invalidModuleId;
- } else {
- /*
- std::cout << cablingMapHost->rawId[i] << std::endl;
- */
- auto gdet = trackerGeom.idToDetUnit(cablingMapHost->rawId[i]);
- if (!gdet) {
- LogDebug("SiPixelROCsStatusAndMapping") << " Not found: " << cablingMapHost->rawId[i] << std::endl;
- continue;
- }
- cablingMapHost->moduleId[i] = gdet->index();
- }
- LogDebug("SiPixelROCsStatusAndMapping")
- << "----------------------------------------------------------------------------" << std::endl;
- LogDebug("SiPixelROCsStatusAndMapping")
- << i << std::setw(20) << cablingMapHost->fed[i] << std::setw(20) << cablingMapHost->link[i] << std::setw(20)
- << cablingMapHost->roc[i] << std::endl;
- LogDebug("SiPixelROCsStatusAndMapping")
- << i << std::setw(20) << cablingMapHost->rawId[i] << std::setw(20) << cablingMapHost->rocInDet[i]
- << std::setw(20) << cablingMapHost->moduleId[i] << std::endl;
- LogDebug("SiPixelROCsStatusAndMapping")
- << i << std::setw(20) << (bool)cablingMapHost->badRocs[i] << std::setw(20) << std::endl;
- LogDebug("SiPixelROCsStatusAndMapping")
- << "----------------------------------------------------------------------------" << std::endl;
- }
-
- cablingMapHost->size = index - 1;
-}
-
-SiPixelROCsStatusAndMappingWrapper::~SiPixelROCsStatusAndMappingWrapper() { cudaCheck(cudaFreeHost(cablingMapHost)); }
-
-const SiPixelROCsStatusAndMapping* SiPixelROCsStatusAndMappingWrapper::getGPUProductAsync(
- cudaStream_t cudaStream) const {
- const auto& data = gpuData_.dataForCurrentDeviceAsync(cudaStream, [this](GPUData& data, cudaStream_t stream) {
- // allocate
- cudaCheck(cudaMalloc(&data.cablingMapDevice, sizeof(SiPixelROCsStatusAndMapping)));
-
- // transfer
- cudaCheck(cudaMemcpyAsync(
- data.cablingMapDevice, this->cablingMapHost, sizeof(SiPixelROCsStatusAndMapping), cudaMemcpyDefault, stream));
- });
- return data.cablingMapDevice;
-}
-
-const unsigned char* SiPixelROCsStatusAndMappingWrapper::getModToUnpAllAsync(cudaStream_t cudaStream) const {
- const auto& data =
- modToUnp_.dataForCurrentDeviceAsync(cudaStream, [this](ModulesToUnpack& data, cudaStream_t stream) {
- cudaCheck(cudaMalloc((void**)&data.modToUnpDefault, pixelgpudetails::MAX_SIZE_BYTE_BOOL));
- cudaCheck(cudaMemcpyAsync(data.modToUnpDefault,
- this->modToUnpDefault.data(),
- this->modToUnpDefault.size() * sizeof(unsigned char),
- cudaMemcpyDefault,
- stream));
- });
- return data.modToUnpDefault;
-}
-
-cms::cuda::device::unique_ptr SiPixelROCsStatusAndMappingWrapper::getModToUnpRegionalAsync(
- std::set const& modules, cudaStream_t cudaStream) const {
- auto modToUnpDevice = cms::cuda::make_device_unique(pixelgpudetails::MAX_SIZE, cudaStream);
- auto modToUnpHost = cms::cuda::make_host_unique(pixelgpudetails::MAX_SIZE, cudaStream);
-
- std::vector const& fedIds = cablingMap_->fedIds();
- std::unique_ptr const& cabling = cablingMap_->cablingTree();
-
- unsigned int startFed = *(fedIds.begin());
- unsigned int endFed = *(fedIds.end() - 1);
-
- sipixelobjects::CablingPathToDetUnit path;
- int index = 1;
-
- for (unsigned int fed = startFed; fed <= endFed; fed++) {
- for (unsigned int link = 1; link <= pixelgpudetails::MAX_LINK; link++) {
- for (unsigned int roc = 1; roc <= pixelgpudetails::MAX_ROC; roc++) {
- path = {fed, link, roc};
- const sipixelobjects::PixelROC* pixelRoc = cabling->findItem(path);
- if (pixelRoc != nullptr) {
- modToUnpHost[index] = (not modules.empty()) and (modules.find(pixelRoc->rawId()) == modules.end());
- } else { // store some dummy number
- modToUnpHost[index] = true;
- }
- index++;
- }
- }
- }
-
- cudaCheck(cudaMemcpyAsync(modToUnpDevice.get(),
- modToUnpHost.get(),
- pixelgpudetails::MAX_SIZE * sizeof(unsigned char),
- cudaMemcpyHostToDevice,
- cudaStream));
- return modToUnpDevice;
-}
-
-SiPixelROCsStatusAndMappingWrapper::GPUData::~GPUData() { cudaCheck(cudaFree(cablingMapDevice)); }
-
-SiPixelROCsStatusAndMappingWrapper::ModulesToUnpack::~ModulesToUnpack() { cudaCheck(cudaFree(modToUnpDefault)); }
diff --git a/DQM/SiPixelHeterogeneous/plugins/BuildFile.xml b/DQM/SiPixelHeterogeneous/plugins/BuildFile.xml
index 79925fdcb6cf8..7606931353d8d 100644
--- a/DQM/SiPixelHeterogeneous/plugins/BuildFile.xml
+++ b/DQM/SiPixelHeterogeneous/plugins/BuildFile.xml
@@ -9,7 +9,4 @@
-
-
-
diff --git a/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareRecHitsSoA.cc b/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareRecHitsSoA.cc
deleted file mode 100644
index 6e2a908b59b38..0000000000000
--- a/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareRecHitsSoA.cc
+++ /dev/null
@@ -1,254 +0,0 @@
-// -*- C++ -*-
-// Package: SiPixelCompareRecHitsSoA
-// Class: SiPixelCompareRecHitsSoA
-//
-/**\class SiPixelCompareRecHitsSoA SiPixelCompareRecHitsSoA.cc
-*/
-//
-// Author: Suvankar Roy Chowdhury, Alessandro Rossi
-//
-#include "DataFormats/Math/interface/approx_atan2.h"
-#include "DataFormats/Common/interface/Handle.h"
-#include "FWCore/Framework/interface/Event.h"
-#include "FWCore/Framework/interface/Frameworkfwd.h"
-#include "FWCore/Framework/interface/MakerMacros.h"
-#include "FWCore/MessageLogger/interface/MessageLogger.h"
-#include "FWCore/ParameterSet/interface/ParameterSet.h"
-// DQM Histograming
-#include "DQMServices/Core/interface/MonitorElement.h"
-#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
-#include "DQMServices/Core/interface/DQMStore.h"
-#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoAHost.h"
-#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitsUtilities.h"
-// Geometry
-#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
-#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
-#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
-#include "Geometry/CommonTopologies/interface/PixelTopology.h"
-#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
-#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
-
-template
-class SiPixelCompareRecHitsSoA : public DQMEDAnalyzer {
-public:
- using HitSoA = TrackingRecHitSoAView;
- using HitsOnHost = TrackingRecHitSoAHost;
-
- explicit SiPixelCompareRecHitsSoA(const edm::ParameterSet&);
- ~SiPixelCompareRecHitsSoA() override = default;
- void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
- void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override;
- void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
- static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
-
-private:
- const edm::ESGetToken geomToken_;
- const edm::ESGetToken topoToken_;
- const edm::EDGetTokenT tokenSoAHitsCPU_; //these two are both on CPU but originally they have been
- const edm::EDGetTokenT tokenSoAHitsGPU_; //produced on CPU or on GPU
- const std::string topFolderName_;
- const float mind2cut_;
- static constexpr uint32_t invalidHit_ = std::numeric_limits::max();
- static constexpr float micron_ = 10000.;
- const TrackerGeometry* tkGeom_ = nullptr;
- const TrackerTopology* tTopo_ = nullptr;
- MonitorElement* hnHits_;
- MonitorElement* hBchargeL_[4]; // max 4 barrel hits
- MonitorElement* hBsizexL_[4];
- MonitorElement* hBsizeyL_[4];
- MonitorElement* hBposxL_[4];
- MonitorElement* hBposyL_[4];
- MonitorElement* hFchargeD_[2][12]; // max 12 endcap disks
- MonitorElement* hFsizexD_[2][12];
- MonitorElement* hFsizeyD_[2][12];
- MonitorElement* hFposxD_[2][12];
- MonitorElement* hFposyD_[2][12];
- //differences
- MonitorElement* hBchargeDiff_;
- MonitorElement* hFchargeDiff_;
- MonitorElement* hBsizeXDiff_;
- MonitorElement* hFsizeXDiff_;
- MonitorElement* hBsizeYDiff_;
- MonitorElement* hFsizeYDiff_;
- MonitorElement* hBposXDiff_;
- MonitorElement* hFposXDiff_;
- MonitorElement* hBposYDiff_;
- MonitorElement* hFposYDiff_;
-};
-//
-// constructors
-//
-
-template
-SiPixelCompareRecHitsSoA::SiPixelCompareRecHitsSoA(const edm::ParameterSet& iConfig)
- : geomToken_(esConsumes()),
- topoToken_(esConsumes()),
- tokenSoAHitsCPU_(consumes(iConfig.getParameter("pixelHitsSrcCPU"))),
- tokenSoAHitsGPU_(consumes(iConfig.getParameter("pixelHitsSrcGPU"))),
- topFolderName_(iConfig.getParameter("topFolderName")),
- mind2cut_(iConfig.getParameter("minD2cut")) {}
-//
-// Begin Run
-//
-template
-void SiPixelCompareRecHitsSoA::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
- tkGeom_ = &iSetup.getData(geomToken_);
- tTopo_ = &iSetup.getData(topoToken_);
-}
-
-//
-// -- Analyze
-//
-template
-void SiPixelCompareRecHitsSoA::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
- const auto& rhsoaHandleCPU = iEvent.getHandle(tokenSoAHitsCPU_);
- const auto& rhsoaHandleGPU = iEvent.getHandle(tokenSoAHitsGPU_);
- if (not rhsoaHandleCPU or not rhsoaHandleGPU) {
- edm::LogWarning out("SiPixelCompareRecHitSoA");
- if (not rhsoaHandleCPU) {
- out << "reference (CPU) rechits not found; ";
- }
- if (not rhsoaHandleGPU) {
- out << "target (GPU) rechits not found; ";
- }
- out << "the comparison will not run.";
- return;
- }
-
- auto const& rhsoaCPU = *rhsoaHandleCPU;
- auto const& rhsoaGPU = *rhsoaHandleGPU;
-
- auto const& soa2dCPU = rhsoaCPU.const_view();
- auto const& soa2dGPU = rhsoaGPU.const_view();
-
- uint32_t nHitsCPU = soa2dCPU.nHits();
- uint32_t nHitsGPU = soa2dGPU.nHits();
-
- hnHits_->Fill(nHitsCPU, nHitsGPU);
- auto detIds = tkGeom_->detUnitIds();
- for (uint32_t i = 0; i < nHitsCPU; i++) {
- float minD = mind2cut_;
- uint32_t matchedHit = invalidHit_;
- uint16_t indCPU = soa2dCPU[i].detectorIndex();
- float xLocalCPU = soa2dCPU[i].xLocal();
- float yLocalCPU = soa2dCPU[i].yLocal();
- for (uint32_t j = 0; j < nHitsGPU; j++) {
- if (soa2dGPU.detectorIndex(j) == indCPU) {
- float dx = xLocalCPU - soa2dGPU[j].xLocal();
- float dy = yLocalCPU - soa2dGPU[j].yLocal();
- float distance = dx * dx + dy * dy;
- if (distance < minD) {
- minD = distance;
- matchedHit = j;
- }
- }
- }
- DetId id = detIds[indCPU];
- uint32_t chargeCPU = soa2dCPU[i].chargeAndStatus().charge;
- int16_t sizeXCPU = std::ceil(float(std::abs(soa2dCPU[i].clusterSizeX()) / 8.));
- int16_t sizeYCPU = std::ceil(float(std::abs(soa2dCPU[i].clusterSizeY()) / 8.));
- uint32_t chargeGPU = 0;
- int16_t sizeXGPU = -99;
- int16_t sizeYGPU = -99;
- float xLocalGPU = -999.;
- float yLocalGPU = -999.;
- if (matchedHit != invalidHit_) {
- chargeGPU = soa2dGPU[matchedHit].chargeAndStatus().charge;
- sizeXGPU = std::ceil(float(std::abs(soa2dGPU[matchedHit].clusterSizeX()) / 8.));
- sizeYGPU = std::ceil(float(std::abs(soa2dGPU[matchedHit].clusterSizeY()) / 8.));
- xLocalGPU = soa2dGPU[matchedHit].xLocal();
- yLocalGPU = soa2dGPU[matchedHit].yLocal();
- }
- switch (id.subdetId()) {
- case PixelSubdetector::PixelBarrel:
- hBchargeL_[tTopo_->pxbLayer(id) - 1]->Fill(chargeCPU, chargeGPU);
- hBsizexL_[tTopo_->pxbLayer(id) - 1]->Fill(sizeXCPU, sizeXGPU);
- hBsizeyL_[tTopo_->pxbLayer(id) - 1]->Fill(sizeYCPU, sizeYGPU);
- hBposxL_[tTopo_->pxbLayer(id) - 1]->Fill(xLocalCPU, xLocalGPU);
- hBposyL_[tTopo_->pxbLayer(id) - 1]->Fill(yLocalCPU, yLocalGPU);
- hBchargeDiff_->Fill(chargeCPU - chargeGPU);
- hBsizeXDiff_->Fill(sizeXCPU - sizeXGPU);
- hBsizeYDiff_->Fill(sizeYCPU - sizeYGPU);
- hBposXDiff_->Fill(micron_ * (xLocalCPU - xLocalGPU));
- hBposYDiff_->Fill(micron_ * (yLocalCPU - yLocalGPU));
- break;
- case PixelSubdetector::PixelEndcap:
- hFchargeD_[tTopo_->pxfSide(id) - 1][tTopo_->pxfDisk(id) - 1]->Fill(chargeCPU, chargeGPU);
- hFsizexD_[tTopo_->pxfSide(id) - 1][tTopo_->pxfDisk(id) - 1]->Fill(sizeXCPU, sizeXGPU);
- hFsizeyD_[tTopo_->pxfSide(id) - 1][tTopo_->pxfDisk(id) - 1]->Fill(sizeYCPU, sizeYGPU);
- hFposxD_[tTopo_->pxfSide(id) - 1][tTopo_->pxfDisk(id) - 1]->Fill(xLocalCPU, xLocalGPU);
- hFposyD_[tTopo_->pxfSide(id) - 1][tTopo_->pxfDisk(id) - 1]->Fill(yLocalCPU, yLocalGPU);
- hFchargeDiff_->Fill(chargeCPU - chargeGPU);
- hFsizeXDiff_->Fill(sizeXCPU - sizeXGPU);
- hFsizeYDiff_->Fill(sizeYCPU - sizeYGPU);
- hFposXDiff_->Fill(micron_ * (xLocalCPU - xLocalGPU));
- hFposYDiff_->Fill(micron_ * (yLocalCPU - yLocalGPU));
- break;
- }
- }
-}
-
-//
-// -- Book Histograms
-//
-template
-void SiPixelCompareRecHitsSoA::bookHistograms(DQMStore::IBooker& iBook,
- edm::Run const& iRun,
- edm::EventSetup const& iSetup) {
- iBook.cd();
- iBook.setCurrentFolder(topFolderName_);
-
- // clang-format off
- //Global
- hnHits_ = iBook.book2I("nHits", "CPUvsGPU RecHits per event;#CPU RecHits;#GPU RecHits", 200, 0, 5000,200, 0, 5000);
- //Barrel Layer
- for(unsigned int il=0;ilnumberOfLayers(PixelSubdetector::PixelBarrel);il++){
- hBchargeL_[il] = iBook.book2I(Form("recHitsBLay%dCharge",il+1), Form("CPUvsGPU RecHits Charge Barrel Layer%d;CPU Charge;GPU Charge",il+1), 250, 0, 100000, 250, 0, 100000);
- hBsizexL_[il] = iBook.book2I(Form("recHitsBLay%dSizex",il+1), Form("CPUvsGPU RecHits SizeX Barrel Layer%d;CPU SizeX;GPU SizeX",il+1), 30, 0, 30, 30, 0, 30);
- hBsizeyL_[il] = iBook.book2I(Form("recHitsBLay%dSizey",il+1), Form("CPUvsGPU RecHits SizeY Barrel Layer%d;CPU SizeY;GPU SizeY",il+1), 30, 0, 30, 30, 0, 30);
- hBposxL_[il] = iBook.book2D(Form("recHitsBLay%dPosx",il+1), Form("CPUvsGPU RecHits x-pos in Barrel Layer%d;CPU pos x;GPU pos x",il+1), 200, -5, 5, 200,-5,5);
- hBposyL_[il] = iBook.book2D(Form("recHitsBLay%dPosy",il+1), Form("CPUvsGPU RecHits y-pos in Barrel Layer%d;CPU pos y;GPU pos y",il+1), 200, -5, 5, 200,-5,5);
- }
- //Endcaps
- //Endcaps Disk
- for(int is=0;is<2;is++){
- int sign=is==0? -1:1;
- for(unsigned int id=0;idnumberOfLayers(PixelSubdetector::PixelEndcap);id++){
- hFchargeD_[is][id] = iBook.book2I(Form("recHitsFDisk%+dCharge",id*sign+sign), Form("CPUvsGPU RecHits Charge Endcaps Disk%+d;CPU Charge;GPU Charge",id*sign+sign), 250, 0, 100000, 250, 0, 100000);
- hFsizexD_[is][id] = iBook.book2I(Form("recHitsFDisk%+dSizex",id*sign+sign), Form("CPUvsGPU RecHits SizeX Endcaps Disk%+d;CPU SizeX;GPU SizeX",id*sign+sign), 30, 0, 30, 30, 0, 30);
- hFsizeyD_[is][id] = iBook.book2I(Form("recHitsFDisk%+dSizey",id*sign+sign), Form("CPUvsGPU RecHits SizeY Endcaps Disk%+d;CPU SizeY;GPU SizeY",id*sign+sign), 30, 0, 30, 30, 0, 30);
- hFposxD_[is][id] = iBook.book2D(Form("recHitsFDisk%+dPosx",id*sign+sign), Form("CPUvsGPU RecHits x-pos Endcaps Disk%+d;CPU pos x;GPU pos x",id*sign+sign), 200, -5, 5, 200, -5, 5);
- hFposyD_[is][id] = iBook.book2D(Form("recHitsFDisk%+dPosy",id*sign+sign), Form("CPUvsGPU RecHits y-pos Endcaps Disk%+d;CPU pos y;GPU pos y",id*sign+sign), 200, -5, 5, 200, -5, 5);
- }
- }
- //1D differences
- hBchargeDiff_ = iBook.book1D("rechitChargeDiffBpix","Charge differnce of rechits in BPix; rechit charge difference (CPU - GPU)", 101, -50.5, 50.5);
- hFchargeDiff_ = iBook.book1D("rechitChargeDiffFpix","Charge differnce of rechits in FPix; rechit charge difference (CPU - GPU)", 101, -50.5, 50.5);
- hBsizeXDiff_ = iBook.book1D("rechitsizeXDiffBpix","SizeX difference of rechits in BPix; rechit sizex difference (CPU - GPU)", 21, -10.5, 10.5);
- hFsizeXDiff_ = iBook.book1D("rechitsizeXDiffFpix","SizeX difference of rechits in FPix; rechit sizex difference (CPU - GPU)", 21, -10.5, 10.5);
- hBsizeYDiff_ = iBook.book1D("rechitsizeYDiffBpix","SizeY difference of rechits in BPix; rechit sizey difference (CPU - GPU)", 21, -10.5, 10.5);
- hFsizeYDiff_ = iBook.book1D("rechitsizeYDiffFpix","SizeY difference of rechits in FPix; rechit sizey difference (CPU - GPU)", 21, -10.5, 10.5);
- hBposXDiff_ = iBook.book1D("rechitsposXDiffBpix","x-position difference of rechits in BPix; rechit x-pos difference (CPU - GPU)", 1000, -10, 10);
- hFposXDiff_ = iBook.book1D("rechitsposXDiffFpix","x-position difference of rechits in FPix; rechit x-pos difference (CPU - GPU)", 1000, -10, 10);
- hBposYDiff_ = iBook.book1D("rechitsposYDiffBpix","y-position difference of rechits in BPix; rechit y-pos difference (CPU - GPU)", 1000, -10, 10);
- hFposYDiff_ = iBook.book1D("rechitsposYDiffFpix","y-position difference of rechits in FPix; rechit y-pos difference (CPU - GPU)", 1000, -10, 10);
-}
-
-template
-void SiPixelCompareRecHitsSoA::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
- // monitorpixelRecHitsSoA
- edm::ParameterSetDescription desc;
- desc.add