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 35 of file G4NeutronHPField.hh.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 43 of file G4NeutronHPField.cc.

00043 { delete [] theData;}


Member Function Documentation

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   }

G4double G4NeutronHPField::GetEnergy ( G4int  i  )  [inline]

Definition at line 68 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::GetX().

00068 { return theData[i].GetX(); }

G4int G4NeutronHPField::GetFieldLength (  )  [inline]

Definition at line 75 of file G4NeutronHPField.hh.

00075 {return nEntries;}

G4NeutronHPFieldPoint& G4NeutronHPField::GetPoint ( G4int  i  )  [inline]

Definition at line 71 of file G4NeutronHPField.hh.

00071 { return theData[i]; }

G4double G4NeutronHPField::GetX ( G4int  i  )  [inline]

Definition at line 69 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::GetX().

Referenced by Dump(), and GetY().

00069 { return theData[i].GetX(); }

G4double G4NeutronHPField::GetY ( G4double  e,
G4int  j 
)

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   }

G4double G4NeutronHPField::GetY ( G4int  i,
G4int  j 
) [inline]

Definition at line 70 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::GetY().

Referenced by Dump().

00070 { return theData[i].GetY(j); }

void G4NeutronHPField::InitY ( G4int  i,
G4int  n 
) [inline]

Definition at line 43 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::InitY().

00044   {
00045     Check(i);
00046     theData[i].InitY(n);
00047   }

void G4NeutronHPField::SetData ( G4int  i,
G4double  x,
G4int  j,
G4double  y 
) [inline]

Definition at line 48 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::SetData().

00049   { 
00050     Check(i);
00051     theData[i].SetData(x, j, y);
00052   }

void G4NeutronHPField::SetEnergy ( G4int  i,
G4double  e 
) [inline]

Definition at line 53 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::SetX().

00054   {
00055     Check(i);
00056     theData[i].SetX(e);
00057   }

void G4NeutronHPField::SetX ( G4int  i,
G4double  e 
) [inline]

Definition at line 58 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::SetX().

00059   {
00060     Check(i);
00061     theData[i].SetX(e);
00062   }

void G4NeutronHPField::SetY ( G4int  i,
G4int  j,
G4double  x 
) [inline]

Definition at line 63 of file G4NeutronHPField.hh.

References G4NeutronHPFieldPoint::SetY().

00064   {
00065     Check(i);
00066     theData[i].SetY(j, x);
00067   }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:37 2013 for Geant4 by  doxygen 1.4.7