Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4NeutronHPField Class Reference

#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)
 
G4NeutronHPFieldPointGetPoint (G4int i)
 
G4double GetY (G4double e, G4int j)
 
G4int GetFieldLength ()
 
void Dump ()
 

Detailed Description

Definition at line 34 of file G4NeutronHPField.hh.

Constructor & Destructor Documentation

G4NeutronHPField::G4NeutronHPField ( )

Definition at line 35 of file G4NeutronHPField.cc.

References G4NeutronHPFieldPoint::SetData().

36  {
37  theData = new G4NeutronHPFieldPoint[100];
38  nPoints=100;
39  nEntries=0;
40  theData->SetData(0,0,0);
41  }
void SetData(G4double e, G4int i, G4double x)
G4NeutronHPField::~G4NeutronHPField ( )

Definition at line 43 of file G4NeutronHPField.cc.

43 { delete [] theData;}

Member Function Documentation

void G4NeutronHPField::Dump ( )

Definition at line 88 of file G4NeutronHPField.cc.

References G4cout, G4endl, G4NeutronHPFieldPoint::GetDepth(), G4NeutronHPFieldPoint::GetX(), and G4NeutronHPFieldPoint::GetY().

89  {
90  G4cout << nEntries<<G4endl;
91  for(G4int i=0; i<nEntries; i++)
92  {
93  G4cout << theData[i].GetX()<<" ";
94  for(G4int j=0; j<theData[i].GetDepth(); j++)
95  {
96  G4cout << theData[i].GetY(j)<<" ";
97  }
98  G4cout << G4endl;
99  }
100  }
G4double GetY(G4int i) const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4double G4NeutronHPField::GetEnergy ( G4int  i)
inline

Definition at line 67 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::GetX().

67 { return theData[i].GetX(); }
G4int G4NeutronHPField::GetFieldLength ( )
inline

Definition at line 74 of file G4NeutronHPField.hh.

74 {return nEntries;}
G4NeutronHPFieldPoint& G4NeutronHPField::GetPoint ( G4int  i)
inline

Definition at line 70 of file G4NeutronHPField.hh.

70 { return theData[i]; }
G4double G4NeutronHPField::GetX ( G4int  i)
inline

Definition at line 68 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::GetX().

Referenced by GetY().

68 { return theData[i].GetX(); }
G4double G4NeutronHPField::GetY ( G4int  i,
G4int  j 
)
inline

Definition at line 69 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::GetY().

69 { return theData[i].GetY(j); }
G4double GetY(G4int i) const
G4double G4NeutronHPField::GetY ( G4double  e,
G4int  j 
)

Definition at line 45 of file G4NeutronHPField.cc.

References G4NeutronHPFieldPoint::GetX(), GetX(), G4NeutronHPFieldPoint::GetY(), and test::x.

46  {
47  G4int low = 0;
48  G4int high = 0;
49  G4int i;
50  for (i=1; i<nEntries/10; i++)
51  {
52  if(theData[10*i].GetX()>e) break;
53  }
54  if(i==(nEntries/10))
55  {
56  i=10*i;
57  while (i<nEntries)
58  {
59  if(theData[i++].GetX()>e) break;
60  }
61  if (i==nEntries)
62  {
63  low = nEntries-1;
64  high = nEntries-2;
65  }else{
66  low = i-1;
67  high = i;
68  }
69  }else{
70  for (G4int jj=0; jj<10; jj++)
71  {
72  if(theData[i].GetX()<e) break;
73  i--;
74  }
75  low = i;
76  high = i+1;
77  }
78  G4double x1, x2, y1, y2, x, y;
79  x = e;
80  x1 = theData[low] .GetX();
81  x2 = theData[high].GetX();
82  y1 = theData[low] .GetY(j);
83  y2 = theData[high].GetY(j);
84  y = x*(y2-y1)/(x2-x1);
85  return y += y2-x2*(y2-y1)/(x2-x1);
86  }
G4double GetY(G4int i) const
G4double GetX(G4int i)
int G4int
Definition: G4Types.hh:78
double G4double
Definition: G4Types.hh:76
void G4NeutronHPField::InitY ( G4int  i,
G4int  n 
)
inline

Definition at line 42 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::InitY().

43  {
44  Check(i);
45  theData[i].InitY(n);
46  }
const G4int n
void G4NeutronHPField::SetData ( G4int  i,
G4double  x,
G4int  j,
G4double  y 
)
inline

Definition at line 47 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::SetData().

48  {
49  Check(i);
50  theData[i].SetData(x, j, y);
51  }
void SetData(G4double e, G4int i, G4double x)
void G4NeutronHPField::SetEnergy ( G4int  i,
G4double  e 
)
inline

Definition at line 52 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::SetX().

53  {
54  Check(i);
55  theData[i].SetX(e);
56  }
void G4NeutronHPField::SetX ( G4int  i,
G4double  e 
)
inline

Definition at line 57 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::SetX().

58  {
59  Check(i);
60  theData[i].SetX(e);
61  }
void G4NeutronHPField::SetY ( G4int  i,
G4int  j,
G4double  x 
)
inline

Definition at line 62 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::SetY().

63  {
64  Check(i);
65  theData[i].SetY(j, x);
66  }
void SetY(G4int i, G4double x)

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