Import Geant4 10.6.0.beta source tree
This commit is contained in:
@@ -54,6 +54,10 @@ class G4DataVector : public std::vector<G4double>
|
||||
G4DataVector();
|
||||
// Default constructor.
|
||||
|
||||
G4DataVector(const G4DataVector&) = default;
|
||||
G4DataVector(G4DataVector&&) = default;
|
||||
// Default copy&move constructors.
|
||||
|
||||
explicit G4DataVector(size_t cap);
|
||||
// Constructor given a 'capacity' defining the initial number of elements.
|
||||
|
||||
@@ -64,6 +68,10 @@ class G4DataVector : public std::vector<G4double>
|
||||
virtual ~G4DataVector();
|
||||
// Empty destructor
|
||||
|
||||
G4DataVector& operator=(const G4DataVector &) = default;
|
||||
G4DataVector& operator=(G4DataVector &&) = default;
|
||||
// Default copy&move assignment operators.
|
||||
|
||||
inline void insertAt(size_t, const G4double&);
|
||||
// Insert an element at given position
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//! \file G4GlobalConfig.hh
|
||||
//! \brief Public global preprocessor defines
|
||||
|
||||
#ifndef G4GLOBALCONFIG_HH
|
||||
#define G4GLOBALCONFIG_HH
|
||||
|
||||
//! \def G4MULTITHREADED
|
||||
//! \brief Defined if Geant4 is built with Multithreading support
|
||||
#cmakedefine G4MULTITHREADED
|
||||
|
||||
//! \def G4_STORE_TRAJECTORY
|
||||
//! \brief Defined if Geant4 is built with trajectory storage
|
||||
#cmakedefine G4_STORE_TRAJECTORY
|
||||
|
||||
//! \def G4VERBOSE
|
||||
//! \brief Defined if Geant4 is built with additional verbosity in logging
|
||||
#cmakedefine G4VERBOSE
|
||||
|
||||
//! \def G4USE_STD11
|
||||
//! \brief Defined if the C++11 standard or newer is in use
|
||||
//! \deprecated Geant4 requires C++11 or later, so this should no longer be used
|
||||
#define G4USE_STD11
|
||||
|
||||
//! \def GEANT4_USE_TIMEMORY
|
||||
//! \brief Defined if Geant4 built with TiMemory support
|
||||
#cmakedefine GEANT4_USE_TIMEMORY
|
||||
|
||||
#endif // G4GLOBALCONFIG_HH
|
||||
|
||||
@@ -56,6 +56,8 @@
|
||||
// 16 Aug. 2011 H.Kurashige : Add dBin, baseBin and verboseLevel
|
||||
// 02 Oct. 2013 V.Ivanchenko : FindBinLocation method become inlined;
|
||||
// instead of G4Pow G4Log is used
|
||||
// 15 Mar. 2019 M.Novak : added Value method with the known log-energy value
|
||||
// that can avoid the log call in case of log-vectors
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4PhysicsVector_h
|
||||
@@ -91,6 +93,12 @@ class G4PhysicsVector
|
||||
// the value. Consumer code got changed index and may reuse it
|
||||
// for the next call to save CPU for bin location.
|
||||
|
||||
G4double Value(G4double theEnergy, G4double theLogEnergy,
|
||||
size_t& lastidx) const;
|
||||
// Same as Value() above, with the additional log-kinetic energy input
|
||||
// argument that can be used for faster index computation in case of
|
||||
// log-vectors.
|
||||
|
||||
inline G4double Value(G4double theEnergy) const;
|
||||
// Get the cross-section/energy-loss value corresponding to the
|
||||
// given energy. An appropriate interpolation is used to calculate
|
||||
@@ -98,6 +106,11 @@ class G4PhysicsVector
|
||||
// it should be used instead of the previous method if bin location
|
||||
// cannot be kept thread safe
|
||||
|
||||
inline G4double Value(G4double theEnergy, G4double theLogEnergy) const;
|
||||
// Same as Value() above with the additional log-kinetic energy input
|
||||
// argument that can be used for faster index computation in case of
|
||||
// log-vectors.
|
||||
|
||||
inline G4double GetValue(G4double theEnergy, G4bool& isOutRange) const;
|
||||
// Obsolete method to get value, isOutRange is not used anymore.
|
||||
// This method is kept for the compatibility reason.
|
||||
@@ -150,6 +163,10 @@ class G4PhysicsVector
|
||||
// min value 0, max value VectorLength-1
|
||||
// idx is suggested bin number from user code
|
||||
|
||||
inline size_t FindBin(G4double energy, G4double logener, size_t idx) const;
|
||||
// Same as FindBin() above with the additional logenergy input argument
|
||||
// that can be used for faster index computation in case of log-vectors.
|
||||
|
||||
void FillSecondDerivatives();
|
||||
// Initialise second derivatives for spline keeping
|
||||
// 3d derivative continues - default algorithm
|
||||
@@ -193,6 +210,8 @@ class G4PhysicsVector
|
||||
|
||||
inline void SetVerboseLevel(G4int value);
|
||||
|
||||
inline G4double Interpolation(size_t idx, G4double energy) const;
|
||||
|
||||
protected:
|
||||
|
||||
void DeleteData();
|
||||
@@ -223,12 +242,16 @@ class G4PhysicsVector
|
||||
inline G4double SplineInterpolation(size_t idx, G4double energy) const;
|
||||
// Spline interpolation function
|
||||
|
||||
inline G4double Interpolation(size_t idx, G4double energy) const;
|
||||
|
||||
inline size_t FindBinLocation(G4double theEnergy) const;
|
||||
// find low edge index of a bin for given energy
|
||||
// min value 0, max value VectorLength-1
|
||||
|
||||
inline size_t FindBinLocation(G4double theEnergy,
|
||||
G4double theLogEnergy) const;
|
||||
// same as FindBinLocation() above with the additional log-energy input
|
||||
// argument that can be used for faster index computations in case of
|
||||
// log-vectors.
|
||||
|
||||
G4bool useSpline;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -209,6 +209,27 @@ size_t G4PhysicsVector::FindBinLocation(G4double theEnergy) const
|
||||
return std::min(bin, numberOfNodes-2);
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
inline
|
||||
size_t G4PhysicsVector::FindBinLocation(G4double theEnergy,
|
||||
G4double theLogEnergy) const
|
||||
{
|
||||
size_t bin;
|
||||
const G4double ex = (type==T_G4PhysicsLogVector) ? theLogEnergy : theEnergy;
|
||||
if(type == T_G4PhysicsLogVector || type == T_G4PhysicsLinearVector) {
|
||||
bin = size_t(ex/dBin - baseBin);
|
||||
if(bin > 0 && theEnergy < binVector[bin]) { --bin; }
|
||||
else if(theEnergy > binVector[bin+1]) { ++bin; }
|
||||
} else {
|
||||
// Bin location proposed by K.Genser (FNAL)
|
||||
bin = std::lower_bound(binVector.begin(), binVector.end(), theEnergy)
|
||||
- binVector.begin() - 1;
|
||||
}
|
||||
return std::min(bin, numberOfNodes-2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
inline size_t G4PhysicsVector::FindBin(G4double e, size_t idx) const
|
||||
@@ -227,6 +248,23 @@ inline size_t G4PhysicsVector::FindBin(G4double e, size_t idx) const
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
inline
|
||||
size_t G4PhysicsVector::FindBin(G4double e, G4double loge, size_t idx) const
|
||||
{
|
||||
size_t id = idx;
|
||||
if(e < binVector[1]) {
|
||||
id = 0;
|
||||
} else if(e >= binVector[numberOfNodes-2]) {
|
||||
id = numberOfNodes - 2;
|
||||
} else if(idx >= numberOfNodes || e < binVector[idx]
|
||||
|| e > binVector[idx+1]) {
|
||||
id = FindBinLocation(e, loge);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
inline
|
||||
G4double G4PhysicsVector::Value(G4double theEnergy) const
|
||||
{
|
||||
@@ -234,6 +272,14 @@ inline
|
||||
return Value(theEnergy, idx);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
inline
|
||||
G4double G4PhysicsVector::Value(G4double theEnergy, G4double theLogEnergy) const
|
||||
{
|
||||
size_t idx=0;
|
||||
return Value(theEnergy, theLogEnergy, idx);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
inline
|
||||
|
||||
@@ -69,12 +69,11 @@ public: // with description
|
||||
|
||||
inline G4ReferenceCountedHandle( const G4ReferenceCountedHandle<X>& right );
|
||||
// Copy constructor.
|
||||
|
||||
|
||||
inline ~G4ReferenceCountedHandle();
|
||||
// Destructor.
|
||||
|
||||
inline G4ReferenceCountedHandle<X>&
|
||||
operator =( const G4ReferenceCountedHandle<X>& right );
|
||||
inline G4ReferenceCountedHandle<X>& operator =( const G4ReferenceCountedHandle<X>& right );
|
||||
// Assignment operator by reference.
|
||||
|
||||
inline G4ReferenceCountedHandle<X>& operator =( X* objPtr );
|
||||
|
||||
@@ -71,11 +71,13 @@ public:
|
||||
inline G4String ( const char *, str_size );
|
||||
inline G4String ( const G4String& );
|
||||
inline G4String ( const std::string & );
|
||||
inline G4String ( G4String&& ) = default;
|
||||
~G4String () {}
|
||||
|
||||
inline G4String& operator=(const G4String&);
|
||||
inline G4String& operator=(const std::string &);
|
||||
inline G4String& operator=(const char*);
|
||||
inline G4String& operator=(G4String&&) = default;
|
||||
|
||||
inline char operator () (str_size) const;
|
||||
inline char& operator () (str_size);
|
||||
|
||||
@@ -35,6 +35,11 @@
|
||||
#ifndef g4timemory_hh_
|
||||
#define g4timemory_hh_
|
||||
|
||||
// Fundamental definitions
|
||||
#ifndef G4GMAKE
|
||||
#include "G4GlobalConfig.hh"
|
||||
#endif
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
@@ -32,6 +32,11 @@
|
||||
#ifndef G4TYPES_HH
|
||||
#define G4TYPES_HH
|
||||
|
||||
// Fundamental definitions
|
||||
#ifndef G4GMAKE
|
||||
#include "G4GlobalConfig.hh"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
// Disable warning C4786 on WIN32 architectures:
|
||||
// identifier was truncated to '255' characters
|
||||
|
||||
@@ -39,27 +39,28 @@
|
||||
// - The meaning of each digit is as follows;
|
||||
//
|
||||
// 711
|
||||
// |--> major version number
|
||||
// |--> major version number
|
||||
// |--> minor version number
|
||||
// |--> patch number
|
||||
|
||||
#ifndef G4VERSION_NUMBER
|
||||
#define G4VERSION_NUMBER 1051
|
||||
#define G4VERSION_NUMBER 1060
|
||||
#endif
|
||||
|
||||
#ifndef G4VERSION_TAG
|
||||
#define G4VERSION_TAG "$Name: geant4-10-05-patch-01 $"
|
||||
#define G4VERSION_TAG "$Name: geant4-10-06-beta-01 $"
|
||||
#endif
|
||||
|
||||
// as variables
|
||||
|
||||
#include "G4Types.hh"
|
||||
#include "G4String.hh"
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
static const G4String G4Version = "$Name: geant4-10-05-patch-01 [MT]$";
|
||||
static const G4String G4Version = "$Name: geant4-10-06-beta-01 [MT]$";
|
||||
#else
|
||||
static const G4String G4Version = "$Name: geant4-10-05-patch-01 $";
|
||||
static const G4String G4Version = "$Name: geant4-10-06-beta-01 $";
|
||||
#endif
|
||||
static const G4String G4Date = "(17-April-2019)";
|
||||
static const G4String G4Date = "(28-June-2019)";
|
||||
|
||||
#endif
|
||||
|
||||
@@ -114,6 +114,10 @@ typedef float Float;
|
||||
#define INT_MIN std::numeric_limits<int>::min() // -2147483648
|
||||
#endif
|
||||
|
||||
#ifndef LOG_EKIN_MIN /* Min value of the natural logarithm of kin. energy. */
|
||||
#define LOG_EKIN_MIN -30
|
||||
#endif
|
||||
|
||||
//---------------------------------
|
||||
|
||||
template <class T>
|
||||
|
||||
@@ -28,7 +28,12 @@
|
||||
|
||||
// History:
|
||||
// 01.10.2012 G.Cosmo - Created
|
||||
|
||||
|
||||
// Fundamental definitions
|
||||
#ifndef G4GMAKE
|
||||
#include "G4GlobalConfig.hh"
|
||||
#endif
|
||||
|
||||
#ifndef G4_TLS
|
||||
#define G4_TLS
|
||||
|
||||
@@ -65,7 +70,7 @@
|
||||
#endif
|
||||
#else
|
||||
# define G4ThreadLocalStatic static
|
||||
# define G4ThreadLocal
|
||||
# define G4ThreadLocal
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user