8#include "TGraphErrors.h"
28int main(
int argc,
char **argv)
42 JParser<> zap(
"Auxiliary application to fit mechanical constants.");
44 zap[
'f'] =
make_field(inputFile,
"input file; see https://git.km3net.de/calibration/input_tables");
46 zap[
'e'] =
make_field(error,
"uncertainty drag value") = 0.2;
47 zap[
'B'] =
make_field(nobuoy,
"fit without buoy");
48 zap[
'O'] =
make_field(old,
"ROOT fit based on minuit");
53 catch(
const exception &error) {
54 FATAL(error.what() << endl);
64 ifstream in(inputFile.c_str());
70 DEBUG(
"Header " << buffer << endl);
76 for (
double x, y; in >> x >> y; ) {
80 AddPoint(&
g1, x, y, 0.0, error);
94 double Tx = ymax / xmax;
95 double a = (nobuoy ? 0.0 : 0.5 / xmax);
96 double b = (nobuoy ? 0.0 : 0.25 * xmax);
105 typedef decltype(f1) function_type;
109 const auto result = (nobuoy ? Fit(&
g1, f1, {1, 2}) : Fit(&
g1, f1));
115 cout <<
"Error matrix:" << endl << result.V << endl;
117 Tx = result.getValue(0);
118 b = result.getValue(1);
119 a = result.getValue(2);
123 TF1 f1(
"f1",
"[0]*(x + [1]*log(1.0 - [2]*x))");
125 f1.SetParameter(0, Tx);
127 f1.FixParameter(1, b);
128 f1.FixParameter(2, a);
130 f1.SetParameter(1, b);
131 f1.SetParameter(2, a);
134 f1.SetParError(0, 0.05);
135 f1.SetParError(1, 1.0e-6);
136 f1.SetParError(2, 1.0e-1);
141 Tx = f1.GetParameter(0);
142 b = f1.GetParameter(1);
143 a = f1.GetParameter(2);
147 cout << inputFile << endl;
149 cout <<
"T_x = " <<
FIXED(5,2) << Tx <<
" [s^2/m^2] * v_x^2" << endl;
151 cout <<
"b [m] " <<
FIXED(7,3) << b << endl;
152 cout <<
"a [m^-1] " <<
FIXED(7,5) << a << endl;
void setFormat(const JFormat_t &format)
Set format for given type.
int main(int argc, char **argv)
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
Double_t g1(const Double_t x)
Function.
Auxiliary class to specify white space character(s) in currect locale.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.
Termination class for polynomial function.