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

#include <G4OpticalSurface.hh>

+ Inheritance diagram for G4OpticalSurface:

Public Member Functions

 G4OpticalSurface (const G4OpticalSurface &right)
 
G4OpticalSurfaceoperator= (const G4OpticalSurface &right)
 
G4int operator== (const G4OpticalSurface &right) const
 
G4int operator!= (const G4OpticalSurface &right) const
 
 G4OpticalSurface (const G4String &name, G4OpticalSurfaceModel model=glisur, G4OpticalSurfaceFinish finish=polished, G4SurfaceType type=dielectric_dielectric, G4double value=1.0)
 
virtual ~G4OpticalSurface ()
 
void SetType (const G4SurfaceType &type)
 
G4OpticalSurfaceFinish GetFinish () const
 
void SetFinish (const G4OpticalSurfaceFinish)
 
G4OpticalSurfaceModel GetModel () const
 
void SetModel (const G4OpticalSurfaceModel model)
 
G4double GetSigmaAlpha () const
 
void SetSigmaAlpha (const G4double s_a)
 
G4double GetPolish () const
 
void SetPolish (const G4double plsh)
 
G4MaterialPropertiesTableGetMaterialPropertiesTable () const
 
void SetMaterialPropertiesTable (G4MaterialPropertiesTable *anMPT)
 
void DumpInfo () const
 
void ReadFile (void)
 
G4double GetAngularDistributionValue (G4int, G4int, G4int)
 
G4int GetThetaIndexMax (void) const
 
G4int GetPhiIndexMax (void) const
 
- Public Member Functions inherited from G4SurfaceProperty
 G4SurfaceProperty (const G4String &name, G4SurfaceType type=x_ray)
 
 G4SurfaceProperty ()
 
virtual ~G4SurfaceProperty ()
 
const G4StringGetName () const
 
void SetName (const G4String &name)
 
const G4SurfaceTypeGetType () const
 
void SetType (const G4SurfaceType &type)
 

Additional Inherited Members

- Static Public Member Functions inherited from G4SurfaceProperty
static void CleanSurfacePropertyTable ()
 
static const G4SurfacePropertyTableGetSurfacePropertyTable ()
 
static size_t GetNumberOfSurfaceProperties ()
 
static void DumpTableInfo ()
 
- Protected Attributes inherited from G4SurfaceProperty
G4String theName
 
G4SurfaceType theType
 
- Static Protected Attributes inherited from G4SurfaceProperty
static G4SurfacePropertyTable theSurfacePropertyTable
 

Detailed Description

Definition at line 111 of file G4OpticalSurface.hh.

Constructor & Destructor Documentation

◆ G4OpticalSurface() [1/2]

G4OpticalSurface::G4OpticalSurface ( const G4OpticalSurface right)

Definition at line 117 of file G4OpticalSurface.cc.

118 : G4SurfaceProperty(right.theName,right.theType)
119{
120 *this = right;
121 this->theMaterialPropertiesTable = right.theMaterialPropertiesTable;
122 this->AngularDistribution = right.AngularDistribution;
123 this->readFileHandle = right.readFileHandle;
124}

◆ G4OpticalSurface() [2/2]

G4OpticalSurface::G4OpticalSurface ( const G4String name,
G4OpticalSurfaceModel  model = glisur,
G4OpticalSurfaceFinish  finish = polished,
G4SurfaceType  type = dielectric_dielectric,
G4double  value = 1.0 
)

Definition at line 75 of file G4OpticalSurface.cc.

80 : G4SurfaceProperty(name,type),
81 theModel(model),
82 theFinish(finish),
83 theMaterialPropertiesTable(0)
84{
85 if (model == glisur ){
86 polish = value;
87 sigma_alpha = 0.0;
88 }
89 else if ( model == unified ) {
90 sigma_alpha = value;
91 polish = 0.0;
92 }
93 else if ( model == LUT ) {
94 sigma_alpha = value;
95 polish = 0.0;
96 }
97 else {
98 G4Exception("G4OpticalSurface::G4OpticalSurface()", "mat309",
100 "Constructor called with INVALID model.");
101 }
102
103 AngularDistribution = NULL;
104
105 if (type == dielectric_LUT) {
106 AngularDistribution =
107 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
108 ReadFile();
109 }
110}
@ FatalException
@ unified
@ glisur
@ dielectric_LUT
float G4float
Definition: G4Types.hh:65
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ ~G4OpticalSurface()

G4OpticalSurface::~G4OpticalSurface ( )
virtual

Definition at line 112 of file G4OpticalSurface.cc.

113{
114 if (AngularDistribution) delete AngularDistribution;
115}

Member Function Documentation

◆ DumpInfo()

void G4OpticalSurface::DumpInfo ( ) const

Definition at line 139 of file G4OpticalSurface.cc.

140{
141
142 // Dump info for surface
143
144 G4cout <<
145 " Surface type = " << G4int(theType) << G4endl <<
146 " Surface finish = " << G4int(theFinish) << G4endl <<
147 " Surface model = " << G4int(theModel) << G4endl;
148
149 G4cout << G4endl;
150
151 G4cout << " Surface parameter " << G4endl;
152 G4cout << " ----------------- " << G4endl;
153 if (theModel == glisur ){
154 G4cout << polish << G4endl;
155 }
156 else if (theModel == LUT ){
157 G4cout << sigma_alpha << G4endl;
158 }
159 else {
160 G4cout << sigma_alpha << G4endl;
161 }
162 G4cout << G4endl;
163}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

◆ GetAngularDistributionValue()

G4double G4OpticalSurface::GetAngularDistributionValue ( G4int  angleIncident,
G4int  thetaIndex,
G4int  phiIndex 
)
inline

Definition at line 224 of file G4OpticalSurface.hh.

227{
228 return AngularDistribution[angleIncident+
229 thetaIndex*incidentIndexMax+
230 phiIndex*thetaIndexMax*incidentIndexMax];
231}

◆ GetFinish()

G4OpticalSurfaceFinish G4OpticalSurface::GetFinish ( ) const
inline

Definition at line 153 of file G4OpticalSurface.hh.

153{ return theFinish; }

Referenced by G4GDMLWriteSolids::OpticalSurfaceWrite(), and G4OpBoundaryProcess::PostStepDoIt().

◆ GetMaterialPropertiesTable()

G4MaterialPropertiesTable * G4OpticalSurface::GetMaterialPropertiesTable ( ) const
inline

Definition at line 174 of file G4OpticalSurface.hh.

175 { return theMaterialPropertiesTable; }

◆ GetModel()

G4OpticalSurfaceModel G4OpticalSurface::GetModel ( ) const
inline

Definition at line 158 of file G4OpticalSurface.hh.

158{ return theModel; }

Referenced by G4GDMLWriteSolids::OpticalSurfaceWrite(), and G4OpBoundaryProcess::PostStepDoIt().

◆ GetPhiIndexMax()

G4int G4OpticalSurface::GetPhiIndexMax ( void  ) const
inline

Definition at line 192 of file G4OpticalSurface.hh.

192{ return phiIndexMax; }

◆ GetPolish()

G4double G4OpticalSurface::GetPolish ( ) const
inline

Definition at line 169 of file G4OpticalSurface.hh.

169{ return polish; }

Referenced by G4GDMLWriteSolids::OpticalSurfaceWrite().

◆ GetSigmaAlpha()

G4double G4OpticalSurface::GetSigmaAlpha ( ) const
inline

Definition at line 164 of file G4OpticalSurface.hh.

164{ return sigma_alpha; }

Referenced by G4GDMLWriteSolids::OpticalSurfaceWrite().

◆ GetThetaIndexMax()

G4int G4OpticalSurface::GetThetaIndexMax ( void  ) const
inline

Definition at line 191 of file G4OpticalSurface.hh.

191{ return thetaIndexMax; }

◆ operator!=()

G4int G4OpticalSurface::operator!= ( const G4OpticalSurface right) const

Definition at line 131 of file G4OpticalSurface.cc.

132{
133 return (this != (G4OpticalSurface *) &right);
134}

◆ operator=()

G4OpticalSurface & G4OpticalSurface::operator= ( const G4OpticalSurface right)

Definition at line 54 of file G4OpticalSurface.cc.

55{
56 if (this != &right)
57 {
58 theName = right.theName;
59 theType = right.theType;
60 theModel = right.theModel;
61 theFinish = right.theFinish;
62 sigma_alpha = right.sigma_alpha;
63 polish = right.polish;
64 theMaterialPropertiesTable = right.theMaterialPropertiesTable;
65 AngularDistribution = right.AngularDistribution;
66 readFileHandle = right.readFileHandle;
67 }
68 return *this;
69}

◆ operator==()

G4int G4OpticalSurface::operator== ( const G4OpticalSurface right) const

Definition at line 126 of file G4OpticalSurface.cc.

127{
128 return (this == (G4OpticalSurface *) &right);
129}

◆ ReadFile()

void G4OpticalSurface::ReadFile ( void  )

Definition at line 185 of file G4OpticalSurface.cc.

186{
187 G4String readFileName = " ";
188
189 if (theFinish == polishedlumirrorglue) {
190 readFileName = "PolishedLumirrorGlue.dat";
191 }
192 else if (theFinish == polishedlumirrorair) {
193 readFileName = "PolishedLumirror.dat";
194 }
195 else if (theFinish == polishedteflonair) {
196 readFileName = "PolishedTeflon.dat";
197 }
198 else if (theFinish == polishedtioair) {
199 readFileName = "PolishedTiO.dat";
200 }
201 else if (theFinish == polishedtyvekair) {
202 readFileName = "PolishedTyvek.dat";
203 }
204 else if (theFinish == polishedvm2000glue) {
205 readFileName = "PolishedVM2000Glue.dat";
206 }
207 else if (theFinish == polishedvm2000air) {
208 readFileName = "PolishedVM2000.dat";
209 }
210 else if (theFinish == etchedlumirrorglue) {
211 readFileName = "EtchedLumirrorGlue.dat";
212 }
213 else if (theFinish == etchedlumirrorair) {
214 readFileName = "EtchedLumirror.dat";
215 }
216 else if (theFinish == etchedteflonair) {
217 readFileName = "EtchedTeflon.dat";
218 }
219 else if (theFinish == etchedtioair) {
220 readFileName = "EtchedTiO.dat";
221 }
222 else if (theFinish == etchedtyvekair) {
223 readFileName = "EtchedTyvek.dat";
224 }
225 else if (theFinish == etchedvm2000glue) {
226 readFileName = "EtchedVM2000Glue.dat";
227 }
228 else if (theFinish == etchedvm2000air) {
229 readFileName = "EtchedVM2000.dat";
230 }
231 else if (theFinish == groundlumirrorglue) {
232 readFileName = "GroundLumirrorGlue.dat";
233 }
234 else if (theFinish == groundlumirrorair) {
235 readFileName = "GroundLumirror.dat";
236 }
237 else if (theFinish == groundteflonair) {
238 readFileName = "GroundTeflon.dat";
239 }
240 else if (theFinish == groundtioair) {
241 readFileName = "GroundTiO.dat";
242 }
243 else if (theFinish == groundtyvekair) {
244 readFileName = "GroundTyvek.dat";
245 }
246 else if (theFinish == groundvm2000glue) {
247 readFileName = "GroundVM2000Glue.dat";
248 }
249 else if (theFinish == groundvm2000air) {
250 readFileName = "GroundVM2000.dat";
251 }
252
253 if (readFileName == " ") return;
254
255 char* path = getenv("G4REALSURFACEDATA");
256 if (!path) {
257 G4String excep =
258 "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
259 G4Exception("G4OpticalSurface::ReadFile()", "mat310",
260 FatalException, excep);
261 return;
262 }
263 G4String pathString(path);
264
265 readFileName = pathString + "/" + readFileName;
266
267 readFileHandle = fopen(readFileName,"r");
268
269 if (readFileHandle) {
270 G4int ncols;
271 G4int idxmax = incidentIndexMax*thetaIndexMax*phiIndexMax;
272 for (G4int i = 0; i<idxmax; i++) {
273 ncols = fscanf(readFileHandle,"%6f", &AngularDistribution[i]);
274 if (ncols < 0) break;
275 }
276 if (ncols >= 0) {
277 G4cout << "LUT - data file: " << readFileName << " read in! " << G4endl;
278 }
279 else {
280 G4String excep = "LUT - data file: "+ readFileName +" not read propery";
281 G4Exception("G4OpticalSurface::ReadFile()", "mat312",
282 FatalException, excep);
283 return;
284 }
285 }
286 else {
287 G4String excep = "LUT - data file: " + readFileName + " not found";
288 G4Exception("G4OpticalSurface::ReadFile()", "mat311",
289 FatalException, excep);
290 return;
291 }
292 fclose(readFileHandle);
293}
@ polishedlumirrorair
@ groundtyvekair
@ groundtioair
@ groundvm2000glue
@ etchedteflonair
@ etchedtyvekair
@ etchedvm2000glue
@ etchedtioair
@ groundvm2000air
@ polishedlumirrorglue
@ polishedtyvekair
@ polishedteflonair
@ polishedvm2000air
@ etchedlumirrorglue
@ polishedvm2000glue
@ polishedtioair
@ groundlumirrorglue
@ etchedvm2000air
@ etchedlumirrorair
@ groundlumirrorair
@ groundteflonair

Referenced by G4OpticalSurface(), SetFinish(), and SetType().

◆ SetFinish()

void G4OpticalSurface::SetFinish ( const G4OpticalSurfaceFinish  finish)

Definition at line 175 of file G4OpticalSurface.cc.

176{
177 theFinish = finish;
178 if (theType == dielectric_LUT) {
179 if (!AngularDistribution) AngularDistribution =
180 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
181 ReadFile();
182 }
183}

◆ SetMaterialPropertiesTable()

void G4OpticalSurface::SetMaterialPropertiesTable ( G4MaterialPropertiesTable anMPT)
inline

Definition at line 179 of file G4OpticalSurface.hh.

180 { theMaterialPropertiesTable = anMPT; }

◆ SetModel()

void G4OpticalSurface::SetModel ( const G4OpticalSurfaceModel  model)
inline

Definition at line 160 of file G4OpticalSurface.hh.

161 { theModel = model; }

◆ SetPolish()

void G4OpticalSurface::SetPolish ( const G4double  plsh)
inline

Definition at line 171 of file G4OpticalSurface.hh.

171{ polish=plsh; }

◆ SetSigmaAlpha()

void G4OpticalSurface::SetSigmaAlpha ( const G4double  s_a)
inline

Definition at line 166 of file G4OpticalSurface.hh.

166{ sigma_alpha = s_a; }

◆ SetType()

void G4OpticalSurface::SetType ( const G4SurfaceType type)

Definition at line 165 of file G4OpticalSurface.cc.

166{
167 theType = type;
168 if (type == dielectric_LUT) {
169 if (!AngularDistribution) AngularDistribution =
170 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
171 ReadFile();
172 }
173}

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