23#ifndef RestCore_TRestMetadata
24#define RestCore_TRestMetadata
28#include <TApplication.h>
30#include <TStreamerElement.h>
31#include <TVirtualStreamerInfo.h>
36#include "TRestDataBase.h"
37#include "TRestPhysics.h"
38#include "TRestReflector.h"
39#include "TRestStringHelper.h"
40#include "TRestStringOutput.h"
41#include "TRestSystemOfUnits.h"
42#include "TRestTools.h"
43#include "TRestVersion.h"
73 void ReadElement(TiXmlElement* e,
bool recursive =
false);
74 void ReplaceForLoopVars(TiXmlElement* e, std::map<std::string, std::string> forLoopVar);
75 void ExpandForLoopOnce(TiXmlElement* e,
const std::map<std::string, std::string>& forLoopVar);
76 void ExpandForLoops(TiXmlElement* e, std::map<std::string, std::string> forLoopVar);
79 std::string
GetUnits(TiXmlElement* e);
81 void ReadOneParameter(std::string name, std::string value);
86 TString fCommit = REST_COMMIT;
87 TString fLibraryVersion =
"0";
89 Bool_t fOfficialRelease =
false;
90 Bool_t fCleanState =
false;
94 std::string
GetFieldValue(std::string parName, TiXmlElement* e);
95 std::string
GetParameter(std::string parName, TiXmlElement* e,
96 TString defaultValue = PARAMETER_NOT_FOUND_STR);
97 Double_t GetDblParameterWithUnits(std::string parName, TiXmlElement* e,
98 Double_t defaultVal = PARAMETER_NOT_FOUND_DBL);
99 TVector2 Get2DVectorParameterWithUnits(std::string parName, TiXmlElement* e,
100 TVector2 defaultValue = TVector2(-1, -1));
101 TVector3 Get3DVectorParameterWithUnits(std::string parName, TiXmlElement* e,
102 TVector3 defaultValue = TVector3(-1, -1, -1));
103 TiXmlElement*
GetElementFromFile(std::string configFilename, std::string NameOrDecalre =
"");
104 TiXmlElement*
GetElement(std::string eleDeclare, TiXmlElement* e =
nullptr);
106 TiXmlElement*
GetElementWithName(std::string eleDeclare, std::string eleName, TiXmlElement* e);
108 std::pair<std::string, std::string>
GetParameterAndUnits(std::string parname, TiXmlElement* e =
nullptr);
116 std::string
GetKEYStructure(std::string keyName,
size_t& Position, std::string buffer);
117 std::string
GetKEYStructure(std::string keyName,
size_t& Position, TiXmlElement* ele);
121 std::string
GetKEYDefinition(std::string keyName,
size_t& Position, std::string buffer);
122 std::string
GetParameter(std::string parName,
size_t& pos, std::string inputString);
123 std::string
GetFieldValue(std::string fieldName, std::string definition,
size_t fromPosition = 0);
216 void AddLog(std::string log =
"",
bool print =
true);
219 void SetError(std::string message =
"",
bool print =
true,
int maxPrint = 5);
222 void SetWarning(std::string message =
"",
bool print =
true,
int maxPrint = 5);
230 inline Int_t GetNumberOfErrors()
const {
return fNErrors; }
232 inline Int_t GetNumberOfWarnings()
const {
return fNWarnings; }
235 std::map<std::string, std::string> envs = {});
236 Int_t
LoadConfigFromFile(
const std::string& configFilename,
const std::string& sectionName =
"");
285 inline Bool_t isOfficialRelease()
const {
return fOfficialRelease; }
287 inline Bool_t isCleanState()
const {
return fCleanState; }
289 UInt_t GetVersionMajor()
const;
290 UInt_t GetVersionMinor()
const;
291 UInt_t GetVersionPatch()
const;
293 Int_t GetVersionCode();
296 std::string dataPath =
GetParameter(
"mainDataPath",
"");
297 if (dataPath ==
"") {
312 std::string
GetParameter(std::string parName, TString defaultValue = PARAMETER_NOT_FOUND_STR);
314 Double_t GetDblParameterWithUnits(std::string parName, Double_t defaultValue = PARAMETER_NOT_FOUND_DBL);
316 TVector2 Get2DVectorParameterWithUnits(std::string parName, TVector2 defaultValue = TVector2(-1, -1));
318 TVector3 Get3DVectorParameterWithUnits(std::string parName, TVector3 defaultValue = TVector3(-1, -1, -1));
334 virtual Int_t
Write(
const char* name =
nullptr, Int_t option = 0, Int_t bufsize = 0);
Managing applications and executing tasks.
REST_Verbose_Level
Enumerate of verbose level, containing five levels.
std::string ReplaceMathematicalExpressions(std::string buffer, Int_t precision=0, std::string errorMessage="")
Evaluates and replaces valid mathematical expressions found in the input string buffer.