test_agky_1pi_rew.C
Go to the documentation of this file.
1 {
2 
3  double fXFmin = -1.0;
4  double fXFmax = 0.5;
5  double fPT2min = 0.001;
6  double fPT2max = 0.6;
7 
8  double fracerr_xF1pi = 0.20;
9  double fracerr_pT1pi = 0.03;
10 
11 
12  TF1 * fBaryonXFpdf = new TF1("fBaryonXFpdf",
13  "0.083*exp(-0.5*pow(x+0.385,2.)/0.131)", fXFmin, fXFmax);
14  TF1 * fBaryonPT2pdf = new TF1("fBaryonPT2pdf",
15  "exp(-0.214-6.625*x)", fPT2min, fPT2max);
16 
17  double fI0XFpdf = fBaryonXFpdf ->Integral(fXFmin, fXFmax);
18  double fI0PT2pdf = fBaryonPT2pdf->Integral(fPT2min,fPT2max);
19 
20  //
21  // Now, define same function as above, but insert tweaking dials.
22  // - For the xF PDF add a parameter to shift the peak of the distribution.
23  // - For the pT2 PDF add a parameter to shift the <pT2>
24  // Include parameter to allow re-normalizing tweaked PDF to 1.
25 
26  double fDefPeakBaryonXF = -0.385;
27  TF1 * fBaryonXFpdfTwk1 = new TF1("fBaryonXFpdfTwk1",
28  "[0]*0.083*exp(-0.5*pow(x-[1],2.)/0.131)", fXFmin, fXFmax);
29  fBaryonXFpdfTwk1->SetParameter(0, 1.); // norm
30  fBaryonXFpdfTwk1->SetParameter(1, fDefPeakBaryonXF*(1+fracerr_xF1pi));
31  fBaryonXFpdfTwk1->SetParameter(0, fI0XFpdf/fBaryonXFpdfTwk1->Integral(fXFmin, fXFmax) );
32  TF1 * fBaryonXFpdfTwk2 = new TF1("fBaryonXFpdfTwk2",
33  "[0]*0.083*exp(-0.5*pow(x-[1],2.)/0.131)", fXFmin, fXFmax);
34  fBaryonXFpdfTwk2->SetParameter(0, 1.); // norm
35  fBaryonXFpdfTwk2->SetParameter(1, fDefPeakBaryonXF*(1-fracerr_xF1pi));
36  fBaryonXFpdfTwk2->SetParameter(0, fI0XFpdf/fBaryonXFpdfTwk2->Integral(fXFmin, fXFmax) );
37 
38  double fDefAvgPT2 = 1./6.625;
39  TF1 * fBaryonPT2pdfTwk1 = new TF1("fBaryonPT2pdfTwk1",
40  "[0]*exp(-0.214-x/[1])", fPT2min, fPT2max);
41  fBaryonPT2pdfTwk1->SetParameter(0, 1.); // norm
42  fBaryonPT2pdfTwk1->SetParameter(1,fDefAvgPT2*(1+fracerr_pT1pi));
43  fBaryonPT2pdfTwk1->SetParameter(0,fI0PT2pdf/fBaryonPT2pdfTwk1->Integral(fPT2min,fPT2max));
44  TF1 * fBaryonPT2pdfTwk2 = new TF1("fBaryonPT2pdfTwk2",
45  "[0]*exp(-0.214-x/[1])", fPT2min, fPT2max);
46  fBaryonPT2pdfTwk2->SetParameter(0, 1.); // norm
47  fBaryonPT2pdfTwk2->SetParameter(1,fDefAvgPT2*(1-fracerr_pT1pi));
48  fBaryonPT2pdfTwk2->SetParameter(0,fI0PT2pdf/fBaryonPT2pdfTwk2->Integral(fPT2min,fPT2max));
49 
50  TCanvas * c1 = new TCanvas("c1","",20,20,500,500);
51  fBaryonXFpdf->Draw();
52  fBaryonXFpdfTwk1->SetLineStyle(kDashed);
53  fBaryonXFpdfTwk2->SetLineStyle(kDashed);
54  fBaryonXFpdfTwk1->Draw("same");
55  fBaryonXFpdfTwk2->Draw("same");
56  c1->Update();
57 
58  TCanvas * c2 = new TCanvas("c2","",120,120,600,600);
59  fBaryonPT2pdf->Draw();
60  fBaryonPT2pdfTwk1->SetLineStyle(kDashed);
61  fBaryonPT2pdfTwk2->SetLineStyle(kDashed);
62  fBaryonPT2pdfTwk1->Draw("same");
63  fBaryonPT2pdfTwk2->Draw("same");
64  c2->Update();
65 }
double fracerr_pT1pi
double fPT2min
TF1 * fBaryonXFpdfTwk1
TF1 * fBaryonXFpdf
double fXFmax
TCanvas * c2
double fDefAvgPT2
double fPT2max
double fracerr_xF1pi
TF1 * fBaryonPT2pdfTwk1
TCanvas * c1
double fI0PT2pdf
TF1 * fBaryonXFpdfTwk2
double fI0XFpdf
double fDefPeakBaryonXF
TF1 * fBaryonPT2pdfTwk2
TF1 * fBaryonPT2pdf