Try to rm the const_cast and thread unsafe annotations from the TrackSlimmingTool (ATLASRECTS-7295)
Let me ping @ssnyder and @fwinkl .
This might work or not at the end, but is one of the ways to get rid of the const_cast
s.
Steps
-
We want to split the
types
, from the persistificationhints
that we want to treat in a special manner. Basically, these are 2 different things set/used into different manner, I assume they are together due to legacy/persistency/convenience. -
Now this brings already one problem as we have the
persistent
side storing a singleulong
. This leads to the bulk of the changes being in the T/P converters. -
To keep the single ulong in the persistent side, and 2 bitsets in the transient side we need to somehow be able to join the 2
bitsets
for storing inpers
and splitting them back intrans
. See (https://godbolt.org/z/58bo8qr34). -
Then for the
hints
that we have now split out we want them to be only set one time from theslimmingTool
. If we try to reset already set hints we throw. See (https://godbolt.org/z/GEaETxMo3) -
In the slimming tool we collect all the hints in a local bitset and then we move them to this special
setter
.
If the slimming tool thins things only once, and I have not nuked the T/P
side it might work ...