Skip to content

Commit c41507a

Browse files
committed
GPU TPC: Add Pt cut to treat < 100 MeV always as secondary
1 parent c602976 commit c41507a

File tree

2 files changed

+42
-39
lines changed

2 files changed

+42
-39
lines changed

GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -862,30 +862,31 @@ GPUd() void GPUTPCGMTrackParam::ShiftZ(const GPUTPCGMMerger* GPUrestrict() merge
862862
if (!merger->Param().par.continuousTracking) {
863863
return;
864864
}
865-
const float r1 = CAMath::Max(0.0001f, CAMath::Abs(mP[4] * merger->Param().polynomialField.GetNominalBz()));
866-
867-
const float dist2 = mX * mX + mP[0] * mP[0];
868-
const float dist1r2 = dist2 * r1 * r1;
869865
float deltaZ = 0.f;
870866
bool beamlineReached = false;
871-
if (dist1r2 < 4) {
872-
const float alpha = CAMath::ACos(1 - 0.5f * dist1r2); // Angle of a circle, such that |(cosa, sina) - (1,0)| == dist
873-
const float beta = CAMath::ATan2(mP[0], mX);
874-
const int32_t comp = mP[2] > CAMath::Sin(beta);
875-
const float sinab = CAMath::Sin((comp ? 0.5f : -0.5f) * alpha + beta); // Angle of circle through origin and track position, to be compared to Snp
876-
const float res = CAMath::Abs(sinab - mP[2]);
877-
878-
if (res < 0.2) {
879-
const float r = 1.f / r1;
880-
const float dS = alpha * r;
881-
float z0 = dS * mP[3];
882-
if (CAMath::Abs(z0) > GPUTPCGeometry::TPCLength()) {
883-
z0 = z0 > 0 ? GPUTPCGeometry::TPCLength() : -GPUTPCGeometry::TPCLength();
884-
}
885-
deltaZ = mP[1] - z0;
886-
beamlineReached = true;
867+
const float r1 = CAMath::Max(0.0001f, CAMath::Abs(mP[4] * merger->Param().polynomialField.GetNominalBz()));
868+
if (r1 < 0.01501) { // 100 MeV @ 0.5T ~ 0.66m cutof
869+
const float dist2 = mX * mX + mP[0] * mP[0];
870+
const float dist1r2 = dist2 * r1 * r1;
871+
if (dist1r2 < 4) {
872+
const float alpha = CAMath::ACos(1 - 0.5f * dist1r2); // Angle of a circle, such that |(cosa, sina) - (1,0)| == dist
873+
const float beta = CAMath::ATan2(mP[0], mX);
874+
const int32_t comp = mP[2] > CAMath::Sin(beta);
875+
const float sinab = CAMath::Sin((comp ? 0.5f : -0.5f) * alpha + beta); // Angle of circle through origin and track position, to be compared to Snp
876+
const float res = CAMath::Abs(sinab - mP[2]);
877+
878+
if (res < 0.2) {
879+
const float r = 1.f / r1;
880+
const float dS = alpha * r;
881+
float z0 = dS * mP[3];
882+
if (CAMath::Abs(z0) > GPUTPCGeometry::TPCLength()) {
883+
z0 = z0 > 0 ? GPUTPCGeometry::TPCLength() : -GPUTPCGeometry::TPCLength();
884+
}
885+
deltaZ = mP[1] - z0;
886+
beamlineReached = true;
887887

888-
// printf("X %9.3f Y %9.3f QPt %9.3f R %9.3f --> Alpha %9.3f Snp %9.3f Snab %9.3f Res %9.3f dS %9.3f z0 %9.3f\n", mX, mP[0], mP[4], r, alpha / 3.1415 * 180, mP[2], sinab, res, dS, z0);
888+
// printf("X %9.3f Y %9.3f QPt %9.3f R %9.3f --> Alpha %9.3f Snp %9.3f Snab %9.3f Res %9.3f dS %9.3f z0 %9.3f\n", mX, mP[0], mP[4], r, alpha / 3.1415 * 180, mP[2], sinab, res, dS, z0);
889+
}
889890
}
890891
}
891892

GPU/GPUTracking/SectorTracker/GPUTPCTrackParam.cxx

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -745,27 +745,29 @@ GPUd() void GPUTPCTrackParam::ConstrainZ(float& z, int32_t sector, float& z0, fl
745745
GPUd() void GPUTPCTrackParam::ShiftZ(float z1, float z2, float x1, float x2, float bz, float defaultZOffsetOverR)
746746
{
747747
const float r1 = CAMath::Max(0.0001f, CAMath::Abs(mParam.mP[4] * bz));
748-
749-
const float dist2 = mParam.mX * mParam.mX + mParam.mP[0] * mParam.mP[0];
750-
const float dist1r2 = dist2 * r1 * r1;
751748
float deltaZ = 0.f;
752749
bool beamlineReached = false;
753-
if (dist1r2 < 4) {
754-
const float alpha = CAMath::ACos(1 - 0.5f * dist1r2); // Angle of a circle, such that |(cosa, sina) - (1,0)| == dist
755-
const float beta = CAMath::ATan2(mParam.mP[0], mParam.mX);
756-
const int32_t comp = mParam.mP[2] > CAMath::Sin(beta);
757-
const float sinab = CAMath::Sin((comp ? 0.5f : -0.5f) * alpha + beta); // Angle of circle through origin and track position, to be compared to Snp
758-
const float res = CAMath::Abs(sinab - mParam.mP[2]);
759-
760-
if (res < 0.2f) {
761-
const float r = 1.f / r1;
762-
const float dS = alpha * r;
763-
float z0 = dS * mParam.mP[3];
764-
if (CAMath::Abs(z0) > GPUTPCGeometry::TPCLength()) {
765-
z0 = z0 > 0 ? GPUTPCGeometry::TPCLength() : -GPUTPCGeometry::TPCLength();
750+
751+
if (r1 < 0.01501) { // 100 MeV @ 0.5T ~ 0.66m cutof
752+
const float dist2 = mParam.mX * mParam.mX + mParam.mP[0] * mParam.mP[0];
753+
const float dist1r2 = dist2 * r1 * r1;
754+
if (dist1r2 < 4) {
755+
const float alpha = CAMath::ACos(1 - 0.5f * dist1r2); // Angle of a circle, such that |(cosa, sina) - (1,0)| == dist
756+
const float beta = CAMath::ATan2(mParam.mP[0], mParam.mX);
757+
const int32_t comp = mParam.mP[2] > CAMath::Sin(beta);
758+
const float sinab = CAMath::Sin((comp ? 0.5f : -0.5f) * alpha + beta); // Angle of circle through origin and track position, to be compared to Snp
759+
const float res = CAMath::Abs(sinab - mParam.mP[2]);
760+
761+
if (res < 0.2f) {
762+
const float r = 1.f / r1;
763+
const float dS = alpha * r;
764+
float z0 = dS * mParam.mP[3];
765+
if (CAMath::Abs(z0) > GPUTPCGeometry::TPCLength()) {
766+
z0 = z0 > 0 ? GPUTPCGeometry::TPCLength() : -GPUTPCGeometry::TPCLength();
767+
}
768+
deltaZ = mParam.mP[1] - z0;
769+
beamlineReached = true;
766770
}
767-
deltaZ = mParam.mP[1] - z0;
768-
beamlineReached = true;
769771
}
770772
}
771773

0 commit comments

Comments
 (0)