Import Geant4 3.1.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4PhysicsVector.hh,v 1.4 2000/11/20 17:26:46 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
// $Id: G4PhysicsVector.hh,v 1.9 2001/03/09 12:08:19 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -26,47 +26,59 @@
|
||||
// 02 Dec. 1995, G.Cosmo : Structure created based on object model
|
||||
// 03 Mar. 1996, K.Amako : Implemented the 1st version
|
||||
// 27 Apr. 1996, K.Amako : Cache mechanism added
|
||||
// 01 Jul. 1996, K.Amako : Now GetValue not virtual.
|
||||
// 21 Sep. 1996, K.Amako : Added [] and () operators.
|
||||
// 01 Jul. 1996, K.Amako : Now GetValue not virtual
|
||||
// 21 Sep. 1996, K.Amako : Added [] and () operators
|
||||
// 11 Nov. 2000, H.Kurashige : use STL vector for dataVector and binVector
|
||||
// 18 Jan. 2001, H.Kurashige : removed ptrNextTable
|
||||
// 09 Mar. 2001, H.Kurashige : added G4PhysicsVectorType & Store/Retrieve()
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4PhysicsVector_h
|
||||
#define G4PhysicsVector_h 1
|
||||
|
||||
#include "g4std/vector"
|
||||
#include "globals.hh"
|
||||
#include "G4DataVector.hh"
|
||||
#include "g4rw/tpordvec.h"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/iostream"
|
||||
#include "g4std/fstream"
|
||||
|
||||
#include "G4PhysicsVectorType.hh"
|
||||
|
||||
class G4PhysicsVector
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
// Constructor and destructor
|
||||
G4PhysicsVector();
|
||||
virtual ~G4PhysicsVector();
|
||||
// constructor
|
||||
// This class is an abstract class with pure virtual method of
|
||||
// virtual size_t FindBinLocation(G4double theEnergy) const
|
||||
// So, default constructor is not supposed to be invoked explicitly
|
||||
|
||||
// Public functions
|
||||
G4double GetValue(G4double theEnergy, G4bool& isOutRange);
|
||||
// Get the crosssection/energy-loss value corresponding to the
|
||||
public: // with description
|
||||
|
||||
virtual ~G4PhysicsVector();
|
||||
// destructor
|
||||
|
||||
inline G4double GetValue(G4double theEnergy, G4bool& isOutRange);
|
||||
// Get the cross-section/energy-loss value corresponding to the
|
||||
// given energy. An appropriate interpolation is used to calculate
|
||||
// the value.
|
||||
// [Note] isOutRange is not used anymore. This argument is kept
|
||||
// for the compatibility reason.
|
||||
// Public operators
|
||||
|
||||
G4int operator==(const G4PhysicsVector &right) const ;
|
||||
G4int operator!=(const G4PhysicsVector &right) const ;
|
||||
G4double operator[](const size_t binNumber) const ;
|
||||
inline G4double operator[](const size_t binNumber) const ;
|
||||
// Returns simply the value in the bin specified by 'binNumber'
|
||||
// of the dataVector. The boundary check will be Done. If you
|
||||
// don't want this check, use the operator ().
|
||||
G4double operator()(const size_t binNumber) const ;
|
||||
inline G4double operator()(const size_t binNumber) const ;
|
||||
// Returns simply the value in the bin specified by 'binNumber'
|
||||
// of the dataVector. The boundary check will not be Done. If
|
||||
// you want this check, use the operator [].
|
||||
|
||||
// Public functions
|
||||
void PutValue(size_t binNumber, G4double theValue);
|
||||
inline void PutValue(size_t binNumber, G4double theValue);
|
||||
// Put 'theValue' into the bin specified by 'binNumber'.
|
||||
// Take note that the 'binNumber' starts from '0'.
|
||||
// To fill the vector, you have beforehand to Construct a vector
|
||||
@@ -80,28 +92,32 @@ class G4PhysicsVector
|
||||
// This value is defined when a physics vector is constructed
|
||||
// by a constructor of a derived class. Use this function
|
||||
// when you fill physis vector by PutValue().
|
||||
size_t GetVectorLength() const;
|
||||
inline size_t GetVectorLength() const;
|
||||
// Get the toal length (bin number) of the vector.
|
||||
G4bool IsFilledVectorExist() const;
|
||||
inline G4bool IsFilledVectorExist() const;
|
||||
// Is non-empty physics vector already exist?
|
||||
|
||||
void LinkPhysicsTable(G4RWTPtrOrderedVector<G4PhysicsVector>& theTable);
|
||||
// Link the given G4PhysicsTable to the current G4PhyiscsVector.
|
||||
G4bool IsLinkedTableExist() const;
|
||||
// Has this physics vector an extended physics table?
|
||||
const G4RWTPtrOrderedVector<G4PhysicsVector>* GetNextTable() const;
|
||||
// Returns the pointer to a physics table created for elements
|
||||
// or isotopes (when the cross-sesctions or energy-losses
|
||||
// depend explicitly on them).
|
||||
|
||||
void PutComment(const G4String& theComment);
|
||||
inline void PutComment(const G4String& theComment);
|
||||
// Put a comment to the G4PhysicsVector. This may help to check
|
||||
// whether your are accessing to the one you want.
|
||||
G4String GetComment() const;
|
||||
inline const G4String& GetComment() const;
|
||||
// Retrieve the comment of the G4PhysicsVector.
|
||||
|
||||
inline G4PhysicsVectorType GetType() const;
|
||||
// Get physics vector type
|
||||
|
||||
virtual G4bool Store(G4std::ofstream& fOut, G4bool ascii=false);
|
||||
virtual G4bool Retrieve(G4std::ifstream& fIn, G4bool ascii=false);
|
||||
// To store/retrieve persistent data to/from file streams.
|
||||
|
||||
friend G4std::ostream& operator<<(G4std::ostream&, const G4PhysicsVector&);
|
||||
|
||||
protected:
|
||||
|
||||
typedef G4std::vector<G4double> G4PVDataVector;
|
||||
|
||||
G4PhysicsVectorType type; // The type of PhysicsVector (enumerator)
|
||||
|
||||
G4double edgeMin; // Lower edge value of the lowest bin
|
||||
G4double edgeMax; // Lower edge value of the highest bin
|
||||
size_t numberOfBin;
|
||||
@@ -110,22 +126,20 @@ class G4PhysicsVector
|
||||
G4double lastValue; // Cache the last output value
|
||||
size_t lastBin; // Cache the last bin location
|
||||
|
||||
G4DataVector dataVector; // Vector to keep the crossection/energyloss
|
||||
G4DataVector binVector; // Vector to keep the low edge value of bin
|
||||
G4PVDataVector dataVector; // Vector to keep the crossection/energyloss
|
||||
G4PVDataVector binVector; // Vector to keep the low edge value of bin
|
||||
|
||||
G4RWTPtrOrderedVector<G4PhysicsVector>* ptrNextTable;
|
||||
// Link to the connected physics table
|
||||
|
||||
G4double LinearInterpolation(G4double theEnergy, size_t theLocBin);
|
||||
inline G4double LinearInterpolation(G4double theEnergy, size_t theLocBin);
|
||||
// Linear interpolation function
|
||||
|
||||
virtual size_t FindBinLocation(G4double theEnergy) const=0;
|
||||
// Find the bin# in which theEnergy belongs - pure virtual function
|
||||
|
||||
private:
|
||||
protected:
|
||||
|
||||
G4PhysicsVector(const G4PhysicsVector&);
|
||||
G4PhysicsVector& operator=(const G4PhysicsVector&);
|
||||
// Private copy constructor and assignment operator.
|
||||
// Protected copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user