Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4OpticalSurface.hh
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//
27//
28//
29////////////////////////////////////////////////////////////////////////
30// G4OpticalSurface Definition
31////////////////////////////////////////////////////////////////////////
32//
33// File: G4OpticalSurface.hh
34// Description: A optical surface class for use in G4OpBoundaryProcess
35// Version: 2.0
36// Created: 1997-06-26
37// Author: Peter Gumplinger
38// Updated: 1999-10-29 add method and class descriptors
39// 2017-02-24 Mariele Stockhoff add DAVIS model
40//
41////////////////////////////////////////////////////////////////////////
42
43#ifndef G4OpticalSurface_h
44#define G4OpticalSurface_h 1
45
46#include "G4Types.hh"
47#include "G4Physics2DVector.hh"
48#include "G4SurfaceProperty.hh"
49
50// Class Description:
51// A optical surface class for use in the G4OpBoundaryProcess class.
52// Contains the enumerations: G4OpticalSurfaceFinish, G4OpticalSurfaceType,
53// and G4OpticalSurfaceModel.
54// Class Description - End:
55
57{
58 polished, // smooth perfectly polished surface
59 polishedfrontpainted, // smooth top-layer (front) paint
60 polishedbackpainted, // same is 'polished' but with a back-paint
61
62 ground, // rough surface
63 groundfrontpainted, // rough top-layer (front) paint
64 groundbackpainted, // same as 'ground' but with a back-paint
65
66 // for LBNL LUT model
67 polishedlumirrorair, // mechanically polished surface, with lumirror
68 polishedlumirrorglue, // mechanically polished surface, with lumirror &
69 // meltmount
70 polishedair, // mechanically polished surface
71 polishedteflonair, // mechanically polished surface, with teflon
72 polishedtioair, // mechanically polished surface, with tio paint
73 polishedtyvekair, // mechanically polished surface, with tyvek
74 polishedvm2000air, // mechanically polished surface, with esr film
75 polishedvm2000glue, // mechanically polished surface, with esr film &
76 // meltmount
77
78 etchedlumirrorair, // chemically etched surface, with lumirror
79 etchedlumirrorglue, // chemically etched surface, with lumirror & meltmount
80 etchedair, // chemically etched surface
81 etchedteflonair, // chemically etched surface, with teflon
82 etchedtioair, // chemically etched surface, with tio paint
83 etchedtyvekair, // chemically etched surface, with tyvek
84 etchedvm2000air, // chemically etched surface, with esr film
85 etchedvm2000glue, // chemically etched surface, with esr film & meltmount
86
87 groundlumirrorair, // rough-cut surface, with lumirror
88 groundlumirrorglue, // rough-cut surface, with lumirror & meltmount
89 groundair, // rough-cut surface
90 groundteflonair, // rough-cut surface, with teflon
91 groundtioair, // rough-cut surface, with tio paint
92 groundtyvekair, // rough-cut surface, with tyvek
93 groundvm2000air, // rough-cut surface, with esr film
94 groundvm2000glue, // rough-cut surface, with esr film & meltmount
95
96 // for DAVIS model
97 Rough_LUT, // rough surface
98 RoughTeflon_LUT, // rough surface wrapped in Teflon tape
99 RoughESR_LUT, // rough surface wrapped with ESR
100 RoughESRGrease_LUT, // rough surface wrapped with ESR
101 // and coupled with optical grease
102 Polished_LUT, // polished surface
103 PolishedTeflon_LUT, // polished surface wrapped in Teflon tape
104 PolishedESR_LUT, // polished surface wrapped with ESR
105 PolishedESRGrease_LUT, // polished surface wrapped with ESR
106 // and coupled with optical grease
107 Detector_LUT // polished surface with optical grease
109
111{
112 glisur, // original GEANT3 model
113 unified, // UNIFIED model
114 LUT, // Look-Up-Table model (LBNL model)
115 DAVIS, // DAVIS model
116 dichroic // dichroic filter
118
120
122{
123 public:
126
127 G4bool operator==(const G4OpticalSurface& right) const;
128 G4bool operator!=(const G4OpticalSurface& right) const;
129
133 G4double value = 1.0);
134 // Constructor of an optical surface object.
135
136 ~G4OpticalSurface() override;
137
138 void SetType(const G4SurfaceType& type) override;
139
140 inline G4OpticalSurfaceFinish GetFinish() const { return theFinish; }
141 // Returns the optical surface finish.
143 // Sets the optical surface finish.
144
145 inline G4OpticalSurfaceModel GetModel() const { return theModel; }
146 // Returns the optical surface model used.
147 inline void SetModel(const G4OpticalSurfaceModel model) { theModel = model; }
148 // Sets the optical surface model to be followed.
149
150 inline G4double GetSigmaAlpha() const { return sigma_alpha; }
151 // Returns an unified model surface parameter.
152 inline void SetSigmaAlpha(const G4double s_a) { sigma_alpha = s_a; }
153 // Sets an unified model surface parameter.
154
155 G4double GetPolish() const { return polish; }
156 // Returns the optical surface polish type.
157 inline void SetPolish(const G4double plsh) { polish = plsh; }
158 // Sets the optical surface polish type.
159
161 {
162 return theMaterialPropertiesTable;
163 }
164 // Retrieves the pointer of the G4MaterialPropertiesTable
165 // attached to optical surface.
166
168 {
169 theMaterialPropertiesTable = anMPT;
170 }
171 // Attaches a G4MaterialPropertiesTable to the optical surface.
172
173 void DumpInfo() const;
174 // Prints information about the optical surface.
175
176 void ReadDataFile();
177 // call the correct ReadXXXFile
178
179 void ReadCompressedFile(const G4String&, std::istringstream&);
180 // read a zlib-compressed file
181
182 void ReadLUTFile();
183 // Method to read the Look-Up-Table into array AngularDistribution
184
186
187 // for DAVIS model
188
190 // Returns the AngularDistributionValue
191
192 void ReadLUTDAVISFile();
193 // Method to read the Davis Look-Up-Table into array AngularDistribution
194
196 // Method to read the Look-Up-Table for reflectivity
197
199 // Returns the reflectivity value from the Davis Look-Up-Table
200
201 G4int GetInmax() const;
202 // Returns the number of lines in the Davis Look-Up-Table
203
204 G4int GetLUTbins() const;
205 // Returns the number of probability values per incidentangle
206
207 G4int GetRefMax() const;
208 // Returns the number of reflectivity values per angle
209
210 G4int GetThetaIndexMax() const;
211 G4int GetPhiIndexMax() const;
212
213 void ReadDichroicFile();
214 // Method to read the dichroic surface data file into Dichroic
215
217
218 private:
219 G4OpticalSurfaceModel theModel; // Surface model
220 G4OpticalSurfaceFinish theFinish; // Surface finish
221
222 G4double sigma_alpha; // The sigma of micro-facet polar angle
223 G4double polish; // Polish parameter in glisur model
224
225 G4MaterialPropertiesTable* theMaterialPropertiesTable;
226
227 static const G4int incidentIndexMax = 91;
228 static const G4int thetaIndexMax = 45;
229 static const G4int phiIndexMax = 37;
230
231 G4float* AngularDistribution;
232 G4Physics2DVector* DichroicVector;
233
234 // for DAVIS model
235 static const G4int indexmax = 7280001; // 3640001;
236 static const G4int RefMax = 90;
237 static const G4int LUTbins = 20000;
238 G4float* AngularDistributionLUT;
239 G4float* Reflectivity;
240};
241
242////////////////////
243// Inline methods
244////////////////////
245
247 G4int angleIncident, G4int thetaIndex, G4int phiIndex)
248{
249 G4int product = angleIncident * thetaIndex * phiIndex;
250 if(product < 0 || product >= incidentIndexMax * thetaIndexMax * phiIndexMax)
251 {
253 ed << "Index angleIncident: " << angleIncident
254 << " thetaIndex: " << thetaIndex << " phiIndex: " << phiIndex
255 << " out of range!";
256 G4Exception("G4OpticalSurface::GetAngularDistributionValue", "mat317",
257 FatalException, ed);
258 return 0.;
259 }
260 return (G4double)
261 AngularDistribution[angleIncident + thetaIndex * incidentIndexMax +
262 phiIndex * thetaIndexMax * incidentIndexMax];
263}
264
266{
267 if(i < 0 || i >= indexmax)
268 {
270 ed << "Index " << i << " out of range!";
271 G4Exception("G4OpticalSurface::GetAngularDistributionValueLUT", "mat318",
272 FatalException, ed);
273 return 0.;
274 }
275 return (G4double) AngularDistributionLUT[i];
276}
277
279{
280 if(i < 0 || i >= RefMax)
281 {
283 ed << "Index " << i << " out of range!";
284 G4Exception("G4OpticalSurface::GetReflectivityLUTValue", "mat319",
285 FatalException, ed);
286 return 0.;
287 }
288 return (G4double) Reflectivity[i];
289}
290
292{
293 return DichroicVector;
294}
295
296#endif /* G4OpticalSurface_h */
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
G4OpticalSurfaceModel
@ unified
@ DAVIS
@ dichroic
@ glisur
G4OpticalSurfaceFinish
@ groundfrontpainted
@ polishedlumirrorair
@ groundtyvekair
@ groundtioair
@ PolishedESR_LUT
@ groundvm2000glue
@ polishedair
@ groundair
@ etchedteflonair
@ etchedtyvekair
@ etchedvm2000glue
@ RoughESR_LUT
@ polishedbackpainted
@ etchedtioair
@ Polished_LUT
@ groundvm2000air
@ polished
@ Detector_LUT
@ polishedlumirrorglue
@ polishedtyvekair
@ PolishedESRGrease_LUT
@ RoughESRGrease_LUT
@ ground
@ Rough_LUT
@ polishedteflonair
@ etchedair
@ polishedvm2000air
@ etchedlumirrorglue
@ polishedvm2000glue
@ polishedfrontpainted
@ RoughTeflon_LUT
@ polishedtioair
@ groundlumirrorglue
@ PolishedTeflon_LUT
@ etchedvm2000air
@ groundbackpainted
@ etchedlumirrorair
@ groundlumirrorair
@ groundteflonair
G4SurfaceType
@ dielectric_dielectric
float G4float
Definition: G4Types.hh:84
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4int GetLUTbins() const
G4double GetAngularDistributionValueLUT(G4int)
void SetSigmaAlpha(const G4double s_a)
void DumpInfo() const
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
void SetType(const G4SurfaceType &type) override
G4OpticalSurfaceModel GetModel() const
G4double GetSigmaAlpha() const
G4OpticalSurfaceFinish GetFinish() const
void SetModel(const G4OpticalSurfaceModel model)
G4int GetThetaIndexMax() const
G4double GetPolish() const
G4bool operator==(const G4OpticalSurface &right) const
G4OpticalSurface & operator=(const G4OpticalSurface &right)
void ReadCompressedFile(const G4String &, std::istringstream &)
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
G4Physics2DVector * GetDichroicVector()
G4int GetPhiIndexMax() const
G4double GetReflectivityLUTValue(G4int)
G4bool operator!=(const G4OpticalSurface &right) const
~G4OpticalSurface() override
G4int GetRefMax() const
G4int GetInmax() const
G4double GetAngularDistributionValue(G4int, G4int, G4int)
void SetFinish(const G4OpticalSurfaceFinish)
void SetPolish(const G4double plsh)