Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// class G4AssemblyStore
|
||||
//
|
||||
// Class description:
|
||||
@@ -72,7 +71,7 @@ class G4AssemblyStore : public std::vector<G4AssemblyVolume*>
|
||||
static void Clean();
|
||||
// Delete all assemblies from the store.
|
||||
|
||||
G4AssemblyVolume* GetAssembly(unsigned int Id, G4bool verbose=true) const;
|
||||
G4AssemblyVolume* GetAssembly(unsigned int id, G4bool verbose=true) const;
|
||||
// Returns an assembly through its Id number specification.
|
||||
|
||||
protected:
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// Class G4AssemblyTriplet
|
||||
//
|
||||
// Class description:
|
||||
@@ -39,13 +36,9 @@
|
||||
// The pointer to the logical or assembly volume is copied so this class
|
||||
// does not take its ownership and does not delete the object behind.
|
||||
|
||||
// Author: Radovan Chytracek
|
||||
// Version: 1.0
|
||||
// Date: November 2000
|
||||
//
|
||||
// History:
|
||||
// March 2006, I.Hrivnacova - Extended to support assembly of assemblies
|
||||
// of volumes and reflections
|
||||
// Radovan Chytracek: created - November 2000
|
||||
// Ivana Hrivnacova: extended to support assembly of assemblies
|
||||
// of volumes and reflections, March 2006
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4_ASSEMBLYTRIPLET_H
|
||||
#define G4_ASSEMBLYTRIPLET_H
|
||||
@@ -66,13 +59,13 @@ class G4AssemblyTriplet
|
||||
G4AssemblyTriplet( G4LogicalVolume* pVolume,
|
||||
G4ThreeVector& translation,
|
||||
G4RotationMatrix* pRotation,
|
||||
G4bool isReflection = false);
|
||||
G4bool isReflection = false );
|
||||
// An explicit constructor for a logical volume
|
||||
|
||||
G4AssemblyTriplet( G4AssemblyVolume* pAssembly,
|
||||
G4ThreeVector& translation,
|
||||
G4RotationMatrix* pRotation,
|
||||
G4bool isReflection = false);
|
||||
G4bool isReflection = false );
|
||||
// An explicit constructor for an assembly volume
|
||||
|
||||
G4AssemblyTriplet( const G4AssemblyTriplet& second );
|
||||
@@ -113,23 +106,23 @@ class G4AssemblyTriplet
|
||||
|
||||
private:
|
||||
|
||||
G4LogicalVolume* fVolume;
|
||||
G4LogicalVolume* fVolume = nullptr;
|
||||
// A logical volume
|
||||
|
||||
G4ThreeVector fTranslation;
|
||||
// A logical volume translation
|
||||
|
||||
G4RotationMatrix* fRotation;
|
||||
G4RotationMatrix* fRotation = nullptr;
|
||||
// A logical volume rotation
|
||||
|
||||
private:
|
||||
|
||||
// Member data for handling assemblies of assemblies and reflections
|
||||
|
||||
G4AssemblyVolume* fAssembly;
|
||||
G4AssemblyVolume* fAssembly = nullptr;
|
||||
// An assembly volume
|
||||
|
||||
G4bool fIsReflection;
|
||||
G4bool fIsReflection = false;
|
||||
// True if the logical or assembly volume has reflection
|
||||
};
|
||||
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// Class G4AssemblyTriplet - inline implementation
|
||||
//
|
||||
@@ -32,7 +29,6 @@
|
||||
|
||||
inline
|
||||
G4AssemblyTriplet::G4AssemblyTriplet()
|
||||
: fVolume( 0 ), fRotation( 0 ), fAssembly(0), fIsReflection(false)
|
||||
{
|
||||
G4ThreeVector v(0.,0.,0.);
|
||||
fTranslation = v;
|
||||
@@ -44,7 +40,7 @@ G4AssemblyTriplet::G4AssemblyTriplet( G4LogicalVolume* pVolume,
|
||||
G4RotationMatrix* pRotation,
|
||||
G4bool isReflection )
|
||||
: fVolume( pVolume ), fTranslation( translation ), fRotation( pRotation ),
|
||||
fAssembly( 0 ), fIsReflection(isReflection)
|
||||
fIsReflection(isReflection)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -53,7 +49,7 @@ G4AssemblyTriplet::G4AssemblyTriplet( G4AssemblyVolume* pAssembly,
|
||||
G4ThreeVector& translation,
|
||||
G4RotationMatrix* pRotation,
|
||||
G4bool isReflection )
|
||||
: fVolume( 0 ), fTranslation( translation ), fRotation( pRotation ),
|
||||
: fTranslation( translation ), fRotation( pRotation ),
|
||||
fAssembly( pAssembly ), fIsReflection(isReflection)
|
||||
{
|
||||
}
|
||||
@@ -82,14 +78,14 @@ G4LogicalVolume* G4AssemblyTriplet::GetVolume() const
|
||||
inline
|
||||
void G4AssemblyTriplet::SetVolume( G4LogicalVolume* pVolume )
|
||||
{
|
||||
if ( fAssembly )
|
||||
if ( fAssembly != nullptr )
|
||||
{
|
||||
G4Exception("G4AssemblyTriplet::SetVolume()",
|
||||
"GeomVol1001", JustWarning,
|
||||
"There is an assembly already set, it will be ignored.");
|
||||
}
|
||||
fVolume = pVolume;
|
||||
fAssembly = 0;
|
||||
fAssembly = nullptr;
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -101,14 +97,14 @@ G4AssemblyVolume* G4AssemblyTriplet::GetAssembly() const
|
||||
inline
|
||||
void G4AssemblyTriplet::SetAssembly( G4AssemblyVolume* pAssembly )
|
||||
{
|
||||
if ( fVolume )
|
||||
if ( fVolume != nullptr )
|
||||
{
|
||||
G4Exception("G4AssemblyTriplet::SetAssembly()",
|
||||
"GeomVol1001", JustWarning,
|
||||
"There is a volume already set, it will be ignored.");
|
||||
}
|
||||
fAssembly = pAssembly;
|
||||
fVolume = 0;
|
||||
fVolume = nullptr;
|
||||
}
|
||||
|
||||
inline
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// Class G4AssemblyVolume
|
||||
//
|
||||
// Class description:
|
||||
@@ -39,12 +36,9 @@
|
||||
// when placement is done. They are seen as independent physical volumes in
|
||||
// space.
|
||||
|
||||
// Author: Radovan Chytracek, John Apostolakis, Gabriele Cosmo
|
||||
// Date: November 2000
|
||||
//
|
||||
// History:
|
||||
// March 2006, I.Hrivnacova - Extended to support assembly of assemblies
|
||||
// of volumes and reflections
|
||||
// Radovan Chytracek, John Apostolakis, Gabriele Cosmo: created - November 2000
|
||||
// Ivana Hrivnacova: extended to support assembly of assemblies
|
||||
// of volumes and reflections - March 2006
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4_ASSEMBLYVOLUME_H
|
||||
#define G4_ASSEMBLYVOLUME_H
|
||||
@@ -70,10 +64,10 @@ class G4AssemblyVolume
|
||||
// At destruction all the generated physical volumes and associated
|
||||
// rotation matrices of the imprints will be destroyed.
|
||||
//
|
||||
// The rotation matrix passed as argument can be 0 (identity) or an address
|
||||
// even of an object on the upper stack frame. During assembly imprint, a
|
||||
// new matrix is created anyway and it is kept track of it so it can be
|
||||
// automatically deleted later at the end of the application.
|
||||
// The rotation matrix passed as argument can be nullptr (identity) or an
|
||||
// address even of an object on the upper stack frame. During assembly
|
||||
// imprint, a new matrix is created anyway and it is kept track of it so
|
||||
// it can be automatically deleted later at the end of the application.
|
||||
// This policy is adopted since user has no control on the way the
|
||||
// rotations are combined.
|
||||
|
||||
@@ -102,10 +96,10 @@ class G4AssemblyVolume
|
||||
// Every next volume being added into the assembly will be placed
|
||||
// w.r.t to the previous one.
|
||||
//
|
||||
// The rotation matrix passed as argument can be 0 (identity) or an address
|
||||
// even of an object on the upper stack frame. During assembly imprint, a
|
||||
// new matrix is created anyway and it is kept track of it so it can be
|
||||
// automatically deleted later at the end of the application.
|
||||
// The rotation matrix passed as argument can be nullptr (identity) or an
|
||||
// address even of an object on the upper stack frame. During assembly
|
||||
// imprint, a new matrix is created anyway and it is kept track of it so
|
||||
// it can be automatically deleted later at the end of the application.
|
||||
// This policy is adopted since user has no control on the way the
|
||||
// rotations are combined.
|
||||
|
||||
@@ -145,18 +139,18 @@ class G4AssemblyVolume
|
||||
// transformation in space as its argument.
|
||||
|
||||
inline std::vector<G4VPhysicalVolume*>::iterator GetVolumesIterator();
|
||||
inline unsigned int TotalImprintedVolumes() const;
|
||||
inline std::size_t TotalImprintedVolumes() const;
|
||||
//
|
||||
// Methods to access the physical volumes imprinted with the assembly.
|
||||
inline G4Transform3D& GetImprintTransformation(unsigned int imprintID);
|
||||
// Method to access transformation for each imprint
|
||||
|
||||
inline std::vector<G4AssemblyTriplet>::iterator GetTripletsIterator();
|
||||
inline unsigned int TotalTriplets() const;
|
||||
inline std::size_t TotalTriplets() const;
|
||||
//
|
||||
// Methods to access the triplets which are part of the assembly
|
||||
|
||||
unsigned int GetImprintsCount() const;
|
||||
inline unsigned int GetImprintsCount() const;
|
||||
//
|
||||
// Return the number of made imprints.
|
||||
|
||||
@@ -164,21 +158,21 @@ class G4AssemblyVolume
|
||||
//
|
||||
// Return the number of existing instance of G4AssemblyVolume class.
|
||||
|
||||
unsigned int GetAssemblyID() const;
|
||||
inline unsigned int GetAssemblyID() const;
|
||||
//
|
||||
// Return instance number of this concrete object.
|
||||
|
||||
protected:
|
||||
|
||||
void SetInstanceCount( unsigned int value );
|
||||
void SetAssemblyID( unsigned int value );
|
||||
inline void SetInstanceCount( unsigned int value );
|
||||
inline void SetAssemblyID( unsigned int value );
|
||||
|
||||
void InstanceCountPlus();
|
||||
void InstanceCountMinus();
|
||||
|
||||
void SetImprintsCount( unsigned int value );
|
||||
void ImprintsCountPlus();
|
||||
void ImprintsCountMinus();
|
||||
inline void SetImprintsCount( unsigned int value );
|
||||
inline void ImprintsCountPlus();
|
||||
inline void ImprintsCountMinus();
|
||||
//
|
||||
// Internal counting mechanism, used to compute unique the names of
|
||||
// physical volumes created by MakeImprint() methods.
|
||||
@@ -220,7 +214,7 @@ class G4AssemblyVolume
|
||||
//
|
||||
// Class instance counter.
|
||||
|
||||
unsigned int fAssemblyID;
|
||||
unsigned int fAssemblyID = 0;
|
||||
//
|
||||
// Assembly object ID derived from instance counter at construction time.
|
||||
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// Class G4AssemblyVolume - inline implementation
|
||||
//
|
||||
@@ -42,17 +39,16 @@ void G4AssemblyVolume::SetImprintsCount( unsigned int value )
|
||||
fImprintsCounter = value;
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void G4AssemblyVolume::ImprintsCountPlus()
|
||||
{
|
||||
fImprintsCounter++;
|
||||
++fImprintsCounter;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4AssemblyVolume::ImprintsCountMinus()
|
||||
{
|
||||
fImprintsCounter--;
|
||||
--fImprintsCounter;
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -67,35 +63,34 @@ void G4AssemblyVolume::SetAssemblyID( unsigned int value )
|
||||
fAssemblyID = value;
|
||||
}
|
||||
|
||||
inline
|
||||
std::vector<G4VPhysicalVolume*>::iterator
|
||||
G4AssemblyVolume::GetVolumesIterator()
|
||||
inline std::vector<G4VPhysicalVolume*>::iterator
|
||||
G4AssemblyVolume::GetVolumesIterator()
|
||||
{
|
||||
std::vector<G4VPhysicalVolume*>::iterator iterator = fPVStore.begin();
|
||||
return iterator;
|
||||
}
|
||||
|
||||
inline
|
||||
unsigned int G4AssemblyVolume::TotalImprintedVolumes() const
|
||||
std::size_t G4AssemblyVolume::TotalImprintedVolumes() const
|
||||
{
|
||||
return fPVStore.size();
|
||||
}
|
||||
|
||||
inline
|
||||
G4Transform3D& G4AssemblyVolume::GetImprintTransformation(unsigned int imprintID)
|
||||
inline G4Transform3D&
|
||||
G4AssemblyVolume::GetImprintTransformation(unsigned int imprintID)
|
||||
{
|
||||
return fImprintsTransf[imprintID];
|
||||
}
|
||||
inline
|
||||
std::vector<G4AssemblyTriplet>::iterator
|
||||
G4AssemblyVolume::GetTripletsIterator()
|
||||
|
||||
inline std::vector<G4AssemblyTriplet>::iterator
|
||||
G4AssemblyVolume::GetTripletsIterator()
|
||||
{
|
||||
std::vector<G4AssemblyTriplet>::iterator iterator = fTriplets.begin();
|
||||
return iterator;
|
||||
}
|
||||
|
||||
inline
|
||||
unsigned int G4AssemblyVolume::TotalTriplets() const
|
||||
std::size_t G4AssemblyVolume::TotalTriplets() const
|
||||
{
|
||||
return fTriplets.size();
|
||||
}
|
||||
|
||||
@@ -23,12 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// A class for fast allocation of STL vectors through a static pool.
|
||||
@@ -45,8 +39,6 @@
|
||||
|
||||
#include "G4Types.hh"
|
||||
|
||||
// #include <cstdlib>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
G4int isAllocated;
|
||||
@@ -118,7 +110,7 @@ void G4EnhancedVecAllocator<_Tp>::deallocate(_Tp* _Ptr, size_t _Count)
|
||||
G4int found = -1;
|
||||
if (G4AllocStats::allocStat != 0)
|
||||
{
|
||||
for (G4int j = 0 ; j < G4AllocStats::numCat ; j++)
|
||||
for (auto j = 0 ; j < G4AllocStats::numCat ; ++j)
|
||||
{
|
||||
if (G4AllocStats::allocStat[j].size == (_Count * sizeof(_Tp)))
|
||||
{
|
||||
@@ -131,7 +123,7 @@ void G4EnhancedVecAllocator<_Tp>::deallocate(_Tp* _Ptr, size_t _Count)
|
||||
|
||||
G4ChunkIndexType& chunk = G4AllocStats::allocStat[found];
|
||||
|
||||
for (G4int k = 0; k < chunk.totalspace; k++)
|
||||
for (auto k = 0; k < chunk.totalspace; ++k)
|
||||
{
|
||||
if ( (chunk.preAllocated[k]).address == ((char *) _Ptr))
|
||||
{
|
||||
@@ -159,7 +151,7 @@ _Tp* G4EnhancedVecAllocator<_Tp>::allocate(size_t _Count)
|
||||
G4int found = -1;
|
||||
if (G4AllocStats::allocStat != 0)
|
||||
{
|
||||
for (G4int j = 0 ; j < G4AllocStats::numCat ; j++)
|
||||
for (auto j = 0 ; j < G4AllocStats::numCat ; ++j)
|
||||
{
|
||||
if (G4AllocStats::allocStat[j].size == totalsize)
|
||||
{
|
||||
@@ -171,7 +163,7 @@ _Tp* G4EnhancedVecAllocator<_Tp>::allocate(size_t _Count)
|
||||
|
||||
if (found == -1) // Find the new size
|
||||
{
|
||||
G4AllocStats::numCat++;
|
||||
++G4AllocStats::numCat;
|
||||
if (G4AllocStats::numCat > G4AllocStats::totSpace)
|
||||
{
|
||||
G4AllocStats::totSpace = G4AllocStats::totSpace + 128;
|
||||
@@ -206,7 +198,7 @@ _Tp* G4EnhancedVecAllocator<_Tp>::allocate(size_t _Count)
|
||||
// failure in allocating extra space for instances !
|
||||
// assert(newSpace1 != 0);
|
||||
|
||||
for (G4int k = 0; k < 512 ; k++)
|
||||
for (auto k = 0; k < 512 ; ++k)
|
||||
{
|
||||
(chunk.preAllocated[k]).isAllocated = 0;
|
||||
(chunk.preAllocated[k]).address = newSpace1+totalsize*k;
|
||||
@@ -220,7 +212,7 @@ _Tp* G4EnhancedVecAllocator<_Tp>::allocate(size_t _Count)
|
||||
|
||||
// assert(chunk.size == totalsize);
|
||||
|
||||
for (G4int k = 0; k < chunk.totalspace; k++)
|
||||
for (auto k = 0; k < chunk.totalspace; ++k)
|
||||
{
|
||||
if ((chunk.preAllocated[k]).isAllocated == 0)
|
||||
{
|
||||
@@ -244,7 +236,7 @@ _Tp* G4EnhancedVecAllocator<_Tp>::allocate(size_t _Count)
|
||||
// failure in allocating extra space for instances !
|
||||
// assert(newSpace != 0);
|
||||
|
||||
for (G4int k = 0; k < 512 ; k++)
|
||||
for (auto k = 0; k < 512 ; ++k)
|
||||
{
|
||||
(chunk.preAllocated[originalchunknumber+k]).isAllocated = 0;
|
||||
(chunk.preAllocated[originalchunknumber+k]).address = newSpace+totalsize*k;
|
||||
@@ -261,7 +253,7 @@ _Tp* G4EnhancedVecAllocator<_Tp>::allocate(size_t _Count)
|
||||
//
|
||||
template<typename _T1, typename _T2>
|
||||
inline G4bool operator==(const G4EnhancedVecAllocator<_T1>&,
|
||||
const G4EnhancedVecAllocator<_T2>&)
|
||||
const G4EnhancedVecAllocator<_T2>&)
|
||||
{ return true; }
|
||||
|
||||
// ************************************************************
|
||||
@@ -270,7 +262,7 @@ inline G4bool operator==(const G4EnhancedVecAllocator<_T1>&,
|
||||
//
|
||||
template<typename _T1, typename _T2>
|
||||
inline G4bool operator!=(const G4EnhancedVecAllocator<_T1>&,
|
||||
const G4EnhancedVecAllocator<_T2>&)
|
||||
const G4EnhancedVecAllocator<_T2>&)
|
||||
{ return false; }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4GRSSolid
|
||||
//
|
||||
// Class description:
|
||||
@@ -35,8 +32,7 @@
|
||||
//
|
||||
// NOTE: The (optional) rotation matrix is copied
|
||||
|
||||
// History:
|
||||
// - Created. Paul Kent, August 1996
|
||||
// Created: Paul Kent - August 1996
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4GRSSOLID_HH
|
||||
#define G4GRSSOLID_HH
|
||||
@@ -59,20 +55,18 @@ class G4GRSSolid : public G4VTouchable
|
||||
const G4ThreeVector &tlate);
|
||||
~G4GRSSolid();
|
||||
|
||||
G4GRSSolid(const G4GRSSolid&) = delete;
|
||||
G4GRSSolid& operator=(const G4GRSSolid&) = delete;
|
||||
// Copy constructor and assignment operator not allowed
|
||||
|
||||
inline G4VSolid* GetSolid(G4int depth=0) const;
|
||||
inline const G4ThreeVector& GetTranslation(G4int depth=0) const;
|
||||
inline const G4RotationMatrix* GetRotation(G4int depth=0) const;
|
||||
|
||||
private:
|
||||
|
||||
G4GRSSolid(const G4GRSSolid&);
|
||||
G4GRSSolid& operator=(const G4GRSSolid&);
|
||||
// Copy constructor and assignment operator NOT public
|
||||
|
||||
private:
|
||||
|
||||
G4VSolid *fsolid;
|
||||
G4RotationMatrix *frot;
|
||||
G4VSolid* fsolid = nullptr;
|
||||
G4RotationMatrix* frot = nullptr;
|
||||
G4ThreeVector ftlate;
|
||||
};
|
||||
|
||||
|
||||
@@ -37,10 +37,10 @@ G4GRSSolid::G4GRSSolid( G4VSolid *pSolid,
|
||||
fsolid(pSolid),
|
||||
ftlate(tlate)
|
||||
{
|
||||
if (pRot)
|
||||
if (pRot != nullptr)
|
||||
{
|
||||
frot = new G4RotationMatrix(*pRot);
|
||||
if ( !frot )
|
||||
if ( frot == nullptr )
|
||||
{
|
||||
G4Exception("G4GRSSolid::G4GRSSolid()","GeomVol0002",FatalException,
|
||||
"Cannot allocate G4RotationMatrix, NULL pointer.");
|
||||
@@ -48,7 +48,7 @@ G4GRSSolid::G4GRSSolid( G4VSolid *pSolid,
|
||||
}
|
||||
else
|
||||
{
|
||||
frot=0;
|
||||
frot = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ G4GRSSolid::G4GRSSolid( G4VSolid *pSolid,
|
||||
ftlate(tlate)
|
||||
{
|
||||
frot = new G4RotationMatrix(rot);
|
||||
if ( !frot )
|
||||
if ( frot == nullptr )
|
||||
{
|
||||
G4Exception("G4GRSSolid::G4GRSSolid()","GeomVol0002",FatalException,
|
||||
"Cannot allocate G4RotationMatrix, NULL pointer.");
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// Class G4GRSSolidHandle
|
||||
//
|
||||
@@ -39,12 +37,12 @@
|
||||
// Author: Radovan Chytracek (Radovan.Chytracek@cern.ch), March 2001
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef _G4GRSSOLIDHANDLE_H_
|
||||
#define _G4GRSSOLIDHANDLE_H_ 1
|
||||
#ifndef G4GRSSOLIDHANDLE_HH
|
||||
#define G4GRSSOLIDHANDLE_HH 1
|
||||
|
||||
#include "G4GRSSolid.hh"
|
||||
#include "G4ReferenceCountedHandle.hh"
|
||||
|
||||
typedef G4ReferenceCountedHandle<G4GRSSolid> G4GRSSolidHandle;
|
||||
using G4GRSSolidHandle = G4ReferenceCountedHandle<G4GRSSolid>;
|
||||
|
||||
#endif // _G4GRSSOLIDHANDLE_H_
|
||||
#endif // G4GRSSOLIDHANDLE_HH
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4GRSVolume
|
||||
//
|
||||
// Class description:
|
||||
@@ -36,14 +33,12 @@
|
||||
//
|
||||
// NOTE: The (optional) rotation matrix is copied
|
||||
|
||||
// History:
|
||||
// - Created. Paul Kent, August 1996
|
||||
// Created: Paul Kent - August 1996
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4GRSVOLUME_HH
|
||||
#define G4GRSVOLUME_HH
|
||||
|
||||
#include "G4VTouchable.hh"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
@@ -53,29 +48,27 @@ class G4GRSVolume : public G4VTouchable
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4GRSVolume(G4VPhysicalVolume *pVol,
|
||||
const G4RotationMatrix *pRot,
|
||||
const G4ThreeVector &tlate);
|
||||
G4GRSVolume(G4VPhysicalVolume *pVol,
|
||||
const G4RotationMatrix &rot,
|
||||
const G4ThreeVector &tlate);
|
||||
G4GRSVolume(G4VPhysicalVolume* pVol,
|
||||
const G4RotationMatrix* pRot,
|
||||
const G4ThreeVector& tlate);
|
||||
G4GRSVolume(G4VPhysicalVolume* pVol,
|
||||
const G4RotationMatrix& rot,
|
||||
const G4ThreeVector& tlate);
|
||||
~G4GRSVolume();
|
||||
|
||||
G4GRSVolume(const G4GRSVolume&) = delete;
|
||||
G4GRSVolume& operator=(const G4GRSVolume&) = delete;
|
||||
// Copy constructor and assignment operator not allowed
|
||||
|
||||
inline G4VPhysicalVolume* GetVolume(G4int depth=0) const;
|
||||
inline G4VSolid* GetSolid(G4int depth=0) const;
|
||||
inline const G4ThreeVector& GetTranslation(G4int depth=0) const;
|
||||
inline const G4RotationMatrix* GetRotation(G4int depth=0) const;
|
||||
|
||||
private:
|
||||
|
||||
G4GRSVolume(const G4GRSVolume&);
|
||||
G4GRSVolume& operator=(const G4GRSVolume&);
|
||||
// Copy constructor and assignment operator NOT public
|
||||
inline const G4RotationMatrix* GetRotation(G4int depth=0) const;
|
||||
|
||||
private:
|
||||
|
||||
G4VPhysicalVolume *fvol;
|
||||
G4RotationMatrix *frot;
|
||||
G4VPhysicalVolume* fvol = nullptr;
|
||||
G4RotationMatrix* frot = nullptr;
|
||||
G4ThreeVector ftlate;
|
||||
};
|
||||
|
||||
|
||||
@@ -30,17 +30,15 @@
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
inline
|
||||
G4GRSVolume::G4GRSVolume( G4VPhysicalVolume *pVol,
|
||||
const G4RotationMatrix *pRot,
|
||||
const G4ThreeVector &tlate )
|
||||
: G4VTouchable(),
|
||||
fvol(pVol),
|
||||
ftlate(tlate)
|
||||
G4GRSVolume::G4GRSVolume( G4VPhysicalVolume* pVol,
|
||||
const G4RotationMatrix* pRot,
|
||||
const G4ThreeVector& tlate )
|
||||
: G4VTouchable(), fvol(pVol), ftlate(tlate)
|
||||
{
|
||||
if ( pRot )
|
||||
if ( pRot != nullptr )
|
||||
{
|
||||
frot = new G4RotationMatrix(*pRot);
|
||||
if ( !frot )
|
||||
if ( frot == nullptr )
|
||||
{
|
||||
G4Exception("G4GRSVolume::G4GRSVolume()", "GeomVol0002", FatalException,
|
||||
"Cannot allocate G4RotationMatrix, NULL pointer.");
|
||||
@@ -48,20 +46,18 @@ G4GRSVolume::G4GRSVolume( G4VPhysicalVolume *pVol,
|
||||
}
|
||||
else
|
||||
{
|
||||
frot = 0;
|
||||
frot = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
G4GRSVolume::G4GRSVolume( G4VPhysicalVolume *pVol,
|
||||
const G4RotationMatrix &rot,
|
||||
const G4ThreeVector &tlate )
|
||||
: G4VTouchable(),
|
||||
fvol(pVol),
|
||||
ftlate(tlate)
|
||||
G4GRSVolume::G4GRSVolume( G4VPhysicalVolume* pVol,
|
||||
const G4RotationMatrix& rot,
|
||||
const G4ThreeVector& tlate )
|
||||
: G4VTouchable(), fvol(pVol), ftlate(tlate)
|
||||
{
|
||||
frot = new G4RotationMatrix(rot);
|
||||
if ( !frot )
|
||||
if ( frot == nullptr )
|
||||
{
|
||||
G4Exception("G4GRSVolume::G4GRSVolume()", "GeomVol0002", FatalException,
|
||||
"Cannot allocate G4RotationMatrix, NULL pointer.");
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// Class G4GRSVolumeHandle
|
||||
//
|
||||
// Class description:
|
||||
@@ -39,12 +37,12 @@
|
||||
// Author: Radovan Chytracek (Radovan.Chytracek@cern.ch), March 2001
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef _G4GRSVOLUMEHANDLE_H_
|
||||
#define _G4GRSVOLUMEHANDLE_H_ 1
|
||||
#ifndef G4GRSVOLUMEHANDLE_HH
|
||||
#define G4GRSVOLUMEHANDLE_HH 1
|
||||
|
||||
#include "G4GRSVolume.hh"
|
||||
#include "G4ReferenceCountedHandle.hh"
|
||||
|
||||
typedef G4ReferenceCountedHandle<G4GRSVolume> G4GRSVolumeHandle;
|
||||
using G4GRSVolumeHandle = G4ReferenceCountedHandle<G4GRSVolume>;
|
||||
|
||||
#endif // _G4GRSVOLUMEHANDLE_H_
|
||||
#endif // G4GRSVOLUMEHANDLE_HH
|
||||
|
||||
@@ -23,11 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// G4GeometryWorkspace
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -63,7 +59,8 @@ class G4GeometryWorkspace
|
||||
{
|
||||
public:
|
||||
|
||||
typedef G4TWorkspacePool<G4GeometryWorkspace> pool_type;
|
||||
using pool_type = G4TWorkspacePool<G4GeometryWorkspace>;
|
||||
|
||||
G4GeometryWorkspace();
|
||||
~G4GeometryWorkspace();
|
||||
|
||||
@@ -74,34 +71,34 @@ class G4GeometryWorkspace
|
||||
void InitialiseWorkspace();
|
||||
// To be called at start of each run (especially 2nd and further runs)
|
||||
|
||||
inline void SetVerbose(G4bool v) { fVerbose=v; }
|
||||
inline G4bool GetVerbose() { return fVerbose; }
|
||||
inline void SetVerbose(G4bool v) { fVerbose = v; }
|
||||
inline G4bool GetVerbose() { return fVerbose; }
|
||||
|
||||
static pool_type* GetPool();
|
||||
|
||||
protected: // Implementation methods
|
||||
|
||||
void InitialisePhysicalVolumes();
|
||||
G4bool CloneParameterisedSolids( G4PVParameterised *paramVol );
|
||||
G4bool CloneReplicaSolid( G4PVReplica *);
|
||||
void InitialisePhysicalVolumes();
|
||||
G4bool CloneParameterisedSolids( G4PVParameterised* paramVol );
|
||||
G4bool CloneReplicaSolid( G4PVReplica* );
|
||||
|
||||
private: // Helper pointers - can be per instance or shared
|
||||
|
||||
G4LVManager *fpLogicalVolumeSIM;
|
||||
G4PVManager *fpPhysicalVolumeSIM;
|
||||
G4PVRManager *fpReplicaSIM;
|
||||
G4RegionManager *fpRegionSIM;
|
||||
G4LVManager* fpLogicalVolumeSIM;
|
||||
G4PVManager* fpPhysicalVolumeSIM;
|
||||
G4PVRManager* fpReplicaSIM;
|
||||
G4RegionManager* fpRegionSIM;
|
||||
|
||||
// Per Instance variables
|
||||
// NOTE: the ownership of the Data Arrays is IN this object
|
||||
// Store SubInstanceManager object pointers (SIM pointers)
|
||||
|
||||
G4LVData *fLogicalVolumeOffset; // (G4LVolume::GetSubInstanceManager())
|
||||
G4PVData *fPhysicalVolumeOffset;
|
||||
G4ReplicaData *fReplicaOffset;
|
||||
G4RegionData *fRegionOffset;
|
||||
G4LVData* fLogicalVolumeOffset;
|
||||
G4PVData* fPhysicalVolumeOffset;
|
||||
G4ReplicaData* fReplicaOffset;
|
||||
G4RegionData* fRegionOffset;
|
||||
|
||||
G4bool fVerbose;
|
||||
G4bool fVerbose = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,19 +23,14 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4LogicalBorderSurface
|
||||
// G4LogicalBorderSurface
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A Logical Surface class for surfaces defined by the boundary
|
||||
// of two physical volumes.
|
||||
|
||||
// History:
|
||||
// -------
|
||||
// Created: 1997-06-17
|
||||
// Author: John Apostolakis (John.Apostolakis@cern.ch)
|
||||
// Author: John Apostolakis (John.Apostolakis@cern.ch), 17-06-1997
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4LogicalBorderSurface_h
|
||||
@@ -49,7 +44,7 @@
|
||||
class G4VPhysicalVolume;
|
||||
class G4LogicalBorderSurface;
|
||||
|
||||
typedef std::vector<G4LogicalBorderSurface*> G4LogicalBorderSurfaceTable;
|
||||
using G4LogicalBorderSurfaceTable = std::vector<G4LogicalBorderSurface*>;
|
||||
|
||||
class G4LogicalBorderSurface : public G4LogicalSurface
|
||||
{
|
||||
@@ -63,6 +58,14 @@ class G4LogicalBorderSurface : public G4LogicalSurface
|
||||
~G4LogicalBorderSurface();
|
||||
// Constructor and destructor
|
||||
|
||||
G4LogicalBorderSurface(const G4LogicalBorderSurface&) = delete;
|
||||
G4LogicalBorderSurface& operator=(const G4LogicalBorderSurface&) = delete;
|
||||
// Copy constructor and assignment operator not allowed.
|
||||
|
||||
G4bool operator==( const G4LogicalBorderSurface& right ) const;
|
||||
G4bool operator!=( const G4LogicalBorderSurface& right ) const;
|
||||
// Operators.
|
||||
|
||||
static G4LogicalBorderSurface* GetSurface( const G4VPhysicalVolume* vol1,
|
||||
const G4VPhysicalVolume* vol2 );
|
||||
inline void SetPhysicalVolumes( G4VPhysicalVolume* vol1,
|
||||
@@ -81,15 +84,6 @@ class G4LogicalBorderSurface : public G4LogicalSurface
|
||||
static void DumpInfo();
|
||||
// To handle the table of surfaces.
|
||||
|
||||
G4bool operator==( const G4LogicalBorderSurface &right ) const;
|
||||
G4bool operator!=( const G4LogicalBorderSurface &right ) const;
|
||||
// Operators.
|
||||
|
||||
private:
|
||||
|
||||
G4LogicalBorderSurface(const G4LogicalBorderSurface &right);
|
||||
G4LogicalBorderSurface& operator=(const G4LogicalBorderSurface &right);
|
||||
|
||||
private:
|
||||
|
||||
G4VPhysicalVolume* Volume1; // Physical Volume pointer on side 1
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4LogicalBorderSurface inline implementation
|
||||
//
|
||||
|
||||
@@ -23,19 +23,14 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4LogicalSkinSurface
|
||||
// G4LogicalSkinSurface
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A Logical Surface class for the surface surrounding a single logical
|
||||
// volume.
|
||||
|
||||
// History:
|
||||
// -------
|
||||
// Created: 1997-06-16
|
||||
// Author: John Apostolakis (John.Apostolakis@cern.ch)
|
||||
// Author: John Apostolakis (John.Apostolakis@cern.ch), 16-06-1997
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4LogicalSkinSurface_h
|
||||
@@ -48,7 +43,7 @@
|
||||
class G4LogicalVolume;
|
||||
class G4LogicalSkinSurface;
|
||||
|
||||
typedef std::vector<G4LogicalSkinSurface*> G4LogicalSkinSurfaceTable;
|
||||
using G4LogicalSkinSurfaceTable = std::vector<G4LogicalSkinSurface*>;
|
||||
|
||||
class G4LogicalSkinSurface : public G4LogicalSurface
|
||||
{
|
||||
@@ -61,6 +56,14 @@ class G4LogicalSkinSurface : public G4LogicalSurface
|
||||
~G4LogicalSkinSurface();
|
||||
// Constructor and destructor.
|
||||
|
||||
G4LogicalSkinSurface(const G4LogicalSkinSurface&) = delete;
|
||||
G4LogicalSkinSurface& operator=(const G4LogicalSkinSurface&) = delete;
|
||||
// Assignment and copying not allowed.
|
||||
|
||||
G4bool operator==(const G4LogicalSkinSurface &right) const;
|
||||
G4bool operator!=(const G4LogicalSkinSurface &right) const;
|
||||
// Operators.
|
||||
|
||||
static G4LogicalSkinSurface* GetSurface(const G4LogicalVolume* vol);
|
||||
inline const G4LogicalVolume* GetLogicalVolume() const;
|
||||
inline void SetLogicalVolume(G4LogicalVolume* vol);
|
||||
@@ -72,16 +75,6 @@ class G4LogicalSkinSurface : public G4LogicalSurface
|
||||
static void DumpInfo(); // const
|
||||
// To handle with the table of surfaces.
|
||||
|
||||
G4bool operator==(const G4LogicalSkinSurface &right) const;
|
||||
G4bool operator!=(const G4LogicalSkinSurface &right) const;
|
||||
// Operators.
|
||||
|
||||
private:
|
||||
|
||||
G4LogicalSkinSurface(const G4LogicalSkinSurface &right);
|
||||
G4LogicalSkinSurface& operator=(const G4LogicalSkinSurface &right);
|
||||
// Assignment and copying must be denied.
|
||||
|
||||
private:
|
||||
|
||||
G4LogicalVolume* LogVolume;
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4LogicalSkinSurface inline implementation
|
||||
//
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4NavigationHistory
|
||||
// G4NavigationHistory
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
@@ -33,10 +31,8 @@
|
||||
// the geometrical hierarchy. Principally a utility class for use by the
|
||||
// G4Navigator.
|
||||
|
||||
// History:
|
||||
//
|
||||
// 25.07.96 P.Kent Initial version. Services derived from
|
||||
// requirements of G4Navigator.
|
||||
// 25.07.96 - P.Kent Initial version. Services derived from
|
||||
// requirements of G4Navigator.
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4NAVIGATIONHISTORY_HH
|
||||
#define G4NAVIGATIONHISTORY_HH
|
||||
@@ -59,7 +55,7 @@ class G4NavigationHistory
|
||||
public: // with description
|
||||
|
||||
friend std::ostream&
|
||||
operator << (std::ostream &os, const G4NavigationHistory &h);
|
||||
operator << (std::ostream& os, const G4NavigationHistory& h);
|
||||
|
||||
G4NavigationHistory();
|
||||
// Constructor: sizes history lists & resets histories.
|
||||
@@ -67,10 +63,10 @@ class G4NavigationHistory
|
||||
~G4NavigationHistory();
|
||||
// Destructor.
|
||||
|
||||
G4NavigationHistory(const G4NavigationHistory &h);
|
||||
G4NavigationHistory(const G4NavigationHistory& h);
|
||||
// Copy constructor.
|
||||
|
||||
inline G4NavigationHistory& operator=(const G4NavigationHistory &h);
|
||||
inline G4NavigationHistory& operator=(const G4NavigationHistory& h);
|
||||
// Assignment operator.
|
||||
|
||||
inline void Reset();
|
||||
@@ -100,10 +96,10 @@ class G4NavigationHistory
|
||||
inline G4VPhysicalVolume* GetTopVolume() const;
|
||||
// Returns topmost physical volume pointer.
|
||||
|
||||
inline G4int GetDepth() const;
|
||||
inline size_t GetDepth() const;
|
||||
// Returns current history depth.
|
||||
|
||||
inline G4int GetMaxDepth() const;
|
||||
inline size_t GetMaxDepth() const;
|
||||
// Returns current maximum size of history.
|
||||
// Note: MaxDepth of 16 mean history entries [0..15] inclusive.
|
||||
|
||||
@@ -119,9 +115,9 @@ class G4NavigationHistory
|
||||
inline G4VPhysicalVolume* GetVolume(G4int n) const;
|
||||
// Returns specified physical volume pointer.
|
||||
|
||||
inline void NewLevel(G4VPhysicalVolume *pNewMother,
|
||||
EVolume vType=kNormal,
|
||||
G4int nReplica=-1);
|
||||
inline void NewLevel(G4VPhysicalVolume* pNewMother,
|
||||
EVolume vType = kNormal,
|
||||
G4int nReplica = -1);
|
||||
// Changes navigation level to that of the new mother.
|
||||
|
||||
inline void BackLevel();
|
||||
@@ -145,10 +141,10 @@ class G4NavigationHistory
|
||||
|
||||
private:
|
||||
|
||||
std::vector<G4NavigationLevel> *fNavHistory;
|
||||
std::vector<G4NavigationLevel>* fNavHistory;
|
||||
// Pointer to the vector of navigation levels.
|
||||
|
||||
G4int fStackDepth;
|
||||
size_t fStackDepth;
|
||||
// Depth of stack: effectively depth in geometrical tree.
|
||||
};
|
||||
|
||||
|
||||
@@ -23,9 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4NavigationHistory Inline implementation
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -39,7 +36,7 @@ extern G4GEOM_DLL G4Allocator<G4NavigationHistory>*& aNavigHistoryAllocator();
|
||||
inline
|
||||
void* G4NavigationHistory::operator new(size_t)
|
||||
{
|
||||
if (!aNavigHistoryAllocator())
|
||||
if (aNavigHistoryAllocator() == nullptr)
|
||||
{
|
||||
aNavigHistoryAllocator() = new G4Allocator<G4NavigationHistory>;
|
||||
}
|
||||
@@ -65,11 +62,11 @@ G4NavigationHistory::operator=(const G4NavigationHistory &h)
|
||||
fNavHistory->resize( h.GetMaxDepth() );
|
||||
}
|
||||
|
||||
for ( G4int ilev=h.fStackDepth; ilev>=0; --ilev )
|
||||
for ( G4int ilev=G4int(h.fStackDepth); ilev>=0; --ilev )
|
||||
{
|
||||
(*fNavHistory)[ilev] = (*h.fNavHistory)[ilev];
|
||||
}
|
||||
fStackDepth=h.fStackDepth;
|
||||
fStackDepth = h.fStackDepth;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -87,7 +84,7 @@ void G4NavigationHistory::Clear()
|
||||
G4NavigationLevel tmpNavLevel = G4NavigationLevel(0, origin, kNormal, -1) ;
|
||||
|
||||
Reset();
|
||||
for (G4int ilev=fNavHistory->size()-1; ilev>=0; ilev--)
|
||||
for (G4long ilev=G4long(fNavHistory->size()-1); ilev>=0; --ilev)
|
||||
{
|
||||
(*fNavHistory)[ilev] = tmpNavLevel;
|
||||
}
|
||||
@@ -102,7 +99,7 @@ void G4NavigationHistory::SetFirstEntry(G4VPhysicalVolume* pVol)
|
||||
// Protection needed in case pVol=null
|
||||
// so that a touchable-history can signal OutOfWorld
|
||||
//
|
||||
if( pVol!=0 )
|
||||
if( pVol != nullptr )
|
||||
{
|
||||
translation = pVol->GetTranslation();
|
||||
copyNo = pVol->GetCopyNo();
|
||||
@@ -142,7 +139,7 @@ G4VPhysicalVolume* G4NavigationHistory::GetTopVolume() const
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4NavigationHistory::GetDepth() const
|
||||
size_t G4NavigationHistory::GetDepth() const
|
||||
{
|
||||
return fStackDepth;
|
||||
}
|
||||
@@ -173,7 +170,7 @@ G4VPhysicalVolume* G4NavigationHistory::GetVolume(G4int n) const
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4NavigationHistory::GetMaxDepth() const
|
||||
size_t G4NavigationHistory::GetMaxDepth() const
|
||||
{
|
||||
return fNavHistory->size();
|
||||
}
|
||||
@@ -186,36 +183,36 @@ void G4NavigationHistory::BackLevel()
|
||||
// Tell the level that I am forgetting it
|
||||
// delete (*fNavHistory)[fStackDepth];
|
||||
//
|
||||
fStackDepth--;
|
||||
--fStackDepth;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4NavigationHistory::BackLevel(G4int n)
|
||||
{
|
||||
assert( n<=fStackDepth );
|
||||
assert( n<=G4int(fStackDepth) );
|
||||
fStackDepth-=n;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4NavigationHistory::EnlargeHistory()
|
||||
{
|
||||
G4int len = fNavHistory->size();
|
||||
if ( len==fStackDepth )
|
||||
size_t len = fNavHistory->size();
|
||||
if ( len == fStackDepth )
|
||||
{
|
||||
// Note: Resize operation clears additional entries
|
||||
//
|
||||
G4int nlen = len+kHistoryStride;
|
||||
size_t nlen = len+kHistoryStride;
|
||||
fNavHistory->resize(nlen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline
|
||||
void G4NavigationHistory::NewLevel( G4VPhysicalVolume *pNewMother,
|
||||
void G4NavigationHistory::NewLevel( G4VPhysicalVolume* pNewMother,
|
||||
EVolume vType,
|
||||
G4int nReplica )
|
||||
{
|
||||
fStackDepth++;
|
||||
++fStackDepth;
|
||||
EnlargeHistory(); // Enlarge if required
|
||||
(*fNavHistory)[fStackDepth] =
|
||||
G4NavigationLevel( pNewMother,
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4NavigationHistoryPool
|
||||
// G4NavigationHistoryPool
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
@@ -33,7 +31,6 @@
|
||||
// allocated by G4NavigationHistory. Allows for reuse of the vectors
|
||||
// allocated according to lifetime of G4NavigationHistory objects.
|
||||
|
||||
// History:
|
||||
// 07.05.14 G.Cosmo Initial version
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4NAVIGATIONHISTORYPOOL_HH
|
||||
|
||||
@@ -23,19 +23,15 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4NavigationLevel
|
||||
// G4NavigationLevel
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Maintains one level of the geometrical hierarchy.
|
||||
// A utility class for use by G4NavigationHistory.
|
||||
|
||||
// History:
|
||||
//
|
||||
// 30.09.97 J.Apostolakis Initial version. Services derived from
|
||||
// requirements of touchables & G4NavigatorHistory.
|
||||
// requirements of touchables & G4NavigatorHistory
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4NAVIGATIONLEVEL_HH
|
||||
#define G4NAVIGATIONLEVEL_HH
|
||||
@@ -58,13 +54,13 @@ class G4NavigationLevel
|
||||
G4NavigationLevel(G4VPhysicalVolume* newPtrPhysVol,
|
||||
const G4AffineTransform& newT,
|
||||
EVolume newVolTp,
|
||||
G4int newRepNo= -1);
|
||||
G4int newRepNo = -1);
|
||||
|
||||
G4NavigationLevel(G4VPhysicalVolume* newPtrPhysVol,
|
||||
const G4AffineTransform& levelAbove,
|
||||
const G4AffineTransform& relativeCurrent,
|
||||
EVolume newVolTp,
|
||||
G4int newRepNo= -1);
|
||||
G4int newRepNo = -1);
|
||||
// As the previous constructor, but instead of giving Transform, give
|
||||
// the AffineTransform to the level above and the current level's
|
||||
// Transform relative to that.
|
||||
@@ -74,7 +70,7 @@ class G4NavigationLevel
|
||||
|
||||
~G4NavigationLevel();
|
||||
|
||||
G4NavigationLevel& operator=(const G4NavigationLevel &right);
|
||||
G4NavigationLevel& operator=(const G4NavigationLevel& right);
|
||||
|
||||
inline G4VPhysicalVolume* GetPhysicalVolume() const;
|
||||
inline const G4AffineTransform* GetTransformPtr() const ; // New
|
||||
@@ -88,20 +84,20 @@ class G4NavigationLevel
|
||||
inline const G4AffineTransform* GetPtrTransform() const;
|
||||
// To try to resolve the possible problem with returning a reference.
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aLevel);
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void* aLevel);
|
||||
// Override "new" and "delete" to use "G4Allocator".
|
||||
|
||||
inline void *operator new(size_t, void *);
|
||||
inline void* operator new(size_t, void*);
|
||||
#ifndef G4NOT_ISO_DELETES
|
||||
inline void operator delete(void *ptr, void*); // Not accepted Sun/HP
|
||||
inline void operator delete(void* ptr, void*); // Not accepted Sun/HP
|
||||
#endif
|
||||
// Pre-allocated 'new' and 'delete' for use with STL
|
||||
// Do not (directly) use Allocator
|
||||
|
||||
private:
|
||||
|
||||
G4NavigationLevelRep* fLevelRep;
|
||||
G4NavigationLevelRep* fLevelRep;
|
||||
};
|
||||
|
||||
#include "G4NavigationLevel.icc"
|
||||
|
||||
@@ -23,10 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4NavigationLevel inline implementation
|
||||
//
|
||||
//
|
||||
// 30.09.97 J.Apostolakis Initial version.
|
||||
//
|
||||
// 30.09.97 J.Apostolakis Initial version
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
extern G4GEOM_DLL G4Allocator<G4NavigationLevel>*& aNavigationLevelAllocator();
|
||||
@@ -67,7 +66,7 @@ G4int G4NavigationLevel::GetReplicaNo() const
|
||||
inline
|
||||
void* G4NavigationLevel::operator new(size_t)
|
||||
{
|
||||
if (!aNavigationLevelAllocator())
|
||||
if (aNavigationLevelAllocator() == nullptr)
|
||||
{
|
||||
aNavigationLevelAllocator() = new G4Allocator<G4NavigationLevel>;
|
||||
}
|
||||
@@ -77,13 +76,13 @@ void* G4NavigationLevel::operator new(size_t)
|
||||
// Added for use by STL (used for pre-allocation).
|
||||
//
|
||||
inline
|
||||
void* G4NavigationLevel::operator new(size_t,void *a)
|
||||
void* G4NavigationLevel::operator new(size_t, void* a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4NavigationLevel::operator delete(void *aLevel)
|
||||
void G4NavigationLevel::operator delete(void* aLevel)
|
||||
{
|
||||
aNavigationLevelAllocator()->FreeSingle((G4NavigationLevel *) aLevel);
|
||||
}
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4NavigationLevelRep
|
||||
// G4NavigationLevelRep
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
@@ -36,9 +34,7 @@
|
||||
// reference counting for NavigationLevels.
|
||||
// The corresponding handle class is G4NavigationLevel
|
||||
|
||||
// History:
|
||||
//
|
||||
// - 1 October 1997, J.Apostolakis: initial version.
|
||||
// 1 October 1997, J.Apostolakis: initial version
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4NAVIGATIONLEVELREP_HH
|
||||
#define G4NAVIGATIONLEVELREP_HH
|
||||
@@ -59,13 +55,13 @@ class G4NavigationLevelRep
|
||||
inline G4NavigationLevelRep( G4VPhysicalVolume* newPtrPhysVol,
|
||||
const G4AffineTransform& newT,
|
||||
EVolume newVolTp,
|
||||
G4int newRepNo= -1 );
|
||||
G4int newRepNo = -1 );
|
||||
|
||||
inline G4NavigationLevelRep( G4VPhysicalVolume* newPtrPhysVol,
|
||||
const G4AffineTransform& levelAbove,
|
||||
const G4AffineTransform& relativeCurrent,
|
||||
EVolume newVolTp,
|
||||
G4int newRepNo= -1 );
|
||||
G4int newRepNo = -1 );
|
||||
// As the previous constructor, but instead of giving Transform, give
|
||||
// the AffineTransform to the level above and the current level's
|
||||
// Transform relative to that.
|
||||
@@ -75,7 +71,7 @@ class G4NavigationLevelRep
|
||||
|
||||
inline ~G4NavigationLevelRep();
|
||||
|
||||
inline G4NavigationLevelRep& operator=(const G4NavigationLevelRep &right);
|
||||
inline G4NavigationLevelRep& operator=(const G4NavigationLevelRep& right);
|
||||
|
||||
inline G4VPhysicalVolume* GetPhysicalVolume();
|
||||
|
||||
@@ -89,9 +85,9 @@ class G4NavigationLevelRep
|
||||
inline G4bool RemoveAReference();
|
||||
// Take care of the reference counts.
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void* operator new(size_t);
|
||||
// Override "new" to use "G4Allocator".
|
||||
inline void operator delete(void *aTrack);
|
||||
inline void operator delete(void* aTrack);
|
||||
// Override "delete" to use "G4Allocator".
|
||||
|
||||
private:
|
||||
@@ -100,14 +96,14 @@ class G4NavigationLevelRep
|
||||
// Compounded global->local transformation (takes a point in the
|
||||
// global reference system to the system of the volume at this level)
|
||||
|
||||
G4VPhysicalVolume* sPhysicalVolumePtr;
|
||||
G4VPhysicalVolume* sPhysicalVolumePtr = nullptr;
|
||||
// Physical volume ptrs, for this level's volume
|
||||
|
||||
G4int sReplicaNo;
|
||||
G4int sReplicaNo = -1;
|
||||
EVolume sVolumeType;
|
||||
// Volume `type'
|
||||
|
||||
G4int fCountRef;
|
||||
G4int fCountRef = 1;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -23,10 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4NavigationLevelRep inline implementation
|
||||
//
|
||||
//
|
||||
// 1 October 1997 J.Apostolakis Initial version.
|
||||
//
|
||||
// 1 October 1997, J.Apostolakis Initial version
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
extern G4GEOM_DLL G4Allocator<G4NavigationLevelRep>*& aNavigLevelRepAllocator();
|
||||
@@ -42,18 +41,14 @@ G4NavigationLevelRep::G4NavigationLevelRep( G4VPhysicalVolume* pPhysVol,
|
||||
: sTransform(afTransform),
|
||||
sPhysicalVolumePtr(pPhysVol),
|
||||
sReplicaNo(repNo),
|
||||
sVolumeType(volTp),
|
||||
fCountRef(1)
|
||||
sVolumeType(volTp)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
G4NavigationLevelRep::G4NavigationLevelRep()
|
||||
: sTransform(),
|
||||
sPhysicalVolumePtr(0),
|
||||
sReplicaNo(-1),
|
||||
sVolumeType(kReplica),
|
||||
fCountRef(1)
|
||||
sVolumeType(kReplica)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -65,8 +60,7 @@ G4NavigationLevelRep::G4NavigationLevelRep( G4VPhysicalVolume* pPhysVol,
|
||||
G4int repNo )
|
||||
: sPhysicalVolumePtr(pPhysVol),
|
||||
sReplicaNo(repNo),
|
||||
sVolumeType(volTp),
|
||||
fCountRef(1)
|
||||
sVolumeType(volTp)
|
||||
{
|
||||
sTransform.InverseProduct( levelAbove, relativeCurrent );
|
||||
}
|
||||
@@ -76,8 +70,7 @@ G4NavigationLevelRep::G4NavigationLevelRep( G4NavigationLevelRep& right )
|
||||
: sTransform(right.sTransform),
|
||||
sPhysicalVolumePtr(right.sPhysicalVolumePtr),
|
||||
sReplicaNo(right.sReplicaNo),
|
||||
sVolumeType(right.sVolumeType),
|
||||
fCountRef(1)
|
||||
sVolumeType(right.sVolumeType)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -102,11 +95,11 @@ G4NavigationLevelRep::~G4NavigationLevelRep()
|
||||
|
||||
inline
|
||||
G4NavigationLevelRep&
|
||||
G4NavigationLevelRep::operator=( const G4NavigationLevelRep &right )
|
||||
G4NavigationLevelRep::operator=( const G4NavigationLevelRep& right )
|
||||
{
|
||||
if ( &right != this )
|
||||
{
|
||||
sTransform = right.sTransform;
|
||||
sTransform = right.sTransform;
|
||||
sPhysicalVolumePtr = right.sPhysicalVolumePtr;
|
||||
sVolumeType = right.sVolumeType;
|
||||
sReplicaNo = right.sReplicaNo;
|
||||
@@ -170,7 +163,7 @@ G4bool G4NavigationLevelRep::RemoveAReference()
|
||||
inline
|
||||
void* G4NavigationLevelRep::operator new(size_t)
|
||||
{
|
||||
if (!aNavigLevelRepAllocator())
|
||||
if (aNavigLevelRepAllocator() == nullptr)
|
||||
{
|
||||
aNavigLevelRepAllocator() = new G4Allocator<G4NavigationLevelRep>;
|
||||
}
|
||||
@@ -178,7 +171,7 @@ void* G4NavigationLevelRep::operator new(size_t)
|
||||
}
|
||||
|
||||
inline
|
||||
void G4NavigationLevelRep::operator delete(void *aLevelRep)
|
||||
void G4NavigationLevelRep::operator delete(void* aLevelRep)
|
||||
{
|
||||
aNavigLevelRepAllocator()->FreeSingle((G4NavigationLevelRep *) aLevelRep);
|
||||
}
|
||||
|
||||
@@ -22,11 +22,8 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4PVParameterised
|
||||
// G4PVParameterised
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
@@ -35,8 +32,7 @@
|
||||
// of a G4VParameterisation object. The positioning is assumed to
|
||||
// be dominant along a cartesian axis (specified).
|
||||
|
||||
// History:
|
||||
// 29.07.95 P.Kent First non-stub version
|
||||
// 29.07.95, P.Kent - first non-stub version
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4PVPARAMETERISED_HH
|
||||
#define G4PVPARAMETERISED_HH
|
||||
@@ -52,8 +48,8 @@ class G4PVParameterised : public G4PVReplica
|
||||
G4LogicalVolume* pMotherLogical,
|
||||
const EAxis pAxis,
|
||||
const G4int nReplicas,
|
||||
G4VPVParameterisation *pParam,
|
||||
G4bool pSurfChk=false);
|
||||
G4VPVParameterisation* pParam,
|
||||
G4bool pSurfChk = false);
|
||||
// Replicate the volume nReplicas Times using the paramaterisation pParam,
|
||||
// within the mother volume pMotherLogical.
|
||||
// The positioning of the replicas is dominant along the specified axis.
|
||||
@@ -66,8 +62,8 @@ class G4PVParameterised : public G4PVReplica
|
||||
G4VPhysicalVolume* pMother,
|
||||
const EAxis pAxis,
|
||||
const G4int nReplicas,
|
||||
G4VPVParameterisation *pParam,
|
||||
G4bool pSurfChk=false);
|
||||
G4VPVParameterisation* pParam,
|
||||
G4bool pSurfChk = false);
|
||||
// Almost exactly similar to first constructor, changing only mother
|
||||
// pointer's type to PhysicalVolume.
|
||||
|
||||
@@ -84,6 +80,8 @@ class G4PVParameterised : public G4PVReplica
|
||||
G4bool IsParameterised() const;
|
||||
// Returns true to identify it is a parameterised physical volume.
|
||||
|
||||
EVolume VolumeType() const final;
|
||||
|
||||
G4VPVParameterisation* GetParameterisation() const;
|
||||
// Returns the current pointer to the parameterisation.
|
||||
|
||||
@@ -93,11 +91,12 @@ class G4PVParameterised : public G4PVReplica
|
||||
G4double& offset,
|
||||
G4bool& consuming) const;
|
||||
// Fills arguments with the attributes from the base replica.
|
||||
virtual void SetRegularStructureId( G4int Code );
|
||||
|
||||
virtual void SetRegularStructureId( G4int code );
|
||||
// Method sets code and can prepare for special type of regular volumes.
|
||||
|
||||
G4bool CheckOverlaps(G4int res=1000, G4double tol=0.,
|
||||
G4bool verbose=true, G4int maxErr=1);
|
||||
G4bool CheckOverlaps(G4int res = 1000, G4double tol = 0.,
|
||||
G4bool verbose = true, G4int maxErr = 1);
|
||||
// Verifies if each instance of the parameterised volume is overlapping
|
||||
// with other instances or with the mother volume. Provides default
|
||||
// resolution for the number of points to be generated and verified.
|
||||
@@ -108,7 +107,7 @@ class G4PVParameterised : public G4PVReplica
|
||||
|
||||
private:
|
||||
|
||||
G4VPVParameterisation *fparam;
|
||||
G4VPVParameterisation* fparam = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,24 +22,17 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4PVPlacement
|
||||
// G4PVPlacement
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Class representing a single volume positioned within and relative
|
||||
// to a mother volume.
|
||||
|
||||
// History:
|
||||
// 24.07.95 P.Kent First non-stub version
|
||||
// 25.07.96 P.Kent Modified interface for new `Replica' capable geometry
|
||||
// 28.08.96 P.Kent Tidied + transform replaced by rotmat+vector
|
||||
// 28.02.97 J.Apostolakis Added 2nd constructor with G4Transform3D of solid.
|
||||
// 11.07.97 J.Apostolakis Added 3rd constructor with pMotherLogical
|
||||
// 11.05.98 J.Apostolakis Added 4th constructor with G4Transform3D & pMotherLV
|
||||
// 24.07.95 P.Kent, First non-stub version
|
||||
// 25.07.96 P.Kent, Modified interface for new `Replica' capable geometry
|
||||
// 28.08.96 P.Kent. Tidied + transform replaced by rotmat+vector
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4PVPLACEMENT_HH
|
||||
#define G4PVPLACEMENT_HH
|
||||
@@ -51,18 +44,18 @@ class G4PVPlacement : public G4VPhysicalVolume
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4PVPlacement(G4RotationMatrix *pRot,
|
||||
const G4ThreeVector &tlate,
|
||||
G4LogicalVolume *pCurrentLogical,
|
||||
G4PVPlacement(G4RotationMatrix* pRot,
|
||||
const G4ThreeVector& tlate,
|
||||
G4LogicalVolume* pCurrentLogical,
|
||||
const G4String& pName,
|
||||
G4LogicalVolume *pMotherLogical,
|
||||
G4LogicalVolume* pMotherLogical,
|
||||
G4bool pMany,
|
||||
G4int pCopyNo,
|
||||
G4bool pSurfChk=false);
|
||||
G4bool pSurfChk = false);
|
||||
// Initialise a single volume, positioned in a frame which is rotated by
|
||||
// *pRot and traslated by tlate, relative to the coordinate system of the
|
||||
// mother volume pMotherLogical.
|
||||
// If pRot=0 the volume is unrotated with respect to its mother.
|
||||
// If pRot=nullptr the volume is unrotated with respect to its mother.
|
||||
// The physical volume is added to the mother's logical volume.
|
||||
// Arguments particular to G4PVPlacement:
|
||||
// pMany Currently NOT used. For future use to identify if the volume
|
||||
@@ -73,13 +66,13 @@ class G4PVPlacement : public G4VPhysicalVolume
|
||||
// especially useful when creating subdetectors: the mother volumes are
|
||||
// not placed until a later stage of the assembly program.
|
||||
|
||||
G4PVPlacement(const G4Transform3D &Transform3D,
|
||||
G4LogicalVolume *pCurrentLogical,
|
||||
G4PVPlacement(const G4Transform3D& Transform3D,
|
||||
G4LogicalVolume* pCurrentLogical,
|
||||
const G4String& pName,
|
||||
G4LogicalVolume *pMotherLogical,
|
||||
G4LogicalVolume* pMotherLogical,
|
||||
G4bool pMany,
|
||||
G4int pCopyNo,
|
||||
G4bool pSurfChk=false);
|
||||
G4bool pSurfChk = false);
|
||||
// Additional constructor, which expects a G4Transform3D that represents
|
||||
// the direct rotation and translation of the solid (NOT of the frame).
|
||||
// The G4Transform3D argument should be constructed by:
|
||||
@@ -94,25 +87,25 @@ class G4PVPlacement : public G4VPhysicalVolume
|
||||
|
||||
public: // without description
|
||||
|
||||
G4PVPlacement(G4RotationMatrix *pRot,
|
||||
const G4ThreeVector &tlate,
|
||||
const G4String &pName,
|
||||
G4LogicalVolume *pLogical,
|
||||
G4VPhysicalVolume *pMother,
|
||||
G4PVPlacement(G4RotationMatrix* pRot,
|
||||
const G4ThreeVector& tlate,
|
||||
const G4String& pName,
|
||||
G4LogicalVolume* pLogical,
|
||||
G4VPhysicalVolume* pMother,
|
||||
G4bool pMany,
|
||||
G4int pCopyNo,
|
||||
G4bool pSurfChk=false);
|
||||
G4bool pSurfChk = false);
|
||||
// A simple variation of the 1st constructor, only specifying the
|
||||
// mother volume as a pointer to its physical volume instead of its
|
||||
// logical volume. The effect is exactly the same.
|
||||
|
||||
G4PVPlacement(const G4Transform3D &Transform3D,
|
||||
const G4String &pName,
|
||||
G4LogicalVolume *pLogical,
|
||||
G4VPhysicalVolume *pMother,
|
||||
G4PVPlacement(const G4Transform3D& Transform3D,
|
||||
const G4String& pName,
|
||||
G4LogicalVolume* pLogical,
|
||||
G4VPhysicalVolume* pMother,
|
||||
G4bool pMany,
|
||||
G4int pCopyNo,
|
||||
G4bool pSurfChk=false);
|
||||
G4bool pSurfChk = false);
|
||||
// Utilises both variations above (from 2nd and 3rd constructor).
|
||||
// The effect is the same as for the 2nd constructor.
|
||||
|
||||
@@ -123,11 +116,11 @@ class G4PVPlacement : public G4VPhysicalVolume
|
||||
|
||||
inline G4int GetCopyNo() const { return fcopyNo; }
|
||||
|
||||
void SetCopyNo(G4int CopyNo);
|
||||
void SetCopyNo(G4int CopyNo);
|
||||
// Gets and sets the copy number of the volume.
|
||||
|
||||
G4bool CheckOverlaps(G4int res=1000, G4double tol=0.,
|
||||
G4bool verbose=true, G4int maxErr=1);
|
||||
G4bool CheckOverlaps(G4int res = 1000, G4double tol = 0.,
|
||||
G4bool verbose = true, G4int maxErr = 1);
|
||||
// Verifies if the placed volume is overlapping with existing
|
||||
// daughters or with the mother volume. Provides default resolution
|
||||
// for the number of points to be generated and verified.
|
||||
@@ -143,6 +136,10 @@ class G4PVPlacement : public G4VPhysicalVolume
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
|
||||
G4PVPlacement(const G4PVPlacement&) = delete;
|
||||
G4PVPlacement& operator=(const G4PVPlacement&) = delete;
|
||||
// Copy constructor and assignment operator not allowed.
|
||||
|
||||
G4bool IsMany() const;
|
||||
G4bool IsReplicated() const;
|
||||
G4bool IsParameterised() const;
|
||||
@@ -152,25 +149,23 @@ class G4PVPlacement : public G4VPhysicalVolume
|
||||
G4double& width,
|
||||
G4double& offset,
|
||||
G4bool& consuming) const;
|
||||
G4bool IsRegularStructure() const;
|
||||
G4int GetRegularStructureId() const;
|
||||
G4bool IsRegularStructure() const;
|
||||
G4int GetRegularStructureId() const;
|
||||
|
||||
EVolume VolumeType() const;
|
||||
|
||||
private:
|
||||
|
||||
static G4RotationMatrix* NewPtrRotMatrix(const G4RotationMatrix &RotMat);
|
||||
static G4RotationMatrix* NewPtrRotMatrix(const G4RotationMatrix& RotMat);
|
||||
// Auxiliary function for 2nd constructor (one with G4Transform3D).
|
||||
// Creates a new RotMatrix on the heap (using "new") and copies
|
||||
// its argument into it.
|
||||
|
||||
G4PVPlacement(const G4PVPlacement&);
|
||||
G4PVPlacement& operator=(const G4PVPlacement&);
|
||||
// Private copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
|
||||
G4bool fmany; // flag for overlapping structure - not used
|
||||
G4bool fallocatedRotM; // flag for allocation of Rotation Matrix
|
||||
G4int fcopyNo; // for identification
|
||||
G4bool fmany = false; // flag for overlapping structure - not used
|
||||
G4bool fallocatedRotM = false; // flag for allocation of Rotation Matrix
|
||||
G4int fcopyNo = 0; // for identification
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -22,11 +22,8 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4PVReplica
|
||||
// G4PVReplica
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
@@ -63,10 +60,8 @@
|
||||
// They have phi of offset+n*width to offset+(n+1)*width where
|
||||
// n=0..nReplicas-1
|
||||
|
||||
// History:
|
||||
// 29.07.95 P.Kent - First non-stub version
|
||||
// 26.10.97 J.Apostolakis - Added constructor that takes mother LV
|
||||
// 16.02.98 J.Apostolakis - Added copy number
|
||||
// 13.01.13 G.Cosmo, A.Dotti - Modified for thread-safety for MT
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4PVREPLICA_HH
|
||||
@@ -86,7 +81,7 @@ public:
|
||||
|
||||
void initialize() {}
|
||||
|
||||
G4int fcopyNo;
|
||||
G4int fcopyNo;
|
||||
};
|
||||
|
||||
// The type G4PVRManager is introduced to encapsulate the methods used by
|
||||
@@ -125,9 +120,7 @@ class G4PVReplica : public G4VPhysicalVolume
|
||||
const EAxis pAxis,
|
||||
const G4int nReplicas,
|
||||
const G4double width,
|
||||
const G4double offset=0);
|
||||
|
||||
public: // without description
|
||||
const G4double offset = 0.);
|
||||
|
||||
G4PVReplica(const G4String& pName,
|
||||
G4LogicalVolume* pLogical,
|
||||
@@ -135,17 +128,21 @@ class G4PVReplica : public G4VPhysicalVolume
|
||||
const EAxis pAxis,
|
||||
const G4int nReplicas,
|
||||
const G4double width,
|
||||
const G4double offset=0);
|
||||
const G4double offset = 0.);
|
||||
|
||||
G4PVReplica(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
|
||||
public: // with description
|
||||
G4PVReplica(const G4PVReplica&) = delete;
|
||||
G4PVReplica& operator=(const G4PVReplica&) = delete;
|
||||
// Copy constructor and assignment operator not allowed
|
||||
|
||||
virtual ~G4PVReplica();
|
||||
|
||||
virtual EVolume VolumeType() const;
|
||||
|
||||
G4bool IsMany() const;
|
||||
G4bool IsReplicated() const;
|
||||
|
||||
@@ -160,7 +157,7 @@ class G4PVReplica : public G4VPhysicalVolume
|
||||
G4double& offset,
|
||||
G4bool& consuming) const;
|
||||
|
||||
virtual void SetRegularStructureId( G4int Code );
|
||||
virtual void SetRegularStructureId( G4int code );
|
||||
// This method must set a unique code for each type of regular structure.
|
||||
// - It must be called only during detector construction.
|
||||
// - It can also be used to prepare any corresponding special
|
||||
@@ -178,11 +175,11 @@ class G4PVReplica : public G4VPhysicalVolume
|
||||
static const G4PVRManager& GetSubInstanceManager();
|
||||
// Returns the private data instance manager.
|
||||
|
||||
void InitialiseWorker(G4PVReplica *pMasterObject);
|
||||
void InitialiseWorker(G4PVReplica* pMasterObject);
|
||||
// This method is similar to the constructor. It is used by each worker
|
||||
// thread to achieve the partial effect as that of the master thread.
|
||||
|
||||
void TerminateWorker(G4PVReplica *pMasterObject);
|
||||
void TerminateWorker(G4PVReplica* pMasterObject);
|
||||
// This method is similar to the destructor. It is used by each worker
|
||||
// thread to achieve the partial effect as that of the master thread.
|
||||
|
||||
@@ -190,19 +187,29 @@ class G4PVReplica : public G4VPhysicalVolume
|
||||
|
||||
void CheckAndSetParameters(const EAxis pAxis, const G4int nReplicas,
|
||||
const G4double width, const G4double offset);
|
||||
G4PVReplica(const G4PVReplica&);
|
||||
G4PVReplica& operator=(const G4PVReplica&);
|
||||
|
||||
void CheckOnlyDaughter(G4LogicalVolume* pMotherLogical);
|
||||
// Check that this volume is the only daughter of its proposed mother volume
|
||||
|
||||
protected:
|
||||
G4PVReplica(const G4String& pName,
|
||||
G4int nReplicas,
|
||||
EAxis pAxis,
|
||||
G4LogicalVolume* pLogical,
|
||||
G4LogicalVolume* pMotherLogical
|
||||
);
|
||||
// Constructor for derived type(s): PVParameterised
|
||||
// - does not set mother or register in mother volume -- leaves it to derived type
|
||||
|
||||
protected:
|
||||
|
||||
EAxis faxis;
|
||||
G4int fnReplicas;
|
||||
G4double fwidth,foffset;
|
||||
G4double fwidth, foffset;
|
||||
|
||||
private:
|
||||
|
||||
G4int fRegularStructureCode;
|
||||
G4int fRegularVolsId;
|
||||
G4int fRegularVolsId = 0;
|
||||
|
||||
G4int instanceID;
|
||||
// This new field is used as instance ID.
|
||||
|
||||
@@ -22,11 +22,8 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4ReflectionFactory
|
||||
// G4ReflectionFactory
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
@@ -59,7 +56,7 @@
|
||||
// = TV * R*TD*R-1 * R*x(inD)
|
||||
// = TV * ReflTD * x(inReflD)
|
||||
|
||||
// Author: Ivana Hrivnacova, 16.10.2001 (Ivana.Hrivnacova@cern.ch)
|
||||
// Author: Ivana Hrivnacova (Ivana.Hrivnacova@cern.ch), 16.10.2001
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4_REFLECTION_FACTORY_HH
|
||||
#define G4_REFLECTION_FACTORY_HH
|
||||
@@ -75,14 +72,12 @@ class G4LogicalVolume;
|
||||
class G4VSolid;
|
||||
class G4VPVDivisionFactory;
|
||||
|
||||
typedef std::pair<G4VPhysicalVolume*,
|
||||
G4VPhysicalVolume*> G4PhysicalVolumesPair;
|
||||
typedef std::map<G4LogicalVolume*, G4LogicalVolume*,
|
||||
std::less<G4LogicalVolume*> > G4ReflectedVolumesMap;
|
||||
|
||||
using G4PhysicalVolumesPair = std::pair<G4VPhysicalVolume*, G4VPhysicalVolume*>;
|
||||
using G4ReflectedVolumesMap = std::map<G4LogicalVolume*, G4LogicalVolume*,
|
||||
std::less<G4LogicalVolume*> >;
|
||||
class G4ReflectionFactory
|
||||
{
|
||||
typedef G4ReflectedVolumesMap::const_iterator LogicalVolumesMapIterator;
|
||||
using LogicalVolumesMapIterator = G4ReflectedVolumesMap::const_iterator;
|
||||
|
||||
public: // with description
|
||||
|
||||
@@ -98,7 +93,7 @@ class G4ReflectionFactory
|
||||
G4LogicalVolume* motherLV,
|
||||
G4bool isMany,
|
||||
G4int copyNo,
|
||||
G4bool surfCheck=false);
|
||||
G4bool surfCheck = false);
|
||||
// Evaluates the passed transformation; if it contains reflection
|
||||
// it performs its decomposition, creates new reflected solid and
|
||||
// logical volume (or retrieves them from a map if the reflected
|
||||
@@ -114,7 +109,7 @@ class G4ReflectionFactory
|
||||
EAxis axis,
|
||||
G4int nofReplicas,
|
||||
G4double width,
|
||||
G4double offset=0);
|
||||
G4double offset = 0.);
|
||||
// Creates replica in the given mother.
|
||||
// The result is a pair of physical volumes;
|
||||
// the second physical volume is a replica in a reflected mother
|
||||
@@ -142,7 +137,7 @@ class G4ReflectionFactory
|
||||
// Creates division in the given mother.
|
||||
// The result is a pair of physical volumes;
|
||||
// the second physical volume is a division in a reflected mother
|
||||
// or 0 if mother LV was not reflected.
|
||||
// or nullptr if mother LV was not reflected.
|
||||
|
||||
void SetVerboseLevel(G4int verboseLevel);
|
||||
G4int GetVerboseLevel() const;
|
||||
@@ -160,11 +155,11 @@ class G4ReflectionFactory
|
||||
|
||||
G4LogicalVolume* GetConstituentLV(G4LogicalVolume* reflLV) const;
|
||||
// Returns the consituent volume of the given reflected volume,
|
||||
// 0 if the given reflected volume was not found.
|
||||
// nullptr if the given reflected volume was not found.
|
||||
|
||||
G4LogicalVolume* GetReflectedLV(G4LogicalVolume* lv) const;
|
||||
// Returns the reflected volume of the given consituent volume,
|
||||
// 0 if the given volume was not reflected.
|
||||
// nullptr if the given volume was not reflected.
|
||||
|
||||
G4bool IsConstituent(G4LogicalVolume* lv) const;
|
||||
// Returns true if the given volume has been already reflected
|
||||
@@ -182,18 +177,18 @@ class G4ReflectionFactory
|
||||
// Resets maps of constituent and reflected volumes.
|
||||
// To be used exclusively when volumes are removed from the stores.
|
||||
|
||||
G4ReflectionFactory(const G4ReflectionFactory&) = delete;
|
||||
G4ReflectionFactory& operator=(const G4ReflectionFactory&) = delete;
|
||||
// Disabled copy constructor and assignment operator.
|
||||
|
||||
protected:
|
||||
|
||||
G4ReflectionFactory();
|
||||
// Protected singleton constructor.
|
||||
|
||||
G4ReflectionFactory(const G4ReflectionFactory&);
|
||||
G4ReflectionFactory& operator=(const G4ReflectionFactory&);
|
||||
// Disabled copy constructor and assignment operator.
|
||||
|
||||
private:
|
||||
|
||||
G4LogicalVolume* ReflectLV(G4LogicalVolume* LV, G4bool surfCheck=false);
|
||||
G4LogicalVolume* ReflectLV(G4LogicalVolume* LV, G4bool surfCheck = false);
|
||||
// Gets/creates the reflected solid and logical volume
|
||||
// and copies + transforms LV daughters.
|
||||
|
||||
@@ -202,11 +197,11 @@ class G4ReflectionFactory
|
||||
// and add the logical volumes pair in the maps.
|
||||
|
||||
void ReflectDaughters(G4LogicalVolume* LV,
|
||||
G4LogicalVolume* refLV, G4bool surfCheck=false);
|
||||
G4LogicalVolume* refLV, G4bool surfCheck = false);
|
||||
// Reflects daughters recursively.
|
||||
|
||||
void ReflectPVPlacement(G4VPhysicalVolume* PV,
|
||||
G4LogicalVolume* refLV, G4bool surfCheck=false);
|
||||
G4LogicalVolume* refLV, G4bool surfCheck = false);
|
||||
// Copies and transforms daughter of PVPlacement type of
|
||||
// a constituent volume into a reflected volume.
|
||||
|
||||
@@ -219,7 +214,7 @@ class G4ReflectionFactory
|
||||
// a constituent volume into a reflected volume.
|
||||
|
||||
void ReflectPVParameterised(G4VPhysicalVolume* PV,
|
||||
G4LogicalVolume* refLV, G4bool surfCheck=false);
|
||||
G4LogicalVolume* refLV, G4bool surfChk = false);
|
||||
// Not implemented yet.
|
||||
// Should copy and transform daughter of PVReplica type of
|
||||
// a constituent volume into a reflected volume.
|
||||
@@ -244,7 +239,7 @@ class G4ReflectionFactory
|
||||
static const G4Scale3D fScale;
|
||||
G4double fScalePrecision;
|
||||
|
||||
G4int fVerboseLevel;
|
||||
G4int fVerboseLevel = 0;
|
||||
G4String fNameExtension;
|
||||
G4ReflectedVolumesMap fConstituentLVMap;
|
||||
G4ReflectedVolumesMap fReflectedLVMap;
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4TouchableHistory
|
||||
//
|
||||
@@ -33,8 +30,7 @@
|
||||
// Object representing a touchable detector element, and its history in the
|
||||
// geometrical hierarchy, including its net resultant local->global transform.
|
||||
|
||||
// History:
|
||||
// - Created. Paul Kent, August 1996
|
||||
// Created: Paul Kent, August 1996
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4TOUCHABLEHISTORY_HH
|
||||
#define G4TOUCHABLEHISTORY_HH
|
||||
@@ -65,18 +61,18 @@ class G4TouchableHistory : public G4VTouchable
|
||||
~G4TouchableHistory();
|
||||
// Destructor
|
||||
|
||||
inline G4VPhysicalVolume* GetVolume( G4int depth=0 ) const;
|
||||
inline G4VSolid* GetSolid( G4int depth=0 ) const;
|
||||
const G4ThreeVector& GetTranslation( G4int depth=0 ) const;
|
||||
const G4RotationMatrix* GetRotation( G4int depth=0 ) const;
|
||||
inline G4VPhysicalVolume* GetVolume( G4int depth = 0 ) const;
|
||||
inline G4VSolid* GetSolid( G4int depth = 0 ) const;
|
||||
const G4ThreeVector& GetTranslation( G4int depth = 0 ) const;
|
||||
const G4RotationMatrix* GetRotation( G4int depth = 0 ) const;
|
||||
|
||||
inline G4int GetReplicaNumber( G4int depth=0 ) const;
|
||||
inline G4int GetReplicaNumber( G4int depth = 0 ) const;
|
||||
inline G4int GetHistoryDepth() const;
|
||||
G4int MoveUpHistory( G4int num_levels = 1 );
|
||||
// Access methods for touchables with history
|
||||
|
||||
void UpdateYourself( G4VPhysicalVolume* pPhysVol,
|
||||
const G4NavigationHistory* history=0 );
|
||||
const G4NavigationHistory* history = nullptr );
|
||||
// Update methods for touchables with history
|
||||
|
||||
public: // without description
|
||||
@@ -85,8 +81,8 @@ class G4TouchableHistory : public G4VTouchable
|
||||
// Should this method be "deprecated" ?
|
||||
// it is used now in G4Navigator::LocateGlobalPointAndSetup
|
||||
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aTH);
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void* aTH);
|
||||
// Override "new" and "delete" to use "G4Allocator".
|
||||
|
||||
private:
|
||||
|
||||
@@ -23,10 +23,9 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// class G4TouchableHistory inline implementation
|
||||
//
|
||||
// Created: Paul Kent, August 1996
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
extern G4GEOM_DLL G4Allocator<G4TouchableHistory>*& aTouchableHistoryAllocator();
|
||||
@@ -37,7 +36,7 @@ void G4TouchableHistory::UpdateYourself( G4VPhysicalVolume* pPhysVol,
|
||||
{
|
||||
fhistory = *pHistory;
|
||||
const G4AffineTransform& tf = fhistory.GetTopTransform();
|
||||
if( pPhysVol == 0 )
|
||||
if( pPhysVol == nullptr )
|
||||
{
|
||||
// This means that the track has left the World Volume.
|
||||
// Since the Navigation History does not already reflect this,
|
||||
@@ -52,7 +51,7 @@ void G4TouchableHistory::UpdateYourself( G4VPhysicalVolume* pPhysVol,
|
||||
inline
|
||||
G4int G4TouchableHistory::CalculateHistoryIndex( G4int stackDepth ) const
|
||||
{
|
||||
return (fhistory.GetDepth()-stackDepth); // was -1
|
||||
return G4int(fhistory.GetDepth()-stackDepth); // was -1
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -77,13 +76,13 @@ G4int G4TouchableHistory::GetReplicaNumber( G4int depth ) const
|
||||
inline
|
||||
G4int G4TouchableHistory::GetHistoryDepth() const
|
||||
{
|
||||
return fhistory.GetDepth();
|
||||
return G4int(fhistory.GetDepth());
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4TouchableHistory::MoveUpHistory( G4int num_levels )
|
||||
{
|
||||
G4int maxLevelsMove = fhistory.GetDepth();
|
||||
G4int maxLevelsMove = G4int(fhistory.GetDepth());
|
||||
G4int minLevelsMove = 0; // Cannot redescend today!
|
||||
// Soon it will be possible
|
||||
// by adding a data member here
|
||||
@@ -116,7 +115,7 @@ void* G4TouchableHistory::operator new(size_t)
|
||||
// Once the Navigator calls InitializeAllocator,
|
||||
// the if block below can be removed.
|
||||
//
|
||||
if (!aTouchableHistoryAllocator())
|
||||
if (aTouchableHistoryAllocator() == nullptr)
|
||||
{
|
||||
aTouchableHistoryAllocator() = new G4Allocator<G4TouchableHistory>;
|
||||
}
|
||||
@@ -124,7 +123,7 @@ void* G4TouchableHistory::operator new(size_t)
|
||||
}
|
||||
|
||||
inline
|
||||
void G4TouchableHistory::operator delete(void *aTH)
|
||||
void G4TouchableHistory::operator delete(void* aTH)
|
||||
{
|
||||
aTouchableHistoryAllocator()->FreeSingle((G4TouchableHistory *) aTH);
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// Class G4TouchableHistoryHandle
|
||||
//
|
||||
@@ -39,12 +37,12 @@
|
||||
|
||||
// Author: Radovan Chytracek (Radovan.Chytracek@cern.ch), March 2001
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef _G4TOUCHABLEHISTORYHANDLE_H_
|
||||
#define _G4TOUCHABLEHISTORYHANDLE_H_ 1
|
||||
#ifndef G4TOUCHABLEHISTORYHANDLE_HH
|
||||
#define G4TOUCHABLEHISTORYHANDLE_HH 1
|
||||
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4ReferenceCountedHandle.hh"
|
||||
|
||||
typedef G4ReferenceCountedHandle<G4TouchableHistory> G4TouchableHistoryHandle;
|
||||
using G4TouchableHistoryHandle = G4ReferenceCountedHandle<G4TouchableHistory>;
|
||||
|
||||
#endif // _G4TOUCHABLEHISTORYHANDLE_H_
|
||||
#endif // G4TOUCHABLEHISTORYHANDLE_HH
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4VExternalPhysicalVolume
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// Base class to represent a physical volume managed by an external
|
||||
// sub-navigator.
|
||||
//
|
||||
// Intial assumptions:
|
||||
// * volume type is similar to G4PVPlacement -- not replicated
|
||||
// * external navigator may provide 'many'/Boolean operation
|
||||
|
||||
// Author: J.Apostolakis, October 2019
|
||||
// ----------------------------------------------------------------------
|
||||
#ifndef G4VEXTERNALPHYSICSVOLUME_HH
|
||||
#define G4VEXTERNALPHYSICSVOLUME_HH
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
|
||||
class G4VExternalPhysicalVolume : public G4VPhysicalVolume
|
||||
{
|
||||
public: // with description
|
||||
|
||||
G4VExternalPhysicalVolume( G4RotationMatrix* pRot,
|
||||
const G4ThreeVector& tlate,
|
||||
G4LogicalVolume* pCurrentLogical,
|
||||
const G4String& pName,
|
||||
G4VPhysicalVolume* pMother );
|
||||
|
||||
G4VExternalPhysicalVolume(const G4VExternalPhysicalVolume&) = delete;
|
||||
G4VExternalPhysicalVolume& operator=(const G4VExternalPhysicalVolume&) = delete;
|
||||
// Forbidden copy constructor and assignment operator.
|
||||
|
||||
virtual ~G4VExternalPhysicalVolume();
|
||||
// Default destructor.
|
||||
|
||||
virtual G4bool CheckOverlaps(G4int res=1000, G4double tol=0.,
|
||||
G4bool verbose=true, G4int maxErr=1) = 0;
|
||||
// Verifies if the placed volume is overlapping with existing
|
||||
// daughters or with the mother volume. Provides default resolution
|
||||
// for the number of points to be generated and verified.
|
||||
// A tolerance for the precision of the overlap check can be specified,
|
||||
// by default it is set to maximum precision.
|
||||
// Reports a maximum of overlaps errors according to parameter in input.
|
||||
// Returns true if the volume is overlapping.
|
||||
|
||||
public: // without description
|
||||
|
||||
G4VExternalPhysicalVolume(__void__&);
|
||||
// Fake default constructor for usage restricted to direct object
|
||||
// persistency for clients requiring preallocation of memory for
|
||||
// persistifiable objects.
|
||||
|
||||
EVolume VolumeType() const final;
|
||||
G4bool IsMany() const final;
|
||||
|
||||
G4bool IsReplicated() const final;
|
||||
G4bool IsParameterised() const final;
|
||||
G4VPVParameterisation* GetParameterisation() const final;
|
||||
void GetReplicationData(EAxis& axis,
|
||||
G4int& nReplicas,
|
||||
G4double& width,
|
||||
G4double& offset,
|
||||
G4bool& consuming) const final;
|
||||
|
||||
// Methods for use with Regular Navigation
|
||||
//
|
||||
G4bool IsRegularStructure() const final;
|
||||
G4int GetRegularStructureId() const final;
|
||||
|
||||
void SetMany(G4bool overlap);
|
||||
// Set the 'many' flag
|
||||
|
||||
private:
|
||||
|
||||
G4bool fMany = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user