Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LogicalSkinSurface.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4LogicalSkinSurface Implementation
27//
28// A Logical Surface class for the surface surrounding a single
29// logical volume.
30//
31// Author: John Apostolakis, CERN - 26-06-1997
32// --------------------------------------------------------------------
33
35#include "G4LogicalVolume.hh"
36
37G4LogicalSkinSurfaceTable *G4LogicalSkinSurface::theSkinSurfaceTable = nullptr;
38
39// --------------------------------------------------------------------
40// Constructor
41//
43 G4LogicalVolume* logicalVolume,
44 G4SurfaceProperty* surfaceProperty)
45 : G4LogicalSurface(name, surfaceProperty),
46 LogVolume(logicalVolume)
47{
48 if (theSkinSurfaceTable == nullptr)
49 {
50 theSkinSurfaceTable = new G4LogicalSkinSurfaceTable;
51 }
52 // Store in the table of Surfaces
53 //
54 theSkinSurfaceTable->insert(std::make_pair(logicalVolume, this));
55}
56
57// --------------------------------------------------------------------
58// Default destructor
59//
61
62// --------------------------------------------------------------------
65{
66 return (this == (G4LogicalSkinSurface *) &right);
67}
68
69// --------------------------------------------------------------------
72{
73 return (this != (G4LogicalSkinSurface *) &right);
74}
75
76// --------------------------------------------------------------------
78{
79 if (theSkinSurfaceTable == nullptr)
80 {
81 theSkinSurfaceTable = new G4LogicalSkinSurfaceTable;
82 }
83 return theSkinSurfaceTable;
84}
85
86// --------------------------------------------------------------------
88{
89 if (theSkinSurfaceTable != nullptr)
90 {
91 return theSkinSurfaceTable->size();
92 }
93 return 0;
94}
95
96// --------------------------------------------------------------------
99{
100 if (theSkinSurfaceTable != nullptr)
101 {
102 auto pos = theSkinSurfaceTable->find(vol);
103 if(pos != theSkinSurfaceTable->cend()) return pos->second;
104 }
105 return nullptr;
106}
107
108// --------------------------------------------------------------------
109// Dump info for known surfaces
110//
112{
113 G4cout << "***** Skin Surface Table : Nb of Surfaces = "
114 << GetNumberOfSkinSurfaces() << " *****" << G4endl;
115
116 if (theSkinSurfaceTable != nullptr)
117 {
118 for(const auto & pos : *theSkinSurfaceTable)
119 {
120 G4LogicalSkinSurface* pSurf = pos.second;
121 G4cout << pSurf->GetName() << " : " << G4endl
122 << " Skin of logical volume "
123 << pSurf->GetLogicalVolume()->GetName()
124 << G4endl;
125 }
126 }
127 G4cout << G4endl;
128}
129
130// --------------------------------------------------------------------
132{
133 if (theSkinSurfaceTable != nullptr)
134 {
135 for(const auto & pos : *theSkinSurfaceTable)
136 {
137 delete pos.second;
138 }
139 theSkinSurfaceTable->clear();
140 }
141 return;
142}
std::map< const G4LogicalVolume *, G4LogicalSkinSurface * > G4LogicalSkinSurfaceTable
bool G4bool
Definition G4Types.hh:86
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4LogicalSkinSurface * GetSurface(const G4LogicalVolume *vol)
G4bool operator==(const G4LogicalSkinSurface &right) const
const G4LogicalVolume * GetLogicalVolume() const
G4LogicalSkinSurface(const G4String &name, G4LogicalVolume *vol, G4SurfaceProperty *surfaceProperty)
static const G4LogicalSkinSurfaceTable * GetSurfaceTable()
~G4LogicalSkinSurface() override
static std::size_t GetNumberOfSkinSurfaces()
G4bool operator!=(const G4LogicalSkinSurface &right) const
const G4String & GetName() const
const G4String & GetName() const