diff --git a/RecoTracker/LSTCore/interface/EndcapGeometry.h b/RecoTracker/LSTCore/interface/EndcapGeometry.h index 12233e0b40cde..555955d83941c 100644 --- a/RecoTracker/LSTCore/interface/EndcapGeometry.h +++ b/RecoTracker/LSTCore/interface/EndcapGeometry.h @@ -27,7 +27,7 @@ namespace lst { void load(std::string const&); void fillGeoMapArraysExplicit(); - float getdxdy_slope(const unsigned int detid) const; + float getdxdy_slope(unsigned int detid) const; }; } // namespace lst diff --git a/RecoTracker/LSTCore/interface/EndcapGeometryBuffer.h b/RecoTracker/LSTCore/interface/EndcapGeometryBuffer.h index 54a78707c4aa9..6a787a5ed95eb 100644 --- a/RecoTracker/LSTCore/interface/EndcapGeometryBuffer.h +++ b/RecoTracker/LSTCore/interface/EndcapGeometryBuffer.h @@ -30,7 +30,7 @@ namespace lst { Buf geoMapPhi_buf; EndcapGeometryDev data_; - EndcapGeometryBuffer(TDev const& dev, const unsigned int nEndCapMap) + EndcapGeometryBuffer(TDev const& dev, unsigned int nEndCapMap) : geoMapDetId_buf(allocBufWrapper(dev, nEndCapMap)), geoMapPhi_buf(allocBufWrapper(dev, nEndCapMap)) { data_.setData(*this); @@ -43,7 +43,7 @@ namespace lst { } template - EndcapGeometryBuffer(TQueue queue, EndcapGeometryBuffer const& src, const unsigned int nEndCapMap) + EndcapGeometryBuffer(TQueue queue, EndcapGeometryBuffer const& src, unsigned int nEndCapMap) : EndcapGeometryBuffer(alpaka::getDev(queue), nEndCapMap) { copyFromSrc(queue, src); } diff --git a/RecoTracker/LSTCore/interface/LST.h b/RecoTracker/LSTCore/interface/LST.h index 04dfc694eb80d..ac23bd09a7ecf 100644 --- a/RecoTracker/LSTCore/interface/LST.h +++ b/RecoTracker/LSTCore/interface/LST.h @@ -22,7 +22,7 @@ namespace lst { template void run(TQueue& queue, - const bool verbose, + bool verbose, LSTESData> const* deviceESData, std::vector const& see_px, std::vector const& see_py, @@ -43,12 +43,12 @@ namespace lst { std::vector const& ph2_x, std::vector const& ph2_y, std::vector const& ph2_z, - const bool no_pls_dupclean, - const bool tc_pls_triplets); - const std::vector>& hits() const { return out_tc_hitIdxs_; } - const std::vector& len() const { return out_tc_len_; } - const std::vector& seedIdx() const { return out_tc_seedIdx_; } - const std::vector& trackCandidateType() const { return out_tc_trackCandidateType_; } + bool no_pls_dupclean, + bool tc_pls_triplets); + std::vector> const& hits() const { return out_tc_hitIdxs_; } + std::vector const& len() const { return out_tc_len_; } + std::vector const& seedIdx() const { return out_tc_seedIdx_; } + std::vector const& trackCandidateType() const { return out_tc_trackCandidateType_; } private: void prepareInput(std::vector const& see_px, @@ -72,8 +72,8 @@ namespace lst { std::vector const& ph2_z); void getOutput(lst::Event& event); - std::vector getHitIdxs(const short trackCandidateType, - const unsigned int TCIdx, + std::vector getHitIdxs(short trackCandidateType, + unsigned int TCIdx, unsigned int const* TCHitIndices, unsigned int const* hitIndices); diff --git a/RecoTracker/LSTCore/interface/Module.h b/RecoTracker/LSTCore/interface/Module.h index f9210e6578202..56c560eaba04c 100644 --- a/RecoTracker/LSTCore/interface/Module.h +++ b/RecoTracker/LSTCore/interface/Module.h @@ -40,7 +40,7 @@ namespace lst { const int* sdlLayers; const unsigned int* connectedPixels; - static bool parseIsInverted(const short subdet, const short side, const short module, const short layer) { + static bool parseIsInverted(short subdet, short side, short module, short layer) { if (subdet == Endcap) { if (side == NegZ) { return module % 2 == 1; @@ -74,11 +74,11 @@ namespace lst { } }; - static bool parseIsLower(const bool isInvertedx, const unsigned int detId) { + static bool parseIsLower(bool isInvertedx, unsigned int detId) { return (isInvertedx) ? !(detId & 1) : (detId & 1); }; - static unsigned int parsePartnerModuleId(const unsigned int detId, const bool isLowerx, const bool isInvertedx) { + static unsigned int parsePartnerModuleId(unsigned int detId, bool isLowerx, bool isInvertedx) { return isLowerx ? (isInvertedx ? detId - 1 : detId + 1) : (isInvertedx ? detId + 1 : detId - 1); }; @@ -144,7 +144,7 @@ namespace lst { Modules data_; - ModulesBuffer(TDev const& dev, const unsigned int nMod, const unsigned int nPixs) + ModulesBuffer(TDev const& dev, unsigned int nMod, unsigned int nPixs) : detIds_buf(allocBufWrapper(dev, nMod)), moduleMap_buf(allocBufWrapper(dev, nMod * max_connected_modules)), mapdetId_buf(allocBufWrapper(dev, nMod)), @@ -175,7 +175,7 @@ namespace lst { } template - inline void copyFromSrc(TQueue queue, ModulesBuffer const& src, const bool isFull = true) { + inline void copyFromSrc(TQueue queue, ModulesBuffer const& src, bool isFull = true) { alpaka::memcpy(queue, detIds_buf, src.detIds_buf); if (isFull) { alpaka::memcpy(queue, moduleMap_buf, src.moduleMap_buf); @@ -216,7 +216,7 @@ namespace lst { } template - ModulesBuffer(TQueue queue, ModulesBuffer const& src, const unsigned int nMod, const unsigned int nPixs) + ModulesBuffer(TQueue queue, ModulesBuffer const& src, unsigned int nMod, unsigned int nPixs) : ModulesBuffer(alpaka::getDev(queue), nMod, nPixs) { copyFromSrc(queue, src); } diff --git a/RecoTracker/LSTCore/interface/ModuleConnectionMap.h b/RecoTracker/LSTCore/interface/ModuleConnectionMap.h index b1482fd31cc12..b3a931345b3a5 100644 --- a/RecoTracker/LSTCore/interface/ModuleConnectionMap.h +++ b/RecoTracker/LSTCore/interface/ModuleConnectionMap.h @@ -22,7 +22,7 @@ namespace lst { void add(std::string const&); void print(); - const std::vector& getConnectedModuleDetIds(const unsigned int detid) const; + const std::vector& getConnectedModuleDetIds(unsigned int detid) const; int size() const; }; diff --git a/RecoTracker/LSTCore/interface/PixelMap.h b/RecoTracker/LSTCore/interface/PixelMap.h index 7edbca0943fe8..73d88bc64f7ec 100644 --- a/RecoTracker/LSTCore/interface/PixelMap.h +++ b/RecoTracker/LSTCore/interface/PixelMap.h @@ -19,7 +19,7 @@ namespace lst { int* pixelType; - PixelMap(const unsigned int sizef = size_superbins) + PixelMap(unsigned int sizef = size_superbins) : pixelModuleIndex(0), connectedPixelsIndex(sizef), connectedPixelsSizes(sizef), diff --git a/RecoTracker/LSTCore/interface/TiltedGeometry.h b/RecoTracker/LSTCore/interface/TiltedGeometry.h index 37012f6465597..b70a1d95a357b 100644 --- a/RecoTracker/LSTCore/interface/TiltedGeometry.h +++ b/RecoTracker/LSTCore/interface/TiltedGeometry.h @@ -22,8 +22,8 @@ namespace lst { void load(std::string const&); - float getDrDz(const unsigned int detid) const; - float getDxDy(const unsigned int detid) const; + float getDrDz(unsigned int detid) const; + float getDxDy(unsigned int detid) const; }; } // namespace lst diff --git a/RecoTracker/LSTCore/src/EndcapGeometry.cc b/RecoTracker/LSTCore/src/EndcapGeometry.cc index 028be82183837..a95e8c34de248 100644 --- a/RecoTracker/LSTCore/src/EndcapGeometry.cc +++ b/RecoTracker/LSTCore/src/EndcapGeometry.cc @@ -48,7 +48,7 @@ void lst::EndcapGeometry::fillGeoMapArraysExplicit() { } } -float lst::EndcapGeometry::getdxdy_slope(const unsigned int detid) const { +float lst::EndcapGeometry::getdxdy_slope(unsigned int detid) const { if (dxdy_slope_.find(detid) != dxdy_slope_.end()) { return dxdy_slope_.at(detid); } else { diff --git a/RecoTracker/LSTCore/src/ModuleConnectionMap.cc b/RecoTracker/LSTCore/src/ModuleConnectionMap.cc index 1f10bed091a27..732b8e155fb4e 100644 --- a/RecoTracker/LSTCore/src/ModuleConnectionMap.cc +++ b/RecoTracker/LSTCore/src/ModuleConnectionMap.cc @@ -93,7 +93,7 @@ void lst::ModuleConnectionMap::print() { } } -const std::vector& lst::ModuleConnectionMap::getConnectedModuleDetIds(const unsigned int detid) const { +const std::vector& lst::ModuleConnectionMap::getConnectedModuleDetIds(unsigned int detid) const { static const std::vector dummy; auto const mList = moduleConnections_.find(detid); return mList != moduleConnections_.end() ? mList->second : dummy; diff --git a/RecoTracker/LSTCore/src/TiltedGeometry.cc b/RecoTracker/LSTCore/src/TiltedGeometry.cc index f537cb93222b1..96db807240f69 100644 --- a/RecoTracker/LSTCore/src/TiltedGeometry.cc +++ b/RecoTracker/LSTCore/src/TiltedGeometry.cc @@ -32,7 +32,7 @@ void lst::TiltedGeometry::load(std::string const& filename) { } } -float lst::TiltedGeometry::getDrDz(const unsigned int detid) const { +float lst::TiltedGeometry::getDrDz(unsigned int detid) const { if (drdzs_.find(detid) != drdzs_.end()) { return drdzs_.at(detid); } else { @@ -40,7 +40,7 @@ float lst::TiltedGeometry::getDrDz(const unsigned int detid) const { } } -float lst::TiltedGeometry::getDxDy(const unsigned int detid) const { +float lst::TiltedGeometry::getDxDy(unsigned int detid) const { if (dxdys_.find(detid) != dxdys_.end()) { return dxdys_.at(detid); } else { diff --git a/RecoTracker/LSTCore/src/alpaka/Event.dev.cc b/RecoTracker/LSTCore/src/alpaka/Event.dev.cc index 38a1a5586751f..20a8a35dc00bf 100644 --- a/RecoTracker/LSTCore/src/alpaka/Event.dev.cc +++ b/RecoTracker/LSTCore/src/alpaka/Event.dev.cc @@ -2,7 +2,7 @@ using namespace ALPAKA_ACCELERATOR_NAMESPACE; -void lst::Event::init(const bool verbose) { +void lst::Event::init(bool verbose) { addObjects = verbose; hitsInGPU = nullptr; mdsInGPU = nullptr; @@ -622,7 +622,7 @@ void lst::Event::createTriplets() { } } -void lst::Event::createTrackCandidates(const bool no_pls_dupclean, const bool tc_pls_triplets) { +void lst::Event::createTrackCandidates(bool no_pls_dupclean, bool tc_pls_triplets) { if (trackCandidatesInGPU == nullptr) { trackCandidatesInGPU = new lst::TrackCandidates(); trackCandidatesBuffers = new lst::TrackCandidatesBuffer( @@ -1278,18 +1278,18 @@ unsigned int lst::Event::getNumberOfHits() { return hits; } -unsigned int lst::Event::getNumberOfHitsByLayer(const unsigned int layer) { +unsigned int lst::Event::getNumberOfHitsByLayer(unsigned int layer) { if (layer == 6) return n_hits_by_layer_barrel_[layer]; else return n_hits_by_layer_barrel_[layer] + n_hits_by_layer_endcap_[layer]; } -unsigned int lst::Event::getNumberOfHitsByLayerBarrel(const unsigned int layer) { +unsigned int lst::Event::getNumberOfHitsByLayerBarrel(unsigned int layer) { return n_hits_by_layer_barrel_[layer]; } -unsigned int lst::Event::getNumberOfHitsByLayerEndcap(const unsigned int layer) { +unsigned int lst::Event::getNumberOfHitsByLayerEndcap(unsigned int layer) { return n_hits_by_layer_endcap_[layer]; } @@ -1305,18 +1305,18 @@ unsigned int lst::Event::getNumberOfMiniDoublets() { return miniDoublets; } -unsigned int lst::Event::getNumberOfMiniDoubletsByLayer(const unsigned int layer) { +unsigned int lst::Event::getNumberOfMiniDoubletsByLayer(unsigned int layer) { if (layer == 6) return n_minidoublets_by_layer_barrel_[layer]; else return n_minidoublets_by_layer_barrel_[layer] + n_minidoublets_by_layer_endcap_[layer]; } -unsigned int lst::Event::getNumberOfMiniDoubletsByLayerBarrel(const unsigned int layer) { +unsigned int lst::Event::getNumberOfMiniDoubletsByLayerBarrel(unsigned int layer) { return n_minidoublets_by_layer_barrel_[layer]; } -unsigned int lst::Event::getNumberOfMiniDoubletsByLayerEndcap(const unsigned int layer) { +unsigned int lst::Event::getNumberOfMiniDoubletsByLayerEndcap(unsigned int layer) { return n_minidoublets_by_layer_endcap_[layer]; } @@ -1332,18 +1332,18 @@ unsigned int lst::Event::getNumberOfSegments() { return segments; } -unsigned int lst::Event::getNumberOfSegmentsByLayer(const unsigned int layer) { +unsigned int lst::Event::getNumberOfSegmentsByLayer(unsigned int layer) { if (layer == 6) return n_segments_by_layer_barrel_[layer]; else return n_segments_by_layer_barrel_[layer] + n_segments_by_layer_endcap_[layer]; } -unsigned int lst::Event::getNumberOfSegmentsByLayerBarrel(const unsigned int layer) { +unsigned int lst::Event::getNumberOfSegmentsByLayerBarrel(unsigned int layer) { return n_segments_by_layer_barrel_[layer]; } -unsigned int lst::Event::getNumberOfSegmentsByLayerEndcap(const unsigned int layer) { +unsigned int lst::Event::getNumberOfSegmentsByLayerEndcap(unsigned int layer) { return n_segments_by_layer_endcap_[layer]; } @@ -1359,18 +1359,18 @@ unsigned int lst::Event::getNumberOfTriplets() { return triplets; } -unsigned int lst::Event::getNumberOfTripletsByLayer(const unsigned int layer) { +unsigned int lst::Event::getNumberOfTripletsByLayer(unsigned int layer) { if (layer == 6) return n_triplets_by_layer_barrel_[layer]; else return n_triplets_by_layer_barrel_[layer] + n_triplets_by_layer_endcap_[layer]; } -unsigned int lst::Event::getNumberOfTripletsByLayerBarrel(const unsigned int layer) { +unsigned int lst::Event::getNumberOfTripletsByLayerBarrel(unsigned int layer) { return n_triplets_by_layer_barrel_[layer]; } -unsigned int lst::Event::getNumberOfTripletsByLayerEndcap(const unsigned int layer) { +unsigned int lst::Event::getNumberOfTripletsByLayerEndcap(unsigned int layer) { return n_triplets_by_layer_endcap_[layer]; } @@ -1408,18 +1408,18 @@ unsigned int lst::Event::getNumberOfQuintuplets() { return quintuplets; } -unsigned int lst::Event::getNumberOfQuintupletsByLayer(const unsigned int layer) { +unsigned int lst::Event::getNumberOfQuintupletsByLayer(unsigned int layer) { if (layer == 6) return n_quintuplets_by_layer_barrel_[layer]; else return n_quintuplets_by_layer_barrel_[layer] + n_quintuplets_by_layer_endcap_[layer]; } -unsigned int lst::Event::getNumberOfQuintupletsByLayerBarrel(const unsigned int layer) { +unsigned int lst::Event::getNumberOfQuintupletsByLayerBarrel(unsigned int layer) { return n_quintuplets_by_layer_barrel_[layer]; } -unsigned int lst::Event::getNumberOfQuintupletsByLayerEndcap(const unsigned int layer) { +unsigned int lst::Event::getNumberOfQuintupletsByLayerEndcap(unsigned int layer) { return n_quintuplets_by_layer_endcap_[layer]; } @@ -1818,7 +1818,7 @@ lst::TrackCandidatesBuffer* lst::Event::getTrackCandidatesInCMSS return trackCandidatesInCPU; } -lst::ModulesBuffer* lst::Event::getModules(const bool isFull) { +lst::ModulesBuffer* lst::Event::getModules(bool isFull) { if (modulesInCPU == nullptr) { // The last input here is just a small placeholder for the allocation. modulesInCPU = new lst::ModulesBuffer(devHost, nModules_, nPixels_); diff --git a/RecoTracker/LSTCore/src/alpaka/Event.h b/RecoTracker/LSTCore/src/alpaka/Event.h index e978a5ac5ecec..16002cfd5abd2 100644 --- a/RecoTracker/LSTCore/src/alpaka/Event.h +++ b/RecoTracker/LSTCore/src/alpaka/Event.h @@ -145,32 +145,32 @@ namespace lst { void createTriplets(); void createPixelTracklets(); void createPixelTrackletsWithMap(); - void createTrackCandidates(const bool no_pls_dupclean, const bool tc_pls_triplets); + void createTrackCandidates(bool no_pls_dupclean, bool tc_pls_triplets); void createExtendedTracks(); void createQuintuplets(); void createPixelTriplets(); void createPixelQuintuplets(); - void pixelLineSegmentCleaning(const bool no_pls_dupclean); + void pixelLineSegmentCleaning(bool no_pls_dupclean); unsigned int getNumberOfHits(); - unsigned int getNumberOfHitsByLayer(const unsigned int layer); - unsigned int getNumberOfHitsByLayerBarrel(const unsigned int layer); - unsigned int getNumberOfHitsByLayerEndcap(const unsigned int layer); + unsigned int getNumberOfHitsByLayer(unsigned int layer); + unsigned int getNumberOfHitsByLayerBarrel(unsigned int layer); + unsigned int getNumberOfHitsByLayerEndcap(unsigned int layer); unsigned int getNumberOfMiniDoublets(); - unsigned int getNumberOfMiniDoubletsByLayer(const unsigned int layer); - unsigned int getNumberOfMiniDoubletsByLayerBarrel(const unsigned int layer); - unsigned int getNumberOfMiniDoubletsByLayerEndcap(const unsigned int layer); + unsigned int getNumberOfMiniDoubletsByLayer(unsigned int layer); + unsigned int getNumberOfMiniDoubletsByLayerBarrel(unsigned int layer); + unsigned int getNumberOfMiniDoubletsByLayerEndcap(unsigned int layer); unsigned int getNumberOfSegments(); - unsigned int getNumberOfSegmentsByLayer(const unsigned int layer); - unsigned int getNumberOfSegmentsByLayerBarrel(const unsigned int layer); - unsigned int getNumberOfSegmentsByLayerEndcap(const unsigned int layer); + unsigned int getNumberOfSegmentsByLayer(unsigned int layer); + unsigned int getNumberOfSegmentsByLayerBarrel(unsigned int layer); + unsigned int getNumberOfSegmentsByLayerEndcap(unsigned int layer); unsigned int getNumberOfTriplets(); - unsigned int getNumberOfTripletsByLayer(const unsigned int layer); - unsigned int getNumberOfTripletsByLayerBarrel(const unsigned int layer); - unsigned int getNumberOfTripletsByLayerEndcap(const unsigned int layer); + unsigned int getNumberOfTripletsByLayer(unsigned int layer); + unsigned int getNumberOfTripletsByLayerBarrel(unsigned int layer); + unsigned int getNumberOfTripletsByLayerEndcap(unsigned int layer); int getNumberOfTrackCandidates(); int getNumberOfPixelTrackCandidates(); @@ -180,9 +180,9 @@ namespace lst { int getNumberOfPLSTrackCandidates(); unsigned int getNumberOfQuintuplets(); - unsigned int getNumberOfQuintupletsByLayer(const unsigned int layer); - unsigned int getNumberOfQuintupletsByLayerBarrel(const unsigned int layer); - unsigned int getNumberOfQuintupletsByLayerEndcap(const unsigned int layer); + unsigned int getNumberOfQuintupletsByLayer(unsigned int layer); + unsigned int getNumberOfQuintupletsByLayerBarrel(unsigned int layer); + unsigned int getNumberOfQuintupletsByLayerEndcap(unsigned int layer); int getNumberOfPixelTriplets(); int getNumberOfPixelQuintuplets(); @@ -198,7 +198,7 @@ namespace lst { TrackCandidatesBuffer* getTrackCandidatesInCMSSW(); PixelTripletsBuffer* getPixelTriplets(); PixelQuintupletsBuffer* getPixelQuintuplets(); - ModulesBuffer* getModules(const bool isFull = false); + ModulesBuffer* getModules(bool isFull = false); }; } // namespace lst diff --git a/RecoTracker/LSTCore/src/alpaka/Hit.h b/RecoTracker/LSTCore/src/alpaka/Hit.h index 5acb255e03957..3557750b11e2d 100644 --- a/RecoTracker/LSTCore/src/alpaka/Hit.h +++ b/RecoTracker/LSTCore/src/alpaka/Hit.h @@ -75,7 +75,7 @@ namespace lst { Hits data_; template - HitsBuffer(const unsigned int nModules, const unsigned int nMaxHits, TDevAcc const& devAccIn, TQueue& queue) + HitsBuffer(unsigned int nModules, unsigned int nMaxHits, TDevAcc const& devAccIn, TQueue& queue) : nHits_buf(allocBufWrapper(devAccIn, 1u, queue)), xs_buf(allocBufWrapper(devAccIn, nMaxHits, queue)), ys_buf(allocBufWrapper(devAccIn, nMaxHits, queue)), @@ -182,7 +182,7 @@ namespace lst { ALPAKA_FN_ACC void operator()(TAcc const& acc, struct lst::Modules modulesInGPU, struct lst::Hits hitsInGPU, - const int nLowerModules) const { + int nLowerModules) const { auto const globalThreadIdx = alpaka::getIdx(acc); auto const gridThreadExtent = alpaka::getWorkDiv(acc); @@ -203,15 +203,15 @@ namespace lst { struct hitLoopKernel { template ALPAKA_FN_ACC void operator()(TAcc const& acc, - const uint16_t Endcap, // Integer corresponding to endcap in module subdets - const uint16_t TwoS, // Integer corresponding to TwoS in moduleType - const unsigned int nModules, // Number of modules - const unsigned int nEndCapMap, // Number of elements in endcap map + uint16_t Endcap, // Integer corresponding to endcap in module subdets + uint16_t TwoS, // Integer corresponding to TwoS in moduleType + unsigned int nModules, // Number of modules + unsigned int nEndCapMap, // Number of elements in endcap map const unsigned int* geoMapDetId, // DetId's from endcap map const float* geoMapPhi, // Phi values from endcap map struct lst::Modules modulesInGPU, struct lst::Hits hitsInGPU, - const unsigned int nHits) const // Total number of hits in event + unsigned int nHits) const // Total number of hits in event { auto const globalThreadIdx = alpaka::getIdx(acc); auto const gridThreadExtent = alpaka::getWorkDiv(acc); diff --git a/RecoTracker/LSTCore/src/alpaka/Kernels.h b/RecoTracker/LSTCore/src/alpaka/Kernels.h index c2ee2570398f6..b95d4ce24055f 100644 --- a/RecoTracker/LSTCore/src/alpaka/Kernels.h +++ b/RecoTracker/LSTCore/src/alpaka/Kernels.h @@ -14,29 +14,29 @@ namespace lst { ALPAKA_FN_ACC ALPAKA_FN_INLINE void rmQuintupletFromMemory(struct lst::Quintuplets& quintupletsInGPU, - const unsigned int quintupletIndex, - const bool secondpass = false) { + unsigned int quintupletIndex, + bool secondpass = false) { quintupletsInGPU.isDup[quintupletIndex] |= 1 + secondpass; }; ALPAKA_FN_ACC ALPAKA_FN_INLINE void rmPixelTripletFromMemory(struct lst::PixelTriplets& pixelTripletsInGPU, - const unsigned int pixelTripletIndex) { + unsigned int pixelTripletIndex) { pixelTripletsInGPU.isDup[pixelTripletIndex] = true; }; ALPAKA_FN_ACC ALPAKA_FN_INLINE void rmPixelQuintupletFromMemory(struct lst::PixelQuintuplets& pixelQuintupletsInGPU, - const unsigned int pixelQuintupletIndex) { + unsigned int pixelQuintupletIndex) { pixelQuintupletsInGPU.isDup[pixelQuintupletIndex] = true; }; ALPAKA_FN_ACC ALPAKA_FN_INLINE void rmPixelSegmentFromMemory(struct lst::Segments& segmentsInGPU, - const unsigned int pixelSegmentArrayIndex, - const bool secondpass = false) { + unsigned int pixelSegmentArrayIndex, + bool secondpass = false) { segmentsInGPU.isDup[pixelSegmentArrayIndex] |= 1 + secondpass; }; - ALPAKA_FN_ACC ALPAKA_FN_INLINE int checkHitsT5(const unsigned int ix, - const unsigned int jx, + ALPAKA_FN_ACC ALPAKA_FN_INLINE int checkHitsT5(unsigned int ix, + unsigned int jx, struct lst::Quintuplets& quintupletsInGPU) { unsigned int hits1[Params_T5::kHits]; unsigned int hits2[Params_T5::kHits]; @@ -62,8 +62,8 @@ namespace lst { return nMatched; }; - ALPAKA_FN_ACC ALPAKA_FN_INLINE int checkHitspT5(const unsigned int ix, - const unsigned int jx, + ALPAKA_FN_ACC ALPAKA_FN_INLINE int checkHitspT5(unsigned int ix, + unsigned int jx, struct lst::PixelQuintuplets& pixelQuintupletsInGPU) { unsigned int hits1[Params_pT5::kHits]; unsigned int hits2[Params_pT5::kHits]; @@ -89,8 +89,8 @@ namespace lst { return nMatched; }; - ALPAKA_FN_ACC ALPAKA_FN_INLINE void checkHitspT3(const unsigned int ix, - const unsigned int jx, + ALPAKA_FN_ACC ALPAKA_FN_INLINE void checkHitspT3(unsigned int ix, + unsigned int jx, struct lst::PixelTriplets& pixelTripletsInGPU, int* matched) { int phits1[Params_pLS::kHits]; @@ -335,7 +335,7 @@ namespace lst { ALPAKA_FN_ACC void operator()(TAcc const& acc, struct lst::Modules modulesInGPU, struct lst::Segments segmentsInGPU, - const bool secondpass) const { + bool secondpass) const { auto const globalThreadIdx = alpaka::getIdx(acc); auto const gridThreadExtent = alpaka::getWorkDiv(acc); diff --git a/RecoTracker/LSTCore/src/alpaka/LST.dev.cc b/RecoTracker/LSTCore/src/alpaka/LST.dev.cc index 64c2a505239a9..940469e8682a2 100644 --- a/RecoTracker/LSTCore/src/alpaka/LST.dev.cc +++ b/RecoTracker/LSTCore/src/alpaka/LST.dev.cc @@ -8,7 +8,7 @@ using namespace ALPAKA_ACCELERATOR_NAMESPACE; using XYZVector = ROOT::Math::XYZVector; namespace { - XYZVector calculateR3FromPCA(const XYZVector& p3, const float dxy, const float dz) { + XYZVector calculateR3FromPCA(const XYZVector& p3, float dxy, float dz) { const float pt = p3.rho(); const float p = p3.r(); const float vz = dz * pt * pt / p / p; @@ -213,8 +213,8 @@ void lst::LST::prepareInput(std::vector const& see_px, } template <> -std::vector lst::LST::getHitIdxs(const short trackCandidateType, - const unsigned int TCIdx, +std::vector lst::LST::getHitIdxs(short trackCandidateType, + unsigned int TCIdx, unsigned int const* TCHitIndices, unsigned int const* hitIndices) { std::vector hits; @@ -279,7 +279,7 @@ void lst::LST::getOutput(lst::Event& event) { template <> template <> void lst::LST::run(Queue& queue, - const bool verbose, + bool verbose, LSTESData const* deviceESData, std::vector const& see_px, std::vector const& see_py, @@ -300,8 +300,8 @@ void lst::LST::run(Queue& queue, std::vector const& ph2_x, std::vector const& ph2_y, std::vector const& ph2_z, - const bool no_pls_dupclean, - const bool tc_pls_triplets) { + bool no_pls_dupclean, + bool tc_pls_triplets) { auto event = lst::Event(verbose, queue, deviceESData); prepareInput(see_px, see_py, diff --git a/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h b/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h index 1e7474db90748..60662aaff6e23 100644 --- a/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h +++ b/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h @@ -140,8 +140,8 @@ namespace lst { MiniDoublets data_; template - MiniDoubletsBuffer(const unsigned int nMemoryLoc, - const uint16_t nLowerModules, + MiniDoubletsBuffer(unsigned int nMemoryLoc, + uint16_t nLowerModules, TDevAcc const& devAccIn, TQueue& queue) : nMemoryLocations_buf(allocBufWrapper(devAccIn, 1, queue)), @@ -194,18 +194,18 @@ namespace lst { struct lst::MiniDoublets& mdsInGPU, struct lst::Hits& hitsInGPU, struct lst::Modules& modulesInGPU, - const unsigned int lowerHitIdx, - const unsigned int upperHitIdx, - const uint16_t& lowerModuleIdx, - const float dz, - const float dPhi, - const float dPhiChange, - const float shiftedX, - const float shiftedY, - const float shiftedZ, - const float noShiftedDphi, - const float noShiftedDPhiChange, - const unsigned int idx) { + unsigned int lowerHitIdx, + unsigned int upperHitIdx, + uint16_t& lowerModuleIdx, + float dz, + float dPhi, + float dPhiChange, + float shiftedX, + float shiftedY, + float shiftedZ, + float noShiftedDphi, + float noShiftedDPhiChange, + unsigned int idx) { //the index into which this MD needs to be written will be computed in the kernel //nMDs variable will be incremented in the kernel, no need to worry about that here @@ -264,7 +264,7 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE float isTighterTiltedModules(struct lst::Modules& modulesInGPU, - const uint16_t moduleIndex) { + uint16_t moduleIndex) { // The "tighter" tilted modules are the subset of tilted modules that have smaller spacing // This is the same as what was previously considered as"isNormalTiltedModules" // See Figure 9.1 of https://cds.cern.ch/record/2272264/files/CMS-TDR-014.pdf @@ -284,7 +284,7 @@ namespace lst { return false; }; - ALPAKA_FN_ACC ALPAKA_FN_INLINE float moduleGapSize(struct lst::Modules& modulesInGPU, const uint16_t moduleIndex) { + ALPAKA_FN_ACC ALPAKA_FN_INLINE float moduleGapSize(struct lst::Modules& modulesInGPU, uint16_t moduleIndex) { float miniDeltaTilted[3] = {0.26f, 0.26f, 0.26f}; float miniDeltaFlat[6] = {0.26f, 0.16f, 0.16f, 0.18f, 0.18f, 0.18f}; float miniDeltaLooseTilted[3] = {0.4f, 0.4f, 0.4f}; @@ -337,11 +337,11 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE float dPhiThreshold(TAcc const& acc, - const float rt, + float rt, struct lst::Modules& modulesInGPU, - const uint16_t moduleIndex, - const float dPhi = 0, - const float dz = 0) { + uint16_t moduleIndex, + float dPhi = 0, + float dz = 0) { // ================================================================= // Various constants // ================================================================= @@ -401,19 +401,19 @@ namespace lst { template ALPAKA_FN_INLINE ALPAKA_FN_ACC void shiftStripHits(TAcc const& acc, struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex, - const uint16_t upperModuleIndex, - const unsigned int lowerHitIndex, - const unsigned int upperHitIndex, + uint16_t lowerModuleIndex, + uint16_t upperModuleIndex, + unsigned int lowerHitIndex, + unsigned int upperHitIndex, float* shiftedCoords, - const float xLower, - const float yLower, - const float zLower, - const float rtLower, - const float xUpper, - const float yUpper, - const float zUpper, - const float rtUpper) { + float xLower, + float yLower, + float zLower, + float rtLower, + float xUpper, + float yUpper, + float zUpper, + float rtUpper) { // This is the strip shift scheme that is explained in http://uaf-10.t2.ucsd.edu/~phchang/talks/PhilipChang20190607_SDL_Update.pdf (see backup slides) // The main feature of this shifting is that the strip hits are shifted to be "aligned" in the line of sight from interaction point to the the pixel hit. // (since pixel hit is well defined in 3-d) @@ -567,10 +567,10 @@ namespace lst { template ALPAKA_FN_ACC bool runMiniDoubletDefaultAlgo(TAcc const& acc, struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex, - const uint16_t upperModuleIndex, - const unsigned int lowerHitIndex, - const unsigned int upperHitIndex, + uint16_t lowerModuleIndex, + uint16_t upperModuleIndex, + unsigned int lowerHitIndex, + unsigned int upperHitIndex, float& dz, float& dPhi, float& dPhiChange, @@ -579,14 +579,14 @@ namespace lst { float& shiftedZ, float& noShiftedDphi, float& noShiftedDphiChange, - const float xLower, - const float yLower, - const float zLower, - const float rtLower, - const float xUpper, - const float yUpper, - const float zUpper, - const float rtUpper) { + float xLower, + float yLower, + float zLower, + float rtLower, + float xUpper, + float yUpper, + float zUpper, + float rtUpper) { if (modulesInGPU.subdets[lowerModuleIndex] == lst::Barrel) { return runMiniDoubletDefaultAlgoBarrel(acc, modulesInGPU, @@ -639,10 +639,10 @@ namespace lst { template ALPAKA_FN_ACC bool runMiniDoubletDefaultAlgoBarrel(TAcc const& acc, struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex, - const uint16_t upperModuleIndex, - const unsigned int lowerHitIndex, - const unsigned int upperHitIndex, + uint16_t lowerModuleIndex, + uint16_t upperModuleIndex, + unsigned int lowerHitIndex, + unsigned int upperHitIndex, float& dz, float& dPhi, float& dPhiChange, @@ -651,17 +651,16 @@ namespace lst { float& shiftedZ, float& noShiftedDphi, float& noShiftedDphiChange, - const float xLower, - const float yLower, - const float zLower, - const float rtLower, - const float xUpper, - const float yUpper, - const float zUpper, - const float rtUpper) { + float xLower, + float yLower, + float zLower, + float rtLower, + float xUpper, + float yUpper, + float zUpper, + float rtUpper) { dz = zLower - zUpper; const float dzCut = modulesInGPU.moduleType[lowerModuleIndex] == lst::PS ? 2.f : 10.f; - //const float sign = ((dz > 0) - (dz < 0)) * ((hitsInGPU.zs[lowerHitIndex] > 0) - (hitsInGPU.zs[lowerHitIndex] < 0)); const float sign = ((dz > 0) - (dz < 0)) * ((zLower > 0) - (zLower < 0)); const float invertedcrossercut = (alpaka::math::abs(acc, dz) > 2) * sign; @@ -767,10 +766,10 @@ namespace lst { template ALPAKA_FN_ACC bool runMiniDoubletDefaultAlgoEndcap(TAcc const& acc, struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex, - const uint16_t upperModuleIndex, - const unsigned int lowerHitIndex, - const unsigned int upperHitIndex, + uint16_t lowerModuleIndex, + uint16_t upperModuleIndex, + unsigned int lowerHitIndex, + unsigned int upperHitIndex, float& drt, float& dPhi, float& dPhiChange, @@ -779,14 +778,14 @@ namespace lst { float& shiftedZ, float& noShiftedDphi, float& noShiftedDphichange, - const float xLower, - const float yLower, - const float zLower, - const float rtLower, - const float xUpper, - const float yUpper, - const float zUpper, - const float rtUpper) { + float xLower, + float yLower, + float zLower, + float rtLower, + float xUpper, + float yUpper, + float zUpper, + float rtUpper) { // There are series of cuts that applies to mini-doublet in a "endcap" region // Cut #1 : dz cut. The dz difference can't be larger than 1cm. (max separation is 4mm for modules in the endcap) // Ref to original code: https://github.com/slava77/cms-tkph2-ntuple/blob/184d2325147e6930030d3d1f780136bc2dd29ce6/doubletAnalysis.C#L3093 diff --git a/RecoTracker/LSTCore/src/alpaka/NeuralNetwork.h b/RecoTracker/LSTCore/src/alpaka/NeuralNetwork.h index 45883d0fd9454..a8b6f1761ebd4 100644 --- a/RecoTracker/LSTCore/src/alpaka/NeuralNetwork.h +++ b/RecoTracker/LSTCore/src/alpaka/NeuralNetwork.h @@ -22,11 +22,11 @@ namespace lst::t5dnn { const float* yVec, const unsigned int* mdIndices, const uint16_t* lowerModuleIndices, - const unsigned int innerTripletIndex, - const unsigned int outerTripletIndex, - const float innerRadius, - const float outerRadius, - const float bridgeRadius) { + unsigned int innerTripletIndex, + unsigned int outerTripletIndex, + float innerRadius, + float outerRadius, + float bridgeRadius) { // Unpack x-coordinates of hits float x1 = xVec[0]; float x2 = xVec[1]; diff --git a/RecoTracker/LSTCore/src/alpaka/ObjectRanges.h b/RecoTracker/LSTCore/src/alpaka/ObjectRanges.h index 7129f5b155574..1e1ccf8df12bc 100644 --- a/RecoTracker/LSTCore/src/alpaka/ObjectRanges.h +++ b/RecoTracker/LSTCore/src/alpaka/ObjectRanges.h @@ -105,7 +105,7 @@ namespace lst { ObjectRanges data_; template - ObjectRangesBuffer(const unsigned int nMod, const unsigned int nLowerMod, TDevAcc const& devAccIn, TQueue& queue) + ObjectRangesBuffer(unsigned int nMod, unsigned int nLowerMod, TDevAcc const& devAccIn, TQueue& queue) : hitRanges_buf(allocBufWrapper(devAccIn, nMod * 2, queue)), hitRangesLower_buf(allocBufWrapper(devAccIn, nMod, queue)), hitRangesUpper_buf(allocBufWrapper(devAccIn, nMod, queue)), diff --git a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h index 5bfc7f5aa7a8b..da5761b19c715 100644 --- a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h +++ b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h @@ -98,7 +98,7 @@ namespace lst { PixelTriplets data_; template - PixelTripletsBuffer(const unsigned int maxPixelTriplets, TDevAcc const& devAccIn, TQueue& queue) + PixelTripletsBuffer(unsigned int maxPixelTriplets, TDevAcc const& devAccIn, TQueue& queue) : pixelSegmentIndices_buf(allocBufWrapper(devAccIn, maxPixelTriplets, queue)), tripletIndices_buf(allocBufWrapper(devAccIn, maxPixelTriplets, queue)), nPixelTriplets_buf(allocBufWrapper(devAccIn, 1, queue)), @@ -137,22 +137,22 @@ namespace lst { struct lst::Segments& segmentsInGPU, struct lst::Triplets& tripletsInGPU, struct lst::PixelTriplets& pixelTripletsInGPU, - const unsigned int pixelSegmentIndex, - const unsigned int tripletIndex, - const float pixelRadius, - const float tripletRadius, - const float centerX, - const float centerY, - const float rPhiChiSquared, - const float rPhiChiSquaredInwards, - const float rzChiSquared, - const unsigned int pixelTripletIndex, - const float pt, - const float eta, - const float phi, - const float eta_pix, - const float phi_pix, - const float score) { + unsigned int pixelSegmentIndex, + unsigned int tripletIndex, + float pixelRadius, + float tripletRadius, + float centerX, + float centerY, + float rPhiChiSquared, + float rPhiChiSquaredInwards, + float rzChiSquared, + unsigned int pixelTripletIndex, + float pt, + float eta, + float phi, + float eta_pix, + float phi_pix, + float score) { pixelTripletsInGPU.pixelSegmentIndices[pixelTripletIndex] = pixelSegmentIndex; pixelTripletsInGPU.tripletIndices[pixelTripletIndex] = tripletIndex; pixelTripletsInGPU.pixelRadius[pixelTripletIndex] = __F2H(pixelRadius); @@ -218,11 +218,11 @@ namespace lst { struct lst::ObjectRanges& rangesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t pixelLowerModuleIndex, - const uint16_t outerInnerLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, + uint16_t pixelLowerModuleIndex, + uint16_t outerInnerLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, float& zOut, float& rtOut, float& deltaPhiPos, @@ -324,10 +324,10 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPT3RZChiSquaredCuts(struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex1, - const uint16_t lowerModuleIndex2, - const uint16_t lowerModuleIndex3, - const float rzChiSquared) { + uint16_t lowerModuleIndex1, + uint16_t lowerModuleIndex2, + uint16_t lowerModuleIndex3, + float rzChiSquared) { const int layer1 = modulesInGPU.layers[lowerModuleIndex1] + 6 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap) + 5 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap and @@ -386,9 +386,9 @@ namespace lst { float* delta2, float* slopes, bool* isFlat, - const float g, - const float f, - const float radius) { + float g, + float f, + float radius) { //given values of (g, f, radius) and a set of points (and its uncertainties) //compute chi squared float c = g * g + f * f - radius * radius; @@ -428,9 +428,9 @@ namespace lst { ALPAKA_FN_ACC ALPAKA_FN_INLINE float computePT3RPhiChiSquared(TAcc const& acc, struct lst::Modules& modulesInGPU, uint16_t* lowerModuleIndices, - const float g, - const float f, - const float radius, + float g, + float f, + float radius, float* xs, float* ys) { float delta1[3]{}, delta2[3]{}, slopes[3]; @@ -496,7 +496,7 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE float computePT3RPhiChiSquaredInwards( - struct lst::Modules& modulesInGPU, const float g, const float f, const float r, float* xPix, float* yPix) { + struct lst::Modules& modulesInGPU, float g, float f, float r, float* xPix, float* yPix) { float residual = (xPix[0] - g) * (xPix[0] - g) + (yPix[0] - f) * (yPix[0] - f) - r * r; float chiSquared = residual * residual; residual = (xPix[1] - g) * (xPix[1] - g) + (yPix[1] - f) * (yPix[1] - f) - r * r; @@ -508,10 +508,10 @@ namespace lst { //90pc threshold ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPT3RPhiChiSquaredCuts(struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex1, - const uint16_t lowerModuleIndex2, - const uint16_t lowerModuleIndex3, - const float chiSquared) { + uint16_t lowerModuleIndex1, + uint16_t lowerModuleIndex2, + uint16_t lowerModuleIndex3, + float chiSquared) { const int layer1 = modulesInGPU.layers[lowerModuleIndex1] + 6 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap) + 5 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap and @@ -555,9 +555,9 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPT3RPhiChiSquaredInwardsCuts(struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex1, - const uint16_t lowerModuleIndex2, - const uint16_t lowerModuleIndex3, + uint16_t lowerModuleIndex1, + uint16_t lowerModuleIndex2, + uint16_t lowerModuleIndex3, float& chiSquared) { const int layer1 = modulesInGPU.layers[lowerModuleIndex1] + 6 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap) + @@ -613,19 +613,19 @@ namespace lst { return true; }; - ALPAKA_FN_ACC ALPAKA_FN_INLINE bool checkIntervalOverlappT3(const float firstMin, - const float firstMax, - const float secondMin, - const float secondMax) { + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool checkIntervalOverlappT3(float firstMin, + float firstMax, + float secondMin, + float secondMax) { return ((firstMin <= secondMin) && (secondMin < firstMax)) || ((secondMin < firstMin) && (firstMin < secondMax)); }; /*bounds for high Pt taken from : http://uaf-10.t2.ucsd.edu/~bsathian/SDL/T5_efficiency/efficiencies/new_efficiencies/efficiencies_20210513_T5_recovering_high_Pt_efficiencies/highE_radius_matching/highE_bounds.txt */ template ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passRadiusCriterionBBB(TAcc const& acc, - const float pixelRadius, - const float pixelRadiusError, - const float tripletRadius) { + float pixelRadius, + float pixelRadiusError, + float tripletRadius) { float tripletInvRadiusErrorBound = 0.15624f; float pixelInvRadiusErrorBound = 0.17235f; @@ -647,9 +647,9 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passRadiusCriterionBBE(TAcc const& acc, - const float pixelRadius, - const float pixelRadiusError, - const float tripletRadius) { + float pixelRadius, + float pixelRadiusError, + float tripletRadius) { float tripletInvRadiusErrorBound = 0.45972f; float pixelInvRadiusErrorBound = 0.19644f; @@ -671,9 +671,9 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passRadiusCriterionBEE(TAcc const& acc, - const float pixelRadius, - const float pixelRadiusError, - const float tripletRadius) { + float pixelRadius, + float pixelRadiusError, + float tripletRadius) { float tripletInvRadiusErrorBound = 1.59294f; float pixelInvRadiusErrorBound = 0.255181f; @@ -697,9 +697,9 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passRadiusCriterionEEE(TAcc const& acc, - const float pixelRadius, - const float pixelRadiusError, - const float tripletRadius) { + float pixelRadius, + float pixelRadiusError, + float tripletRadius) { float tripletInvRadiusErrorBound = 1.7006f; float pixelInvRadiusErrorBound = 0.26367f; @@ -724,12 +724,12 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passRadiusCriterion(TAcc const& acc, struct lst::Modules const& modulesInGPU, - const float pixelRadius, - const float pixelRadiusError, - const float tripletRadius, - const int16_t lowerModuleIndex, - const uint16_t middleModuleIndex, - const uint16_t upperModuleIndex) { + float pixelRadius, + float pixelRadiusError, + float tripletRadius, + int16_t lowerModuleIndex, + uint16_t middleModuleIndex, + uint16_t upperModuleIndex) { if (modulesInGPU.subdets[lowerModuleIndex] == lst::Endcap) { return passRadiusCriterionEEE(acc, pixelRadius, pixelRadiusError, tripletRadius); } else if (modulesInGPU.subdets[middleModuleIndex] == lst::Endcap) { @@ -753,11 +753,11 @@ namespace lst { const float* xs, const float* ys, const float* zs, - const float pixelSegmentPt, - const float pixelSegmentPx, - const float pixelSegmentPy, - const float pixelSegmentPz, - const int pixelSegmentCharge) { + float pixelSegmentPt, + float pixelSegmentPx, + float pixelSegmentPy, + float pixelSegmentPz, + int pixelSegmentCharge) { float residual = 0; float error2 = 0; float RMSE = 0; @@ -837,8 +837,8 @@ namespace lst { struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, struct lst::Triplets& tripletsInGPU, - const unsigned int pixelSegmentIndex, - const unsigned int tripletIndex, + unsigned int pixelSegmentIndex, + unsigned int tripletIndex, float& pixelRadius, float& pixelRadiusError, float& tripletRadius, @@ -847,7 +847,7 @@ namespace lst { float& rzChiSquared, float& rPhiChiSquared, float& rPhiChiSquaredInwards, - const bool runChiSquaredCuts = true) { + bool runChiSquaredCuts = true) { //run pT4 compatibility between the pixel segment and inner segment, and between the pixel and outer segment of the triplet uint16_t pixelModuleIndex = segmentsInGPU.innerLowerModuleIndices[pixelSegmentIndex]; @@ -1037,7 +1037,7 @@ namespace lst { struct lst::PixelTriplets pixelTripletsInGPU, unsigned int* connectedPixelSize, unsigned int* connectedPixelIndex, - const unsigned int nPixelSegments) const { + unsigned int nPixelSegments) const { auto const globalBlockIdx = alpaka::getIdx(acc); auto const globalThreadIdx = alpaka::getIdx(acc); auto const gridBlockExtent = alpaka::getWorkDiv(acc); @@ -1172,10 +1172,10 @@ namespace lst { float& betaOut, float& betaAv, float& pt_beta, - const float sdIn_dr, - const float sdOut_dr, - const float dr, - const float lIn) { + float sdIn_dr, + float sdOut_dr, + float dr, + float lIn) { if (lIn == 0) { betaOut += alpaka::math::copysign( acc, @@ -1278,15 +1278,15 @@ namespace lst { struct lst::ObjectRanges& rangesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t pixelModuleIndex, - const uint16_t outerInnerLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, - const unsigned int fourthMDIndex, + uint16_t pixelModuleIndex, + uint16_t outerInnerLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, + unsigned int fourthMDIndex, float& /*z_OutLo*/, float& /*rt_OutLo*/, float& dPhiPos, @@ -1557,15 +1557,15 @@ namespace lst { struct lst::ObjectRanges& rangesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t pixelModuleIndex, - const uint16_t outerInnerLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, - const unsigned int fourthMDIndex, + uint16_t pixelModuleIndex, + uint16_t outerInnerLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, + unsigned int fourthMDIndex, float& /*z_OutLo*/, float& /*rt_OutLo*/, float& deltaPhiPos, @@ -1921,7 +1921,7 @@ namespace lst { PixelQuintuplets data_; template - PixelQuintupletsBuffer(const unsigned int maxPixelQuintuplets, TDevAcc const& devAccIn, TQueue& queue) + PixelQuintupletsBuffer(unsigned int maxPixelQuintuplets, TDevAcc const& devAccIn, TQueue& queue) : pixelIndices_buf(allocBufWrapper(devAccIn, maxPixelQuintuplets, queue)), T5Indices_buf(allocBufWrapper(devAccIn, maxPixelQuintuplets, queue)), nPixelQuintuplets_buf(allocBufWrapper(devAccIn, 1, queue)), @@ -1954,15 +1954,15 @@ namespace lst { struct lst::Segments& segmentsInGPU, struct lst::Quintuplets& quintupletsInGPU, struct lst::PixelQuintuplets& pixelQuintupletsInGPU, - const unsigned int pixelIndex, - const unsigned int T5Index, - const unsigned int pixelQuintupletIndex, + unsigned int pixelIndex, + unsigned int T5Index, + unsigned int pixelQuintupletIndex, float& rzChiSquared, float& rPhiChiSquared, float& rPhiChiSquaredInwards, - const float score, - const float eta, - const float phi, + float score, + float eta, + float phi, float& pixelRadius, float& quintupletRadius, float& centerX, @@ -2046,12 +2046,12 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPT5RZChiSquaredCuts(struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex1, - const uint16_t lowerModuleIndex2, - const uint16_t lowerModuleIndex3, - const uint16_t lowerModuleIndex4, - const uint16_t lowerModuleIndex5, - const float rzChiSquared) { + uint16_t lowerModuleIndex1, + uint16_t lowerModuleIndex2, + uint16_t lowerModuleIndex3, + uint16_t lowerModuleIndex4, + uint16_t lowerModuleIndex5, + float rzChiSquared) { const int layer1 = modulesInGPU.layers[lowerModuleIndex1] + 6 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap) + 5 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap and @@ -2136,12 +2136,12 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPT5RPhiChiSquaredCuts(struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex1, - const uint16_t lowerModuleIndex2, - const uint16_t lowerModuleIndex3, - const uint16_t lowerModuleIndex4, - const uint16_t lowerModuleIndex5, - const float rPhiChiSquared) { + uint16_t lowerModuleIndex1, + uint16_t lowerModuleIndex2, + uint16_t lowerModuleIndex3, + uint16_t lowerModuleIndex4, + uint16_t lowerModuleIndex5, + float rPhiChiSquared) { const int layer1 = modulesInGPU.layers[lowerModuleIndex1] + 6 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap) + 5 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap and @@ -2227,16 +2227,16 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeChiSquaredpT5(TAcc const& acc, - const unsigned int nPoints, + unsigned int nPoints, float* xs, float* ys, float* delta1, float* delta2, float* slopes, bool* isFlat, - const float g, - const float f, - const float radius) { + float g, + float f, + float radius) { /* Given values of (g, f, radius) and a set of points (and its uncertainties) compute chi squared */ @@ -2279,8 +2279,8 @@ namespace lst { float* delta2, float* slopes, bool* isFlat, - const unsigned int nPoints = 5, - const bool anchorHits = true) { + unsigned int nPoints = 5, + bool anchorHits = true) { /* bool anchorHits required to deal with a weird edge case wherein the hits ultimately used in the regression are anchor hits, but the @@ -2361,9 +2361,9 @@ namespace lst { ALPAKA_FN_ACC ALPAKA_FN_INLINE float computePT5RPhiChiSquared(TAcc const& acc, struct lst::Modules& modulesInGPU, uint16_t* lowerModuleIndices, - const float g, - const float f, - const float radius, + float g, + float f, + float radius, float* xs, float* ys) { /* @@ -2396,12 +2396,12 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passPT5RPhiChiSquaredInwardsCuts(struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex1, - const uint16_t lowerModuleIndex2, - const uint16_t lowerModuleIndex3, - const uint16_t lowerModuleIndex4, - const uint16_t lowerModuleIndex5, - const float rPhiChiSquared) { + uint16_t lowerModuleIndex1, + uint16_t lowerModuleIndex2, + uint16_t lowerModuleIndex3, + uint16_t lowerModuleIndex4, + uint16_t lowerModuleIndex5, + float rPhiChiSquared) { const int layer1 = modulesInGPU.layers[lowerModuleIndex1] + 6 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap) + 5 * (modulesInGPU.subdets[lowerModuleIndex1] == lst::Endcap and @@ -2493,8 +2493,8 @@ namespace lst { struct lst::Segments& segmentsInGPU, struct lst::Triplets& tripletsInGPU, struct lst::Quintuplets& quintupletsInGPU, - const unsigned int pixelSegmentIndex, - const unsigned int quintupletIndex, + unsigned int pixelSegmentIndex, + unsigned int quintupletIndex, float& rzChiSquared, float& rPhiChiSquared, float& rPhiChiSquaredInwards, @@ -2502,7 +2502,7 @@ namespace lst { float& quintupletRadius, float& centerX, float& centerY, - const unsigned int pixelSegmentArrayIndex) { + unsigned int pixelSegmentArrayIndex) { unsigned int T5InnerT3Index = quintupletsInGPU.tripletIndices[2 * quintupletIndex]; unsigned int T5OuterT3Index = quintupletsInGPU.tripletIndices[2 * quintupletIndex + 1]; diff --git a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h index 2c260876af268..1d796a6613824 100644 --- a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h +++ b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h @@ -104,8 +104,8 @@ namespace lst { Quintuplets data_; template - QuintupletsBuffer(const unsigned int nTotalQuintuplets, - const unsigned int nLowerModules, + QuintupletsBuffer(unsigned int nTotalQuintuplets, + unsigned int nLowerModules, TDevAcc const& devAccIn, TQueue& queue) : tripletIndices_buf(allocBufWrapper(devAccIn, 2 * nTotalQuintuplets, queue)), @@ -144,22 +144,22 @@ namespace lst { inline void setData(QuintupletsBuffer& buf) { data_.setData(buf); } }; - ALPAKA_FN_ACC ALPAKA_FN_INLINE bool checkIntervalOverlap(const float firstMin, - const float firstMax, - const float secondMin, - const float secondMax) { + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool checkIntervalOverlap(float firstMin, + float firstMax, + float secondMin, + float secondMax) { return ((firstMin <= secondMin) && (secondMin < firstMax)) || ((secondMin < firstMin) && (firstMin < secondMax)); }; ALPAKA_FN_ACC ALPAKA_FN_INLINE void addQuintupletToMemory(struct lst::Triplets& tripletsInGPU, struct lst::Quintuplets& quintupletsInGPU, - const unsigned int innerTripletIndex, - const unsigned int outerTripletIndex, - const uint16_t lowerModule1, - const uint16_t lowerModule2, - const uint16_t lowerModule3, - const uint16_t lowerModule4, - const uint16_t lowerModule5, + unsigned int innerTripletIndex, + unsigned int outerTripletIndex, + uint16_t lowerModule1, + uint16_t lowerModule2, + uint16_t lowerModule3, + uint16_t lowerModule4, + uint16_t lowerModule5, float& innerRadius, float& bridgeRadius, float& outerRadius, @@ -169,13 +169,13 @@ namespace lst { float& rzChiSquared, float& rPhiChiSquared, float& nonAnchorChiSquared, - const float pt, - const float eta, - const float phi, - const float scores, - const uint8_t layer, - const unsigned int quintupletIndex, - const bool TightCutFlag) { + float pt, + float eta, + float phi, + float scores, + uint8_t layer, + unsigned int quintupletIndex, + bool TightCutFlag) { quintupletsInGPU.tripletIndices[2 * quintupletIndex] = innerTripletIndex; quintupletsInGPU.tripletIndices[2 * quintupletIndex + 1] = outerTripletIndex; @@ -235,12 +235,12 @@ namespace lst { //90% constraint ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passChiSquaredConstraint(struct lst::Modules& modulesInGPU, - const uint16_t lowerModuleIndex1, - const uint16_t lowerModuleIndex2, - const uint16_t lowerModuleIndex3, - const uint16_t lowerModuleIndex4, - const uint16_t lowerModuleIndex5, - const float chiSquared) { + uint16_t lowerModuleIndex1, + uint16_t lowerModuleIndex2, + uint16_t lowerModuleIndex3, + uint16_t lowerModuleIndex4, + uint16_t lowerModuleIndex5, + float chiSquared) { // Using sdlLayer numbering convention defined in ModuleMethods.h const int layer1 = modulesInGPU.sdlLayers[lowerModuleIndex1]; const int layer2 = modulesInGPU.sdlLayers[lowerModuleIndex2]; @@ -321,21 +321,21 @@ namespace lst { ALPAKA_FN_ACC ALPAKA_FN_INLINE bool passT5RZConstraint(TAcc const& acc, struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, - const unsigned int fourthMDIndex, - const unsigned int fifthMDIndex, - const uint16_t lowerModuleIndex1, - const uint16_t lowerModuleIndex2, - const uint16_t lowerModuleIndex3, - const uint16_t lowerModuleIndex4, - const uint16_t lowerModuleIndex5, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, + unsigned int fourthMDIndex, + unsigned int fifthMDIndex, + uint16_t lowerModuleIndex1, + uint16_t lowerModuleIndex2, + uint16_t lowerModuleIndex3, + uint16_t lowerModuleIndex4, + uint16_t lowerModuleIndex5, float& rzChiSquared, - const float inner_pt, - const float innerRadius, - const float g, - const float f, + float inner_pt, + float innerRadius, + float g, + float f, bool& TightCutFlag) { //(g,f) is the center of the circle fitted by the innermost 3 points on x,y coordinates const float& rt1 = mdsInGPU.anchorRt[firstMDIndex] / 100; //in the unit of m instead of cm @@ -755,8 +755,8 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE bool T5HasCommonMiniDoublet(struct lst::Triplets& tripletsInGPU, struct lst::Segments& segmentsInGPU, - const unsigned int innerTripletIndex, - const unsigned int outerTripletIndex) { + unsigned int innerTripletIndex, + unsigned int outerTripletIndex) { unsigned int innerOuterSegmentIndex = tripletsInGPU.segmentIndices[2 * innerTripletIndex + 1]; unsigned int outerInnerSegmentIndex = tripletsInGPU.segmentIndices[2 * outerTripletIndex]; unsigned int innerOuterOuterMiniDoubletIndex = @@ -1158,8 +1158,8 @@ namespace lst { float* delta2, float* slopes, bool* isFlat, - const unsigned int nPoints = 5, - const bool anchorHits = true) { + unsigned int nPoints = 5, + bool anchorHits = true) { /* Bool anchorHits required to deal with a weird edge case wherein the hits ultimately used in the regression are anchor hits, but the @@ -1239,7 +1239,7 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeRadiusUsingRegression(TAcc const& acc, - const unsigned int nPoints, + unsigned int nPoints, float* xs, float* ys, float* delta1, @@ -1337,16 +1337,16 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeChiSquared(TAcc const& acc, - const unsigned int nPoints, + unsigned int nPoints, float* xs, float* ys, float* delta1, float* delta2, float* slopes, bool* isFlat, - const float g, - const float f, - const float radius) { + float g, + float f, + float radius) { // given values of (g, f, radius) and a set of points (and its uncertainties) // compute chi squared float c = g * g + f * f - radius * radius; @@ -1387,10 +1387,10 @@ namespace lst { float& betaOut, float& betaAv, float& pt_beta, - const float sdIn_dr, - const float sdOut_dr, - const float dr, - const float lIn) { + float sdIn_dr, + float sdOut_dr, + float dr, + float lIn) { if (lIn == 0) { betaOut += alpaka::math::copysign( acc, @@ -1492,16 +1492,16 @@ namespace lst { struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t innerOuterLowerModuleIndex, - const uint16_t outerInnerLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, - const unsigned int fourthMDIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t innerOuterLowerModuleIndex, + uint16_t outerInnerLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, + unsigned int fourthMDIndex, float& zOut, float& rtOut, float& deltaPhiPos, @@ -1761,16 +1761,16 @@ namespace lst { struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t innerOuterLowerModuleIndex, - const uint16_t outerInnerLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, - const unsigned int fourthMDIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t innerOuterLowerModuleIndex, + uint16_t outerInnerLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, + unsigned int fourthMDIndex, float& zOut, float& rtOut, float& deltaPhiPos, @@ -2032,16 +2032,16 @@ namespace lst { struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t innerOuterLowerModuleIndex, - const uint16_t outerInnerLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, - const unsigned int fourthMDIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t innerOuterLowerModuleIndex, + uint16_t outerInnerLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, + unsigned int fourthMDIndex, float& zOut, float& rtOut, float& deltaPhiPos, @@ -2289,16 +2289,16 @@ namespace lst { struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t innerOuterLowerModuleIndex, - const uint16_t outerInnerLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, - const unsigned int fourthMDIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t innerOuterLowerModuleIndex, + uint16_t outerInnerLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, + unsigned int fourthMDIndex, float& zOut, float& rtOut, float& deltaPhiPos, @@ -2497,13 +2497,13 @@ namespace lst { struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, struct lst::Triplets& tripletsInGPU, - const uint16_t lowerModuleIndex1, - const uint16_t lowerModuleIndex2, - const uint16_t lowerModuleIndex3, - const uint16_t lowerModuleIndex4, - const uint16_t lowerModuleIndex5, - const unsigned int innerTripletIndex, - const unsigned int outerTripletIndex, + uint16_t lowerModuleIndex1, + uint16_t lowerModuleIndex2, + uint16_t lowerModuleIndex3, + uint16_t lowerModuleIndex4, + uint16_t lowerModuleIndex5, + unsigned int innerTripletIndex, + unsigned int outerTripletIndex, float& innerRadius, float& outerRadius, float& bridgeRadius, @@ -2991,7 +2991,7 @@ namespace lst { struct lst::Triplets tripletsInGPU, struct lst::Quintuplets quintupletsInGPU, struct lst::ObjectRanges rangesInGPU, - const uint16_t nEligibleT5Modules) const { + uint16_t nEligibleT5Modules) const { auto const globalThreadIdx = alpaka::getIdx(acc); auto const gridThreadExtent = alpaka::getWorkDiv(acc); diff --git a/RecoTracker/LSTCore/src/alpaka/Segment.h b/RecoTracker/LSTCore/src/alpaka/Segment.h index 993d659844e23..93a17e3d72e46 100644 --- a/RecoTracker/LSTCore/src/alpaka/Segment.h +++ b/RecoTracker/LSTCore/src/alpaka/Segment.h @@ -125,9 +125,9 @@ namespace lst { Segments data_; template - SegmentsBuffer(const unsigned int nMemoryLocationsIn, - const uint16_t nLowerModules, - const unsigned int maxPixelSegments, + SegmentsBuffer(unsigned int nMemoryLocationsIn, + uint16_t nLowerModules, + unsigned int maxPixelSegments, TDevAcc const& devAccIn, TQueue& queue) : dPhis_buf(allocBufWrapper(devAccIn, nMemoryLocationsIn, queue)), @@ -176,7 +176,7 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE float isTighterTiltedModules_seg(struct lst::Modules& modulesInGPU, - const unsigned int moduleIndex) { + unsigned int moduleIndex) { // The "tighter" tilted modules are the subset of tilted modules that have smaller spacing // This is the same as what was previously considered as"isNormalTiltedModules" // See Figure 9.1 of https://cds.cern.ch/record/2272264/files/CMS-TDR-014.pdf @@ -200,7 +200,7 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE float moduleGapSize_seg( - const short layer, const short ring, const short subdet, const short side, const short rod) { + short layer, short ring, short subdet, short side, short rod) { static constexpr float miniDeltaTilted[3] = {0.26f, 0.26f, 0.26f}; static constexpr float miniDeltaFlat[6] = {0.26f, 0.16f, 0.16f, 0.18f, 0.18f, 0.18f}; static constexpr float miniDeltaLooseTilted[3] = {0.4f, 0.4f, 0.4f}; @@ -231,7 +231,7 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE float moduleGapSize_seg(struct lst::Modules& modulesInGPU, - const unsigned int moduleIndex) { + unsigned int moduleIndex) { static constexpr float miniDeltaTilted[3] = {0.26f, 0.26f, 0.26f}; static constexpr float miniDeltaFlat[6] = {0.26f, 0.16f, 0.16f, 0.18f, 0.18f, 0.18f}; static constexpr float miniDeltaLooseTilted[3] = {0.4f, 0.4f, 0.4f}; @@ -276,10 +276,10 @@ namespace lst { float& yOut, float& zOut, float& rtOut, - const uint16_t innerLowerModuleIndex, - const uint16_t outerLowerModuleIndex, - const unsigned int innerMDIndex, - const unsigned int outerMDIndex) { + uint16_t innerLowerModuleIndex, + uint16_t outerLowerModuleIndex, + unsigned int innerMDIndex, + unsigned int outerMDIndex) { float sdMuls = (modulesInGPU.subdets[innerLowerModuleIndex] == lst::Barrel) ? kMiniMulsPtScaleBarrel[modulesInGPU.layers[innerLowerModuleIndex] - 1] * 3.f / ptCut : kMiniMulsPtScaleEndcap[modulesInGPU.layers[innerLowerModuleIndex] - 1] * 3.f / ptCut; @@ -359,19 +359,19 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE void addSegmentToMemory(struct lst::Segments& segmentsInGPU, - const unsigned int lowerMDIndex, - const unsigned int upperMDIndex, - const uint16_t innerLowerModuleIndex, - const uint16_t outerLowerModuleIndex, - const unsigned int innerMDAnchorHitIndex, - const unsigned int outerMDAnchorHitIndex, + unsigned int lowerMDIndex, + unsigned int upperMDIndex, + uint16_t innerLowerModuleIndex, + uint16_t outerLowerModuleIndex, + unsigned int innerMDAnchorHitIndex, + unsigned int outerMDAnchorHitIndex, float& dPhi, float& dPhiMin, float& dPhiMax, float& dPhiChange, float& dPhiChangeMin, float& dPhiChangeMax, - const unsigned int idx) { + unsigned int idx) { //idx will be computed in the kernel, which is the index into which the //segment will be written //nSegments will be incremented in the kernel @@ -395,16 +395,16 @@ namespace lst { ALPAKA_FN_ACC ALPAKA_FN_INLINE void addPixelSegmentToMemory(TAcc const& acc, struct lst::Segments& segmentsInGPU, struct lst::MiniDoublets& mdsInGPU, - const unsigned int innerMDIndex, - const unsigned int outerMDIndex, - const uint16_t pixelModuleIndex, - const unsigned int hitIdxs[4], - const unsigned int innerAnchorHitIndex, - const unsigned int outerAnchorHitIndex, - const float dPhiChange, - const unsigned int idx, - const unsigned int pixelSegmentArrayIndex, - const float score) { + unsigned int innerMDIndex, + unsigned int outerMDIndex, + uint16_t pixelModuleIndex, + unsigned int hitIdxs[4], + unsigned int innerAnchorHitIndex, + unsigned int outerAnchorHitIndex, + float dPhiChange, + unsigned int idx, + unsigned int pixelSegmentArrayIndex, + float score) { segmentsInGPU.mdIndices[idx * 2] = innerMDIndex; segmentsInGPU.mdIndices[idx * 2 + 1] = outerMDIndex; segmentsInGPU.innerLowerModuleIndices[idx] = pixelModuleIndex; @@ -458,10 +458,10 @@ namespace lst { ALPAKA_FN_ACC ALPAKA_FN_INLINE bool runSegmentDefaultAlgoBarrel(TAcc const& acc, struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, - const uint16_t innerLowerModuleIndex, - const uint16_t outerLowerModuleIndex, - const unsigned int& innerMDIndex, - const unsigned int& outerMDIndex, + uint16_t innerLowerModuleIndex, + uint16_t outerLowerModuleIndex, + unsigned int& innerMDIndex, + unsigned int& outerMDIndex, float& zIn, float& zOut, float& rtIn, @@ -561,10 +561,10 @@ namespace lst { ALPAKA_FN_ACC ALPAKA_FN_INLINE bool runSegmentDefaultAlgoEndcap(TAcc const& acc, struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, - const uint16_t innerLowerModuleIndex, - const uint16_t outerLowerModuleIndex, - const unsigned int innerMDIndex, - const unsigned int outerMDIndex, + uint16_t innerLowerModuleIndex, + uint16_t outerLowerModuleIndex, + unsigned int innerMDIndex, + unsigned int outerMDIndex, float& zIn, float& zOut, float& rtIn, @@ -691,10 +691,10 @@ namespace lst { ALPAKA_FN_ACC ALPAKA_FN_INLINE bool runSegmentDefaultAlgo(TAcc const& acc, struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, - const uint16_t innerLowerModuleIndex, - const uint16_t outerLowerModuleIndex, - const unsigned int innerMDIndex, - const unsigned int outerMDIndex, + uint16_t innerLowerModuleIndex, + uint16_t outerLowerModuleIndex, + unsigned int innerMDIndex, + unsigned int outerMDIndex, float& zIn, float& zOut, float& rtIn, @@ -1023,8 +1023,8 @@ namespace lst { unsigned int* hitIndices2, unsigned int* hitIndices3, float* dPhiChange, - const uint16_t pixelModuleIndex, - const int size) const { + uint16_t pixelModuleIndex, + int size) const { auto const globalThreadIdx = alpaka::getIdx(acc); auto const gridThreadExtent = alpaka::getWorkDiv(acc); diff --git a/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h b/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h index d17ce8c347cbf..7451f5e47dc80 100644 --- a/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h +++ b/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h @@ -77,7 +77,7 @@ namespace lst { TrackCandidates data_; template - TrackCandidatesBuffer(const unsigned int maxTrackCandidates, TDevAcc const& devAccIn, TQueue& queue) + TrackCandidatesBuffer(unsigned int maxTrackCandidates, TDevAcc const& devAccIn, TQueue& queue) : trackCandidateType_buf(allocBufWrapper(devAccIn, maxTrackCandidates, queue)), directObjectIndices_buf(allocBufWrapper(devAccIn, maxTrackCandidates, queue)), objectIndices_buf(allocBufWrapper(devAccIn, 2 * maxTrackCandidates, queue)), @@ -110,10 +110,10 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE void addpLSTrackCandidateToMemory(struct lst::TrackCandidates& trackCandidatesInGPU, - const unsigned int trackletIndex, - const unsigned int trackCandidateIndex, - const uint4 hitIndices, - const int pixelSeedIndex) { + unsigned int trackletIndex, + unsigned int trackCandidateIndex, + uint4 hitIndices, + int pixelSeedIndex) { trackCandidatesInGPU.trackCandidateType[trackCandidateIndex] = 8; // type for pLS trackCandidatesInGPU.directObjectIndices[trackCandidateIndex] = trackletIndex; trackCandidatesInGPU.pixelSeedIndex[trackCandidateIndex] = pixelSeedIndex; @@ -129,18 +129,18 @@ namespace lst { }; ALPAKA_FN_ACC ALPAKA_FN_INLINE void addTrackCandidateToMemory(struct lst::TrackCandidates& trackCandidatesInGPU, - const short trackCandidateType, - const unsigned int innerTrackletIndex, - const unsigned int outerTrackletIndex, + short trackCandidateType, + unsigned int innerTrackletIndex, + unsigned int outerTrackletIndex, uint8_t* logicalLayerIndices, uint16_t* lowerModuleIndices, unsigned int* hitIndices, - const int pixelSeedIndex, - const float centerX, - const float centerY, - const float radius, - const unsigned int trackCandidateIndex, - const unsigned int directObjectIndex) { + int pixelSeedIndex, + float centerX, + float centerY, + float radius, + unsigned int trackCandidateIndex, + unsigned int directObjectIndex) { trackCandidatesInGPU.trackCandidateType[trackCandidateIndex] = trackCandidateType; trackCandidatesInGPU.directObjectIndices[trackCandidateIndex] = directObjectIndex; trackCandidatesInGPU.pixelSeedIndex[trackCandidateIndex] = pixelSeedIndex; @@ -165,8 +165,8 @@ namespace lst { trackCandidatesInGPU.radius[trackCandidateIndex] = __F2H(radius); }; - ALPAKA_FN_ACC ALPAKA_FN_INLINE int checkPixelHits(const unsigned int ix, - const unsigned int jx, + ALPAKA_FN_ACC ALPAKA_FN_INLINE int checkPixelHits(unsigned int ix, + unsigned int jx, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, struct lst::Hits& hitsInGPU) { @@ -439,7 +439,7 @@ namespace lst { struct addT5asTrackCandidateInGPU { template ALPAKA_FN_ACC void operator()(TAcc const& acc, - const uint16_t nLowerModules, + uint16_t nLowerModules, struct lst::Quintuplets quintupletsInGPU, struct lst::TrackCandidates trackCandidatesInGPU, struct lst::ObjectRanges rangesInGPU) const { @@ -493,10 +493,10 @@ namespace lst { struct addpLSasTrackCandidateInGPU { template ALPAKA_FN_ACC void operator()(TAcc const& acc, - const uint16_t nLowerModules, + uint16_t nLowerModules, struct lst::TrackCandidates trackCandidatesInGPU, struct lst::Segments segmentsInGPU, - const bool tc_pls_triplets) const { + bool tc_pls_triplets) const { auto const globalThreadIdx = alpaka::getIdx(acc); auto const gridThreadExtent = alpaka::getWorkDiv(acc); @@ -532,7 +532,7 @@ namespace lst { struct addpT5asTrackCandidateInGPU { template ALPAKA_FN_ACC void operator()(TAcc const& acc, - const uint16_t nLowerModules, + uint16_t nLowerModules, struct lst::PixelQuintuplets pixelQuintupletsInGPU, struct lst::TrackCandidates trackCandidatesInGPU, struct lst::Segments segmentsInGPU, diff --git a/RecoTracker/LSTCore/src/alpaka/Triplet.h b/RecoTracker/LSTCore/src/alpaka/Triplet.h index 1936ecb495ff7..336724e8a8bee 100644 --- a/RecoTracker/LSTCore/src/alpaka/Triplet.h +++ b/RecoTracker/LSTCore/src/alpaka/Triplet.h @@ -109,8 +109,8 @@ namespace lst { Triplets data_; template - TripletsBuffer(const unsigned int maxTriplets, - const unsigned int nLowerModules, + TripletsBuffer(unsigned int maxTriplets, + unsigned int nLowerModules, TDevAcc const& devAccIn, TQueue& queue) : segmentIndices_buf(allocBufWrapper(devAccIn, 2 * maxTriplets, queue)), @@ -159,11 +159,11 @@ namespace lst { struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, struct lst::Triplets& tripletsInGPU, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t middleLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t middleLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, float& zOut, float& rtOut, float& deltaPhiPos, @@ -180,22 +180,22 @@ namespace lst { float& zHiPointed, float& sdlCut, float& betaInCut, - const unsigned int tripletIndex) + unsigned int tripletIndex) #else ALPAKA_FN_ACC ALPAKA_FN_INLINE void addTripletToMemory(struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, struct lst::Triplets& tripletsInGPU, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t middleLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t middleLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, float& betaIn, float& circleRadius, float& circleCenterX, float& circleCenterY, - const unsigned int tripletIndex) + unsigned int tripletIndex) #endif { tripletsInGPU.segmentIndices[tripletIndex * 2] = innerSegmentIndex; @@ -246,12 +246,12 @@ namespace lst { struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t middleLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex) { + uint16_t innerInnerLowerModuleIndex, + uint16_t middleLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex) { //get the rt and z const float& r1 = mdsInGPU.anchorRt[firstMDIndex]; const float& r2 = mdsInGPU.anchorRt[secondMDIndex]; @@ -306,15 +306,15 @@ namespace lst { struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t middleLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t middleLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, float& zOut, float& rtOut, - const unsigned int innerSegmentIndex, + unsigned int innerSegmentIndex, float& betaIn, float& betaInCut) { bool isPSIn = (modulesInGPU.moduleType[innerInnerLowerModuleIndex] == lst::PS); @@ -405,17 +405,17 @@ namespace lst { struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t middleLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t middleLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, float& zOut, float& rtOut, - const uint16_t innerOuterLowerModuleIndex, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, + uint16_t innerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, float& betaIn, float& betaInCut) { bool isPSIn = (modulesInGPU.moduleType[innerInnerLowerModuleIndex] == lst::PS); @@ -526,16 +526,16 @@ namespace lst { struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t middleLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t middleLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, float& zOut, float& rtOut, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, float& betaIn, float& betaInCut) { float rtIn = mdsInGPU.anchorRt[firstMDIndex]; @@ -649,17 +649,17 @@ namespace lst { struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t middleLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int firstMDIndex, - const unsigned int secondMDIndex, - const unsigned int thirdMDIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t middleLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int firstMDIndex, + unsigned int secondMDIndex, + unsigned int thirdMDIndex, float& zOut, float& rtOut, - const uint16_t innerOuterLowerModuleIndex, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, + uint16_t innerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, float& betaIn, float& betaInCut) { short innerInnerLowerModuleSubdet = modulesInGPU.subdets[innerInnerLowerModuleIndex]; @@ -748,12 +748,12 @@ namespace lst { template ALPAKA_FN_ACC ALPAKA_FN_INLINE float computeRadiusFromThreeAnchorHits(TAcc const& acc, - const float x1, - const float y1, - const float x2, - const float y2, - const float x3, - const float y3, + float x1, + float y1, + float x2, + float y2, + float x3, + float y3, float& g, float& f) { float radius = 0.f; @@ -793,11 +793,11 @@ namespace lst { struct lst::Modules& modulesInGPU, struct lst::MiniDoublets& mdsInGPU, struct lst::Segments& segmentsInGPU, - const uint16_t innerInnerLowerModuleIndex, - const uint16_t middleLowerModuleIndex, - const uint16_t outerOuterLowerModuleIndex, - const unsigned int innerSegmentIndex, - const unsigned int outerSegmentIndex, + uint16_t innerInnerLowerModuleIndex, + uint16_t middleLowerModuleIndex, + uint16_t outerOuterLowerModuleIndex, + unsigned int innerSegmentIndex, + unsigned int outerSegmentIndex, float& zOut, float& rtOut, float& deltaPhiPos, @@ -872,7 +872,7 @@ namespace lst { struct lst::Triplets tripletsInGPU, struct lst::ObjectRanges rangesInGPU, uint16_t* index_gpu, - const uint16_t nonZeroModules) const { + uint16_t nonZeroModules) const { auto const globalThreadIdx = alpaka::getIdx(acc); auto const gridThreadExtent = alpaka::getWorkDiv(acc);