Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleHPFastLegendre Class Reference

#include <G4ParticleHPFastLegendre.hh>

Public Member Functions

 G4ParticleHPFastLegendre ()
 
 ~G4ParticleHPFastLegendre ()
 
G4double Integrate (G4int l, G4double costh)
 
G4double Evaluate (G4int l, G4double costh)
 

Detailed Description

Definition at line 34 of file G4ParticleHPFastLegendre.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPFastLegendre()

G4ParticleHPFastLegendre::G4ParticleHPFastLegendre ( )
inline

Definition at line 37 of file G4ParticleHPFastLegendre.hh.

38 {
39 value = new const G4double*[31];
40 value[0] = l0;
41 value[1] = l1;
42 value[2] = l2;
43 value[3] = l3;
44 value[4] = l4;
45 value[5] = l5;
46 value[6] = l6;
47 value[7] = l7;
48 value[8] = l8;
49 value[9] = l9;
50 value[10] = l10;
51 value[11] = l11;
52 value[12] = l12;
53 value[13] = l13;
54 value[14] = l14;
55 value[15] = l15;
56 value[16] = l16;
57 value[17] = l17;
58 value[18] = l18;
59 value[19] = l19;
60 value[20] = l20;
61 value[21] = l21;
62 value[22] = l22;
63 value[23] = l23;
64 value[24] = l24;
65 value[25] = l25;
66 value[26] = l26;
67 value[27] = l27;
68 value[28] = l28;
69 value[29] = l29;
70 value[30] = l30;
71 integral = new const G4double*[31];
72 integral[0] = i0;
73 integral[1] = i1;
74 integral[2] = i2;
75 integral[3] = i3;
76 integral[4] = i4;
77 integral[5] = i5;
78 integral[6] = i6;
79 integral[7] = i7;
80 integral[8] = i8;
81 integral[9] = i9;
82 integral[10] = i10;
83 integral[11] = i11;
84 integral[12] = i12;
85 integral[13] = i13;
86 integral[14] = i14;
87 integral[15] = i15;
88 integral[16] = i16;
89 integral[17] = i17;
90 integral[18] = i18;
91 integral[19] = i19;
92 integral[20] = i20;
93 integral[21] = i21;
94 integral[22] = i22;
95 integral[23] = i23;
96 integral[24] = i24;
97 integral[25] = i25;
98 integral[26] = i26;
99 integral[27] = i27;
100 integral[28] = i28;
101 integral[29] = i29;
102 integral[30] = i30;
103
104 G4int i;
105 for (i = 0; i < 31; i++)
106 theNbin[i] = 1 + 200 * (i + 1);
107 }
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85

◆ ~G4ParticleHPFastLegendre()

G4ParticleHPFastLegendre::~G4ParticleHPFastLegendre ( )
inline

Definition at line 109 of file G4ParticleHPFastLegendre.hh.

110 {
111 delete[] value;
112 delete[] integral;
113 }

Member Function Documentation

◆ Evaluate()

G4double G4ParticleHPFastLegendre::Evaluate ( G4int l,
G4double costh )
inline

Definition at line 127 of file G4ParticleHPFastLegendre.hh.

128 {
129 if (l > 30) return regularEvaluate(l, costh);
130 G4double result;
131 G4int bin = GetBin(l, costh);
132 if (bin != theNbin[l] - 1) {
133 G4double y1, y2;
134 y1 = value[l][bin];
135 y2 = value[l][bin + 1];
136 result = Interpolate(bin, l, y1, y2, costh);
137 }
138 else {
139 result = value[l][bin];
140 }
141 return result;
142 }

Referenced by G4ParticleHPLegendreStore::SampleDiscreteTwoBody(), G4ParticleHPLegendreStore::SampleElastic(), and G4ParticleHPLegendreStore::SampleMax().

◆ Integrate()

G4double G4ParticleHPFastLegendre::Integrate ( G4int l,
G4double costh )
inline

Definition at line 115 of file G4ParticleHPFastLegendre.hh.

116 {
117 if (l > 30) return regularIntegrate(l, costh);
118 G4int bin = GetBin(l, costh);
119 G4double y1, y2;
120 // G4cout <<"Testhpw G4ParticleHPFastLegendre::Integrate "<<l<<" "<<bin<<G4endl;
121 y1 = integral[l][bin];
122 y2 = integral[l][bin + 1];
123 // G4cout <<"Testhpw G4ParticleHPFastLegendre::Integrate exit"<<G4endl;
124 return Interpolate(bin, l, y1, y2, costh);
125 }

Referenced by G4ParticleHPLegendreStore::Integrate().


The documentation for this class was generated from the following files: