Draft: GeoModelSvc: make MaterialManager methods non-const
This is an attempt to make GeoModelSvc
"thread-safe", i.e. pass the thread-checker.
The main problems is that all the StoredMaterialManager interfaces are const
and use mutable
for the list of materials. Making addMaterial
non-const was rather easy (and probably uncontroversial) as it's only used in a few places.
The bigger problem is getMaterial
, which is used in pretty much all detector-specific factories. As an example, I applied the necessary fixes to InDetServMatGeoModel
. At least for this package this works without problems. Not sure there are any road-blocks in other packages.
But before going further, I would like to have feedback from @tsulaia and @ssnyder if this is the way we want to go. Another option could be to leave getMaterial const
and make sure the code is actually thread-safe. Although from what I have seen so far, the code really does not need to be thread-safe/const.
Merge request reports
Activity
Hi @fwinkl , your changes look good to me. The reason why we have there the combination of
const
andmutable
is purely historical.Since we are on it, perhaps we should also do the same with
getElement()
andm_elementVector
? This can be done in a separate MR later on.Thanks.
mentioned in merge request !54069 (merged)
OK, thanks for the feedback. I started with the most invasive
getMaterial
change in !54069 (merged) and will follow-up with the rest. Closing this MR here...mentioned in merge request !54097 (merged)