ActsGeometryContext - Non const access
Hi everybody,
this MR improves the memory footprint of the ActsGeometry
in particular of the ActsGeometryContext
.
-
GeoAlignmentStore: The three transform maps holding the alignment delta, the final transformations and the default transformations are now shared pointers --> fast instansiation of the copy constructor (Done in !70221 (merged)).
-
TransformMap: Exploit the
ConcurrentMap
to allow for thread-safe access (Done in !70221 (merged)) -
GeometryContext: Instead of a simple transform map, the context holds for each detector technology a
DetectorAlignStore
(merged in !70220 (merged)). Simply speaking theDetectorAlignStore
is nothing else than a std::vector of unique transform pointers. The vector with full size is allocated if the object is instantiated, but all pointers are set to zero. Each DetectorElement which needs to interact with theDetectorAlignStore
needs to reserve a slot at the construction stage via calling the staticdrawTicket(<DetectorSubsystem>)
method. As theActsDetectorElements
are created and deleted multiple times during the tracking geometry building, the clients are supposed to return their slot to theDetectorAlignmentStore
via calling thegiveBackTicekt()
when they're destructed. Subsequent clients will then draw a ticket from the returned pool avoiding the DetectorAlignmentStores to grow unneccessarily large. -
*TransformCache: Implements the pattern to use the
DetectorAlignmentStore
. If the parent inherits from theGeoVDetectorElement
, the nominal transform cache of theGeoFullPhysVol
is cleared everytime when a new Transform is put into theDetectorAlignmentStore
. -
ActsAlignmentAlgs: Replace the
ActsAlignmentCondAlg
andActsDetAlignCondAlg
by theGeometryContextAlg
, theDetectorAlignCondAlg
and theAlignmentStoreProviderAlg
. Put all the three algorithms into theActsAlignmentAlgs
package in order to be able to use the algorithms also inAthSimulation
(Follow-up MR !70219 (merged)). TheActsDetAlignCondAlg
preserves pretty much the same functionallity as theActsDetAlignCondAlg
. Everytime when the alignment constants run out of scope, a newDetectorAlignStore
object is written into the conditions store holding the alignment deltas. Optionally, the algorithm is interfaced to theActsTrackingGeometrySvc
and to theDetectorVolumeSvc
which then cache the final acts transformations into this instance of theDetectorAlignmentStore
as well. TheAlignmentStoreProviderAlg
is called at the beginning of every event. It fetches theDetectorAlignStore
from theConditionsStore
and write another copy into the event store. If the final transforms have been already populated, it's simply piped into the event store as well. Otherwise a new store is created. TheGeometryContextAlg
packs allDetectorAlignmentStores
written by theAlignmentStoreProviderAlg
isntances and packs them into the EventStore. -
ActsDetectorElement: Use the transform cache to handle the communication with the geometry context. At construction stage, the
TransformCache
draws a unique ticket number to reserve a slot in theDetectorAlignmentStore
and pipes later the transform into the presented store if it's not already present. Further, the class inherits from theGeoVDetectorElement
w
Effect on Itk reconstruction has been evaluated using the Acts spot test:
Log files: spotMain.logspotPatched.log
Algorithm | main | patch | Rel runtime. |
---|---|---|---|
ActsTrackFindingAlg | 783867.76 | 755139.08 | 96% |
ActsPixelSeedingAlg | 128181.73 | 125948.77 | 98% |
ITkPixelClusterization | 47279.76 | 46665.34 | 98% |
ActsPixelClusterizationAlg | 37962.64 | 37168.76 | 98% |
ActsStripSeedingAlg | 26272.70 | 26049.77 | 99% |
ActsStripClusterizationAlg | 22822.71 | 22984.57 | 101% |
ITkInDetToXAODClusterConversion | 21778.60 | 21883.37 | 100% |
ITkStripClusterization | 15474.70 | 15431.59 | 100% |
ActsAmbiguityResolutionAlg | 10061.89 | 9933.53 | 98% |
Overall the changes speed up the top 9 algorithms by 3%.
Check that the reconstruction output remain untouched: All_quick_plots.pdf
Tagging from the Acts group: @ncalace, @cvarni, @asalzbur, @pagessin