From 1e4bc663e076b365683c867765782962d78360ed Mon Sep 17 00:00:00 2001 From: Angela Czirkos Date: Thu, 15 Jul 2021 16:19:53 +0200 Subject: [PATCH] add check --- .../SiPixelRecHits/plugins/SiPixelRecHitFromCUDA.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromCUDA.cc b/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromCUDA.cc index 790b0da51ecfb..0bad87176ef7a 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromCUDA.cc +++ b/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromCUDA.cc @@ -85,7 +85,8 @@ void SiPixelRecHitFromCUDA::acquire(edm::Event const& iEvent, void SiPixelRecHitFromCUDA::produce(edm::Event& iEvent, edm::EventSetup const& es) { // allocate a buffer for the indices of the clusters auto hmsp = std::make_unique(gpuClustering::maxNumModules + 1); - std::copy(hitsModuleStart_.get(), hitsModuleStart_.get() + gpuClustering::maxNumModules + 1, hmsp.get()); + if (hitsModuleStart_) + std::copy(hitsModuleStart_.get(), hitsModuleStart_.get() + gpuClustering::maxNumModules + 1, hmsp.get()); // wrap the buffer in a HostProduct, and move it to the Event, without reallocating the buffer or affecting hitsModuleStart iEvent.emplace(hostPutToken_, std::move(hmsp));