Implement automatic parameter loading for all the metadata classes
It is time to implement automatic parameter loading from rml text to all the class data members. We shall verify each metadata classes that:
- All the data members are named following our naming convention
- The method
InitFromConfigFile()has only simple logic of parameter reading:fXXX=StringToDouble(GetParameter("xXX","10")) - The data members have default values
Will constructions such as this one be properly interpreted by default?
std::vector <double> fTimeWindow;
fTimeWindow = StringToElements(GetParameter("timeWindow", "-1,-1"), ",");
This construction appears for example at: https://github.com/rest-for-physics/rawlib/blob/master/src/TRestRawVetoAnalysisProcess.cxx
Yes, it could. But somehow the string to vector style is different. The string form should be like: {1,2,3,4,5}, which is wrapped with {} as root command line prints.
root [0] std::vector<double> vec;
root [1] any(vec).ParseString("{1,2,3,0.5}");
root [2] vec // will print: (std::vector<double> &) { 1.0000000, 2.0000000, 3.0000000, 0.50000000 }
It is implemented in https://github.com/rest-for-physics/framework/blob/f83c73dae97f781827e55edbf8e3cf0336a360ac/source/framework/core/src/startup.cpp#L181