23 double MyFunc (
double *
x,
double *p ) {
29 MyDerivFunc(
TF1 *
f): fFunc(f) {}
31 return fFunc->Derivative(*x);
37 MyIntegFunc(
TF1 *
f): fFunc(f) {}
38 double Integral (
double *
x,
double * )
const {
39 double a = fFunc->GetXmin();
40 return fFunc->Integral(a, *x);
47 void exampleFunctor() {
52 TF1 *
f1 =
new TF1(
"f1",MyFunc,xmin,xmax,2);
66 MyDerivFunc * deriv =
new MyDerivFunc(f1);
67 TF1 * f2 =
new TF1(
"f2",deriv, xmin, xmax, 0);
82 MyIntegFunc * intg =
new MyIntegFunc(f1);
83 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.
TRObject operator()(const T1 &t1) const
virtual void SetLineColor(Color_t lcolor)
Set the line color.
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.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.