Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LogicalBorderSurface Class Reference

G4LogicalBorderSurface is a Logical Surface class for surfaces defined by the boundary of two physical volumes. More...

#include <G4LogicalBorderSurface.hh>

Inheritance diagram for G4LogicalBorderSurface:

Public Member Functions

 G4LogicalBorderSurface (const G4String &name, G4VPhysicalVolume *vol1, G4VPhysicalVolume *vol2, G4SurfaceProperty *surfaceProperty)
 ~G4LogicalBorderSurface () override=default
 G4LogicalBorderSurface (const G4LogicalBorderSurface &)=delete
G4LogicalBorderSurfaceoperator= (const G4LogicalBorderSurface &)=delete
G4bool operator== (const G4LogicalBorderSurface &right) const
G4bool operator!= (const G4LogicalBorderSurface &right) const
void SetPhysicalVolumes (G4VPhysicalVolume *vol1, G4VPhysicalVolume *vol2)
const G4VPhysicalVolumeGetVolume1 () const
const G4VPhysicalVolumeGetVolume2 () const
std::size_t GetIndex () const
void SetVolume1 (G4VPhysicalVolume *vol1)
void SetVolume2 (G4VPhysicalVolume *vol2)
Public Member Functions inherited from G4LogicalSurface
virtual ~G4LogicalSurface ()=default
 G4LogicalSurface (const G4LogicalSurface &)=delete
G4LogicalSurfaceoperator= (const G4LogicalSurface &)=delete
G4SurfacePropertyGetSurfaceProperty () const
void SetSurfaceProperty (G4SurfaceProperty *ptrSurfaceProperty)
const G4StringGetName () const
void SetName (const G4String &name)
G4TransitionRadiationSurface * GetTransitionRadiationSurface () const
void SetTransitionRadiationSurface (G4TransitionRadiationSurface *trs)
G4bool operator== (const G4LogicalSurface &right) const
G4bool operator!= (const G4LogicalSurface &right) const

Static Public Member Functions

static G4LogicalBorderSurfaceGetSurface (const G4VPhysicalVolume *vol1, const G4VPhysicalVolume *vol2)
static void CleanSurfaceTable ()
static const G4LogicalBorderSurfaceTableGetSurfaceTable ()
static std::size_t GetNumberOfBorderSurfaces ()
static void DumpInfo ()

Additional Inherited Members

Protected Member Functions inherited from G4LogicalSurface
 G4LogicalSurface (const G4String &name, G4SurfaceProperty *prop)

Detailed Description

G4LogicalBorderSurface is a Logical Surface class for surfaces defined by the boundary of two physical volumes.

Definition at line 54 of file G4LogicalBorderSurface.hh.

Constructor & Destructor Documentation

◆ G4LogicalBorderSurface() [1/2]

G4LogicalBorderSurface::G4LogicalBorderSurface ( const G4String & name,
G4VPhysicalVolume * vol1,
G4VPhysicalVolume * vol2,
G4SurfaceProperty * surfaceProperty )

Constructor and Destructor.

Definition at line 41 of file G4LogicalBorderSurface.cc.

46 : G4LogicalSurface(name, surfaceProperty),
47 Volume1(vol1), Volume2(vol2),
48 Index(theBorderSurfaceTable != nullptr ? theBorderSurfaceTable->size() : 0)
49{
50 if (theBorderSurfaceTable == nullptr)
51 {
52 theBorderSurfaceTable = new G4LogicalBorderSurfaceTable;
53 }
54
55 // Store in the table of Surfaces
56 //
57 theBorderSurfaceTable->insert(std::make_pair(std::make_pair(vol1,vol2),this));
58}
std::map< std::pair< const G4VPhysicalVolume *, const G4VPhysicalVolume * >, G4LogicalBorderSurface * > G4LogicalBorderSurfaceTable
G4LogicalSurface(const G4LogicalSurface &)=delete

Referenced by DumpInfo(), operator!=(), operator=(), and operator==().

◆ ~G4LogicalBorderSurface()

G4LogicalBorderSurface::~G4LogicalBorderSurface ( )
overridedefault

◆ G4LogicalBorderSurface() [2/2]

G4LogicalBorderSurface::G4LogicalBorderSurface ( const G4LogicalBorderSurface & )
delete

Copy constructor and assignment operator are not allowed.

Member Function Documentation

◆ CleanSurfaceTable()

void G4LogicalBorderSurface::CleanSurfaceTable ( )
static

Handling of the table of surfaces.

Definition at line 130 of file G4LogicalBorderSurface.cc.

131{
132 if (theBorderSurfaceTable == nullptr) { return; }
133
134 // Do nothing if geometry is closed
135 if (G4GeometryManager::GetInstance()->IsGeometryClosed())
136 {
137 G4cout << "WARNING - Attempt to clear the border surface store"
138 << " while geometry closed !" << G4endl;
139 return;
140 }
141
142 for (const auto& pos : *theBorderSurfaceTable)
143 {
144 delete pos.second;
145 }
146 theBorderSurfaceTable->clear();
147}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4GeometryManager * GetInstance()

Referenced by G4RunManager::ReinitializeGeometry().

◆ DumpInfo()

void G4LogicalBorderSurface::DumpInfo ( )
static

Definition at line 110 of file G4LogicalBorderSurface.cc.

111{
112 G4cout << "***** Surface Table : Nb of Surfaces = "
113 << GetNumberOfBorderSurfaces() << " *****" << G4endl;
114
115 if (theBorderSurfaceTable != nullptr)
116 {
117 for(const auto & pos : *theBorderSurfaceTable)
118 {
119 G4LogicalBorderSurface* pSurf = pos.second;
120 G4cout << pSurf->GetName() << " : " << G4endl
121 << " Border of volumes "
122 << pSurf->GetVolume1()->GetName() << " and "
123 << pSurf->GetVolume2()->GetName() << G4endl;
124 }
125 }
126 G4cout << G4endl;
127}
static std::size_t GetNumberOfBorderSurfaces()
const G4VPhysicalVolume * GetVolume2() const
G4LogicalBorderSurface(const G4String &name, G4VPhysicalVolume *vol1, G4VPhysicalVolume *vol2, G4SurfaceProperty *surfaceProperty)
const G4VPhysicalVolume * GetVolume1() const
const G4String & GetName() const
const G4String & GetName() const

◆ GetIndex()

std::size_t G4LogicalBorderSurface::GetIndex ( ) const
inline

◆ GetNumberOfBorderSurfaces()

std::size_t G4LogicalBorderSurface::GetNumberOfBorderSurfaces ( )
static

Definition at line 85 of file G4LogicalBorderSurface.cc.

86{
87 if (theBorderSurfaceTable != nullptr)
88 {
89 return theBorderSurfaceTable->size();
90 }
91 return 0;
92}

Referenced by DumpInfo(), and G4GDMLWriteStructure::GetBorderSurface().

◆ GetSurface()

G4LogicalBorderSurface * G4LogicalBorderSurface::GetSurface ( const G4VPhysicalVolume * vol1,
const G4VPhysicalVolume * vol2 )
static

Generic accessors and setters.

Definition at line 96 of file G4LogicalBorderSurface.cc.

98{
99 if (theBorderSurfaceTable != nullptr)
100 {
101 auto pos = theBorderSurfaceTable->find(std::make_pair(vol1,vol2));
102 if(pos != theBorderSurfaceTable->cend()) { return pos->second; }
103 }
104 return nullptr;
105}

Referenced by G4MicroElecSurface::PostStepDoIt(), and G4OpBoundaryProcess::PostStepDoIt().

◆ GetSurfaceTable()

const G4LogicalBorderSurfaceTable * G4LogicalBorderSurface::GetSurfaceTable ( )
static

Definition at line 75 of file G4LogicalBorderSurface.cc.

76{
77 if (theBorderSurfaceTable == nullptr)
78 {
79 theBorderSurfaceTable = new G4LogicalBorderSurfaceTable;
80 }
81 return theBorderSurfaceTable;
82}

Referenced by G4GDMLWriteStructure::GetBorderSurface().

◆ GetVolume1()

const G4VPhysicalVolume * G4LogicalBorderSurface::GetVolume1 ( ) const
inline

◆ GetVolume2()

const G4VPhysicalVolume * G4LogicalBorderSurface::GetVolume2 ( ) const
inline

◆ operator!=()

G4bool G4LogicalBorderSurface::operator!= ( const G4LogicalBorderSurface & right) const

Definition at line 69 of file G4LogicalBorderSurface.cc.

70{
71 return (this != (G4LogicalBorderSurface *) &right);
72}

◆ operator=()

G4LogicalBorderSurface & G4LogicalBorderSurface::operator= ( const G4LogicalBorderSurface & )
delete

◆ operator==()

G4bool G4LogicalBorderSurface::operator== ( const G4LogicalBorderSurface & right) const

Equality operators.

Definition at line 62 of file G4LogicalBorderSurface.cc.

63{
64 return (this == (G4LogicalBorderSurface *) &right);
65}

◆ SetPhysicalVolumes()

void G4LogicalBorderSurface::SetPhysicalVolumes ( G4VPhysicalVolume * vol1,
G4VPhysicalVolume * vol2 )
inline

◆ SetVolume1()

void G4LogicalBorderSurface::SetVolume1 ( G4VPhysicalVolume * vol1)
inline

◆ SetVolume2()

void G4LogicalBorderSurface::SetVolume2 ( G4VPhysicalVolume * vol2)
inline

The documentation for this class was generated from the following files: