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

Skip the time component calculation in track param estimation #738

Merged
merged 3 commits into from
Oct 15, 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
3 changes: 0 additions & 3 deletions core/include/traccc/definitions/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,4 @@ using constant = detray::constant<scalar_t>;
// epsilon for float variables
constexpr scalar float_epsilon = 1e-5f;

// pion mass for track parameter estimation
constexpr scalar PION_MASS_MEV = 139.57018f * unit<scalar>::MeV;

} // namespace traccc
32 changes: 5 additions & 27 deletions core/include/traccc/seeding/track_params_estimation_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ inline TRACCC_HOST_DEVICE vector2 uv_transform(const scalar& x,
/// @param bfield is the magnetic field
/// @param mass is the mass of particle
template <typename spacepoint_collection_t>
inline TRACCC_HOST_DEVICE bound_vector seed_to_bound_vector(
const spacepoint_collection_t& sp_collection, const seed& seed,
const vector3& bfield, const scalar mass) {
inline TRACCC_HOST_DEVICE bound_vector
seed_to_bound_vector(const spacepoint_collection_t& sp_collection,
const seed& seed, const vector3& bfield) {

bound_vector params;

Expand Down Expand Up @@ -112,30 +112,8 @@ inline TRACCC_HOST_DEVICE bound_vector seed_to_bound_vector(
getter::element(params, e_bound_qoverp, 0) =
qOverPt / getter::perp(vector2{1., invTanTheta});

// The estimated momentum, and its projection along the magnetic
// field diretion
scalar pInGeV =
math::fabs(1.0f / getter::element(params, e_bound_qoverp, 0));
scalar pzInGeV = 1.0f / math::fabs(qOverPt) * invTanTheta;
scalar massInGeV = mass / unit<scalar>::GeV;

// The estimated velocity, and its projection along the magnetic
// field diretion
scalar v = pInGeV / getter::perp(vector2{pInGeV, massInGeV});
scalar vz = pzInGeV / getter::perp(vector2{pInGeV, massInGeV});
// The z coordinate of the bottom space point along the magnetic
// field direction
scalar pathz =
vector::dot(sp_global_positions[0], bfield) / getter::norm(bfield);

// The estimated time (use path length along magnetic field only if
// it's not zero)
if (pathz != 0) {
getter::element(params, e_bound_time, 0) = pathz / vz;
} else {
getter::element(params, e_bound_time, 0) =
getter::norm(sp_global_positions[0]) / v;
}
// Make sure the time is a finite value
assert(std::isfinite(getter::element(params, e_bound_time, 0)));

return params;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/seeding/track_params_estimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ track_params_estimation::output_type track_params_estimation::operator()(
for (unsigned int i = 0; i < num_seeds; ++i) {
bound_track_parameters track_params;
track_params.set_vector(
seed_to_bound_vector(spacepoints, seeds[i], bfield, PION_MASS_MEV));
seed_to_bound_vector(spacepoints, seeds[i], bfield));

// Set Covariance
for (std::size_t j = 0; j < e_bound_size; ++j) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ inline void estimate_track_params(

// Get bound track parameter
bound_track_parameters track_params;
track_params.set_vector(seed_to_bound_vector(spacepoints_device, this_seed,
bfield, PION_MASS_MEV));
track_params.set_vector(
seed_to_bound_vector(spacepoints_device, this_seed, bfield));

// Set Covariance
for (std::size_t i = 0; i < e_bound_size; i++) {
Expand Down
Loading