37 std::cout <<
"Drawing associate Legendre Polynomials.." << std::endl;
38 TCanvas *Canvas =
new TCanvas(
"DistCanvas",
"Associate Legendre polynomials", 10, 10, 800, 500);
47 L[0]=
new TF1(
"L_0",
"ROOT::Math::assoc_legendre(1, 0,x)", -1, 1);
48 L[1]=
new TF1(
"L_1",
"ROOT::Math::assoc_legendre(1, 1,x)", -1, 1);
49 L[2]=
new TF1(
"L_2",
"ROOT::Math::assoc_legendre(2, 0,x)", -1, 1);
50 L[3]=
new TF1(
"L_3",
"ROOT::Math::assoc_legendre(2, 1,x)", -1, 1);
51 L[4]=
new TF1(
"L_4",
"ROOT::Math::assoc_legendre(2, 2,x)", -1, 1);
66 L[0]->SetTitle(
"Associate Legendre Polynomials");
67 for (
int nu = 0;
nu < 5;
nu++) {
68 L[
nu]->SetLineStyle(1);
69 L[
nu]->SetLineWidth(2);
70 L[
nu]->SetLineColor(
nu+1);
73 leg1->AddEntry(L[0]->DrawCopy(),
" P^{1}_{0}(x)",
"l");
74 leg1->AddEntry(L[1]->DrawCopy(
"same"),
" P^{1}_{1}(x)",
"l");
75 leg1->AddEntry(L[2]->DrawCopy(
"same"),
" P^{2}_{0}(x)",
"l");
76 leg1->AddEntry(L[3]->DrawCopy(
"same"),
" P^{2}_{1}(x)",
"l");
77 leg1->AddEntry(L[4]->DrawCopy(
"same"),
" P^{2}_{2}(x)",
"l");
84 SL[0]->SetMinimum(-1);
85 SL[0]->SetTitle(
"Spherical Legendre Polynomials");
86 for (
int nu = 0;
nu < 5;
nu++) {
87 SL[
nu]->SetLineStyle(1);
88 SL[
nu]->SetLineWidth(2);
89 SL[
nu]->SetLineColor(
nu+1);
92 leg2->AddEntry(
SL[0]->DrawCopy(),
" P^{1}_{0}(x)",
"l");
93 leg2->AddEntry(
SL[1]->DrawCopy(
"same"),
" P^{1}_{1}(x)",
"l");
94 leg2->AddEntry(
SL[2]->DrawCopy(
"same"),
" P^{2}_{0}(x)",
"l");
95 leg2->AddEntry(
SL[3]->DrawCopy(
"same"),
" P^{2}_{1}(x)",
"l");
96 leg2->AddEntry(
SL[4]->DrawCopy(
"same"),
" P^{2}_{2}(x)",
"l");
102 std::cout <<
"Calculating integrals of Associate Legendre Polynomials on [-1, 1]" << std::endl;
104 for (
int nu = 0;
nu < 5;
nu++) {
105 integral[
nu] =
L[
nu]->Integral(-1.0, 1.0);
106 std::cout <<
"Integral [-1,1] for Associated Legendre Polynomial of Degree " <<
nu <<
"\t = \t" << integral[
nu] << std::endl;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
This class displays a legend box (TPaveText) containing several legend entries.
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
Automatic pad generation by division.
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)=0
RooArgList L(Args_t &&... args)