diff --git a/Core/include/Acts/Seeding/Seedfinder.ipp b/Core/include/Acts/Seeding/Seedfinder.ipp index 28965b5cedd..f6277a1f628 100644 --- a/Core/include/Acts/Seeding/Seedfinder.ipp +++ b/Core/include/Acts/Seeding/Seedfinder.ipp @@ -116,33 +116,36 @@ void Seedfinder::createSeedsForGroup( // points away from the interaction point in addition to a translation // transformation we also perform a rotation in order to keep the // curvature of the circle tangent to the x axis - float xVal = (topSP->x() - spM->x()) * (spM->x() / rM) + - (topSP->y() - spM->y()) * (spM->y() / rM); - float yVal = (topSP->y() - spM->y()) * (spM->x() / rM) - - (topSP->x() - spM->x()) * (spM->y() / rM); - if (std::abs(rM * yVal) > m_config.impactMax * xVal) { - // conformal transformation u=x/(x²+y²) v=y/(x²+y²) transform the circle - // into straight lines in the u/v plane the line equation can be - // described in terms of aCoef and bCoef, where v = aCoef * u + bCoef - float uT = xVal / (xVal * xVal + yVal * yVal); - float vT = yVal / (xVal * xVal + yVal * yVal); - // in the rotated frame the interaction point is positioned at x = -rM - // and y ~= impactParam - float uIP = -1. / rM; - float vIP = m_config.impactMax / (rM * rM); - if (yVal > 0.) - vIP = -vIP; - // we can obtain aCoef as the slope dv/du of the linear function, - // estimated using du and dv between the two SP bCoef is obtained by - // inserting aCoef into the linear equation - float aCoef = (vT - vIP) / (uT - uIP); - float bCoef = vIP - aCoef * uIP; - // the distance of the straight line from the origin (radius of the - // circle) is related to aCoef and bCoef by d^2 = bCoef^2 / (1 + - // aCoef^2) = 1 / (radius^2) and we can apply the cut on the curvature - if ((bCoef * bCoef) > - (1 + aCoef * aCoef) / m_config.minHelixDiameter2) { - continue; + if (m_config.interactionPointCut) { + float xVal = (topSP->x() - spM->x()) * (spM->x() / rM) + + (topSP->y() - spM->y()) * (spM->y() / rM); + float yVal = (topSP->y() - spM->y()) * (spM->x() / rM) - + (topSP->x() - spM->x()) * (spM->y() / rM); + if (std::abs(rM * yVal) > m_config.impactMax * xVal) { + // conformal transformation u=x/(x²+y²) v=y/(x²+y²) transform the + // circle into straight lines in the u/v plane the line equation can + // be described in terms of aCoef and bCoef, where v = aCoef * u + + // bCoef + float uT = xVal / (xVal * xVal + yVal * yVal); + float vT = yVal / (xVal * xVal + yVal * yVal); + // in the rotated frame the interaction point is positioned at x = -rM + // and y ~= impactParam + float uIP = -1. / rM; + float vIP = m_config.impactMax / (rM * rM); + if (yVal > 0.) + vIP = -vIP; + // we can obtain aCoef as the slope dv/du of the linear function, + // estimated using du and dv between the two SP bCoef is obtained by + // inserting aCoef into the linear equation + float aCoef = (vT - vIP) / (uT - uIP); + float bCoef = vIP - aCoef * uIP; + // the distance of the straight line from the origin (radius of the + // circle) is related to aCoef and bCoef by d^2 = bCoef^2 / (1 + + // aCoef^2) = 1 / (radius^2) and we can apply the cut on the curvature + if ((bCoef * bCoef) > + (1 + aCoef * aCoef) / m_config.minHelixDiameter2) { + continue; + } } } state.compatTopSP.push_back(topSP); @@ -185,33 +188,36 @@ void Seedfinder::createSeedsForGroup( // points away from the interaction point in addition to a translation // transformation we also perform a rotation in order to keep the // curvature of the circle tangent to the x axis - float xVal = (bottomSP->x() - spM->x()) * (spM->x() / rM) + - (bottomSP->y() - spM->y()) * (spM->y() / rM); - float yVal = (bottomSP->y() - spM->y()) * (spM->x() / rM) - - (bottomSP->x() - spM->x()) * (spM->y() / rM); - if (std::abs(rM * yVal) > -m_config.impactMax * xVal) { - // conformal transformation u=x/(x²+y²) v=y/(x²+y²) transform the circle - // into straight lines in the u/v plane the line equation can be - // described in terms of aCoef and bCoef, where v = aCoef * u + bCoef - float uB = xVal / (xVal * xVal + yVal * yVal); - float vB = yVal / (xVal * xVal + yVal * yVal); - // in the rotated frame the interaction point is positioned at x = -rM - // and y ~= impactParam - float uIP = -1. / rM; - float vIP = m_config.impactMax / (rM * rM); - if (yVal < 0.) - vIP = -vIP; - // we can obtain aCoef as the slope dv/du of the linear function, - // estimated using du and dv between the two SP bCoef is obtained by - // inserting aCoef into the linear equation - float aCoef = (vB - vIP) / (uB - uIP); - float bCoef = vIP - aCoef * uIP; - // the distance of the straight line from the origin (radius of the - // circle) is related to aCoef and bCoef by d^2 = bCoef^2 / (1 + - // aCoef^2) = 1 / (radius^2) and we can apply the cut on the curvature - if ((bCoef * bCoef) > - (1 + aCoef * aCoef) / m_config.minHelixDiameter2) { - continue; + if (m_config.interactionPointCut) { + float xVal = (bottomSP->x() - spM->x()) * (spM->x() / rM) + + (bottomSP->y() - spM->y()) * (spM->y() / rM); + float yVal = (bottomSP->y() - spM->y()) * (spM->x() / rM) - + (bottomSP->x() - spM->x()) * (spM->y() / rM); + if (std::abs(rM * yVal) > -m_config.impactMax * xVal) { + // conformal transformation u=x/(x²+y²) v=y/(x²+y²) transform the + // circle into straight lines in the u/v plane the line equation can + // be + // described in terms of aCoef and bCoef, where v = aCoef * u + bCoef + float uB = xVal / (xVal * xVal + yVal * yVal); + float vB = yVal / (xVal * xVal + yVal * yVal); + // in the rotated frame the interaction point is positioned at x = -rM + // and y ~= impactParam + float uIP = -1. / rM; + float vIP = m_config.impactMax / (rM * rM); + if (yVal < 0.) + vIP = -vIP; + // we can obtain aCoef as the slope dv/du of the linear function, + // estimated using du and dv between the two SP bCoef is obtained by + // inserting aCoef into the linear equation + float aCoef = (vB - vIP) / (uB - uIP); + float bCoef = vIP - aCoef * uIP; + // the distance of the straight line from the origin (radius of the + // circle) is related to aCoef and bCoef by d^2 = bCoef^2 / (1 + + // aCoef^2) = 1 / (radius^2) and we can apply the cut on the curvature + if ((bCoef * bCoef) > + (1 + aCoef * aCoef) / m_config.minHelixDiameter2) { + continue; + } } } state.compatBottomSP.push_back(bottomSP); diff --git a/Core/include/Acts/Seeding/SeedfinderConfig.hpp b/Core/include/Acts/Seeding/SeedfinderConfig.hpp index e4ba4997ae2..8597ff7cec1 100644 --- a/Core/include/Acts/Seeding/SeedfinderConfig.hpp +++ b/Core/include/Acts/Seeding/SeedfinderConfig.hpp @@ -65,6 +65,9 @@ struct SeedfinderConfig { // parameters for forward seed confirmation SeedConfirmationRange forwardSeedConfirmationRange; + // enable cut on the compatibility between interaction point and SPs + bool interactionPointCut = false; + // non equidistant binning in z std::vector zBinEdges; diff --git a/Examples/Python/src/TrackFinding.cpp b/Examples/Python/src/TrackFinding.cpp index 63d721190a0..64427dbbdfe 100644 --- a/Examples/Python/src/TrackFinding.cpp +++ b/Examples/Python/src/TrackFinding.cpp @@ -106,6 +106,7 @@ void addTrackFinding(Context& ctx) { ACTS_PYTHON_MEMBER(impactMax); ACTS_PYTHON_MEMBER(zBinEdges); ACTS_PYTHON_MEMBER(enableCutsForSortedSP); + ACTS_PYTHON_MEMBER(interactionPointCut); ACTS_PYTHON_MEMBER(zBinEdges); ACTS_PYTHON_MEMBER(rRangeMiddleSP); ACTS_PYTHON_MEMBER(useVariableMiddleSPRange); diff --git a/Examples/Scripts/Python/itk_seeding.py b/Examples/Scripts/Python/itk_seeding.py index f3c8472cf7e..6aca2160584 100755 --- a/Examples/Scripts/Python/itk_seeding.py +++ b/Examples/Scripts/Python/itk_seeding.py @@ -69,6 +69,7 @@ def runITkSeeding(field, csvInputDir, outputDir, s=None): beamPos=acts.Vector2(0 * u.mm, 0 * u.mm), impactMax=gridConfig.impactMax, maxPtScattering=float("inf") * u.GeV, + interactionPointCut=True, zBinEdges=gridConfig.zBinEdges, enableCutsForSortedSP=True, # enable cotTheta sorting in SeedFinder rRangeMiddleSP=[