Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

pT3 new pt definiton #402

Merged
merged 10 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SDL/Event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,7 @@ SDL::tripletsBuffer<alpaka::DevCpu>* SDL::Event<SDL::Acc>::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);
Expand Down
6 changes: 2 additions & 4 deletions SDL/Triplet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
float betaInRHmin =
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);
Expand All @@ -396,7 +395,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;
};
Expand Down Expand Up @@ -821,7 +820,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;
Expand Down
5 changes: 4 additions & 1 deletion code/core/write_sdl_ntuple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ std::tuple<float, float, float, vector<unsigned int>, vector<unsigned int>> pars
{
// Get relevant information
SDL::trackCandidatesBuffer<alpaka::DevCpu>& trackCandidatesInGPU = (*event->getTrackCandidates());
SDL::tripletsBuffer<alpaka::DevCpu>& tripletsInGPU = (*event->getTriplets());
SDL::segmentsBuffer<alpaka::DevCpu>& segmentsInGPU = (*event->getSegments());

//
Expand All @@ -922,14 +923,16 @@ std::tuple<float, float, float, vector<unsigned int>, vector<unsigned int>> 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;

// average pt
const float pt = pt_pLS;
const float pt = (pt_pLS+pt_T3)/2;

// Form the hit idx/type vector
std::vector<unsigned int> hit_idx = getHitIdxsFrompT3(event, pT3);
Expand Down