3 #include <TApplication.h>
6 #include <FMD/flow/AliFMDFlowBessel.h>
8 //____________________________________________________________________
9 double myI(double* xp, double* pp)
13 return AliFMDFlowBessel::I(n, x);
16 //____________________________________________________________________
17 double myDI(double* xp, double* pp)
21 return AliFMDFlowBessel::DiffI(n, x);
24 //____________________________________________________________________
25 double _rootI(double n, double x)
27 if (fabs(x) < 0.00001) return 0;
29 return TMath::Sqrt(2 * x / TMath::Pi()) * TMath::SinH(x)/x;
31 return TMath::Sqrt(2 * x / TMath::Pi()) *
32 (TMath::CosH(x) / x - TMath::SinH(x) / (x * x));
33 if (n == 2.5) return _rootI(0.5, x) - 3 * _rootI(1.5, x) / x;
34 return TMath::BesselI(int(fabs(n)), x);
37 //____________________________________________________________________
38 double rootI(double* xp, double* pp)
40 return _rootI(pp[0], xp[0]);
43 //____________________________________________________________________
44 const char* ntonm(double n)
46 if (int(2 * fabs(n)) % 2 == 1)
47 return Form("I%d_2", int(2 * n));
48 return Form("I%d", int(n));
51 //____________________________________________________________________
52 const char* ntostr(double n)
54 if (int(2 * fabs(n)) % 2 == 1)
55 return Form("I_{%d/2}", int(2 * n));
56 return Form("I_{%d}", int(n));
59 //____________________________________________________________________
63 //____________________________________________________________________
64 void compare(double n, int col)
66 Double_t min = 0.00001;
69 c = new TCanvas("c_I", "I_{#nu}");
72 TH2* f = new TH2F("f_I", "I_{#nu}", 100, min, max, 100, -1, 13);
74 f->SetYTitle("I_{#nu}");
78 TString str = ntostr(n);
79 TString nm = ntonm(n);
82 TF1* r = new TF1(Form("root_%s", nm.Data()), rootI, min, max, 1);
83 r->SetTitle(Form("%s (ROOT)", str.Data()));
84 r->SetParameter(0, n);
89 TF1* m = new TF1(Form("my_%s", nm.Data()), myI, min, max, 1);
90 m->SetTitle(Form("%s (My)", str.Data()));
91 m->SetParameter(0, n);
101 //____________________________________________________________________
102 void dcompare(double n, int col)
107 d = new TCanvas("c_dI", "dI_{#nu}/dx");
110 TH2* f = new TH2F("f_dI", "dI_{#nu}/dx", 100, min, max, 100, -1, 12);
112 f->SetYTitle("dI_{#nu}/dx");
117 TString str = ntostr(n);
118 TString nm = ntonm(n);
121 TF1* r = new TF1(Form("root_d%s", nm.Data()), rootI, min, max, 1);
122 r->SetTitle(Form("d%s/dx (ROOT)", str.Data()));
123 r->SetParameter(0, n);
124 r->SetLineColor(col);
125 TGraph* g = new TGraph(r, "d");
126 g->SetTitle(r->GetTitle());
130 TF1* m = new TF1(Form("my_d%s", nm.Data()), myDI, min, max, 1);
131 m->SetTitle(Form("d%s/dx (My)", str.Data()));
132 m->SetParameter(0, n);
133 m->SetLineColor(col);
142 //____________________________________________________________________
146 gStyle->SetPalette(1);
147 // gStyle->SetOptTitle(0);
148 // double n[] = { 0, 0.5, 1, 1.5, 2, 2.5, 3 };
149 double n[] = { -1, 0, 0.5, 1, 1.5, 2, 2.5, 3 };
150 // double n[] = { 0.5, 1.5, 2.5 };
151 // double n[] = { 0.5, 1.5, 2.5 };
152 size_t m = sizeof(n)/sizeof(double);
153 Int_t nc = gStyle->GetNumberOfColors();
154 for (size_t i = 0; i < m; i++) {
155 int col = gStyle->GetColorPalette(int(float(i) / m * nc));
160 c->SetTopMargin(0.05);
161 c->SetRightMargin(0.05);
162 TLegend* l = c->BuildLegend(.1, .35, .4, .95);
167 d->SetTopMargin(0.05);
168 d->SetRightMargin(0.05);
169 l = d->BuildLegend(.1, .35, .4, .95);
172 // d->Print("dI.ps");
179 TApplication app("app", 0, 0);