Import Geant4 10.5.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2018-06-29 10:58:11 +02:00
parent fe81a77428
commit 6aa23be517
1581 changed files with 124288 additions and 83758 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ExtrudedSolid.hh 107099 2017-11-02 11:40:23Z gcosmo $
// $Id: G4ExtrudedSolid.hh 108078 2017-12-20 08:15:44Z gcosmo $
//
//
// --------------------------------------------------------------------
@@ -62,7 +62,7 @@
#ifndef G4ExtrudedSolid_HH
#define G4ExtrudedSolid_HH
/*
#if defined(G4GEOM_USE_USOLIDS)
#define G4GEOM_USE_UEXTRUDEDSOLID 1
#endif
@@ -71,7 +71,7 @@
#define G4UExtrudedSolid G4ExtrudedSolid
#include "G4UExtrudedSolid.hh"
#else
*/
#include <vector>
#include "G4TwoVector.hh"
@@ -215,6 +215,6 @@ class G4ExtrudedSolid : public G4TessellatedSolid
#include "G4ExtrudedSolid.icc"
//#endif
#endif
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Hype.hh 106627 2017-10-17 06:23:58Z gcosmo $
// $Id: G4Hype.hh 108078 2017-12-20 08:15:44Z gcosmo $
// $Original: G4Hype.hh,v 1.0 1998/06/09 16:57:50 safai Exp $
//
//
@@ -56,7 +56,7 @@
// --------------------------------------------------------------------
#ifndef G4HYPE_HH
#define G4HYPE_HH
/*
#if defined(G4GEOM_USE_USOLIDS)
#define G4GEOM_USE_UHYPE 1
#endif
@@ -65,7 +65,7 @@
#define G4UHype G4Hype
#include "G4UHype.hh"
#else
*/
#include "G4VSolid.hh"
#include "G4ThreeVector.hh"
#include "G4Polyhedron.hh"
@@ -208,6 +208,6 @@ class G4Hype : public G4VSolid
#include "G4Hype.icc"
//#endif // defined(G4GEOM_USE_UHYPE) && defined(G4GEOM_USE_SYS_USOLIDS)
#endif // defined(G4GEOM_USE_UHYPE) && defined(G4GEOM_USE_SYS_USOLIDS)
#endif // G4HYPE_HH
@@ -50,7 +50,7 @@ class G4SolidsWorkspacePool
// Reuse an existing workspace - or create a new one if needed.
// This will never fail, except if system is out of resources
inline G4SolidsWorkspace* GetWorkspace() { return fMyWorkspace; }
inline G4SolidsWorkspace* GetWorkspace() { return fMyWorkspace(); }
// Give back the existing, active workspace for my thread / task
void Recycle( G4SolidsWorkspace * );
@@ -71,7 +71,7 @@ class G4SolidsWorkspacePool
private:
static G4SolidsWorkspacePool* thePool;
G4GEOM_DLL static G4ThreadLocal G4SolidsWorkspace* fMyWorkspace;
G4GEOM_DLL static G4SolidsWorkspace*& fMyWorkspace();
// The thread's workspace - if assigned.
};
@@ -24,7 +24,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TessellatedSolid.hh 104316 2017-05-24 13:04:23Z gcosmo $
// $Id: G4TessellatedSolid.hh 108151 2018-01-12 09:29:46Z gcosmo $
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
@@ -99,6 +99,15 @@
#ifndef G4TessellatedSolid_hh
#define G4TessellatedSolid_hh 1
#if defined(G4GEOM_USE_USOLIDS)
#define G4GEOM_USE_UTESSELLATEDSOLID 1
#endif
#if defined(G4GEOM_USE_UTESSELLATEDSOLID)
#define G4UTessellatedSolid G4TessellatedSolid
#include "G4UTessellatedSolid.hh"
#else
#include <iostream>
#include <vector>
#include <set>
@@ -327,3 +336,5 @@ inline G4bool G4TessellatedSolid::OutsideOfExtent(const G4ThreeVector &p,
}
#endif
#endif
@@ -35,33 +35,34 @@
//
// Class description:
//
// Wrapper class for G4UExtrudedSolid to make use of it from USolids module.
// Wrapper class for G4ExtrudedSolid to make use of VecGeom ExtrudedSolid.
// History:
// 30.10.13 G.Cosmo, CERN/PH
// 17.11.17 G.Cosmo, CERN
// --------------------------------------------------------------------
#ifndef G4UEXTRUDEDSOLID_hh
#define G4UEXTRUDEDSOLID_hh
#include "G4USolid.hh"
#include "G4UAdapter.hh"
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include "UExtrudedSolid.hh"
#include <volumes/UnplacedExtruded.h>
#include "G4TwoVector.hh"
#include "G4Polyhedron.hh"
class G4UExtrudedSolid : public G4USolid
class G4UExtrudedSolid : public G4UAdapter<vecgeom::UnplacedExtruded>
{
using Shape_t = vecgeom::UnplacedExtruded;
using Base_t = G4UAdapter<vecgeom::UnplacedExtruded>;
public: // without description
struct ZSection
{
ZSection(G4double z, G4TwoVector offset, G4double scale)
: fZ(z), fOffset(offset), fScale(scale) {}
ZSection(const UExtrudedSolid::ZSection& zs)
: fZ(zs.fZ), fOffset(G4TwoVector(zs.fOffset.x,zs.fOffset.y)),
fScale(zs.fScale) {}
G4double fZ;
G4TwoVector fOffset;
@@ -71,21 +72,19 @@ class G4UExtrudedSolid : public G4USolid
public: // with description
G4UExtrudedSolid(const G4String& pName,
std::vector<G4TwoVector> polygon,
std::vector<ZSection> zsections);
std::vector<G4TwoVector> polygon,
std::vector<ZSection> zsections);
// General constructor
G4UExtrudedSolid(const G4String& pName,
std::vector<G4TwoVector> polygon,
G4double halfZ,
G4TwoVector off1, G4double scale1,
G4TwoVector off2, G4double scale2);
std::vector<G4TwoVector> polygon,
G4double halfZ,
G4TwoVector off1, G4double scale1,
G4TwoVector off2, G4double scale2);
// Special constructor for solid with 2 z-sections
~G4UExtrudedSolid();
inline UExtrudedSolid* GetShape() const;
G4int GetNofVertices() const;
G4TwoVector GetVertex(G4int index) const;
std::vector<G4TwoVector> GetPolygon() const;
@@ -119,11 +118,6 @@ class G4UExtrudedSolid : public G4USolid
// Inline methods
// --------------------------------------------------------------------
inline UExtrudedSolid* G4UExtrudedSolid::GetShape() const
{
return (UExtrudedSolid*) fShape;
}
inline G4GeometryType G4UExtrudedSolid::GetEntityType() const
{
return "G4ExtrudedSolid";
@@ -0,0 +1,125 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id:$
//
//
// --------------------------------------------------------------------
// GEANT 4 class header file
//
//
// G4UTesselladedSolid
//
// Class description:
//
// Wrapper class for G4TessellatedSolid to make use of VecGeom TessellatedSolid.
// History:
// 11.01.18 G.Cosmo, CERN
// --------------------------------------------------------------------
#ifndef G4UTESSELLATEDSOLID_hh
#define G4UTESSELLATEDSOLID_hh
#include "G4UAdapter.hh"
#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
#include <volumes/UnplacedTessellated.h>
#include "G4Polyhedron.hh"
class G4VFacet;
class G4UTessellatedSolid : public G4UAdapter<vecgeom::UnplacedTessellated>
{
using Shape_t = vecgeom::UnplacedTessellated;
using Base_t = G4UAdapter<vecgeom::UnplacedTessellated>;
public: // with description
G4UTessellatedSolid();
G4UTessellatedSolid(const G4String& pName);
~G4UTessellatedSolid();
G4bool AddFacet(G4VFacet* aFacet);
G4VFacet* GetFacet(G4int i) const;
G4int GetNumberOfFacets() const;
inline G4GeometryType GetEntityType() const;
void SetSolidClosed(const G4bool t);
G4bool GetSolidClosed() const;
void SetMaxVoxels(G4int);
G4double GetMinXExtent() const;
G4double GetMaxXExtent() const;
G4double GetMinYExtent() const;
G4double GetMaxYExtent() const;
G4double GetMinZExtent() const;
G4double GetMaxZExtent() const;
G4int AllocatedMemoryWithoutVoxels();
G4int AllocatedMemory();
void DisplayAllocatedMemory();
public: // without description
G4UTessellatedSolid(__void__&);
// Fake default constructor for usage restricted to direct object
// persistency for clients requiring preallocation of memory for
// persistifiable objects.
G4UTessellatedSolid( const G4UTessellatedSolid& source );
G4UTessellatedSolid &operator=(const G4UTessellatedSolid& source);
// Copy constructor and assignment operator.
void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const;
G4bool CalculateExtent(const EAxis pAxis,
const G4VoxelLimits& pVoxelLimit,
const G4AffineTransform& pTransform,
G4double& pMin, G4double& pMax) const;
G4Polyhedron* CreatePolyhedron() const;
private:
std::vector<G4VFacet *> fFacets;
std::vector<G4ThreeVector> fVertexList;
};
// --------------------------------------------------------------------
// Inline methods
// --------------------------------------------------------------------
inline G4GeometryType G4UTessellatedSolid::GetEntityType() const
{
return "G4TessellatedSolid";
}
#endif // G4GEOM_USE_USOLIDS
#endif