diff --git a/RecoTracker/LST/plugins/alpaka/LSTProducer.cc b/RecoTracker/LST/plugins/alpaka/LSTProducer.cc index b93580b0a9fa9..1b34b949c64e5 100644 --- a/RecoTracker/LST/plugins/alpaka/LSTProducer.cc +++ b/RecoTracker/LST/plugins/alpaka/LSTProducer.cc @@ -91,7 +91,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const bool verbose_, nopLSDupClean_, tcpLSTriplets_; edm::EDPutTokenT lstOutputToken_; - SDL::LST lst_; + SDL::LST lst_; }; } // namespace ALPAKA_ACCELERATOR_NAMESPACE diff --git a/RecoTracker/LSTCore/interface/LST.h b/RecoTracker/LSTCore/interface/LST.h index 13aa2ec9896aa..7b44d07e0bb6c 100644 --- a/RecoTracker/LSTCore/interface/LST.h +++ b/RecoTracker/LSTCore/interface/LST.h @@ -16,7 +16,7 @@ namespace SDL { template class LST; - template + template class LST { public: LST() = default; @@ -24,7 +24,7 @@ namespace SDL { template void run(TQueue& queue, bool verbose, - const LSTESData* deviceESData, + const LSTESData>* deviceESData, const std::vector see_px, const std::vector see_py, const std::vector see_pz, @@ -72,7 +72,7 @@ namespace SDL { const std::vector ph2_y, const std::vector ph2_z); - void getOutput(SDL::Event& event); + void getOutput(SDL::Event& event); std::vector getHitIdxs(const short trackCandidateType, const unsigned int TCIdx, const unsigned int* TCHitIndices, diff --git a/RecoTracker/LSTCore/interface/alpaka/Constants.h b/RecoTracker/LSTCore/interface/alpaka/Constants.h index b0a5d0e556760..e8a890fbb9ff4 100644 --- a/RecoTracker/LSTCore/interface/alpaka/Constants.h +++ b/RecoTracker/LSTCore/interface/alpaka/Constants.h @@ -8,6 +8,9 @@ #endif namespace SDL { + + using namespace ALPAKA_ACCELERATOR_NAMESPACE; + // Half precision wrapper functions. #if defined(FP16_Base) #define __F2H __float2half @@ -19,7 +22,7 @@ namespace SDL { typedef float FPX; #endif - alpaka_common::Vec3D const elementsPerThread(alpaka_common::Vec3D::all(static_cast(1))); + Vec3D constexpr elementsPerThread(Vec3D::all(static_cast(1))); // Needed for files that are compiled by g++ to not throw an error. // uint4 is defined only for CUDA, so we will have to revisit this soon when running on other backends. @@ -33,14 +36,14 @@ namespace SDL { #endif // Wrapper function to reduce code boilerplate for defining grid/block sizes. - ALPAKA_FN_HOST ALPAKA_FN_INLINE alpaka_common::Vec3D createVec(int x, int y, int z) { - return alpaka_common::Vec3D( - static_cast(x), static_cast(y), static_cast(z)); + ALPAKA_FN_HOST ALPAKA_FN_INLINE Vec3D createVec(int x, int y, int z) { + return Vec3D( + static_cast(x), static_cast(y), static_cast(z)); } // Adjust grid and block sizes based on backend configuration template - ALPAKA_FN_HOST ALPAKA_FN_INLINE alpaka_common::WorkDiv3D createWorkDiv(const Vec& blocksPerGrid, + ALPAKA_FN_HOST ALPAKA_FN_INLINE WorkDiv3D createWorkDiv(const Vec& blocksPerGrid, const Vec& threadsPerBlock, const Vec& elementsPerThreadArg) { Vec adjustedBlocks = blocksPerGrid; @@ -48,16 +51,16 @@ namespace SDL { // Serial execution, so all launch parameters set to 1. #if defined(ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED) - adjustedBlocks = Vec::all(static_cast(1)); - adjustedThreads = Vec::all(static_cast(1)); + adjustedBlocks = Vec::all(static_cast(1)); + adjustedThreads = Vec::all(static_cast(1)); #endif // Threads enabled, set number of blocks to 1. #if defined(ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLED) - adjustedBlocks = Vec::all(static_cast(1)); + adjustedBlocks = Vec::all(static_cast(1)); #endif - return alpaka_common::WorkDiv3D(adjustedBlocks, adjustedThreads, elementsPerThreadArg); + return WorkDiv3D(adjustedBlocks, adjustedThreads, elementsPerThreadArg); } // 15 MeV constant from the approximate Bethe-Bloch formula diff --git a/RecoTracker/LSTCore/src/alpaka/Event.dev.cc b/RecoTracker/LSTCore/src/alpaka/Event.dev.cc index 37fb4ca02fc0a..230b10d3904bc 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 SDL::Event::init(bool verbose) { +void SDL::Event::init(bool verbose) { addObjects = verbose; hitsInGPU = nullptr; mdsInGPU = nullptr; @@ -44,7 +44,7 @@ void SDL::Event::init(bool verbose) { } } -void SDL::Event::resetEvent() { +void SDL::Event::resetEvent() { //reset the arrays for (int i = 0; i < 6; i++) { n_hits_by_layer_barrel_[i] = 0; @@ -150,7 +150,7 @@ void SDL::Event::resetEvent() { } } -void SDL::Event::addHitToEvent(std::vector x, +void SDL::Event::addHitToEvent(std::vector x, std::vector y, std::vector z, std::vector detId, @@ -217,7 +217,7 @@ void SDL::Event::addHitToEvent(std::vector x, alpaka::enqueue(queue, module_ranges_task); } -void SDL::Event::addPixelSegmentToEvent(std::vector hitIndices0, +void SDL::Event::addPixelSegmentToEvent(std::vector hitIndices0, std::vector hitIndices1, std::vector hitIndices2, std::vector hitIndices3, @@ -393,7 +393,7 @@ void SDL::Event::addPixelSegmentToEvent(std::vector hitInd alpaka::wait(queue); } -void SDL::Event::createMiniDoublets() { +void SDL::Event::createMiniDoublets() { // Create a view for the element nLowerModules_ inside rangesBuffers->miniDoubletModuleOccupancy auto dst_view_miniDoubletModuleOccupancy = alpaka::createSubView(rangesBuffers->miniDoubletModuleOccupancy_buf, (Idx)1u, (Idx)nLowerModules_); @@ -469,7 +469,7 @@ void SDL::Event::createMiniDoublets() { } } -void SDL::Event::createSegmentsWithModuleMap() { +void SDL::Event::createSegmentsWithModuleMap() { if (segmentsInGPU == nullptr) { segmentsInGPU = new SDL::segments(); segmentsBuffers = @@ -513,7 +513,7 @@ void SDL::Event::createSegmentsWithModuleMap() { } } -void SDL::Event::createTriplets() { +void SDL::Event::createTriplets() { if (tripletsInGPU == nullptr) { Vec3D const threadsPerBlockCreateTrip = createVec(1, 1, 1024); Vec3D const blocksPerGridCreateTrip = createVec(1, 1, 1); @@ -622,7 +622,7 @@ void SDL::Event::createTriplets() { } } -void SDL::Event::createTrackCandidates(bool no_pls_dupclean, bool tc_pls_triplets) { +void SDL::Event::createTrackCandidates(bool no_pls_dupclean, bool tc_pls_triplets) { if (trackCandidatesInGPU == nullptr) { trackCandidatesInGPU = new SDL::trackCandidates(); trackCandidatesBuffers = new SDL::trackCandidatesBuffer( @@ -787,7 +787,7 @@ void SDL::Event::createTrackCandidates(bool no_pls_dupclean, bool tc_pls } } -void SDL::Event::createPixelTriplets() { +void SDL::Event::createPixelTriplets() { if (pixelTripletsInGPU == nullptr) { pixelTripletsInGPU = new SDL::pixelTriplets(); pixelTripletsBuffers = new SDL::pixelTripletsBuffer(N_MAX_PIXEL_TRIPLETS, devAcc, queue); @@ -906,7 +906,7 @@ void SDL::Event::createPixelTriplets() { alpaka::wait(queue); } -void SDL::Event::createQuintuplets() { +void SDL::Event::createQuintuplets() { Vec3D const threadsPerBlockCreateQuints = createVec(1, 1, 1024); Vec3D const blocksPerGridCreateQuints = createVec(1, 1, 1); WorkDiv3D const createEligibleModulesListForQuintupletsGPU_workDiv = @@ -996,7 +996,7 @@ void SDL::Event::createQuintuplets() { } } -void SDL::Event::pixelLineSegmentCleaning(bool no_pls_dupclean) { +void SDL::Event::pixelLineSegmentCleaning(bool no_pls_dupclean) { if (!no_pls_dupclean) { Vec3D const threadsPerBlockCheckHitspLS = createVec(1, 16, 16); Vec3D const blocksPerGridCheckHitspLS = createVec(1, MAX_BLOCKS * 4, MAX_BLOCKS / 4); @@ -1012,7 +1012,7 @@ void SDL::Event::pixelLineSegmentCleaning(bool no_pls_dupclean) { } } -void SDL::Event::createPixelQuintuplets() { +void SDL::Event::createPixelQuintuplets() { if (pixelQuintupletsInGPU == nullptr) { pixelQuintupletsInGPU = new SDL::pixelQuintuplets(); pixelQuintupletsBuffers = new SDL::pixelQuintupletsBuffer(N_MAX_PIXEL_QUINTUPLETS, devAcc, queue); @@ -1151,7 +1151,7 @@ void SDL::Event::createPixelQuintuplets() { #endif } -void SDL::Event::addMiniDoubletsToEventExplicit() { +void SDL::Event::addMiniDoubletsToEventExplicit() { auto nMDsCPU_buf = allocBufWrapper(devHost, nLowerModules_, queue); alpaka::memcpy(queue, nMDsCPU_buf, miniDoubletsBuffers->nMDs_buf, nLowerModules_); @@ -1182,7 +1182,7 @@ void SDL::Event::addMiniDoubletsToEventExplicit() { } } -void SDL::Event::addSegmentsToEventExplicit() { +void SDL::Event::addSegmentsToEventExplicit() { auto nSegmentsCPU_buf = allocBufWrapper(devHost, nLowerModules_, queue); alpaka::memcpy(queue, nSegmentsCPU_buf, segmentsBuffers->nSegments_buf, nLowerModules_); @@ -1209,7 +1209,7 @@ void SDL::Event::addSegmentsToEventExplicit() { } } -void SDL::Event::addQuintupletsToEventExplicit() { +void SDL::Event::addQuintupletsToEventExplicit() { auto nQuintupletsCPU_buf = allocBufWrapper(devHost, nLowerModules_, queue); alpaka::memcpy(queue, nQuintupletsCPU_buf, quintupletsBuffers->nQuintuplets_buf); @@ -1240,7 +1240,7 @@ void SDL::Event::addQuintupletsToEventExplicit() { } } -void SDL::Event::addTripletsToEventExplicit() { +void SDL::Event::addTripletsToEventExplicit() { auto nTripletsCPU_buf = allocBufWrapper(devHost, nLowerModules_, queue); alpaka::memcpy(queue, nTripletsCPU_buf, tripletsBuffers->nTriplets_buf); @@ -1266,7 +1266,7 @@ void SDL::Event::addTripletsToEventExplicit() { } } -unsigned int SDL::Event::getNumberOfHits() { +unsigned int SDL::Event::getNumberOfHits() { unsigned int hits = 0; for (auto& it : n_hits_by_layer_barrel_) { hits += it; @@ -1278,22 +1278,22 @@ unsigned int SDL::Event::getNumberOfHits() { return hits; } -unsigned int SDL::Event::getNumberOfHitsByLayer(unsigned int layer) { +unsigned int SDL::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 SDL::Event::getNumberOfHitsByLayerBarrel(unsigned int layer) { +unsigned int SDL::Event::getNumberOfHitsByLayerBarrel(unsigned int layer) { return n_hits_by_layer_barrel_[layer]; } -unsigned int SDL::Event::getNumberOfHitsByLayerEndcap(unsigned int layer) { +unsigned int SDL::Event::getNumberOfHitsByLayerEndcap(unsigned int layer) { return n_hits_by_layer_endcap_[layer]; } -unsigned int SDL::Event::getNumberOfMiniDoublets() { +unsigned int SDL::Event::getNumberOfMiniDoublets() { unsigned int miniDoublets = 0; for (auto& it : n_minidoublets_by_layer_barrel_) { miniDoublets += it; @@ -1305,22 +1305,22 @@ unsigned int SDL::Event::getNumberOfMiniDoublets() { return miniDoublets; } -unsigned int SDL::Event::getNumberOfMiniDoubletsByLayer(unsigned int layer) { +unsigned int SDL::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 SDL::Event::getNumberOfMiniDoubletsByLayerBarrel(unsigned int layer) { +unsigned int SDL::Event::getNumberOfMiniDoubletsByLayerBarrel(unsigned int layer) { return n_minidoublets_by_layer_barrel_[layer]; } -unsigned int SDL::Event::getNumberOfMiniDoubletsByLayerEndcap(unsigned int layer) { +unsigned int SDL::Event::getNumberOfMiniDoubletsByLayerEndcap(unsigned int layer) { return n_minidoublets_by_layer_endcap_[layer]; } -unsigned int SDL::Event::getNumberOfSegments() { +unsigned int SDL::Event::getNumberOfSegments() { unsigned int segments = 0; for (auto& it : n_segments_by_layer_barrel_) { segments += it; @@ -1332,22 +1332,22 @@ unsigned int SDL::Event::getNumberOfSegments() { return segments; } -unsigned int SDL::Event::getNumberOfSegmentsByLayer(unsigned int layer) { +unsigned int SDL::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 SDL::Event::getNumberOfSegmentsByLayerBarrel(unsigned int layer) { +unsigned int SDL::Event::getNumberOfSegmentsByLayerBarrel(unsigned int layer) { return n_segments_by_layer_barrel_[layer]; } -unsigned int SDL::Event::getNumberOfSegmentsByLayerEndcap(unsigned int layer) { +unsigned int SDL::Event::getNumberOfSegmentsByLayerEndcap(unsigned int layer) { return n_segments_by_layer_endcap_[layer]; } -unsigned int SDL::Event::getNumberOfTriplets() { +unsigned int SDL::Event::getNumberOfTriplets() { unsigned int triplets = 0; for (auto& it : n_triplets_by_layer_barrel_) { triplets += it; @@ -1359,22 +1359,22 @@ unsigned int SDL::Event::getNumberOfTriplets() { return triplets; } -unsigned int SDL::Event::getNumberOfTripletsByLayer(unsigned int layer) { +unsigned int SDL::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 SDL::Event::getNumberOfTripletsByLayerBarrel(unsigned int layer) { +unsigned int SDL::Event::getNumberOfTripletsByLayerBarrel(unsigned int layer) { return n_triplets_by_layer_barrel_[layer]; } -unsigned int SDL::Event::getNumberOfTripletsByLayerEndcap(unsigned int layer) { +unsigned int SDL::Event::getNumberOfTripletsByLayerEndcap(unsigned int layer) { return n_triplets_by_layer_endcap_[layer]; } -int SDL::Event::getNumberOfPixelTriplets() { +int SDL::Event::getNumberOfPixelTriplets() { auto nPixelTriplets_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nPixelTriplets_buf, pixelTripletsBuffers->nPixelTriplets_buf); @@ -1385,7 +1385,7 @@ int SDL::Event::getNumberOfPixelTriplets() { return nPixelTriplets; } -int SDL::Event::getNumberOfPixelQuintuplets() { +int SDL::Event::getNumberOfPixelQuintuplets() { auto nPixelQuintuplets_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nPixelQuintuplets_buf, pixelQuintupletsBuffers->nPixelQuintuplets_buf); @@ -1396,7 +1396,7 @@ int SDL::Event::getNumberOfPixelQuintuplets() { return nPixelQuintuplets; } -unsigned int SDL::Event::getNumberOfQuintuplets() { +unsigned int SDL::Event::getNumberOfQuintuplets() { unsigned int quintuplets = 0; for (auto& it : n_quintuplets_by_layer_barrel_) { quintuplets += it; @@ -1408,22 +1408,22 @@ unsigned int SDL::Event::getNumberOfQuintuplets() { return quintuplets; } -unsigned int SDL::Event::getNumberOfQuintupletsByLayer(unsigned int layer) { +unsigned int SDL::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 SDL::Event::getNumberOfQuintupletsByLayerBarrel(unsigned int layer) { +unsigned int SDL::Event::getNumberOfQuintupletsByLayerBarrel(unsigned int layer) { return n_quintuplets_by_layer_barrel_[layer]; } -unsigned int SDL::Event::getNumberOfQuintupletsByLayerEndcap(unsigned int layer) { +unsigned int SDL::Event::getNumberOfQuintupletsByLayerEndcap(unsigned int layer) { return n_quintuplets_by_layer_endcap_[layer]; } -int SDL::Event::getNumberOfTrackCandidates() { +int SDL::Event::getNumberOfTrackCandidates() { auto nTrackCandidates_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidates_buf, trackCandidatesBuffers->nTrackCandidates_buf); @@ -1434,7 +1434,7 @@ int SDL::Event::getNumberOfTrackCandidates() { return nTrackCandidates; } -int SDL::Event::getNumberOfPT5TrackCandidates() { +int SDL::Event::getNumberOfPT5TrackCandidates() { auto nTrackCandidatesPT5_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidatesPT5_buf, trackCandidatesBuffers->nTrackCandidatespT5_buf); @@ -1445,7 +1445,7 @@ int SDL::Event::getNumberOfPT5TrackCandidates() { return nTrackCandidatesPT5; } -int SDL::Event::getNumberOfPT3TrackCandidates() { +int SDL::Event::getNumberOfPT3TrackCandidates() { auto nTrackCandidatesPT3_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidatesPT3_buf, trackCandidatesBuffers->nTrackCandidatespT3_buf); @@ -1456,7 +1456,7 @@ int SDL::Event::getNumberOfPT3TrackCandidates() { return nTrackCandidatesPT3; } -int SDL::Event::getNumberOfPLSTrackCandidates() { +int SDL::Event::getNumberOfPLSTrackCandidates() { auto nTrackCandidatesPLS_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidatesPLS_buf, trackCandidatesBuffers->nTrackCandidatespLS_buf); @@ -1467,7 +1467,7 @@ int SDL::Event::getNumberOfPLSTrackCandidates() { return nTrackCandidatesPLS; } -int SDL::Event::getNumberOfPixelTrackCandidates() { +int SDL::Event::getNumberOfPixelTrackCandidates() { auto nTrackCandidates_buf = allocBufWrapper(devHost, 1, queue); auto nTrackCandidatesT5_buf = allocBufWrapper(devHost, 1, queue); @@ -1481,7 +1481,7 @@ int SDL::Event::getNumberOfPixelTrackCandidates() { return nTrackCandidates - nTrackCandidatesT5; } -int SDL::Event::getNumberOfT5TrackCandidates() { +int SDL::Event::getNumberOfT5TrackCandidates() { auto nTrackCandidatesT5_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nTrackCandidatesT5_buf, trackCandidatesBuffers->nTrackCandidatesT5_buf); @@ -1492,7 +1492,7 @@ int SDL::Event::getNumberOfT5TrackCandidates() { return nTrackCandidatesT5; } -SDL::hitsBuffer* SDL::Event::getHits() //std::shared_ptr should take care of garbage collection +SDL::hitsBuffer* SDL::Event::getHits() //std::shared_ptr should take care of garbage collection { if (hitsInCPU == nullptr) { auto nHits_buf = allocBufWrapper(devHost, 1, queue); @@ -1515,7 +1515,7 @@ SDL::hitsBuffer* SDL::Event::getHits() //std::shared_ptr shoul return hitsInCPU; } -SDL::hitsBuffer* SDL::Event::getHitsInCMSSW() { +SDL::hitsBuffer* SDL::Event::getHitsInCMSSW() { if (hitsInCPU == nullptr) { auto nHits_buf = allocBufWrapper(devHost, 1, queue); alpaka::memcpy(queue, nHits_buf, hitsBuffers->nHits_buf); @@ -1532,7 +1532,7 @@ SDL::hitsBuffer* SDL::Event::getHitsInCMSSW() { return hitsInCPU; } -SDL::objectRangesBuffer* SDL::Event::getRanges() { +SDL::objectRangesBuffer* SDL::Event::getRanges() { if (rangesInCPU == nullptr) { rangesInCPU = new SDL::objectRangesBuffer(nModules_, nLowerModules_, devHost, queue); rangesInCPU->setData(*rangesInCPU); @@ -1547,7 +1547,7 @@ SDL::objectRangesBuffer* SDL::Event::getRanges() { return rangesInCPU; } -SDL::miniDoubletsBuffer* SDL::Event::getMiniDoublets() { +SDL::miniDoubletsBuffer* SDL::Event::getMiniDoublets() { if (mdsInCPU == nullptr) { // Get nMemoryLocations parameter to initialize host based mdsInCPU auto nMemHost_buf = allocBufWrapper(devHost, 1, queue); @@ -1569,7 +1569,7 @@ SDL::miniDoubletsBuffer* SDL::Event::getMiniDoublets() { return mdsInCPU; } -SDL::segmentsBuffer* SDL::Event::getSegments() { +SDL::segmentsBuffer* SDL::Event::getSegments() { if (segmentsInCPU == nullptr) { // Get nMemoryLocations parameter to initialize host based segmentsInCPU auto nMemHost_buf = allocBufWrapper(devHost, 1, queue); @@ -1605,7 +1605,7 @@ SDL::segmentsBuffer* SDL::Event::getSegments() { return segmentsInCPU; } -SDL::tripletsBuffer* SDL::Event::getTriplets() { +SDL::tripletsBuffer* SDL::Event::getTriplets() { if (tripletsInCPU == nullptr) { // Get nMemoryLocations parameter to initialize host based tripletsInCPU auto nMemHost_buf = allocBufWrapper(devHost, 1, queue); @@ -1641,7 +1641,7 @@ SDL::tripletsBuffer* SDL::Event::getTriplets() { return tripletsInCPU; } -SDL::quintupletsBuffer* SDL::Event::getQuintuplets() { +SDL::quintupletsBuffer* SDL::Event::getQuintuplets() { if (quintupletsInCPU == nullptr) { // Get nMemoryLocations parameter to initialize host based quintupletsInCPU auto nMemHost_buf = allocBufWrapper(devHost, 1, queue); @@ -1677,7 +1677,7 @@ SDL::quintupletsBuffer* SDL::Event::getQuintuplets() { return quintupletsInCPU; } -SDL::pixelTripletsBuffer* SDL::Event::getPixelTriplets() { +SDL::pixelTripletsBuffer* SDL::Event::getPixelTriplets() { if (pixelTripletsInCPU == nullptr) { // Get nPixelTriplets parameter to initialize host based quintupletsInCPU auto nPixelTriplets_buf = allocBufWrapper(devHost, 1, queue); @@ -1716,7 +1716,7 @@ SDL::pixelTripletsBuffer* SDL::Event::getPixelTriplets() { return pixelTripletsInCPU; } -SDL::pixelQuintupletsBuffer* SDL::Event::getPixelQuintuplets() { +SDL::pixelQuintupletsBuffer* SDL::Event::getPixelQuintuplets() { if (pixelQuintupletsInCPU == nullptr) { // Get nPixelQuintuplets parameter to initialize host based quintupletsInCPU auto nPixelQuintuplets_buf = allocBufWrapper(devHost, 1, queue); @@ -1752,7 +1752,7 @@ SDL::pixelQuintupletsBuffer* SDL::Event::getPixelQuintuplets() return pixelQuintupletsInCPU; } -SDL::trackCandidatesBuffer* SDL::Event::getTrackCandidates() { +SDL::trackCandidatesBuffer* SDL::Event::getTrackCandidates() { if (trackCandidatesInCPU == nullptr) { // Get nTrackCanHost parameter to initialize host based trackCandidatesInCPU auto nTrackCanHost_buf = allocBufWrapper(devHost, 1, queue); @@ -1790,7 +1790,7 @@ SDL::trackCandidatesBuffer* SDL::Event::getTrackCandidates() { return trackCandidatesInCPU; } -SDL::trackCandidatesBuffer* SDL::Event::getTrackCandidatesInCMSSW() { +SDL::trackCandidatesBuffer* SDL::Event::getTrackCandidatesInCMSSW() { if (trackCandidatesInCPU == nullptr) { // Get nTrackCanHost parameter to initialize host based trackCandidatesInCPU auto nTrackCanHost_buf = allocBufWrapper(devHost, 1, queue); @@ -1818,7 +1818,7 @@ SDL::trackCandidatesBuffer* SDL::Event::getTrackCandidatesInCMS return trackCandidatesInCPU; } -SDL::modulesBuffer* SDL::Event::getModules(bool isFull) { +SDL::modulesBuffer* SDL::Event::getModules(bool isFull) { if (modulesInCPU == nullptr) { // The last input here is just a small placeholder for the allocation. modulesInCPU = new SDL::modulesBuffer(devHost, nModules_, nPixels_); diff --git a/RecoTracker/LSTCore/src/alpaka/Event.h b/RecoTracker/LSTCore/src/alpaka/Event.h index eeba434b503c0..3c8dea32612af 100644 --- a/RecoTracker/LSTCore/src/alpaka/Event.h +++ b/RecoTracker/LSTCore/src/alpaka/Event.h @@ -18,15 +18,17 @@ namespace SDL { - template + using namespace ALPAKA_ACCELERATOR_NAMESPACE; + + template class Event; template <> - class Event { + class Event { private: - ALPAKA_ACCELERATOR_NAMESPACE::Queue queue; - ALPAKA_ACCELERATOR_NAMESPACE::Device devAcc; - alpaka_common::DevHost devHost; + Queue queue; + Device devAcc; + DevHost devHost; bool addObjects; std::array n_hits_by_layer_barrel_; @@ -45,35 +47,35 @@ namespace SDL { //Device stuff unsigned int nTotalSegments; struct objectRanges* rangesInGPU; - struct objectRangesBuffer* rangesBuffers; + struct objectRangesBuffer* rangesBuffers; struct hits* hitsInGPU; - struct hitsBuffer* hitsBuffers; + struct hitsBuffer* hitsBuffers; struct miniDoublets* mdsInGPU; - struct miniDoubletsBuffer* miniDoubletsBuffers; + struct miniDoubletsBuffer* miniDoubletsBuffers; struct segments* segmentsInGPU; - struct segmentsBuffer* segmentsBuffers; + struct segmentsBuffer* segmentsBuffers; struct triplets* tripletsInGPU; - struct tripletsBuffer* tripletsBuffers; + struct tripletsBuffer* tripletsBuffers; struct quintuplets* quintupletsInGPU; - struct quintupletsBuffer* quintupletsBuffers; + struct quintupletsBuffer* quintupletsBuffers; struct trackCandidates* trackCandidatesInGPU; - struct trackCandidatesBuffer* trackCandidatesBuffers; + struct trackCandidatesBuffer* trackCandidatesBuffers; struct pixelTriplets* pixelTripletsInGPU; - struct pixelTripletsBuffer* pixelTripletsBuffers; + struct pixelTripletsBuffer* pixelTripletsBuffers; struct pixelQuintuplets* pixelQuintupletsInGPU; - struct pixelQuintupletsBuffer* pixelQuintupletsBuffers; + struct pixelQuintupletsBuffer* pixelQuintupletsBuffers; //CPU interface stuff - objectRangesBuffer* rangesInCPU; - hitsBuffer* hitsInCPU; - miniDoubletsBuffer* mdsInCPU; - segmentsBuffer* segmentsInCPU; - tripletsBuffer* tripletsInCPU; - trackCandidatesBuffer* trackCandidatesInCPU; - modulesBuffer* modulesInCPU; - quintupletsBuffer* quintupletsInCPU; - pixelTripletsBuffer* pixelTripletsInCPU; - pixelQuintupletsBuffer* pixelQuintupletsInCPU; + objectRangesBuffer* rangesInCPU; + hitsBuffer* hitsInCPU; + miniDoubletsBuffer* mdsInCPU; + segmentsBuffer* segmentsInCPU; + tripletsBuffer* tripletsInCPU; + trackCandidatesBuffer* trackCandidatesInCPU; + modulesBuffer* modulesInCPU; + quintupletsBuffer* quintupletsInCPU; + pixelTripletsBuffer* pixelTripletsInCPU; + pixelQuintupletsBuffer* pixelQuintupletsInCPU; void init(bool verbose); @@ -85,14 +87,14 @@ namespace SDL { const uint16_t nLowerModules_; const unsigned int nPixels_; const unsigned int nEndCapMap_; - const std::shared_ptr> modulesBuffers_; + const std::shared_ptr> modulesBuffers_; const std::shared_ptr pixelMapping_; - const std::shared_ptr> endcapGeometryBuffers_; + const std::shared_ptr> endcapGeometryBuffers_; public: // Constructor used for CMSSW integration. Uses an external queue. template - Event(bool verbose, TQueue const& q, const LSTESData* deviceESData) + Event(bool verbose, TQueue const& q, const LSTESData* deviceESData) : queue(q), devAcc(alpaka::getDev(q)), devHost(cms::alpakatools::host()), @@ -186,18 +188,18 @@ namespace SDL { int getNumberOfPixelTriplets(); int getNumberOfPixelQuintuplets(); - objectRangesBuffer* getRanges(); - hitsBuffer* getHits(); - hitsBuffer* getHitsInCMSSW(); - miniDoubletsBuffer* getMiniDoublets(); - segmentsBuffer* getSegments(); - tripletsBuffer* getTriplets(); - quintupletsBuffer* getQuintuplets(); - trackCandidatesBuffer* getTrackCandidates(); - trackCandidatesBuffer* getTrackCandidatesInCMSSW(); - pixelTripletsBuffer* getPixelTriplets(); - pixelQuintupletsBuffer* getPixelQuintuplets(); - modulesBuffer* getModules(bool isFull = false); + objectRangesBuffer* getRanges(); + hitsBuffer* getHits(); + hitsBuffer* getHitsInCMSSW(); + miniDoubletsBuffer* getMiniDoublets(); + segmentsBuffer* getSegments(); + tripletsBuffer* getTriplets(); + quintupletsBuffer* getQuintuplets(); + trackCandidatesBuffer* getTrackCandidates(); + trackCandidatesBuffer* getTrackCandidatesInCMSSW(); + pixelTripletsBuffer* getPixelTriplets(); + pixelQuintupletsBuffer* getPixelQuintuplets(); + modulesBuffer* getModules(bool isFull = false); }; } // namespace SDL diff --git a/RecoTracker/LSTCore/src/alpaka/LST.dev.cc b/RecoTracker/LSTCore/src/alpaka/LST.dev.cc index 27b0fb49e1cd9..1d8700ce7be9e 100644 --- a/RecoTracker/LSTCore/src/alpaka/LST.dev.cc +++ b/RecoTracker/LSTCore/src/alpaka/LST.dev.cc @@ -20,7 +20,7 @@ namespace { } // namespace template <> -void SDL::LST::prepareInput(const std::vector see_px, +void SDL::LST::prepareInput(const std::vector see_px, const std::vector see_py, const std::vector see_pz, const std::vector see_dxy, @@ -213,7 +213,7 @@ void SDL::LST::prepareInput(const std::vector see_px, } template <> -std::vector SDL::LST::getHitIdxs(const short trackCandidateType, +std::vector SDL::LST::getHitIdxs(const short trackCandidateType, const unsigned int TCIdx, const unsigned int* TCHitIndices, const unsigned int* hitIndices) { @@ -249,7 +249,7 @@ std::vector SDL::LST::getHitIdxs(const short trackCandidat } template <> -void SDL::LST::getOutput(SDL::Event& event) { +void SDL::LST::getOutput(SDL::Event& event) { std::vector> tc_hitIdxs; std::vector tc_len; std::vector tc_seedIdx; @@ -278,7 +278,7 @@ void SDL::LST::getOutput(SDL::Event& event) { template <> template <> -void SDL::LST::run(Queue& queue, +void SDL::LST::run(Queue& queue, bool verbose, const LSTESData* deviceESData, const std::vector see_px, @@ -302,7 +302,7 @@ void SDL::LST::run(Queue& queue, const std::vector ph2_z, bool no_pls_dupclean, bool tc_pls_triplets) { - auto event = SDL::Event(verbose, queue, deviceESData); + auto event = SDL::Event(verbose, queue, deviceESData); prepareInput(see_px, see_py, see_pz, diff --git a/RecoTracker/LSTCore/standalone/bin/sdl.cc b/RecoTracker/LSTCore/standalone/bin/sdl.cc index eab52b42645dd..498b58ea8731a 100644 --- a/RecoTracker/LSTCore/standalone/bin/sdl.cc +++ b/RecoTracker/LSTCore/standalone/bin/sdl.cc @@ -384,9 +384,9 @@ void run_sdl() { full_timer.Reset(); full_timer.Start(); - std::vector *> events; + std::vector *> events; for (int s = 0; s < ana.streams; s++) { - SDL::Event *event = new SDL::Event(ana.verbose >= 2, queues[s], &deviceESData); + SDL::Event *event = new SDL::Event(ana.verbose >= 2, queues[s], &deviceESData); events.push_back(event); } float timeForEventCreation = full_timer.RealTime() * 1000; diff --git a/RecoTracker/LSTCore/standalone/code/core/AccessHelper.cc b/RecoTracker/LSTCore/standalone/code/core/AccessHelper.cc index debebfb128859..55080b6857d37 100644 --- a/RecoTracker/LSTCore/standalone/code/core/AccessHelper.cc +++ b/RecoTracker/LSTCore/standalone/code/core/AccessHelper.cc @@ -8,7 +8,7 @@ using namespace ALPAKA_ACCELERATOR_NAMESPACE; //____________________________________________________________________________________________ std::tuple, std::vector> convertHitsToHitIdxsAndHitTypes( - SDL::Event* event, std::vector hits) { + SDL::Event* event, std::vector hits) { SDL::hitsBuffer& hitsInGPU = *(event->getHits()); std::vector hitidxs; std::vector hittypes; @@ -27,7 +27,7 @@ std::tuple, std::vector> convertHitsToHi // =============== //____________________________________________________________________________________________ -std::vector getPixelHitsFrompLS(SDL::Event* event, unsigned int pLS) { +std::vector getPixelHitsFrompLS(SDL::Event* event, unsigned int pLS) { SDL::segmentsBuffer& segments_ = *(event->getSegments()); SDL::miniDoubletsBuffer& miniDoublets_ = *(event->getMiniDoublets()); SDL::objectRangesBuffer& rangesInGPU = (*event->getRanges()); @@ -46,7 +46,7 @@ std::vector getPixelHitsFrompLS(SDL::Event* event, unsigne } //____________________________________________________________________________________________ -std::vector getPixelHitIdxsFrompLS(SDL::Event* event, unsigned int pLS) { +std::vector getPixelHitIdxsFrompLS(SDL::Event* event, unsigned int pLS) { SDL::hitsBuffer& hitsInGPU = *(event->getHits()); std::vector hits = getPixelHitsFrompLS(event, pLS); std::vector hitidxs; @@ -56,14 +56,14 @@ std::vector getPixelHitIdxsFrompLS(SDL::Event* event, unsi } //____________________________________________________________________________________________ -std::vector getPixelHitTypesFrompLS(SDL::Event* event, unsigned int pLS) { +std::vector getPixelHitTypesFrompLS(SDL::Event* event, unsigned int pLS) { std::vector hits = getPixelHitsFrompLS(event, pLS); std::vector hittypes(hits.size(), 0); return hittypes; } //____________________________________________________________________________________________ -std::tuple, std::vector> getHitIdxsAndHitTypesFrompLS(SDL::Event* event, +std::tuple, std::vector> getHitIdxsAndHitTypesFrompLS(SDL::Event* event, unsigned pLS) { return convertHitsToHitIdxsAndHitTypes(event, getPixelHitsFrompLS(event, pLS)); } @@ -73,7 +73,7 @@ std::tuple, std::vector> getHitIdxsAndHi // ============== //____________________________________________________________________________________________ -std::vector getHitsFromMD(SDL::Event* event, unsigned int MD) { +std::vector getHitsFromMD(SDL::Event* event, unsigned int MD) { SDL::miniDoubletsBuffer& miniDoublets_ = *(event->getMiniDoublets()); unsigned int hit_1 = miniDoublets_.anchorHitIndices[MD]; unsigned int hit_2 = miniDoublets_.outerHitIndices[MD]; @@ -81,7 +81,7 @@ std::vector getHitsFromMD(SDL::Event* event, unsigned int } //____________________________________________________________________________________________ -std::tuple, std::vector> getHitIdxsAndHitTypesFromMD(SDL::Event* event, +std::tuple, std::vector> getHitIdxsAndHitTypesFromMD(SDL::Event* event, unsigned MD) { return convertHitsToHitIdxsAndHitTypes(event, getHitsFromMD(event, MD)); } @@ -91,7 +91,7 @@ std::tuple, std::vector> getHitIdxsAndHi // ============== //____________________________________________________________________________________________ -std::vector getMDsFromLS(SDL::Event* event, unsigned int LS) { +std::vector getMDsFromLS(SDL::Event* event, unsigned int LS) { SDL::segmentsBuffer& segments_ = *(event->getSegments()); unsigned int MD_1 = segments_.mdIndices[2 * LS]; unsigned int MD_2 = segments_.mdIndices[2 * LS + 1]; @@ -99,7 +99,7 @@ std::vector getMDsFromLS(SDL::Event* event, unsigned int L } //____________________________________________________________________________________________ -std::vector getHitsFromLS(SDL::Event* event, unsigned int LS) { +std::vector getHitsFromLS(SDL::Event* event, unsigned int LS) { std::vector MDs = getMDsFromLS(event, LS); std::vector hits_0 = getHitsFromMD(event, MDs[0]); std::vector hits_1 = getHitsFromMD(event, MDs[1]); @@ -107,7 +107,7 @@ std::vector getHitsFromLS(SDL::Event* event, unsigned int } //____________________________________________________________________________________________ -std::tuple, std::vector> getHitIdxsAndHitTypesFromLS(SDL::Event* event, +std::tuple, std::vector> getHitIdxsAndHitTypesFromLS(SDL::Event* event, unsigned LS) { return convertHitsToHitIdxsAndHitTypes(event, getHitsFromLS(event, LS)); } @@ -117,7 +117,7 @@ std::tuple, std::vector> getHitIdxsAndHi // ============== //____________________________________________________________________________________________ -std::vector getLSsFromT3(SDL::Event* event, unsigned int T3) { +std::vector getLSsFromT3(SDL::Event* event, unsigned int T3) { SDL::tripletsBuffer& triplets_ = *(event->getTriplets()); unsigned int LS_1 = triplets_.segmentIndices[2 * T3]; unsigned int LS_2 = triplets_.segmentIndices[2 * T3 + 1]; @@ -125,7 +125,7 @@ std::vector getLSsFromT3(SDL::Event* event, unsigned int T } //____________________________________________________________________________________________ -std::vector getMDsFromT3(SDL::Event* event, unsigned int T3) { +std::vector getMDsFromT3(SDL::Event* event, unsigned int T3) { std::vector LSs = getLSsFromT3(event, T3); std::vector MDs_0 = getMDsFromLS(event, LSs[0]); std::vector MDs_1 = getMDsFromLS(event, LSs[1]); @@ -133,7 +133,7 @@ std::vector getMDsFromT3(SDL::Event* event, unsigned int T } //____________________________________________________________________________________________ -std::vector getHitsFromT3(SDL::Event* event, unsigned int T3) { +std::vector getHitsFromT3(SDL::Event* event, unsigned int T3) { std::vector MDs = getMDsFromT3(event, T3); std::vector hits_0 = getHitsFromMD(event, MDs[0]); std::vector hits_1 = getHitsFromMD(event, MDs[1]); @@ -142,7 +142,7 @@ std::vector getHitsFromT3(SDL::Event* event, unsigned int } //____________________________________________________________________________________________ -std::tuple, std::vector> getHitIdxsAndHitTypesFromT3(SDL::Event* event, +std::tuple, std::vector> getHitIdxsAndHitTypesFromT3(SDL::Event* event, unsigned T3) { return convertHitsToHitIdxsAndHitTypes(event, getHitsFromT3(event, T3)); } @@ -152,7 +152,7 @@ std::tuple, std::vector> getHitIdxsAndHi // ============== //____________________________________________________________________________________________ -std::vector getT3sFromT5(SDL::Event* event, unsigned int T5) { +std::vector getT3sFromT5(SDL::Event* event, unsigned int T5) { SDL::quintupletsBuffer& quintuplets_ = *(event->getQuintuplets()); unsigned int T3_1 = quintuplets_.tripletIndices[2 * T5]; unsigned int T3_2 = quintuplets_.tripletIndices[2 * T5 + 1]; @@ -160,7 +160,7 @@ std::vector getT3sFromT5(SDL::Event* event, unsigned int T } //____________________________________________________________________________________________ -std::vector getLSsFromT5(SDL::Event* event, unsigned int T5) { +std::vector getLSsFromT5(SDL::Event* event, unsigned int T5) { std::vector T3s = getT3sFromT5(event, T5); std::vector LSs_0 = getLSsFromT3(event, T3s[0]); std::vector LSs_1 = getLSsFromT3(event, T3s[1]); @@ -168,7 +168,7 @@ std::vector getLSsFromT5(SDL::Event* event, unsigned int T } //____________________________________________________________________________________________ -std::vector getMDsFromT5(SDL::Event* event, unsigned int T5) { +std::vector getMDsFromT5(SDL::Event* event, unsigned int T5) { std::vector LSs = getLSsFromT5(event, T5); std::vector MDs_0 = getMDsFromLS(event, LSs[0]); std::vector MDs_1 = getMDsFromLS(event, LSs[1]); @@ -178,7 +178,7 @@ std::vector getMDsFromT5(SDL::Event* event, unsigned int T } //____________________________________________________________________________________________ -std::vector getHitsFromT5(SDL::Event* event, unsigned int T5) { +std::vector getHitsFromT5(SDL::Event* event, unsigned int T5) { std::vector MDs = getMDsFromT5(event, T5); std::vector hits_0 = getHitsFromMD(event, MDs[0]); std::vector hits_1 = getHitsFromMD(event, MDs[1]); @@ -189,7 +189,7 @@ std::vector getHitsFromT5(SDL::Event* event, unsigned int } //____________________________________________________________________________________________ -std::vector getHitIdxsFromT5(SDL::Event* event, unsigned int T5) { +std::vector getHitIdxsFromT5(SDL::Event* event, unsigned int T5) { SDL::hitsBuffer& hitsInGPU = *(event->getHits()); std::vector hits = getHitsFromT5(event, T5); std::vector hitidxs; @@ -198,7 +198,7 @@ std::vector getHitIdxsFromT5(SDL::Event* event, unsigned i return hitidxs; } //____________________________________________________________________________________________ -std::vector getModuleIdxsFromT5(SDL::Event* event, unsigned int T5) { +std::vector getModuleIdxsFromT5(SDL::Event* event, unsigned int T5) { std::vector hits = getHitsFromT5(event, T5); std::vector module_idxs; SDL::hitsBuffer& hitsInGPU = *(event->getHits()); @@ -208,13 +208,13 @@ std::vector getModuleIdxsFromT5(SDL::Event* event, unsigne return module_idxs; } //____________________________________________________________________________________________ -std::vector getHitTypesFromT5(SDL::Event* event, unsigned int T5) { +std::vector getHitTypesFromT5(SDL::Event* event, unsigned int T5) { return {4, 4, 4, 4, 4, 4, 4, 4, 4, 4}; ; } //____________________________________________________________________________________________ -std::tuple, std::vector> getHitIdxsAndHitTypesFromT5(SDL::Event* event, +std::tuple, std::vector> getHitIdxsAndHitTypesFromT5(SDL::Event* event, unsigned T5) { return convertHitsToHitIdxsAndHitTypes(event, getHitsFromT5(event, T5)); } @@ -224,7 +224,7 @@ std::tuple, std::vector> getHitIdxsAndHi // =============== //____________________________________________________________________________________________ -unsigned int getPixelLSFrompT3(SDL::Event* event, unsigned int pT3) { +unsigned int getPixelLSFrompT3(SDL::Event* event, unsigned int pT3) { SDL::pixelTripletsBuffer& pixelTriplets_ = *(event->getPixelTriplets()); SDL::objectRangesBuffer& rangesInGPU = (*event->getRanges()); SDL::modulesBuffer& modulesInGPU = (*event->getModules()); @@ -233,37 +233,37 @@ unsigned int getPixelLSFrompT3(SDL::Event* event, unsigned int pT3) { } //____________________________________________________________________________________________ -unsigned int getT3FrompT3(SDL::Event* event, unsigned int pT3) { +unsigned int getT3FrompT3(SDL::Event* event, unsigned int pT3) { SDL::pixelTriplets& pixelTriplets_ = *(event->getPixelTriplets()); return pixelTriplets_.tripletIndices[pT3]; } //____________________________________________________________________________________________ -std::vector getLSsFrompT3(SDL::Event* event, unsigned int pT3) { +std::vector getLSsFrompT3(SDL::Event* event, unsigned int pT3) { unsigned int T3 = getT3FrompT3(event, pT3); return getLSsFromT3(event, T3); } //____________________________________________________________________________________________ -std::vector getMDsFrompT3(SDL::Event* event, unsigned int pT3) { +std::vector getMDsFrompT3(SDL::Event* event, unsigned int pT3) { unsigned int T3 = getT3FrompT3(event, pT3); return getMDsFromT3(event, T3); } //____________________________________________________________________________________________ -std::vector getOuterTrackerHitsFrompT3(SDL::Event* event, unsigned int pT3) { +std::vector getOuterTrackerHitsFrompT3(SDL::Event* event, unsigned int pT3) { unsigned int T3 = getT3FrompT3(event, pT3); return getHitsFromT3(event, T3); } //____________________________________________________________________________________________ -std::vector getPixelHitsFrompT3(SDL::Event* event, unsigned int pT3) { +std::vector getPixelHitsFrompT3(SDL::Event* event, unsigned int pT3) { unsigned int pLS = getPixelLSFrompT3(event, pT3); return getPixelHitsFrompLS(event, pLS); } //____________________________________________________________________________________________ -std::vector getHitsFrompT3(SDL::Event* event, unsigned int pT3) { +std::vector getHitsFrompT3(SDL::Event* event, unsigned int pT3) { unsigned int pLS = getPixelLSFrompT3(event, pT3); unsigned int T3 = getT3FrompT3(event, pT3); std::vector pixelHits = getPixelHitsFrompLS(event, pLS); @@ -273,7 +273,7 @@ std::vector getHitsFrompT3(SDL::Event* event, unsigned int } //____________________________________________________________________________________________ -std::vector getHitIdxsFrompT3(SDL::Event* event, unsigned int pT3) { +std::vector getHitIdxsFrompT3(SDL::Event* event, unsigned int pT3) { SDL::hitsBuffer& hitsInGPU = *(event->getHits()); std::vector hits = getHitsFrompT3(event, pT3); std::vector hitidxs; @@ -282,7 +282,7 @@ std::vector getHitIdxsFrompT3(SDL::Event* event, unsigned return hitidxs; } //____________________________________________________________________________________________ -std::vector getModuleIdxsFrompT3(SDL::Event* event, unsigned int pT3) { +std::vector getModuleIdxsFrompT3(SDL::Event* event, unsigned int pT3) { std::vector hits = getOuterTrackerHitsFrompT3(event, pT3); std::vector module_idxs; SDL::hitsBuffer& hitsInGPU = *(event->getHits()); @@ -292,7 +292,7 @@ std::vector getModuleIdxsFrompT3(SDL::Event* event, unsign return module_idxs; } //____________________________________________________________________________________________ -std::vector getHitTypesFrompT3(SDL::Event* event, unsigned int pT3) { +std::vector getHitTypesFrompT3(SDL::Event* event, unsigned int pT3) { unsigned int pLS = getPixelLSFrompT3(event, pT3); std::vector pixelHits = getPixelHitsFrompLS(event, pLS); // pixel Hits list will be either 3 or 4 and depending on it return accordingly @@ -303,7 +303,7 @@ std::vector getHitTypesFrompT3(SDL::Event* event, unsigned } //____________________________________________________________________________________________ -std::tuple, std::vector> getHitIdxsAndHitTypesFrompT3(SDL::Event* event, +std::tuple, std::vector> getHitIdxsAndHitTypesFrompT3(SDL::Event* event, unsigned pT3) { return convertHitsToHitIdxsAndHitTypes(event, getHitsFrompT3(event, pT3)); } @@ -313,7 +313,7 @@ std::tuple, std::vector> getHitIdxsAndHi // =============== //____________________________________________________________________________________________ -unsigned int getPixelLSFrompT5(SDL::Event* event, unsigned int pT5) { +unsigned int getPixelLSFrompT5(SDL::Event* event, unsigned int pT5) { SDL::pixelQuintupletsBuffer& pixelQuintuplets_ = *(event->getPixelQuintuplets()); SDL::objectRangesBuffer& rangesInGPU = (*event->getRanges()); SDL::modulesBuffer& modulesInGPU = (*event->getModules()); @@ -322,43 +322,43 @@ unsigned int getPixelLSFrompT5(SDL::Event* event, unsigned int pT5) { } //____________________________________________________________________________________________ -unsigned int getT5FrompT5(SDL::Event* event, unsigned int pT5) { +unsigned int getT5FrompT5(SDL::Event* event, unsigned int pT5) { SDL::pixelQuintupletsBuffer& pixelQuintuplets_ = *(event->getPixelQuintuplets()); return pixelQuintuplets_.T5Indices[pT5]; } //____________________________________________________________________________________________ -std::vector getT3sFrompT5(SDL::Event* event, unsigned int pT5) { +std::vector getT3sFrompT5(SDL::Event* event, unsigned int pT5) { unsigned int T5 = getT5FrompT5(event, pT5); return getT3sFromT5(event, T5); } //____________________________________________________________________________________________ -std::vector getLSsFrompT5(SDL::Event* event, unsigned int pT5) { +std::vector getLSsFrompT5(SDL::Event* event, unsigned int pT5) { unsigned int T5 = getT5FrompT5(event, pT5); return getLSsFromT5(event, T5); } //____________________________________________________________________________________________ -std::vector getMDsFrompT5(SDL::Event* event, unsigned int pT5) { +std::vector getMDsFrompT5(SDL::Event* event, unsigned int pT5) { unsigned int T5 = getT5FrompT5(event, pT5); return getMDsFromT5(event, T5); } //____________________________________________________________________________________________ -std::vector getOuterTrackerHitsFrompT5(SDL::Event* event, unsigned int pT5) { +std::vector getOuterTrackerHitsFrompT5(SDL::Event* event, unsigned int pT5) { unsigned int T5 = getT5FrompT5(event, pT5); return getHitsFromT5(event, T5); } //____________________________________________________________________________________________ -std::vector getPixelHitsFrompT5(SDL::Event* event, unsigned int pT5) { +std::vector getPixelHitsFrompT5(SDL::Event* event, unsigned int pT5) { unsigned int pLS = getPixelLSFrompT5(event, pT5); return getPixelHitsFrompLS(event, pLS); } //____________________________________________________________________________________________ -std::vector getHitsFrompT5(SDL::Event* event, unsigned int pT5) { +std::vector getHitsFrompT5(SDL::Event* event, unsigned int pT5) { unsigned int pLS = getPixelLSFrompT5(event, pT5); unsigned int T5 = getT5FrompT5(event, pT5); std::vector pixelHits = getPixelHitsFrompLS(event, pLS); @@ -368,7 +368,7 @@ std::vector getHitsFrompT5(SDL::Event* event, unsigned int } //____________________________________________________________________________________________ -std::vector getHitIdxsFrompT5(SDL::Event* event, unsigned int pT5) { +std::vector getHitIdxsFrompT5(SDL::Event* event, unsigned int pT5) { SDL::hitsBuffer& hitsInGPU = *(event->getHits()); std::vector hits = getHitsFrompT5(event, pT5); std::vector hitidxs; @@ -378,7 +378,7 @@ std::vector getHitIdxsFrompT5(SDL::Event* event, unsigned } //____________________________________________________________________________________________ -std::vector getModuleIdxsFrompT5(SDL::Event* event, unsigned int pT5) { +std::vector getModuleIdxsFrompT5(SDL::Event* event, unsigned int pT5) { std::vector hits = getOuterTrackerHitsFrompT5(event, pT5); std::vector module_idxs; SDL::hitsBuffer& hitsInGPU = *(event->getHits()); @@ -389,7 +389,7 @@ std::vector getModuleIdxsFrompT5(SDL::Event* event, unsign } //____________________________________________________________________________________________ -std::vector getHitTypesFrompT5(SDL::Event* event, unsigned int pT5) { +std::vector getHitTypesFrompT5(SDL::Event* event, unsigned int pT5) { unsigned int pLS = getPixelLSFrompT5(event, pT5); std::vector pixelHits = getPixelHitsFrompLS(event, pLS); // pixel Hits list will be either 3 or 4 and depending on it return accordingly @@ -400,7 +400,7 @@ std::vector getHitTypesFrompT5(SDL::Event* event, unsigned } //____________________________________________________________________________________________ -std::tuple, std::vector> getHitIdxsAndHitTypesFrompT5(SDL::Event* event, +std::tuple, std::vector> getHitIdxsAndHitTypesFrompT5(SDL::Event* event, unsigned pT5) { return convertHitsToHitIdxsAndHitTypes(event, getHitsFrompT5(event, pT5)); } @@ -410,7 +410,7 @@ std::tuple, std::vector> getHitIdxsAndHi // ============== //____________________________________________________________________________________________ -std::vector getLSsFromTC(SDL::Event* event, unsigned int TC) { +std::vector getLSsFromTC(SDL::Event* event, unsigned int TC) { // Get the type of the track candidate SDL::trackCandidatesBuffer& trackCandidatesInGPU = (*event->getTrackCandidates()); short type = trackCandidatesInGPU.trackCandidateType[TC]; @@ -432,7 +432,7 @@ std::vector getLSsFromTC(SDL::Event* event, unsigned int T } //____________________________________________________________________________________________ -std::tuple, std::vector> getHitIdxsAndHitTypesFromTC(SDL::Event* event, +std::tuple, std::vector> getHitIdxsAndHitTypesFromTC(SDL::Event* event, unsigned TC) { // Get the type of the track candidate SDL::trackCandidatesBuffer& trackCandidatesInGPU = (*event->getTrackCandidates()); diff --git a/RecoTracker/LSTCore/standalone/code/core/AccessHelper.h b/RecoTracker/LSTCore/standalone/code/core/AccessHelper.h index d72edd669fb51..e970462872218 100644 --- a/RecoTracker/LSTCore/standalone/code/core/AccessHelper.h +++ b/RecoTracker/LSTCore/standalone/code/core/AccessHelper.h @@ -5,90 +5,92 @@ #include #include "Event.h" +using SDLEvent = SDL::Event; + enum { kpT5 = 7, kpT3 = 5, kT5 = 4, kpLS = 8 }; // ----* Hit *---- std::tuple, std::vector> convertHitsToHitIdxsAndHitTypes( - SDL::Event* event, std::vector hits); + SDLEvent* event, std::vector hits); // ----* pLS *---- -std::vector getPixelHitsFrompLS(SDL::Event* event, +std::vector getPixelHitsFrompLS(SDLEvent* event, unsigned int pLS); -std::vector getPixelHitIdxsFrompLS(SDL::Event* event, +std::vector getPixelHitIdxsFrompLS(SDLEvent* event, unsigned int pLS); -std::vector getPixelHitTypesFrompLS(SDL::Event* event, +std::vector getPixelHitTypesFrompLS(SDLEvent* event, unsigned int pLS); std::tuple, std::vector> getHitIdxsAndHitTypesFrompLS( - SDL::Event* event, unsigned pLS); + SDLEvent* event, unsigned pLS); // ----* MD *---- -std::vector getHitsFromMD(SDL::Event* event, unsigned int MD); +std::vector getHitsFromMD(SDLEvent* event, unsigned int MD); std::tuple, std::vector> getHitIdxsAndHitTypesFromMD( - SDL::Event* event, unsigned MD); + SDLEvent* event, unsigned MD); // ----* LS *---- -std::vector getMDsFromLS(SDL::Event* event, unsigned int LS); -std::vector getHitsFromLS(SDL::Event* event, unsigned int LS); +std::vector getMDsFromLS(SDLEvent* event, unsigned int LS); +std::vector getHitsFromLS(SDLEvent* event, unsigned int LS); std::tuple, std::vector> getHitIdxsAndHitTypesFromLS( - SDL::Event* event, unsigned LS); + SDLEvent* event, unsigned LS); // ----* T3 *---- -std::vector getLSsFromT3(SDL::Event* event, unsigned int T3); -std::vector getMDsFromT3(SDL::Event* event, unsigned int T3); -std::vector getHitsFromT3(SDL::Event* event, unsigned int T3); +std::vector getLSsFromT3(SDLEvent* event, unsigned int T3); +std::vector getMDsFromT3(SDLEvent* event, unsigned int T3); +std::vector getHitsFromT3(SDLEvent* event, unsigned int T3); std::tuple, std::vector> getHitIdxsAndHitTypesFromT3( - SDL::Event* event, unsigned T3); + SDLEvent* event, unsigned T3); // ----* T5 *---- -std::vector getT3sFromT5(SDL::Event* event, unsigned int T5); -std::vector getLSsFromT5(SDL::Event* event, unsigned int T5); -std::vector getMDsFromT5(SDL::Event* event, unsigned int T5); -std::vector getHitsFromT5(SDL::Event* event, unsigned int T5); -std::vector getHitIdxsFromT5(SDL::Event* event, unsigned int T5); -std::vector getHitTypesFromT5(SDL::Event* event, unsigned int T5); -std::vector getModuleIdxsFromT5(SDL::Event* event, unsigned int T5); +std::vector getT3sFromT5(SDLEvent* event, unsigned int T5); +std::vector getLSsFromT5(SDLEvent* event, unsigned int T5); +std::vector getMDsFromT5(SDLEvent* event, unsigned int T5); +std::vector getHitsFromT5(SDLEvent* event, unsigned int T5); +std::vector getHitIdxsFromT5(SDLEvent* event, unsigned int T5); +std::vector getHitTypesFromT5(SDLEvent* event, unsigned int T5); +std::vector getModuleIdxsFromT5(SDLEvent* event, unsigned int T5); std::tuple, std::vector> getHitIdxsAndHitTypesFromT5( - SDL::Event* event, unsigned T5); + SDLEvent* event, unsigned T5); // ----* pT3 *---- -unsigned int getPixelLSFrompT3(SDL::Event* event, unsigned int pT3); -unsigned int getT3FrompT3(SDL::Event* event, unsigned int pT3); -std::vector getLSsFrompT3(SDL::Event* event, unsigned int pT3); -std::vector getMDsFrompT3(SDL::Event* event, unsigned int pT3); -std::vector getOuterTrackerHitsFrompT3(SDL::Event* event, +unsigned int getPixelLSFrompT3(SDLEvent* event, unsigned int pT3); +unsigned int getT3FrompT3(SDLEvent* event, unsigned int pT3); +std::vector getLSsFrompT3(SDLEvent* event, unsigned int pT3); +std::vector getMDsFrompT3(SDLEvent* event, unsigned int pT3); +std::vector getOuterTrackerHitsFrompT3(SDLEvent* event, unsigned int pT3); -std::vector getPixelHitsFrompT3(SDL::Event* event, +std::vector getPixelHitsFrompT3(SDLEvent* event, unsigned int pT3); -std::vector getHitsFrompT3(SDL::Event* event, unsigned int pT3); -std::vector getHitIdxsFrompT3(SDL::Event* event, unsigned int pT3); -std::vector getHitTypesFrompT3(SDL::Event* event, unsigned int pT3); -std::vector getModuleIdxsFrompT3(SDL::Event* event, +std::vector getHitsFrompT3(SDLEvent* event, unsigned int pT3); +std::vector getHitIdxsFrompT3(SDLEvent* event, unsigned int pT3); +std::vector getHitTypesFrompT3(SDLEvent* event, unsigned int pT3); +std::vector getModuleIdxsFrompT3(SDLEvent* event, unsigned int pT3); std::tuple, std::vector> getHitIdxsAndHitTypesFrompT3( - SDL::Event* event, unsigned pT3); + SDLEvent* event, unsigned pT3); // ----* pT5 *---- -unsigned int getPixelLSFrompT5(SDL::Event* event, unsigned int pT5); -unsigned int getT5FrompT5(SDL::Event* event, unsigned int pT5); -std::vector getT3sFrompT5(SDL::Event* event, unsigned int pT5); -std::vector getLSsFrompT5(SDL::Event* event, unsigned int pT5); -std::vector getMDsFrompT5(SDL::Event* event, unsigned int pT5); -std::vector getOuterTrackerHitsFrompT5(SDL::Event* event, +unsigned int getPixelLSFrompT5(SDLEvent* event, unsigned int pT5); +unsigned int getT5FrompT5(SDLEvent* event, unsigned int pT5); +std::vector getT3sFrompT5(SDLEvent* event, unsigned int pT5); +std::vector getLSsFrompT5(SDLEvent* event, unsigned int pT5); +std::vector getMDsFrompT5(SDLEvent* event, unsigned int pT5); +std::vector getOuterTrackerHitsFrompT5(SDLEvent* event, unsigned int pT5); -std::vector getPixelHitsFrompT5(SDL::Event* event, +std::vector getPixelHitsFrompT5(SDLEvent* event, unsigned int pT5); -std::vector getHitsFrompT5(SDL::Event* event, unsigned int pT5); -std::vector getHitIdxsFrompT5(SDL::Event* event, unsigned int pT5); -std::vector getHitTypesFrompT5(SDL::Event* event, unsigned int pT5); -std::vector getModuleIdxsFrompT5(SDL::Event* event, +std::vector getHitsFrompT5(SDLEvent* event, unsigned int pT5); +std::vector getHitIdxsFrompT5(SDLEvent* event, unsigned int pT5); +std::vector getHitTypesFrompT5(SDLEvent* event, unsigned int pT5); +std::vector getModuleIdxsFrompT5(SDLEvent* event, unsigned int pT5); std::tuple, std::vector> getHitIdxsAndHitTypesFrompT5( - SDL::Event* event, unsigned pT5); + SDLEvent* event, unsigned pT5); // ----* TC *---- -std::vector getLSsFromTC(SDL::Event* event, unsigned int TC); -std::vector getHitsFromTC(SDL::Event* event, unsigned int TC); +std::vector getLSsFromTC(SDLEvent* event, unsigned int TC); +std::vector getHitsFromTC(SDLEvent* event, unsigned int TC); std::tuple, std::vector> getHitIdxsAndHitTypesFromTC( - SDL::Event* event, unsigned int TC); + SDLEvent* event, unsigned int TC); #endif diff --git a/RecoTracker/LSTCore/standalone/code/core/trkCore.cc b/RecoTracker/LSTCore/standalone/code/core/trkCore.cc index cff1ef733e1f6..db8b2f6ac142d 100644 --- a/RecoTracker/LSTCore/standalone/code/core/trkCore.cc +++ b/RecoTracker/LSTCore/standalone/code/core/trkCore.cc @@ -22,7 +22,7 @@ bool goodEvent() { } //___________________________________________________________________________________________________________________________________________________________________________________________ -float runMiniDoublet(SDL::Event *event, int evt) { +float runMiniDoublet(SDL::Event *event, int evt) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Reco Mini-Doublet start " << evt << std::endl; @@ -74,7 +74,7 @@ float runMiniDoublet(SDL::Event *event, int evt) { } //___________________________________________________________________________________________________________________________________________________________________________________________ -float runSegment(SDL::Event *event) { +float runSegment(SDL::Event *event) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Reco Segment start" << std::endl; @@ -111,7 +111,7 @@ float runSegment(SDL::Event *event) { } //___________________________________________________________________________________________________________________________________________________________________________________________ -float runT3(SDL::Event *event) { +float runT3(SDL::Event *event) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Reco T3 start" << std::endl; @@ -152,7 +152,7 @@ float runT3(SDL::Event *event) { } //___________________________________________________________________________________________________________________________________________________________________________________________ -float runpT3(SDL::Event *event) { +float runpT3(SDL::Event *event) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Reco Pixel Triplet pT3 start" << std::endl; @@ -168,7 +168,7 @@ float runpT3(SDL::Event *event) { } //___________________________________________________________________________________________________________________________________________________________________________________________ -float runQuintuplet(SDL::Event *event) { +float runQuintuplet(SDL::Event *event) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Reco Quintuplet start" << std::endl; @@ -213,7 +213,7 @@ float runQuintuplet(SDL::Event *event) { } //___________________________________________________________________________________________________________________________________________________________________________________________ -float runPixelLineSegment(SDL::Event *event, bool no_pls_dupclean) { +float runPixelLineSegment(SDL::Event *event, bool no_pls_dupclean) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Reco Pixel Line Segment start" << std::endl; @@ -227,7 +227,7 @@ float runPixelLineSegment(SDL::Event *event, bool no_pls_dupclean) { } //___________________________________________________________________________________________________________________________________________________________________________________________ -float runPixelQuintuplet(SDL::Event *event) { +float runPixelQuintuplet(SDL::Event *event) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Reco Pixel Quintuplet start" << std::endl; @@ -243,7 +243,7 @@ float runPixelQuintuplet(SDL::Event *event) { } //___________________________________________________________________________________________________________________________________________________________________________________________ -float runTrackCandidate(SDL::Event *event, bool no_pls_dupclean, bool tc_pls_triplets) { +float runTrackCandidate(SDL::Event *event, bool no_pls_dupclean, bool tc_pls_triplets) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Reco TrackCandidate start" << std::endl; @@ -839,7 +839,7 @@ void addInputsToLineSegmentTrackingPreLoad(std::vector> &out_ } //___________________________________________________________________________________________________________________________________________________________________________________________ -float addInputsToEventPreLoad(SDL::Event *event, +float addInputsToEventPreLoad(SDL::Event *event, bool useOMP, std::vector trkX, std::vector trkY, @@ -1143,7 +1143,7 @@ void writeMetaData() { // DEPRECATED FUNCTIONS //__________________________________________________________________________________________ -[[deprecated]] float addInputsToLineSegmentTracking(SDL::Event &event, bool useOMP) { +[[deprecated]] float addInputsToLineSegmentTracking(SDL::Event &event, bool useOMP) { TStopwatch my_timer; if (ana.verbose >= 2) std::cout << "Loading Inputs (i.e. outer tracker hits, and pixel line segements) to the Line Segment Tracking.... " @@ -1338,6 +1338,6 @@ void writeMetaData() { } //__________________________________________________________________________________________ -[[deprecated]] float addInputsToLineSegmentTrackingUsingExplicitMemory(SDL::Event &event) { +[[deprecated]] float addInputsToLineSegmentTrackingUsingExplicitMemory(SDL::Event &event) { return addInputsToLineSegmentTracking(event, true); } diff --git a/RecoTracker/LSTCore/standalone/code/core/trkCore.h b/RecoTracker/LSTCore/standalone/code/core/trkCore.h index e32bc5153e04a..6a3d926658890 100644 --- a/RecoTracker/LSTCore/standalone/code/core/trkCore.h +++ b/RecoTracker/LSTCore/standalone/code/core/trkCore.h @@ -11,22 +11,24 @@ #include #include +using SDLEvent = SDL::Event; + // --------------------- ======================== --------------------- bool goodEvent(); -float runMiniDoublet(SDL::Event *event, int evt); -float runSegment(SDL::Event *event); -float runT4(SDL::Event *event); -float runT4x(SDL::Event *event); -float runpT4(SDL::Event *event); -float runT3(SDL::Event *event); -float runTrackCandidate(SDL::Event *event, +float runMiniDoublet(SDLEvent *event, int evt); +float runSegment(SDLEvent *event); +float runT4(SDLEvent *event); +float runT4x(SDLEvent *event); +float runpT4(SDLEvent *event); +float runT3(SDLEvent *event); +float runTrackCandidate(SDLEvent *event, bool no_pls_dupclean, bool tc_pls_triplets); -float runQuintuplet(SDL::Event *event); -float runPixelQuintuplet(SDL::Event *event); -float runPixelLineSegment(SDL::Event *event, bool no_pls_dupclean); -float runpT3(SDL::Event *event); +float runQuintuplet(SDLEvent *event); +float runPixelQuintuplet(SDLEvent *event); +float runPixelLineSegment(SDLEvent *event, bool no_pls_dupclean); +float runpT3(SDLEvent *event); // --------------------- ======================== --------------------- @@ -71,7 +73,7 @@ void addInputsToLineSegmentTrackingPreLoad(std::vector> &out_ std::vector> &out_pixelType_vec, std::vector> &out_isQuad_vec); -float addInputsToEventPreLoad(SDL::Event *event, +float addInputsToEventPreLoad(SDLEvent *event, bool useOMP, std::vector trkX, std::vector trkY, @@ -107,7 +109,7 @@ void writeMetaData(); // --------------------- ======================== --------------------- // DEPRECATED FUNCTION -float addInputsToLineSegmentTrackingUsingExplicitMemory(SDL::Event &event); -float addInputsToLineSegmentTracking(SDL::Event &event, bool useOMP); +float addInputsToLineSegmentTrackingUsingExplicitMemory(SDLEvent &event); +float addInputsToLineSegmentTracking(SDLEvent &event, bool useOMP); #endif diff --git a/RecoTracker/LSTCore/standalone/code/core/write_sdl_ntuple.cc b/RecoTracker/LSTCore/standalone/code/core/write_sdl_ntuple.cc index d361cdd165705..a610c40c6188d 100644 --- a/RecoTracker/LSTCore/standalone/code/core/write_sdl_ntuple.cc +++ b/RecoTracker/LSTCore/standalone/code/core/write_sdl_ntuple.cc @@ -9,7 +9,7 @@ void createOutputBranches() { } //________________________________________________________________________________________________________________________________ -void fillOutputBranches(SDL::Event* event) { +void fillOutputBranches(SDL::Event* event) { setOutputBranches(event); setOptionalOutputBranches(event); if (ana.gnn_ntuple) @@ -183,7 +183,7 @@ void createGnnNtupleBranches() { } //________________________________________________________________________________________________________________________________ -void setOutputBranches(SDL::Event* event) { +void setOutputBranches(SDL::Event* event) { // ============ Sim tracks ============= int n_accepted_simtrk = 0; for (unsigned int isimtrk = 0; isimtrk < trk.sim_pt().size(); ++isimtrk) { @@ -278,7 +278,7 @@ void setOutputBranches(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void setOptionalOutputBranches(SDL::Event* event) { +void setOptionalOutputBranches(SDL::Event* event) { #ifdef CUT_VALUE_DEBUG setPixelQuintupletOutputBranches(event); @@ -289,7 +289,7 @@ void setOptionalOutputBranches(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void setPixelQuintupletOutputBranches(SDL::Event* event) { +void setPixelQuintupletOutputBranches(SDL::Event* event) { // ============ pT5 ============= SDL::pixelQuintupletsBuffer& pixelQuintupletsInGPU = (*event->getPixelQuintuplets()); SDL::quintupletsBuffer& quintupletsInGPU = (*event->getQuintuplets()); @@ -365,7 +365,7 @@ void setPixelQuintupletOutputBranches(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void setQuintupletOutputBranches(SDL::Event* event) { +void setQuintupletOutputBranches(SDL::Event* event) { SDL::quintupletsBuffer& quintupletsInGPU = (*event->getQuintuplets()); SDL::objectRangesBuffer& rangesInGPU = (*event->getRanges()); SDL::modulesBuffer& modulesInGPU = (*event->getModules()); @@ -436,7 +436,7 @@ void setQuintupletOutputBranches(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void setPixelTripletOutputBranches(SDL::Event* event) { +void setPixelTripletOutputBranches(SDL::Event* event) { SDL::pixelTripletsBuffer& pixelTripletsInGPU = (*event->getPixelTriplets()); SDL::tripletsBuffer& tripletsInGPU = *(event->getTriplets()); SDL::modulesBuffer& modulesInGPU = *(event->getModules()); @@ -501,7 +501,7 @@ void setPixelTripletOutputBranches(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void setGnnNtupleBranches(SDL::Event* event) { +void setGnnNtupleBranches(SDL::Event* event) { // Get relevant information SDL::segmentsBuffer& segmentsInGPU = (*event->getSegments()); SDL::miniDoubletsBuffer& miniDoubletsInGPU = (*event->getMiniDoublets()); @@ -642,7 +642,7 @@ void setGnnNtupleBranches(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void setGnnNtupleMiniDoublet(SDL::Event* event, unsigned int MD) { +void setGnnNtupleMiniDoublet(SDL::Event* event, unsigned int MD) { // Get relevant information SDL::miniDoubletsBuffer& miniDoubletsInGPU = (*event->getMiniDoublets()); SDL::hitsBuffer& hitsInGPU = (*event->getHits()); @@ -710,7 +710,7 @@ void setGnnNtupleMiniDoublet(SDL::Event* event, unsigned int MD) { } //________________________________________________________________________________________________________________________________ -std::tuple> parseTrackCandidate(SDL::Event* event, +std::tuple> parseTrackCandidate(SDL::Event* event, unsigned int idx) { // Get the type of the track candidate SDL::trackCandidatesBuffer& trackCandidatesInGPU = (*event->getTrackCandidates()); @@ -745,7 +745,7 @@ std::tuple> parseTrackCandidate( //________________________________________________________________________________________________________________________________ std::tuple, std::vector> parsepT5( - SDL::Event* event, unsigned int idx) { + SDL::Event* event, unsigned int idx) { // Get relevant information SDL::trackCandidatesBuffer& trackCandidatesInGPU = (*event->getTrackCandidates()); SDL::quintupletsBuffer& quintupletsInGPU = (*event->getQuintuplets()); @@ -857,7 +857,7 @@ std::tuple, std::vector, std::vector> parsepT3( - SDL::Event* event, unsigned int idx) { + SDL::Event* event, unsigned int idx) { // Get relevant information SDL::trackCandidatesBuffer& trackCandidatesInGPU = (*event->getTrackCandidates()); SDL::tripletsBuffer& tripletsInGPU = (*event->getTriplets()); @@ -891,7 +891,7 @@ std::tuple, std::vector, std::vector> parseT5(SDL::Event* event, +std::tuple, std::vector> parseT5(SDL::Event* event, unsigned int idx) { SDL::trackCandidatesBuffer& trackCandidatesInGPU = (*event->getTrackCandidates()); SDL::quintupletsBuffer& quintupletsInGPU = (*event->getQuintuplets()); @@ -926,7 +926,7 @@ std::tuple, std::vector, std::vector> parsepLS( - SDL::Event* event, unsigned int idx) { + SDL::Event* event, unsigned int idx) { SDL::trackCandidatesBuffer& trackCandidatesInGPU = (*event->getTrackCandidates()); SDL::segmentsBuffer& segmentsInGPU = (*event->getSegments()); @@ -946,7 +946,7 @@ std::tuple, std::vector* event) { +void printHitMultiplicities(SDL::Event* event) { SDL::modulesBuffer& modulesInGPU = (*event->getModules()); SDL::objectRangesBuffer& rangesInGPU = (*event->getRanges()); @@ -961,7 +961,7 @@ void printHitMultiplicities(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void printMiniDoubletMultiplicities(SDL::Event* event) { +void printMiniDoubletMultiplicities(SDL::Event* event) { SDL::miniDoubletsBuffer& miniDoubletsInGPU = (*event->getMiniDoublets()); SDL::modulesBuffer& modulesInGPU = (*event->getModules()); @@ -980,7 +980,7 @@ void printMiniDoubletMultiplicities(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void printAllObjects(SDL::Event* event) { +void printAllObjects(SDL::Event* event) { printMDs(event); printLSs(event); printpLSs(event); @@ -988,7 +988,7 @@ void printAllObjects(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void printMDs(SDL::Event* event) { +void printMDs(SDL::Event* event) { SDL::miniDoubletsBuffer& miniDoubletsInGPU = (*event->getMiniDoublets()); SDL::hitsBuffer& hitsInGPU = (*event->getHits()); SDL::modulesBuffer& modulesInGPU = (*event->getModules()); @@ -1010,7 +1010,7 @@ void printMDs(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void printLSs(SDL::Event* event) { +void printLSs(SDL::Event* event) { SDL::segmentsBuffer& segmentsInGPU = (*event->getSegments()); SDL::miniDoubletsBuffer& miniDoubletsInGPU = (*event->getMiniDoublets()); SDL::hitsBuffer& hitsInGPU = (*event->getHits()); @@ -1042,7 +1042,7 @@ void printLSs(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void printpLSs(SDL::Event* event) { +void printpLSs(SDL::Event* event) { SDL::segmentsBuffer& segmentsInGPU = (*event->getSegments()); SDL::miniDoubletsBuffer& miniDoubletsInGPU = (*event->getMiniDoublets()); SDL::hitsBuffer& hitsInGPU = (*event->getHits()); @@ -1072,7 +1072,7 @@ void printpLSs(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void printT3s(SDL::Event* event) { +void printT3s(SDL::Event* event) { SDL::tripletsBuffer& tripletsInGPU = (*event->getTriplets()); SDL::segmentsBuffer& segmentsInGPU = (*event->getSegments()); SDL::miniDoubletsBuffer& miniDoubletsInGPU = (*event->getMiniDoublets()); @@ -1114,7 +1114,7 @@ void printT3s(SDL::Event* event) { } //________________________________________________________________________________________________________________________________ -void debugPrintOutlierMultiplicities(SDL::Event* event) { +void debugPrintOutlierMultiplicities(SDL::Event* event) { SDL::trackCandidatesBuffer& trackCandidatesInGPU = (*event->getTrackCandidates()); SDL::tripletsBuffer& tripletsInGPU = (*event->getTriplets()); SDL::segmentsBuffer& segmentsInGPU = (*event->getSegments()); diff --git a/RecoTracker/LSTCore/standalone/code/core/write_sdl_ntuple.h b/RecoTracker/LSTCore/standalone/code/core/write_sdl_ntuple.h index ec3afb2e1944c..a5f325f986ab7 100644 --- a/RecoTracker/LSTCore/standalone/code/core/write_sdl_ntuple.h +++ b/RecoTracker/LSTCore/standalone/code/core/write_sdl_ntuple.h @@ -11,47 +11,49 @@ #include "trkCore.h" #include "AccessHelper.h" +using SDLEvent = SDL::Event; + // Common void createOutputBranches(); void createRequiredOutputBranches(); void createOptionalOutputBranches(); void createGnnNtupleBranches(); -void fillOutputBranches(SDL::Event* event); -void setOutputBranches(SDL::Event* event); -void setOptionalOutputBranches(SDL::Event* event); -void setPixelQuintupletOutputBranches(SDL::Event* event); -void setQuintupletOutputBranches(SDL::Event* event); -void setPixelTripletOutputBranches(SDL::Event* event); -void setGnnNtupleBranches(SDL::Event* event); -void setGnnNtupleMiniDoublet(SDL::Event* event, unsigned int MD); +void fillOutputBranches(SDLEvent* event); +void setOutputBranches(SDLEvent* event); +void setOptionalOutputBranches(SDLEvent* event); +void setPixelQuintupletOutputBranches(SDLEvent* event); +void setQuintupletOutputBranches(SDLEvent* event); +void setPixelTripletOutputBranches(SDLEvent* event); +void setGnnNtupleBranches(SDLEvent* event); +void setGnnNtupleMiniDoublet(SDLEvent* event, unsigned int MD); std::tuple> parseTrackCandidate( - SDL::Event* event, unsigned int); + SDLEvent* event, unsigned int); std::tuple, std::vector> parsepT5( - SDL::Event* event, unsigned int); + SDLEvent* event, unsigned int); std::tuple, std::vector> parsepT3( - SDL::Event* event, unsigned int); + SDLEvent* event, unsigned int); std::tuple, std::vector> parseT5( - SDL::Event* event, unsigned int); + SDLEvent* event, unsigned int); std::tuple, std::vector> parsepLS( - SDL::Event* event, unsigned int); + SDLEvent* event, unsigned int); // Print multiplicities -void printMiniDoubletMultiplicities(SDL::Event* event); -void printHitMultiplicities(SDL::Event* event); +void printMiniDoubletMultiplicities(SDLEvent* event); +void printHitMultiplicities(SDLEvent* event); // Print objects (GPU) -void printAllObjects(SDL::Event* event); -void printpT4s(SDL::Event* event); -void printMDs(SDL::Event* event); -void printLSs(SDL::Event* event); -void printpLSs(SDL::Event* event); -void printT3s(SDL::Event* event); -void printT4s(SDL::Event* event); -void printTCs(SDL::Event* event); +void printAllObjects(SDLEvent* event); +void printpT4s(SDLEvent* event); +void printMDs(SDLEvent* event); +void printLSs(SDLEvent* event); +void printpLSs(SDLEvent* event); +void printT3s(SDLEvent* event); +void printT4s(SDLEvent* event); +void printTCs(SDLEvent* event); // Print anomalous multiplicities -void debugPrintOutlierMultiplicities(SDL::Event* event); +void debugPrintOutlierMultiplicities(SDLEvent* event); #endif