9 template <
typename vfitter_t>
11 const std::vector<const InputTrack_t*>& trackVector,
15 bool useConstraint =
false;
16 if (vertexingOptions.vertexConstraint.fullCovariance().determinant() != 0) {
23 std::vector<std::pair<double, double>> zPositions;
25 for (
const auto& iTrk : trackVector) {
29 std::pair<double, double> z0AndWeight;
32 vertexingOptions.vertexConstraint.covariance()(0, 0) != 0) {
33 auto estRes = m_cfg.ipEstimator.estimateImpactParameters(
34 params, vertexingOptions.vertexConstraint,
35 vertexingOptions.geoContext, vertexingOptions.magFieldContext);
39 return estRes.error();
46 ipas.
IPz0 + vertexingOptions.vertexConstraint.position().z();
49 double chi2IP = std::pow(ipas.
IPd0 / ipas.
sigmad0, 2);
51 if (!m_cfg.disableAllWeights) {
53 1. / (1. + std::exp((chi2IP - m_cfg.constraintcutoff) /
54 m_cfg.constrainttemp));
56 if (!std::isnormal(z0AndWeight.second)) {
57 z0AndWeight.second = 0.;
60 z0AndWeight.second = 1.;
64 "Unable to compute IP significance. "
65 "Setting IP weight to 1.");
68 z0AndWeight.second = 1.;
72 if (!m_cfg.disableAllWeights && (m_cfg.usePt || m_cfg.useLogPt)) {
76 z0AndWeight.second *= std::pow(Pt, m_cfg.expPt);
79 Pt > m_cfg.minPt ? std::log(Pt / m_cfg.minPt) : 0.;
83 if (z0AndWeight.second >= m_cfg.minWeight) {
84 zPositions.push_back(z0AndWeight);
88 if (!zPositions.empty()) {
89 auto res = m_cfg.mode1dFinder.getMode(zPositions);
96 ACTS_DEBUG(
"Resulting mean Z position found: " << ZResult);
101 vertexingOptions.vertexConstraint.position().y(),
102 ZResult, vertexingOptions.vertexConstraint.time());
106 std::vector<Vertex<InputTrack_t>> vertexCollection;
109 vertexCollection.push_back(vtxResult);
111 return vertexCollection;