Project
Loading...
Searching...
No Matches
CandidateFinding.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
18
20{
21
23 const GlobalMeasurement& sourceMeasurement,
25 float beamPositionVariance,
27 const TrackletProjectionCache& edgeCache,
28 const o2::itsmft::IndexTableUtilsCore& indexUtils,
29 float nSigmaCut,
31{
32 const bool disk = kind == SurfaceKind::Disk;
33 const float referenceCoordinate = disk ? sourceMeasurement.z : sourceMeasurement.radius;
34 const float referenceOrigin = disk ? vertex.getZ() : 0.f;
35 const float projectedCoordinate = disk ? sourceMeasurement.radius : sourceMeasurement.z;
36 const float projectedOrigin = disk ? 0.f : vertex.getZ();
37 const float targetMin = disk ? edgeCache.targetMinZ : edgeCache.targetMinR;
38 const float targetMax = disk ? edgeCache.targetMaxZ : edgeCache.targetMaxR;
39 const float referenceDelta = referenceCoordinate - referenceOrigin;
40 const float projectedDelta = projectedCoordinate - projectedOrigin;
41 if (!(targetMin <= targetMax) ||
42 !(o2::gpu::CAMath::Abs(referenceDelta) > o2::its::constants::Tolerance) ||
43 (disk && !(projectedDelta > o2::its::constants::Tolerance))) {
44 return false;
45 }
46
47 const float slope = projectedDelta / referenceDelta; // tan(lambda) for cylinders, 1/tan(lambda) for disks
48 const float targetCoordinate = 0.5f * (targetMin + targetMax);
49 const float referenceToTarget = targetCoordinate - referenceCoordinate;
50 const float prediction = projectedCoordinate + slope * referenceToTarget;
51 if (disk && !(prediction > 0.f)) {
52 return false;
53 }
54
55 const float sourceCoordinateVariance = o2::its::math_utils::Sq(edgeCache.sourcePositionResolution);
56 const float referenceOriginVariance = disk ? vertex.getSigmaZ2() : beamPositionVariance;
57 const float projectedOriginVariance = disk ? beamPositionVariance : vertex.getSigmaZ2();
58 const float inverseReferenceDelta = 1.f / referenceDelta;
59 const float sourceVarianceScale = (1.f + o2::its::math_utils::Sq(slope)) * sourceCoordinateVariance;
60 const float originVarianceScale = projectedOriginVariance + o2::its::math_utils::Sq(slope) * referenceOriginVariance;
61 const float edgeMSVarianceScale = o2::its::math_utils::Sq(edgeCache.edgeMSAngle);
62 const float varianceConstant = sourceVarianceScale;
63 const float varianceLinear = 2.f * inverseReferenceDelta * sourceVarianceScale;
64 const float varianceQuadratic = o2::its::math_utils::Sq(inverseReferenceDelta) *
65 (sourceVarianceScale + originVarianceScale) +
66 edgeMSVarianceScale;
67 const float minDelta = targetMin - referenceCoordinate;
68 const float minPrediction = projectedCoordinate + slope * minDelta;
69 const float minVariance = varianceConstant + minDelta * (varianceLinear + minDelta * varianceQuadratic);
70 const float maxDelta = targetMax - referenceCoordinate;
71 const float maxPrediction = projectedCoordinate + slope * maxDelta;
72 const float maxVariance = varianceConstant + maxDelta * (varianceLinear + maxDelta * varianceQuadratic);
73 const float lowerBound = o2::gpu::CAMath::Min(minPrediction - nSigmaCut * o2::gpu::CAMath::Sqrt(minVariance),
74 maxPrediction - nSigmaCut * o2::gpu::CAMath::Sqrt(maxVariance));
75 const float upperBound = o2::gpu::CAMath::Max(minPrediction + nSigmaCut * o2::gpu::CAMath::Sqrt(minVariance),
76 maxPrediction + nSigmaCut * o2::gpu::CAMath::Sqrt(maxVariance));
77 const float searchPrediction = 0.5f * (lowerBound + upperBound);
78 const float searchHalfWidth = 0.5f * (upperBound - lowerBound);
79
80 const auto bins = o2::itsmft::getBinsPhiColumn(sourceMeasurement.phi, edgeCache.toLayer,
81 searchPrediction, searchHalfWidth,
82 edgeCache.edgePhiCut, indexUtils);
83 if (bins.x < 0) {
84 return false;
85 }
86 out = {bins,
87 referenceCoordinate,
88 projectedCoordinate,
89 slope,
90 varianceConstant,
91 varianceLinear,
92 varianceQuadratic,
93 sourceMeasurement.phi,
94 o2::its::math_utils::Sq(edgeCache.edgePhiCut / nSigmaCut)};
95 return true;
96}
97
98} // namespace o2::itsmft::tracking
uint64_t vertex
Definition RawEventData.h:9
Shared index-table utilities for periodic-phi surface charts.
bounded_vector< float > bins
uint16_t slope
Definition RawData.h:1
constexpr float Tolerance
Definition Constants.h:30
bool projectTrackletSearchWindow(const GlobalMeasurement &sourceMeasurement, const o2::its::Vertex &vertex, float beamPositionVariance, SurfaceKind kind, const TrackletProjectionCache &edgeCache, const o2::itsmft::IndexTableUtilsCore &indexUtils, float nSigmaCut, TrackletSearchWindow &out)