00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4OpticalSurface.hh 67044 2013-01-30 08:50:06Z gcosmo $ 00028 // 00029 // 00031 // G4OpticalSurface Definition 00033 // 00034 // File: G4OpticalSurface.hh 00035 // Description: A optical surface class for use in G4OpBoundaryProcess 00036 // Version: 2.0 00037 // Created: 1997-06-26 00038 // Author: Peter Gumplinger 00039 // Updated: 1999-10-29 add method and class descriptors 00040 // mail: gum@triumf.ca 00041 // 00043 00044 #ifndef G4OpticalSurface_h 00045 #define G4OpticalSurface_h 1 00046 00048 // Includes 00050 00051 #include "G4Types.hh" 00052 #include "G4SurfaceProperty.hh" 00053 00054 // Class Description: 00055 // A optical surface class for use in the G4OpBoundaryProcess class. 00056 // Contains the enumerations: G4OpticalSurfaceFinish, G4OpticalSurfaceType, 00057 // and G4OpticalSurfaceModel. 00058 // Class Description - End: 00059 00060 enum G4OpticalSurfaceFinish 00061 { 00062 polished, // smooth perfectly polished surface 00063 polishedfrontpainted, // smooth top-layer (front) paint 00064 polishedbackpainted, // same is 'polished' but with a back-paint 00065 00066 ground, // rough surface 00067 groundfrontpainted, // rough top-layer (front) paint 00068 groundbackpainted, // same as 'ground' but with a back-paint 00069 00070 polishedlumirrorair, // mechanically polished surface, with lumirror 00071 polishedlumirrorglue, // mechanically polished surface, with lumirror & meltmount 00072 polishedair, // mechanically polished surface 00073 polishedteflonair, // mechanically polished surface, with teflon 00074 polishedtioair, // mechanically polished surface, with tio paint 00075 polishedtyvekair, // mechanically polished surface, with tyvek 00076 polishedvm2000air, // mechanically polished surface, with esr film 00077 polishedvm2000glue, // mechanically polished surface, with esr film & meltmount 00078 00079 etchedlumirrorair, // chemically etched surface, with lumirror 00080 etchedlumirrorglue, // chemically etched surface, with lumirror & meltmount 00081 etchedair, // chemically etched surface 00082 etchedteflonair, // chemically etched surface, with teflon 00083 etchedtioair, // chemically etched surface, with tio paint 00084 etchedtyvekair, // chemically etched surface, with tyvek 00085 etchedvm2000air, // chemically etched surface, with esr film 00086 etchedvm2000glue, // chemically etched surface, with esr film & meltmount 00087 00088 groundlumirrorair, // rough-cut surface, with lumirror 00089 groundlumirrorglue, // rough-cut surface, with lumirror & meltmount 00090 groundair, // rough-cut surface 00091 groundteflonair, // rough-cut surface, with teflon 00092 groundtioair, // rough-cut surface, with tio paint 00093 groundtyvekair, // rough-cut surface, with tyvek 00094 groundvm2000air, // rough-cut surface, with esr film 00095 groundvm2000glue // rough-cut surface, with esr film & meltmount 00096 }; 00097 00098 enum G4OpticalSurfaceModel 00099 { 00100 glisur, // original GEANT3 model 00101 unified, // UNIFIED model 00102 LUT // Look-Up-Table model 00103 }; 00104 00105 class G4MaterialPropertiesTable; 00106 00108 // Class Definition 00110 00111 class G4OpticalSurface : public G4SurfaceProperty 00112 { 00113 00114 public: // Without description 00115 00117 // Operators 00119 00120 G4OpticalSurface(const G4OpticalSurface &right); 00121 G4OpticalSurface & operator=(const G4OpticalSurface &right); 00122 00123 G4int operator==(const G4OpticalSurface &right) const; 00124 G4int operator!=(const G4OpticalSurface &right) const; 00125 00126 public: // With description 00127 00129 // Constructors and Destructor 00131 00132 G4OpticalSurface(const G4String& name, 00133 G4OpticalSurfaceModel model = glisur, 00134 G4OpticalSurfaceFinish finish = polished, 00135 G4SurfaceType type = dielectric_dielectric, 00136 G4double value = 1.0); 00137 // Constructor of an optical surface object. 00138 00139 public: // Without description 00140 00141 virtual ~G4OpticalSurface(); 00142 00144 // Methods 00146 00147 // public methods 00148 00149 public: // With description 00150 00151 void SetType(const G4SurfaceType& type); 00152 00153 inline G4OpticalSurfaceFinish GetFinish() const { return theFinish; } 00154 // Returns the optical surface finish. 00155 void SetFinish(const G4OpticalSurfaceFinish ); 00156 // Sets the optical surface finish. 00157 00158 inline G4OpticalSurfaceModel GetModel() const { return theModel; } 00159 // Returns the optical surface model used. 00160 inline void SetModel(const G4OpticalSurfaceModel model) 00161 { theModel = model; } 00162 // Sets the optical surface model to be followed. 00163 00164 inline G4double GetSigmaAlpha() const { return sigma_alpha; } 00165 // Returns an unified model surface parameter. 00166 inline void SetSigmaAlpha(const G4double s_a) { sigma_alpha = s_a; } 00167 // Sets an unified model surface parameter. 00168 00169 G4double GetPolish() const { return polish; } 00170 // Returns the optical surface polish type. 00171 inline void SetPolish(const G4double plsh) { polish=plsh; } 00172 // Sets the optical surface polish type. 00173 00174 inline G4MaterialPropertiesTable* GetMaterialPropertiesTable() const 00175 { return theMaterialPropertiesTable; } 00176 // Retrieves the pointer of the G4MaterialPropertiesTable 00177 // attached to optical surface. 00178 00179 inline void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT) 00180 { theMaterialPropertiesTable = anMPT; } 00181 // Attaches a G4MaterialPropertiesTable to the optical surface. 00182 00183 void DumpInfo() const; 00184 // Prints information about the optical surface. 00185 00186 void ReadFile(void); 00187 // Method to read the Look-Up-Table into array AngularDistribution 00188 00189 inline G4double GetAngularDistributionValue(G4int, G4int, G4int); 00190 00191 inline G4int GetThetaIndexMax(void) const { return thetaIndexMax; } 00192 inline G4int GetPhiIndexMax(void) const { return phiIndexMax; } 00193 00194 private: 00195 00196 // ------------------ 00197 // Basic data members ( To define an optical surface) 00198 // ------------------ 00199 00200 G4OpticalSurfaceModel theModel; // Surface model 00201 G4OpticalSurfaceFinish theFinish; // Surface finish 00202 00203 G4double sigma_alpha; // The sigma of micro-facet polar angle 00204 G4double polish; // Polish parameter in glisur model 00205 00206 G4MaterialPropertiesTable* theMaterialPropertiesTable; 00207 00208 static const G4int incidentIndexMax = 91; 00209 static const G4int thetaIndexMax = 45; 00210 static const G4int phiIndexMax = 37; 00211 00212 G4float* AngularDistribution; 00213 00214 // Open LUT with Material and Integer Angle 00215 FILE* readFileHandle; 00216 00217 }; 00218 00220 // Inline methods 00222 00223 inline 00224 G4double G4OpticalSurface::GetAngularDistributionValue(G4int angleIncident, 00225 G4int thetaIndex, 00226 G4int phiIndex) 00227 { 00228 return AngularDistribution[angleIncident+ 00229 thetaIndex*incidentIndexMax+ 00230 phiIndex*thetaIndexMax*incidentIndexMax]; 00231 } 00232 00233 #endif /* G4OpticalSurface_h */