27 int main(
int argc,
char **argv)
32 typedef JRange<Double_t> JRange_t;
35 JRootObjectID inputFile;
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);
Utility class to parse command line options.
TObject * getObject(const JRootObjectID &id)
Get first TObject with given identifier.
TF1 * getFunction(TH1 *h1, const char *const fcn)
Get function.
int main(int argc, char *argv[])
const JPolynome f1(1.0, 2.0, 3.0)
Function.
#define ASSERT(A,...)
Assert macro.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Auxiliary class to define a range between two values.
Utility class to parse command line options.
Auxiliary data structure for floating point format specification.
#define DEBUG(A)
Message macros.