ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4LogicalSkinSurface.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4LogicalSkinSurface.cc
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 (John.Apostolakis@cern.ch), 26-06-1997
32 // ----------------------------------------------------------------------
33 
34 #include "G4LogicalSkinSurface.hh"
35 #include "G4LogicalVolume.hh"
36 
38 
39 //
40 // Constructors & destructor
41 //
42 
44  G4LogicalVolume* logicalVolume,
45  G4SurfaceProperty* surfaceProperty)
46  : G4LogicalSurface(name, surfaceProperty),
47  LogVolume(logicalVolume)
48 {
49  if (theSkinSurfaceTable == nullptr)
50  {
52  }
53  // Store in the table of Surfaces
54  //
55  theSkinSurfaceTable->push_back(this);
56 }
57 
59 {
60 }
61 
62 //
63 // Operators
64 //
65 
66 G4bool
68 {
69  return (this == (G4LogicalSkinSurface *) &right);
70 }
71 
72 G4bool
74 {
75  return (this != (G4LogicalSkinSurface *) &right);
76 }
77 
78 //
79 // Methods
80 //
81 
83 {
84  if (theSkinSurfaceTable == nullptr)
85  {
87  }
88  return theSkinSurfaceTable;
89 }
90 
92 {
93  if (theSkinSurfaceTable != nullptr)
94  {
95  return theSkinSurfaceTable->size();
96  }
97  return 0;
98 }
99 
102 {
103  if (theSkinSurfaceTable != nullptr)
104  {
105  for(auto pos = theSkinSurfaceTable->cbegin();
106  pos != theSkinSurfaceTable->cend(); ++pos)
107  {
108  if ((*pos)->GetLogicalVolume() == vol) { return *pos; }
109  }
110  }
111  return nullptr;
112 }
113 
114 // Dump info for known surfaces
115 //
117 {
118  G4cout << "***** Skin Surface Table : Nb of Surfaces = "
119  << GetNumberOfSkinSurfaces() << " *****" << G4endl;
120 
121  if (theSkinSurfaceTable != nullptr)
122  {
123  for(auto pos = theSkinSurfaceTable->cbegin();
124  pos != theSkinSurfaceTable->cend(); ++pos)
125  {
126  G4cout << (*pos)->GetName() << " : " << G4endl
127  << " Skin of logical volume "
128  << (*pos)->GetLogicalVolume()->GetName()
129  << G4endl;
130  }
131  }
132  G4cout << G4endl;
133 }
134 
136 {
138  {
139  for(auto pos = theSkinSurfaceTable->cbegin();
140  pos != theSkinSurfaceTable->cend(); ++pos)
141  {
142  if (*pos) { delete *pos; }
143  }
144  theSkinSurfaceTable->clear();
145  }
146  return;
147 }