Skip to content

Commit 7ffb824

Browse files
committed
Theta tolerance in radiants
1 parent b3ce76b commit 7ffb824

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/ACTSDuplicateRemoval.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <IMPL/LCFlagImpl.h>
77

88
#include <algorithm>
9+
#include <cmath>
910

1011
namespace ACTSTracking {
1112
/**
@@ -64,8 +65,8 @@ ACTSDuplicateRemoval::ACTSDuplicateRemoval()
6465
_outputTrackCollection,
6566
std::string("DedupedTruthTracks"));
6667

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));
6970
}
7071

7172
void ACTSDuplicateRemoval::init() {
@@ -109,10 +110,9 @@ void ACTSDuplicateRemoval::processEvent(LCEvent* evt) {
109110
for (EVENT::Track* myTrk : sortedInput) {
110111
bool foundAnEqual = false;
111112

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)));
116116

117117
while (finalTracks.size() > t_bound and
118118
low_theta > finalTracks[t_bound]->getTrackState(TrackState::AtIP)->getTanLambda())

0 commit comments

Comments
 (0)