38 return object.ReadLine(in);
50 return out <<
object.Data();
63inline TString
replace(
const TString& target,
const TRegexp& regexp,
const T& replacement)
68 TString buffer = target;
70 if ((pos = buffer.Index(regexp, &len)) != -1) {
72 TSubString substr = buffer(pos, len);
74 TString format(substr.Data(), substr.Length());
76 format.ReplaceAll(
"T",
"s");
78 buffer.Replace(pos, len, TString::Format(format.Data(), replacement));
95int main(
int argc,
char **argv)
107 JParser<> zap(
"Auxiliary program to print result from ROOT objects."\
108 "\nNote that the formula may contain method names of the specified object.");
110 zap[
'f'] =
make_field(inputFile,
"<input file>:<object name>");
113 "\nwhere '%s', '%T' and '%f' will be replaced by name, title and value(s) from formula(s), respectively") =
"";
118 catch(
const exception &error) {
135 ERROR(
"File: " << input->getFullFilename() <<
" not opened." <<
endl);
145 const TString tag(key->GetName());
151 if (tag.Contains(
regexp) && isTObject(key)) {
153 TObject*
object = key->ReadObj();
159 TString buffer = option;
166 const double value = getResult(*i,
object);
168 if (buffer.Contains(
DOUBLE)){
174 if (i != formula.begin()) {
178 buffer.Append(TString::Format(
"%20.10e", value));
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
TString replace(const TString &target, const TRegexp ®exp, const T &replacement)
Replace regular expression in input by given replacement.
std::ostream & operator<<(std::ostream &out, const JFormula &object)
Write formula to output stream.
std::istream & operator>>(std::istream &in, JFormula &object)
Read formula from input stream.
I/O formatting auxiliaries.
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary data structure for floating point format specification.