Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 << 22 // >> 23 // >> 24 // $Id: G4OpticalSurface.hh,v 1.4.10.1 2001/06/28 19:10:29 gunter Exp $ >> 25 // GEANT4 tag $Name: $ >> 26 // >> 27 // 26 ////////////////////////////////////////////// 28 //////////////////////////////////////////////////////////////////////// 27 // G4OpticalSurface Definition 29 // G4OpticalSurface Definition 28 ////////////////////////////////////////////// 30 //////////////////////////////////////////////////////////////////////// 29 // 31 // 30 // File: G4OpticalSurface.hh 32 // File: G4OpticalSurface.hh 31 // Description: A optical surface class for us 33 // Description: A optical surface class for use in G4OpBoundaryProcess 32 // Version: 2.0 34 // Version: 2.0 33 // Created: 1997-06-26 35 // Created: 1997-06-26 34 // Author: Peter Gumplinger 36 // Author: Peter Gumplinger 35 // Updated: 1999-10-29 add method and clas 37 // Updated: 1999-10-29 add method and class descriptors 36 // 2017-02-24 Mariele Stockhoff a << 38 // mail: gum@triumf.ca 37 // 39 // 38 // Class Description: << 40 // Cvs version: 39 // A optical surface class for use in the G4Op << 40 // Contains the enumerations: G4OpticalSurface << 41 // and G4OpticalSurfaceModel. << 42 ////////////////////////////////////////////// 41 //////////////////////////////////////////////////////////////////////// 43 42 44 #ifndef G4OpticalSurface_h 43 #ifndef G4OpticalSurface_h 45 #define G4OpticalSurface_h 1 44 #define G4OpticalSurface_h 1 46 45 47 #include "G4Physics2DVector.hh" << 46 ///////////// 48 #include "G4SurfaceProperty.hh" << 47 // Includes 49 #include "G4Types.hh" << 48 ///////////// >> 49 >> 50 #include "globals.hh" >> 51 #include "templates.hh" >> 52 >> 53 // Class Description: >> 54 // A optical surface class for use in the G4OpBoundaryProcess class. >> 55 // Contains the enumerations: G4OpticalSurfaceFinish, G4OpticalSurfaceType, >> 56 // and G4OpticalSurfaceModel. >> 57 // Class Description - End: 50 58 51 // clang-format off << 52 enum G4OpticalSurfaceFinish 59 enum G4OpticalSurfaceFinish 53 { 60 { 54 polished, // smooth perfectly p << 61 polished, // smooth perfectly polished surface 55 polishedfrontpainted, // smooth top-layer ( << 62 polishedfrontpainted, // smooth top-layer (front) paint 56 polishedbackpainted, // same is 'polished' << 63 polishedbackpainted, // same is 'polished' but with a back-paint 57 << 64 ground, // rough surface 58 ground, // rough surface << 65 groundfrontpainted, // rough top-layer (front) paint 59 groundfrontpainted, // rough top-layer (fro << 66 groundbackpainted // same as 'ground' but with a back-paint 60 groundbackpainted, // same as 'ground' but << 61 << 62 // for LBNL LUT model << 63 polishedlumirrorair, // mechanically polis << 64 polishedlumirrorglue, // mechanically polis << 65 // meltmount << 66 polishedair, // mechanically polis << 67 polishedteflonair, // mechanically polis << 68 polishedtioair, // mechanically polis << 69 polishedtyvekair, // mechanically polis << 70 polishedvm2000air, // mechanically polis << 71 polishedvm2000glue, // mechanically polis << 72 // meltmount << 73 << 74 etchedlumirrorair, // chemically etched su << 75 etchedlumirrorglue, // chemically etched su << 76 etchedair, // chemically etched su << 77 etchedteflonair, // chemically etched su << 78 etchedtioair, // chemically etched su << 79 etchedtyvekair, // chemically etched su << 80 etchedvm2000air, // chemically etched su << 81 etchedvm2000glue, // chemically etched su << 82 << 83 groundlumirrorair, // rough-cut surface, w << 84 groundlumirrorglue, // rough-cut surface, w << 85 groundair, // rough-cut surface << 86 groundteflonair, // rough-cut surface, w << 87 groundtioair, // rough-cut surface, w << 88 groundtyvekair, // rough-cut surface, w << 89 groundvm2000air, // rough-cut surface, w << 90 groundvm2000glue, // rough-cut surface, w << 91 << 92 // for DAVIS model << 93 Rough_LUT, // rough surface << 94 RoughTeflon_LUT, // rough surface wra << 95 RoughESR_LUT, // rough surface wra << 96 RoughESRGrease_LUT, // rough surface wra << 97 // and coupled with << 98 Polished_LUT, // polished surface << 99 PolishedTeflon_LUT, // polished surface << 100 PolishedESR_LUT, // polished surface << 101 PolishedESRGrease_LUT, // polished surface << 102 // and coupled with << 103 Detector_LUT // polished surface << 104 }; 67 }; 105 68 106 enum G4OpticalSurfaceModel << 69 enum G4OpticalSurfaceType 107 { 70 { 108 glisur, // original GEANT3 model << 71 dielectric_metal, // dielectric-metal interface 109 unified, // UNIFIED model << 72 dielectric_dielectric // dielectric-dielectric interface 110 LUT, // Look-Up-Table model (LBNL model << 111 DAVIS, // DAVIS model << 112 dichroic // dichroic filter << 113 }; 73 }; 114 74 115 // clang-format on << 75 enum G4OpticalSurfaceModel 116 << 117 class G4MaterialPropertiesTable; << 118 << 119 class G4OpticalSurface : public G4SurfacePrope << 120 { 76 { 121 public: << 77 glisur, // original GEANT3 model 122 // Constructor of an optical surface object. << 78 unified // UNIFIED model 123 G4OpticalSurface(const G4String& name, G4Opt << 79 }; 124 G4OpticalSurfaceFinish finish = polished, << 125 G4double value = 1.0); << 126 << 127 ~G4OpticalSurface() override; << 128 << 129 G4OpticalSurface(const G4OpticalSurface& rig << 130 G4OpticalSurface& operator=(const G4OpticalS << 131 << 132 G4bool operator==(const G4OpticalSurface& ri << 133 G4bool operator!=(const G4OpticalSurface& ri << 134 << 135 void SetType(const G4SurfaceType& type) over << 136 80 137 // Returns the optical surface finish. << 81 class G4MaterialPropertiesTable; 138 inline G4OpticalSurfaceFinish GetFinish() co << 139 82 140 // Sets the optical surface finish. << 83 ///////////////////// 141 void SetFinish(const G4OpticalSurfaceFinish) << 84 // Class Definition >> 85 ///////////////////// 142 86 143 // Returns the optical surface model used. << 87 class G4OpticalSurface 144 inline G4OpticalSurfaceModel GetModel() cons << 88 { 145 89 146 // Sets the optical surface model to be foll << 90 public: // Without description 147 inline void SetModel(const G4OpticalSurfaceM << 148 91 149 // Returns an unified model surface paramete << 92 ////////////// 150 inline G4double GetSigmaAlpha() const { retu << 93 // Operators >> 94 ////////////// 151 95 152 // Sets an unified model surface parameter. << 96 G4OpticalSurface(const G4OpticalSurface &right); 153 inline void SetSigmaAlpha(const G4double s_a << 97 const G4OpticalSurface & operator=(const G4OpticalSurface &right); 154 98 155 // Returns the optical surface polish type. << 99 G4int operator==(const G4OpticalSurface &right) const; 156 G4double GetPolish() const { return polish; << 100 G4int operator!=(const G4OpticalSurface &right) const; 157 101 158 // Sets the optical surface polish type. << 102 public: // With description 159 inline void SetPolish(const G4double plsh) { << 160 103 161 // Retrieves the pointer of the G4MaterialPr << 104 //////////////////////////////// 162 // attached to optical surface. << 105 // Constructors and Destructor 163 inline G4MaterialPropertiesTable* GetMateria << 106 //////////////////////////////// 164 { << 165 return theMaterialPropertiesTable; << 166 } << 167 107 168 // Attaches a G4MaterialPropertiesTable to t << 108 G4OpticalSurface(const G4String& name, 169 inline void SetMaterialPropertiesTable(G4Mat << 109 G4OpticalSurfaceModel model = glisur, 170 { << 110 G4OpticalSurfaceFinish finish = polished, 171 theMaterialPropertiesTable = anMPT; << 111 G4OpticalSurfaceType type = dielectric_dielectric, 172 } << 112 G4double value = 1.0); >> 113 // Constructor of an optical surface object. 173 114 174 // Prints information about the optical surf << 115 public: // Without description 175 void DumpInfo() const; << 176 116 177 // call the correct ReadXXXFile << 117 ~G4OpticalSurface(); 178 void ReadDataFile(); << 179 118 180 // read a zlib-compressed file << 119 //////////// 181 void ReadCompressedFile(const G4String&, std << 120 // Methods >> 121 //////////// 182 122 183 // Method to read the Look-Up-Table into arr << 123 // public methods 184 void ReadLUTFile(); << 185 124 186 // for DAVIS model << 125 public: // With description 187 inline G4double GetAngularDistributionValue( << 188 126 189 // Returns the AngularDistributionValue << 127 G4String GetName() const { return theName; }; 190 inline G4double GetAngularDistributionValueL << 128 // Returns the optical surface name. >> 129 void SetName(const G4String& name){theName = name;}; >> 130 // Sets the optical surface name. 191 131 192 // Method to read the Davis Look-Up-Table in << 132 G4OpticalSurfaceType GetType() const {return theType;}; 193 void ReadLUTDAVISFile(); << 133 // Returns the optical surface type. >> 134 void SetType(const G4OpticalSurfaceType type){theType = type;}; >> 135 // Sets the optical surface type. 194 136 195 // Method to read the Look-Up-Table for refl << 137 G4OpticalSurfaceFinish GetFinish() const {return theFinish;}; 196 void ReadReflectivityLUTFile(); << 138 // Returns the optical surface finish. >> 139 void SetFinish(const G4OpticalSurfaceFinish finish) >> 140 {theFinish = finish;}; >> 141 // Sets the optical surface finish. 197 142 198 // Returns the reflectivity value from the D << 143 G4OpticalSurfaceModel GetModel() const {return theModel;}; 199 inline G4double GetReflectivityLUTValue(G4in << 144 // Returns the optical surface model used. >> 145 void SetModel(const G4OpticalSurfaceModel model) >> 146 {theModel = model;}; >> 147 // Sets the optical surface model to be followed. 200 148 201 // Returns the number of lines in the Davis << 149 G4double GetSigmaAlpha() const {return sigma_alpha;}; 202 G4int GetInmax() const; << 150 // Returns an unified model surface parameter. >> 151 void SetSigmaAlpha(const G4double s_a) >> 152 {sigma_alpha = s_a;}; >> 153 // Sets an unified model surface parameter. 203 154 204 // Returns the number of probability values << 155 G4double GetPolish() const {return polish;}; 205 G4int GetLUTbins() const; << 156 // Returns the optical surface polish type. >> 157 void SetPolish(const G4double plsh) {polish=plsh;}; >> 158 // Sets the optical surface polish type. 206 159 207 // Returns the number of reflectivity values << 160 G4MaterialPropertiesTable* GetMaterialPropertiesTable() const 208 G4int GetRefMax() const; << 161 { return theMaterialPropertiesTable;}; >> 162 // Retrieves the pointer of the G4MaterialPropertiesTable >> 163 // attached to optical surface. 209 164 210 G4int GetThetaIndexMax() const; << 165 void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT) 211 G4int GetPhiIndexMax() const; << 166 { theMaterialPropertiesTable = anMPT;}; >> 167 // Attaches a G4MaterialPropertiesTable to the optical surface. 212 168 213 // Method to read the dichroic surface data << 169 void DumpInfo() const; 214 void ReadDichroicFile(); << 170 // Prints information about the optical surface. 215 171 216 inline G4Physics2DVector* GetDichroicVector( << 172 private: 217 173 218 private: << 174 // ------------------ 219 G4OpticalSurfaceModel theModel; // Surface << 175 // Basic data members ( To define an optical surface) 220 G4OpticalSurfaceFinish theFinish; // Surfac << 176 // ------------------ 221 177 222 G4double sigma_alpha; // The sigma of micro << 178 G4String theName; // Surface name 223 G4double polish; // Polish parameter in gli << 224 179 225 G4MaterialPropertiesTable* theMaterialProper << 180 G4OpticalSurfaceModel theModel; // Surface model >> 181 G4OpticalSurfaceFinish theFinish; // Surface finish >> 182 G4OpticalSurfaceType theType; // Surface type 226 183 227 static const G4int incidentIndexMax = 91; << 184 G4double sigma_alpha; // The sigma of micro-facet polar angle 228 static const G4int thetaIndexMax = 45; << 185 G4double polish; // Polish parameter in glisur model 229 static const G4int phiIndexMax = 37; << 230 186 231 G4float* AngularDistribution; << 187 G4MaterialPropertiesTable* theMaterialPropertiesTable; 232 G4Physics2DVector* DichroicVector; << 233 188 234 // for DAVIS model << 235 static const G4int indexmax = 7280001; // 3 << 236 static const G4int RefMax = 90; << 237 static const G4int LUTbins = 20000; << 238 G4float* AngularDistributionLUT; << 239 G4float* Reflectivity; << 240 }; 189 }; 241 190 242 //////////////////// 191 //////////////////// 243 // Inline methods 192 // Inline methods 244 //////////////////// 193 //////////////////// 245 << 246 inline G4double G4OpticalSurface::GetAngularDi << 247 G4int angleIncident, G4int thetaIndex, G4int << 248 { << 249 G4int product = angleIncident * thetaIndex * << 250 if (product < 0 || product >= incidentIndexM << 251 G4ExceptionDescription ed; << 252 ed << "Index angleIncident: " << angleInci << 253 << " phiIndex: " << phiIndex << " out o << 254 G4Exception("G4OpticalSurface::GetAngularD << 255 return 0.; << 256 } << 257 return (G4double)AngularDistribution[angleIn << 258 phiInde << 259 } << 260 << 261 inline G4double G4OpticalSurface::GetAngularDi << 262 { << 263 if (i < 0 || i >= indexmax) { << 264 G4ExceptionDescription ed; << 265 ed << "Index " << i << " out of range!"; << 266 G4Exception("G4OpticalSurface::GetAngularD << 267 return 0.; << 268 } << 269 return (G4double)AngularDistributionLUT[i]; << 270 } << 271 << 272 inline G4double G4OpticalSurface::GetReflectiv << 273 { << 274 if (i < 0 || i >= RefMax) { << 275 G4ExceptionDescription ed; << 276 ed << "Index " << i << " out of range!"; << 277 G4Exception("G4OpticalSurface::GetReflecti << 278 return 0.; << 279 } << 280 return (G4double)Reflectivity[i]; << 281 } << 282 << 283 inline G4Physics2DVector* G4OpticalSurface::Ge << 284 194 285 #endif /* G4OpticalSurface_h */ 195 #endif /* G4OpticalSurface_h */ 286 196