Import Geant4 10.6.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2019-06-28 11:59:04 +02:00
parent 28a70706e0
commit d0f911957d
1056 changed files with 95168 additions and 78160 deletions
@@ -94,10 +94,12 @@ public: // with description
// Optionally rotate by *rot then translate by tlate - rot may be null
inline G4AffineTransform(const G4AffineTransform& rhs);
// Copy constructor
inline G4AffineTransform(G4AffineTransform&& rhs) = default;
// Copy and move constructors
inline G4AffineTransform& operator=(const G4AffineTransform& rhs);
// Assignment operator
inline G4AffineTransform& operator=(G4AffineTransform&& rhs) = default;
// Assignment & Move operators
inline ~G4AffineTransform();
// Destructor
@@ -0,0 +1,120 @@
//
// ********************************************************************
// * 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 G4GeomConfig.hh
//! \brief Public preprocessor definitions for geometry
#ifndef G4GEOMCONFIG_HH
#define G4GEOMCONFIG_HH
//! \def G4GEOM_USE_USOLIDS
//! \brief Defined if all Geant4 solids use VecGeom implementations
#cmakedefine G4GEOM_USE_USOLIDS
//! \def G4GEOM_USE_PARTIAL_USOLIDS
//! \brief Defined if selected Geant4 solids use VecGeom implementations
#cmakedefine G4GEOM_USE_PARTIAL_USOLIDS
#ifdef G4GEOM_USE_PARTIAL_USOLIDS
//! \def G4GEOM_USE_UBOX
//! \brief Defined if G4Box is replaced with VecGeom UnplacedBox
#cmakedefine G4GEOM_USE_UBOX
//! \def G4GEOM_USE_UCONS
//! \brief Defined if G4Cons is replaced with VecGeom GenericUnplacedCone
#cmakedefine G4GEOM_USE_UCONS
//! \def G4GEOM_USE_UCTUBS
//! \brief Defined if G4CutTubs is replaced with VecGeom UnplacedCutTube
#cmakedefine G4GEOM_USE_UCTUBS
//! \def G4GEOM_USE_UEXTRUDEDSOLID
//! \brief Defined if G4ExtrudedSolid is replaced with VecGeom UnplacedExtruded
#cmakedefine G4GEOM_USE_UEXTRUDEDSOLID
//! \def G4GEOM_USE_UHYPE
//! \brief Defined if G4Hype is replaced with VecGeom GenericUnplacedHype
#cmakedefine G4GEOM_USE_UHYPE
//! \def G4GEOM_USE_UGENERICPOLYCONE
//! \brief Defined if G4GenericPolycone is replaced with VecGeom UnplacedGenericPolycone
#cmakedefine G4GEOM_USE_UGENERICPOLYCONE
//! \def G4GEOM_USE_UGENERICTRAP
//! \brief Defined if G4GenericTrap is replaced with VecGeom UnplacedGenTrap
#cmakedefine G4GEOM_USE_UGENERICTRAP
//! \def G4GEOM_USE_UORB
//! \brief Defined if G4Orb is replaced with VecGeom UnplacedOrb
#cmakedefine G4GEOM_USE_UORB
//! \def G4GEOM_USE_UPARA
//! \brief Defined if G4Para is replaced with VecGeom UnplacedParallelepiped
#cmakedefine G4GEOM_USE_UPARA
//! \def G4GEOM_USE_UPARABOLOID
//! \brief Defined if G4Paraboloid is replaced with VecGeom UnplacedParaboloid
#cmakedefine G4GEOM_USE_UPARABOLOID
//! \def G4GEOM_USE_UPOLYCONE
//! \brief Defined if G4Polycone is replaced with VecGeom GenericUnplacedPolycone
#cmakedefine G4GEOM_USE_UPOLYCONE
//! \def G4GEOM_USE_UPOLYHEDRA
//! \brief Defined if G4Polyhedra is replaced with VecGeom UnplacedPolyhedron
#cmakedefine G4GEOM_USE_UPOLYHEDRA
//! \def G4GEOM_USE_USPHERE
//! \brief Defined if G4Box is replaced with VecGeom UnplacedSphere
#cmakedefine G4GEOM_USE_USPHERE
//! \def G4GEOM_USE_UTESSELLATEDSOLID
//! \brief Defined if G4TessellatedSolid is replaced with VecGeom UnplacedTessellated
#cmakedefine G4GEOM_USE_UTESSELLATEDSOLID
//! \def G4GEOM_USE_UTET
//! \brief Defined if G4Tet is replaced with VecGeom UnplacedTet
#cmakedefine G4GEOM_USE_UTET
//! \def G4GEOM_USE_UTRAP
//! \brief Defined if G4Trap is replaced with VecGeom UnplacedTrapezoid
#cmakedefine G4GEOM_USE_UTRAP
//! \def G4GEOM_USE_UTRD
//! \brief Defined if G4Trd is replaced with VecGeom GenericUnplacedTrd
#cmakedefine G4GEOM_USE_UTRD
//! \def G4GEOM_USE_UTORUS
//! \brief Defined if G4Torus is replaced with VecGeom UnplacedTorus2
#cmakedefine G4GEOM_USE_UTORUS
//! \def G4GEOM_USE_UTUBS
//! \brief Defined if G4Tubs is replaced with VecGeom GenericUnplacedTube
#cmakedefine G4GEOM_USE_UTUBS
#endif // G4GEOM_USE_PARTIAL_USOLIDS
#endif // G4GEOMCONFIG_HH
@@ -43,7 +43,6 @@
#include "globals.hh"
#include "geomwdefs.hh"
#include "G4AutoLock.hh"
#include "G4Allocator.hh"
template <class T> // T is the private data from the object to be split
class G4GeomSplitter
@@ -56,33 +55,10 @@ class G4GeomSplitter
G4MUTEXINIT(mutex);
}
void *operator new(size_t)
// Override "new" for "G4Allocator"
{
if (!anOffsetAllocator) anOffsetAllocator = new G4Allocator<T>;
return (void *) anOffsetAllocator->MallocSingle();
}
void operator delete(void *anOffset)
// Override "delete" for "G4Allocator".
{
anOffsetAllocator->FreeSingle((T*) anOffset);
}
T* Reallocate(G4int size)
{
T* noffset = new T[size];
if (offset)
{
for (G4int i=0; i<totalspace; ++i)
{
noffset[i] = offset[i];
}
delete [] offset;
}
totalspace = size;
return noffset;
return (T *) std::realloc(offset, totalspace * sizeof(T));
}
G4int CreateSubInstance()
@@ -107,10 +83,7 @@ class G4GeomSplitter
void CopyMasterContents()
{
G4AutoLock l(&mutex);
for (G4int i=0; i<totalspace; ++i)
{
offset[i] = sharedOffset[i];
}
std::memcpy(offset, sharedOffset, totalspace * sizeof(T));
}
void SlaveCopySubInstanceArray()
@@ -170,7 +143,7 @@ class G4GeomSplitter
// Invoked by all threads to free the subinstance array.
{
if (!offset) { return; }
delete [] offset;
std::free( offset );
offset = 0;
}
@@ -202,7 +175,6 @@ class G4GeomSplitter
public:
G4GEOM_DLL static G4ThreadLocal T* offset;
G4GEOM_DLL static G4ThreadLocal G4Allocator<T>* anOffsetAllocator;
private:
@@ -212,9 +184,6 @@ class G4GeomSplitter
G4Mutex mutex;
};
template <typename T> G4ThreadLocal
T* G4GeomSplitter<T>::offset = 0;
template <typename T> G4ThreadLocal
G4Allocator<T>* G4GeomSplitter<T>::anOffsetAllocator = 0;
template <typename T> G4ThreadLocal T* G4GeomSplitter<T>::offset = 0;
#endif
@@ -0,0 +1,37 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// GEANT4 geomtetry/solid types
//
#ifndef G4GEOMTYPES_HH
#define G4GEOMTYPES_HH
// Fundamental definitions
#ifndef G4GMAKE
#include "G4GeomConfig.hh"
#endif
#endif /* G4GEOMTYPES_HH */
@@ -41,7 +41,6 @@
#define G4SmartVoxelStat_hh
#include "G4Types.hh"
#include <functional>
class G4LogicalVolume;
class G4SmartVoxelHeader;
@@ -97,32 +96,7 @@ class G4SmartVoxelStat
G4long heads;
G4long nodes;
G4long pointers;
public:
//
// Functor objects for sorting
//
struct ByCpu
: public std::binary_function< const G4SmartVoxelStat,
const G4SmartVoxelStat, G4bool >
{
G4bool operator()( const G4SmartVoxelStat &a, const G4SmartVoxelStat &b )
{
return a.GetTotalTime() > b.GetTotalTime();
}
};
struct ByMemory
: public std::binary_function< const G4SmartVoxelStat,
const G4SmartVoxelStat, G4bool >
{
G4bool operator()( const G4SmartVoxelStat &a, const G4SmartVoxelStat &b )
{
return a.GetMemoryUse() > b.GetMemoryUse();
}
};
};
#endif
@@ -25,12 +25,12 @@
//
//
//
//
//
// class G4UAdapter
//
// Class description:
//
// Utility class for adapting VecGeom solids API to Geant4 solids.
// Utility class for adapting VecGeom solids API to Geant4 solids.
// NOTE: Using protected inheritance since the Adapter is supposed to
// be a G4VSolid "implemented-in-terms-of" the VecGeom UnplacedVolume_t.
// The choice of protected vs private is due to the fact that we want
@@ -56,6 +56,8 @@
#include "G4BoundingEnvelope.hh"
#include "G4AutoLock.hh"
#include "G4GeomTypes.hh"
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <base/Global.h>
@@ -64,15 +64,17 @@ class G4PVData
// and must have a per-thread state.
public:
G4PVData():frot(0) {}
void initialize() {
G4PVData() : frot(0) {}
void initialize()
{
frot = 0;
ftrans = G4ThreeVector(0,0,0);
tx = 0.; ty = 0.; tz = 0.;
}
G4RotationMatrix *frot;
G4ThreeVector ftrans;
G4double tx = 0., ty = 0., tz = 0.;
};
typedef G4GeomSplitter<G4PVData> G4PVManager;
@@ -124,7 +126,7 @@ class G4VPhysicalVolume
// Older access functions, that do not distinguish between frame/object!
const G4ThreeVector& GetTranslation() const;
const G4ThreeVector GetTranslation() const;
const G4RotationMatrix* GetRotation() const;
// Old access functions, that do not distinguish between frame/object!
// They return the translation/rotation of the volume.