Online-capable hitfinder for TRD and TRD2D
- Added online capable TRD hitfinders (1D and 2D) in cbm::algo.
- Added ROOT-free implementations of CbmTrdCluster and CbmTrdHit.
- Added class CbmTaskTrdHitFinder as wrapper for new hitfinders.
- Added class CbmTaskTrdHitFinderParWrite to produce YAML input files.
- Added example macro trd_hitfinder_run.C in beamtime/mcbm2022 folder to run new hitfinder.
- Added a required getter function to CbmTrdParModGeo.h.
- Updated CMakeLists and LinkDef files to enable compilation.
The current state of the code is ready to be integrated into the online reconstruction chain. The hotfix from !1752 (merged) is currently not included and will be implemented separately. The code is also currently not parallelized, which will be a separate MR.
Performance-wise there are drastic improvements compared to the original classes. A benchmark on a single core of a Core i9 13900K CPU shows that a high-multiplicity timeslice with 15 million TRD digis (1D and 2D combined) is processed in less than 10 seconds.
There are surely possibilities for further improvements, both in terms of performance and code structure. In particular, I would like to further clean up the HitFinder2D class. The current state is fit for purpose however.
The 1D system is missing a hit-merge step, as it was concluded in discussions that the original implementation does not work as intended. This can also be added at a later time.
The code is organized as follows: There are now separate classes for the building of clusters and the subsequent creation of hit objects from the clusters (both steps were done in by one class in the original codes). These each exist separately for the 1D and 2D systems. The base classes were dropped entirely, so each algorithm is a stand-alone class. There is a steering class trd/Hitfind
which wraps all of the algorithms. Everything is configurable by YAML files (one for 1D and one for 2D).
ROOT-free versions of CbmTrdCluster
(separately for 1D and 2D) and CbmTrdHit
(combined for 1D and 2D) are included, which do away with the dependency on CBM base classes (such as CbmPixelHit
) etc. The later (hit) class maintains the interface of the original CbmTrdHit
class, so it includes some functions which are not needed by this implementation of the hitfinder. There is also a ROOT-free version of CbmRecoDigi
which is needed by the 2D hitfinder.
There are some preprocessor macros SETBIT
, CLRBIT
etc. which are originally from ROOT and have been re-defined in header files as needed. This currently produces some compiler warnings. We should ultimately put them somewhere in the algo folder (to be decided by @fweig).
Likewise, there is a function TMath:Nint()
which rounds floats to the nearest even integer (Gaussian or Banker's rounding). I found no std function which reproduces this behavior, so I simply copied the ROOT version to the class which needs it.
@fweig in principle this is ready to be added to CbmReco
. The interface is essentially the same as for TOF.
For lack of better ideas, I added @v.friese as reviewer. In principle this is relevant at least for @fweig @a.bercuci @p.kaehler @apuntke @dschledt.
Also maybe of interest to @p.-a.loizeau @f.uhlig
Update: Included the hotfix from !1752 (merged) and added OpenMP parallelization.
Update2: Added unit test supplied by @apuntke