Skip to content
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

refactor: Remove Tesla conversion in estimateTrackParamsFromSeed #3835

Merged
Changes from 2 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
16 changes: 8 additions & 8 deletions Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ std::optional<BoundVector> estimateTrackParamsFromSeed(
}

// Convert bField to Tesla
ActsScalar bFieldInTesla = bField.norm() / UnitConstants::T;
ActsScalar bFieldMinInTesla = bFieldMin / UnitConstants::T;
ActsScalar bFieldStrength = bField.norm();
// Check if magnetic field is too small
if (bFieldInTesla < bFieldMinInTesla) {
if (bFieldStrength < bFieldMin) {
// @todo shall we use straight-line estimation and use default q/pt in such
// case?
ACTS_WARNING("The magnetic field at the bottom space point: B = "
<< bFieldInTesla << " T is smaller than |B|_min = "
<< bFieldMinInTesla << " T. Estimation is not performed.");
ACTS_WARNING(
"The magnetic field at the bottom space point: B = "
<< bFieldStrength / UnitConstants::T << " T is smaller than |B|_min = "
<< bFieldMin / UnitConstants::T << " T. Estimation is not performed.");
return std::nullopt;
}

Expand Down Expand Up @@ -142,7 +142,7 @@ std::optional<BoundVector> estimateTrackParamsFromSeed(
int sign = ia > 0 ? -1 : 1;
const ActsScalar R = circleCenter.norm();
ActsScalar invTanTheta =
local2.z() / (2.f * R * std::asin(local2.head<2>().norm() / (2.f * R)));
local2.z() / (2 * R * std::asin(local2.head<2>().norm() / (2 * R)));
// The momentum direction in the new frame (the center of the circle has the
// coordinate (-1.*A/(2*B), 1./(2*B)))
ActsScalar A = -circleCenter(0) / circleCenter(1);
Expand Down Expand Up @@ -174,7 +174,7 @@ std::optional<BoundVector> estimateTrackParamsFromSeed(

// The estimated q/pt in [GeV/c]^-1 (note that the pt is the projection of
// momentum on the transverse plane of the new frame)
ActsScalar qOverPt = sign * (UnitConstants::m) / (0.3 * bFieldInTesla * R);
ActsScalar qOverPt = sign / (bFieldStrength * R);
// The estimated q/p in [GeV/c]^-1
params[eBoundQOverP] = qOverPt / fastHypot(1., invTanTheta);

Expand Down
Loading