Changeset 1315 for trunk/source/global


Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

Location:
trunk/source/global
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/global/HEPNumerics/test/G4IntegratorTest.cc

    r1199 r1315  
    2626//
    2727// $Id: G4IntegratorTest.cc,v 1.10 2006/08/21 12:24:32 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Test program for G4Integrator class. The function std::exp(-x)*std::cos(x) is
  • trunk/source/global/HEPNumerics/test/testChebyshev.cc

    r1199 r1315  
    2626//
    2727// $Id: testChebyshev.cc,v 1.6 2006/06/29 19:00:28 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Test program for G4ChebyshevApproximation class. The function std::exp(-x)*std::cos(x) is
  • trunk/source/global/HEPNumerics/test/testDataInterpolation.cc

    r1199 r1315  
    2626//
    2727// $Id: testDataInterpolation.cc,v 1.6 2006/06/29 19:00:31 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030#include "G4ios.hh"
  • trunk/source/global/HEPNumerics/test/testG4AnalyticalPolSolver.cc

    r1199 r1315  
    2626//
    2727// $Id: testG4AnalyticalPolSolver.cc,v 1.7 2006/06/29 19:00:33 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Test program for G4AnalyticalPolSolver class.
  • trunk/source/global/HEPNumerics/test/testG4PolynomialSolver.cc

    r1199 r1315  
    2626//
    2727// $Id: testG4PolynomialSolver.cc,v 1.6 2006/06/29 19:00:35 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030#include "G4PolynomialSolver.hh"
  • trunk/source/global/HEPNumerics/test/testGaussianQuadrature.cc

    r1199 r1315  
    2626//
    2727// $Id: testGaussianQuadrature.cc,v 1.6 2006/06/29 19:00:37 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Test program for G4GaussianQuadrature class. The function std::exp(-x)*std::cos(x) is
  • trunk/source/global/HEPNumerics/test/testIntegration.cc

    r1199 r1315  
    2626//
    2727// $Id: testIntegration.cc,v 1.6 2006/06/29 19:00:39 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Test program for G4SimpleIntegration class. The function std::exp(-x)*std::cos(x) is
  • trunk/source/global/HEPRandom/test/G4RandDistributionTest.cc

    r1199 r1315  
    2626//
    2727// $Id: G4RandDistributionTest.cc,v 1.5 2006/06/29 19:00:52 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/HEPRandom/test/G4RandGlobalTest.cc

    r1199 r1315  
    2626//
    2727// $Id: G4RandGlobalTest.cc,v 1.6 2006/06/29 19:00:55 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/HEPRandom/test/G4RandomDirectionTest.cc

    r1199 r1315  
    2626//
    2727// $Id: G4RandomDirectionTest.cc,v 1.1 2008/03/19 16:53:55 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/HEPRandom/test/G4ShootBitTest.cc

    r1199 r1315  
    2626//
    2727// $Id: G4ShootBitTest.cc,v 1.7 2006/06/29 19:00:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/History

    r1228 r1315  
    1 $Id: History,v 1.234 2009/12/07 09:24:27 vnivanch Exp $
     1$Id: History,v 1.245 2010/06/09 13:54:13 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1818     ----------------------------------------------------------
    1919
    20 Dec 7, 2009  V.Ivanchenko (global-V09-02-12)
    21 - G4PhysicsVector: (L.Pandola) fixed initialisation of lastEnergy to -DBL_MAX
    22                    allowing to have negative scale of energy 
     20Jun 09, 2010  G.Cosmo (global-V09-03-08)
     21- Changed date for release 9.4-beta.
     22
     23May 29, 2010  V.Ivantchenko (global-V09-03-07)
     24- More safe numerical computation of A13 and logA methods in G4Pow.
     25
     26May 28, 2010  H.Kurasige
     27- Restored G4PVDataVector vectors in G4PhysicsVector owned by value instead
     28  of pointers, as originally was before tag "global-V09-03-00".
     29
     30May 05, 2010  G.Cosmo (global-V09-03-06)
     31- Move interpolation methods to inline in G4PhysicsVector.
     32- Some cleanup.
     33
     34May 04, 2010  H.Kurashige (global-V09-03-05)
     35- Introduced G4PhysicsVectorCache, placeholder for cache R/W data in use
     36  by G4PhysicsVector and derivates.
     37  Modified G4PhysicsVector and G4LPhysicsFreeVector accordingly.
     38
     39Apr 06, 2010  G.Cosmo (global-V09-03-04)
     40- Changed date for release 9.3.p01.
     41
     42Mar 30, 2010  G.Cosmo (global-V09-03-03)
     43- Moved 'mem' pool in G4Allocator to public section, to allow for use of
     44  allocator in vectors on Windows/C++.
     45
     46Mar 23, 2010  V.Ivanchenko (global-V09-03-02)
     47- G4PhysicsLogVector, G4PhysicsLnVector, G4PhysicsLinearVector: preserve
     48  values of 'edgeMin' and 'edgeMax' in constructors avoiding recomputation,
     49  to avoid precision problem; fixes problem detected on Windows/VC++.
     50
     51Feb 01, 2010  G.Cosmo (global-V09-03-01)
     52- Restored G4PVDataVector as typedef for optimisation; removed class files.
     53
     54Dec 22, 2009  H.Kurashige (global-V09-03-00)
     55- Modified G4PhysicsVector to use pointers to G4PVDataVector instead of
     56  holding it as static data.
     57
     58Dec 07, 2009  L.Pandola, V.Ivanchenko (global-V09-02-12)
     59- G4PhysicsVector: fixed initialisation of 'lastEnergy' to -DBL_MAX
     60  allowing to have negative scale of energy.
    2361
    2462Nov 24, 2009  G.Cosmo (global-V09-02-11)
  • trunk/source/global/management/include/G4Allocator.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4Allocator.hh,v 1.19 2009/10/29 16:01:28 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4Allocator.hh,v 1.20 2010/03/30 08:17:24 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    137137      // Rebind allocator to type U
    138138
    139   private:
    140 
    141139    G4AllocatorPool mem;
    142140      // Pool of elements of sizeof(Type)
  • trunk/source/global/management/include/G4LPhysicsFreeVector.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4LPhysicsFreeVector.hh,v 1.11 2008/09/22 08:26:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4LPhysicsFreeVector.hh,v 1.14 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    7474   G4int GetVerboseLevel(G4int);
    7575
    76    G4double GetLastEnergy();
    77 
    78    size_t GetLastBin();
    79 
    8076   void DumpValues();
    8177
  • trunk/source/global/management/include/G4LPhysicsFreeVector.icc

    r1193 r1315  
    2525//
    2626//
    27 // $Id: G4LPhysicsFreeVector.icc,v 1.14 2009/06/25 10:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: global-V09-02-10 $
     27// $Id: G4LPhysicsFreeVector.icc,v 1.17 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    6868}
    6969
    70 inline
    71 G4double G4LPhysicsFreeVector::GetLastEnergy()
    72 {
    73    return lastEnergy;
    74 }
    75 
    76 inline
    77 size_t G4LPhysicsFreeVector::GetLastBin()
    78 {
    79    return lastBin;
    80 }
    8170
    8271inline
  • trunk/source/global/management/include/G4PhysicsFreeVector.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsFreeVector.hh,v 1.13 2009/06/25 10:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsFreeVector.hh,v 1.15 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    7676         // the same vector length.
    7777 
    78     ~G4PhysicsFreeVector();
     78    virtual ~G4PhysicsFreeVector();
    7979         // Destructor
    8080
  • trunk/source/global/management/include/G4PhysicsLinearVector.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsLinearVector.hh,v 1.11 2008/09/22 11:37:09 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsLinearVector.hh,v 1.13 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/include/G4PhysicsLnVector.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsLnVector.hh,v 1.13 2008/09/22 11:37:09 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsLnVector.hh,v 1.15 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/include/G4PhysicsLogVector.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsLogVector.hh,v 1.13 2008/09/22 08:26:33 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsLogVector.hh,v 1.15 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/include/G4PhysicsOrderedFreeVector.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsOrderedFreeVector.hh,v 1.12 2009/06/25 10:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsOrderedFreeVector.hh,v 1.14 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
  • trunk/source/global/management/include/G4PhysicsOrderedFreeVector.icc

    r1193 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsOrderedFreeVector.icc,v 1.9 2009/06/25 10:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: global-V09-02-10 $
     27// $Id: G4PhysicsOrderedFreeVector.icc,v 1.11 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
  • trunk/source/global/management/include/G4PhysicsVector.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsVector.hh,v 1.25 2009/11/04 11:32:43 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsVector.hh,v 1.31 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    5353//    11 May  2009, V.Ivanchenko : Added ComputeSecondDerivatives
    5454//    19 Jun. 2009, V.Ivanchenko : Removed hidden bin
    55 //
     55//    22 Dec. 2009  H.Kurashige  : Use pointers to G4PVDataVector
     56//    04 May. 2010  H.Kurashige  : Use G4PhysicsVectorCache
     57//    28 May  2010  H.Kurashige  : Stop using  pointers to G4PVDataVector
    5658//---------------------------------------------------------------
    5759
     
    6567#include <fstream>
    6668
     69#include "G4PhysicsVectorCache.hh"
    6770#include "G4PhysicsVectorType.hh"
     71
     72typedef std::vector<G4double> G4PVDataVector;
    6873
    6974class G4PhysicsVector
     
    8691         // destructor
    8792
    88     inline G4double Value(G4double theEnergy);
     93    G4double Value(G4double theEnergy);
    8994         // Get the cross-section/energy-loss value corresponding to the
    9095         // given energy. An appropriate interpolation is used to calculate
     
    175180    friend std::ostream& operator<<(std::ostream&, const G4PhysicsVector&);
    176181
     182   
     183    G4double GetLastEnergy() const;
     184    G4double GetLastValue() const;
     185    size_t GetLastBin() const;
     186         // Get cache values
     187
    177188  protected:
    178189
     
    186197  protected:
    187198
    188     typedef std::vector<G4double> G4PVDataVector;
    189 
    190199    G4PhysicsVectorType type;   // The type of PhysicsVector (enumerator)
    191200
     
    195204    size_t numberOfNodes;
    196205
    197     G4double lastEnergy;        // Cache the last input value
    198     G4double lastValue;         // Cache the last output value   
    199     size_t lastBin;             // Cache the last bin location
    200 
    201     G4PVDataVector dataVector;    // Vector to keep the crossection/energyloss
    202     G4PVDataVector binVector;     // Vector to keep energy
    203     G4PVDataVector secDerivative; // Vector to keep second derivatives
     206    G4PhysicsVectorCache*  cache;
     207
     208    G4PVDataVector  dataVector;    // Vector to keep the crossection/energyloss
     209    G4PVDataVector  binVector;     // Vector to keep energy
     210    G4PVDataVector  secDerivative; // Vector to keep second derivatives
    204211
    205212  private:
     
    207214    G4bool SplinePossible();
    208215
    209     inline G4double LinearInterpolation();
     216    inline G4double LinearInterpolation(G4int lastBin);
    210217         // Linear interpolation function
    211     inline G4double SplineInterpolation();
     218    inline G4double SplineInterpolation(G4int lastBin);
    212219         // Spline interpolation function
    213220
    214     inline void Interpolation();
     221    inline void Interpolation(G4int lastBin);
    215222
    216223    G4String   comment;
  • trunk/source/global/management/include/G4PhysicsVector.icc

    r1193 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsVector.icc,v 1.23 2009/11/18 11:42:03 vnivanch Exp $
    28 // GEANT4 tag $Name: global-V09-02-10 $
     27// $Id: G4PhysicsVector.icc,v 1.28 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    4444
    4545inline
     46 G4double G4PhysicsVector::GetLastEnergy() const
     47{
     48  return cache->lastEnergy;     
     49}
     50
     51inline
     52 G4double G4PhysicsVector::GetLastValue() const
     53{
     54   return cache->lastValue;
     55}
     56
     57inline
     58 size_t G4PhysicsVector::GetLastBin() const
     59{
     60   return cache->lastBin;
     61}
     62 
     63inline
    4664 G4double G4PhysicsVector::operator[](const size_t binNumber) const
    4765{
     66  return  dataVector[binNumber];
     67}
     68
     69//---------------------------------------------------------------
     70
     71inline
     72 G4double G4PhysicsVector::operator()(const size_t binNumber) const
     73{
    4874  return dataVector[binNumber];
    4975}
     
    5278
    5379inline
    54  G4double G4PhysicsVector::operator()(const size_t binNumber) const
    55 {
    56   return dataVector[binNumber];
    57 }
    58 
    59 //---------------------------------------------------------------
    60 
    61 inline
    6280 G4double G4PhysicsVector::Energy(const size_t binNumber) const
    6381{
     
    7694
    7795inline
    78  G4double G4PhysicsVector::LinearInterpolation()
     96 G4double G4PhysicsVector::GetValue(G4double theEnergy, G4bool&)
     97{
     98  return Value(theEnergy);
     99}
     100
     101//------------------------------------------------
     102
     103inline
     104 G4double G4PhysicsVector::LinearInterpolation(G4int lastBin)
    79105{
    80106  // Linear interpolation is used to get the value. If the give energy
     
    84110  // numberOfBin-1.
    85111
    86   G4double intplFactor = (lastEnergy-binVector[lastBin])
    87      / (binVector[lastBin+1]-binVector[lastBin]); // Interpolation factor
     112  G4double intplFactor = (cache->lastEnergy-binVector[lastBin])
     113     / (binVector[lastBin + 1]-binVector[lastBin]); // Interpol. factor
    88114
    89115  return dataVector[lastBin] +
    90          ( dataVector[lastBin+1]-dataVector[lastBin] ) * intplFactor;
    91 }
    92 
    93 //---------------------------------------------------------------
    94 
    95 inline
    96  G4double G4PhysicsVector::SplineInterpolation()
     116         ( dataVector[lastBin + 1]-dataVector[lastBin] ) * intplFactor;
     117}
     118
     119//---------------------------------------------------------------
     120
     121inline
     122 G4double G4PhysicsVector::SplineInterpolation(G4int lastBin)
    97123{
    98124  // Spline interpolation is used to get the value. If the give energy
     
    106132  // check bin value
    107133  G4double x1 = binVector[lastBin];
    108   G4double x2 = binVector[lastBin+1];
     134  G4double x2 = binVector[lastBin + 1];
    109135  G4double delta = x2 - x1;
    110136
    111   G4double a = (x2 - lastEnergy)/delta;
    112   G4double b = (lastEnergy - x1)/delta;
     137  G4double a = (x2 - cache->lastEnergy)/delta;
     138  G4double b = (cache->lastEnergy - x1)/delta;
    113139   
    114140  // Final evaluation of cubic spline polynomial for return   
    115141  G4double y1 = dataVector[lastBin];
    116   G4double y2 = dataVector[lastBin+1];
     142  G4double y2 = dataVector[lastBin + 1];
    117143
    118144  G4double res = a*y1 + b*y2 +
    119145        ( (a*a*a - a)*secDerivative[lastBin] +
    120           (b*b*b - b)*secDerivative[lastBin+1] )*delta*delta/6.0;
     146          (b*b*b - b)*secDerivative[lastBin + 1] )*delta*delta/6.0;
    121147
    122148  return res;
     
    125151//---------------------------------------------------------------
    126152
    127 inline
    128  G4double G4PhysicsVector::GetValue(G4double theEnergy, G4bool&)
    129 {
    130   return Value(theEnergy);
    131 }
    132 
    133 //---------------------------------------------------------------
    134 
    135 inline
    136  G4double G4PhysicsVector::Value(G4double theEnergy)
    137 {
    138   // Use cache for speed up - check if the value 'theEnergy' is same as the
    139   // last call. If it is same, then use the last bin location. Also the
    140   // value 'theEnergy' lies between the last energy and low edge of of the
    141   // bin of last call, then the last bin location is used.
    142 
    143   if( theEnergy == lastEnergy ) {
    144 
    145   } else if(theEnergy < lastEnergy && theEnergy >= binVector[lastBin]) {
    146      lastEnergy = theEnergy;
    147      Interpolation();
    148 
    149   } else if( theEnergy <= edgeMin ) {
    150      lastBin = 0;
    151      lastEnergy = edgeMin;
    152      lastValue  = dataVector[0];
    153 
    154   } else if( theEnergy >= edgeMax ){
    155      lastBin = numberOfNodes-2;
    156      lastEnergy = edgeMax;
    157      lastValue  = dataVector[numberOfNodes-1];
    158 
    159   } else {
    160      lastBin = FindBinLocation(theEnergy);
    161      if(lastBin >= numberOfNodes-1) {lastBin = numberOfNodes-2;}
    162      lastEnergy = theEnergy;
    163      Interpolation();
    164   }
    165   return lastValue;       
    166 }
    167 
    168 //---------------------------------------------------------------
    169 
    170 inline
    171  void G4PhysicsVector::Interpolation()
    172 {
    173   if(useSpline) { lastValue = SplineInterpolation(); }
    174   else          { lastValue = LinearInterpolation(); }
     153inline
     154 void G4PhysicsVector::Interpolation(G4int lastBin)
     155{
     156  if(useSpline) { cache->lastValue = SplineInterpolation(lastBin); }
     157  else          { cache->lastValue = LinearInterpolation(lastBin); }
    175158}
    176159
  • trunk/source/global/management/include/G4Pow.hh

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4Pow.hh,v 1.2 2009/07/03 11:35:07 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4Pow.hh,v 1.5 2010/05/28 08:18:03 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//
     
    3535//
    3636// Utility singleton class for the fast computation of log and pow
    37 // functions
     37// functions. Integer argument should in the interval 0-255, no
     38// check is performed inside these methods for performance reasons.
     39// Computations with double arguments are fast for the interval
     40// 0.5-255.5, standard library is used in the opposite case
    3841
    3942// Author: Vladimir Ivanchenko
     
    109112inline G4double G4Pow::A13(G4double A)
    110113{
    111   const G4int maxZ = 256;
     114  const G4double minA = 0.5000001;
     115  const G4double maxA = 255.5;
    112116
    113117  G4double res;
    114   G4int i = G4int(A + 0.5);
    115   if((i >= 1) && (i < maxZ))
     118  if((A >= minA) && (A <= maxA))
    116119  {
     120    G4int i = G4int(A + 0.5);
    117121    G4double x = (1.0 - A/G4double(i))*onethird;
    118122    res = pz13[i]*(1.0 + x - x*x*(1.0 - 1.66666666*x));
     
    144148inline G4double G4Pow::logA(G4double A)
    145149{
    146   const G4int maxZ = 256;
     150  const G4double minA = 0.5000001;
     151  const G4double maxA = 255.5;
    147152
    148153  G4double res;
    149   G4int i = G4int(A + 0.5);
    150   if((i >= 1) && (i < maxZ))
     154  if((A >= minA) && (A <= maxA))
    151155  {
     156    G4int i = G4int(A + 0.5);
    152157    G4double x = 1.0 - A/G4double(i);
    153158    res = lz[i] + x*(1.0 - 0.5*x + onethird*x*x);
  • trunk/source/global/management/include/G4Version.hh

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4Version.hh,v 1.25 2009/11/24 13:51:02 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4Version.hh,v 1.27 2010/06/09 13:52:53 gcosmo Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030// Version information
     
    4747
    4848#ifndef G4VERSION_NUMBER
    49 #define G4VERSION_NUMBER  930
     49#define G4VERSION_NUMBER  940
    5050#endif
    5151
    5252#ifndef G4VERSION_TAG
    53 #define G4VERSION_TAG "$Name: geant4-09-03 $"
     53#define G4VERSION_TAG "$Name: geant4-09-04-beta-cand-01 $"
    5454#endif
    5555
     
    5858#include "G4String.hh"
    5959
    60 static const G4String G4Version = "$Name: geant4-09-03 $";
    61 static const G4String G4Date    = "(18-December-2009)";
     60static const G4String G4Version = "$Name: geant4-09-04-beta-cand-01 $";
     61static const G4String G4Date    = "(25-June-2010)";
    6262
    6363#endif
  • trunk/source/global/management/src/G4LPhysicsFreeVector.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4LPhysicsFreeVector.cc,v 1.23 2009/06/25 10:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4LPhysicsFreeVector.cc,v 1.25 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/src/G4PhysicsFreeVector.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsFreeVector.cc,v 1.13 2009/06/25 10:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsFreeVector.cc,v 1.15 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    9393}
    9494
    95 void G4PhysicsFreeVector::PutValue( size_t theBinNumber, G4double theBinValue,
     95void G4PhysicsFreeVector::PutValue( size_t theBinNumber,
     96                                    G4double theBinValue,
    9697                                    G4double theDataValue )
    9798{
  • trunk/source/global/management/src/G4PhysicsLinearVector.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsLinearVector.cc,v 1.15 2009/06/25 10:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsLinearVector.cc,v 1.18 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    7575  binVector.reserve(numberOfNodes);     
    7676
    77   for (size_t i=0; i<numberOfNodes; i++)
    78   {
    79     binVector.push_back( theEmin + i*dBin );
    80     dataVector.push_back(0.0);
    81   }
     77  binVector.push_back(theEmin);
     78  dataVector.push_back(0.0);
     79
     80  for (size_t i=1; i<numberOfNodes-1; i++)
     81    {
     82      binVector.push_back( theEmin + i*dBin );
     83      dataVector.push_back(0.0);
     84    }
     85  binVector.push_back(theEmax);
     86  dataVector.push_back(0.0);
    8287
    8388  edgeMin = binVector[0];
  • trunk/source/global/management/src/G4PhysicsLnVector.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsLnVector.cc,v 1.18 2009/06/25 10:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsLnVector.cc,v 1.21 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    7575  binVector.reserve(numberOfNodes);     
    7676
    77   for (size_t i=0; i<numberOfNodes; i++)
    78   {
    79     binVector.push_back(std::exp((baseBin+i)*dBin));
    80     dataVector.push_back(0.0);
    81   }
     77  binVector.push_back(theEmin);
     78  dataVector.push_back(0.0);
     79
     80  for (size_t i=1; i<numberOfNodes-1; i++)
     81    {
     82      binVector.push_back(std::exp((baseBin+i)*dBin));
     83      dataVector.push_back(0.0);
     84    }
     85  binVector.push_back(theEmax);
     86  dataVector.push_back(0.0);
    8287
    8388  edgeMin = binVector[0];
  • trunk/source/global/management/src/G4PhysicsLogVector.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsLogVector.cc,v 1.22 2009/06/25 10:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsLogVector.cc,v 1.25 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    8282  static const G4double g4log10 = std::log(10.);
    8383
    84   for (size_t i=0; i<numberOfNodes; i++)
    85   {
    86     binVector.push_back(std::exp(g4log10*(baseBin+i)*dBin));
    87     dataVector.push_back(0.0);
    88   }
     84  binVector.push_back(theEmin);
     85  dataVector.push_back(0.0);
     86
     87  for (size_t i=1; i<numberOfNodes-1; i++)
     88    {
     89      binVector.push_back(std::exp(g4log10*(baseBin+i)*dBin));
     90      dataVector.push_back(0.0);
     91    }
     92  binVector.push_back(theEmax);
     93  dataVector.push_back(0.0);
    8994
    9095  edgeMin = binVector[0];
  • trunk/source/global/management/src/G4PhysicsOrderedFreeVector.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsOrderedFreeVector.cc,v 1.13 2009/06/25 10:05:26 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsOrderedFreeVector.cc,v 1.15 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
  • trunk/source/global/management/src/G4PhysicsVector.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4PhysicsVector.cc,v 1.41 2009/12/07 09:21:27 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4PhysicsVector.cc,v 1.46 2010/05/28 05:13:43 kurasige Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    4949//                                    algorithm
    5050//    19 Jun. 2009, V.Ivanchenko : removed hidden bin
     51//    17 Nov. 2009, H.Kurashige   : use pointer for DataVector
     52//    04 May  2010  H.Kurashige   : use G4PhyscisVectorCache
     53//    28 May  2010  H.Kurashige  : Stop using  pointers to G4PVDataVector
    5154// --------------------------------------------------------------
    5255
     
    5962 : type(T_G4PhysicsVector),
    6063   edgeMin(0.), edgeMax(0.), numberOfNodes(0),
    61    lastEnergy(-DBL_MAX), lastValue(0.), lastBin(0), useSpline(spline)
    62 {}
     64   useSpline(spline)
     65{
     66  cache      = new G4PhysicsVectorCache();
     67}
    6368
    6469// --------------------------------------------------------------
    6570
    6671G4PhysicsVector::~G4PhysicsVector()
    67 {}
     72{
     73  delete cache; cache =0;
     74}
    6875
    6976// --------------------------------------------------------------
     
    7178G4PhysicsVector::G4PhysicsVector(const G4PhysicsVector& right)
    7279{
     80  cache      = new G4PhysicsVectorCache();
    7381  CopyData(right);
    7482}
     
    116124  edgeMax = vec.edgeMax;
    117125  numberOfNodes = vec.numberOfNodes;
    118   lastEnergy = vec.lastEnergy;
    119   lastValue = vec.lastValue;
    120   lastBin = vec.lastBin;
    121   dataVector = vec.dataVector;
    122   binVector = vec.binVector;
     126  cache->lastEnergy = vec.GetLastEnergy();
     127  cache->lastValue = vec.GetLastValue();
     128  cache->lastBin = vec.GetLastBin();
    123129  useSpline = vec.useSpline;
    124130  comment = vec.comment;
    125   secDerivative = vec.secDerivative;
     131
     132  size_t i;
     133  dataVector.clear();
     134  for(i=0; i<(vec.dataVector).size(); i++){
     135    dataVector.push_back( (vec.dataVector)[i] );
     136  }
     137  binVector.clear();
     138  for(i=0; i<(vec.binVector).size(); i++){
     139    binVector.push_back( (vec.binVector)[i] );
     140  }
     141  secDerivative.clear();
     142  for(i=0; i<(vec.secDerivative).size(); i++){
     143    secDerivative.push_back( (vec.secDerivative)[i] );
     144  }
    126145}
    127146
     
    171190{
    172191  // clear properties;
    173   lastEnergy=-DBL_MAX;
    174   lastValue =0.;
    175   lastBin   =0;
     192  cache->lastEnergy=-DBL_MAX;
     193  cache->lastValue =0.;
     194  cache->lastBin   =0;
    176195  dataVector.clear();
    177196  binVector.clear();
     
    253272  edgeMin *= factorE;
    254273  edgeMax *= factorE;
    255   lastEnergy *= factorE;
    256   lastValue  *= factorV;
     274  cache->lastEnergy = factorE*(cache->lastEnergy);
     275  cache->lastValue  = factorV*(cache->lastValue);
    257276}
    258277
     
    293312  {
    294313    sig = (binVector[i]-binVector[i-1]) / (binVector[i+1]-binVector[i-1]);
    295     p = sig*secDerivative[i-1] + 2.0;
     314    p = sig*(secDerivative[i-1]) + 2.0;
    296315    secDerivative[i] = (sig - 1.0)/p;
    297316    u[i] = (dataVector[i+1]-dataVector[i])/(binVector[i+1]-binVector[i])
     
    457476  return out;
    458477}
     478
     479//---------------------------------------------------------------
     480
     481G4double G4PhysicsVector::Value(G4double theEnergy)
     482{
     483  // Use cache for speed up - check if the value 'theEnergy' is same as the
     484  // last call. If it is same, then use the last bin location. Also the
     485  // value 'theEnergy' lies between the last energy and low edge of of the
     486  // bin of last call, then the last bin location is used.
     487
     488  if( theEnergy == cache->lastEnergy ) {
     489
     490  } else if( theEnergy < cache->lastEnergy
     491        &&   theEnergy >= binVector[cache->lastBin]) {
     492     cache->lastEnergy = theEnergy;
     493     Interpolation(cache->lastBin);
     494
     495  } else if( theEnergy <= edgeMin ) {
     496     cache->lastBin = 0;
     497     cache->lastEnergy = edgeMin;
     498     cache->lastValue  = dataVector[0];
     499
     500  } else if( theEnergy >= edgeMax ){
     501     cache->lastBin = numberOfNodes-1;
     502     cache->lastEnergy = edgeMax;
     503     cache->lastValue  = dataVector[cache->lastBin];
     504
     505  } else {
     506     cache->lastBin = FindBinLocation(theEnergy);
     507     cache->lastEnergy = theEnergy;
     508     Interpolation(cache->lastBin);
     509  }
     510  return cache->lastValue;       
     511}
     512
  • trunk/source/global/management/test/AllocVectorTest.cc

    r1199 r1315  
    2626//
    2727// $Id: AllocVectorTest.cc,v 1.2 2006/06/29 19:04:45 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/test/AllocatorTest.cc

    r1199 r1315  
    2626//
    2727// $Id: AllocatorTest.cc,v 1.2 2006/06/29 19:04:47 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/test/DeallocatorTest.cc

    r1199 r1315  
    2626//
    2727// $Id: DeallocatorTest.cc,v 1.3 2006/06/29 19:04:49 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/test/G4UnitsTest.cc

    r1199 r1315  
    2626//
    2727// $Id: G4UnitsTest.cc,v 1.6 2006/06/29 19:04:53 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/test/LimitsTest.cc

    r1199 r1315  
    2626//
    2727// $Id: LimitsTest.cc,v 1.2 2006/06/29 19:04:55 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/test/OrderedTableTest.cc

    r1199 r1315  
    2626//
    2727// $Id: OrderedTableTest.cc,v 1.7 2006/06/29 19:04:58 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/test/PhysicsTableTest.cc

    r1199 r1315  
    2626//
    2727// $Id: PhysicsTableTest.cc,v 1.6 2006/06/29 19:05:00 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/test/TimerTest.cc

    r1199 r1315  
    2626//
    2727// $Id: TimerTest.cc,v 1.2 2006/06/29 19:05:02 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
  • trunk/source/global/management/test/testPhysicsOrderedFreeVector.cc

    r1199 r1315  
    2626//
    2727// $Id: testPhysicsOrderedFreeVector.cc,v 1.6 2006/06/29 19:05:05 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02-ref-02 $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030#include "globals.hh"
Note: See TracChangeset for help on using the changeset viewer.