Import Geant4 11.1.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2022-07-01 10:44:02 +02:00
parent b3bf75a2a1
commit c07cea1fe0
2172 changed files with 183300 additions and 123938 deletions
@@ -1,74 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// John Allison 7th June 1997
// An artificial scene to reuse G4VScene code to calculate a bounding sphere.
#ifndef G4BOUNDINGSPHERESCENE_HH
#define G4BOUNDINGSPHERESCENE_HH
#include "G4PseudoScene.hh"
#include "G4VisExtent.hh"
class G4VModel;
class G4BoundingSphereScene: public G4PseudoScene {
public:
G4BoundingSphereScene (G4VModel* pModel = 0);
virtual ~G4BoundingSphereScene ();
G4VisExtent GetBoundingSphereExtent ();
const G4Point3D& GetCentre() const {return fCentre;}
G4double GetRadius() const {return fRadius;}
void SetCentre(const G4Point3D& centre) {fCentre = centre;}
////////////////////////////////////////////////////////////////
// The following 2 functions can be used by any code which wishes to
// accrue a bounding sphere. Just instantiate a
// G4BoundingSphereScene and use AccrueBoundingSphere.
void ResetBoundingSphere ();
void AccrueBoundingSphere (const G4Point3D& centre,
G4double radius);
private:
void ProcessVolume (const G4VSolid& solid);
G4VModel* fpModel; // Instantiating code may optionally set this.
G4Point3D fCentre;
G4double fRadius;
};
#endif
+29 -12
View File
@@ -40,35 +40,52 @@
#define G4MESH_HH
#include "G4Transform3D.hh"
#include "geomdefs.hh"
class G4VPhysicalVolume;
class G4Mesh
{
public: // With description
enum MeshType
{
invalid,
rectangle,
cylinder,
sphere
public:
enum MeshType {
invalid
, rectangle
, nested3DRectangular
, cylinder
, sphere
, tetrahedron
};
struct ThreeDRectangleParameters {
EAxis fAxis1 = kUndefined, fAxis2 = kUndefined, fAxis3 = kUndefined;
G4int fNreplica1 = 0, fNreplica2 = 0, fNreplica3 = 0;
G4double fOffset1 = 0., fOffset2 = 0., fOffset3 = 0.;
G4double fWidth1 = 0., fWidth2 = 0., fWidth3 = 0.;
G4bool fConsuming1 = false, fConsuming2 = false, fConsuming3 = false;
G4double fHalfX = 0., fHalfY = 0., fHalfZ = 0.;
};
G4Mesh(G4VPhysicalVolume* containerVolume, const G4Transform3D&);
virtual ~G4Mesh();
const std::map<G4int,G4String>& GetEnumMap() const { return fEnumMap; }
G4VPhysicalVolume* GetContainerVolume() const { return fpContainerVolume; }
MeshType GetMeshType() const { return fMeshType; }
G4int GetMeshDepth() const { return fMeshDepth; }
const G4Transform3D& GetTransform() const { return fTransform; }
const std::map<G4int,G4String>& GetEnumMap() const {return fEnumMap;}
G4VPhysicalVolume* GetContainerVolume() const {return fpContainerVolume;}
G4VPhysicalVolume* GetParameterisedVolume() const {return fpParameterisedVolume;}
MeshType GetMeshType() const {return fMeshType;}
G4int GetMeshDepth() const {return fMeshDepth;}
const G4Transform3D& GetTransform() const {return fTransform;}
const ThreeDRectangleParameters& GetThreeDRectParameters() const {return f3DRPs;}
private:
static std::map<G4int,G4String> fEnumMap;
G4VPhysicalVolume* fpContainerVolume;
G4VPhysicalVolume* fpParameterisedVolume;
MeshType fMeshType;
G4int fMeshDepth;
G4Transform3D fTransform;
ThreeDRectangleParameters f3DRPs;
};
std::ostream& operator << (std::ostream& os, const G4Mesh& mesh);
@@ -102,12 +102,16 @@ public: // With description
fTransform(transform),
fDrawn(drawn) {}
G4VPhysicalVolume* GetPhysicalVolume() const {return fpPV;}
G4int GetCopyNo() const {return fCopyNo;}
G4int GetNonCulledDepth() const {return fNonCulledDepth;}
const G4Transform3D& GetTransform() const {return fTransform;}
G4bool GetDrawn() const {return fDrawn;}
void SetDrawn(G4bool drawn) {fDrawn = drawn;}
G4bool operator< (const G4PhysicalVolumeNodeID& right) const;
G4int GetCopyNo() const {return fCopyNo;}
G4int GetNonCulledDepth() const {return fNonCulledDepth;}
const G4Transform3D& GetTransform() const {return fTransform;}
G4bool GetDrawn() const {return fDrawn;}
void SetPhysicalVolume(G4VPhysicalVolume* v) {fpPV = v;}
void SetCopyNo (G4int n) {fCopyNo = n;}
void SetNonCulledDepth(G4int d) {fNonCulledDepth = d;}
void SetTransform (const G4Transform3D& t) {fTransform = t;}
void SetDrawn (G4bool b) {fDrawn = b;}
G4bool operator< (const G4PhysicalVolumeNodeID& right) const;
G4bool operator!= (const G4PhysicalVolumeNodeID& right) const;
G4bool operator== (const G4PhysicalVolumeNodeID& right) const {
return !operator!= (right);
@@ -143,6 +147,7 @@ public: // With description
G4int fCopyNo;
G4Transform3D fTouchableGlobalTransform;
std::vector<G4PhysicalVolumeNodeID> fTouchableBaseFullPVPath;
std::vector<G4PhysicalVolumeNodeID> fTouchableFullPVPath;
};
G4PhysicalVolumeModel
@@ -1,80 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
//
// John Allison 10th August 1998.
// An artificial scene to find physical volumes.
#ifndef G4PHYSICALVOLUMESEARCHSCENE_HH
#define G4PHYSICALVOLUMESEARCHSCENE_HH
#include "G4PseudoScene.hh"
#include "G4VisExtent.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
#include "G4PhysicalVolumeModel.hh"
class G4PhysicalVolumeSearchScene: public G4PseudoScene {
public:
G4PhysicalVolumeSearchScene
(G4PhysicalVolumeModel*,
const G4String& requiredPhysicalVolumeName,
G4int requiredCopyNo,
G4int verbosity = 99);
virtual ~G4PhysicalVolumeSearchScene ();
const std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>&
GetFoundFullPVPath() const
{return fFoundFullPVPath;}
G4int GetFoundDepth() const {return fFoundDepth;}
G4VPhysicalVolume* GetFoundVolume() const {return fpFoundPV;}
const G4Transform3D& GetFoundTransformation () const
{return fFoundObjectTransformation;}
private:
void ProcessVolume(const G4VSolid&);
const G4PhysicalVolumeModel* fpPVModel;
G4String fRequiredPhysicalVolumeName;
G4int fRequiredCopyNo;
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
fFoundFullPVPath; // Found full path.
G4int fFoundDepth; // Found depth.
G4VPhysicalVolume* fpFoundPV; // Found physical volume.
G4Transform3D fFoundObjectTransformation; // Found transformation.
G4int fVerbosity;
G4bool fMultipleOccurrence;
};
#endif
@@ -26,13 +26,14 @@
//
//
//
// John Allison 5th September 2018, based on G4PhysicalVolumeSearchScene
// An artificial scene to find physical volumes. Instead of returning the
// first occurrence (G4PhysicalVolumeSearchScene) this class (note the extra
// 's' in the name of this class) returns a vector of all occurrences.
// It can match a physical volume name with the required match. The latter can
// be of the form "/regexp/", where regexp is a regular expression (see C++
// regex), or a plain string, in which case there must be an exact match.
// John Allison 5th September 2018
// Originally G4PhysicalVolumeSearchScene, 10th August 1998, which only
// found the first occurrence of a volume.
// This class (note the extra 's' in the name) produces a vector of all
// occurrences. It can match a physical volume name with the required
// match. The latter can be of the form "/regexp/", where regexp is a
// regular expression (see C++ regex), or a plain string, in which case
// there must be an exact match.
#ifndef G4PHYSICALVOLUMESSEARCHSCENE_HH
#define G4PHYSICALVOLUMESSEARCHSCENE_HH
@@ -49,9 +50,7 @@ public:
G4PhysicalVolumesSearchScene
(G4PhysicalVolumeModel* pSearchVolumeModel, // usually a world
const G4String& requiredPhysicalVolumeName,
G4int requiredCopyNo = -1, // -1 means any copy no
// Don't continue beyond requiredContinuation once found
G4int requiredContinuation = G4PhysicalVolumeModel::UNLIMITED);
G4int requiredCopyNo = -1); // -1 means any copy no
virtual ~G4PhysicalVolumesSearchScene () {}
@@ -65,12 +64,16 @@ public:
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
foundBasePVPath =
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>(),
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
foundFullPVPath =
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>(),
G4Transform3D foundObjectTransformation = G4Transform3D())
: fpSearchPV(pSearchPV)
, fpFoundPV(pFoundPV)
, fFoundPVCopyNo(foundPVCopyNo)
, fFoundDepth(foundDepth)
, fFoundBasePVPath(foundBasePVPath)
, fFoundFullPVPath(foundFullPVPath)
, fFoundObjectTransformation(foundObjectTransformation) {}
Findings(const G4PhysicalVolumeModel::TouchableProperties& tp)
: fpSearchPV(nullptr)
@@ -78,6 +81,7 @@ public:
, fFoundPVCopyNo(tp.fCopyNo)
, fFoundDepth(0)
, fFoundBasePVPath(tp.fTouchableBaseFullPVPath)
, fFoundFullPVPath(tp.fTouchableFullPVPath)
, fFoundObjectTransformation(tp.fTouchableGlobalTransform) {}
G4VPhysicalVolume* fpSearchPV; // Searched physical volume.
G4VPhysicalVolume* fpFoundPV; // Found physical volume.
@@ -85,6 +89,8 @@ public:
G4int fFoundDepth; // Found depth.
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
fFoundBasePVPath; // Base path (e.g., empty for world volume)
std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
fFoundFullPVPath; // Full path of found volume
G4Transform3D fFoundObjectTransformation; // Found transformation.
};
@@ -110,7 +116,6 @@ private:
const G4PhysicalVolumeModel* fpSearchVolumesModel;
Matcher fMatcher;
G4int fRequiredCopyNo;
G4int fRequiredContinuation;
std::vector<Findings> fFindings;
};
@@ -80,7 +80,7 @@ public:
void AddCompound (const G4VDigi&) {}
void AddCompound (const G4THitsMap<G4double>&) {}
void AddCompound (const G4THitsMap<G4StatDouble>&) {}
void AddCompound (const G4Mesh&) {}
void AddCompound (const G4Mesh&); // Catches mesh if special mesh rendering set
// Primitives
void BeginPrimitives (const G4Transform3D&) {}
void EndPrimitives () {}