DAS  3.0
Das Analysis System
Greta< Log, Exp >

Description

template<double(*)(double) Log = log, double(*)(double) Exp = exp>
struct DAS::Greta< Log, Exp >

Motto: "Greta should not fail"

Automated fitter for steeply falling p_T spectrum.

#include <Greta.h>

Public Member Functions

 Greta (int d, double mi, double Ma)
 
double normalise (const double *x) const
 
double operator() (const double *x, const double *p) const
 
const char * formula ()
 

Static Public Member Functions

static double T (double x, int i)
 
static const char * T (const char *x, int i)
 
static const char * formula (double mi, double Ma, int deg)
 

Public Attributes

const int degree
 
const int npars
 
const double m
 
const double M
 

Constructor & Destructor Documentation

◆ Greta()

Greta ( int  d,
double  mi,
double  Ma 
)
inline

Constructor

min and max are used to transform the variable into [-1,1]

121  :
122  degree(d), npars(d+1), m(mi), M(Ma)
123  { }

Member Function Documentation

◆ formula() [1/2]

const char* formula ( )
inline
168  {
169  return formula(m, M, degree);
170  }

◆ formula() [2/2]

static const char* formula ( double  mi,
double  Ma,
int  deg 
)
inlinestatic
158  {
159  TString result = "[2]";
160  TString nx = "(-1+2*(log(x)-log([0]))/(log([1])-log([0])))";
161  for (int i = 1; i <= deg; ++i)
162  result += Form("+[%d]*%s", i+2, T(nx, i));
163  result = "exp(" + result + ")";
164  return result.Data();
165  }

◆ normalise()

double normalise ( const double *  x) const
inline
143  {
144  return -1 + 2* (Log(*x) - Log(m)) / (Log(M) - Log(m));
145  }

◆ operator()()

double operator() ( const double *  x,
const double *  p 
) const
inline
148  {
149  double nx = normalise(x);
150  double result = 0;
151  for (int i = 0; i <= degree; ++i)
152  result += p[i]*T(nx,i);
153  //result += p[i]*pow(nx,i);
154  return Exp(result);
155  }

◆ T() [1/2]

static const char* T ( const char *  x,
int  i 
)
inlinestatic
135  {
136  if (i == 0) return Form("1.");
137  if (i == 1) return x;
138  const char * t1 = T(x, i-1), * t2 = T(x, i-2);
139  return Form("2*%s*%s-%s", x, t1, t2);
140  }

◆ T() [2/2]

static double T ( double  x,
int  i 
)
inlinestatic

Chebyshev of first kind.

128  {
129  if (i == 0) return 1.;
130  if (i == 1) return x;
131  return 2*x*T(x, i-1)-T(x, i-2);
132  }

Member Data Documentation

◆ degree

const int degree

◆ M

const double M

◆ m

const double m

◆ npars

const int npars

The documentation for this struct was generated from the following file:
DAS::Greta::m
const double m
Definition: Greta.h:114
DAS::Greta::M
const double M
Definition: Greta.h:114
DAS::Greta::degree
const int degree
Definition: Greta.h:113
Ntupliser_cfg.p
p
Definition: Ntupliser_cfg.py:362
DAS::Greta::T
static double T(double x, int i)
Chebyshev of first kind.
Definition: Greta.h:127
DAS::Greta::npars
const int npars
Definition: Greta.h:113
DAS::Greta::normalise
double normalise(const double *x) const
Definition: Greta.h:142
DAS::Greta::formula
const char * formula()
Definition: Greta.h:167