Cleanup of ca::TripletConstructor.
This MR builds upon !1896 (closed). The main achievement is the elimination of several global fields for storage of temporary (doublet and triplet) hit and track objects. All intermediate results are now kept at local scope. The interface of the class was also changed, such that the final Vector<ca::Triplet>
output object is now a return value, instead of a class member that has to be retrieved by a getter.
In order to eliminate global objects, several private functions of the class (such as FindRightHit()
, FitTriplets()
, FindDoublets()
etc.) were restructured, renamed in some cases, and streamlined. Local lambda expressions were used in some cases. The class functions now explicitly reveal what their input and output is.
The resulting code is, in my opinion, much more concise and readable for a non-expert.
@se.gorbunov There is one potential conflict with !1898 (merged). A lambda expression called fitTrack
now receives a fscal
instead of a float
, according to its header, but at the function calls the values -1.f
and 1.f
are passed. This will not produce any logic errors, but the compiler might complain if fscal
is globally set to something other than float
.
Also: If we could get rid of the debug output checks, i.e. those controlled by
static constexpr bool fDebugDublets = false; // print debug info for dublets
static constexpr bool fDebugTriplets = false; // print debug info for triplets
static constexpr bool fDebugCollectHits = false; // print debug info for CollectHits
then this class could be made even cleaner.
@s.zharko The QA test completes and shows no conflicts.