G4PhysicsLnVector Class Reference

#include <G4PhysicsLnVector.hh>

Inheritance diagram for G4PhysicsLnVector:

G4PhysicsVector

Public Member Functions

 G4PhysicsLnVector ()
 G4PhysicsLnVector (size_t theNbin)
 G4PhysicsLnVector (G4double theEmin, G4double theEmax, size_t theNbin)
 ~G4PhysicsLnVector ()
virtual G4bool Retrieve (std::ifstream &fIn, G4bool ascii)
virtual void ScaleVector (G4double factorE, G4double factorV)

Protected Member Functions

virtual size_t FindBinLocation (G4double theEnergy) const

Detailed Description

Definition at line 55 of file G4PhysicsLnVector.hh.


Constructor & Destructor Documentation

G4PhysicsLnVector::G4PhysicsLnVector (  ) 

Definition at line 42 of file G4PhysicsLnVector.cc.

References T_G4PhysicsLnVector, and G4PhysicsVector::type.

00043   : G4PhysicsVector()
00044 {
00045   type = T_G4PhysicsLnVector;
00046 }

G4PhysicsLnVector::G4PhysicsLnVector ( size_t  theNbin  )  [explicit]

Definition at line 48 of file G4PhysicsLnVector.cc.

References G4PhysicsVector::binVector, G4PhysicsVector::dataVector, G4PhysicsVector::numberOfNodes, T_G4PhysicsLnVector, and G4PhysicsVector::type.

00049   : G4PhysicsVector()
00050 {
00051   type = T_G4PhysicsLnVector;
00052 
00053   numberOfNodes = theNbin + 1;
00054   dataVector.reserve(numberOfNodes);
00055   binVector.reserve(numberOfNodes);      
00056 
00057   for (size_t i=0; i<numberOfNodes; i++)
00058   {
00059      binVector.push_back(0.0);
00060      dataVector.push_back(0.0);
00061   }
00062 }  

G4PhysicsLnVector::G4PhysicsLnVector ( G4double  theEmin,
G4double  theEmax,
size_t  theNbin 
)

Definition at line 64 of file G4PhysicsLnVector.cc.

References G4PhysicsVector::baseBin, G4PhysicsVector::binVector, G4PhysicsVector::dataVector, G4PhysicsVector::dBin, G4PhysicsVector::edgeMax, G4PhysicsVector::edgeMin, G4PhysicsVector::numberOfNodes, T_G4PhysicsLnVector, and G4PhysicsVector::type.

00066   : G4PhysicsVector()
00067 {
00068   type = T_G4PhysicsLnVector;
00069 
00070   dBin    = std::log(theEmax/theEmin)/theNbin;
00071   baseBin = std::log(theEmin)/dBin;
00072   numberOfNodes = theNbin + 1;
00073   dataVector.reserve(numberOfNodes);
00074   binVector.reserve(numberOfNodes);      
00075 
00076   binVector.push_back(theEmin);
00077   dataVector.push_back(0.0);
00078 
00079   for (size_t i=1; i<numberOfNodes-1; i++)
00080     {
00081       binVector.push_back(std::exp((baseBin+i)*dBin));
00082       dataVector.push_back(0.0);
00083     }
00084   binVector.push_back(theEmax);
00085   dataVector.push_back(0.0);
00086 
00087   edgeMin = binVector[0];
00088   edgeMax = binVector[numberOfNodes-1];
00089 }

G4PhysicsLnVector::~G4PhysicsLnVector (  ) 

Definition at line 91 of file G4PhysicsLnVector.cc.

00091 {}


Member Function Documentation

size_t G4PhysicsLnVector::FindBinLocation ( G4double  theEnergy  )  const [protected, virtual]

Implements G4PhysicsVector.

Definition at line 113 of file G4PhysicsLnVector.cc.

References G4PhysicsVector::baseBin, and G4PhysicsVector::dBin.

00114 {
00115  
00116   // For G4PhysicsLnVector, FindBinLocation is implemented using
00117   // a simple arithmetic calculation.
00118   //
00119   // Because this is a virtual function, it is accessed through a
00120   // pointer to the G4PhyiscsVector object for most usages. In this
00121   // case, 'inline' will not be invoked. However, there is a possibility 
00122   // that the user access to the G4PhysicsLnVector object directly and 
00123   // not through pointers or references. In this case, the 'inline' will
00124   // be invoked. (See R.B.Murray, "C++ Strategies and Tactics", Chap.6.6)
00125 
00126   return size_t( std::log(theEnergy)/dBin - baseBin );
00127 }

G4bool G4PhysicsLnVector::Retrieve ( std::ifstream &  fIn,
G4bool  ascii 
) [virtual]

Reimplemented from G4PhysicsVector.

Definition at line 93 of file G4PhysicsLnVector.cc.

References G4PhysicsVector::baseBin, G4PhysicsVector::binVector, G4PhysicsVector::dBin, and G4PhysicsVector::Retrieve().

00094 {
00095   G4bool success = G4PhysicsVector::Retrieve(fIn, ascii);
00096   if (success)
00097   {
00098     G4double theEmin = binVector[0];
00099     dBin = std::log(binVector[1]/theEmin);
00100     baseBin = std::log(theEmin)/dBin;
00101   }
00102   return success;
00103 }

void G4PhysicsLnVector::ScaleVector ( G4double  factorE,
G4double  factorV 
) [virtual]

Reimplemented from G4PhysicsVector.

Definition at line 105 of file G4PhysicsLnVector.cc.

References G4PhysicsVector::baseBin, G4PhysicsVector::binVector, G4PhysicsVector::dBin, and G4PhysicsVector::ScaleVector().

00106 {
00107   G4PhysicsVector::ScaleVector(factorE, factorV);
00108   G4double theEmin = binVector[0];
00109   dBin = std::log(binVector[1]/theEmin);
00110   baseBin = std::log(theEmin)/dBin;
00111 }


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