Skip to content
Open
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
5 changes: 4 additions & 1 deletion core/include/traccc/seeding/detail/seeding_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ struct seedfilter_config {
// the impact parameters (d0) is multiplied by this factor and subtracted
// from weight
float impactWeightFactor = 1.f;
// assumed variance of the half-Gaussian distribution of the impact
// parameter $d_0$ in mm
float impactSigma = 5.f;
// seed weight increased by this value if a compatible seed has been found.
float compatSeedWeight = 200.f;
// minimum distance between compatible seeds to be considered for weight
Expand All @@ -211,7 +214,7 @@ struct seedfilter_config {
float good_spB_min_weight = 380.f;

// seed cut
float seed_min_weight = 200.f;
float seed_min_weight = 400.f;
float spB_min_radius = 43.f * unit<float>::mm;
};

Expand Down
32 changes: 28 additions & 4 deletions device/common/include/traccc/seeding/device/impl/find_triplets.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,35 @@ inline void find_triplets(
spM, lb, lt, config, iSinTheta2, scatteringInRegion2, curvature,
impact_parameter)) {

// Compute the weight attributed by the impact factor as the PDF of
// a half-Gaussian distribution, i.e. we compute:
//
// w' = \frac{\sqrt{2}}{\sigma\sqrt{\pi}}
// \exp\left(\frac{-x^2}{2\sigma^2}\right)
//
// However, we would like the weight to be normalized to the range
// [0, 1], so we divide by the maximum probability density which
// is easily found as:
//
// w_{max} = \frac{\sqrt{2}}{\sigma\sqrt{\pi}}
//
// Thus normalizing gives:
//
// w = \frac{w'}{w_{max}} = \exp\left(\frac{-x^2}{2\sigma^2}\right)
//
// Conveniently, this normalization also reduces the number of
// operations to be performed.
scalar impactParameterProb = math::exp(
-(impact_parameter * impact_parameter) /
(2.f * filter_config.impactSigma * filter_config.impactSigma));

scalar weight =
impactParameterProb * filter_config.impactWeightFactor;

// Add triplet to jagged vector
triplets.at(posTriplets++) = device_triplet(
{spB_idx, spM_idx, spT_idx, globalIndex, curvature,
-impact_parameter * filter_config.impactWeightFactor,
lb.Zo()});
triplets.at(posTriplets++) =
device_triplet({spB_idx, spM_idx, spT_idx, globalIndex,
curvature, weight, lb.Zo()});
}
}
}
Expand Down
Loading