Skip to content

AthenaConfiguration: Fix setting of VarHandleKeyArray properties.

If we set a VarHandleKeyArray based on another handle property:

ghostpjgalg = CompFactory.PseudoJetAlgorithm(
    OutputContainer = "PseudoJetGhostTruth"
    "pjgalg_GhostTruth", ...)
mergepjalg = CompFactory.PseudoJetMerger(
     InputPJContainers = [ghostpjgalg.OutputContainer], ...)

Then the InputPJContainers property gets set to a python list containing a DataHandle instance. If we convert the list to a string using str(), we get something like

"[DataHandle('PseudoJetGhostTruth','W','PseudoJetContainer')]"

However, this is not what the Gaudi JO pointer needs to see. Indeed, if we convert the DataHandle instance itself to a string using str(), we get just

"PseudoJetGhostTruth"

which is what we want. But if we use str() on a list, the list elements get converted using repr(), not str(), giving us what we see above.

Try to fix this by changing the stringification of properties to call str() element-by-element for a list before doing str() on the list itself.

Fixes errors seen in the JetRec unit test. (Which were being ignored due to the lack of a reference file.)

Edited by Scott Snyder

Merge request reports