From 5a478efff9c5d62d4317051e7dc1a5209ca007b6 Mon Sep 17 00:00:00 2001 From: Barak Schmookler Date: Thu, 11 Jan 2024 10:07:39 -0500 Subject: [PATCH] Small change to phi difference calculation in seed charge determination --- src/algorithms/tracking/TrackSeeding.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/algorithms/tracking/TrackSeeding.cc b/src/algorithms/tracking/TrackSeeding.cc index e0e06058fa..255dbef985 100644 --- a/src/algorithms/tracking/TrackSeeding.cc +++ b/src/algorithms/tracking/TrackSeeding.cc @@ -270,8 +270,8 @@ int eicrecon::TrackSeeding::determineCharge(std::vector>& const auto firstphi = atan2(firstpos.second, firstpos.first); const auto secondphi = atan2(secondpos.second, secondpos.first); auto dphi = secondphi - firstphi; - if(dphi > M_PI) dphi = 2.*M_PI - dphi; - if(dphi < -M_PI) dphi = 2*M_PI + dphi; + if(dphi > M_PI) dphi -= 2.*M_PI; + if(dphi < -M_PI) dphi += 2*M_PI; if(dphi < 0) charge = -1; return charge;