-
Notifications
You must be signed in to change notification settings - Fork 510
[NN CF] Momentum vector usage by neural network cluster finder #15582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,15 +120,17 @@ GPUdii() void GPUTPCNeighboursFinder::Thread<0>(int32_t /*nBlocks*/, int32_t nTh | |
| const GPUglobalref() cahit2& hitData = pHitData[lHitNumberOffset + ih]; | ||
| const float y = y0 + hitData.x * stepY; | ||
| const float z = z0 + hitData.y * stepZ; | ||
| float nnDydx = 0.f, nnDzdx = 0.f; | ||
| const bool useNNDir = tracker.HitNNDirection(row, ih, nnDydx, nnDzdx) && CAMath::Abs(nnDydx) < 10.f && CAMath::Abs(nnDzdx) < 10.f; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there should be an option in param.rec.tpc, that enables / disables it, and this should be ANDed as first check here. |
||
|
|
||
| uint32_t nNeighUp = 0; | ||
| float minZ, maxZ, minY, maxY; | ||
| int32_t binYmin, binYmax, binZmin, binZmax; | ||
| int32_t nY; | ||
|
|
||
| { // area in the upper row | ||
| const float yy = y * s.mUpTx; | ||
| const float zz = z * kAreaSlopeZUp; | ||
| const float yy = useNNDir ? y + nnDydx * s.mUpDx : y * s.mUpTx; | ||
| const float zz = useNNDir ? z + nnDzdx * s.mUpDx : z * kAreaSlopeZUp; | ||
| minZ = zz - kAreaSizeZUp; | ||
| maxZ = zz + kAreaSizeZUp; | ||
| minY = yy - kAreaSizeY; | ||
|
|
@@ -196,8 +198,8 @@ GPUdii() void GPUTPCNeighboursFinder::Thread<0>(int32_t /*nBlocks*/, int32_t nTh | |
| } | ||
|
|
||
| { // area in the lower row | ||
| const float yy = y * s.mDnTx; | ||
| const float zz = z * kAreaSlopeZDn; | ||
| const float yy = useNNDir ? y + nnDydx * s.mDnDx : y * s.mDnTx; | ||
| const float zz = useNNDir ? z + nnDzdx * s.mDnDx : z * kAreaSlopeZDn; | ||
| minZ = zz - kAreaSizeZDn; | ||
| maxZ = zz + kAreaSizeZDn; | ||
| minY = yy - kAreaSizeY; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -170,9 +170,16 @@ GPUdic(2, 1) void GPUTPCTrackletConstructor::UpdateTracklet(int32_t /*nBlocks*/, | |
|
|
||
| float ri = 1.f / CAMath::Sqrt(dx * dx + dy * dy); | ||
| if (iRow == (int32_t)r.mStartRow + 2) { | ||
| tParam.SetSinPhi(dy * ri); | ||
| float nnDydx = 0.f, nnDzdx = 0.f; | ||
| if (tracker.HitNNDirection(row, seedIH, nnDydx, nnDzdx) && CAMath::Abs(nnDydx) < 10.f && CAMath::Abs(nnDzdx) < 10.f) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't fully understand the math without checking in detail. You are weighting the NN direction and the slope between the clusters? That makes sense. But in any case, as first check, it should be ANDed with a setting in param.rec.tpc
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I normalize the NN direction by the transverse element (ds = sqrt(dx2 + dy2), which becomes dx*invsqrt(1 + (dy/dx)**2)). Since sin(phi) = dy/ds you get nnDydx * nnNormI. The track parameters use the transverse path length with sin(phi) = Py / Pt and DzDs = Pz / Pt. Therefore the normalization is reused for the z direction too. |
||
| const float nnNormI = CAMath::InvSqrt(1.f + nnDydx * nnDydx); | ||
| tParam.SetSinPhi(0.5f * (dy * ri + nnDydx * nnNormI)); | ||
| tParam.SetDzDs(0.5f * (dz * ri + nnDzdx * nnNormI)); | ||
| } else { | ||
| tParam.SetSinPhi(dy * ri); | ||
| tParam.SetDzDs(dz * ri); | ||
| } | ||
| tParam.SetSignCosPhi(dx); | ||
| tParam.SetDzDs(dz * ri); | ||
| float err2Y, err2Z; | ||
| tracker.GetErrors2Seeding(iRow, tParam, -1.f, err2Y, err2Z); // Use correct time | ||
| tParam.SetCov(0, err2Y); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this have to go here? This is one of the base classes, included almost everywhere, so I would try to keep it as slim as possible.