make musrRootValidation TDirectory compatible.

This commit is contained in:
2025-09-29 14:28:53 +02:00
parent 2b67c76b3c
commit 935d0420d3

View File

@@ -249,6 +249,8 @@ void PMusrRoot2Xml::DumpDirectory(TDirectoryFile *dir, UInt_t offset)
oo = static_cast<TKey*>(obj)->ReadObj(); oo = static_cast<TKey*>(obj)->ReadObj();
if (!fQuiet) std::cout << std::endl << offsetStr << "name: " << oo->GetName() << ", class name: " << oo->ClassName(); if (!fQuiet) std::cout << std::endl << offsetStr << "name: " << oo->GetName() << ", class name: " << oo->ClassName();
str = oo->ClassName(); str = oo->ClassName();
if (TString(oo->GetName()).Contains("Detector0"))
fNoOfDetectors++;
CheckClass(oo, str, offset); CheckClass(oo, str, offset);
} }
} }
@@ -443,6 +445,37 @@ void PMusrRoot2Xml::CheckClass(TObject *obj, TString str, UInt_t offset)
} else if (str == "TObjArray") { } else if (str == "TObjArray") {
offset += 2; offset += 2;
DumpObjArray(dynamic_cast<TObjArray*>(obj), offset); DumpObjArray(dynamic_cast<TObjArray*>(obj), offset);
} else if (str == "TObjString") {
TObjString *ostr = dynamic_cast<TObjString*>(obj);
TString tstr = ostr->GetString();
tstr.Remove(TString::kTrailing, '\n');
TString type, label;
GetType(tstr, type);
GetLabel(tstr, label);
// filter out the number of histograms according to the RunInfo
if (tstr.Contains("- No of Histos: ")) {
TString histoStr = tstr;
Ssiz_t pos = histoStr.Last(':');
histoStr.Remove(0, pos+1);
pos = histoStr.Last('-');
histoStr.Remove(pos);
fNoOfHistos = histoStr.Atoi();
}
// filter out the number of Red/Green offsets
if (tstr.Contains("- RedGreen Offsets: ")) {
TString redGreenStr = tstr;
Ssiz_t pos = redGreenStr.Last(':');
redGreenStr.Remove(0, pos+1);
pos = redGreenStr.Last('-');
redGreenStr.Remove(pos);
TObjArray *tokens = redGreenStr.Tokenize(";");
if (tokens)
fNoOfRedGreenOffsets = tokens->GetEntries();
if (tokens) delete tokens;
}
} else { } else {
// filter out the proper entry tag // filter out the proper entry tag
TString entryTag(""); TString entryTag("");