27 double xoff = ppar[0];
28 double scal = ppar[1];
29 double yped = ppar[2];
30 double sneg = ppar[3];
31 double shif = ppar[4];
34 if ( x > 0.0 ) yped += shif;
35 if ( x < 0.0 ) yped -= shif;
36 if ( x < 0.0 ) gain *= sneg;
38 if ( x > xoff )
return yped + gain*(x-xoff);
39 if ( x < -xoff )
return yped + gain*(x+xoff);
41 double y0 = -gain*xoff;
42 if ( x > 0.0 )
return yped + y0 + gain*
x;
43 else if ( x < 0.0 )
return yped - y0 + gain*
x;
50 double xoff = ppar[0];
51 double scal = ppar[1];
52 double yped = ppar[2];
53 double sneg = ppar[3];
56 if ( x < 0.0 ) gain *= sneg;
58 if ( x > xoff )
return yped + gain*(x-xoff);
59 if ( x < -xoff )
return yped + gain*(x+xoff);
61 double y0 = -gain*xoff;
62 if ( x > 0.0 )
return yped + y0 + gain*
x;
63 else if ( x < 0.0 )
return yped - y0 + gain*
x;
70 double xoff = ppar[0];
71 double gain = ppar[1];
74 if ( x > xoff )
return gain*(x-xoff);
75 if ( x < -xoff )
return gain*(x+xoff);
77 double y0 = -gain*xoff;
78 if ( x > 0.0 )
return y0 + gain*
x;
79 else if ( x < 0.0 )
return -y0 + gain*
x;
86 double yped = ppar[2];
92 double xmin =-10.0,
double xmax =10.0,
95 pf->SetParName(0,
"Offset");
96 pf->SetParName(1,
"Slope");
97 pf->SetParameter(0, off);
98 pf->SetParameter(1, slope);
104 double xmin =-10.0,
double xmax =10.0,
107 pf->SetParName(0,
"Offset");
108 pf->SetParName(1,
"Slope");
109 pf->SetParName(2,
"Pedestal");
110 pf->SetParameter(0, off);
111 pf->SetParameter(1, slope);
112 pf->SetParameter(2, ped);
118 double ped =0.0,
double sneg =1.0,
119 double xmin =-10.0,
double xmax =10.0,
122 pf->SetParName(0,
"Offset");
123 pf->SetParName(1,
"Slope");
124 pf->SetParName(2,
"Pedestal");
125 pf->SetParName(3,
"NegScale");
126 pf->SetParameter(0, off);
127 pf->SetParameter(1, slope);
128 pf->SetParameter(2, ped);
129 pf->SetParameter(3, sneg);
135 double ped =0.0,
double sneg =1.0,
double shif=0.0,
136 double xmin =-10.0,
double xmax =10.0,
139 pf->SetParName(0,
"Offset");
140 pf->SetParName(1,
"Slope");
141 pf->SetParName(2,
"Pedestal");
142 pf->SetParName(3,
"NegScale");
143 pf->SetParName(4,
"Shift");
144 pf->SetParameter(0, off);
145 pf->SetParameter(1, slope);
146 pf->SetParameter(2, ped);
147 pf->SetParameter(3, sneg);
148 pf->SetParameter(4, shif);
TF1 * offsetLineTF1(double off=0.0, double slope=1.0, double xmin=-10.0, double xmax=10.0, std::string fname="offsetLine")
TF1 * offsetLineShiftedTF1(double off=0.0, double slope=1.0, double ped=0.0, double sneg=1.0, double shif=0.0, double xmin=-10.0, double xmax=10.0, std::string fname="offsetLineShifted")
double offsetLineShifted(double *px, double *ppar)
double offsetLine(double *px, double *ppar)
TF1 * offsetLineFullTF1(double off=0.0, double slope=1.0, double ped=0.0, double sneg=1.0, double xmin=-10.0, double xmax=10.0, std::string fname="offsetLinePed")
TF1 * offsetLinePedTF1(double off=0.0, double slope=1.0, double ped=0.0, double xmin=-10.0, double xmax=10.0, std::string fname="offsetLinePed")
double offsetLineFull(double *px, double *ppar)
double offsetLinePed(double *px, double *ppar)