27 int main(
int argc,
char **argv)
42 JParser<> zap(
"Auxiliary program to test ROOT fit results.");
44 zap[
'f'] =
make_field(inputFile,
"histogram, e.g: <file name>:<object name>");
45 zap[
'='] =
make_field(fcn,
"function name") =
".*";
46 zap[
'@'] =
make_field(test,
"<parameter> <min> <max>");
51 catch(
const exception &error) {
52 FATAL(error.what() << endl);
59 FATAL(
"No object at " << inputFile << endl);
64 if (
f1 == NULL &&
dynamic_cast<TF1*
> (p) != NULL) {
f1 =
dynamic_cast<TF1*
>(p); }
65 if (
f1 == NULL &&
dynamic_cast<TH1*
> (p) != NULL) {
f1 =
getFunction(
dynamic_cast<TH1*
> (p), fcn.c_str()); };
66 if (
f1 == NULL &&
dynamic_cast<TGraph*
> (p) != NULL) {
f1 =
getFunction(
dynamic_cast<TGraph*
> (p), fcn.c_str()); };
67 if (
f1 == NULL &&
dynamic_cast<TGraph2D*
>(p) != NULL) {
f1 =
getFunction(
dynamic_cast<TGraph2D*
>(p), fcn.c_str()); };
70 FATAL(
"No function at " << inputFile <<
" " << fcn << endl);
74 for (
int i = 0; i !=
f1->GetNpar(); ++i) {
76 DEBUG(left << setw(12) <<
f1->GetParName(i) <<
' ');
79 JTest_t::const_iterator p = test.find(
f1->GetParName(i));
81 if (p != test.end()) {
83 DEBUG(
" [" <<
SCIENTIFIC(12,5) << p->second.getLowerLimit() <<
"," <<
SCIENTIFIC(12,5) << p->second.getLowerLimit() <<
"] ");
84 DEBUG((p->second(
f1->GetParameter(i)) ?
"passed" :
"failed"));
95 for (
int i = 0; i !=
f1->GetNpar(); ++i) {
97 JTest_t::const_iterator p = test.find(
f1->GetParName(i));
99 if (p != test.end()) {
100 ASSERT(p->second(
f1->GetParameter(i)), p->first <<
' ' << p->second);
General purpose messaging.
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
Auxiliary class to define a range between two values.
int main(int argc, char **argv)
Interface to read input and write output for TObject tests.
Auxiliary class to handle file name, ROOT directory and object name.
Utility class to parse command line options.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
TObject * getObject(const JRootObjectID &id)
Get first TObject with given identifier.
TF1 * getFunction(TH1 *h1, const char *const fcn)
Get function.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Type definition of range.
Auxiliary data structure for floating point format specification.