From ad97afe0d48cc4fb54ccc6cd77c2637af915f364 Mon Sep 17 00:00:00 2001 From: Angela Czirkos Date: Mon, 22 Mar 2021 10:57:04 +0100 Subject: [PATCH] Use phase1PixelTopology::numberOfLayers where appropriate --- .../TrackerGeometryBuilder/test/phase1PixelTopology_t.cpp | 4 ++-- .../SiPixelRecHits/plugins/SiPixelRecHitSoAFromLegacy.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Geometry/TrackerGeometryBuilder/test/phase1PixelTopology_t.cpp b/Geometry/TrackerGeometryBuilder/test/phase1PixelTopology_t.cpp index 8dfae57b685b4..2dda8ed41500b 100644 --- a/Geometry/TrackerGeometryBuilder/test/phase1PixelTopology_t.cpp +++ b/Geometry/TrackerGeometryBuilder/test/phase1PixelTopology_t.cpp @@ -149,9 +149,9 @@ int main() { } for (auto i = 0U; i < phase1PixelTopology::numberOfModules; ++i) { - int layer = phase1PixelTopology::layer[i / phase1PixelTopology::maxModuleStride]; + auto layer = static_cast(phase1PixelTopology::layer[i / phase1PixelTopology::maxModuleStride]); //std::cout << "module " << i << ": " << "layer " << layer << ", \"" << phase1PixelTopology::layerName[layer] << "\", [" << phase1PixelTopology::layerStart[layer] << ", " << phase1PixelTopology::layerStart[layer+1] << ")" << std::endl; - assert(layer < 10); + assert(layer < phase1PixelTopology::numberOfLayers); assert(i >= phase1PixelTopology::layerStart[layer]); assert(i < phase1PixelTopology::layerStart[layer + 1]); } diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitSoAFromLegacy.cc b/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitSoAFromLegacy.cc index 0d95370f25e47..d94d123ea316a 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitSoAFromLegacy.cc +++ b/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitSoAFromLegacy.cc @@ -236,11 +236,11 @@ void SiPixelRecHitSoAFromLegacy::produce(edm::StreamID streamID, edm::Event& iEv assert(numberOfHits == numberOfClusters); // fill data structure to support CA - for (auto i = 0; i < 11; ++i) { + for (auto i = 0U; i < phase1PixelTopology::numberOfLayers + 1; ++i) { output->hitsLayerStart()[i] = hitsModuleStart[cpeView.layerGeometry().layerStart[i]]; } cms::cuda::fillManyFromVector( - output->phiBinner(), 10, output->iphi(), output->hitsLayerStart(), numberOfHits, 256, nullptr); + output->phiBinner(), phase1PixelTopology::numberOfLayers, output->iphi(), output->hitsLayerStart(), numberOfHits, 256, nullptr); LogDebug("SiPixelRecHitSoAFromLegacy") << "created HitSoa for " << numberOfClusters << " clusters in " << numberOfDetUnits << " Dets";