Summary
Every output file written by restManager is missing the StreamerInfos of the event classes it contains. Without them ROOT cannot apply schema evolution, so any change to an event class definition makes older files unreadable.
Mechanism
- Worker threads write events to temporary files;
TRestRun::MergeToOutputFile merges them. The merged file at this point has all StreamerInfos.
- The same method then reopens the output in UPDATE mode to write metadata.
- On close,
TFile::WriteStreamerInfo() (see ROOT TFile.cxx) frees the previous StreamerInfo record and writes only the classes streamed during the current session — i.e. only the metadata classes. The event-class infos are gone.
Verified with a minimal reproducer (write tree → infos present; TFileMerger → still present; reopen UPDATE + write a TNamed → event infos wiped). restG4 files are unaffected (single write session).
Consequences
Fix
PR #567 re-tags the existing infos after each UPDATE open so they are rewritten on close. Not covered there (lower risk, could be follow-ups): TFileMerger's own UPDATE path in MergeToOutputFile(outputfilename != ""), TRestAnalysisTree::AddChainFile, and the plot tools' UPDATE sessions (TRestMetadataPlot, TRestDataSetPlot). Read-only UPDATE sessions are safe (WriteStreamerInfo is a no-op unless something was streamed).
Summary
Every output file written by restManager is missing the StreamerInfos of the event classes it contains. Without them ROOT cannot apply schema evolution, so any change to an event class definition makes older files unreadable.
Mechanism
TRestRun::MergeToOutputFilemerges them. The merged file at this point has all StreamerInfos.TFile::WriteStreamerInfo()(see ROOTTFile.cxx) frees the previous StreamerInfo record and writes only the classes streamed during the current session — i.e. only the metadata classes. The event-class infos are gone.Verified with a minimal reproducer (write tree → infos present; TFileMerger → still present; reopen UPDATE + write a TNamed → event infos wiped). restG4 files are unaffected (single write session).
Consequences
TRestDetectorSignalEventfrom older files detectorlib#125: thevector<Float_t>→vector<Double_t>change in TRestDetectorSignal (detectorlib#109) made all pre-v2.4.3 detector signal data unreadable (multi-GB allocations / OOM), because ROOT has no record of the on-disk layout. Recovery tool in Warning if unsupported legacy detector signal branches are used #566.Fix
PR #567 re-tags the existing infos after each UPDATE open so they are rewritten on close. Not covered there (lower risk, could be follow-ups):
TFileMerger's own UPDATE path inMergeToOutputFile(outputfilename != ""),TRestAnalysisTree::AddChainFile, and the plot tools' UPDATE sessions (TRestMetadataPlot,TRestDataSetPlot). Read-only UPDATE sessions are safe (WriteStreamerInfois a no-op unless something was streamed).