22 double MyFunc (
double *x,
double *p ) {
28 MyDerivFunc(
TF1 *
f): fFunc(f) {}
29 double operator() (
double *x,
double * )
const {
30 return fFunc->Derivative(*x);
36 MyIntegFunc(
TF1 *
f): fFunc(f) {}
37 double Integral (
double *x,
double * )
const {
38 double a = fFunc->GetXmin();
39 return fFunc->Integral(a, *x);
46 void exampleFunctor() {
48 double xmin = -10;
double xmax = 10;
51 TF1 * f1 =
new TF1(
"f1",MyFunc,xmin,xmax,2);
64 MyDerivFunc * deriv =
new MyDerivFunc(f1);
65 TF1 * f2 =
new TF1(
"f2",deriv, xmin, xmax, 0);
79 MyIntegFunc * intg =
new MyIntegFunc(f1);
80 TF1 * f3 =
new TF1(
"f3",intg,&MyIntegFunc::Integral, xmin, xmax, 0);
virtual void SetParameters(const Double_t *params)
This class displays a legend box (TPaveText) containing several legend entries.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
virtual void SetMinimum(Double_t minimum=-1111)
Set the minimum value along Y for this function In case the function is already drawn, set also the minimum in the helper histogram.
virtual void SetLineColor(Color_t lcolor)
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculate a gaussian function with mean and sigma.
virtual void SetMaximum(Double_t maximum=-1111)
Set the maximum value along Y for this function In case the function is already drawn, set also the maximum in the helper histogram.
TRObject operator()(const T1 &t1) const
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.