47 G4int low(0), high(0);
49 for (i0=0; i0<nEnergy; i0++)
52 if(theCoeff[i0].
GetEnergy()>anEnergy)
break;
54 low = std::max(0, high-1);
65 for(i0=0; i0<601; i0++)
72 try01 += (2.*l+1)/2.*theCoeff[low].
GetCoeff(m_tmp)*theLeg.
Evaluate(l, costh);
74 if(try01>max1) max1=try01;
79 try02 += (2.*l+1)/2.*theCoeff[high].
GetCoeff(m_tmp)*theLeg.
Evaluate(l, costh);
81 if(try02>max2) max2=try02;
96 v1 += (2.*l+1)/2.*theCoeff[low].
GetCoeff(m_tmp)*legend;
102 v2 += (2.*l+1)/2.*theCoeff[high].
GetCoeff(m_tmp)*legend;
108 if(0>=theNorm)
break;
110 while(random>value/theNorm);
122 G4int low(0), high(0);
124 for (i0=0; i0<nEnergy; i0++)
127 if(theCoeff[i0].
GetEnergy()>anEnergy)
break;
129 low = std::max(0, high-1);
140 for(i0=0; i0<601; i0++)
148 if(try01>max1) max1=try01;
154 if(try02>max2) max2=try02;
168 v1 += (2.*l+1)/2.*theCoeff[low].
GetCoeff(l)*legend;
173 v2 += (2.*l+1)/2.*theCoeff[high].
GetCoeff(l)*legend;
175 v1 = std::max(0.,v1);
176 v2 = std::max(0.,v2);
179 if(0>=theNorm)
break;
181 while(random>value/theNorm);
192 G4int low(0), high(0);
194 for (i0=0; i0<nEnergy; i0++)
197 if(theCoeff[i0].
GetEnergy()>anEnergy)
break;
199 low = std::max(0, high-1);
206 G4double try01=0, try02=0, try11=0, try12=0;
221 theNorm = std::max(try1, try2);
233 v1 += (2.*l+1)/2.*theCoeff[low].
GetCoeff(l)*legend;
238 v2 += (2.*l+1)/2.*theCoeff[high].
GetCoeff(l)*legend;
243 while(random>value/theNorm);
251 G4int low(0), high(0);
253 for (i0=0; i0<nEnergy; i0++)
257 if(theCoeff[i0].
GetEnergy()>energy)
break;
259 low = std::max(0, high-1);
268 for(i0=0; i0<601; i0++)
274 theBuffer.
SetData(i0, costh, y);
279 for (i0=1; i0<601; i0++)
282 if(rand < theBuffer.
GetY(i0)/theBuffer.
GetY(600))
break;
293 x1 = theBuffer.
GetY(it)/norm;
294 x2 = theBuffer.
GetY(it-1)/norm;
295 y1 = theBuffer.
GetX(it);
296 y2 = theBuffer.
GetX(it-1);
G4InterpolationScheme GetScheme(G4int index) const
G4double Integrate(G4int l, G4double costh)
G4double Evaluate(G4int l, G4double costh)
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
G4double GetEnergy(G4int i)
G4double GetCoeff(G4int i, G4int l)
G4double Integrate(G4int k, G4double costh)
G4double SampleMax(G4double energy)
G4double Sample(G4double energy)
G4double SampleDiscreteTwoBody(G4double anEnergy)
G4double SampleElastic(G4double anEnergy)
G4double GetCoeff(G4int l)
G4double GetX(G4int i) const
G4double GetY(G4double x)
void SetData(G4int i, G4double x, G4double y)