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"
77 void ReadElement(TiXmlElement* e,
bool recursive =
false);
78 void ReplaceForLoopVars(TiXmlElement* e, std::map<std::string, std::string> forLoopVar);
79 void ExpandForLoopOnce(TiXmlElement* e,
const std::map<std::string, std::string>& forLoopVar);
80 void ExpandForLoops(TiXmlElement* e, std::map<std::string, std::string> forLoopVar);
83 std::string
GetUnits(TiXmlElement* e);
85 void ReadOneParameter(std::string name, std::string value);
90 TString fCommit = REST_COMMIT;
91 TString fLibraryVersion =
"0";
93 Bool_t fOfficialRelease =
false;
94 Bool_t fCleanState =
false;
98 std::string
GetFieldValue(std::string parName, TiXmlElement* e);
99 std::string
GetParameter(std::string parName, TiXmlElement* e,
100 TString defaultValue = PARAMETER_NOT_FOUND_STR);
101 Double_t GetDblParameterWithUnits(std::string parName, TiXmlElement* e,
102 Double_t defaultVal = PARAMETER_NOT_FOUND_DBL);
103 TVector2 Get2DVectorParameterWithUnits(std::string parName, TiXmlElement* e,
104 TVector2 defaultValue = TVector2(-1, -1));
105 TVector3 Get3DVectorParameterWithUnits(std::string parName, TiXmlElement* e,
106 TVector3 defaultValue = TVector3(-1, -1, -1));
107 TiXmlElement*
GetElementFromFile(std::string configFilename, std::string NameOrDecalre =
"");
108 TiXmlElement*
GetElement(std::string eleDeclare, TiXmlElement* e =
nullptr);
110 TiXmlElement*
GetElementWithName(std::string eleDeclare, std::string eleName, TiXmlElement* e);
112 std::pair<std::string, std::string>
GetParameterAndUnits(std::string parname, TiXmlElement* e =
nullptr);
120 std::string
GetKEYStructure(std::string keyName,
size_t& Position, std::string buffer);
121 std::string
GetKEYStructure(std::string keyName,
size_t& Position, TiXmlElement* ele);
125 std::string
GetKEYDefinition(std::string keyName,
size_t& Position, std::string buffer);
126 std::string
GetParameter(std::string parName,
size_t& pos, std::string inputString);
127 std::string
GetFieldValue(std::string fieldName, std::string definition,
size_t fromPosition = 0);
220 void AddLog(std::string log =
"",
bool print =
true);
223 void SetError(std::string message =
"",
bool print =
true,
int maxPrint = 5);
226 void SetWarning(std::string message =
"",
bool print =
true,
int maxPrint = 5);
234 inline Int_t GetNumberOfErrors()
const {
return fNErrors; }
236 inline Int_t GetNumberOfWarnings()
const {
return fNWarnings; }
239 std::map<std::string, std::string> envs = {});
240 Int_t
LoadConfigFromFile(
const std::string& configFilename,
const std::string& sectionName =
"");
289 inline Bool_t isOfficialRelease()
const {
return fOfficialRelease; }
291 inline Bool_t isCleanState()
const {
return fCleanState; }
293 UInt_t GetVersionMajor()
const;
294 UInt_t GetVersionMinor()
const;
295 UInt_t GetVersionPatch()
const;
297 Int_t GetVersionCode();
300 std::string dataPath =
GetParameter(
"mainDataPath",
"");
301 if (dataPath ==
"") {
316 std::string
GetParameter(std::string parName, TString defaultValue = PARAMETER_NOT_FOUND_STR);
318 Double_t GetDblParameterWithUnits(std::string parName, Double_t defaultValue = PARAMETER_NOT_FOUND_DBL);
320 TVector2 Get2DVectorParameterWithUnits(std::string parName, TVector2 defaultValue = TVector2(-1, -1));
322 TVector3 Get3DVectorParameterWithUnits(std::string parName, TVector3 defaultValue = TVector3(-1, -1, -1));
338 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.