Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: CMakeLists.txt,v 1.1 2010-09-29 18:44:09 bmorgan Exp $
|
||||
# $Id: CMakeLists.txt 66892 2013-01-17 10:57:59Z gunter $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.4 2010-10-27 07:40:06 gcosmo Exp $
|
||||
# $Id: GNUmakefile 66892 2013-01-17 10:57:59Z gunter $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for global HEPNumerics. Gabriele Cosmo, 26/9/96.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4AnalyticalPolSolver.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4ChebyshevApproximation.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4ConvergenceTester.hh 74256 2013-10-02 14:24:02Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
@@ -59,7 +59,7 @@ class G4ConvergenceTester
|
||||
{
|
||||
public:
|
||||
|
||||
G4ConvergenceTester();
|
||||
G4ConvergenceTester( G4String theName="NONAME" );
|
||||
~G4ConvergenceTester();
|
||||
G4ConvergenceTester( G4double );
|
||||
|
||||
@@ -67,8 +67,9 @@ class G4ConvergenceTester
|
||||
|
||||
void AddScore( G4double );
|
||||
|
||||
void ShowHistory();
|
||||
void ShowResult();
|
||||
// default to G4cout but can redirected to another ostream
|
||||
void ShowHistory(std::ostream& out = G4cout);
|
||||
void ShowResult(std::ostream& out = G4cout);
|
||||
|
||||
inline G4double GetValueOfMinimizingFunction( std::vector<G4double> x )
|
||||
{ return slope_fitting_function( x ); }
|
||||
@@ -76,21 +77,32 @@ class G4ConvergenceTester
|
||||
private:
|
||||
|
||||
void calStat();
|
||||
// boolean value of “statsAreUpdated” is set to TRUE at end of calStat
|
||||
// and set to FALSE at end of AddScore
|
||||
// NOTE : A thread lock for Geant4-MT needs to be put in AddScore so calStat is not
|
||||
// executed in one thread while AddScore is modifying/adding data
|
||||
void CheckIsUpdated() { if(!statsAreUpdated) { calStat(); } }
|
||||
|
||||
public:
|
||||
// Public function to explicitly calculate statistics
|
||||
void ComputeStatistics() { calStat(); }
|
||||
|
||||
// All “Get” functions check to make sure value is current before returning
|
||||
G4double GetMean() { CheckIsUpdated(); return mean; }
|
||||
G4double GetStandardDeviation() { CheckIsUpdated(); return sd; }
|
||||
G4double GetVariance() { CheckIsUpdated(); return var; }
|
||||
G4double GetR() { CheckIsUpdated(); return r; }
|
||||
G4double GetEfficiency() { CheckIsUpdated(); return efficiency; }
|
||||
G4double GetR2eff() { CheckIsUpdated(); return r2eff; }
|
||||
G4double GetR2int() { CheckIsUpdated(); return r2int; }
|
||||
G4double GetShift() { CheckIsUpdated(); return shift; }
|
||||
G4double GetVOV() { CheckIsUpdated(); return vov; }
|
||||
G4double GetFOM() { CheckIsUpdated(); return fom; }
|
||||
|
||||
G4double GetMean() { return mean; }
|
||||
G4double GetStandardDeviation() { return sd; }
|
||||
G4double GetVariance() { return var; }
|
||||
G4double GetR() { return r; }
|
||||
G4double GetEfficiency() { return efficiency; }
|
||||
G4double GetR2eff() { return r2eff; }
|
||||
G4double GetR2int() { return r2int; }
|
||||
G4double GetShift() { return shift; }
|
||||
G4double GetVOV() { return vov; }
|
||||
G4double GetFOM() { return fom; }
|
||||
|
||||
private:
|
||||
void calc_grid_point_of_history();
|
||||
void calc_stat_history();
|
||||
void check_stat_history();
|
||||
void check_stat_history(std::ostream& out = G4cout);
|
||||
G4double calc_Pearson_r( G4int, std::vector<G4double>,
|
||||
std::vector<G4double> );
|
||||
G4bool is_monotonically_decrease( std::vector<G4double> );
|
||||
@@ -99,6 +111,7 @@ class G4ConvergenceTester
|
||||
|
||||
private:
|
||||
|
||||
G4String name;
|
||||
std::map< G4int , G4double > nonzero_histories;
|
||||
// (ith-history , score value)
|
||||
G4int n;
|
||||
@@ -153,6 +166,7 @@ class G4ConvergenceTester
|
||||
G4int noPass;
|
||||
G4int noTotal; // Total number of tests
|
||||
|
||||
G4bool statsAreUpdated;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4DataInterpolation.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GaussChebyshevQ.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GaussHermiteQ.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GaussJacobiQ.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GaussLaguerreQ.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GaussLegendreQ.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4Integrator.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4Integrator.icc 69546 2013-05-08 09:50:34Z gcosmo $
|
||||
//
|
||||
// Implementation of G4Integrator methods.
|
||||
//
|
||||
@@ -138,8 +138,8 @@ template <class T, class F>
|
||||
G4double G4Integrator<T,F>::Gauss( T& typeT, F f,
|
||||
G4double xInitial, G4double xFinal )
|
||||
{
|
||||
static G4double root = 1.0/std::sqrt(3.0) ;
|
||||
|
||||
static const G4double root = 1.0/std::sqrt(3.0) ;
|
||||
|
||||
G4double xMean = (xInitial + xFinal)/2.0 ;
|
||||
G4double Step = (xFinal - xInitial)/2.0 ;
|
||||
G4double delta = Step*root ;
|
||||
@@ -167,8 +167,8 @@ template <class T, class F>
|
||||
G4double G4Integrator<T,F>::Gauss( G4double (*f)(G4double),
|
||||
G4double xInitial, G4double xFinal)
|
||||
{
|
||||
static G4double root = 1.0/std::sqrt(3.0) ;
|
||||
|
||||
static const G4double root = 1.0/std::sqrt(3.0) ;
|
||||
|
||||
G4double xMean = (xInitial + xFinal)/2.0 ;
|
||||
G4double Step = (xFinal - xInitial)/2.0 ;
|
||||
G4double delta = Step*root ;
|
||||
@@ -473,13 +473,13 @@ G4double G4Integrator<T,F>::Legendre10( T& typeT, F f,G4double a, G4double b)
|
||||
|
||||
// From Abramowitz M., Stegan I.A. 1964 , Handbook of Math... , p. 916
|
||||
|
||||
static G4double abscissa[] = { 0.148874338981631, 0.433395394129247,
|
||||
0.679409568299024, 0.865063366688985,
|
||||
0.973906528517172 } ;
|
||||
static const G4double abscissa[] = { 0.148874338981631, 0.433395394129247,
|
||||
0.679409568299024, 0.865063366688985,
|
||||
0.973906528517172 } ;
|
||||
|
||||
static G4double weight[] = { 0.295524224714753, 0.269266719309996,
|
||||
0.219086362515982, 0.149451349150581,
|
||||
0.066671344308688 } ;
|
||||
static const G4double weight[] = { 0.295524224714753, 0.269266719309996,
|
||||
0.219086362515982, 0.149451349150581,
|
||||
0.066671344308688 } ;
|
||||
xMean = 0.5*(a + b) ;
|
||||
xDiff = 0.5*(b - a) ;
|
||||
integral = 0.0 ;
|
||||
@@ -514,13 +514,13 @@ G4double G4Integrator<T,F>::Legendre10( G4double (*f)(G4double),
|
||||
|
||||
// From Abramowitz M., Stegan I.A. 1964 , Handbook of Math... , p. 916
|
||||
|
||||
static G4double abscissa[] = { 0.148874338981631, 0.433395394129247,
|
||||
0.679409568299024, 0.865063366688985,
|
||||
0.973906528517172 } ;
|
||||
static const G4double abscissa[] = { 0.148874338981631, 0.433395394129247,
|
||||
0.679409568299024, 0.865063366688985,
|
||||
0.973906528517172 } ;
|
||||
|
||||
static G4double weight[] = { 0.295524224714753, 0.269266719309996,
|
||||
0.219086362515982, 0.149451349150581,
|
||||
0.066671344308688 } ;
|
||||
static const G4double weight[] = { 0.295524224714753, 0.269266719309996,
|
||||
0.219086362515982, 0.149451349150581,
|
||||
0.066671344308688 } ;
|
||||
xMean = 0.5*(a + b) ;
|
||||
xDiff = 0.5*(b - a) ;
|
||||
integral = 0.0 ;
|
||||
@@ -549,7 +549,7 @@ G4double G4Integrator<T,F>::Legendre96( T& typeT, F f,G4double a, G4double b)
|
||||
|
||||
// From Abramowitz M., Stegan I.A. 1964 , Handbook of Math... , p. 919
|
||||
|
||||
static G4double
|
||||
static const G4double
|
||||
abscissa[] = {
|
||||
0.016276744849602969579, 0.048812985136049731112,
|
||||
0.081297495464425558994, 0.113695850110665920911,
|
||||
@@ -584,7 +584,7 @@ G4double G4Integrator<T,F>::Legendre96( T& typeT, F f,G4double a, G4double b)
|
||||
0.998364375863181677724, 0.999689503883230766828 // 48
|
||||
} ;
|
||||
|
||||
static G4double
|
||||
static const G4double
|
||||
weight[] = {
|
||||
0.032550614492363166242, 0.032516118713868835987,
|
||||
0.032447163714064269364, 0.032343822568575928429,
|
||||
@@ -652,7 +652,7 @@ G4double G4Integrator<T,F>::Legendre96( G4double (*f)(G4double),
|
||||
|
||||
// From Abramowitz M., Stegan I.A. 1964 , Handbook of Math... , p. 919
|
||||
|
||||
static G4double
|
||||
static const G4double
|
||||
abscissa[] = {
|
||||
0.016276744849602969579, 0.048812985136049731112,
|
||||
0.081297495464425558994, 0.113695850110665920911,
|
||||
@@ -687,7 +687,7 @@ G4double G4Integrator<T,F>::Legendre96( G4double (*f)(G4double),
|
||||
0.998364375863181677724, 0.999689503883230766828 // 48
|
||||
} ;
|
||||
|
||||
static G4double
|
||||
static const G4double
|
||||
weight[] = {
|
||||
0.032550614492363166242, 0.032516118713868835987,
|
||||
0.032447163714064269364, 0.032343822568575928429,
|
||||
@@ -1015,9 +1015,9 @@ G4Integrator<T,F>::Laguerre( G4double (*f)(G4double),
|
||||
template <class T, class F>
|
||||
G4double G4Integrator<T,F>::GammaLogarithm(G4double xx)
|
||||
{
|
||||
static G4double cof[6] = { 76.18009172947146, -86.50532032941677,
|
||||
24.01409824083091, -1.231739572450155,
|
||||
0.1208650973866179e-2, -0.5395239384953e-5 } ;
|
||||
static const G4double cof[6] = { 76.18009172947146, -86.50532032941677,
|
||||
24.01409824083091, -1.231739572450155,
|
||||
0.1208650973866179e-2, -0.5395239384953e-5 };
|
||||
register G4int j;
|
||||
G4double x = xx - 1.0 ;
|
||||
G4double tmp = x + 5.5 ;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4JTPolynomialSolver.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
@@ -90,11 +90,11 @@ class G4JTPolynomialSolver
|
||||
G4double si;
|
||||
G4double u,v;
|
||||
G4double a,b,c,d;
|
||||
G4double a1,a2,a3,a6,a7;
|
||||
G4double a1,a3,a7;
|
||||
G4double e,f,g,h;
|
||||
G4double szr,szi;
|
||||
G4double lzr,lzi;
|
||||
G4int n,nmi;
|
||||
G4int n;
|
||||
|
||||
/* The following statements set machine constants */
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4PolynomialSolver.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// class G4PolynomialSolver
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4PolynomialSolver.icc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// class G4PolynomialSolver
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4SimpleIntegration.hh 69546 2013-05-08 09:50:34Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
@@ -114,7 +114,7 @@ class G4SimpleIntegration
|
||||
|
||||
function fFunction ;
|
||||
G4double fTolerance ;
|
||||
static G4int fMaxDepth ;
|
||||
const G4int fMaxDepth ;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4SimplexDownhill.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4SimplexDownhill.icc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Author: Tatsumi Koi (SLAC/SCCS), 2007
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -67,6 +66,9 @@ class G4StatDouble
|
||||
G4double rms(G4double ext_sum_w, G4int ext_n);
|
||||
// RMS scaled to sum of weights
|
||||
|
||||
void add(G4StatDouble*);
|
||||
// merge 2 statistics
|
||||
|
||||
inline G4int n() const { return m_n; }
|
||||
inline G4double sum_w() const { return m_sum_w; }
|
||||
inline G4double sum_w2() const { return m_sum_w2; }
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4VGaussianQuadrature.hh 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: sources.cmake,v 1.2 2010-10-12 07:24:27 gcosmo Exp $
|
||||
# $Id: sources.cmake 66892 2013-01-17 10:57:59Z gunter $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4AnalyticalPolSolver.cc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4ChebyshevApproximation.cc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4ChebyshevApproximation.hh"
|
||||
|
||||
@@ -41,13 +41,14 @@
|
||||
//
|
||||
|
||||
#include "G4ConvergenceTester.hh"
|
||||
#include <iomanip>
|
||||
|
||||
G4ConvergenceTester::G4ConvergenceTester()
|
||||
: n(0), sum(0.), mean(0.), var(0.), sd(0.), r(0.), efficiency(0.),
|
||||
G4ConvergenceTester::G4ConvergenceTester( G4String theName )
|
||||
: name(theName), n(0), sum(0.), mean(0.), var(0.), sd(0.), r(0.), efficiency(0.),
|
||||
r2eff(0.), r2int(0.), shift(0.), vov(0.), fom(0.), largest(0.),
|
||||
largest_score_happened(0), mean_1(0.), var_1(0.), sd_1(0.), r_1(0.),
|
||||
shift_1(0.), vov_1(0.), fom_1(0.), noBinOfHistory(16), slope(0.),
|
||||
noBinOfPDF(10), minimizer(0), noPass(0), noTotal(8)
|
||||
noBinOfPDF(10), minimizer(0), noPass(0), noTotal(8), statsAreUpdated(true)
|
||||
{
|
||||
nonzero_histories.clear();
|
||||
largest_scores.clear();
|
||||
@@ -96,7 +97,7 @@ void G4ConvergenceTester::AddScore( G4double x )
|
||||
nonzero_histories.insert( std::pair< G4int , G4double > ( n , x ) );
|
||||
if ( x > largest_scores.back() )
|
||||
{
|
||||
// Following serch should become faster if begin from bottom.
|
||||
// Following serch should become faster if begin from bottom.
|
||||
std::vector< G4double >::iterator it;
|
||||
for ( it = largest_scores.begin() ; it != largest_scores.end() ; it++ )
|
||||
{
|
||||
@@ -116,6 +117,8 @@ void G4ConvergenceTester::AddScore( G4double x )
|
||||
sum += x;
|
||||
}
|
||||
|
||||
// Data has been added so statistics have not been updated to new values
|
||||
statsAreUpdated = false;
|
||||
n++;
|
||||
return;
|
||||
}
|
||||
@@ -222,7 +225,7 @@ void G4ConvergenceTester::calStat()
|
||||
|
||||
if ( nonzero_histories.size() < 500 )
|
||||
{
|
||||
G4cout << "Number of non zero history too small to calcuarte SLOPE" << G4endl;
|
||||
G4cout << "Number of non zero history too small to calculate SLOPE" << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -239,6 +242,10 @@ void G4ConvergenceTester::calStat()
|
||||
|
||||
calc_grid_point_of_history();
|
||||
calc_stat_history();
|
||||
|
||||
// statistics have been calculated and this function does not need
|
||||
// to be called again until data has been added
|
||||
statsAreUpdated = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -336,66 +343,82 @@ void G4ConvergenceTester::calc_stat_history()
|
||||
|
||||
|
||||
|
||||
void G4ConvergenceTester::ShowResult()
|
||||
void G4ConvergenceTester::ShowResult(std::ostream& out)
|
||||
{
|
||||
calStat();
|
||||
// if data has been added since the last computation of the statistical values (not statsAreUpdated)
|
||||
// call calStat to recompute the statistical values
|
||||
if(!statsAreUpdated) { calStat(); }
|
||||
|
||||
G4cout << "EFFICIENCY = " << efficiency << G4endl;
|
||||
G4cout << "MEAN = " << mean << G4endl;
|
||||
G4cout << "VAR = " << var << G4endl;
|
||||
G4cout << "SD = " << sd << G4endl;
|
||||
G4cout << "R = "<< r << G4endl;
|
||||
G4cout << "SHIFT = "<< shift << G4endl;
|
||||
G4cout << "VOV = "<< vov << G4endl;
|
||||
G4cout << "FOM = "<< fom << G4endl;
|
||||
out << G4endl;
|
||||
out << "G4ConvergenceTester Output Result of " << name << G4endl;
|
||||
out << std::setw(20) << "EFFICIENCY = " << std::setw(13) << efficiency << G4endl;
|
||||
out << std::setw(20) << "MEAN = " << std::setw(13) << mean << G4endl;
|
||||
out << std::setw(20) << "VAR = " << std::setw(13) << var << G4endl;
|
||||
out << std::setw(20) << "SD = " << std::setw(13) << sd << G4endl;
|
||||
out << std::setw(20) << "R = " << std::setw(13) << r << G4endl;
|
||||
out << std::setw(20) << "SHIFT = "<< std::setw(13) << shift << G4endl;
|
||||
out << std::setw(20) << "VOV = "<< std::setw(13) << vov << G4endl;
|
||||
out << std::setw(20) << "FOM = "<< std::setw(13) << fom << G4endl;
|
||||
|
||||
G4cout << "THE LARGEST SCORE = " << largest << " and it happend at " << largest_score_happened << "th event" << G4endl;
|
||||
G4cout << "Affected Mean = " << mean_1 << " and its ratio to orignal is " << mean_1/mean << G4endl;
|
||||
G4cout << "Affected VAR = " << var_1 << " and its ratio to orignal is " << var_1/var << G4endl;
|
||||
G4cout << "Affected R = " << r_1 << " and its ratio to orignal is " << r_1/r << G4endl;
|
||||
G4cout << "Affected SHIFT = " << shift_1 << " and its ratio to orignal is " << shift_1/shift << G4endl;
|
||||
G4cout << "Affected FOM = " << fom_1 << " and its ratio to orignal is " << fom_1/fom << G4endl;
|
||||
out << std::setw(20) << "THE LARGEST SCORE = " << std::setw(13) << largest << " and it happend at " << largest_score_happened << "th event" << G4endl;
|
||||
out << std::setw(20) << "Affected Mean = " << std::setw(13) << mean_1 << " and its ratio to orignal is " << mean_1/mean << G4endl;
|
||||
out << std::setw(20) << "Affected VAR = " << std::setw(13) << var_1 << " and its ratio to orignal is " << var_1/var << G4endl;
|
||||
out << std::setw(20) << "Affected R = " << std::setw(13) << r_1 << " and its ratio to orignal is " << r_1/r << G4endl;
|
||||
out << std::setw(20) << "Affected SHIFT = " << std::setw(13) << shift_1 << " and its ratio to orignal is " << shift_1/shift << G4endl;
|
||||
out << std::setw(20) << "Affected FOM = " << std::setw(13) << fom_1 << " and its ratio to orignal is " << fom_1/fom << G4endl;
|
||||
|
||||
check_stat_history();
|
||||
check_stat_history(out);
|
||||
|
||||
// check SLOPE and output result
|
||||
if ( slope >= 3 )
|
||||
{
|
||||
noPass++;
|
||||
G4cout << "SLOPE is large enough" << G4endl;
|
||||
out << "SLOPE is large enough" << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "SLOPE is not large enough" << G4endl;
|
||||
out << "SLOPE is not large enough" << G4endl;
|
||||
}
|
||||
|
||||
G4cout << "This result passes " << noPass << " / "<< noTotal << " Convergence Test." << G4endl;
|
||||
G4cout << G4endl;
|
||||
out << "This result passes " << noPass << " / "<< noTotal << " Convergence Test." << G4endl;
|
||||
out << G4endl;
|
||||
|
||||
}
|
||||
|
||||
void G4ConvergenceTester::ShowHistory()
|
||||
void G4ConvergenceTester::ShowHistory(std::ostream& out)
|
||||
{
|
||||
G4cout << "i/" << noBinOfHistory << " till_ith mean var sd r vov fom shift e r2eff r2int" << G4endl;
|
||||
out << G4endl;
|
||||
out << "G4ConvergenceTester Output History of " << name << G4endl;
|
||||
out << "i/" << noBinOfHistory << " till_ith mean"
|
||||
<< std::setw(13) << "var"
|
||||
<< std::setw(13) << "sd"
|
||||
<< std::setw(13) << "r"
|
||||
<< std::setw(13) << "vov"
|
||||
<< std::setw(13) << "fom"
|
||||
<< std::setw(13) << "shift"
|
||||
<< std::setw(13) << "e"
|
||||
<< std::setw(13) << "r2eff"
|
||||
<< std::setw(13) << "r2int"
|
||||
<< G4endl;
|
||||
for ( G4int i = 1 ; i <= noBinOfHistory ; i++ )
|
||||
{
|
||||
G4cout << i << " "
|
||||
<< history_grid [ i-1 ] << " "
|
||||
<< mean_history [ i-1 ] << " "
|
||||
<< var_history [ i-1 ] << " "
|
||||
<< sd_history [ i-1 ] << " "
|
||||
<< r_history [ i-1 ] << " "
|
||||
<< vov_history [ i-1 ] << " "
|
||||
<< fom_history [ i-1 ] << " "
|
||||
<< shift_history [ i-1 ] << " "
|
||||
<< e_history [ i-1 ] << " "
|
||||
<< r2eff_history [ i-1 ] << " "
|
||||
<< r2int_history [ i-1 ] << " "
|
||||
<< G4endl;
|
||||
out << std::setw( 4) << i << " "
|
||||
<< std::setw( 5) << history_grid [ i-1 ]
|
||||
<< std::setw(13) << mean_history [ i-1 ]
|
||||
<< std::setw(13) << var_history [ i-1 ]
|
||||
<< std::setw(13) << sd_history [ i-1 ]
|
||||
<< std::setw(13) << r_history [ i-1 ]
|
||||
<< std::setw(13) << vov_history [ i-1 ]
|
||||
<< std::setw(13) << fom_history [ i-1 ]
|
||||
<< std::setw(13) << shift_history [ i-1 ]
|
||||
<< std::setw(13) << e_history [ i-1 ]
|
||||
<< std::setw(13) << r2eff_history [ i-1 ]
|
||||
<< std::setw(13) << r2int_history [ i-1 ]
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
void G4ConvergenceTester::check_stat_history()
|
||||
void G4ConvergenceTester::check_stat_history(std::ostream& out)
|
||||
{
|
||||
|
||||
// 1 sigma rejection for null hypothesis
|
||||
@@ -426,12 +449,12 @@ void G4ConvergenceTester::check_stat_history()
|
||||
|
||||
if ( t < 0.429318 ) // Student t of (Degree of freedom = N-2 )
|
||||
{
|
||||
G4cout << "MEAN distribution is RANDOM" << G4endl;
|
||||
out << "MEAN distribution is RANDOM" << G4endl;
|
||||
noPass++;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "MEAN distribution is not RANDOM" << G4endl;
|
||||
out << "MEAN distribution is not RANDOM" << G4endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -448,31 +471,31 @@ void G4ConvergenceTester::check_stat_history()
|
||||
|
||||
if ( t > 1.090546 )
|
||||
{
|
||||
G4cout << "r follows 1/std::sqrt(N)" << G4endl;
|
||||
out << "r follows 1/std::sqrt(N)" << G4endl;
|
||||
noPass++;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "r does not follow 1/std::sqrt(N)" << G4endl;
|
||||
out << "r does not follow 1/std::sqrt(N)" << G4endl;
|
||||
}
|
||||
|
||||
if ( is_monotonically_decrease( second_ally ) == true )
|
||||
{
|
||||
G4cout << "r is monotonically decrease " << G4endl;
|
||||
out << "r is monotonically decrease " << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "r is NOT monotonically decrease " << G4endl;
|
||||
out << "r is NOT monotonically decrease " << G4endl;
|
||||
}
|
||||
|
||||
if ( r_history.back() < 0.1 )
|
||||
{
|
||||
G4cout << "r is less than 0.1. r = " << r_history.back() << G4endl;
|
||||
out << "r is less than 0.1. r = " << r_history.back() << G4endl;
|
||||
noPass++;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "r is NOT less than 0.1. r = " << r_history.back() << G4endl;
|
||||
out << "r is NOT less than 0.1. r = " << r_history.back() << G4endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -488,21 +511,21 @@ void G4ConvergenceTester::check_stat_history()
|
||||
|
||||
if ( t > 1.090546 )
|
||||
{
|
||||
G4cout << "VOV follows 1/std::sqrt(N)" << G4endl;
|
||||
out << "VOV follows 1/std::sqrt(N)" << G4endl;
|
||||
noPass++;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "VOV does not follow 1/std::sqrt(N)" << G4endl;
|
||||
out << "VOV does not follow 1/std::sqrt(N)" << G4endl;
|
||||
}
|
||||
|
||||
if ( is_monotonically_decrease( second_ally ) == true )
|
||||
{
|
||||
G4cout << "VOV is monotonically decrease " << G4endl;
|
||||
out << "VOV is monotonically decrease " << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "VOV is NOT monotonically decrease " << G4endl;
|
||||
out << "VOV is NOT monotonically decrease " << G4endl;
|
||||
}
|
||||
|
||||
// FOM
|
||||
@@ -518,12 +541,12 @@ void G4ConvergenceTester::check_stat_history()
|
||||
|
||||
if ( t < 0.429318 )
|
||||
{
|
||||
G4cout << "FOM distribution is RANDOM" << G4endl;
|
||||
out << "FOM distribution is RANDOM" << G4endl;
|
||||
noPass++;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "FOM distribution is not RANDOM" << G4endl;
|
||||
out << "FOM distribution is not RANDOM" << G4endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4DataInterpolation.cc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
#include "G4DataInterpolation.hh"
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GaussChebyshevQ.cc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
#include "G4GaussChebyshevQ.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GaussHermiteQ.cc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4GaussHermiteQ.hh"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GaussJacobiQ.cc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
#include "G4GaussJacobiQ.hh"
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GaussLaguerreQ.cc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
#include "G4GaussLaguerreQ.hh"
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4GaussLegendreQ.cc 69546 2013-05-08 09:50:34Z gcosmo $
|
||||
//
|
||||
|
||||
#include "G4GaussLegendreQ.hh"
|
||||
@@ -123,13 +123,13 @@ G4double
|
||||
{
|
||||
// From Abramowitz M., Stegan I.A. 1964 , Handbook of Math... , p. 916
|
||||
|
||||
static G4double abscissa[] = { 0.148874338981631, 0.433395394129247,
|
||||
0.679409568299024, 0.865063366688985,
|
||||
0.973906528517172 } ;
|
||||
static const G4double abscissa[] = { 0.148874338981631, 0.433395394129247,
|
||||
0.679409568299024, 0.865063366688985,
|
||||
0.973906528517172 } ;
|
||||
|
||||
static G4double weight[] = { 0.295524224714753, 0.269266719309996,
|
||||
0.219086362515982, 0.149451349150581,
|
||||
0.066671344308688 } ;
|
||||
static const G4double weight[] = { 0.295524224714753, 0.269266719309996,
|
||||
0.219086362515982, 0.149451349150581,
|
||||
0.066671344308688 } ;
|
||||
G4double xMean = 0.5*(a + b),
|
||||
xDiff = 0.5*(b - a),
|
||||
integral = 0.0, dx = 0.0 ;
|
||||
@@ -155,7 +155,7 @@ G4double
|
||||
{
|
||||
// From Abramowitz M., Stegan I.A. 1964 , Handbook of Math... , p. 919
|
||||
|
||||
static
|
||||
static const
|
||||
G4double abscissa[] = {
|
||||
0.016276744849602969579, 0.048812985136049731112,
|
||||
0.081297495464425558994, 0.113695850110665920911,
|
||||
@@ -190,7 +190,7 @@ G4double
|
||||
0.998364375863181677724, 0.999689503883230766828 // 48
|
||||
} ;
|
||||
|
||||
static
|
||||
static const
|
||||
G4double weight[] = {
|
||||
0.032550614492363166242, 0.032516118713868835987,
|
||||
0.032447163714064269364, 0.032343822568575928429,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4JTPolynomialSolver.cc 67970 2013-03-13 10:10:06Z gcosmo $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
@@ -47,10 +47,10 @@ const G4double G4JTPolynomialSolver::lo = DBL_MIN/DBL_EPSILON ;
|
||||
G4JTPolynomialSolver::G4JTPolynomialSolver()
|
||||
: sr(0.), si(0.), u(0.),v(0.),
|
||||
a(0.), b(0.), c(0.), d(0.),
|
||||
a1(0.), a2(0.), a3(0.), a6(0.), a7(0.),
|
||||
a1(0.), a3(0.), a7(0.),
|
||||
e(0.), f(0.), g(0.), h(0.),
|
||||
szr(0.), szi(0.), lzr(0.), lzi(0.),
|
||||
n(0), nmi(0)
|
||||
n(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4SimpleIntegration.cc 69546 2013-05-08 09:50:34Z gcosmo $
|
||||
//
|
||||
// Implementation file for simple integration methods
|
||||
//
|
||||
@@ -33,19 +33,18 @@
|
||||
#include "G4SimpleIntegration.hh"
|
||||
|
||||
|
||||
G4int G4SimpleIntegration::fMaxDepth = 100 ;
|
||||
|
||||
|
||||
G4SimpleIntegration::G4SimpleIntegration( function pFunction )
|
||||
: fFunction(pFunction),
|
||||
fTolerance(.0001)
|
||||
fTolerance(.0001),
|
||||
fMaxDepth(100)
|
||||
{
|
||||
}
|
||||
|
||||
G4SimpleIntegration::G4SimpleIntegration( function pFunction,
|
||||
G4double pTolerance)
|
||||
: fFunction(pFunction),
|
||||
fTolerance(pTolerance)
|
||||
fTolerance(pTolerance),
|
||||
fMaxDepth(100)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -94,7 +93,7 @@ G4SimpleIntegration::Gauss(G4double xInitial,
|
||||
G4int iterationNumber )
|
||||
{
|
||||
G4double x=0.;
|
||||
static G4double root = 1.0/std::sqrt(3.0) ;
|
||||
static const G4double root = 1.0/std::sqrt(3.0) ;
|
||||
G4double Step = (xFinal - xInitial)/(2.0*iterationNumber) ;
|
||||
G4double delta = Step*root ;
|
||||
G4double mean = 0.0 ;
|
||||
@@ -146,7 +145,7 @@ G4double
|
||||
G4SimpleIntegration::Gauss( G4double xInitial,
|
||||
G4double xFinal )
|
||||
{
|
||||
static G4double root = 1.0/std::sqrt(3.0) ;
|
||||
static const G4double root = 1.0/std::sqrt(3.0) ;
|
||||
|
||||
G4double xMean = (xInitial + xFinal)/2.0 ;
|
||||
G4double Step = (xFinal - xInitial)/2.0 ;
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
//
|
||||
//
|
||||
// $Id:$
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -162,3 +161,12 @@ G4double G4StatDouble::rms(G4double ext_sum_w, G4int ext_n)
|
||||
|
||||
return rms(m_sum_wx, m_sum_wx2, ext_sum_w, ext_n);
|
||||
}
|
||||
|
||||
void G4StatDouble::add(G4StatDouble* ptr)
|
||||
{
|
||||
m_n += ptr->n();
|
||||
m_sum_w += ptr->sum_w();
|
||||
m_sum_w2 += ptr->sum_w2();
|
||||
m_sum_wx += ptr->sum_wx();
|
||||
m_sum_wx2 += ptr->sum_wx2();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4VGaussianQuadrature.cc 69546 2013-05-08 09:50:34Z gcosmo $
|
||||
//
|
||||
// Implementation file for G4VGaussianQuadrature virtual base class
|
||||
//
|
||||
@@ -81,9 +81,9 @@ G4VGaussianQuadrature::GammaLogarithm(G4double xx)
|
||||
// xx > 1. For 0 < xx < 1. the reflection formula (6.1.4) can be used first.
|
||||
// (Adapted from Numerical Recipes in C)
|
||||
|
||||
static G4double cof[6] = { 76.18009172947146, -86.50532032941677,
|
||||
24.01409824083091, -1.231739572450155,
|
||||
0.1208650973866179e-2, -0.5395239384953e-5 } ;
|
||||
static const G4double cof[6] = { 76.18009172947146, -86.50532032941677,
|
||||
24.01409824083091, -1.231739572450155,
|
||||
0.1208650973866179e-2, -0.5395239384953e-5 };
|
||||
G4double x = xx - 1.0;
|
||||
G4double tmp = x + 5.5;
|
||||
tmp -= (x + 0.5) * std::log(tmp);
|
||||
|
||||
Reference in New Issue
Block a user