Skip to content

Commit eee58c4

Browse files
committed
Change momentum cut
1 parent d17ec74 commit eee58c4

File tree

3 files changed

+93
-24
lines changed

3 files changed

+93
-24
lines changed

core/include/traccc/finding/details/combinatorial_kalman_filter.hpp

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,28 @@ combinatorial_kalman_filter(
509509
const bound_track_parameters<algebra_type>& param =
510510
updated_params[link_id];
511511

512+
// Check if the seed shopuld be used
513+
if (step == 0u) {
514+
const scalar_type q{detail::correct_particle_hypothesis(
515+
config.ptc_hypothesis, param)
516+
.charge()};
517+
if (param.pT(q) <=
518+
static_cast<scalar_type>(config.min_pT) / 10.f) {
519+
TRACCC_WARNING_HOST(
520+
"Seed below min. transverse momentum: |pT| = "
521+
<< param.pT(q) << " MeV");
522+
param_liveness.at(link_id) = 0u;
523+
continue;
524+
}
525+
if (param.p(q) <=
526+
static_cast<scalar_type>(config.min_p) / 10.f) {
527+
TRACCC_WARNING_HOST("Seed below min. momentum: |p| = "
528+
<< param.p(q) << " MeV");
529+
param_liveness.at(link_id) = 0u;
530+
continue;
531+
}
532+
}
533+
512534
// Create propagator state
513535
typename traccc::details::ckf_propagator_t<
514536
detector_t, bfield_t>::state propagation(param, field, det);
@@ -529,15 +551,9 @@ combinatorial_kalman_filter(
529551
typename detray::parameter_resetter<
530552
typename detector_t::algebra_type>::state resetter_state{
531553
prop_cfg};
532-
typename detray::momentum_aborter<scalar_type>::state
533-
momentum_aborter_state{};
534554
typename ckf_aborter::state ckf_aborter_state;
535555

536556
// Update the actor config
537-
momentum_aborter_state.min_pT(
538-
static_cast<scalar_type>(config.min_pT));
539-
momentum_aborter_state.min_p(
540-
static_cast<scalar_type>(config.min_p));
541557
ckf_aborter_state.min_step_length =
542558
config.min_step_length_for_next_surface;
543559
ckf_aborter_state.max_count =
@@ -549,8 +565,7 @@ combinatorial_kalman_filter(
549565
propagation,
550566
detray::tie(aborter_state, transporter_state,
551567
interaction_register_state, interactor_state,
552-
resetter_state, momentum_aborter_state,
553-
ckf_aborter_state));
568+
resetter_state, ckf_aborter_state));
554569
TRACCC_DEBUG_HOST("Finished propagation");
555570

556571
// If a surface found, add the parameter for the next
@@ -565,6 +580,28 @@ combinatorial_kalman_filter(
565580
const bound_track_parameters<algebra_type>& out_param =
566581
propagation._stepping.bound_params();
567582

583+
if (const unsigned int n_cands =
584+
step + 1 - links.at(step).at(link_id).n_skipped;
585+
n_cands >= config.duplicate_removal_minimum_length) {
586+
// Check if the track should be continued
587+
const auto& free_param = propagation._stepping();
588+
const scalar_type q{
589+
propagation._stepping.particle_hypothesis().charge()};
590+
if (free_param.pT(q) <=
591+
static_cast<scalar_type>(config.min_pT)) {
592+
TRACCC_WARNING_HOST(
593+
"Track below min. transverse momentum: |pT| = "
594+
<< free_param.pT(q) << " MeV");
595+
param_liveness.at(link_id) = 0u;
596+
}
597+
if (free_param.p(q) <=
598+
static_cast<scalar_type>(config.min_p)) {
599+
TRACCC_WARNING_HOST("Track below min. momentum: |p| = "
600+
<< free_param.p(q) << " MeV");
601+
param_liveness.at(link_id) = 0u;
602+
}
603+
}
604+
568605
const scalar theta = out_param.theta();
569606
if (theta <= 0.f ||
570607
theta >= 2.f * constant<traccc::scalar>::pi) {

core/include/traccc/finding/details/combinatorial_kalman_filter_types.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ using ckf_interactor_t =
3737
detray::pointwise_material_interactor<traccc::default_algebra>;
3838

3939
/// Actor chain used in the Combinatorial Kalman Filter (CKF)
40-
using ckf_actor_chain_t =
41-
detray::actor_chain<detray::pathlimit_aborter<traccc::scalar>,
42-
detray::parameter_transporter<traccc::default_algebra>,
43-
interaction_register<ckf_interactor_t>,
44-
ckf_interactor_t,
45-
detray::parameter_resetter<traccc::default_algebra>,
46-
detray::momentum_aborter<traccc::scalar>, ckf_aborter>;
40+
using ckf_actor_chain_t = detray::actor_chain<
41+
detray::pathlimit_aborter<traccc::scalar>,
42+
detray::parameter_transporter<traccc::default_algebra>,
43+
interaction_register<ckf_interactor_t>, ckf_interactor_t,
44+
detray::parameter_resetter<traccc::default_algebra>, ckf_aborter>;
4745

4846
/// Propagator type used in the Combinatorial Kalman Filter (CKF)
4947
///

device/common/include/traccc/finding/device/impl/propagate_to_next_surface.ipp

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,26 @@ TRACCC_HOST_DEVICE inline void propagate_to_next_surface(
6363
// Input bound track parameter
6464
const bound_track_parameters<> in_par = params.at(param_id);
6565

66+
// Check if the seed shopuld be used
67+
if (link.step == 0u) {
68+
const scalar_t q{
69+
detail::correct_particle_hypothesis(cfg.ptc_hypothesis, in_par)
70+
.charge()};
71+
if (in_par.pT(q) <= static_cast<scalar_t>(cfg.min_pT) / 10.f) {
72+
TRACCC_WARNING_DEVICE(
73+
"Seed below min. transverse momentum: |pT| = %f MeV",
74+
in_par.pT(q));
75+
params_liveness[param_id] = 0u;
76+
return;
77+
}
78+
if (in_par.p(q) <= static_cast<scalar_t>(cfg.min_p) / 10.f) {
79+
TRACCC_WARNING_DEVICE("Seed below min. momentum: |p| = %f MeV",
80+
in_par.p(q));
81+
params_liveness[param_id] = 0u;
82+
return;
83+
}
84+
}
85+
6686
// Create propagator
6787
detray::propagation::config prop_cfg{cfg.propagation};
6888
prop_cfg.navigation.estimate_scattering_noise = false;
@@ -95,10 +115,8 @@ TRACCC_HOST_DEVICE inline void propagate_to_next_surface(
95115
// Parameter resetter
96116
typename detray::detail::tuple_element<4, actor_tuple_type>::type::state s4{
97117
prop_cfg};
98-
// Momentum aborter
99-
typename detray::detail::tuple_element<5, actor_tuple_type>::type::state s5;
100118
// CKF aborter
101-
typename detray::detail::tuple_element<6, actor_tuple_type>::type::state s6;
119+
typename detray::detail::tuple_element<5, actor_tuple_type>::type::state s5;
102120

103121
/*
104122
* If we are running the MBF smoother, we need to accumulate the Jacobians
@@ -114,22 +132,38 @@ TRACCC_HOST_DEVICE inline void propagate_to_next_surface(
114132
s1._full_jacobian_ptr = &payload.tmp_jacobian_ptr[param_id];
115133
}
116134

117-
s5.min_pT(static_cast<scalar_t>(cfg.min_pT));
118-
s5.min_p(static_cast<scalar_t>(cfg.min_p));
119-
s6.min_step_length = cfg.min_step_length_for_next_surface;
120-
s6.max_count = cfg.max_step_counts_for_next_surface;
135+
s5.min_step_length = cfg.min_step_length_for_next_surface;
136+
s5.max_count = cfg.max_step_counts_for_next_surface;
121137

122138
// Propagate to the next surface
123-
propagator.propagate(propagation, detray::tie(s0, s1, s2, s3, s4, s5, s6));
139+
propagator.propagate(propagation, detray::tie(s0, s1, s2, s3, s4, s5));
124140

125141
// If a surface found, add the parameter for the next step
126-
if (s6.success) {
142+
if (s5.success) {
127143
assert(propagation._navigation.is_on_sensitive());
128144
assert(!propagation._stepping.bound_params().is_invalid());
129145

130146
params[param_id] = propagation._stepping.bound_params();
131147
params_liveness[param_id] = 1u;
132148

149+
if (n_cands >= cfg.duplicate_removal_minimum_length) {
150+
// Check if the track should be continued
151+
const auto& free_param = propagation._stepping();
152+
const scalar_t q{
153+
propagation._stepping.particle_hypothesis().charge()};
154+
if (free_param.pT(q) <= static_cast<scalar_t>(cfg.min_pT)) {
155+
TRACCC_WARNING_DEVICE(
156+
"Track below min. transverse momentum: |pT| = %f MeV",
157+
free_param.pT(q));
158+
params_liveness[param_id] = 0u;
159+
}
160+
if (free_param.p(q) <= static_cast<scalar_t>(cfg.min_p)) {
161+
TRACCC_WARNING_DEVICE("Track below min. momentum: |p| = %f MeV",
162+
free_param.p(q));
163+
params_liveness[param_id] = 0u;
164+
}
165+
}
166+
133167
const scalar theta = params[param_id].theta();
134168
if (theta <= 0.f || theta >= 2.f * constant<traccc::scalar>::pi) {
135169
TRACCC_ERROR_DEVICE("Theta is zero after propagation");

0 commit comments

Comments
 (0)