|
musrfit 1.10.0
|
#include <TMusrRunHeader.h>


Public Member Functions | |
| TMusrRunHeader (bool quiet=false) | |
| TMusrRunHeader (const char *fileName, bool quiet=false) | |
| virtual | ~TMusrRunHeader () |
| virtual TString | GetFileName () |
| virtual Bool_t | FillFolder (TFolder *folder) |
| virtual Bool_t | FillDirectory (TDirectory *dir) |
| virtual Bool_t | ExtractAll (TFolder *folder) |
| virtual Bool_t | ExtractAll (TDirectory *dir) |
| virtual Bool_t | ExtractHeaderInformationData (TObjString *headerData, TString path) |
| 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) |
| virtual void | Get (TString pathName, TMusrRunPhysicalQuantity &value, Bool_t &ok) |
| virtual void | Get (TString pathName, TStringVector &value, Bool_t &ok) |
| virtual void | Get (TString pathName, TIntVector &value, Bool_t &ok) |
| virtual void | Get (TString pathName, TDoubleVector &value, Bool_t &ok) |
| virtual void | SetFileName (TString fln) |
| virtual void | Set (TString pathName, TString value) |
| virtual void | Set (TString pathName, Int_t value) |
| virtual void | Set (TString pathName, Double_t value) |
| virtual void | Set (TString pathName, TMusrRunPhysicalQuantity value) |
| virtual void | Set (TString pathName, TStringVector value) |
| virtual void | Set (TString pathName, TIntVector value) |
| virtual void | Set (TString pathName, TDoubleVector value) |
| virtual void | DumpHeader () |
Private Member Functions | |
| virtual void | Init (TString str="n/a") |
| virtual void | CleanUp () |
| virtual UInt_t | GetDecimalPlace (Double_t val) |
| virtual UInt_t | GetLeastSignificantDigit (Double_t val) const |
| virtual void | SplitPathName (TString pathName, TString &path, TString &name) |
| virtual TString | GetLabel (TString str) |
| virtual TString | GetStrValue (TString str) |
| virtual TString | GetType (TString str) |
| virtual bool | UpdateFolder (TObject *treeObj, TString path) |
| virtual bool | UpdateDirTree (TDirectory *topdir) |
| virtual TObject * | FindObject (TObject *treeObj, TString path) |
| virtual TObjString | GetHeaderString (UInt_t idx) |
| virtual bool | RemoveFirst (TString &str, const char splitter) |
| virtual TString | GetFirst (TString &str, const char splitter) |
Private Attributes | |
| bool | fQuiet |
| TString | fFileName |
| TString | fVersion |
| std::vector< TMusrRunObject< TString > > | fStringObj |
| std::vector< TMusrRunObject< Int_t > > | fIntObj |
| std::vector< TMusrRunObject< Double_t > > | fDoubleObj |
| std::vector< TMusrRunObject< TMusrRunPhysicalQuantity > > | fMusrRunPhysQuantityObj |
| std::vector< TMusrRunObject< TStringVector > > | fStringVectorObj |
| std::vector< TMusrRunObject< TIntVector > > | fIntVectorObj |
| std::vector< TMusrRunObject< TDoubleVector > > | fDoubleVectorObj |
| std::vector< TString > | fPathNameOrder |
| keeps the path-name as they were created in ordered to keep ordering | |
Definition at line 123 of file TMusrRunHeader.h.
| TMusrRunHeader::TMusrRunHeader | ( | bool | quiet = false | ) |
| TMusrRunHeader::TMusrRunHeader | ( | const char * | fileName, |
| bool | quiet = false ) |
Constructor.
| fileName | file name of the MusrRoot file. |
| quiet | if set to true, warnings will be omited. Default is false. |
Definition at line 232 of file TMusrRunHeader.cpp.
|
virtual |
|
privatevirtual |
Clean up internal stuff.
Definition at line 316 of file TMusrRunHeader.cpp.
References fDoubleObj, fDoubleVectorObj, fIntObj, fIntVectorObj, fMusrRunPhysQuantityObj, fPathNameOrder, fStringObj, and fStringVectorObj.
Referenced by ExtractAll(), ExtractAll(), and ~TMusrRunHeader().
|
virtual |
Dumps the header informaton onto the stdout.
Definition at line 1239 of file TMusrRunHeader.cpp.
References fDoubleObj, fDoubleVectorObj, fFileName, fIntObj, fIntVectorObj, fMusrRunPhysQuantityObj, fPathNameOrder, fStringObj, fStringVectorObj, GetDecimalPlace(), TMusrRunPhysicalQuantity::GetDemand(), TMusrRunPhysicalQuantity::GetDescription(), TMusrRunPhysicalQuantity::GetError(), TMusrRunPhysicalQuantity::GetLabel(), GetLeastSignificantDigit(), TMusrRunPhysicalQuantity::GetUnit(), TMusrRunPhysicalQuantity::GetValue(), MRH_DOUBLE, MRH_DOUBLE_PREC, MRH_DOUBLE_VECTOR, MRH_INT, MRH_INT_VECTOR, MRH_TMUSR_RUN_PHYSICAL_QUANTITY, MRH_TSTRING, MRH_TSTRING_VECTOR, MRH_UNDEFINED, and SplitPathName().
|
virtual |
Reads all data from an open ROOT-file structure and feeds all the necessary internal data objects.
| dir | TDirectory object. The top one will be 'RunHeader'. |
Definition at line 960 of file TMusrRunHeader.cpp.
References CleanUp(), ExtractAll(), and ExtractHeaderInformationData().
|
virtual |
Reads all data from an open ROOT-file structure and feeds all the necessary internal data objects.
| folder | top folder 'RunHeader'. |
Definition at line 934 of file TMusrRunHeader.cpp.
References CleanUp(), and ExtractHeaderInformation().
Referenced by ExtractAll().
|
virtual |
TFolder releated routine needed to recursively decode the header information.
| headerInfo | header info object. It is either a TObjArray or a data object. |
| requestedPath | corresponding TFolder/TDiretory path. |
Definition at line 1207 of file TMusrRunHeader.cpp.
References ExtractHeaderInformation(), and ExtractHeaderInformationData().
Referenced by ExtractAll(), and ExtractHeaderInformation().
|
virtual |
Extract the header information data and fills the corresponing objects.
| headerData | encoded header data. |
| requestedPath | corresponding TFolder/TDiretory path. |
Definition at line 999 of file TMusrRunHeader.cpp.
References GetLabel(), GetStrValue(), GetType(), Set(), TMusrRunPhysicalQuantity::SetDemand(), TMusrRunPhysicalQuantity::SetDescription(), TMusrRunPhysicalQuantity::SetError(), TMusrRunPhysicalQuantity::SetLabel(), TMusrRunPhysicalQuantity::SetUnit(), and TMusrRunPhysicalQuantity::SetValue().
Referenced by ExtractAll(), and ExtractHeaderInformation().
|
virtual |
Fills the RunHeader directory. This is needed to write it to a ROOT file. It walks through all information and attaches it to the directory or replaces it, if it is already present.
| dir | to be filled |
Definition at line 413 of file TMusrRunHeader.cpp.
References fPathNameOrder, GetFirst(), GetHeaderString(), and UpdateDirTree().
|
virtual |
Fills the RunHeader folder. This is needed to write it to a ROOT file. It walks through all information and attaches it to the folder or replaces it, if it is already present.
| folder | to be filled |
Definition at line 341 of file TMusrRunHeader.cpp.
References FindObject(), fPathNameOrder, GetFirst(), GetHeaderString(), and UpdateFolder().
Referenced by main().
|
privatevirtual |
Check if 'path' is present in 'treeObj'
| treeObj | to be searched |
| path | searched for within 'treeObj' |
Definition at line 1714 of file TMusrRunHeader.cpp.
References FindObject(), GetFirst(), and RemoveFirst().
Referenced by FillFolder(), and FindObject().
|
virtual |
Get Double_t 'value'.
| pathName | path/name within the header, e.g. RunInfo/Time Zero Bin |
| value | Double_t return value |
| ok | flag telling if the Double_t value was found |
Definition at line 584 of file TMusrRunHeader.cpp.
References fDoubleObj.
|
virtual |
Get Int_t 'value'.
| pathName | path/name within the header, e.g. RunInfo/Run Number |
| value | Int_t return value |
| ok | flag telling if the Int_t value was found |
Definition at line 562 of file TMusrRunHeader.cpp.
References fIntObj.
|
virtual |
Get TDoubleVector 'value'.
| pathName | path/name within the header, e.g. RunInfo/Run Title |
| value | TDoubleVector return value |
| ok | flag telling if the TDoubleVector value was found |
Definition at line 672 of file TMusrRunHeader.cpp.
References fDoubleVectorObj.
|
virtual |
Get TIntVector 'value'.
| pathName | path/name within the header, e.g. RunInfo/Run Title |
| value | TIntVector return value |
| ok | flag telling if the TIntVector value was found |
Definition at line 650 of file TMusrRunHeader.cpp.
References fIntVectorObj.
|
virtual |
Get TMusrRunPhysicalQuantity 'value'.
| pathName | path/name within the header, e.g. RunInfo/Run Title |
| value | TMusrRunPhysicalQuantity return value |
| ok | flag telling if the TMusrRunPhysicalQuantity value was found |
Definition at line 606 of file TMusrRunHeader.cpp.
References fMusrRunPhysQuantityObj.
|
virtual |
Get TString 'value'.
| pathName | path/name within the header, e.g. RunInfo/Run Title |
| value | TString return value |
| ok | flag telling if the TString value was found |
Definition at line 540 of file TMusrRunHeader.cpp.
References fStringObj.
|
virtual |
Get TStringVector 'value'.
| pathName | path/name within the header, e.g. RunInfo/Run Title |
| value | TStringVector return value |
| ok | flag telling if the TStringVector value was found |
Definition at line 628 of file TMusrRunHeader.cpp.
References fStringVectorObj.
|
privatevirtual |
Check decimal place of val. If val > 1.0, the function will return 0, otherwise the first decimal place found will be returned.
| val | value from which the first significant digit shall be determined |
Definition at line 1407 of file TMusrRunHeader.cpp.
Referenced by DumpHeader(), and GetHeaderString().
|
inlinevirtual |
Definition at line 130 of file TMusrRunHeader.h.
References fFileName.
|
privatevirtual |
Assuming a string built like 'this/is/a/string:with:diffrent:splitters'. Using as splitter '/', this routine would return 'this', it means get from str everything up to the first occurance of splitter. If splitter would be ':' in this example, the return string would be 'this/is/a/string'.
If splitter is not present in str the original str is returned.
| str | |
| splitter |
Definition at line 1932 of file TMusrRunHeader.cpp.
Referenced by FillDirectory(), FillFolder(), FindObject(), and UpdateFolder().
|
privatevirtual |
Encodes the header information into the MusrRoot header line in the file.
| idx | absolut index of the header string. |
Definition at line 1749 of file TMusrRunHeader.cpp.
References fDoubleObj, fDoubleVectorObj, fIntObj, fIntVectorObj, fMusrRunPhysQuantityObj, fPathNameOrder, fStringObj, fStringVectorObj, GetDecimalPlace(), TMusrRunPhysicalQuantity::GetDemand(), TMusrRunPhysicalQuantity::GetDescription(), TMusrRunPhysicalQuantity::GetError(), TMusrRunPhysicalQuantity::GetLabel(), GetLeastSignificantDigit(), TMusrRunPhysicalQuantity::GetUnit(), TMusrRunPhysicalQuantity::GetValue(), MRH_DOUBLE, MRH_DOUBLE_PREC, MRH_DOUBLE_VECTOR, MRH_INT, MRH_INT_VECTOR, MRH_TMUSR_RUN_PHYSICAL_QUANTITY, MRH_TSTRING, MRH_TSTRING_VECTOR, MRH_UNDEFINED, and SplitPathName().
Referenced by FillDirectory(), and FillFolder().
|
privatevirtual |
extracts form the run header line, as written to the MusrROOT file, the run header label, e.g. Run Number.
| str | runHeader string as written to the MusrROOT file. |
Definition at line 1488 of file TMusrRunHeader.cpp.
References fQuiet.
Referenced by ExtractHeaderInformationData().
|
privatevirtual |
returns the number of significant digits
| val | value from which the lowest significant digit shall be determined |
Definition at line 1434 of file TMusrRunHeader.cpp.
Referenced by DumpHeader(), and GetHeaderString().
|
privatevirtual |
extracts form the run header line, as written to the MusrROOT file, the run header str value, e.g. 557 (for Run Number).
| str | runHeader string as written to the MusrROOT file. |
Definition at line 1522 of file TMusrRunHeader.cpp.
References fQuiet.
Referenced by ExtractHeaderInformationData().
|
privatevirtual |
extracts form the run header line, as written to the MusrROOT file, the encoded type and retruns it.
| str | runHeader string with encoded type |
Definition at line 1556 of file TMusrRunHeader.cpp.
References fQuiet, MRH_DOUBLE, MRH_DOUBLE_VECTOR, MRH_INT, MRH_INT_VECTOR, MRH_TMUSR_RUN_PHYSICAL_QUANTITY, MRH_TSTRING, and MRH_TSTRING_VECTOR.
Referenced by ExtractHeaderInformationData().
|
virtual |
Get type of path-name, e.g. RunInfo/Sample Name.
| pathName | path-name for which the type is requested |
Definition at line 478 of file TMusrRunHeader.cpp.
References fDoubleObj, fDoubleVectorObj, fIntObj, fIntVectorObj, fMusrRunPhysQuantityObj, fStringObj, and fStringVectorObj.
|
privatevirtual |
Initializer
| fileName | file name of the caller. |
Definition at line 246 of file TMusrRunHeader.cpp.
References fFileName, fVersion, Set(), and TMusrRunPhysicalQuantity::Set().
Referenced by TMusrRunHeader().
|
privatevirtual |
Removes the first junk of a string up to 'splitter'. If 'splitter' is NOT present in the string, the string stays untouched and the routine returns false.
| str | string to be truncated |
| splitter | the start of the string up to the splitter character removed |
Definition at line 1905 of file TMusrRunHeader.cpp.
Referenced by FindObject(), and UpdateFolder().
|
virtual |
Set Double_t 'value'.
| pathName | path/name within the header, e.g. RunInfo/DoubleValue |
| value | of the entry |
Definition at line 761 of file TMusrRunHeader.cpp.
References fDoubleObj, fPathNameOrder, and fQuiet.
|
virtual |
Set Int_t 'value'.
| pathName | path/name within the header, e.g. RunInfo/Run number |
| value | of the entry |
Definition at line 727 of file TMusrRunHeader.cpp.
References fIntObj, fPathNameOrder, and fQuiet.
|
virtual |
Set TDoubleVector 'value'.
| pathName | path/name within the header, e.g. RunInfo/Time Zero Bin |
| value | of the entry |
Definition at line 897 of file TMusrRunHeader.cpp.
References fDoubleVectorObj, fPathNameOrder, and fQuiet.
|
virtual |
Set TIntVector 'value'.
| pathName | path/name within the header, e.g. RunInfo/Time Zero Bin |
| value | of the entry |
Definition at line 863 of file TMusrRunHeader.cpp.
References fIntVectorObj, fPathNameOrder, and fQuiet.
|
virtual |
Set TMusrRunPhysicalQuantity 'value'.
| pathName | path/name within the header, e.g. RunInfo/Muon Beam Momentum |
| value | of the entry |
Definition at line 795 of file TMusrRunHeader.cpp.
References fMusrRunPhysQuantityObj, fPathNameOrder, and fQuiet.
|
virtual |
Set TString 'value'.
| pathName | path/name within the header, e.g. RunInfo/Run Title |
| value | of the entry |
Definition at line 693 of file TMusrRunHeader.cpp.
References fPathNameOrder, fQuiet, and fStringObj.
Referenced by ExtractHeaderInformationData(), Init(), and main().
|
virtual |
Set TStringVector 'value'.
| pathName | path/name within the header, e.g. RunInfo/Histo names |
| value | of the entry |
Definition at line 829 of file TMusrRunHeader.cpp.
References fPathNameOrder, fQuiet, and fStringVectorObj.
|
inlinevirtual |
Definition at line 150 of file TMusrRunHeader.h.
References fFileName.
|
privatevirtual |
splits a path name string into the path and the name.
| pathName | path name to be split |
| path | of pathName |
| name | of pathName |
Definition at line 1465 of file TMusrRunHeader.cpp.
Referenced by DumpHeader(), and GetHeaderString().
|
privatevirtual |
Update directory tree for RunHeader
| dir | top directory pointer |
Definition at line 1669 of file TMusrRunHeader.cpp.
References fPathNameOrder.
Referenced by FillDirectory().
|
privatevirtual |
Update folder structure
| treeObj | to be updated |
| path | to be added within 'treeObj' |
Definition at line 1624 of file TMusrRunHeader.cpp.
References GetFirst(), RemoveFirst(), and UpdateFolder().
Referenced by FillFolder(), and UpdateFolder().
|
private |
Definition at line 169 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
Definition at line 173 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
Definition at line 164 of file TMusrRunHeader.h.
Referenced by DumpHeader(), GetFileName(), Init(), and SetFileName().
|
private |
Definition at line 168 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
Definition at line 172 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
Definition at line 170 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
keeps the path-name as they were created in ordered to keep ordering
Definition at line 175 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), FillDirectory(), FillFolder(), GetHeaderString(), Set(), Set(), Set(), Set(), Set(), Set(), Set(), and UpdateDirTree().
|
private |
Definition at line 163 of file TMusrRunHeader.h.
Referenced by GetLabel(), GetStrValue(), GetType(), Set(), Set(), Set(), Set(), Set(), Set(), Set(), and TMusrRunHeader().
|
private |
Definition at line 167 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
Definition at line 171 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
Definition at line 165 of file TMusrRunHeader.h.
Referenced by Init().