2 #include <utl/AugerUnits.h>
5 using namespace LDFFinderOG;
17 const int n,
const double*
const s1000,
const double*
const beta,
30 minuit.mnexcm(
"SET PRINTOUT", argList, 1, errFlag);
31 minuit.mnexcm(
"SET NOWARNINGS", argList, 0, errFlag);
32 minuit.SetPrintLevel(-1);
37 minuit.mnexcm(
"SET ERRORDEF", argList, 1, errFlag);
39 minuit.mnparm(0,
"ropt", 1400*
meter, 50*
meter, 0, 0, errFlag);
42 minuit.mnexcm(
"MINIMIZE", argList, 1, errFlag);
45 pair<double, double> ropt;
46 minuit.GetParameter(0, ropt.first, ropt.second);
54 double*
const par,
const int )
56 const double& ropt = par[0];
60 for (
int i = 0; i < fgN; ++i) {
61 const double s = fgS1000[i] *
LDFFunction(fgLDFType, ropt, fgBeta[i], 0);
65 const double invN = 1./fgN;
66 const double avg = sum * invN;
67 const double var2 = sum2 * invN -
Sqr(avg);
69 value = (var2 > 0 ?
sqrt(var2) : 0) / avg;
constexpr T Sqr(const T &x)
double LDFFunction(const LDFFunctionType type, const double r, const double beta, const double gamma=0, const double mu=2660.*meter, const double tau=242.*meter)
static const double * fgS1000
std::pair< double, double > Fit(const LDFFunctionType type, const int n, const double *const s1000, const double *const beta, const bool verbose=false)
static LDFFunctionType fgLDFType
static const double * fgBeta
static void FitFunction(int &nPar, double *const grad, double &value, double *const par, const int flag)