52 result->
SetData(running++, x, y);
56 else if( left.
GetX(i)+right.
GetX(j) == 0
57 || std::abs((right.
GetX(j)-left.
GetX(i))/(left.
GetX(i)+right.
GetX(j))) > 0.001 )
61 result->
SetData(running++, x, y);
73 result->
SetData(running++, x, y);
90 the15percentBorderCash = -
DBL_MAX;
91 the50percentBorderCash = -
DBL_MAX;
98 nPoints=std::max(n, 20);
106 the15percentBorderCash = -
DBL_MAX;
107 the50percentBorderCash = -
DBL_MAX;
115 delete [] theIntegral;
123 if(&right ==
this)
return *
this;
127 totalIntegral = right.totalIntegral;
128 if(right.theIntegral!=0) theIntegral =
new G4double[right.nEntries];
129 for(i=0; i<right.nEntries; i++)
132 if(right.theIntegral!=0) theIntegral[i] = right.theIntegral[i];
134 theManager = right.theManager;
137 Verbose = right.Verbose;
138 the15percentBorderCash = right.the15percentBorderCash;
139 the50percentBorderCash = right.the50percentBorderCash;
140 theHash = right.theHash;
147 if(nEntries == 0)
return 0;
151 for(i=min ; i<nEntries; i++)
154 if(theData[i].
GetX() >= e)
break;
169 if(e<theData[nEntries-1].
GetX())
173 if ( theData[high].
GetX() !=0
176 &&( std::abs( (theData[high].
GetX()-theData[low].
GetX())/theData[high].
GetX() ) < 0.000001 ) )
178 y = theData[low].
GetY();
183 theData[low].
GetX(), theData[high].
GetX(),
184 theData[low].
GetY(), theData[high].
GetY());
189 y=theData[nEntries-1].
GetY();
197 for(
G4int i=0; i<nEntries; i++)
207 void G4NeutronHPVector::Check(
G4int i)
209 if(i>nEntries)
throw G4HadronicException(__FILE__, __LINE__,
"Skipped some index numbers in G4NeutronHPVector");
212 nPoints =
static_cast<G4int>(1.2*nPoints);
214 for (
G4int j=0; j<nEntries; j++) buff[j] = theData[j];
218 if(i==nEntries) nEntries=i+1;
229 G4int s_tmp = 0,
n=0, m_tmp=0;
246 && std::abs(std::abs(xp-xa)/xa) < 0.0000001
251 active = passive; a=
p;
256 active = passive; a=
p;
265 anX = passive->
GetXsec(p)-deltaX;
292 G4int count = 0, current = 2, start = 1;
295 aBuff[0] = theData[0];
300 x1=aBuff[count].
GetX();
301 y1=aBuff[count].
GetY();
302 x2=theData[current].
GetX();
303 y2=theData[current].
GetY();
304 for(
G4int j=start; j<current; j++)
306 x = theData[j].
GetX();
307 if(x1-x2 == 0) y = (y2+
y1)/2.;
308 else y = theInt.
Lin(x, x1, x2, y1, y2);
309 if (std::abs(y-theData[j].
GetY())>precision*y)
311 aBuff[++count] = theData[current-1];
334 std::vector<G4double>::iterator i;
335 for(i=theBlocked.begin(); i!=theBlocked.end(); i++)
338 if(std::abs(aX-aBlock) < 0.1*
MeV)
359 result = theBuffered[0];
360 theBuffered.erase(theBuffered.begin());
365 result = theData[0].
GetX();
396 if ( rand < theIntegral[i] )
402 if ( ibin < 0 )
G4cout <<
"TKDB 080807 " << rand <<
G4endl;
408 x1 = theData[ ibin ].
GetX();
414 x1 = theData[ ibin-1 ].
GetX();
417 x2 = theData[ ibin ].
GetX();
418 value = rand * ( x2 -
x1 ) + x1;
429 test =(mval*value+bval)/std::max (
GetY( ibin-1 ) ,
GetY ( ibin ) );
436 while(IsBlocked(result));
443 if(the15percentBorderCash>-
DBL_MAX/2.)
return the15percentBorderCash;
447 result = theData[0].
GetX();
448 the15percentBorderCash = result;
460 the15percentBorderCash = result;
464 the15percentBorderCash = result;
471 if(the50percentBorderCash>-
DBL_MAX/2.)
return the50percentBorderCash;
475 result = theData[0].
GetX();
476 the50percentBorderCash = result;
499 y1 = theData[i-1].
GetX();
500 y2 = theData[i].
GetX();
501 result = theLin.
Lin(x, x1, x2, y1, y2);
503 the50percentBorderCash = result;
507 the50percentBorderCash = result;