43 #include <TFitResult.h>
49 #include <TPaveText.h>
69 : TNamed(name, title) {
77 : TNamed(c.GetName(), c.GetTitle())
78 , fFitMin(c.GetFitMin())
79 , fFitMax(c.GetFitMax())
80 , fPOIpdg(c.GetParticleOfInterest()) {
100 const Double_t* par) {
110 "E-PairAnalysisFunction::PeakFun: No histogram for peak fit defined!\n");
114 Int_t idx = hPeak->FindBin(xx);
115 if ((idx <= 1) || (idx >= hPeak->GetNbinsX())) {
return 0.0; }
117 return (par[0] * hPeak->GetBinContent(idx));
122 const Double_t* par) {
126 Double_t alpha = par[1];
127 Double_t meanx = par[2];
128 Double_t sigma = par[3];
129 Double_t nn = par[4];
132 TMath::Power((n / TMath::Abs(alpha)), n) * TMath::Exp(-.5 * alpha * alpha);
133 Double_t b = n / TMath::Abs(alpha) - TMath::Abs(alpha);
135 Double_t arg = (
x[0] - meanx) / sigma;
138 if (arg > -1. * alpha) {
139 fitval = nn * TMath::Exp(-.5 * arg * arg);
141 fitval = nn * a * TMath::Power((b - arg), (-1 * n));
149 const Double_t* par) {
153 Double_t alpha = par[1];
154 Double_t nn = par[4];
155 Double_t meanx = par[2];
156 Double_t sigma = par[3];
159 TMath::Power((n / TMath::Abs(alpha)), n) * TMath::Exp(-.5 * alpha * alpha);
160 Double_t b = n / TMath::Abs(alpha) - TMath::Abs(alpha);
162 Double_t arg = (
x[0] - meanx) / sigma;
166 fitval = nn * a * TMath::Power((b + arg), (-1 * n));
167 }
else if (arg < -alpha) {
168 fitval = nn * a * TMath::Power((b - arg), (-1 * n));
170 fitval = nn * TMath::Exp(-0.5 * arg * arg);
178 const Double_t* par) {
182 Double_t alpha = par[1];
184 Double_t meanx = par[2];
185 Double_t sigma = par[3];
187 Double_t arg = (
x[0] - meanx) / sigma;
191 fitval = n * TMath::Exp(-0.5 * alpha * alpha - alpha * arg);
192 }
else if (arg < -alpha) {
193 fitval = n * TMath::Exp(-0.5 * alpha * alpha + alpha * arg);
195 fitval = n * TMath::Exp(-0.5 * arg * arg);
203 const Double_t* par) {
208 Double_t mean = par[1];
209 Double_t sigma = par[2];
212 return (n * TMath::Exp(-0.5 * TMath::Power((xx - mean) / sigma, 2)));
227 if (!sig || !back || !combined) {
228 Error(
"SetFunctions",
229 "Both, signal and background function need to be set!");
244 switch (predefinedFunc) {
249 default: Error(
"SetDefault",
"predefined function not yet implemented");
266 fFuncSignal =
new TF1(
"DieleSignal",
"gaus", 2.5, 4);
268 fFuncSigBack =
new TF1(
"DieleCombined",
"gaus+pol1(3)", 2.5, 4);
274 }
else if (type == 1) {
275 fFuncSignal =
new TF1(
"DieleSignal",
"gaus", 2.5, 4);
277 new TF1(
"DieleBackground",
"[0]*exp(-(x-[1])/[2])", 2.5, 4);
279 new TF1(
"DieleCombined",
"gaus+[3]*exp(-(x-[4])/[5])", 2.5, 4);
285 }
else if (type == 2) {
289 "(x<[1])*([0]*(exp(-0.5*((x-[1])/[2])^2)+exp((x-[1])/"
290 "[3])*(1-exp(-0.5*((x-[1])/"
291 "[2])^2))))+(x>=[1])*([0]*exp(-0.5*((x-[1])/[2])^2))",
295 new TF1(
"DieleBackground",
"[0]*exp(-(x-[1])/[2])+[3]", 2.5, 4);
298 "(x<[1])*([0]*(exp(-0.5*((x-[1])/[2])^2)+exp((x-[1])/"
299 "[3])*(1-exp(-0.5*((x-[1])/[2])^2))))+(x>=[1])*([0]*exp(-0.5*((x-[1])/"
300 "[2])^2))+[4]*exp(-(x-[5])/[6])+[7]",
303 fFuncSigBack->SetParameters(1., 3.1, .05, .1, 1, 2.5, 1, 0);
320 Error(
"CombineFunc",
"signal function need to be set!");
340 const Double_t* par) {
364 "[1]*x*sqrt(x*x+[0]*[0])*exp(-sqrt(x*x+[0]*[0])/[2])",
377 fFuncSigBack =
new TF1(
"Exponential",
"[0]*x*exp(-x/[1])", 0., 10.);
389 fFuncSigBack =
new TF1(
"Hagedorn",
"x*[0]*( 1 + x/[1] )^(-[2])", 0., 10.);
401 new TF1(
"Levi-Tsallis",
402 "( x*[0]*([1]-1)*([1]-2) )/( [1]*[2]*( [1]*[2]+[3]*([1]-2) ) ) * "
403 "( 1 + (sqrt([3]*[3]+x*x) -[3])/([1]*[2]) )^(-[1])",
409 fFuncSigBack->SetParNames(
"norm (dN/dy)",
"n",
"T",
"mass");