From 12c08a5c1370ea803dd3eaf41e2acc913efbf47c Mon Sep 17 00:00:00 2001 From: YonsiG Date: Mon, 13 May 2024 09:40:17 -0700 Subject: [PATCH 01/10] add pT3 new def --- SDL/Triplet.h | 4 ++-- code/core/write_sdl_ntuple.cc | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 89363d61..12c3493b 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -821,7 +821,6 @@ namespace SDL { float& sdlCut, float& betaInCut) { bool pass = true; - //this cut reduces the number of candidates by a factor of 4, i.e., 3 out of 4 warps can end right here! if (segmentsInGPU.mdIndices[2 * innerSegmentIndex + 1] != segmentsInGPU.mdIndices[2 * outerSegmentIndex]) return false; @@ -870,6 +869,7 @@ namespace SDL { float y3 = mdsInGPU.anchorY[thirdMDIndex]; circleRadius = computeRadiusFromThreeAnchorHits(acc, x1, y1, x2, y2, x3, y3, circleCenterX, circleCenterY); + if(circleRadius==0) printf("%f, x1:%f, x2:%f, x3:%f, y1:%f, y2:%f, y3:%f\n",circleRadius, x1, x2, x3, y1, y2, y3); return pass; }; @@ -913,7 +913,7 @@ namespace SDL { uint16_t outerOuterLowerModuleIndex = segmentsInGPU.outerLowerModuleIndices[outerSegmentIndex]; - float zOut, rtOut, deltaPhiPos, deltaPhi, betaIn, circleRadius, circleCenterX, circleCenterY; + float zOut, rtOut, deltaPhiPos, deltaPhi, betaIn, circleRadius=-999, circleCenterX, circleCenterY; float zLo, zHi, rtLo, rtHi, zLoPointed, zHiPointed, sdlCut, betaInCut; bool success = runTripletConstraintsAndAlgo(acc, diff --git a/code/core/write_sdl_ntuple.cc b/code/core/write_sdl_ntuple.cc index 327a5995..467d5f98 100644 --- a/code/core/write_sdl_ntuple.cc +++ b/code/core/write_sdl_ntuple.cc @@ -911,6 +911,7 @@ std::tuple, vector> pars { // Get relevant information SDL::trackCandidatesBuffer& trackCandidatesInGPU = (*event->getTrackCandidates()); + SDL::tripletsBuffer& tripletsInGPU = *(event->getTriplets()); SDL::segmentsBuffer& segmentsInGPU = (*event->getSegments()); // @@ -922,14 +923,18 @@ std::tuple, vector> pars // **** oo -- oo -- oo pT3 unsigned int pT3 = trackCandidatesInGPU.directObjectIndices[idx]; unsigned int pLS = getPixelLSFrompT3(event, pT3); + unsigned int T3 = getT3FrompT3(event, pT3); // pixel pt const float pt_pLS = segmentsInGPU.ptIn[pLS]; const float eta_pLS = segmentsInGPU.eta[pLS]; const float phi_pLS = segmentsInGPU.phi[pLS]; + float pt_T3 = tripletsInGPU.circleRadius[T3] * 2 * SDL::k2Rinv1GeVf; + //if (tripletsInGPU.circleRadius[T3]==-999) +// std::cout< hit_idx = getHitIdxsFrompT3(event, pT3); From 19f4c3aa31ca792fad82080a37d7ba8d0019adc1 Mon Sep 17 00:00:00 2001 From: YonsiG Date: Mon, 13 May 2024 09:50:44 -0700 Subject: [PATCH 02/10] correct an asterik --- code/core/write_sdl_ntuple.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/core/write_sdl_ntuple.cc b/code/core/write_sdl_ntuple.cc index 467d5f98..f7336649 100644 --- a/code/core/write_sdl_ntuple.cc +++ b/code/core/write_sdl_ntuple.cc @@ -911,7 +911,7 @@ std::tuple, vector> pars { // Get relevant information SDL::trackCandidatesBuffer& trackCandidatesInGPU = (*event->getTrackCandidates()); - SDL::tripletsBuffer& tripletsInGPU = *(event->getTriplets()); + SDL::tripletsBuffer& tripletsInGPU = (*event->getTriplets()); SDL::segmentsBuffer& segmentsInGPU = (*event->getSegments()); // From a5aa3ff731a68909a46b1bc546042733a7143e34 Mon Sep 17 00:00:00 2001 From: YonsiG Date: Tue, 14 May 2024 11:44:16 -0700 Subject: [PATCH 03/10] transport the GPU info into the CPU write out --- SDL/Event.cc | 1 + SDL/Triplet.h | 2 +- code/core/write_sdl_ntuple.cc | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/SDL/Event.cc b/SDL/Event.cc index 54aea9b3..db6c8d2a 100644 --- a/SDL/Event.cc +++ b/SDL/Event.cc @@ -1675,6 +1675,7 @@ SDL::tripletsBuffer* SDL::Event::getTriplets() { alpaka::memcpy(queue, tripletsInCPU->logicalLayers_buf, tripletsBuffers->logicalLayers_buf, 3 * nMemHost); alpaka::memcpy(queue, tripletsInCPU->segmentIndices_buf, tripletsBuffers->segmentIndices_buf, 2 * nMemHost); alpaka::memcpy(queue, tripletsInCPU->betaIn_buf, tripletsBuffers->betaIn_buf, nMemHost); + alpaka::memcpy(queue, tripletsInCPU->circleRadius_buf, tripletsBuffers->circleRadius_buf, nMemHost); alpaka::memcpy(queue, tripletsInCPU->nTriplets_buf, tripletsBuffers->nTriplets_buf); alpaka::memcpy(queue, tripletsInCPU->totOccupancyTriplets_buf, tripletsBuffers->totOccupancyTriplets_buf); alpaka::wait(queue); diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 12c3493b..86f88327 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -913,7 +913,7 @@ namespace SDL { uint16_t outerOuterLowerModuleIndex = segmentsInGPU.outerLowerModuleIndices[outerSegmentIndex]; - float zOut, rtOut, deltaPhiPos, deltaPhi, betaIn, circleRadius=-999, circleCenterX, circleCenterY; + float zOut, rtOut, deltaPhiPos, deltaPhi, betaIn=0, circleRadius=-999, circleCenterX, circleCenterY; float zLo, zHi, rtLo, rtHi, zLoPointed, zHiPointed, sdlCut, betaInCut; bool success = runTripletConstraintsAndAlgo(acc, diff --git a/code/core/write_sdl_ntuple.cc b/code/core/write_sdl_ntuple.cc index f7336649..0b60d254 100644 --- a/code/core/write_sdl_ntuple.cc +++ b/code/core/write_sdl_ntuple.cc @@ -930,8 +930,6 @@ std::tuple, vector> pars const float eta_pLS = segmentsInGPU.eta[pLS]; const float phi_pLS = segmentsInGPU.phi[pLS]; float pt_T3 = tripletsInGPU.circleRadius[T3] * 2 * SDL::k2Rinv1GeVf; - //if (tripletsInGPU.circleRadius[T3]==-999) -// std::cout< Date: Tue, 14 May 2024 11:52:09 -0700 Subject: [PATCH 04/10] delete unused printout --- SDL/Triplet.h | 1 - 1 file changed, 1 deletion(-) diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 86f88327..74c024f4 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -869,7 +869,6 @@ namespace SDL { float y3 = mdsInGPU.anchorY[thirdMDIndex]; circleRadius = computeRadiusFromThreeAnchorHits(acc, x1, y1, x2, y2, x3, y3, circleCenterX, circleCenterY); - if(circleRadius==0) printf("%f, x1:%f, x2:%f, x3:%f, y1:%f, y2:%f, y3:%f\n",circleRadius, x1, x2, x3, y1, y2, y3); return pass; }; From a9bf9a9f9dfc8d23e76bfeb4c38ad6635e8f95b6 Mon Sep 17 00:00:00 2001 From: YonsiG Date: Tue, 14 May 2024 11:55:08 -0700 Subject: [PATCH 05/10] linter checks --- SDL/Event.cc | 2 +- SDL/Triplet.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SDL/Event.cc b/SDL/Event.cc index db6c8d2a..0bea0d16 100644 --- a/SDL/Event.cc +++ b/SDL/Event.cc @@ -1675,7 +1675,7 @@ SDL::tripletsBuffer* SDL::Event::getTriplets() { alpaka::memcpy(queue, tripletsInCPU->logicalLayers_buf, tripletsBuffers->logicalLayers_buf, 3 * nMemHost); alpaka::memcpy(queue, tripletsInCPU->segmentIndices_buf, tripletsBuffers->segmentIndices_buf, 2 * nMemHost); alpaka::memcpy(queue, tripletsInCPU->betaIn_buf, tripletsBuffers->betaIn_buf, nMemHost); - alpaka::memcpy(queue, tripletsInCPU->circleRadius_buf, tripletsBuffers->circleRadius_buf, nMemHost); + alpaka::memcpy(queue, tripletsInCPU->circleRadius_buf, tripletsBuffers->circleRadius_buf, nMemHost); alpaka::memcpy(queue, tripletsInCPU->nTriplets_buf, tripletsBuffers->nTriplets_buf); alpaka::memcpy(queue, tripletsInCPU->totOccupancyTriplets_buf, tripletsBuffers->totOccupancyTriplets_buf); alpaka::wait(queue); diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 74c024f4..498acbf6 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -912,7 +912,7 @@ namespace SDL { uint16_t outerOuterLowerModuleIndex = segmentsInGPU.outerLowerModuleIndices[outerSegmentIndex]; - float zOut, rtOut, deltaPhiPos, deltaPhi, betaIn=0, circleRadius=-999, circleCenterX, circleCenterY; + float zOut, rtOut, deltaPhiPos, deltaPhi, betaIn = 0, circleRadius = -999, circleCenterX, circleCenterY; float zLo, zHi, rtLo, rtHi, zLoPointed, zHiPointed, sdlCut, betaInCut; bool success = runTripletConstraintsAndAlgo(acc, From 085cf929f9ccaad90fcbc133ae747b1d8a6ede75 Mon Sep 17 00:00:00 2001 From: YonsiG Date: Mon, 20 May 2024 08:52:58 -0700 Subject: [PATCH 06/10] remove initialization --- SDL/Triplet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 498acbf6..0641014b 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -912,7 +912,7 @@ namespace SDL { uint16_t outerOuterLowerModuleIndex = segmentsInGPU.outerLowerModuleIndices[outerSegmentIndex]; - float zOut, rtOut, deltaPhiPos, deltaPhi, betaIn = 0, circleRadius = -999, circleCenterX, circleCenterY; + float zOut, rtOut, deltaPhiPos, deltaPhi, betaIn, circleRadius, circleCenterX, circleCenterY; float zLo, zHi, rtLo, rtHi, zLoPointed, zHiPointed, sdlCut, betaInCut; bool success = runTripletConstraintsAndAlgo(acc, From b12b335ed5300817d3c67d8f95a2a93978a9281e Mon Sep 17 00:00:00 2001 From: YonsiG Date: Mon, 20 May 2024 08:57:49 -0700 Subject: [PATCH 07/10] add initialization --- SDL/Triplet.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 0641014b..3e9d59a2 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -940,6 +940,17 @@ namespace SDL { zHiPointed, sdlCut, betaInCut); + if (!success) + { + zOut=-999; + rtOut=-999; + deltaPhiPos=-999; + deltaPhi=-999; + betaIn=-999; + circleRadius=-999; + circleCenterX=-999; + circleCenterY=-999; + } if (success) { unsigned int totOccupancyTriplets = alpaka::atomicOp( From ac7ce561747fd5fd754c8bcca914f48ba5db5ac2 Mon Sep 17 00:00:00 2001 From: YonsiG Date: Mon, 20 May 2024 08:59:39 -0700 Subject: [PATCH 08/10] linter check --- SDL/Triplet.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 3e9d59a2..a543632c 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -940,16 +940,15 @@ namespace SDL { zHiPointed, sdlCut, betaInCut); - if (!success) - { - zOut=-999; - rtOut=-999; - deltaPhiPos=-999; - deltaPhi=-999; - betaIn=-999; - circleRadius=-999; - circleCenterX=-999; - circleCenterY=-999; + if (!success) { + zOut = -999; + rtOut = -999; + deltaPhiPos = -999; + deltaPhi = -999; + betaIn = -999; + circleRadius = -999; + circleCenterX = -999; + circleCenterY = -999; } if (success) { From 6be4f7f62050da20dca8c2695055fb14f865c2e3 Mon Sep 17 00:00:00 2001 From: YonsiG Date: Tue, 21 May 2024 11:03:53 -0700 Subject: [PATCH 09/10] initialize betaIn in passPointingConstraintsBBB --- SDL/Triplet.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/SDL/Triplet.h b/SDL/Triplet.h index a543632c..8aea3384 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -377,7 +377,7 @@ namespace SDL { float alpha_InLo = __H2F(segmentsInGPU.dPhiChanges[innerSegmentIndex]); float tl_axis_x = mdsInGPU.anchorX[thirdMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float tl_axis_y = mdsInGPU.anchorY[thirdMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - float betaInRHmin = + betaIn = alpha_InLo - SDL::phi_mpi_pi(acc, SDL::phi(acc, tl_axis_x, tl_axis_y) - mdsInGPU.anchorPhi[firstMDIndex]); //beta computation @@ -396,7 +396,7 @@ namespace SDL { (0.02f / drt_InSeg); //Cut #3: first beta cut - pass = pass and (alpaka::math::abs(acc, betaInRHmin) < betaInCut); + pass = pass and (alpaka::math::abs(acc, betaIn) < betaInCut); return pass; }; @@ -940,16 +940,6 @@ namespace SDL { zHiPointed, sdlCut, betaInCut); - if (!success) { - zOut = -999; - rtOut = -999; - deltaPhiPos = -999; - deltaPhi = -999; - betaIn = -999; - circleRadius = -999; - circleCenterX = -999; - circleCenterY = -999; - } if (success) { unsigned int totOccupancyTriplets = alpaka::atomicOp( From 0f20b8ff4df58fcb9fed131703295c92fcd90f56 Mon Sep 17 00:00:00 2001 From: YonsiG Date: Tue, 21 May 2024 11:15:38 -0700 Subject: [PATCH 10/10] linter check --- SDL/Triplet.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SDL/Triplet.h b/SDL/Triplet.h index 8aea3384..3ea9571a 100644 --- a/SDL/Triplet.h +++ b/SDL/Triplet.h @@ -377,8 +377,7 @@ namespace SDL { float alpha_InLo = __H2F(segmentsInGPU.dPhiChanges[innerSegmentIndex]); float tl_axis_x = mdsInGPU.anchorX[thirdMDIndex] - mdsInGPU.anchorX[firstMDIndex]; float tl_axis_y = mdsInGPU.anchorY[thirdMDIndex] - mdsInGPU.anchorY[firstMDIndex]; - betaIn = - alpha_InLo - SDL::phi_mpi_pi(acc, SDL::phi(acc, tl_axis_x, tl_axis_y) - mdsInGPU.anchorPhi[firstMDIndex]); + betaIn = alpha_InLo - SDL::phi_mpi_pi(acc, SDL::phi(acc, tl_axis_x, tl_axis_y) - mdsInGPU.anchorPhi[firstMDIndex]); //beta computation float drt_tl_axis = alpaka::math::sqrt(acc, tl_axis_x * tl_axis_x + tl_axis_y * tl_axis_y);