G4PhysicsLogVector Class Reference

#include <G4PhysicsLogVector.hh>

Inheritance diagram for G4PhysicsLogVector:

G4PhysicsVector

Public Member Functions

 G4PhysicsLogVector ()
 G4PhysicsLogVector (size_t theNbin)
 G4PhysicsLogVector (G4double theEmin, G4double theEmax, size_t theNbin)
virtual ~G4PhysicsLogVector ()
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 59 of file G4PhysicsLogVector.hh.


Constructor & Destructor Documentation

G4PhysicsLogVector::G4PhysicsLogVector (  ) 

Definition at line 49 of file G4PhysicsLogVector.cc.

References T_G4PhysicsLogVector, and G4PhysicsVector::type.

00050   : G4PhysicsVector()
00051 { 
00052   type = T_G4PhysicsLogVector;
00053 }

G4PhysicsLogVector::G4PhysicsLogVector ( size_t  theNbin  )  [explicit]

Definition at line 55 of file G4PhysicsLogVector.cc.

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

00056   : G4PhysicsVector()
00057 {
00058   type = T_G4PhysicsLogVector;
00059 
00060   numberOfNodes = theNbin + 1;
00061   dataVector.reserve(numberOfNodes);
00062   binVector.reserve(numberOfNodes);      
00063 
00064   for (size_t i=0; i<numberOfNodes; i++)
00065   {
00066      binVector.push_back(0.0);
00067      dataVector.push_back(0.0);
00068   }
00069 }  

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

Definition at line 71 of file G4PhysicsLogVector.cc.

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

00073   : G4PhysicsVector()
00074 {
00075   type = T_G4PhysicsLogVector;
00076 
00077   dBin     =  std::log10(theEmax/theEmin)/theNbin;
00078   baseBin  =  std::log10(theEmin)/dBin;
00079 
00080   numberOfNodes = theNbin + 1;
00081   dataVector.reserve(numberOfNodes);
00082   binVector.reserve(numberOfNodes);
00083   static const G4double g4log10 = std::log(10.); 
00084 
00085   binVector.push_back(theEmin);
00086   dataVector.push_back(0.0);
00087 
00088   for (size_t i=1; i<numberOfNodes-1; i++)
00089     {
00090       binVector.push_back(std::exp(g4log10*(baseBin+i)*dBin));
00091       dataVector.push_back(0.0);
00092     }
00093   binVector.push_back(theEmax);
00094   dataVector.push_back(0.0);
00095 
00096   edgeMin = binVector[0];
00097   edgeMax = binVector[numberOfNodes-1];
00098 }  

G4PhysicsLogVector::~G4PhysicsLogVector (  )  [virtual]

Definition at line 100 of file G4PhysicsLogVector.cc.

00101 {
00102 }


Member Function Documentation

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

Implements G4PhysicsVector.

Definition at line 124 of file G4PhysicsLogVector.cc.

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

00125 {
00126   // For G4PhysicsLogVector, FindBinLocation is implemented using
00127   // a simple arithmetic calculation.
00128   //
00129   // Because this is a virtual function, it is accessed through a
00130   // pointer to the G4PhyiscsVector object for most usages. In this
00131   // case, 'inline' will not be invoked. However, there is a possibility 
00132   // that the user access to the G4PhysicsLogVector object directly and 
00133   // not through pointers or references. In this case, the 'inline' will
00134   // be invoked. (See R.B.Murray, "C++ Strategies and Tactics", Chap.6.6)
00135   //G4cout << "G4PhysicsLogVector::FindBinLocation: e= " << theEnergy
00136 
00137   return size_t( std::log10(theEnergy)/dBin - baseBin );
00138 }

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

Reimplemented from G4PhysicsVector.

Definition at line 104 of file G4PhysicsLogVector.cc.

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

00105 {
00106   G4bool success = G4PhysicsVector::Retrieve(fIn, ascii);
00107   if (success)
00108   {
00109     G4double theEmin = binVector[0];
00110     dBin = std::log10(binVector[1]/theEmin);
00111     baseBin = std::log10(theEmin)/dBin;
00112   }
00113   return success;
00114 }

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

Reimplemented from G4PhysicsVector.

Definition at line 116 of file G4PhysicsLogVector.cc.

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

00117 {
00118   G4PhysicsVector::ScaleVector(factorE, factorV);
00119   G4double theEmin = binVector[0];
00120   dBin = std::log10(binVector[1]/theEmin);
00121   baseBin = std::log10(theEmin)/dBin;
00122 }


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