add new method GetTypeOfPath to TMusrRunHeader. It allows deduce the type of a given path-name.
This commit is contained in:
parent
bfd7229252
commit
90fb81f16a
62
src/external/MusrRoot/TMusrRunHeader.cpp
vendored
62
src/external/MusrRoot/TMusrRunHeader.cpp
vendored
@ -394,6 +394,68 @@ Bool_t TMusrRunHeader::FillFolder(TFolder *folder)
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GetTypeOfPath (public)
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Get type of path-name, e.g. RunInfo/Sample Name.
|
||||
*
|
||||
* @param pathName path-name for which the type is requested
|
||||
*
|
||||
* @return the type, or 'undef' if path-name is not found.
|
||||
*/
|
||||
TString TMusrRunHeader::GetTypeOfPath(TString pathName)
|
||||
{
|
||||
TString type("undef");
|
||||
|
||||
// find pathName
|
||||
for (Int_t i=0; i<fStringObj.size(); i++) {
|
||||
if (fStringObj[i].GetPathName() == pathName) {
|
||||
type = fStringObj[i].GetType();
|
||||
return type;
|
||||
}
|
||||
}
|
||||
for (Int_t i=0; i<fIntObj.size(); i++) {
|
||||
if (fIntObj[i].GetPathName() == pathName) {
|
||||
type = fIntObj[i].GetType();
|
||||
return type;
|
||||
}
|
||||
}
|
||||
for (Int_t i=0; i<fDoubleObj.size(); i++) {
|
||||
if (fDoubleObj[i].GetPathName() == pathName) {
|
||||
type = fDoubleObj[i].GetType();
|
||||
return type;
|
||||
}
|
||||
}
|
||||
for (Int_t i=0; i<fMusrRunPhysQuantityObj.size(); i++) {
|
||||
if (fMusrRunPhysQuantityObj[i].GetPathName() == pathName) {
|
||||
type = fMusrRunPhysQuantityObj[i].GetType();
|
||||
return type;
|
||||
}
|
||||
}
|
||||
for (Int_t i=0; i<fStringVectorObj.size(); i++) {
|
||||
if (fStringVectorObj[i].GetPathName() == pathName) {
|
||||
type = fStringVectorObj[i].GetType();
|
||||
return type;
|
||||
}
|
||||
}
|
||||
for (Int_t i=0; i<fIntVectorObj.size(); i++) {
|
||||
if (fIntVectorObj[i].GetPathName() == pathName) {
|
||||
type = fIntVectorObj[i].GetType();
|
||||
return type;
|
||||
}
|
||||
}
|
||||
for (Int_t i=0; i<fDoubleVectorObj.size(); i++) {
|
||||
if (fDoubleVectorObj[i].GetPathName() == pathName) {
|
||||
type = fDoubleVectorObj[i].GetType();
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Get (public)
|
||||
//--------------------------------------------------------------------------
|
||||
|
2
src/external/MusrRoot/TMusrRunHeader.h
vendored
2
src/external/MusrRoot/TMusrRunHeader.h
vendored
@ -133,6 +133,8 @@ public:
|
||||
virtual Bool_t ExtractAll(TFolder *folder);
|
||||
virtual Bool_t ExtractHeaderInformation(TObjArray *headerInfo, TString path);
|
||||
|
||||
virtual TString GetTypeOfPath(TString pathName);
|
||||
|
||||
virtual void Get(TString pathName, TString &value, Bool_t &ok);
|
||||
virtual void Get(TString pathName, Int_t &value, Bool_t &ok);
|
||||
virtual void Get(TString pathName, Double_t &value, Bool_t &ok);
|
||||
|
Loading…
x
Reference in New Issue
Block a user