32double g2(
double *
x,
double *par) {
33 double r1 =
double((
x[0]-par[1])/par[2]);
34 double r2 =
double((
x[1]-par[3])/par[4]);
37double fun2(
double *
x,
double *par) {
40 double *p3 = &par[10];
41 double result = g2(
x,p1) + g2(
x,p2) + g2(
x,p3);
50 double f2params[npar] = {100,-3,3,-3,3,160,0,0.8,0,0.9,40,4,0.7,4,0.7};
51 auto f2 =
new TF2(
"f2",fun2,-10,10,-10,10, npar);
52 f2->SetParameters(f2params);
55 auto h2 =
new TH2F(
"h2",
"From f2",40,-10,10,40,-10,10);
60 f2params[ 0] *= ratio;
61 f2params[ 5] *= ratio;
62 f2params[10] *= ratio;
63 f2->SetParameters(f2params);
65 auto cutg =
new TCutG(
"cutg",5);
66 cutg->SetPoint(0,-7,-7);
67 cutg->SetPoint(1, 2,-7);
68 cutg->SetPoint(2, 2, 2);
69 cutg->SetPoint(3,-7, 2);
70 cutg->SetPoint(4,-7,-7);
75 f2->Draw(
"surf1 same bb [cutg]");
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
R__EXTERN TStyle * gStyle
A 2-Dim function with parameters.
2-D histogram with a float per channel (see TH1 documentation)}
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
void SetPalette(Int_t ncolors=kBird, Int_t *colors=nullptr, Float_t alpha=1.)
See TColor::SetPalette.
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.