Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4AllocatorPool.cc,v 1.6 2010-07-14 10:45:46 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DataVector.cc,v 1.12 2010-11-01 13:55:53 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ErrorPropagatorData.cc,v 1.7 2010-10-01 16:36:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Exception.cc,v 1.21 2007-11-13 17:35:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeometryTolerance.cc,v 1.3 2008-02-15 07:29:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
// class G4GeometryTolerance
|
||||
//
|
||||
@@ -36,8 +35,10 @@
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4GeometryTolerance.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
// Static class data
|
||||
// ***************************************************************************
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4LPhysicsFreeVector.cc,v 1.25 2010-05-28 05:13:43 kurasige Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
@@ -41,6 +40,7 @@
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
#include "G4LPhysicsFreeVector.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OrderedTable.cc,v 1.8 2010-11-01 13:55:53 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
G4Physics2DVector::G4Physics2DVector()
|
||||
: type(T_G4PhysicsFreeVector),
|
||||
numberOfXNodes(0), numberOfYNodes(0),
|
||||
verboseLevel(0)
|
||||
verboseLevel(0), useBicubic(false)
|
||||
{
|
||||
cache = new G4Physics2DVectorCache();
|
||||
}
|
||||
@@ -57,7 +57,7 @@ G4Physics2DVector::G4Physics2DVector()
|
||||
G4Physics2DVector::G4Physics2DVector(size_t nx, size_t ny)
|
||||
: type(T_G4PhysicsFreeVector),
|
||||
numberOfXNodes(nx), numberOfYNodes(ny),
|
||||
verboseLevel(0)
|
||||
verboseLevel(0), useBicubic(false)
|
||||
{
|
||||
cache = new G4Physics2DVectorCache();
|
||||
PrepareVectors();
|
||||
@@ -81,6 +81,7 @@ G4Physics2DVector::G4Physics2DVector(const G4Physics2DVector& right)
|
||||
numberOfYNodes = right.numberOfYNodes;
|
||||
|
||||
verboseLevel = right.verboseLevel;
|
||||
useBicubic = right.useBicubic;
|
||||
|
||||
xVector = right.xVector;
|
||||
yVector = right.yVector;
|
||||
@@ -103,6 +104,7 @@ G4Physics2DVector& G4Physics2DVector::operator=(const G4Physics2DVector& right)
|
||||
numberOfYNodes = right.numberOfYNodes;
|
||||
|
||||
verboseLevel = right.verboseLevel;
|
||||
useBicubic = right.useBicubic;
|
||||
|
||||
cache->Clear();
|
||||
PrepareVectors();
|
||||
@@ -180,19 +182,90 @@ void G4Physics2DVector::ComputeValue(G4double xx, G4double yy)
|
||||
}
|
||||
size_t idx = cache->lastBinX;
|
||||
size_t idy = cache->lastBinY;
|
||||
G4double x1 = xVector[idx];
|
||||
G4double x2 = xVector[idx+1];
|
||||
G4double y1 = yVector[idy];
|
||||
G4double y2 = yVector[idy+1];
|
||||
G4double x = cache->lastX;
|
||||
G4double y = cache->lastY;
|
||||
G4double v11= GetValue(idx, idy);
|
||||
G4double v12= GetValue(idx+1, idy);
|
||||
G4double v21= GetValue(idx, idy+1);
|
||||
G4double v22= GetValue(idx+1, idy+1);
|
||||
cache->lastValue =
|
||||
((y2 - y)*(v11*(x2 - x) + v12*(x - x1)) +
|
||||
((y - y1)*(v21*(x2 - x) + v22*(x - x1))))/((x2 - x1)*(y2 - y1));
|
||||
if(useBicubic) {
|
||||
BicubicInterpolation(idx, idy);
|
||||
} else {
|
||||
G4double x1 = xVector[idx];
|
||||
G4double x2 = xVector[idx+1];
|
||||
G4double y1 = yVector[idy];
|
||||
G4double y2 = yVector[idy+1];
|
||||
G4double x = cache->lastX;
|
||||
G4double y = cache->lastY;
|
||||
G4double v11= GetValue(idx, idy);
|
||||
G4double v12= GetValue(idx+1, idy);
|
||||
G4double v21= GetValue(idx, idy+1);
|
||||
G4double v22= GetValue(idx+1, idy+1);
|
||||
cache->lastValue =
|
||||
((y2 - y)*(v11*(x2 - x) + v12*(x - x1)) +
|
||||
((y - y1)*(v21*(x2 - x) + v22*(x - x1))))/((x2 - x1)*(y2 - y1));
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
|
||||
void G4Physics2DVector::BicubicInterpolation(size_t idx, size_t idy)
|
||||
{
|
||||
// Bicubic interpolation according to
|
||||
// 1. H.M. Antia, "Numerical Methods for Scientists and Engineers",
|
||||
// MGH, 1991.
|
||||
// 2. W.H. Press et al., "Numerical recipes. The Art of Scientific
|
||||
// Computing", Cambridge University Press, 2007.
|
||||
G4double x1 = xVector[idx];
|
||||
G4double x2 = xVector[idx+1];
|
||||
G4double y1 = yVector[idy];
|
||||
G4double y2 = yVector[idy+1];
|
||||
G4double x = cache->lastX;
|
||||
G4double y = cache->lastY;
|
||||
G4double f1 = GetValue(idx, idy);
|
||||
G4double f2 = GetValue(idx+1, idy);
|
||||
G4double f3 = GetValue(idx+1, idy+1);
|
||||
G4double f4 = GetValue(idx, idy+1);
|
||||
|
||||
G4double dx = x2 - x1;
|
||||
G4double dy = y2 - y1;
|
||||
|
||||
G4double h1 = (x - x1)/dx;
|
||||
G4double h2 = (y - y1)/dy;
|
||||
|
||||
G4double h12 = h1*h1;
|
||||
G4double h13 = h12*h1;
|
||||
G4double h22 = h2*h2;
|
||||
G4double h23 = h22*h2;
|
||||
|
||||
// Three derivatives at each of four points (1-4) defining the
|
||||
// subregion are computed by numerical centered differencing from
|
||||
// the functional values already tabulated on the grid.
|
||||
|
||||
G4double f1x = DerivativeX(idx, idy, dx);
|
||||
G4double f2x = DerivativeX(idx+1, idy, dx);
|
||||
G4double f3x = DerivativeX(idx+1, idy+1, dx);
|
||||
G4double f4x = DerivativeX(idx, idy+1, dx);
|
||||
|
||||
G4double f1y = DerivativeY(idx, idy, dy);
|
||||
G4double f2y = DerivativeY(idx+1, idy, dy);
|
||||
G4double f3y = DerivativeY(idx+1, idy+1, dy);
|
||||
G4double f4y = DerivativeY(idx, idy+1, dy);
|
||||
|
||||
G4double dxy = dx*dy;
|
||||
G4double f1xy = DerivativeXY(idx, idy, dxy);
|
||||
G4double f2xy = DerivativeXY(idx+1, idy, dxy);
|
||||
G4double f3xy = DerivativeXY(idx+1, idy+1, dxy);
|
||||
G4double f4xy = DerivativeXY(idx, idy+1, dxy);
|
||||
|
||||
cache->lastValue =
|
||||
f1 + f1y*h2 + (3*(f4-f1) - 2*f1y - f4y)*h22 + (2*(f1 - f4) + f1y + f4y)*h23
|
||||
+ f1x*h1 + f1xy*h1*h2 +(3*(f4x - f1x) - 2*f1xy - f4xy)*h1*h22
|
||||
+ (2*(f1x - f4x) + f1xy + f4xy)*h1*h23
|
||||
+ (3*(f2 - f1) - 2*f1x - f2x)*h12 + (3*f2y - 3*f1y - 2*f1xy - f2xy)*h12*h2
|
||||
+ (9*(f1 - f2 + f3 - f4) + 6*f1x + 3*f2x - 3*f3x - 6*f4x + 6*f1y - 6*f2y
|
||||
- 3*f3y + 3*f4y + 4*f1xy + 2*f2xy + f3xy + 2*f4xy)*h12*h22
|
||||
+ (6*(-f1 + f2 - f3 + f4) - 4*f1x - 2*f2x + 2*f3x + 4*f4x - 3*f1y
|
||||
+ 3*f2y + 3*f3y - 3*f4y - 2*f1xy - f2xy - f3xy - 2*f4xy)*h12*h23
|
||||
+ (2*(f1 - f2) + f1x + f2x)*h13 + (2*(f1y - f2y) + f1xy + f2xy)*h13*h2
|
||||
+ (6*(-f1 + f2 -f3 + f4) + 3*(-f1x - f2x + f3x + f4x) - 4*f1y
|
||||
+ 4*f2y + 2*f3y - 2*f4y - 2*f1xy - 2*f2xy - f3xy - f4xy)*h13*h22
|
||||
+ (4*(f1 - f2 + f3 - f4) + 2*(f1x + f2x - f3x - f4x)
|
||||
+ 2*(f1y - f2y - f3y + f4y) + f1xy + f2xy + f3xy + f4xy)*h13*h23;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsFreeVector.cc,v 1.15 2010-05-28 05:13:43 kurasige Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsLinearVector.cc,v 1.18 2010-05-28 05:13:43 kurasige Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsLnVector.cc,v 1.21 2010-05-28 05:13:43 kurasige Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsLogVector.cc,v 1.25 2010-05-28 05:13:43 kurasige Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsOrderedFreeVector.cc,v 1.15 2010-05-28 05:13:43 kurasige Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// PhysicsOrderedFreeVector Class Implementation
|
||||
@@ -66,17 +65,10 @@ G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector(G4double *Energies,
|
||||
{
|
||||
type = T_G4PhysicsOrderedFreeVector;
|
||||
|
||||
dataVector.reserve(VectorLength);
|
||||
binVector.reserve(VectorLength);
|
||||
numberOfNodes = VectorLength;
|
||||
|
||||
for (size_t i = 0 ; i < VectorLength ; i++)
|
||||
{
|
||||
binVector.push_back(Energies[i]);
|
||||
dataVector.push_back(Values[i]);
|
||||
InsertValues(Energies[i], Values[i]);
|
||||
}
|
||||
edgeMin = binVector[0];
|
||||
edgeMax = binVector[numberOfNodes-1];
|
||||
}
|
||||
|
||||
G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector()
|
||||
@@ -97,12 +89,19 @@ G4PhysicsOrderedFreeVector::~G4PhysicsOrderedFreeVector() {}
|
||||
|
||||
void G4PhysicsOrderedFreeVector::InsertValues(G4double energy, G4double value)
|
||||
{
|
||||
binVector.push_back(energy);
|
||||
dataVector.push_back(value);
|
||||
std::vector<G4double>::iterator binLoc =
|
||||
std::lower_bound(binVector.begin(), binVector.end(), energy);
|
||||
|
||||
size_t binIdx = binLoc - binVector.begin(); // Iterator difference!
|
||||
|
||||
std::vector<G4double>::iterator dataLoc = dataVector.begin() + binIdx;
|
||||
|
||||
binVector.insert(binLoc, energy);
|
||||
dataVector.insert(dataLoc, value);
|
||||
|
||||
numberOfNodes++;
|
||||
edgeMin = binVector.front();
|
||||
edgeMax = binVector.back();
|
||||
|
||||
}
|
||||
|
||||
G4double G4PhysicsOrderedFreeVector::GetLowEdgeEnergy(size_t binNumber) const
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsTable.cc,v 1.18 2010-12-24 07:33:13 kurasige Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsVector.cc,v 1.49 2010-11-01 13:55:53 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -138,7 +137,6 @@ void G4PhysicsVector::CopyData(const G4PhysicsVector& vec)
|
||||
cache->lastValue = vec.GetLastValue();
|
||||
cache->lastBin = vec.GetLastBin();
|
||||
useSpline = vec.useSpline;
|
||||
comment = vec.comment;
|
||||
|
||||
size_t i;
|
||||
dataVector.clear();
|
||||
@@ -206,7 +204,6 @@ G4bool G4PhysicsVector::Retrieve(std::ifstream& fIn, G4bool ascii)
|
||||
dataVector.clear();
|
||||
binVector.clear();
|
||||
secDerivative.clear();
|
||||
comment = "";
|
||||
|
||||
// retrieve in ascii mode
|
||||
if (ascii){
|
||||
@@ -240,6 +237,10 @@ G4bool G4PhysicsVector::Retrieve(std::ifstream& fIn, G4bool ascii)
|
||||
dataVector.push_back(vData);
|
||||
}
|
||||
|
||||
// to remove any inconsistency
|
||||
numberOfNodes = siz;
|
||||
edgeMin = binVector[0];
|
||||
edgeMax = binVector[numberOfNodes-1];
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -270,6 +271,11 @@ G4bool G4PhysicsVector::Retrieve(std::ifstream& fIn, G4bool ascii)
|
||||
}
|
||||
delete [] value;
|
||||
|
||||
// to remove any inconsistency
|
||||
numberOfNodes = size;
|
||||
edgeMin = binVector[0];
|
||||
edgeMax = binVector[numberOfNodes-1];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -303,7 +309,7 @@ G4PhysicsVector::ComputeSecondDerivatives(G4double firstPointDerivative,
|
||||
G4double endPointDerivative)
|
||||
// A standard method of computation of second derivatives
|
||||
// First derivatives at the first and the last point should be provided
|
||||
// See for example W.H. Press et al. "Numerical reciptes and C"
|
||||
// See for example W.H. Press et al. "Numerical recipes in C"
|
||||
// Cambridge University Press, 1997.
|
||||
{
|
||||
if(4 > numberOfNodes) // cannot compute derivatives for less than 4 bins
|
||||
@@ -377,10 +383,6 @@ void G4PhysicsVector::FillSecondDerivatives()
|
||||
|
||||
G4int n = numberOfNodes-1;
|
||||
|
||||
//G4cout << "G4PhysicsVector::FillSecondDerivatives() n= " << n
|
||||
// << " " << this << G4endl;
|
||||
// G4cout << *this << G4endl;
|
||||
|
||||
G4double* u = new G4double [n];
|
||||
|
||||
G4double p, sig;
|
||||
@@ -501,17 +503,14 @@ std::ostream& operator<<(std::ostream& out, const G4PhysicsVector& pv)
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
G4double G4PhysicsVector::Value(G4double theEnergy)
|
||||
void G4PhysicsVector::ComputeValue(G4double theEnergy)
|
||||
{
|
||||
// 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
|
||||
// value 'theEnergy' lies between the last energy and low edge of of the
|
||||
// Use cache for speed up - check if the value 'theEnergy' lies
|
||||
// between the last energy and low edge of of the
|
||||
// bin of last call, then the last bin location is used.
|
||||
|
||||
if( theEnergy == cache->lastEnergy ) {
|
||||
|
||||
} else if( theEnergy < cache->lastEnergy
|
||||
&& theEnergy >= binVector[cache->lastBin]) {
|
||||
if( theEnergy < cache->lastEnergy
|
||||
&& theEnergy >= binVector[cache->lastBin]) {
|
||||
cache->lastEnergy = theEnergy;
|
||||
Interpolation(cache->lastBin);
|
||||
|
||||
@@ -520,16 +519,15 @@ G4double G4PhysicsVector::Value(G4double theEnergy)
|
||||
cache->lastEnergy = edgeMin;
|
||||
cache->lastValue = dataVector[0];
|
||||
|
||||
} else if( theEnergy >= edgeMax ){
|
||||
} else if( theEnergy >= edgeMax ) {
|
||||
cache->lastBin = numberOfNodes-1;
|
||||
cache->lastEnergy = edgeMax;
|
||||
cache->lastValue = dataVector[cache->lastBin];
|
||||
|
||||
} else {
|
||||
cache->lastBin = FindBinLocation(theEnergy);
|
||||
cache->lastEnergy = theEnergy;
|
||||
Interpolation(cache->lastBin);
|
||||
cache->lastBin = FindBinLocation(theEnergy);
|
||||
cache->lastEnergy = theEnergy;
|
||||
Interpolation(cache->lastBin);
|
||||
}
|
||||
return cache->lastValue;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4Pow.cc,v 1.6 2011-01-08 15:39:03 vnivanch Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id:$
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
//
|
||||
// File name: G4ReferenceCountedHandle.cc
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#include "G4Types.hh"
|
||||
#include "G4ReferenceCountedHandle.hh"
|
||||
|
||||
G4Allocator<G4CountedObject<void> > aCountedObjectAllocator;
|
||||
G4Allocator<G4ReferenceCountedHandle<void> > aRCHAllocator;
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SliceTimer.cc,v 1.3 2010-10-01 16:36:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4StateManager.cc,v 1.15 2010-10-01 16:36:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Timer.cc,v 1.15 2006-06-29 19:04:30 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UnitsTable.cc,v 1.38 2010-08-09 15:21:14 maire Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//
|
||||
@@ -47,12 +46,12 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
G4UnitsTable G4UnitDefinition::theUnitsTable;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -62,19 +61,21 @@ G4UnitDefinition::G4UnitDefinition(const G4String& name,
|
||||
const G4String& category, G4double value)
|
||||
: Name(name),SymbolName(symbol),Value(value)
|
||||
{
|
||||
// Does the Category objet already exist ?
|
||||
//
|
||||
//does the Category objet already exist ?
|
||||
size_t nbCat = theUnitsTable.size();
|
||||
size_t i = 0;
|
||||
while ((i<nbCat)&&(theUnitsTable[i]->GetName()!=category)) { i++; }
|
||||
if (i == nbCat)
|
||||
{ theUnitsTable.push_back( new G4UnitsCategory(category)); }
|
||||
CategoryIndex = i;
|
||||
|
||||
// Insert this Unit in the Units table
|
||||
//
|
||||
//insert this Unit in the Unitstable
|
||||
(theUnitsTable[CategoryIndex]->GetUnitsList()).push_back(this);
|
||||
|
||||
//update string max length for name and symbol
|
||||
// Update string max length for name and symbol
|
||||
//
|
||||
theUnitsTable[i]->UpdateNameMxLen((G4int)name.length());
|
||||
theUnitsTable[i]->UpdateSymbMxLen((G4int)symbol.length());
|
||||
}
|
||||
@@ -124,6 +125,7 @@ G4int G4UnitDefinition::operator!=(const G4UnitDefinition &right) const
|
||||
|
||||
G4UnitsTable& G4UnitDefinition::GetUnitsTable()
|
||||
{
|
||||
if(theUnitsTable.size()==0) { BuildUnitsTable(); }
|
||||
return theUnitsTable;
|
||||
}
|
||||
|
||||
@@ -131,9 +133,8 @@ G4UnitsTable& G4UnitDefinition::GetUnitsTable()
|
||||
|
||||
G4double G4UnitDefinition::GetValueOf(const G4String& str)
|
||||
{
|
||||
if(theUnitsTable.size()==0) { BuildUnitsTable(); }
|
||||
G4String name,symbol;
|
||||
for (size_t i=0;i<theUnitsTable.size();i++)
|
||||
for (size_t i=0;i<(GetUnitsTable()).size();i++)
|
||||
{
|
||||
G4UnitsContainer& units = theUnitsTable[i]->GetUnitsList();
|
||||
for (size_t j=0;j<units.size();j++)
|
||||
@@ -143,9 +144,10 @@ G4double G4UnitDefinition::GetValueOf(const G4String& str)
|
||||
{ return units[j]->GetValue(); }
|
||||
}
|
||||
}
|
||||
G4cout << "Warning from G4UnitDefinition::GetValueOf(" << str << ")."
|
||||
<< " The unit " << str << " does not exist in UnitsTable."
|
||||
<< " Return Value = 0." << G4endl;
|
||||
std::ostringstream message;
|
||||
message << "The unit '" << str << "' does not exist in the Units Table.";
|
||||
G4Exception("G4UnitDefinition::GetValueOf()", "InvalidUnit",
|
||||
JustWarning, message, "Returning Value = 0.");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
@@ -153,9 +155,8 @@ G4double G4UnitDefinition::GetValueOf(const G4String& str)
|
||||
|
||||
G4String G4UnitDefinition::GetCategory(const G4String& str)
|
||||
{
|
||||
if(theUnitsTable.size()==0) { BuildUnitsTable(); }
|
||||
G4String name,symbol;
|
||||
for (size_t i=0;i<theUnitsTable.size();i++)
|
||||
for (size_t i=0;i<(GetUnitsTable()).size();i++)
|
||||
{
|
||||
G4UnitsContainer& units = theUnitsTable[i]->GetUnitsList();
|
||||
for (size_t j=0;j<units.size();j++)
|
||||
@@ -165,9 +166,10 @@ G4String G4UnitDefinition::GetCategory(const G4String& str)
|
||||
{ return theUnitsTable[i]->GetName(); }
|
||||
}
|
||||
}
|
||||
G4cout << "Warning from G4UnitDefinition::GetCategory(" << str << ")."
|
||||
<< " The unit " << str << " does not exist in UnitsTable."
|
||||
<< " Return category = None" << G4endl;
|
||||
std::ostringstream message;
|
||||
message << "The unit '" << str << "' does not exist in the Units Table.";
|
||||
G4Exception("G4UnitDefinition::GetCategory()", "InvalidUnit",
|
||||
JustWarning, message, "Returning Value = 0.");
|
||||
name = "None";
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VExceptionHandler.cc,v 1.3 2006-06-29 19:04:35 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VNotifier.cc,v 1.2 2006-06-29 19:04:37 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
// G4VNotifier
|
||||
//
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VStateDependent.cc,v 1.5 2006-06-29 19:04:39 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4coutDestination.cc,v 1.2 2006-06-29 19:04:41 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -42,12 +41,12 @@ G4coutDestination::~G4coutDestination()
|
||||
{
|
||||
}
|
||||
|
||||
G4int G4coutDestination::ReceiveG4cout(G4String)
|
||||
G4int G4coutDestination::ReceiveG4cout(const G4String&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
G4int G4coutDestination::ReceiveG4cerr(G4String)
|
||||
G4int G4coutDestination::ReceiveG4cerr(const G4String&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ios.cc,v 1.9 2006-06-29 19:04:43 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user