|
6 | 6 | #include <IMPL/LCFlagImpl.h> |
7 | 7 |
|
8 | 8 | #include <algorithm> |
| 9 | +#include <cmath> |
9 | 10 |
|
10 | 11 | namespace ACTSTracking { |
11 | 12 | /** |
@@ -64,8 +65,8 @@ ACTSDuplicateRemoval::ACTSDuplicateRemoval() |
64 | 65 | _outputTrackCollection, |
65 | 66 | std::string("DedupedTruthTracks")); |
66 | 67 |
|
67 | | - registerProcessorParameter("ThetaTolerance", "Tolerance for theta in percentage.", |
68 | | - theta_tolerance, 0.01f); |
| 68 | + registerProcessorParameter("ThetaTolerance", "Tolerance for theta in rad.", |
| 69 | + theta_tolerance, 0.01f * static_cast<float>(M_PI)); |
69 | 70 | } |
70 | 71 |
|
71 | 72 | void ACTSDuplicateRemoval::init() { |
@@ -109,10 +110,9 @@ void ACTSDuplicateRemoval::processEvent(LCEvent* evt) { |
109 | 110 | for (EVENT::Track* myTrk : sortedInput) { |
110 | 111 | bool foundAnEqual = false; |
111 | 112 |
|
112 | | - // TODO check for tan_lambda = inf |
113 | | - float tmptl = myTrk->getTrackState(TrackState::AtIP)->getTanLambda(); |
114 | | - float low_theta = tmptl >= 0 ? (1 - theta_tolerance) * tmptl : |
115 | | - (1 + theta_tolerance) * tmptl; |
| 113 | + float l_angle = std::atan(myTrk->getTrackState(TrackState::AtIP)->getTanLambda()); |
| 114 | + l_angle -= theta_tolerance; |
| 115 | + float low_theta = std::tan(std::max(l_angle, -0.5f * static_cast<float>(M_PI))); |
116 | 116 |
|
117 | 117 | while (finalTracks.size() > t_bound and |
118 | 118 | low_theta > finalTracks[t_bound]->getTrackState(TrackState::AtIP)->getTanLambda()) |
|
0 commit comments