-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
invalidThis doesn't seem rightThis doesn't seem right
Description
TRestMetadata::InstantiateChildMetadata calls the metadata Initialize() method after loading its members from the config element. Thus, the child metadata members are reset. I think the call to Initialize() should be before the LoadConfigFromElement() call.
framework/source/framework/core/src/TRestMetadata.cxx
Lines 801 to 802 in df3eb05
| md->LoadConfigFromElement(paraele, Global, {}); | |
| md->Initialize(); |
This was added in commit 5d8cb71 but I dont know what was the reason for it.
I found this when trying to debug the TRestCut applied in TRestDataSetPlot, where the cuts are loaded using this TRestMetadata::InstantiateChildMetadata
| cut->AddCut((TRestCut*)InstantiateChildMetadata("TRestCut", cutName)); |
It also appears for loading the TRestCut in TRestDataSet
| fCut = (TRestCut*)InstantiateChildMetadata("TRestCut"); |
and was recently added in TRestDataSetGainMap
| fCut = (TRestCut*)InstantiateChildMetadata("TRestCut"); |
They still work as expected because the TRestCut::Initialize() method
| void TRestCut::Initialize() { fCuts.clear(); } |
Metadata
Metadata
Labels
invalidThis doesn't seem rightThis doesn't seem right