#include <G4NeutronHPField.hh>
Public Member Functions | |
G4NeutronHPField () | |
~G4NeutronHPField () | |
void | InitY (G4int i, G4int n) |
void | SetData (G4int i, G4double x, G4int j, G4double y) |
void | SetEnergy (G4int i, G4double e) |
void | SetX (G4int i, G4double e) |
void | SetY (G4int i, G4int j, G4double x) |
G4double | GetEnergy (G4int i) |
G4double | GetX (G4int i) |
G4double | GetY (G4int i, G4int j) |
G4NeutronHPFieldPoint & | GetPoint (G4int i) |
G4double | GetY (G4double e, G4int j) |
G4int | GetFieldLength () |
void | Dump () |
Definition at line 35 of file G4NeutronHPField.hh.
G4NeutronHPField::G4NeutronHPField | ( | ) |
Definition at line 35 of file G4NeutronHPField.cc.
References G4NeutronHPFieldPoint::SetData().
00036 { 00037 theData = new G4NeutronHPFieldPoint[100]; 00038 nPoints=100; 00039 nEntries=0; 00040 theData->SetData(0,0,0); 00041 }
G4NeutronHPField::~G4NeutronHPField | ( | ) |
void G4NeutronHPField::Dump | ( | ) |
Definition at line 88 of file G4NeutronHPField.cc.
References G4cout, G4endl, G4NeutronHPFieldPoint::GetDepth(), GetX(), and GetY().
00089 { 00090 G4cout << nEntries<<G4endl; 00091 for(G4int i=0; i<nEntries; i++) 00092 { 00093 G4cout << theData[i].GetX()<<" "; 00094 for(G4int j=0; j<theData[i].GetDepth(); j++) 00095 { 00096 G4cout << theData[i].GetY(j)<<" "; 00097 } 00098 G4cout << G4endl; 00099 } 00100 }
Definition at line 68 of file G4NeutronHPField.hh.
References G4NeutronHPFieldPoint::GetX().
00068 { return theData[i].GetX(); }
G4int G4NeutronHPField::GetFieldLength | ( | ) | [inline] |
G4NeutronHPFieldPoint& G4NeutronHPField::GetPoint | ( | G4int | i | ) | [inline] |
Definition at line 69 of file G4NeutronHPField.hh.
References G4NeutronHPFieldPoint::GetX().
Referenced by Dump(), and GetY().
00069 { return theData[i].GetX(); }
Definition at line 45 of file G4NeutronHPField.cc.
References G4NeutronHPFieldPoint::GetX(), GetX(), and G4NeutronHPFieldPoint::GetY().
00046 { 00047 G4int low = 0; 00048 G4int high = 0; 00049 G4int i; 00050 for (i=1; i<nEntries/10; i++) 00051 { 00052 if(theData[10*i].GetX()>e) break; 00053 } 00054 if(i==(nEntries/10)) 00055 { 00056 i=10*i; 00057 while (i<nEntries) 00058 { 00059 if(theData[i++].GetX()>e) break; 00060 } 00061 if (i==nEntries) 00062 { 00063 low = nEntries-1; 00064 high = nEntries-2; 00065 }else{ 00066 low = i-1; 00067 high = i; 00068 } 00069 }else{ 00070 for (G4int jj=0; jj<10; jj++) 00071 { 00072 if(theData[i].GetX()<e) break; 00073 i--; 00074 } 00075 low = i; 00076 high = i+1; 00077 } 00078 G4double x1, x2, y1, y2, x, y; 00079 x = e; 00080 x1 = theData[low] .GetX(); 00081 x2 = theData[high].GetX(); 00082 y1 = theData[low] .GetY(j); 00083 y2 = theData[high].GetY(j); 00084 y = x*(y2-y1)/(x2-x1); 00085 return y += y2-x2*(y2-y1)/(x2-x1); 00086 }
Definition at line 70 of file G4NeutronHPField.hh.
References G4NeutronHPFieldPoint::GetY().
Referenced by Dump().
00070 { return theData[i].GetY(j); }
Definition at line 48 of file G4NeutronHPField.hh.
References G4NeutronHPFieldPoint::SetData().
00049 { 00050 Check(i); 00051 theData[i].SetData(x, j, y); 00052 }
Definition at line 53 of file G4NeutronHPField.hh.
References G4NeutronHPFieldPoint::SetX().
00054 { 00055 Check(i); 00056 theData[i].SetX(e); 00057 }
Definition at line 58 of file G4NeutronHPField.hh.
References G4NeutronHPFieldPoint::SetX().
00059 { 00060 Check(i); 00061 theData[i].SetX(e); 00062 }
Definition at line 63 of file G4NeutronHPField.hh.
References G4NeutronHPFieldPoint::SetY().
00064 { 00065 Check(i); 00066 theData[i].SetY(j, x); 00067 }