Import Geant4 3.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:03:00 +02:00
parent cfcb558cfe
commit 137e303ecc
2843 changed files with 37082 additions and 38426 deletions
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4LorentzRotation.hh,v 1.2 1999/11/16 17:29:12 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#ifndef G4LorentzRotation_hh
#define G4LorentzRotation_hh
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4LorentzVector.hh,v 1.2 1999/11/16 17:29:13 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#ifndef G4LorentzVector_hh
#define G4LorentzVector_hh
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Normal3D.hh,v 1.2 1999/11/16 17:29:13 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#ifndef G4NORMAL3D_HH
#define G4NORMAL3D_HH
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Plane3D.hh,v 1.2 1999/11/16 17:29:13 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#ifndef G4PLANE3D_HH
#define G4PLANE3D_HH
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Point3D.hh,v 1.2 1999/11/16 17:29:13 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#ifndef G4POINT3D_HH
#define G4POINT3D_HH
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Transform3D.hh,v 1.2 1999/11/16 17:29:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#ifndef G4TRANSFORM3D_HH
#define G4TRANSFORM3D_HH
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Vector3D.hh,v 1.2 1999/11/16 17:29:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#ifndef G4VECTOR3D_HH
#define G4VECTOR3D_HH
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: geomdefs.hh,v 1.3 2000/11/01 15:23:10 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ----------------------------------------------------------------------
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ChebyshevApproximation.hh,v 1.3 2000/11/20 17:26:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Class description:
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4DataInterpolation.hh,v 1.3 2000/11/20 17:26:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Class description:
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GaussChebyshevQ.hh,v 1.3 2000/11/20 17:26:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Class description:
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GaussHermiteQ.hh,v 1.3 2000/11/20 17:26:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Class description:
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GaussJacobiQ.hh,v 1.3 2000/11/20 17:26:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Class description:
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GaussLaguerreQ.hh,v 1.3 2000/11/20 17:26:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Class description:
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GaussLegendreQ.hh,v 1.3 2000/11/20 17:26:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Class description:
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Integrator.hh,v 1.4 2000/06/15 17:31:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Class description:
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Integrator.icc,v 1.6 2000/06/15 17:31:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Implementation of G4Integrator methods.
//
@@ -0,0 +1,118 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PolynomialSolver.hh,v 1.2 2001/01/29 09:49:54 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// class G4PolynomialSolver
//
// Class description:
//
// G4PolynomialSolver allows the user to solve a polynomial equation
// with a great precision. This is used by Implicit Equation solver.
//
// The Bezier clipping method is used to solve the polynomial.
//
// How to use it:
// Create a class that is the function to be solved.
// This class could have internal parameters to allow to change
// the equation to be solved without recreating a new one.
//
// Define a Polynomial solver, example:
// G4PolynomialSolver<MyFunctionClass,G4double(MyFunctionClass::*)(G4double)>
// PolySolver (&MyFunction,
// &MyFunctionClass::Function,
// &MyFunctionClass::Derivative,
// precision);
//
// The precision is relative to the function to solve.
//
// In MyFunctionClass, provide the function to solve and its derivative:
// Example of function to provide :
//
// x,y,z,dx,dy,dz,Rmin,Rmax are internal variables of MyFunctionClass
//
// G4double MyFunctionClass::Function(G4double value)
// {
// G4double Lx,Ly,Lz;
// G4double result;
//
// Lx = x + value*dx;
// Ly = y + value*dy;
// Lz = z + value*dz;
//
// result = TorusEquation(Lx,Ly,Lz,Rmax,Rmin);
//
// return result ;
// }
//
// G4double MyFunctionClass::Derivative(G4double value)
// {
// G4double Lx,Ly,Lz;
// G4double result;
//
// Lx = x + value*dx;
// Ly = y + value*dy;
// Lz = z + value*dz;
//
// result = dx*TorusDerivativeX(Lx,Ly,Lz,Rmax,Rmin);
// result += dy*TorusDerivativeY(Lx,Ly,Lz,Rmax,Rmin);
// result += dz*TorusDerivativeZ(Lx,Ly,Lz,Rmax,Rmin);
//
// return result;
// }
//
// Then to have a root inside an interval [IntervalMin,IntervalMax] do the
// following:
//
// MyRoot = PolySolver.solve(IntervalMin,IntervalMax);
//
// History:
//
// - 19.12.00 E.Medernach, First implementation
//
#ifndef G4POL_SOLVER_HH
#define G4POL_SOLVER_HH
#include "globals.hh"
template <class T, class F>
class G4PolynomialSolver
{
public: // with description
G4PolynomialSolver(T* typeF, F func, F deriv, G4double precision);
~G4PolynomialSolver();
G4double solve (G4double IntervalMin, G4double IntervalMax);
private:
G4double Newton (G4double IntervalMin, G4double IntervalMax);
//General Newton method with Bezier Clipping
// Works for polynomial of order less or equal than 4.
// But could be changed to work for polynomial of any order providing
// that we find the bezier control points.
G4int BezierClipping(G4double *IntervalMin, G4double *IntervalMax);
// This is just one iteration of Bezier Clipping
T* FunctionClass ;
F Function ;
F Derivative ;
G4double Precision;
};
#include "G4PolynomialSolver.icc"
#endif
@@ -0,0 +1,201 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PolynomialSolver.icc,v 1.5 2001/01/29 13:13:34 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// class G4PolynomialSolver
//
// 19.12.00 E.Medernach, First implementation
//
#define POLEPSILON 1e-12
#define POLINFINITY 9.0E99
#define ITERATION 12 // 20 But 8 is really enough for Newton with a good guess
template <class T, class F>
G4PolynomialSolver<T,F>::G4PolynomialSolver (T* typeF, F func, F deriv,
G4double precision)
{
Precision = precision ;
FunctionClass = typeF ;
Function = func ;
Derivative = deriv ;
}
template <class T, class F>
G4PolynomialSolver<T,F>::~G4PolynomialSolver ()
{
}
template <class T, class F>
G4double G4PolynomialSolver<T,F>::solve(G4double IntervalMin,
G4double IntervalMax)
{
return Newton(IntervalMin,IntervalMax);
}
/* If we want to be general this could work for any
polynomial of order more that 4 if we find the (ORDER + 1)
control points
*/
#define NBBEZIER 5
template <class T, class F>
G4int
G4PolynomialSolver<T,F>::BezierClipping(/*T* typeF,F func,F deriv,*/
G4double *IntervalMin,
G4double *IntervalMax)
{
/** BezierClipping is a clipping interval Newton method **/
/** It works by clipping the area where the polynomial is **/
G4double P[NBBEZIER][2],D[2];
G4double NewMin,NewMax;
G4int IntervalIsVoid = 1;
/*** Calculating Control Points ***/
/* We see the polynomial as a Bezier curve for some control points to find */
/*
For 5 control points (polynomial of degree 4) this is:
0 p0 = F((*IntervalMin))
1/4 p1 = F((*IntervalMin)) + ((*IntervalMax) - (*IntervalMin))/4
* F'((*IntervalMin))
2/4 p2 = 1/6 * (16*F(((*IntervalMax) + (*IntervalMin))/2)
- (p0 + 4*p1 + 4*p3 + p4))
3/4 p3 = F((*IntervalMax)) - ((*IntervalMax) - (*IntervalMin))/4
* F'((*IntervalMax))
1 p4 = F((*IntervalMax))
*/
/* x,y,z,dx,dy,dz are constant during searching */
D[0] = (FunctionClass->*Derivative)(*IntervalMin);
P[0][0] = (*IntervalMin);
P[0][1] = (FunctionClass->*Function)(*IntervalMin);
if (fabs(P[0][1]) < Precision) {
return 1;
}
if (((*IntervalMax) - (*IntervalMin)) < POLEPSILON) {
return 1;
}
P[1][0] = (*IntervalMin) + ((*IntervalMax) - (*IntervalMin))/4;
P[1][1] = P[0][1] + (((*IntervalMax) - (*IntervalMin))/4.0) * D[0];
D[1] = (FunctionClass->*Derivative)(*IntervalMax);
P[4][0] = (*IntervalMax);
P[4][1] = (FunctionClass->*Function)(*IntervalMax);
P[3][0] = (*IntervalMax) - ((*IntervalMax) - (*IntervalMin))/4;
P[3][1] = P[4][1] - ((*IntervalMax) - (*IntervalMin))/4 * D[1];
P[2][0] = ((*IntervalMax) + (*IntervalMin))/2;
P[2][1] = (16*(FunctionClass->*Function)(((*IntervalMax)+(*IntervalMin))/2)
- (P[0][1] + 4*P[1][1] + 4*P[3][1] + P[4][1]))/6 ;
{
G4double Intersection ;
G4int i,j;
NewMin = (*IntervalMax) ;
NewMax = (*IntervalMin) ;
for (i=0;i<5;i++)
for (j=i+1;j<5;j++)
{
/* there is an intersection only if each have different signs */
if (((P[j][1] > -Precision) && (P[i][1] < Precision)) ||
((P[j][1] < Precision) && (P[i][1] > -Precision))) {
IntervalIsVoid = 0;
Intersection = P[j][0] - P[j][1]*((P[i][0] - P[j][0])/
(P[i][1] - P[j][1]));
if (Intersection < NewMin) {
NewMin = Intersection;
}
if (Intersection > NewMax) {
NewMax = Intersection;
}
}
}
if (IntervalIsVoid != 1) {
(*IntervalMax) = NewMax;
(*IntervalMin) = NewMin;
}
}
if (IntervalIsVoid == 1) {
return -1;
}
return 0;
}
template <class T, class F>
G4double G4PolynomialSolver<T,F>::Newton (G4double IntervalMin,
G4double IntervalMax)
{
/* So now we have a good guess and an interval where
if there are an intersection the root must be */
G4double Value = 0;
G4double Gradient = 0;
G4double Lambda ;
G4int i=0;
G4int j=0;
/* Reduce interval before applying Newton Method */
{
G4int NewtonIsSafe ;
while ((NewtonIsSafe = BezierClipping(&IntervalMin,&IntervalMax)) == 0) ;
if (NewtonIsSafe == -1) {
return POLINFINITY;
}
}
Lambda = IntervalMin;
Value = (FunctionClass->*Function)(Lambda);
// while ((fabs(Value) > Precision)) {
while (j != -1) {
Value = (FunctionClass->*Function)(Lambda);
Gradient = (FunctionClass->*Derivative)(Lambda);
Lambda = Lambda - Value/Gradient ;
if (fabs(Value) <= Precision) {
j ++;
if (j == 2) {
j = -1;
}
} else {
i ++;
if (i > ITERATION)
return POLINFINITY;
}
}
return Lambda ;
}
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4SimpleIntegration.hh,v 1.2 1999/11/16 17:30:59 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Class description:
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VGaussianQuadrature.hh,v 1.3 2000/11/20 17:26:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Class description:
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ChebyshevApproximation.cc,v 1.2 1999/11/16 17:31:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4ChebyshevApproximation.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4DataInterpolation.cc,v 1.3 1999/11/16 17:31:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4DataInterpolation.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GaussChebyshevQ.cc,v 1.2 1999/11/16 17:31:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4GaussChebyshevQ.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GaussHermiteQ.cc,v 1.3 2000/11/20 17:26:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4GaussHermiteQ.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GaussJacobiQ.cc,v 1.3 2000/11/20 17:26:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4GaussJacobiQ.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GaussLaguerreQ.cc,v 1.3 2000/11/20 17:26:43 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4GaussLaguerreQ.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4GaussLegendreQ.cc,v 1.2 1999/11/16 17:31:10 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#include "G4GaussLegendreQ.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4SimpleIntegration.cc,v 1.2 1999/11/16 17:31:11 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Implementation file for simple integration methods
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VGaussianQuadrature.cc,v 1.2 1999/11/16 17:31:11 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// Implementation file for G4VGaussianQuadrature virtual base class
//
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Poisson.hh,v 1.5 2000/01/06 14:13:08 maire Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: Randomize.hh,v 1.4 2000/08/02 15:21:19 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#ifndef randomize_h
#define randomize_h 1
+74 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.59 2000/12/13 08:22:26 gcosmo Exp $
$Id: History,v 1.78 2001/04/05 09:05:37 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,79 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
April 05, 2001 G.Cosmo (global-V03-00-11)
- Added patch to management/GNUmakefile for allowing compilation of G4UnitsTable.cc
on SUN-CC5 (CC 5.2 Patch 109508-02), removing optimisation.
April 03, 2001 G.Cosmo (global-V03-00-10)
- Fixed minor bug in constructor of G4PhysicsLinearVector, G4PhysicsLnVector
and G4PhysicsLogVector (H.Kurasige).
April 02, 2001 G.Cosmo (global-V03-00-09)
- G4UnitsTable.cc: resolved ambiguity of old/new style iostream for
formatting in G4UnitsTable::operator<<.
- Fix for compilation on WIN32-VC: added typedef to base collection G4PhysCollection
in G4PhysicsTable.
March 09, 2001 G.Cosmo (global-V03-00-08)
- Tyde up comments.
- Added patch to G4PhysicsTable::Store/Retrieve methods for non-ISO setup
where 'binary' streams are not implemented. Binary mode is allowed only
with ISO setup (native-STL).
- Removed 'virtual' specifier from Retrieve (...) methods in G4PhysicsVector
derived classes.
- Fixed bug in constructor of G4PhysicsLnVector:
added initialisation of 'dataVector' to zero (H.Kurasige).
March 09, 2001 H.Kurasige
- Added Store/RetrievePhysicsTable methods (G4PhysicsTable).
- Added Store/Retrieve and GetType methods (G4PhysicsVector and related).
- Introduced G4PhysicsVectorType class (enumeration).
- Added unit test PhysicsTableTest.cc.
March 06, 2001 G.Cosmo (global-V03-00-07)
- Completed migration to STL vector for all classes in "global/management"
o Migrated G4UnitsTable
o Migrated G4StateManager
March 05, 2001 G.Cosmo (global-V03-00-06)
- Added new unit 'parsec' to SystemOfUnits.h (M.Maire).
- Updated G4UnitsTable unit test (M.Maire).
- Removed file G4UnitsTest.hh now replaced by G4SIunits.hh.
February 24, 2001 G.Cosmo (global-V03-00-05)
- Implemented migration to STL vectors for G4PhysicsTable (H.Kurasige).
Added class description and comments for Software Reference Manual.
February 05, 2001 H.Kurasige (global-V03-00-04)
- Added default constructors to G4DataVector and G4OrderedTable. Removed
default size.
February 01, 2001 G.Cosmo, H.Kurasige (global-V03-00-03)
- Migration to STL vectors for G4OrderedTable and G4DataVector. In
G4OrderedTable, G4ValVector type has been removed and is now replaced
with G4DataVector.
- Removed from G4PhysicsVector dependency over G4PhysicsTable.
Removed methods: LinkPhysicsTable(), IsLinkedTableExist() and
GetNextTable(). Removed data-member ptrNextTable.
Updated all related subclasses.
- Updated unit tests in management/test.
January 29, 2001 G.Cosmo (global-V03-00-02)
- Added generic class G4PolynomialSolver in HEPNumerics module, extracting
logic from class G4Torus in geometry/solids/CSG.
January 16, 2001 G.Cosmo (global-V03-00-01)
- Minor fixes to last migration in management classes
tagged global-STLmigration-V02.
January 09, 2001 H.Kurashige
- Full STL migration for G4PhysicsVector and related.
January 09, 2001 G.Cosmo (global-V03-00-00)
- Fixed bug in destructor of G4Allocator (report #181): use "delete"
instead of "free" for deleting a page allocated with "new".
December 13, 2000 G.Folger (global-V02-00-06)
- Added GNUmakefile to HEPRandom to handle "includes" gmake target.
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: cstring.h,v 1.9 2000/11/20 17:26:44 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: cstring.icc,v 1.9 2000/11/20 20:03:16 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: ctoken.h,v 1.5 1999/11/29 10:17:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: defs.h,v 1.8 2000/06/26 16:25:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: rstream.h,v 1.4 1999/11/25 10:14:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: rw2stl_algo.h,v 1.4 1999/11/25 10:14:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: tpordvec.h,v 1.7 1999/11/26 17:17:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: tpordvec.icc,v 1.5 2000/11/20 17:26:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: tpsrtvec.h,v 1.8 1999/11/26 17:17:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: tpsrtvec.icc,v 1.7 2000/11/20 17:26:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: tpvector.h,v 1.9 2000/02/11 14:09:24 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: tpvector.icc,v 1.8 2000/11/20 17:26:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: tvordvec.h,v 1.8 2000/03/10 15:53:24 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: tvordvec.icc,v 1.6 2000/11/20 17:26:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: tvvector.h,v 1.8 2000/03/10 15:53:24 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: tvvector.icc,v 1.4 2000/11/20 17:26:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
+14 -1
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.2 2000/11/03 16:40:30 gunter Exp $
# $Id: GNUmakefile,v 1.3 2001/04/05 09:02:19 gcosmo Exp $
# --------------------------------------------------------------
# GNUmakefile for global management. Gabriele Cosmo, 26/9/96.
# --------------------------------------------------------------
@@ -13,6 +13,19 @@ include $(G4INSTALL)/config/architecture.gmk
include $(G4INSTALL)/config/common.gmk
# Fix for Solaris CC 5.2 Patch 109508-02 to compile without optimization.
#
CXXFLAGS_WITHOUT_O := $(filter-out -O% , $(CXXFLAGS))
CXXFLAGS_WITHOUT_O := $(filter-out +O% , $(CXXFLAGS_WITHOUT_O))
ifeq ($(G4SYSTEM),SUN-CC5)
COMPILER := $(shell CC -V 2>&1)
ifeq ($(findstring 109508-02,$(COMPILER)),109508-02)
$(G4TMP)/$(G4SYSTEM)/$(name)/G4UnitsTable.o: src/G4UnitsTable.cc
@echo Compiling G4UnitsTable.cc ...
@$(CXX) $(CXXFLAGS_WITHOUT_O) $(CPPFLAGS) -c $(OUT_OBJ)$@ src/G4UnitsTable.cc
endif
endif
G4DUMMY_VARIABLE:=$(shell [ ! -d $(G4INCLUDE)/g4std ] && mkdir -p $(G4INCLUDE)/g4std )
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Allocator.hh,v 1.5 2000/11/20 20:16:50 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4Allocator.hh,v 1.6 2001/01/09 07:50:57 stesting Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
@@ -103,7 +103,7 @@ G4Allocator<Type>::~G4Allocator()
{
aNextPage = aPage->fNext;
free(aPage->fUnits);
free(aPage);
delete aPage;
aPage = aNextPage;
}
fPages = NULL;
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4AllocatorPage.hh,v 1.2 1999/11/16 17:40:22 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4AllocatorUnit.hh,v 1.2 1999/11/16 17:40:22 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ApplicationState.hh,v 1.1 2000/07/22 10:45:34 asaim Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
#ifndef G4APPLICATIONSTATE_H
@@ -5,20 +5,127 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DataVector.hh,v 1.4 1999/11/23 15:00:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4DataVector.hh,v 1.7 2001/03/06 15:56:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
// ------------------------------------------------------------
//
// Class Description:
//
// Utility class providing similar behaviour of vector<G4double>.
// It includes additional methods for compatibility with Rogue Wave
// collection.
//
#ifndef G4DataVector_h
#define G4DataVector_h 1
#include "globals.hh"
#include "g4rw/tvordvec.h"
#include "g4std/vector"
typedef G4RWTValOrderedVector<G4double> G4DataVector;
class G4DataVector : public G4std::vector<G4double>
{
public: // with description
G4DataVector();
// Default constructor.
G4DataVector(size_t capacity);
// Constructor given a 'capacity' defining the initial number of elements.
virtual ~G4DataVector(){;}
// Empty destructor
inline void insertAt(size_t, const G4double&);
// Insert an element at given position
inline size_t index(const G4double&);
// Returns back index of the element same as given value
inline G4bool contains(const G4double&) const;
// Returns 'true' if it contains the element same as given value
inline G4bool remove(const G4double&);
// Removes the first element same as given value
inline size_t removeAll(const G4double&);
// Remove all elements same as given value
};
inline
G4DataVector::G4DataVector()
: G4std::vector<G4double>()
{
}
inline
G4DataVector::G4DataVector(size_t capacity)
: G4std::vector<G4double>(capacity)
{
}
inline
void G4DataVector::insertAt(size_t pos, const G4double& a)
{
iterator i = begin();
for (size_t ptn=0; (ptn<pos)&&(i!=end()); i++,ptn++);
if (i==end())
push_back(a);
else
insert(i,a);
}
inline
size_t G4DataVector::index(const G4double& a)
{
size_t ptn = 0;
for (iterator i=begin(); i!=end(); i++,ptn++)
if (*i==a) return ptn;
return (ptn=~(size_t)0);
}
inline
G4bool G4DataVector::contains(const G4double& a) const
{
for (const_iterator i=begin(); i!=end(); i++)
if (*i==a) return true;
return false;
}
inline
G4bool G4DataVector::remove(const G4double& a)
{
G4bool found =false;
for (iterator i=begin(); i!=end(); i++){
if (*i==a) {
erase(i);
found = true;
break;
}
}
return found;
}
inline
size_t G4DataVector::removeAll(const G4double& a)
{
size_t ptn=0;
for (iterator i=begin(); i!=end(); i++){
if (*i==a) {
erase(i);
ptn++;
i--;
}
}
return ptn;
}
#endif
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4FastVector.hh,v 1.3 1999/11/23 15:00:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LPhysicsFreeVector.hh,v 1.2 1999/11/16 17:40:38 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4LPhysicsFreeVector.hh,v 1.6 2001/03/09 12:08:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------------
@@ -27,6 +27,7 @@
//
// 27-MAR-97 FWJ: first version for Alpha release
// 20-JUN-97 FWJ: added comment re GetValue(): no longer virtual
// 11-NOV-00 H.Kurashige: use STL vector for dataVector and binVector
//
#ifndef G4LPhysicsFreeVector_h
@@ -36,19 +37,23 @@
class G4LPhysicsFreeVector : public G4PhysicsVector
{
public:
public:
G4LPhysicsFreeVector();
public: // with description
G4LPhysicsFreeVector(size_t nbin, G4double binmin, G4double binmax);
~G4LPhysicsFreeVector();
void PutValues(size_t binNumber, G4double binValue, G4double dataValue);
// G4PhysicsVector has PutValue() but it is inconvenient.
// Want to simultaneously fill the bin and data vectors.
// G4PhysicsVector has PutValue() but it is inconvenient.
// Want to simultaneously fill the bin and data vectors.
G4double GetValue(G4double theEnergy, G4bool& isOutRange);
// Note that theEnergy could be energy, momentum, or whatever.
// Note that theEnergy could be energy, momentum, or whatever.
void SetVerboseLevel(G4int value);
@@ -65,7 +70,7 @@ private:
G4int verboseLevel;
size_t FindBinLocation(G4double theEnergy) const;
// Pure virtual in G4PhysicsVector
// Pure virtual in G4PhysicsVector
};
#include "G4LPhysicsFreeVector.icc"
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4LPhysicsFreeVector.icc,v 1.2 1999/11/23 15:00:03 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4LPhysicsFreeVector.icc,v 1.4 2001/01/09 11:26:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------------
@@ -28,8 +28,8 @@
inline
void G4LPhysicsFreeVector::PutValues(size_t binNumber, G4double binValue, G4double dataValue)
{
binVector(binNumber) = binValue;
dataVector(binNumber) = dataValue;
binVector[binNumber] = binValue;
dataVector[binNumber] = dataValue;
}
// Note that theEnergy could be energy, momentum, or whatever.
@@ -47,33 +47,35 @@ G4double G4LPhysicsFreeVector::GetValue(G4double theEnergy, G4bool& isOutRange)
if (theEnergy < edgeMin) {
isOutRange = true;
#ifdef G4VERBOSE
if (verboseLevel > 1) G4cout << "G4LPhysicsFreeVector::GetValue " <<
theEnergy << " " << dataVector(0) << " " << isOutRange << G4endl;
returnValue = dataVector(0);
theEnergy << " " << dataVector[0] << " " << isOutRange << G4endl;
#endif
returnValue = dataVector[0];
}
else if (theEnergy > edgeMax) {
isOutRange = true;
#ifdef G4VERBOSE
if (verboseLevel > 1) G4cout << "G4LPhysicsFreeVector::GetValue " <<
theEnergy << " " << dataVector(numberOfBin - 1) << " " <<
theEnergy << " " << dataVector[numberOfBin - 1] << " " <<
isOutRange << G4endl;
returnValue = dataVector(numberOfBin - 1);
#endif
returnValue = dataVector[numberOfBin - 1];
}
else {
isOutRange = false;
G4int n = FindBinLocation(theEnergy);
G4double dsde = (dataVector(n + 1) - dataVector(n))/
(binVector(n + 1) - binVector(n));
G4double dsde = (dataVector[n + 1] - dataVector[n])/
(binVector[n + 1] - binVector[n]);
#ifdef G4VERBOSE
if (verboseLevel > 1) G4cout << "G4LPhysicsFreeVector::GetValue " <<
theEnergy << " " << dataVector(n) + (theEnergy - binVector(n))*dsde <<
theEnergy << " " << dataVector[n] + (theEnergy - binVector[n])*dsde <<
" " << isOutRange << G4endl;
returnValue = dataVector(n) + (theEnergy - binVector(n))*dsde;
#endif
returnValue = dataVector[n] + (theEnergy - binVector[n])*dsde;
}
return returnValue;
}
@@ -109,13 +111,15 @@ size_t G4LPhysicsFreeVector::FindBinLocation(G4double theEnergy) const
G4int n2 = numberOfBin/2;
G4int n3 = numberOfBin - 1;
while (n1 != n3 - 1) {
if (theEnergy > binVector(n2))
if (theEnergy > binVector[n2])
n1 = n2;
else
n3 = n2;
n2 = n1 + (n3 - n1 + 1)/2;
}
#ifdef G4VERBOSE
if (verboseLevel > 1) G4cout <<
"G4LPhysicsFreeVector::FindBinLocation: returning " << n1 << G4endl;
#endif
return (size_t)n1;
}
@@ -5,43 +5,80 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OrderedTable.hh,v 1.4 1999/11/16 17:40:39 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4OrderedTable.hh,v 1.7 2001/03/06 15:56:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
// ------------------------------------------------------------
// Sep. 1996 : M.Maire
// Jan. 2001 : H.Kurashige
// - G4ValVector is replaced with G4DataVector
// - Migrated to G4std::vector<G4DataVector*>.
//
// This class is setting up an ordered collection of
// ordered vectors of <G4double>
// 30 September 1996, M.Maire
// Class Description:
//
// Utility class, defining an ordered collection of vectors
// of <G4double>.
// ------------------------------------------------------------
#ifndef G4OrderedTable_h
#define G4OrderedTable_h 1
#include "globals.hh"
#include "g4rw/tvordvec.h"
#include "g4rw/tpordvec.h"
#include "g4std/vector"
#include "G4DataVector.hh"
class G4ValVector : public G4RWTValOrderedVector<G4double>
class G4OrderedTable : public G4std::vector<G4DataVector*>
{
public:
public: // with description
G4ValVector(size_t capac=G4RWDEFAULT_CAPACITY)
: G4RWTValOrderedVector<G4double>(capac) {;}
G4OrderedTable();
// Deafult constructor.
virtual ~G4ValVector() {;}
G4OrderedTable(size_t capacity);
// Constructor given a 'capacity' defining the initial
// number of elements (NULL pointers are filled up)
virtual ~G4OrderedTable(){;}
// Empty Destructor
G4bool operator==(const G4ValVector &right) const
{
return (this == (G4ValVector *) &right);
}
inline void clearAndDestroy();
// Removes all elements and deletes all non-NULL pointers
};
typedef G4RWTPtrOrderedVector<G4ValVector> G4OrderedTable;
inline
G4OrderedTable::G4OrderedTable()
: G4std::vector<G4DataVector*>()
{
}
inline
G4OrderedTable::G4OrderedTable(size_t capacity)
: G4std::vector<G4DataVector*>(capacity, (G4DataVector*)(0) )
{
}
inline
void G4OrderedTable::clearAndDestroy()
{
G4DataVector* a;
while (size()>0) {
a = back();
pop_back();
for (iterator i=begin(); i!=end(); i++){
if (*i==a) {
erase(i);
i--;
}
}
if ( a ) delete a;
}
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicsFreeVector.hh,v 1.3 2000/11/20 17:26:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4PhysicsFreeVector.hh,v 1.7 2001/03/09 12:08:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//--------------------------------------------------------------------
@@ -28,8 +28,9 @@
// 02 Dec. 1995, G.Cosmo : Structure created based on object model
// 06 Jun. 1996, K.Amako : Implemented the 1st version
// 01 Jul. 1996, K.Amako : Cache mechanism and hidden bin from the
// user introduced.
// 26 Sep. 1996, K.Amako : Constructor with only 'bin size' added.
// user introduced
// 26 Sep. 1996, K.Amako : Constructor with only 'bin size' added
// 11 Nov. 2000, H.Kurashige : Use STL vector for dataVector and binVector
//
//--------------------------------------------------------------------
@@ -37,29 +38,27 @@
#define G4PhysicsFreeVector_h 1
#include "globals.hh"
#include "G4DataVector.hh"
#include "G4PhysicsVector.hh"
#include "G4DataVector.hh"
class G4PhysicsFreeVector : public G4PhysicsVector
{
public:
public: // with description
// Constructors
G4PhysicsFreeVector();
G4PhysicsFreeVector(size_t theNbin);
G4PhysicsFreeVector(const G4DataVector& binVector,
const G4DataVector& dataVector);
// Constructors:
// 'binVector' has the low edge value of each scale bin.
// 'dataVector' has the cross-section/energy-loss/etc at
// the energy/momenturm of the corresponding a bin of
// 'binVector'. 'binVector' and 'dataVector' need to have
// the same vector length.
// Destructor
~G4PhysicsFreeVector();
// Destructor
// Special PutValue function for PhysicsFreeVector
void PutValue( size_t binNumber, G4double binValue,
G4double dataValue );
// To use this method to fill a PhysicsFreeVector, you have
@@ -75,7 +74,8 @@ class G4PhysicsFreeVector : public G4PhysicsVector
};
inline size_t G4PhysicsFreeVector::FindBinLocation(G4double theEnergy) const
inline
size_t G4PhysicsFreeVector::FindBinLocation(G4double theEnergy) const
{
// For G4PhysicsFreeVector, FindBinLocation is implemented using
// the binary search algorithm.
@@ -92,11 +92,11 @@ inline size_t G4PhysicsFreeVector::FindBinLocation(G4double theEnergy) const
while (lowerBound <= upperBound) {
size_t midBin = (lowerBound + upperBound)/2;
if( theEnergy < binVector(midBin) )
if( theEnergy < binVector[midBin] )
upperBound = midBin-1;
else
lowerBound = midBin+1;
}
}
return upperBound;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicsLinearVector.hh,v 1.2 1999/11/16 17:40:40 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4PhysicsLinearVector.hh,v 1.6 2001/03/09 12:08:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//--------------------------------------------------------------------
@@ -25,8 +25,9 @@
// 02 Dec. 1995, G.Cosmo : Structure created based on object model
// 03 Mar. 1996, K.Amako : Implemented the 1st version
// 01 Jul. 1996, K.Amako : Cache mechanism and hidden bin from the
// user introduced.
// 26 Sep. 1996, K.Amako : Constructor with only 'bin size' added.
// user introduced
// 26 Sep. 1996, K.Amako : Constructor with only 'bin size' added
// 11 Nov. 2000, H.Kurashige : Use STL vector for dataVector and binVector
//
//--------------------------------------------------------------------
@@ -34,26 +35,30 @@
#define G4PhysicsLinearVector_h 1
#include "globals.hh"
#include "G4DataVector.hh"
#include "G4PhysicsVector.hh"
class G4PhysicsLinearVector : public G4PhysicsVector
{
public:
// Constructors
G4PhysicsLinearVector();
G4PhysicsLinearVector(size_t theNbin);
G4PhysicsLinearVector(G4double theEmin, G4double theEmax, size_t theNbin);
// Constructors
public: // with description
G4PhysicsLinearVector(G4double theEmin, G4double theEmax, size_t theNbin);
// Constructor
// Destructor
~G4PhysicsLinearVector();
// Destructor
G4bool Retrieve(G4std::ifstream& fIn, G4bool ascii);
protected:
size_t FindBinLocation(G4double theEnergy) const;
// Find bin# in which theEnergy belongs - pure virtual function
// Find bin# in which theEnergy belongs - pure virtual function
private:
@@ -62,7 +67,8 @@ class G4PhysicsLinearVector : public G4PhysicsVector
};
inline size_t G4PhysicsLinearVector::FindBinLocation(G4double theEnergy) const
inline
size_t G4PhysicsLinearVector::FindBinLocation(G4double theEnergy) const
{
// For G4PhysicsLinearVector, FindBinLocation is implemented using
// a simple arithmetic calculation.
@@ -78,17 +84,3 @@ inline size_t G4PhysicsLinearVector::FindBinLocation(G4double theEnergy) const
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicsLnVector.hh,v 1.3 2000/03/23 09:20:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4PhysicsLnVector.hh,v 1.7 2001/03/09 12:08:18 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//--------------------------------------------------------------------
@@ -23,6 +23,7 @@
//
// History:
// 27 Apr. 1999, M.G. Pia: Created, copying from G4PhysicsLogVector
// 11 Nov. 2000, H.Kurashige : Use STL vector for dataVector and binVector
//
//--------------------------------------------------------------------
@@ -30,28 +31,32 @@
#define G4PhysicsLnVector_h 1
#include "globals.hh"
#include "G4DataVector.hh"
#include "G4PhysicsVector.hh"
class G4PhysicsLnVector : public G4PhysicsVector
{
public:
// Constructors
G4PhysicsLnVector();
G4PhysicsLnVector(size_t theNbin);
G4PhysicsLnVector(G4double theEmin, G4double theEmax, size_t theNbin);
// Because of logarithmic scale, note that 'theEmin' has to be
// greater than zero. No protection exists against this error.
// Constructors
public: // with description
G4PhysicsLnVector(G4double theEmin, G4double theEmax, size_t theNbin);
// Because of logarithmic scale, note that 'theEmin' has to be
// greater than zero. No protection exists against this error.
// Destructor
~G4PhysicsLnVector();
// Destructor.
G4bool Retrieve(G4std::ifstream& fIn, G4bool ascii);
// To retrieve persistent data from file stream.
protected:
size_t FindBinLocation(G4double theEnergy) const;
// Find bin# in which theEnergy belongs - pure virtual function
// Find bin# in which theEnergy belongs - pure virtual function.
private:
@@ -61,8 +66,10 @@ class G4PhysicsLnVector : public G4PhysicsVector
};
inline size_t G4PhysicsLnVector::FindBinLocation(G4double theEnergy) const {
inline
size_t G4PhysicsLnVector::FindBinLocation(G4double theEnergy) const
{
// For G4PhysicsLnVector, FindBinLocation is implemented using
// a simple arithmetic calculation.
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicsLogVector.hh,v 1.2 1999/11/16 17:40:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4PhysicsLogVector.hh,v 1.6 2001/03/09 12:08:19 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//--------------------------------------------------------------------
@@ -26,7 +26,8 @@
// 03 Mar. 1996, K.Amako : Implemented the 1st version
// 27 Apr. 1996, K.Amako : Cache mechanism added
// 01 Jul. 1996, K.Amako : Hidden bin from the user introduced
// 26 Sep. 1996, K.Amako : Constructor with only 'bin size' added.
// 26 Sep. 1996, K.Amako : Constructor with only 'bin size' added
// 11 Nov. 2000, H.Kurashige : Use STL vector for dataVector and binVector
//
//--------------------------------------------------------------------
@@ -34,28 +35,33 @@
#define G4PhysicsLogVector_h 1
#include "globals.hh"
#include "G4DataVector.hh"
#include "G4PhysicsVector.hh"
class G4PhysicsLogVector : public G4PhysicsVector
{
public:
// Constructors
G4PhysicsLogVector();
G4PhysicsLogVector(size_t theNbin);
G4PhysicsLogVector(G4double theEmin, G4double theEmax, size_t theNbin);
// Because of logarithmic scale, note that 'theEmin' has to be
// greater than zero. No protection exists against this error.
// Constructors
public: // with description
G4PhysicsLogVector(G4double theEmin, G4double theEmax, size_t theNbin);
// Because of logarithmic scale, note that 'theEmin' has to be
// greater than zero. No protection exists against this error.
// Destructor
~G4PhysicsLogVector();
// Destructor
G4bool Retrieve(G4std::ifstream& fIn, G4bool ascii);
// To retrieve persistent data from file stream.
protected:
size_t FindBinLocation(G4double theEnergy) const;
// Find bin# in which theEnergy belongs - pure virtual function
// Find bin# in which theEnergy belongs - pure virtual function
private:
@@ -65,7 +71,8 @@ class G4PhysicsLogVector : public G4PhysicsVector
};
inline size_t G4PhysicsLogVector::FindBinLocation(G4double theEnergy) const
inline
size_t G4PhysicsLogVector::FindBinLocation(G4double theEnergy) const
{
// For G4PhysicsLogVector, FindBinLocation is implemented using
// a simple arithmetic calculation.
@@ -5,19 +5,20 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicsOrderedFreeVector.hh,v 1.3 1999/11/16 17:40:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4PhysicsOrderedFreeVector.hh,v 1.7 2001/03/09 12:08:19 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
////////////////////////////////////////////////////////////////////////
// PhysicsOrderedFreeVector Class Definition
////////////////////////////////////////////////////////////////////////
//
// File: G4PhysicsOrderedFreeVector.hh
// Version: 1.0
// Created: 1996-08-13
// Author: Juliet Armstrong
// Updated: 1997-03-25 by Peter Gumplinger
// > cosmetics (only)
// 2000-11-11 by H.Kurashige
// > use STL vector for dataVector and binVector
// mail: gum@triumf.ca
//
// Class description:
@@ -39,7 +40,6 @@
// Includes
/////////////
#include "g4rw/tpordvec.h"
#include "G4PhysicsVector.hh"
/////////////////////
@@ -48,7 +48,8 @@
class G4PhysicsOrderedFreeVector : public G4PhysicsVector
{
public:
public: // with description
////////////////////////////////
// Constructors and Destructor
@@ -81,7 +82,7 @@ public:
void DumpValues();
private:
private:
size_t FindBinLocation(G4double theEnergy) const;
@@ -93,3 +94,9 @@ private:
#include "G4PhysicsOrderedFreeVector.icc"
#endif /* G4PhysicsOrderedFreeVector_h */
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicsOrderedFreeVector.icc,v 1.3 2000/11/20 17:26:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4PhysicsOrderedFreeVector.icc,v 1.5 2001/01/09 11:26:59 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
////////////////////////////////////////////////////////////////////////
// PhysicsOrderedFreeVector Class Inline Functions Definitions
@@ -17,6 +17,9 @@
// Author: Juliet Armstrong
// mail: gum@triumf.ca
//
// Updated:
// 2000-11-11 by H.Kurashige
// > use STL vector for dataVector and binVector
////////////////////////////////////////////////////////////////////////
////////////////////
@@ -26,25 +29,25 @@
inline
G4double G4PhysicsOrderedFreeVector::GetMaxValue()
{
return dataVector.last();
return dataVector.back();
}
inline
G4double G4PhysicsOrderedFreeVector::GetMinValue()
{
return dataVector.first();
return dataVector.front();
}
inline
G4double G4PhysicsOrderedFreeVector::GetMaxLowEdgeEnergy()
{
return binVector.last();
return binVector.back();
}
inline
G4double G4PhysicsOrderedFreeVector::GetMinLowEdgeEnergy()
{
return binVector.first();
return binVector.front();
}
inline
@@ -62,7 +65,7 @@ size_t G4PhysicsOrderedFreeVector::FindBinLocation(G4double theEnergy) const
G4int n2 = numberOfBin/2;
G4int n3 = numberOfBin - 1;
while (n1 != n3 - 1) {
if (theEnergy > binVector(n2))
if (theEnergy > binVector[n2])
n1 = n2;
else
n3 = n2;
@@ -5,28 +5,104 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicsTable.hh,v 1.3 1999/11/16 17:40:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4PhysicsTable.hh,v 1.10 2001/04/03 07:26:38 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// Class description:
//
// Modified 01 March 1996, K. Amako
// G4PhysicsTable is an utility class for storage of pointers
// to G4PhysicsVector containers. It derives all functionalities
// of STL vector containers with the addition of few methods for
// compatibility with previous implementation based on Rogue-Wave
// pointer collections.
// The constructor given the 'capacity' of the table, pre-allocates
// memory for the specified value by invoking the STL's reserve()
// function, in order to avoid reallocation during insertions.
// ------------------------------------------------------------
//
// History:
// -------
// - First implementation, based on object model of
// 2nd December 1995. G.Cosmo
// - 1st March 1996, modified. K.Amako
// - 24th February 2001, migration to STL vectors. H.Kurashige
// - 9th March 2001, added Store/RetrievePhysicsTable. H.Kurashige
//-------------------------------------
#ifndef G4PhysicsTable_h
#define G4PhysicsTable_h 1
#include "g4rw/tpordvec.h"
#include "g4std/vector"
#include "globals.hh"
#include "G4PhysicsVector.hh"
#include "G4ios.hh"
typedef G4RWTPtrOrderedVector<G4PhysicsVector> G4PhysicsTable;
class G4PhysicsVector;
class G4PhysicsTable : public G4std::vector<G4PhysicsVector*>
{
typedef G4std::vector<G4PhysicsVector*> G4PhysCollection;
public: // with description
G4PhysicsTable();
// Default constructor.
G4PhysicsTable(size_t capacity);
// Constructor with capacity. Reserves memory for the
// specified capacity.
virtual ~G4PhysicsTable();
// Destructor.
// Does not invoke deletion of contained pointed collections.
G4PhysicsVector*& operator()(size_t);
G4PhysicsVector* const& operator()(size_t) const;
// Access operators.
void clearAndDestroy();
// Removes all items and deletes them at the same time.
void insert (G4PhysicsVector*);
// Pushes new element to collection.
void insertAt (size_t, G4PhysicsVector*);
// Inserts element at the specified position in the collection.
size_t entries() const;
size_t length() const;
// Return collection's size.
G4bool isEmpty() const;
// Flags if collection is empty or not.
G4bool StorePhysicsTable(const G4String& filename, G4bool ascii=false);
// Stores PhysicsTable in a file (returns false in case of failure).
G4bool RetrievePhysicsTable(const G4String& filename, G4bool ascii=false);
// Retrieves Physics from a file (returns false in case of failure).
friend G4std::ostream& operator<<(G4std::ostream& out, G4PhysicsTable& table);
protected:
G4PhysicsVector* CreatePhysicsVector(G4int type);
private:
G4PhysicsTable(const G4PhysicsTable&);
G4PhysicsTable& operator=(const G4PhysicsTable&);
// Private copy constructor and assignment operator.
};
typedef G4PhysicsTable::iterator G4PhysicsTableIterator;
#include "G4PhysicsVector.hh"
#include "G4PhysicsTable.icc"
#endif
@@ -0,0 +1,73 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicsTable.icc,v 1.3 2001/04/03 07:26:38 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class inline implementation
//
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
//
// ------------------------------------------------------------
inline
void G4PhysicsTable::clearAndDestroy()
{
G4PhysicsVector* a;
while (size()>0) {
a = back();
pop_back();
if ( a ) delete a;
}
}
inline
G4PhysicsVector*& G4PhysicsTable::operator()(size_t i)
{
return (*this)[i];
}
inline
G4PhysicsVector* const& G4PhysicsTable::operator()(size_t i) const
{
return (*this)[i];
}
inline
void G4PhysicsTable::insert(G4PhysicsVector* pvec)
{
push_back(pvec);
}
inline
void G4PhysicsTable::insertAt (size_t idx, G4PhysicsVector* pvec)
{
G4PhysicsTableIterator itr=begin();
for (size_t i=0; i<idx; ++i) itr++;
G4PhysCollection::insert(itr, pvec);
}
inline
size_t G4PhysicsTable::entries() const
{
return size();
}
inline
size_t G4PhysicsTable::length() const
{
return size();
}
inline
G4bool G4PhysicsTable::isEmpty() const
{
return empty();
}
@@ -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:
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicsVector.icc,v 1.1 1999/11/16 17:40:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4PhysicsVector.icc,v 1.6 2001/03/09 12:08:19 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//---------------------------------------------------------------
@@ -24,27 +24,32 @@
//---------------------------------------------------------------
inline G4double G4PhysicsVector::operator[](const size_t binNumber) const
inline
G4double G4PhysicsVector::operator[](const size_t binNumber) const
{
return dataVector[binNumber];
}
inline G4double G4PhysicsVector::operator()(const size_t binNumber) const
inline
G4double G4PhysicsVector::operator()(const size_t binNumber) const
{
return dataVector(binNumber);
return dataVector[binNumber];
}
inline const G4RWTPtrOrderedVector<G4PhysicsVector>*
G4PhysicsVector::GetNextTable() const
inline
size_t G4PhysicsVector::GetVectorLength() const
{
return ptrNextTable;
return numberOfBin;
}
inline G4double G4PhysicsVector::LinearInterpolation(G4double theEnergy,
size_t theLocBin) {
inline
G4double G4PhysicsVector::LinearInterpolation(G4double theEnergy,
size_t theLocBin)
{
// Linear interpolation is used to get the value. If the give energy
// is in the highest bin, no interpolation will be Done. Because
@@ -52,16 +57,18 @@ inline G4double G4PhysicsVector::LinearInterpolation(G4double theEnergy,
// the following interpolation is valid even the current locBin=
// numberOfBin-1.
G4double intplFactor = (theEnergy-binVector(theLocBin))
/ (binVector(theLocBin+1)-binVector(theLocBin)); // Interpolation factor
G4double intplFactor = (theEnergy-binVector[theLocBin])
/ (binVector[theLocBin+1]-binVector[theLocBin]); // Interpolation factor
return dataVector(theLocBin) +
( dataVector(theLocBin+1)-dataVector(theLocBin) ) * intplFactor;
return dataVector[theLocBin] +
( dataVector[theLocBin+1]-dataVector[theLocBin] ) * intplFactor;
}
inline G4double G4PhysicsVector::GetValue(G4double theEnergy,
G4bool& isOutRange) {
inline
G4double G4PhysicsVector::GetValue(G4double theEnergy,
G4bool& isOutRange)
{
// Use cache for speed up - check if the value 'theEnergy' is same as the
// last call. If it is same, then use the last bin location. Also the
@@ -74,28 +81,28 @@ inline G4double G4PhysicsVector::GetValue(G4double theEnergy,
if( theEnergy == lastEnergy ) {
return lastValue;
}
else if( (theEnergy < lastEnergy) &&
(theEnergy >= binVector(lastBin)) ) {
} else if( (theEnergy < lastEnergy) &&
(theEnergy >= binVector[lastBin]) ) {
locBin = lastBin;
lastEnergy = theEnergy;
lastValue = LinearInterpolation(theEnergy, locBin);
return lastValue;
}
else if( theEnergy < edgeMin ){
} else if( theEnergy < edgeMin ){
lastBin = 0;
lastEnergy = theEnergy;
lastValue = dataVector(0);
lastValue = dataVector[0];
return lastValue;
}
else if( theEnergy >= edgeMax ){
} else if( theEnergy >= edgeMax ){
lastBin = numberOfBin-1;
lastEnergy = theEnergy;
lastValue = dataVector( numberOfBin-1 );
lastValue = dataVector[ numberOfBin-1 ];
return lastValue;
}
else {
} else {
locBin = FindBinLocation(theEnergy);
lastBin = locBin;
@@ -103,4 +110,45 @@ inline G4double G4PhysicsVector::GetValue(G4double theEnergy,
lastValue = LinearInterpolation(theEnergy, locBin);
return lastValue;
}
}
inline
void G4PhysicsVector::PutValue(size_t binNumber, G4double theValue)
{
dataVector[binNumber] = theValue;
// Fill the bin which is hidden to user with theValue. This is to
// handle correctly when Energy=theEmax in getValue.
if(binNumber==numberOfBin-1) {
dataVector[binNumber+1] = theValue;
}
}
inline
G4bool G4PhysicsVector::IsFilledVectorExist() const
{
G4bool status=false;
if(numberOfBin > 0) status=true;
return status;
}
inline
void G4PhysicsVector::PutComment(const G4String& theComment)
{
comment = theComment;
}
inline
const G4String& G4PhysicsVector::GetComment() const
{
return comment;
}
inline
G4PhysicsVectorType G4PhysicsVector::GetType() const
{
return type;
}
@@ -0,0 +1,42 @@
// This code implementation is the intellectual property of
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhysicsVectorType.hh,v 1.2 2001/03/09 12:08:20 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// --------------------------------------------------------------
//
// G4PhysicsVectorType
//
// Class Description:
//
// Enumerator to define the physics vector type:
// G4PhysicsVector - base
// G4PhysicsLinearVector
// G4PhysicsLogVector
// G4PhysicsLnVector
// G4PhysicsFreeVector
// G4PhysicsOrderedFreeVector
// G4LPhysicsFreeVector
// --------------------------------------------------------------
#ifndef G4PhysicsVectorType_h
#define G4PhysicsVectorType_h
enum G4PhysicsVectorType
{
T_G4PhysicsVector =0,
T_G4PhysicsLinearVector,
T_G4PhysicsLogVector,
T_G4PhysicsLnVector,
T_G4PhysicsFreeVector,
T_G4PhysicsOrderedFreeVector,
T_G4LPhysicsFreeVector
};
#endif
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4RotationMatrix.hh,v 1.2 1999/11/16 17:40:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ----------------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UnitsTest.hh,v 1.4 1999/11/19 09:19:30 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4SIunits.hh,v 1.1 2001/03/02 11:01:51 maire Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// ----------------------------------------------------------------------
//
@@ -42,7 +42,8 @@
//
// History:
//
// 10.03.99 created
// 10.03.99 created
// 01.03.01 parsec
#ifndef G4UNITSTEST_HH
#define G4UNITSTEST_HH
@@ -68,6 +69,8 @@ static const HepDouble kilometer = 1000.*meter;
static const HepDouble kilometer2 = kilometer*kilometer;
static const HepDouble kilometer3 = kilometer*kilometer*kilometer;
static const HepDouble parsec = 3.0856775807e+16*meter;
static const HepDouble micrometer = 1.e-6 *meter;
static const HepDouble nanometer = 1.e-9 *meter;
static const HepDouble angstrom = 1.e-10*meter;
@@ -96,6 +99,8 @@ static const HepDouble km = kilometer;
static const HepDouble km2 = kilometer2;
static const HepDouble km3 = kilometer3;
static const HepDouble pc = parsec;
//
// Angle
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4StateManager.hh,v 1.2 2000/11/20 17:26:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4StateManager.hh,v 1.3 2001/03/06 15:56:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
@@ -35,7 +35,7 @@
#ifndef G4StateManager_h
#define G4StateManager_h 1
#include "g4rw/tpordvec.h"
#include "g4std/vector"
#include "globals.hh"
#include "G4ApplicationState.hh"
#include "G4VStateDependent.hh"
@@ -60,9 +60,9 @@ public:
public: // with description
G4ApplicationState GetCurrentState();
G4ApplicationState GetCurrentState() const;
// Returns the current state
G4ApplicationState GetPreviousState();
G4ApplicationState GetPreviousState() const;
// Returns the previous state
G4bool SetNewState(G4ApplicationState requestedState);
// Set Geant4 to a new state.
@@ -79,7 +79,7 @@ public: // with description
G4VStateDependent* RemoveDependent(const G4VStateDependent* aDependent);
// Remove the registration.
// Removed pointer is returned.
G4String GetStateString(G4ApplicationState aState);
G4String GetStateString(G4ApplicationState aState) const;
// Utility method which returns a string of the state name.
public:
@@ -104,7 +104,7 @@ private:
static G4StateManager* theStateManager;
G4ApplicationState theCurrentState;
G4ApplicationState thePreviousState;
G4RWTPtrOrderedVector<G4VStateDependent> theDependentsList;
G4std::vector<G4VStateDependent*> theDependentsList;
G4VStateDependent* theBottomDependent;
};
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ThreeVector.hh,v 1.2 1999/11/16 17:40:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ----------------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Timer.hh,v 1.10 2000/01/06 14:27:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ----------------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4Types.hh,v 1.4 1999/12/15 18:05:19 gracia Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// GEANT4 native types
@@ -5,26 +5,26 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4UnitsTable.hh,v 1.9 2000/01/19 11:16:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: G4UnitsTable.hh,v 1.10 2001/03/06 15:56:48 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// -----------------------------------------------------------------
// GEANT 4 class header file
//
// ------------------- class G4UnitsTable -----------------
//
// 17-05-98: first version, M.Maire
// 13-10-98: Units and symbols printed in fixed length
// 18-01-00: BestUnit for three vector
// 13-10-98: Units and symbols printed in fixed length, M.Maire
// 18-01-00: BestUnit for three vector, M.Maire
// 06-03-01: Migrated to STL vectors, G.Cosmo
//
// Class description:
//
// This class maintains a table of Units.
// A Unit has a name, a symbol, a value and belong to a category (i.e. its
// dimensional definition): Length, Time, Energy, etc...
// The Units are grouped by category. The TableOfUnits is a list of categories.
// The class BestUnit allow to convert automaticaly a physical quantity
// The class G4BestUnit allows to convert automaticaly a physical quantity
// from its internal value into the most appropriate Unit of the same category.
//
@@ -35,11 +35,11 @@
#define G4UnitsTable_HH
#include "globals.hh"
#include "g4rw/tpordvec.h"
#include "g4std/vector"
#include "G4ThreeVector.hh"
class G4UnitsCategory;
typedef G4RWTPtrOrderedVector<G4UnitsCategory> G4UnitsTable;
typedef G4std::vector<G4UnitsCategory*> G4UnitsTable;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -48,8 +48,8 @@ class G4UnitDefinition
{
public: // with description
G4UnitDefinition(G4String name, G4String symbol,G4String category,
G4double value);
G4UnitDefinition(G4String name, G4String symbol,
G4String category, G4double value);
public: // without description
@@ -64,18 +64,17 @@ private:
public: // with description
G4String GetName() {return Name;};
G4String GetSymbol() {return SymbolName;};
G4double GetValue() {return Value;};
G4String GetName() const {return Name;}
G4String GetSymbol() const {return SymbolName;}
G4double GetValue() const {return Value;}
void PrintDefinition();
static void BuildUnitsTable();
static void PrintUnitsTable();
static
G4UnitsTable& GetUnitsTable() {return theUnitsTable;};
static G4UnitsTable& GetUnitsTable() {return theUnitsTable;}
static G4double GetValueOf (G4String);
static G4String GetCategory(G4String);
@@ -94,7 +93,7 @@ private:
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
typedef G4RWTPtrOrderedVector<G4UnitDefinition> G4UnitsContainer;
typedef G4std::vector<G4UnitDefinition*> G4UnitsContainer;
class G4UnitsCategory
{
@@ -112,13 +111,13 @@ private:
public: // without description
G4String GetName() {return Name;};
G4UnitsContainer& GetUnitsList() {return UnitsList;};
G4int GetNameMxLen() {return NameMxLen;};
G4int GetSymbMxLen() {return SymbMxLen;};
void UpdateNameMxLen(G4int len) {if (NameMxLen<len) NameMxLen=len;};
void UpdateSymbMxLen(G4int len) {if (SymbMxLen<len) SymbMxLen=len;};
void PrintCategory();
G4String GetName() const {return Name;}
G4UnitsContainer& GetUnitsList() {return UnitsList;}
G4int GetNameMxLen() const {return NameMxLen;}
G4int GetSymbMxLen() const {return SymbMxLen;}
void UpdateNameMxLen(G4int len) {if (NameMxLen<len) NameMxLen=len;}
void UpdateSymbMxLen(G4int len) {if (SymbMxLen<len) SymbMxLen=len;}
void PrintCategory();
private:
@@ -134,25 +133,25 @@ class G4BestUnit
{
public: // with description
G4BestUnit(G4double internalValue, G4String category);
G4BestUnit(G4double internalValue, G4String category);
G4BestUnit(const G4ThreeVector& internalValue, G4String category);
// These constructors convert a physical quantity from its internalValue
// into the most appropriate unit of the same category.
// In practice it builds an object VU = (newValue, newUnit)
// These constructors convert a physical quantity from its internalValue
// into the most appropriate unit of the same category.
// In practice it builds an object VU = (newValue, newUnit)
~G4BestUnit();
public: // without description
G4double* GetValue() {return Value;};
G4String GetCategory() {return Category;};
size_t GetIndexOfCategory() {return IndexOfCategory;};
G4double* GetValue() {return Value;}
G4String GetCategory() const {return Category;}
size_t GetIndexOfCategory() const {return IndexOfCategory;}
public: // with description
friend
G4std::ostream& operator<<(G4std::ostream&,G4BestUnit VU);
// Default format to print the objet VU above.
// Default format to print the objet VU above.
private:
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4UserLimits.hh,v 1.6 2000/02/17 16:13:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// class G4UserLimits
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4UserLimits.icc,v 1.5 2000/02/17 16:13:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VStateDependent.hh,v 1.2 2000/11/20 17:26:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ------------------------------------------------------------
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4coutDestination.hh,v 1.3 2000/11/20 17:26:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ---------------------------------------------------------------
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4ios.hh,v 1.5 1999/12/15 18:05:18 gracia Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ---------------------------------------------------------------
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4strstreambuf.hh,v 1.7 2000/11/20 17:26:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ---------------------------------------------------------------
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4strstreambuf.icc,v 1.1 2000/11/20 17:26:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// ---------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: PhysicalConstants.h,v 1.4 1999/11/19 09:19:31 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: PhysicalConstants.h,v 1.5 2001/03/02 11:28:29 maire Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// ----------------------------------------------------------------------
//
@@ -50,7 +50,7 @@
#define HEP_PHYSICAL_CONSTANTS_H
#include "SystemOfUnits.h"
///#include "G4UnitsTest.hh"
////#include "G4SIunits.hh"
//
//
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: SystemOfUnits.h,v 1.4 1999/11/19 09:19:31 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// $Id: SystemOfUnits.h,v 1.6 2001/03/05 13:25:22 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-01 $
//
// ----------------------------------------------------------------------
//
@@ -27,7 +27,7 @@
// radian (radian)
// steradian (steradian)
//
// Below is a non exhaustive List of derived and pratical units
// Below is a non exhaustive list of derived and pratical units
// (i.e. mostly the SI units).
// You can add your own units.
//
@@ -45,9 +45,10 @@
// 06.02.96 Created.
// 28.03.96 Added miscellaneous constants.
// 05.12.97 E.Tcherniaev: Redefined pascal (to avoid warnings on WinNT)
// 20.05.98 names: meter, second, gram, radian, degree. (from Blasiuk (STAR))
// Added luminous units.
// 05.08.98 angstrom,picobarn,microsecond,picosecond,petaelectronvolt
// 20.05.98 names: meter, second, gram, radian, degree
// (from Brian.Lasiuk@yale.edu (STAR)). Added luminous units.
// 05.08.98 angstrom, picobarn, microsecond, picosecond, petaelectronvolt
// 01.03.01 parsec
#ifndef HEP_SYSTEM_OF_UNITS_H
#define HEP_SYSTEM_OF_UNITS_H
@@ -73,6 +74,8 @@ static const HepDouble kilometer = 1000.*meter;
static const HepDouble kilometer2 = kilometer*kilometer;
static const HepDouble kilometer3 = kilometer*kilometer*kilometer;
static const HepDouble parsec = 3.0856775807e+16*meter;
static const HepDouble micrometer = 1.e-6 *meter;
static const HepDouble nanometer = 1.e-9 *meter;
static const HepDouble angstrom = 1.e-10*meter;
@@ -101,6 +104,8 @@ static const HepDouble km = kilometer;
static const HepDouble km2 = kilometer2;
static const HepDouble km3 = kilometer3;
static const HepDouble pc = parsec;
//
// Angle
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: algorithm,v 1.3 1999/11/16 17:42:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- algorithm ----------------
//
@@ -7,7 +7,7 @@
//
//
// $Id: complex,v 1.3 2000/06/15 17:32:10 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- complex ----------------
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: fstream,v 1.3 1999/11/16 17:43:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- fstream ----------------
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: functional,v 1.3 1999/11/16 17:43:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- functional ----------------
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: iomanip,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- iomanip ----------------
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: iostream,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- iostream ----------------
//
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: list,v 1.1 2000/08/22 07:54:26 hpw Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- list ----------------
//
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: map,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- map ----------------
//
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: queue,v 1.1 2000/08/02 09:49:56 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- queue ----------------
//
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: set,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- set ----------------
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: streambuf,v 1.3 1999/11/16 17:43:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- streambuf ----------------
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: strstream,v 1.3 1999/11/16 17:43:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- strstream ----------------
//
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: vector,v 1.3 1999/11/16 17:43:09 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
// ---------------- vector ----------------
//
+1 -1
View File
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: globals.hh,v 1.15 2000/01/19 11:12:44 gcosmo Exp $
// GEANT4 tag $Name: geant4-03-00 $
// GEANT4 tag $Name: geant4-03-01 $
//
//
// Global Constants and typedefs

Some files were not shown because too many files have changed in this diff Show More