musrfit
1.9.2
|
#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 | 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) |
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 () |
virtual void | DrawHeader () |
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 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 More... | |
Definition at line 122 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 231 of file TMusrRunHeader.cpp.
|
virtual |
|
privatevirtual |
Clean up internal stuff.
Definition at line 315 of file TMusrRunHeader.cpp.
References fDoubleObj, fDoubleVectorObj, fIntObj, fIntVectorObj, fMusrRunPhysQuantityObj, fPathNameOrder, fStringObj, and fStringVectorObj.
Referenced by ExtractAll(), and ~TMusrRunHeader().
|
virtual |
Definition at line 1256 of file TMusrRunHeader.cpp.
|
virtual |
Definition at line 1099 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.
folder |
Definition at line 862 of file TMusrRunHeader.cpp.
References CleanUp(), and ExtractHeaderInformation().
|
virtual |
headerInfo | |
requestedPath |
Definition at line 885 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().
|
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 338 of file TMusrRunHeader.cpp.
References FindObject(), fPathNameOrder, GetFirst(), GetHeaderString(), and UpdateFolder().
Referenced by main().
|
privatevirtual |
Check if 'path' is present in 'treeObj'
return:
treeObj | to be searched |
path | searched for within 'treeObj' |
Definition at line 1541 of file TMusrRunHeader.cpp.
References GetFirst(), and RemoveFirst().
Referenced by FillFolder().
|
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 470 of file TMusrRunHeader.cpp.
References fStringObj.
|
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 492 of file TMusrRunHeader.cpp.
References fIntObj.
|
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 514 of file TMusrRunHeader.cpp.
References fDoubleObj.
|
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 536 of file TMusrRunHeader.cpp.
References fMusrRunPhysQuantityObj.
|
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 558 of file TMusrRunHeader.cpp.
References fStringVectorObj.
|
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 580 of file TMusrRunHeader.cpp.
References fIntVectorObj.
|
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 602 of file TMusrRunHeader.cpp.
References fDoubleVectorObj.
|
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 1282 of file TMusrRunHeader.cpp.
Referenced by DumpHeader(), and GetHeaderString().
|
inlinevirtual |
Definition at line 129 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.
return: first part of up to the splitter in struct
str | |
splitter |
Definition at line 1752 of file TMusrRunHeader.cpp.
Referenced by FillFolder(), FindObject(), and UpdateFolder().
|
privatevirtual |
pathName |
Definition at line 1574 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 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 1359 of file TMusrRunHeader.cpp.
References fQuiet.
Referenced by ExtractHeaderInformation().
|
privatevirtual |
returns the number of significant digits
val | value from which the lowest significant digit shall be determined |
Definition at line 1307 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 1391 of file TMusrRunHeader.cpp.
References fQuiet.
Referenced by ExtractHeaderInformation().
|
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 1423 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 ExtractHeaderInformation().
|
virtual |
Get type of path-name, e.g. RunInfo/Sample Name.
pathName | path-name for which the type is requested |
Definition at line 408 of file TMusrRunHeader.cpp.
References fDoubleObj, fDoubleVectorObj, fIntObj, fIntVectorObj, fMusrRunPhysQuantityObj, fStringObj, and fStringVectorObj.
|
privatevirtual |
Initializer
fileName | file name of the caller. |
Definition at line 245 of file TMusrRunHeader.cpp.
References fFileName, fVersion, TMusrRunPhysicalQuantity::Set(), and 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 1725 of file TMusrRunHeader.cpp.
Referenced by FindObject(), and UpdateFolder().
|
virtual |
Set TString 'value'.
pathName | path/name within the header, e.g. RunInfo/Run Title |
value | of the entry |
Definition at line 623 of file TMusrRunHeader.cpp.
References fPathNameOrder, fQuiet, and fStringObj.
Referenced by ExtractHeaderInformation(), Init(), and main().
|
virtual |
Set Int_t 'value'.
pathName | path/name within the header, e.g. RunInfo/Run number |
value | of the entry |
Definition at line 657 of file TMusrRunHeader.cpp.
References fIntObj, fPathNameOrder, and fQuiet.
|
virtual |
Set Double_t 'value'.
pathName | path/name within the header, e.g. RunInfo/DoubleValue |
value | of the entry |
Definition at line 691 of file TMusrRunHeader.cpp.
References fDoubleObj, 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 725 of file TMusrRunHeader.cpp.
References fMusrRunPhysQuantityObj, fPathNameOrder, and fQuiet.
|
virtual |
Set TStringVector 'value'.
pathName | path/name within the header, e.g. RunInfo/Histo names |
value | of the entry |
Definition at line 759 of file TMusrRunHeader.cpp.
References fPathNameOrder, fQuiet, and fStringVectorObj.
|
virtual |
Set TIntVector 'value'.
pathName | path/name within the header, e.g. RunInfo/Time Zero Bin |
value | of the entry |
Definition at line 793 of file TMusrRunHeader.cpp.
References fIntVectorObj, 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 827 of file TMusrRunHeader.cpp.
References fDoubleVectorObj, fPathNameOrder, and fQuiet.
|
inlinevirtual |
Definition at line 146 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 1338 of file TMusrRunHeader.cpp.
Referenced by DumpHeader(), and GetHeaderString().
|
privatevirtual |
Update folder structure
return:
treeObj | to be updated |
path | to be added within 'treeObj' |
Definition at line 1493 of file TMusrRunHeader.cpp.
References GetFirst(), and RemoveFirst().
Referenced by FillFolder().
|
private |
Definition at line 166 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 |
Definition at line 161 of file TMusrRunHeader.h.
Referenced by DumpHeader(), GetFileName(), Init(), and SetFileName().
|
private |
Definition at line 165 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
Definition at line 169 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
Definition at line 167 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 172 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), FillFolder(), GetHeaderString(), and Set().
|
private |
Definition at line 160 of file TMusrRunHeader.h.
Referenced by GetLabel(), GetStrValue(), GetType(), Set(), and TMusrRunHeader().
|
private |
Definition at line 164 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
Definition at line 168 of file TMusrRunHeader.h.
Referenced by CleanUp(), DumpHeader(), Get(), GetHeaderString(), GetTypeOfPath(), and Set().
|
private |
Definition at line 162 of file TMusrRunHeader.h.
Referenced by Init().