Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
PolLeg.h File Reference

Go to the source code of this file.

Functions

double polleg (int l, double x)
 

Function Documentation

◆ polleg()

double polleg ( int  l,
double  x 
)

Definition at line 14 of file PolLeg.cpp.

14 {
15 mfunname("double polleg(int l, double x)");
16 check_econd11(l, < 0, mcerr);
17 check_econd11a(l, > 6, "not implemented", mcerr);
18 switch (l) {
19 case 0:
20 return 1.0;
21 case 1:
22 return x;
23 case 2:
24 return 0.5 * (3.0 * x * x - 1.0);
25 case 3:
26 return 0.5 * (5.0 * x * x * x - 3.0 * x);
27 case 4: {
28 double x2 = x * x;
29 return 1.0 / 8.0 * (35.0 * x2 * x2 - 30.0 * x2 + 3.0);
30 }
31 case 5: {
32 double x2 = x * x;
33 double x3 = x2 * x;
34 return 1.0 / 8.0 * (63.0 * x3 * x2 - 70.0 * x3 + 15.0 * x);
35 }
36 case 6: {
37 double x2 = x * x;
38 double x4 = x2 * x2;
39 return 1.0 / 16.0 * (231.0 * x4 * x2 - 315.0 * x4 + 105.0 * x2 - 5.0);
40 }
41 default:
42 return 0.0;
43 }
44 /*
45 if( l == 0 )
46 return 1.0;
47 else if(l == 1)
48 return x;
49 else if(l == 2)
50 return 0.5 * (3.0 * x * x - 1.0);
51 return 0.0; // should never happen
52 */
53}
#define check_econd11(a, signb, stream)
Definition: FunNameStack.h:366
#define check_econd11a(a, signb, add, stream)
Definition: FunNameStack.h:395
#define mfunname(string)
Definition: FunNameStack.h:67
#define mcerr
Definition: prstream.h:135

Referenced by Heed::ElElasticScatDataStruct::CS().