Geant4  10.02.p03
G4ParticleHPVector Class Reference

#include <G4ParticleHPVector.hh>

Collaboration diagram for G4ParticleHPVector:

Public Member Functions

 G4ParticleHPVector ()
 
 G4ParticleHPVector (G4int n)
 
 ~G4ParticleHPVector ()
 
G4ParticleHPVectoroperator= (const G4ParticleHPVector &right)
 
void SetVerbose (G4int ff)
 
void Times (G4double factor)
 
void SetPoint (G4int i, const G4ParticleHPDataPoint &it)
 
void SetData (G4int i, G4double x, G4double y)
 
void SetX (G4int i, G4double e)
 
void SetEnergy (G4int i, G4double e)
 
void SetY (G4int i, G4double x)
 
void SetXsec (G4int i, G4double x)
 
G4double GetEnergy (G4int i) const
 
G4double GetXsec (G4int i)
 
G4double GetX (G4int i) const
 
const G4ParticleHPDataPointGetPoint (G4int i) const
 
void Hash ()
 
void ReHash ()
 
G4double GetXsec (G4double e)
 
G4double GetXsec (G4double e, G4int min)
 
G4double GetY (G4double x)
 
G4int GetVectorLength () const
 
G4double GetY (G4int i)
 
G4double GetY (G4int i) const
 
void Dump ()
 
void InitInterpolation (std::istream &aDataFile)
 
void Init (std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
 
void Init (std::istream &aDataFile, G4double ux=1., G4double uy=1.)
 
void ThinOut (G4double precision)
 
void SetLabel (G4double aLabel)
 
G4double GetLabel ()
 
void CleanUp ()
 
void Merge (G4ParticleHPVector *active, G4ParticleHPVector *passive)
 
void Merge (G4InterpolationScheme aScheme, G4double aValue, G4ParticleHPVector *active, G4ParticleHPVector *passive)
 
G4double SampleLin ()
 
G4double Sample ()
 
G4doubleDebug ()
 
void IntegrateAndNormalise ()
 
void Integrate ()
 
G4double GetIntegral ()
 
void SetInterpolationManager (const G4InterpolationManager &aManager)
 
const G4InterpolationManagerGetInterpolationManager () const
 
void SetInterpolationManager (G4InterpolationManager &aMan)
 
void SetScheme (G4int aPoint, const G4InterpolationScheme &aScheme)
 
G4InterpolationScheme GetScheme (G4int anIndex)
 
G4double GetMeanX ()
 
std::vector< G4doubleGetBlocked ()
 
std::vector< G4doubleGetBuffered ()
 
G4double Get15percentBorder ()
 
G4double Get50percentBorder ()
 

Private Member Functions

void Check (G4int i)
 
G4bool IsBlocked (G4double aX)
 

Private Attributes

G4ParticleHPInterpolator theLin
 
G4double totalIntegral
 
G4ParticleHPDataPointtheData
 
G4InterpolationManager theManager
 
G4doubletheIntegral
 
G4int nEntries
 
G4int nPoints
 
G4double label
 
G4ParticleHPInterpolator theInt
 
G4int Verbose
 
G4int isFreed
 
G4ParticleHPHash theHash
 
G4double maxValue
 
std::vector< G4doubletheBlocked
 
std::vector< G4doubletheBuffered
 
G4double the15percentBorderCash
 
G4double the50percentBorderCash
 

Friends

G4ParticleHPVectoroperator+ (G4ParticleHPVector &left, G4ParticleHPVector &right)
 

Detailed Description

Definition at line 56 of file G4ParticleHPVector.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPVector() [1/2]

G4ParticleHPVector::G4ParticleHPVector ( )

◆ G4ParticleHPVector() [2/2]

G4ParticleHPVector::G4ParticleHPVector ( G4int  n)

Definition at line 98 of file G4ParticleHPVector.cc.

99  {
100  nPoints=std::max(n, 20);
102  nEntries=0;
103  Verbose=0;
104  theIntegral=0;
105  totalIntegral=-1;
106  isFreed = 0;
107  maxValue = -DBL_MAX;
110  label = -DBL_MAX;
111  }
Char_t n[5]
G4ParticleHPDataPoint * theData
#define DBL_MAX
Definition: templates.hh:83

◆ ~G4ParticleHPVector()

G4ParticleHPVector::~G4ParticleHPVector ( )

Definition at line 113 of file G4ParticleHPVector.cc.

114  {
115 // if(Verbose==1)G4cout <<"G4ParticleHPVector::~G4ParticleHPVector"<<G4endl;
116  delete [] theData;
117 // if(Verbose==1)G4cout <<"Vector: delete theData"<<G4endl;
118  delete [] theIntegral;
119 // if(Verbose==1)G4cout <<"Vector: delete theIntegral"<<G4endl;
120  theHash.Clear();
121  isFreed = 1;
122  }
G4ParticleHPHash theHash
G4ParticleHPDataPoint * theData
Here is the call graph for this function:

Member Function Documentation

◆ Check()

void G4ParticleHPVector::Check ( G4int  i)
private

Definition at line 218 of file G4ParticleHPVector.cc.

219  {
220  if(i>nEntries) throw G4HadronicException(__FILE__, __LINE__, "Skipped some index numbers in G4ParticleHPVector");
221  if(i==nPoints)
222  {
223  nPoints = static_cast<G4int>(1.2*nPoints);
225  for (G4int j=0; j<nEntries; j++) buff[j] = theData[j];
226  delete [] theData;
227  theData = buff;
228  }
229  if(i==nEntries) nEntries=i+1;
230  }
int G4int
Definition: G4Types.hh:78
G4ParticleHPDataPoint * theData
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CleanUp()

void G4ParticleHPVector::CleanUp ( )
inline

Definition at line 261 of file G4ParticleHPVector.hh.

262  {
263  nEntries=0;
265  maxValue = -DBL_MAX;
266  theHash.Clear();
267 //080811 TK DB
268  delete[] theIntegral;
269  theIntegral = NULL;
270  }
G4ParticleHPHash theHash
G4InterpolationManager theManager
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Debug()

G4double* G4ParticleHPVector::Debug ( )
inline

Definition at line 368 of file G4ParticleHPVector.hh.

369  {
370  return theIntegral;
371  }

◆ Dump()

void G4ParticleHPVector::Dump ( )

Definition at line 205 of file G4ParticleHPVector.cc.

206  {
207  G4cout << nEntries<<G4endl;
208  for(G4int i=0; i<nEntries; i++)
209  {
210  G4cout << theData[i].GetX()<<" ";
211  G4cout << theData[i].GetY()<<" ";
212 // if (i!=1&&i==5*(i/5)) G4cout << G4endl;
213  G4cout << G4endl;
214  }
215  G4cout << G4endl;
216  }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4ParticleHPDataPoint * theData
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get15percentBorder()

G4double G4ParticleHPVector::Get15percentBorder ( )

Definition at line 466 of file G4ParticleHPVector.cc.

467  {
469  G4double result;
470  if(GetVectorLength()==1)
471  {
472  result = theData[0].GetX();
473  the15percentBorderCash = result;
474  }
475  else
476  {
477  if(theIntegral==0) { IntegrateAndNormalise(); }
478  G4int i;
479  result = theData[GetVectorLength()-1].GetX();
480  for(i=0;i<GetVectorLength();i++)
481  {
482  if(theIntegral[i]/theIntegral[GetVectorLength()-1]>0.15)
483  {
484  result = theData[std::min(i+1, GetVectorLength()-1)].GetX();
485  the15percentBorderCash = result;
486  break;
487  }
488  }
489  the15percentBorderCash = result;
490  }
491  return result;
492  }
int G4int
Definition: G4Types.hh:78
G4ParticleHPDataPoint * theData
G4int GetVectorLength() const
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get50percentBorder()

G4double G4ParticleHPVector::Get50percentBorder ( )

Definition at line 494 of file G4ParticleHPVector.cc.

495  {
497  G4double result;
498  if(GetVectorLength()==1)
499  {
500  result = theData[0].GetX();
501  the50percentBorderCash = result;
502  }
503  else
504  {
505  if(theIntegral==0) { IntegrateAndNormalise(); }
506  G4int i;
507  G4double x = 0.5;
508  result = theData[GetVectorLength()-1].GetX();
509  for(i=0;i<GetVectorLength();i++)
510  {
512  {
513  G4int it;
514  it = i;
515  if(it == GetVectorLength()-1)
516  {
517  result = theData[GetVectorLength()-1].GetX();
518  }
519  else
520  {
521  G4double x1, x2, y1, y2;
522  x1 = theIntegral[i-1]/theIntegral[GetVectorLength()-1];
524  y1 = theData[i-1].GetX();
525  y2 = theData[i].GetX();
526  result = theLin.Lin(x, x1, x2, y1, y2);
527  }
528  the50percentBorderCash = result;
529  break;
530  }
531  }
532  the50percentBorderCash = result;
533  }
534  return result;
535  }
Double_t y2[nxs]
Double_t y1[nxs]
G4double Lin(G4double x, G4double x1, G4double x2, G4double y1, G4double y2)
Double_t x2[nxs]
int G4int
Definition: G4Types.hh:78
G4ParticleHPDataPoint * theData
Double_t x1[nxs]
G4int GetVectorLength() const
G4ParticleHPInterpolator theLin
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBlocked()

std::vector<G4double> G4ParticleHPVector::GetBlocked ( )
inline

Definition at line 538 of file G4ParticleHPVector.hh.

538 {return theBlocked;}
std::vector< G4double > theBlocked

◆ GetBuffered()

std::vector<G4double> G4ParticleHPVector::GetBuffered ( )
inline

Definition at line 539 of file G4ParticleHPVector.hh.

539 {return theBuffered;}
std::vector< G4double > theBuffered
Here is the call graph for this function:

◆ GetEnergy()

G4double G4ParticleHPVector::GetEnergy ( G4int  i) const
inline

Definition at line 125 of file G4ParticleHPVector.hh.

125 { return theData[i].GetX(); }
G4ParticleHPDataPoint * theData
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIntegral()

G4double G4ParticleHPVector::GetIntegral ( )
inline

Definition at line 477 of file G4ParticleHPVector.hh.

478  {
479  if(totalIntegral<-0.5) Integrate();
480  return totalIntegral;
481  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInterpolationManager()

const G4InterpolationManager& G4ParticleHPVector::GetInterpolationManager ( ) const
inline

Definition at line 488 of file G4ParticleHPVector.hh.

489  {
490  return theManager;
491  }
G4InterpolationManager theManager
Here is the caller graph for this function:

◆ GetLabel()

G4double G4ParticleHPVector::GetLabel ( )
inline

Definition at line 256 of file G4ParticleHPVector.hh.

257  {
258  return label;
259  }
Here is the caller graph for this function:

◆ GetMeanX()

G4double G4ParticleHPVector::GetMeanX ( )
inline

Definition at line 508 of file G4ParticleHPVector.hh.

509  {
510  G4double result;
511  G4double running = 0;
512  G4double weighted = 0;
513  for(G4int i=1; i<nEntries; i++)
514  {
515  running += theInt.GetBinIntegral(theManager.GetScheme(i-1),
516  theData[i-1].GetX(), theData[i].GetX(),
517  theData[i-1].GetY(), theData[i].GetY());
519  theData[i-1].GetX(), theData[i].GetX(),
520  theData[i-1].GetY(), theData[i].GetY());
521  }
522  result = weighted / running;
523  return result;
524  }
G4ParticleHPInterpolator theInt
int G4int
Definition: G4Types.hh:78
G4InterpolationManager theManager
G4ParticleHPDataPoint * theData
G4double GetWeightedBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)
G4InterpolationScheme GetScheme(G4int index) const
G4double GetBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPoint()

const G4ParticleHPDataPoint& G4ParticleHPVector::GetPoint ( G4int  i) const
inline

Definition at line 133 of file G4ParticleHPVector.hh.

133 { return theData[i]; }
G4ParticleHPDataPoint * theData
Here is the caller graph for this function:

◆ GetScheme()

G4InterpolationScheme G4ParticleHPVector::GetScheme ( G4int  anIndex)
inline

Definition at line 503 of file G4ParticleHPVector.hh.

504  {
505  return theManager.GetScheme(anIndex);
506  }
G4InterpolationManager theManager
G4InterpolationScheme GetScheme(G4int index) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetVectorLength()

G4int G4ParticleHPVector::GetVectorLength ( ) const
inline

Definition at line 199 of file G4ParticleHPVector.hh.

199 {return nEntries;}
Here is the caller graph for this function:

◆ GetX()

G4double G4ParticleHPVector::GetX ( G4int  i) const
inline

Definition at line 127 of file G4ParticleHPVector.hh.

128  {
129  if (i<0) i=0;
130  if(i>=GetVectorLength()) i=GetVectorLength()-1;
131  return theData[i].GetX();
132  }
G4ParticleHPDataPoint * theData
G4int GetVectorLength() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetXsec() [1/3]

G4double G4ParticleHPVector::GetXsec ( G4int  i)
inline

Definition at line 126 of file G4ParticleHPVector.hh.

126 { return theData[i].GetY(); }
G4ParticleHPDataPoint * theData
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetXsec() [2/3]

G4double G4ParticleHPVector::GetXsec ( G4double  e)

Definition at line 149 of file G4ParticleHPVector.cc.

150  {
151  if(nEntries == 0) return 0;
152  //if(!theHash.Prepared()) Hash();
153  if ( !theHash.Prepared() ) {
154  if ( G4Threading::IsWorkerThread() ) {
155  ;
156  } else {
157  Hash();
158  }
159  }
161  G4int i;
162  for(i=min ; i<nEntries; i++)
163  {
164  //if(theData[i].GetX()>e) break;
165  if(theData[i].GetX() >= e) break;
166  }
167  G4int low = i-1;
168  G4int high = i;
169  if(i==0)
170  {
171  low = 0;
172  high = 1;
173  }
174  else if(i==nEntries)
175  {
176  low = nEntries-2;
177  high = nEntries-1;
178  }
179  G4double y;
180  if(e<theData[nEntries-1].GetX())
181  {
182  // Protect against doubled-up x values
183  //if( (theData[high].GetX()-theData[low].GetX())/theData[high].GetX() < 0.000001)
184  if ( theData[high].GetX() !=0
185  //080808 TKDB
186  //&&( theData[high].GetX()-theData[low].GetX())/theData[high].GetX() < 0.000001)
187  &&( std::abs( (theData[high].GetX()-theData[low].GetX())/theData[high].GetX() ) < 0.000001 ) )
188  {
189  y = theData[low].GetY();
190  }
191  else
192  {
194  theData[low].GetX(), theData[high].GetX(),
195  theData[low].GetY(), theData[high].GetY());
196  }
197  }
198  else
199  {
200  y=theData[nEntries-1].GetY();
201  }
202  return y;
203  }
G4ParticleHPInterpolator theInt
int G4int
Definition: G4Types.hh:78
G4ParticleHPHash theHash
G4InterpolationManager theManager
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
Double_t y
G4ParticleHPDataPoint * theData
G4bool IsWorkerThread()
Definition: G4Threading.cc:135
G4InterpolationScheme GetScheme(G4int index) const
G4double GetX(G4int i) const
G4int GetMinIndex(G4double e) const
G4bool Prepared() const
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ GetXsec() [3/3]

G4double G4ParticleHPVector::GetXsec ( G4double  e,
G4int  min 
)
inline

Definition at line 157 of file G4ParticleHPVector.hh.

158  {
159  G4int i;
160  for(i=min ; i<nEntries; i++)
161  {
162  if(theData[i].GetX()>e) break;
163  }
164  G4int low = i-1;
165  G4int high = i;
166  if(i==0)
167  {
168  low = 0;
169  high = 1;
170  }
171  else if(i==nEntries)
172  {
173  low = nEntries-2;
174  high = nEntries-1;
175  }
176  G4double y;
177  if(e<theData[nEntries-1].GetX())
178  {
179  // Protect against doubled-up x values
180  if( (theData[high].GetX()-theData[low].GetX())/theData[high].GetX() < 0.000001)
181  {
182  y = theData[low].GetY();
183  }
184  else
185  {
187  theData[low].GetX(), theData[high].GetX(),
188  theData[low].GetY(), theData[high].GetY());
189  }
190  }
191  else
192  {
193  y=theData[nEntries-1].GetY();
194  }
195  return y;
196  }
G4ParticleHPInterpolator theInt
int G4int
Definition: G4Types.hh:78
G4InterpolationManager theManager
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
Double_t y
G4ParticleHPDataPoint * theData
G4InterpolationScheme GetScheme(G4int index) const
G4double GetX(G4int i) const
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ GetY() [1/3]

G4double G4ParticleHPVector::GetY ( G4double  x)
inline

Definition at line 198 of file G4ParticleHPVector.hh.

198 {return GetXsec(x);}
G4double GetXsec(G4int i)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetY() [2/3]

G4double G4ParticleHPVector::GetY ( G4int  i)
inline

Definition at line 201 of file G4ParticleHPVector.hh.

202  {
203  if (i<0) i=0;
204  if(i>=GetVectorLength()) i=GetVectorLength()-1;
205  return theData[i].GetY();
206  }
G4ParticleHPDataPoint * theData
G4int GetVectorLength() const
Here is the call graph for this function:

◆ GetY() [3/3]

G4double G4ParticleHPVector::GetY ( G4int  i) const
inline

Definition at line 208 of file G4ParticleHPVector.hh.

209  {
210  if (i<0) i=0;
211  if(i>=GetVectorLength()) i=GetVectorLength()-1;
212  return theData[i].GetY();
213  }
G4ParticleHPDataPoint * theData
G4int GetVectorLength() const
Here is the call graph for this function:

◆ Hash()

void G4ParticleHPVector::Hash ( )
inline

Definition at line 135 of file G4ParticleHPVector.hh.

136  {
137  G4int i;
138  G4double x, y;
139  for(i=0 ; i<nEntries; i++)
140  {
141  if(0 == (i+1)%10)
142  {
143  x = GetX(i);
144  y = GetY(i);
145  theHash.SetData(i, x, y);
146  }
147  }
148  }
int G4int
Definition: G4Types.hh:78
void SetData(G4int index, G4double x, G4double y)
G4ParticleHPHash theHash
Double_t y
G4double GetY(G4double x)
G4double GetX(G4int i) const
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init() [1/2]

void G4ParticleHPVector::Init ( std::istream &  aDataFile,
G4int  total,
G4double  ux = 1.,
G4double  uy = 1. 
)
inline

Definition at line 221 of file G4ParticleHPVector.hh.

222  {
223  G4double x,y;
224  for (G4int i=0;i<total;i++)
225  {
226  aDataFile >> x >> y;
227  x*=ux;
228  y*=uy;
229  SetData(i,x,y);
230  if(0 == nEntries%10)
231  {
232  theHash.SetData(nEntries-1, x, y);
233  }
234  }
235  }
void SetData(G4int i, G4double x, G4double y)
int G4int
Definition: G4Types.hh:78
void SetData(G4int index, G4double x, G4double y)
G4ParticleHPHash theHash
Double_t y
G4double total(Particle const *const p1, Particle const *const p2)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init() [2/2]

void G4ParticleHPVector::Init ( std::istream &  aDataFile,
G4double  ux = 1.,
G4double  uy = 1. 
)
inline

Definition at line 237 of file G4ParticleHPVector.hh.

238  {
239  G4int total;
240  aDataFile >> total;
241  if(theData!=0) delete [] theData;
243  nPoints=total;
244  nEntries=0;
245  theManager.Init(aDataFile);
246  Init(aDataFile, total, ux, uy);
247  }
void Init(G4int aScheme, G4int aRange)
int G4int
Definition: G4Types.hh:78
G4InterpolationManager theManager
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
G4ParticleHPDataPoint * theData
G4double total(Particle const *const p1, Particle const *const p2)
Here is the call graph for this function:

◆ InitInterpolation()

void G4ParticleHPVector::InitInterpolation ( std::istream &  aDataFile)
inline

Definition at line 216 of file G4ParticleHPVector.hh.

217  {
218  theManager.Init(aDataFile);
219  }
void Init(G4int aScheme, G4int aRange)
G4InterpolationManager theManager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Integrate()

void G4ParticleHPVector::Integrate ( )
inline

Definition at line 423 of file G4ParticleHPVector.hh.

424  {
425  G4int i;
426  if(nEntries == 1)
427  {
428  totalIntegral = 0;
429  return;
430  }
431  G4double sum = 0;
432  for(i=1;i<GetVectorLength();i++)
433  {
434  if(std::abs((theData[i].GetX()-theData[i-1].GetX())/theData[i].GetX())>0.0000001)
435  {
436  G4double x1 = theData[i-1].GetX();
437  G4double x2 = theData[i].GetX();
438  G4double y1 = theData[i-1].GetY();
439  G4double y2 = theData[i].GetY();
441  if(aScheme==LINLIN||aScheme==CLINLIN||aScheme==ULINLIN)
442  {
443  sum+= 0.5*(y2+y1)*(x2-x1);
444  }
445  else if(aScheme==LINLOG||aScheme==CLINLOG||aScheme==ULINLOG)
446  {
447  G4double a = y1;
448  G4double b = (y2-y1)/(G4Log(x2)-G4Log(x1));
449  sum+= (a-b)*(x2-x1) + b*(x2*G4Log(x2)-x1*G4Log(x1));
450  }
451  else if(aScheme==LOGLIN||aScheme==CLOGLIN||aScheme==ULOGLIN)
452  {
453  G4double a = G4Log(y1);
454  G4double b = (G4Log(y2)-G4Log(y1))/(x2-x1);
455  sum += (G4Exp(a)/b)*(G4Exp(b*x2)-G4Exp(b*x1));
456  }
457  else if(aScheme==HISTO||aScheme==CHISTO||aScheme==UHISTO)
458  {
459  sum+= y1*(x2-x1);
460  }
461  else if(aScheme==LOGLOG||aScheme==CLOGLOG||aScheme==ULOGLOG)
462  {
463  G4double a = G4Log(y1);
464  G4double b = (G4Log(y2)-G4Log(y1))/(G4Log(x2)-G4Log(x1));
465  sum += (G4Exp(a)/(b+1))*(G4Pow::GetInstance()->powA(x2,b+1)-G4Pow::GetInstance()->powA(x1,b+1));
466  }
467  else
468  {
469  throw G4HadronicException(__FILE__, __LINE__, "Unknown interpolation scheme in G4ParticleHPVector::Integrate");
470  }
471 
472  }
473  }
474  totalIntegral = sum;
475  }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
Double_t y2[nxs]
Double_t y1[nxs]
Double_t x2[nxs]
int G4int
Definition: G4Types.hh:78
G4InterpolationManager theManager
G4ParticleHPDataPoint * theData
Double_t x1[nxs]
G4int GetVectorLength() const
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
G4InterpolationScheme
G4InterpolationScheme GetScheme(G4int index) const
G4double GetX(G4int i) const
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IntegrateAndNormalise()

void G4ParticleHPVector::IntegrateAndNormalise ( )
inline

Definition at line 373 of file G4ParticleHPVector.hh.

374  {
375  G4int i;
376  if(theIntegral!=0) return;
378  if(nEntries == 1)
379  {
380  theIntegral[0] = 1;
381  return;
382  }
383  theIntegral[0] = 0;
384  G4double sum = 0;
385  G4double x1 = 0;
386  G4double x0 = 0;
387  for(i=1;i<GetVectorLength();i++)
388  {
389  x1 = theData[i].GetX();
390  x0 = theData[i-1].GetX();
391  if (std::abs(x1-x0) > std::abs(x1*0.0000001) )
392  {
393  //********************************************************************
394  //EMendoza -> the interpolation scheme is not always lin-lin
395  /*
396  sum+= 0.5*(theData[i].GetY()+theData[i-1].GetY())*
397  (x1-x0);
398  */
399  //********************************************************************
401  G4double y0 = theData[i-1].GetY();
402  G4double y1 = theData[i].GetY();
403  G4double integ=theInt.GetBinIntegral(aScheme,x0,x1,y0,y1);
404 #if defined WIN32-VC
405  if(!_finite(integ)){integ=0;}
406 #elif defined __IBMCPP__
407  if(isinf(integ)||isnan(integ)){integ=0;}
408 #else
409  if(std::isinf(integ)||std::isnan(integ)){integ=0;}
410 #endif
411  sum+=integ;
412  //********************************************************************
413  }
414  theIntegral[i] = sum;
415  }
417  for(i=1;i<GetVectorLength();i++)
418  {
419  theIntegral[i]/=total;
420  }
421  }
Double_t y1[nxs]
G4ParticleHPInterpolator theInt
int G4int
Definition: G4Types.hh:78
G4InterpolationManager theManager
G4ParticleHPDataPoint * theData
Double_t x1[nxs]
G4int GetVectorLength() const
G4InterpolationScheme
G4double total(Particle const *const p1, Particle const *const p2)
G4InterpolationScheme GetScheme(G4int index) const
G4double GetBinIntegral(const G4InterpolationScheme &aScheme, const G4double x1, const G4double x2, const G4double y1, const G4double y2)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsBlocked()

G4bool G4ParticleHPVector::IsBlocked ( G4double  aX)
private

Definition at line 342 of file G4ParticleHPVector.cc.

343  {
344  G4bool result = false;
345  std::vector<G4double>::iterator i;
346  for(i=theBlocked.begin(); i!=theBlocked.end(); i++)
347  {
348  G4double aBlock = *i;
349  if(std::abs(aX-aBlock) < 0.1*MeV)
350  {
351  result = true;
352  theBlocked.erase(i);
353  break;
354  }
355  }
356  return result;
357  }
static const double MeV
Definition: G4SIunits.hh:211
bool G4bool
Definition: G4Types.hh:79
std::vector< G4double > theBlocked
double G4double
Definition: G4Types.hh:76
Here is the caller graph for this function:

◆ Merge() [1/2]

void G4ParticleHPVector::Merge ( G4ParticleHPVector active,
G4ParticleHPVector passive 
)
inline

Definition at line 273 of file G4ParticleHPVector.hh.

274  {
275  CleanUp();
276  G4int s_tmp = 0, n=0, m_tmp=0;
278  G4int a = s_tmp, p = n, t;
279  while (a<active->GetVectorLength()&&p<passive->GetVectorLength()) // Loop checking, 11.05.2015, T. Koi
280  {
281  if(active->GetEnergy(a) <= passive->GetEnergy(p))
282  {
283  G4double xa = active->GetEnergy(a);
284  G4double yy = active->GetXsec(a);
285  SetData(m_tmp, xa, yy);
286  theManager.AppendScheme(m_tmp, active->GetScheme(a));
287  m_tmp++;
288  a++;
289  G4double xp = passive->GetEnergy(p);
290 
291 //080409 TKDB
292  //if( std::abs(std::abs(xp-xa)/xa)<0.001 ) p++;
293  if ( !( xa == 0 ) && std::abs(std::abs(xp-xa)/xa)<0.001 ) p++;
294  } else {
295  tmp = active;
296  t=a;
297  active = passive;
298  a=p;
299  passive = tmp;
300  p=t;
301  }
302  }
303  while (a!=active->GetVectorLength()) // Loop checking, 11.05.2015, T. Koi
304  {
305  SetData(m_tmp, active->GetEnergy(a), active->GetXsec(a));
306  theManager.AppendScheme(m_tmp++, active->GetScheme(a));
307  a++;
308  }
309  while (p!=passive->GetVectorLength()) // Loop checking, 11.05.2015, T. Koi
310  {
311  if(std::abs(GetEnergy(m_tmp-1)-passive->GetEnergy(p))/passive->GetEnergy(p)>0.001)
312  //if(std::abs(GetEnergy(m)-passive->GetEnergy(p))/passive->GetEnergy(p)>0.001)
313  {
314  SetData(m_tmp, passive->GetEnergy(p), passive->GetXsec(p));
315  theManager.AppendScheme(m_tmp++, active->GetScheme(p));
316  }
317  p++;
318  }
319  }
Double_t yy
Float_t tmp
void SetData(G4int i, G4double x, G4double y)
G4double GetEnergy(G4int i) const
int G4int
Definition: G4Types.hh:78
G4double GetXsec(G4int i)
G4InterpolationManager theManager
void AppendScheme(G4int aPoint, const G4InterpolationScheme &aScheme)
Char_t n[5]
G4int GetVectorLength() const
double G4double
Definition: G4Types.hh:76
G4InterpolationScheme GetScheme(G4int anIndex)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Merge() [2/2]

void G4ParticleHPVector::Merge ( G4InterpolationScheme  aScheme,
G4double  aValue,
G4ParticleHPVector active,
G4ParticleHPVector passive 
)

Definition at line 233 of file G4ParticleHPVector.cc.

235  {
236  // interpolate between labels according to aScheme, cut at aValue,
237  // continue in unknown areas by substraction of the last difference.
238 
239  CleanUp();
240  G4int s_tmp = 0, n=0, m_tmp=0;
242  G4int a = s_tmp, p = n, t;
243  while ( a<active->GetVectorLength() ) // Loop checking, 11.05.2015, T. Koi
244  {
245  if(active->GetEnergy(a) <= passive->GetEnergy(p))
246  {
247  G4double xa = active->GetEnergy(a);
248  G4double yy = theInt.Interpolate(aScheme, aValue, active->GetLabel(), passive->GetLabel(),
249  active->GetXsec(a), passive->GetXsec(xa));
250  SetData(m_tmp, xa, yy);
251  theManager.AppendScheme(m_tmp, active->GetScheme(a));
252  m_tmp++;
253  a++;
254  G4double xp = passive->GetEnergy(p);
255  //if( std::abs(std::abs(xp-xa)/xa)<0.0000001&&a<active->GetVectorLength() )
256  if ( xa != 0
257  && std::abs(std::abs(xp-xa)/xa) < 0.0000001
258  && a < active->GetVectorLength() )
259  {
260  p++;
261  tmp = active; t=a;
262  active = passive; a=p;
263  passive = tmp; p=t;
264  }
265  } else {
266  tmp = active; t=a;
267  active = passive; a=p;
268  passive = tmp; p=t;
269  }
270  }
271 
272  G4double deltaX = passive->GetXsec(GetEnergy(m_tmp-1)) - GetXsec(m_tmp-1);
273  while (p!=passive->GetVectorLength()&&passive->GetEnergy(p)<=aValue) // Loop checking, 11.05.2015, T. Koi
274  {
275  G4double anX;
276  anX = passive->GetXsec(p)-deltaX;
277  if(anX>0)
278  {
279  //if(std::abs(GetEnergy(m-1)-passive->GetEnergy(p))/passive->GetEnergy(p)>0.0000001)
280  if ( passive->GetEnergy(p) == 0
281  || std::abs(GetEnergy(m_tmp-1)-passive->GetEnergy(p))/passive->GetEnergy(p) > 0.0000001 )
282  {
283  SetData(m_tmp, passive->GetEnergy(p), anX);
284  theManager.AppendScheme(m_tmp++, passive->GetScheme(p));
285  }
286  }
287  p++;
288  }
289  // Rebuild the Hash;
290  if(theHash.Prepared())
291  {
292  ReHash();
293  }
294  }
Double_t yy
Float_t tmp
void SetData(G4int i, G4double x, G4double y)
G4ParticleHPInterpolator theInt
G4double GetEnergy(G4int i) const
int G4int
Definition: G4Types.hh:78
G4double GetXsec(G4int i)
G4ParticleHPHash theHash
G4InterpolationManager theManager
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
void AppendScheme(G4int aPoint, const G4InterpolationScheme &aScheme)
Char_t n[5]
G4int GetVectorLength() const
G4bool Prepared() const
double G4double
Definition: G4Types.hh:76
G4InterpolationScheme GetScheme(G4int anIndex)
Here is the call graph for this function:

◆ operator=()

G4ParticleHPVector & G4ParticleHPVector::operator= ( const G4ParticleHPVector right)

Definition at line 125 of file G4ParticleHPVector.cc.

126  {
127  if(&right == this) return *this;
128 
129  G4int i;
130 
132  if(right.theIntegral!=0) theIntegral = new G4double[right.nEntries];
133  for(i=0; i<right.nEntries; i++)
134  {
135  SetPoint(i, right.GetPoint(i)); // copy theData
136  if(right.theIntegral!=0) theIntegral[i] = right.theIntegral[i];
137  }
138  theManager = right.theManager;
139  label = right.label;
140 
141  Verbose = right.Verbose;
144  theHash = right.theHash;
145  return *this;
146  }
int G4int
Definition: G4Types.hh:78
G4ParticleHPHash theHash
G4InterpolationManager theManager
void SetPoint(G4int i, const G4ParticleHPDataPoint &it)
double G4double
Definition: G4Types.hh:76
const G4ParticleHPDataPoint & GetPoint(G4int i) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReHash()

void G4ParticleHPVector::ReHash ( )
inline

Definition at line 150 of file G4ParticleHPVector.hh.

151  {
152  theHash.Clear();
153  Hash();
154  }
G4ParticleHPHash theHash
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sample()

G4double G4ParticleHPVector::Sample ( )

Definition at line 359 of file G4ParticleHPVector.cc.

360  {
361  G4double result;
362  G4int j;
363  for(j=0; j<GetVectorLength(); j++)
364  {
365  if(GetY(j)<0) SetY(j, 0);
366  }
367 
368  if(theBuffered.size() !=0 && G4UniformRand()<0.5)
369  {
370  result = theBuffered[0];
371  theBuffered.erase(theBuffered.begin());
372  if(result < GetX(GetVectorLength()-1) ) return result;
373  }
374  if(GetVectorLength()==1)
375  {
376  result = theData[0].GetX();
377  }
378  else
379  {
380  if(theIntegral==0) { IntegrateAndNormalise(); }
381  G4int icounter=0;
382  G4int icounter_max=1024;
383  do
384  {
385  icounter++;
386  if ( icounter > icounter_max ) {
387  G4cout << "Loop-counter exceeded the threshold value at " << __LINE__ << "th line of " << __FILE__ << "." << G4endl;
388  break;
389  }
390 //080808
391 /*
392  G4double rand;
393  G4double value, test, baseline;
394  baseline = theData[GetVectorLength()-1].GetX()-theData[0].GetX();
395  do
396  {
397  value = baseline*G4UniformRand();
398  value += theData[0].GetX();
399  test = GetY(value)/maxValue;
400  rand = G4UniformRand();
401  }
402  //while(test<rand);
403  while( test < rand && test > 0 );
404  result = value;
405 */
406  G4double rand;
407  G4double value, test;
408  G4int jcounter=0;
409  G4int jcounter_max=1024;
410  do
411  {
412  jcounter++;
413  if ( jcounter > jcounter_max ) {
414  G4cout << "Loop-counter exceeded the threshold value at " << __LINE__ << "th line of " << __FILE__ << "." << G4endl;
415  break;
416  }
417  rand = G4UniformRand();
418  G4int ibin = -1;
419  for ( G4int i = 0 ; i < GetVectorLength() ; i++ )
420  {
421  if ( rand < theIntegral[i] )
422  {
423  ibin = i;
424  break;
425  }
426  }
427  if ( ibin < 0 ) G4cout << "TKDB 080807 " << rand << G4endl;
428  // result
429  rand = G4UniformRand();
430  G4double x1, x2;
431  if ( ibin == 0 )
432  {
433  x1 = theData[ ibin ].GetX();
434  value = x1;
435  break;
436  }
437  else
438  {
439  x1 = theData[ ibin-1 ].GetX();
440  }
441 
442  x2 = theData[ ibin ].GetX();
443  value = rand * ( x2 - x1 ) + x1;
444  //***********************************************************************
445  /*
446  test = GetY ( value ) / std::max ( GetY( ibin-1 ) , GetY ( ibin ) );
447  */
448  //***********************************************************************
449  //EMendoza - Always linear interpolation:
450  G4double y1=theData[ ibin-1 ].GetY();
451  G4double y2=theData[ ibin ].GetY();
452  G4double mval=(y2-y1)/(x2-x1);
453  G4double bval=y1-mval*x1;
454  test =(mval*value+bval)/std::max ( GetY( ibin-1 ) , GetY ( ibin ) );
455  //***********************************************************************
456  }
457  while ( G4UniformRand() > test ); // Loop checking, 11.05.2015, T. Koi
458  result = value;
459 //080807
460  }
461  while(IsBlocked(result)); // Loop checking, 11.05.2015, T. Koi
462  }
463  return result;
464  }
Double_t y2[nxs]
Double_t y1[nxs]
Double_t x2[nxs]
int G4int
Definition: G4Types.hh:78
void SetY(G4int i, G4double x)
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
G4ParticleHPDataPoint * theData
Double_t x1[nxs]
G4double GetY(G4double x)
G4int GetVectorLength() const
G4bool IsBlocked(G4double aX)
G4double GetX(G4int i) const
#define G4endl
Definition: G4ios.hh:61
std::vector< G4double > theBuffered
double G4double
Definition: G4Types.hh:76
program test
Definition: Main_HIJING.f:1
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SampleLin()

G4double G4ParticleHPVector::SampleLin ( )
inline

Definition at line 324 of file G4ParticleHPVector.hh.

325  {
326  G4double result;
328  if(GetVectorLength()==1)
329  {
330  result = theData[0].GetX();
331  }
332  else
333  {
334  G4int i;
335  G4double rand = G4UniformRand();
336 
337  // this was replaced
338 // for(i=1;i<GetVectorLength();i++)
339 // {
340 // if(rand<theIntegral[i]/theIntegral[GetVectorLength()-1]) break;
341 // }
342 
343 // by this (begin)
344  for(i=GetVectorLength()-1; i>=0 ;i--)
345  {
346  if(rand>theIntegral[i]/theIntegral[GetVectorLength()-1]) break;
347  }
348  if(i!=GetVectorLength()-1) i++;
349 // until this (end)
350 
351  G4double x1, x2, y1, y2;
352  y1 = theData[i-1].GetX();
353  x1 = theIntegral[i-1];
354  y2 = theData[i].GetX();
355  x2 = theIntegral[i];
356  if(std::abs((y2-y1)/y2)<0.0000001) // not really necessary, since the case is excluded by construction
357  {
358  y1 = theData[i-2].GetX();
359  x1 = theIntegral[i-2];
360  }
361  result = theLin.Lin(rand, x1, x2, y1, y2);
362  }
363  return result;
364  }
Double_t y2[nxs]
Double_t y1[nxs]
G4double Lin(G4double x, G4double x1, G4double x2, G4double y1, G4double y2)
Double_t x2[nxs]
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
G4ParticleHPDataPoint * theData
Double_t x1[nxs]
G4int GetVectorLength() const
G4ParticleHPInterpolator theLin
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ SetData()

void G4ParticleHPVector::SetData ( G4int  i,
G4double  x,
G4double  y 
)
inline

Definition at line 96 of file G4ParticleHPVector.hh.

97  {
98 // G4cout <<"G4ParticleHPVector::SetData called"<<nPoints<<" "<<nEntries<<G4endl;
99  Check(i);
100  if(y>maxValue) maxValue=y;
101  theData[i].SetData(x, y);
102  }
void SetData(G4double e, G4double x)
Double_t y
G4ParticleHPDataPoint * theData
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetEnergy()

void G4ParticleHPVector::SetEnergy ( G4int  i,
G4double  e 
)
inline

Definition at line 108 of file G4ParticleHPVector.hh.

109  {
110  Check(i);
111  theData[i].SetX(e);
112  }
G4ParticleHPDataPoint * theData
Here is the call graph for this function:

◆ SetInterpolationManager() [1/2]

void G4ParticleHPVector::SetInterpolationManager ( const G4InterpolationManager aManager)
inline

Definition at line 483 of file G4ParticleHPVector.hh.

484  {
485  theManager = aManager;
486  }
G4InterpolationManager theManager
Here is the caller graph for this function:

◆ SetInterpolationManager() [2/2]

void G4ParticleHPVector::SetInterpolationManager ( G4InterpolationManager aMan)
inline

Definition at line 493 of file G4ParticleHPVector.hh.

494  {
495  theManager = aMan;
496  }
G4InterpolationManager theManager

◆ SetLabel()

void G4ParticleHPVector::SetLabel ( G4double  aLabel)
inline

Definition at line 251 of file G4ParticleHPVector.hh.

252  {
253  label = aLabel;
254  }
Here is the caller graph for this function:

◆ SetPoint()

void G4ParticleHPVector::SetPoint ( G4int  i,
const G4ParticleHPDataPoint it 
)
inline

Definition at line 89 of file G4ParticleHPVector.hh.

90  {
91  G4double x = it.GetX();
92  G4double y = it.GetY();
93  SetData(i, x, y);
94  }
void SetData(G4int i, G4double x, G4double y)
Double_t y
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetScheme()

void G4ParticleHPVector::SetScheme ( G4int  aPoint,
const G4InterpolationScheme aScheme 
)
inline

Definition at line 498 of file G4ParticleHPVector.hh.

499  {
500  theManager.AppendScheme(aPoint, aScheme);
501  }
G4InterpolationManager theManager
void AppendScheme(G4int aPoint, const G4InterpolationScheme &aScheme)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVerbose()

void G4ParticleHPVector::SetVerbose ( G4int  ff)
inline

Definition at line 71 of file G4ParticleHPVector.hh.

72  {
73  Verbose = ff;
74  }
TFile ff[ntarg]

◆ SetX()

void G4ParticleHPVector::SetX ( G4int  i,
G4double  e 
)
inline

Definition at line 103 of file G4ParticleHPVector.hh.

104  {
105  Check(i);
106  theData[i].SetX(e);
107  }
G4ParticleHPDataPoint * theData
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetXsec()

void G4ParticleHPVector::SetXsec ( G4int  i,
G4double  x 
)
inline

Definition at line 119 of file G4ParticleHPVector.hh.

120  {
121  Check(i);
122  if(x>maxValue) maxValue=x;
123  theData[i].SetY(x);
124  }
G4ParticleHPDataPoint * theData
Here is the call graph for this function:

◆ SetY()

void G4ParticleHPVector::SetY ( G4int  i,
G4double  x 
)
inline

Definition at line 113 of file G4ParticleHPVector.hh.

114  {
115  Check(i);
116  if(x>maxValue) maxValue=x;
117  theData[i].SetY(x);
118  }
G4ParticleHPDataPoint * theData
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ThinOut()

void G4ParticleHPVector::ThinOut ( G4double  precision)

Definition at line 296 of file G4ParticleHPVector.cc.

297  {
298  // anything in there?
299  if(GetVectorLength()==0) return;
300  // make the new vector
302  G4double x, x1, x2, y, y1, y2;
303  G4int count = 0, current = 2, start = 1;
304 
305  // First element always goes and is never tested.
306  aBuff[0] = theData[0];
307 
308  // Find the rest
309  while(current < GetVectorLength()) // Loop checking, 11.05.2015, T. Koi
310  {
311  x1=aBuff[count].GetX();
312  y1=aBuff[count].GetY();
313  x2=theData[current].GetX();
314  y2=theData[current].GetY();
315  for(G4int j=start; j<current; j++)
316  {
317  x = theData[j].GetX();
318  if(x1-x2 == 0) y = (y2+y1)/2.;
319  else y = theInt.Lin(x, x1, x2, y1, y2);
320  if (std::abs(y-theData[j].GetY())>precision*y)
321  {
322  aBuff[++count] = theData[current-1]; // for this one, everything was fine
323  start = current; // the next candidate
324  break;
325  }
326  }
327  current++ ;
328  }
329  // The last one also always goes, and is never tested.
330  aBuff[++count] = theData[GetVectorLength()-1];
331  delete [] theData;
332  theData = aBuff;
333  nEntries = count+1;
334 
335  // Rebuild the Hash;
336  if(theHash.Prepared())
337  {
338  ReHash();
339  }
340  }
Double_t y2[nxs]
Double_t y1[nxs]
G4double Lin(G4double x, G4double x1, G4double x2, G4double y1, G4double y2)
Double_t x2[nxs]
G4ParticleHPInterpolator theInt
int G4int
Definition: G4Types.hh:78
G4ParticleHPHash theHash
Double_t y
G4ParticleHPDataPoint * theData
Double_t x1[nxs]
G4double GetY(G4double x)
G4int GetVectorLength() const
G4bool Prepared() const
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Times()

void G4ParticleHPVector::Times ( G4double  factor)
inline

Definition at line 76 of file G4ParticleHPVector.hh.

77  {
78  G4int i;
79  for(i=0; i<nEntries; i++)
80  {
81  theData[i].SetY(theData[i].GetY()*factor);
82  }
83  if(theIntegral!=0)
84  {
85  theIntegral[i] *= factor;
86  }
87  }
int G4int
Definition: G4Types.hh:78
G4ParticleHPDataPoint * theData
G4double GetY(G4double x)
static const G4double factor
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator+

G4ParticleHPVector& operator+ ( G4ParticleHPVector left,
G4ParticleHPVector right 
)
friend

Definition at line 40 of file G4ParticleHPVector.cc.

41  {
43  G4int j=0;
44  G4double x;
45  G4double y;
46  G4int running = 0;
47  for(G4int i=0; i<left.GetVectorLength(); i++)
48  {
49  while(j<right.GetVectorLength()) // Loop checking, 11.05.2015, T. Koi
50  {
51  if(right.GetX(j)<left.GetX(i)*1.001)
52  {
53  x = right.GetX(j);
54  y = right.GetY(j)+left.GetY(x);
55  result->SetData(running++, x, y);
56  j++;
57  }
58  //else if(std::abs((right.GetX(j)-left.GetX(i))/(left.GetX(i)+right.GetX(j)))>0.001)
59  else if( left.GetX(i)+right.GetX(j) == 0
60  || std::abs((right.GetX(j)-left.GetX(i))/(left.GetX(i)+right.GetX(j))) > 0.001 )
61  {
62  x = left.GetX(i);
63  y = left.GetY(i)+right.GetY(x);
64  result->SetData(running++, x, y);
65  break;
66  }
67  else
68  {
69  break;
70  }
71  }
72  if(j==right.GetVectorLength())
73  {
74  x = left.GetX(i);
75  y = left.GetY(i)+right.GetY(x);
76  result->SetData(running++, x, y);
77  }
78  }
79  result->ThinOut(0.02);
80  return *result;
81  }
void SetData(G4int i, G4double x, G4double y)
int G4int
Definition: G4Types.hh:78
Double_t y
G4double GetY(G4double x)
G4int GetVectorLength() const
G4double GetX(G4int i) const
double G4double
Definition: G4Types.hh:76
void ThinOut(G4double precision)

Member Data Documentation

◆ isFreed

G4int G4ParticleHPVector::isFreed
private

Definition at line 571 of file G4ParticleHPVector.hh.

◆ label

G4double G4ParticleHPVector::label
private

Definition at line 566 of file G4ParticleHPVector.hh.

◆ maxValue

G4double G4ParticleHPVector::maxValue
private

Definition at line 574 of file G4ParticleHPVector.hh.

◆ nEntries

G4int G4ParticleHPVector::nEntries
private

Definition at line 564 of file G4ParticleHPVector.hh.

◆ nPoints

G4int G4ParticleHPVector::nPoints
private

Definition at line 565 of file G4ParticleHPVector.hh.

◆ the15percentBorderCash

G4double G4ParticleHPVector::the15percentBorderCash
private

Definition at line 578 of file G4ParticleHPVector.hh.

◆ the50percentBorderCash

G4double G4ParticleHPVector::the50percentBorderCash
private

Definition at line 579 of file G4ParticleHPVector.hh.

◆ theBlocked

std::vector<G4double> G4ParticleHPVector::theBlocked
private

Definition at line 576 of file G4ParticleHPVector.hh.

◆ theBuffered

std::vector<G4double> G4ParticleHPVector::theBuffered
private

Definition at line 577 of file G4ParticleHPVector.hh.

◆ theData

G4ParticleHPDataPoint* G4ParticleHPVector::theData
private

Definition at line 561 of file G4ParticleHPVector.hh.

◆ theHash

G4ParticleHPHash G4ParticleHPVector::theHash
private

Definition at line 573 of file G4ParticleHPVector.hh.

◆ theInt

G4ParticleHPInterpolator G4ParticleHPVector::theInt
private

Definition at line 568 of file G4ParticleHPVector.hh.

◆ theIntegral

G4double* G4ParticleHPVector::theIntegral
private

Definition at line 563 of file G4ParticleHPVector.hh.

◆ theLin

G4ParticleHPInterpolator G4ParticleHPVector::theLin
private

Definition at line 555 of file G4ParticleHPVector.hh.

◆ theManager

G4InterpolationManager G4ParticleHPVector::theManager
private

Definition at line 562 of file G4ParticleHPVector.hh.

◆ totalIntegral

G4double G4ParticleHPVector::totalIntegral
private

Definition at line 559 of file G4ParticleHPVector.hh.

◆ Verbose

G4int G4ParticleHPVector::Verbose
private

Definition at line 569 of file G4ParticleHPVector.hh.


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