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 // 26 // 23 // >> 24 // $Id: G4OpBoundaryProcess.hh,v 1.13 2005/07/28 22:26:59 gum Exp $ >> 25 // GEANT4 tag $Name: geant4-07-01-patch-01 $ 27 // 26 // 28 // << 27 // 29 ////////////////////////////////////////////// 28 //////////////////////////////////////////////////////////////////////// 30 // Optical Photon Boundary Process Class Defin 29 // Optical Photon Boundary Process Class Definition 31 ////////////////////////////////////////////// 30 //////////////////////////////////////////////////////////////////////// 32 // 31 // 33 // File: G4OpBoundaryProcess.hh 32 // File: G4OpBoundaryProcess.hh 34 // Description: Discrete Process -- reflection 33 // Description: Discrete Process -- reflection/refraction at 35 // optical in 34 // optical interfaces 36 // Version: 1.1 35 // Version: 1.1 37 // Created: 1997-06-18 36 // Created: 1997-06-18 38 // Modified: 2005-07-28 add G4ProcessType t 37 // Modified: 2005-07-28 add G4ProcessType to constructor 39 // 1999-10-29 add method and clas 38 // 1999-10-29 add method and class descriptors 40 // 1999-10-10 - Fill NewMomentum/ << 39 // 1999-10-10 - Fill NewMomentum/NewPolarization in 41 // DoAbsorption. The 40 // DoAbsorption. These members need to be 42 // filled since DoIt << 41 // filled since DoIt calls 43 // aParticleChange.S 42 // aParticleChange.SetMomentumChange etc. 44 // upon return (than 43 // upon return (thanks to: Clark McGrew) 45 // 2006-11-04 - add capability of << 46 // off a metal surfa << 47 // of refraction - T << 48 // Hauptman (Dept. o << 49 // 2009-11-10 - add capability of << 50 // with Look-Up-Tabl << 51 // optical reflectan << 52 // treatments - Than << 53 // William Moses (La << 54 // 2013-06-01 - add the capabilit << 55 // of a dichronic fi << 56 // 2017-02-24 - add capability of << 57 // with Look-Up-Tabl << 58 // 44 // 59 // Author: Peter Gumplinger 45 // Author: Peter Gumplinger 60 // adopted from work by Werner Ke 46 // adopted from work by Werner Keil - April 2/96 >> 47 // mail: gum@triumf.ca 61 // 48 // >> 49 // CVS version tag: 62 ////////////////////////////////////////////// 50 //////////////////////////////////////////////////////////////////////// 63 51 64 #ifndef G4OpBoundaryProcess_h 52 #ifndef G4OpBoundaryProcess_h 65 #define G4OpBoundaryProcess_h 1 53 #define G4OpBoundaryProcess_h 1 66 54 67 #include "G4OpticalPhoton.hh" << 55 ///////////// 68 #include "G4OpticalSurface.hh" << 56 // Includes 69 #include "G4RandomTools.hh" << 57 ///////////// >> 58 >> 59 #include "globals.hh" >> 60 #include "templates.hh" >> 61 #include "geomdefs.hh" >> 62 #include "Randomize.hh" >> 63 #include "G4Step.hh" 70 #include "G4VDiscreteProcess.hh" 64 #include "G4VDiscreteProcess.hh" >> 65 #include "G4DynamicParticle.hh" >> 66 #include "G4Material.hh" >> 67 #include "G4LogicalBorderSurface.hh" >> 68 #include "G4LogicalSkinSurface.hh" >> 69 #include "G4OpticalSurface.hh" >> 70 #include "G4OpticalPhoton.hh" >> 71 #include "G4TransportationManager.hh" 71 72 72 enum G4OpBoundaryProcessStatus << 73 // Class Description: 73 { << 74 // Discrete Process -- reflection/refraction at optical interfaces. 74 Undefined, << 75 // Class inherits publicly from G4VDiscreteProcess. 75 Transmission, << 76 // Class Description - End: 76 FresnelRefraction, << 77 77 FresnelReflection, << 78 ///////////////////// 78 TotalInternalReflection, << 79 // Class Definition 79 LambertianReflection, << 80 ///////////////////// 80 LobeReflection, << 81 81 SpikeReflection, << 82 enum G4OpBoundaryProcessStatus { Undefined, 82 BackScattering, << 83 FresnelRefraction, FresnelReflection, 83 Absorption, << 84 TotalInternalReflection, 84 Detection, << 85 LambertianReflection, LobeReflection, 85 NotAtBoundary, << 86 SpikeReflection, BackScattering, 86 SameMaterial, << 87 Absorption, Detection, NotAtBoundary, 87 StepTooSmall, << 88 SameMaterial, StepTooSmall, NoRINDEX }; 88 NoRINDEX, << 89 PolishedLumirrorAirReflection, << 90 PolishedLumirrorGlueReflection, << 91 PolishedAirReflection, << 92 PolishedTeflonAirReflection, << 93 PolishedTiOAirReflection, << 94 PolishedTyvekAirReflection, << 95 PolishedVM2000AirReflection, << 96 PolishedVM2000GlueReflection, << 97 EtchedLumirrorAirReflection, << 98 EtchedLumirrorGlueReflection, << 99 EtchedAirReflection, << 100 EtchedTeflonAirReflection, << 101 EtchedTiOAirReflection, << 102 EtchedTyvekAirReflection, << 103 EtchedVM2000AirReflection, << 104 EtchedVM2000GlueReflection, << 105 GroundLumirrorAirReflection, << 106 GroundLumirrorGlueReflection, << 107 GroundAirReflection, << 108 GroundTeflonAirReflection, << 109 GroundTiOAirReflection, << 110 GroundTyvekAirReflection, << 111 GroundVM2000AirReflection, << 112 GroundVM2000GlueReflection, << 113 Dichroic, << 114 CoatedDielectricReflection, << 115 CoatedDielectricRefraction, << 116 CoatedDielectricFrustratedTransmission << 117 }; << 118 89 119 class G4OpBoundaryProcess : public G4VDiscrete << 90 class G4OpBoundaryProcess : public G4VDiscreteProcess 120 { 91 { 121 public: << 122 explicit G4OpBoundaryProcess(const G4String& << 123 G4ProcessType t << 124 virtual ~G4OpBoundaryProcess(); << 125 92 126 virtual G4bool IsApplicable( << 93 private: 127 const G4ParticleDefinition& aParticleType) << 94 128 // Returns true -> 'is applicable' only for << 95 ////////////// >> 96 // Operators >> 97 ////////////// >> 98 >> 99 // G4OpBoundaryProcess& operator=(const G4OpBoundaryProcess &right); 129 100 130 virtual G4double GetMeanFreePath(const G4Tra << 101 // G4OpBoundaryProcess(const G4OpBoundaryProcess &right); 131 G4ForceCond << 132 // Returns infinity; i. e. the process does << 133 // 'Forced' condition for the DoIt to be inv << 134 // at a boundary will any action be taken. << 135 102 136 G4VParticleChange* PostStepDoIt(const G4Trac << 103 public: // Without description 137 const G4Step << 138 // This is the method implementing boundary << 139 104 140 virtual G4OpBoundaryProcessStatus GetStatus( << 105 //////////////////////////////// 141 // Returns the current status. << 106 // Constructors and Destructor >> 107 //////////////////////////////// 142 108 143 virtual void SetInvokeSD(G4bool); << 109 G4OpBoundaryProcess(const G4String& processName = "OpBoundary", 144 // Set flag for call to InvokeSD method. << 110 G4ProcessType type = fOptical); 145 111 146 virtual void PreparePhysicsTable(const G4Par << 112 ~G4OpBoundaryProcess(); 147 113 148 virtual void Initialise(); << 114 //////////// >> 115 // Methods >> 116 //////////// 149 117 150 void SetVerboseLevel(G4int); << 118 public: // With description 151 119 152 private: << 120 G4bool IsApplicable(const G4ParticleDefinition& aParticleType); 153 G4OpBoundaryProcess(const G4OpBoundaryProces << 121 // Returns true -> 'is applicable' only for an optical photon. 154 G4OpBoundaryProcess& operator=(const G4OpBou << 155 122 156 G4bool G4BooleanRand(const G4double prob) co << 123 G4double GetMeanFreePath(const G4Track& , >> 124 G4double , >> 125 G4ForceCondition* condition); >> 126 // Returns infinity; i. e. the process does not limit the step, >> 127 // but sets the 'Forced' condition for the DoIt to be invoked at >> 128 // every step. However, only at a boundary will any action be >> 129 // taken. 157 130 158 G4ThreeVector GetFacetNormal(const G4ThreeVe << 131 G4VParticleChange* PostStepDoIt(const G4Track& aTrack, 159 const G4ThreeVe << 132 const G4Step& aStep); >> 133 // This is the method implementing boundary processes. 160 134 161 void DielectricMetal(); << 135 G4OpticalSurfaceModel GetModel() const; 162 void DielectricDielectric(); << 136 // Returns the optical surface mode. 163 137 164 void DielectricLUT(); << 138 G4OpBoundaryProcessStatus GetStatus() const; 165 void DielectricLUTDAVIS(); << 139 // Returns the current status. 166 140 167 void DielectricDichroic(); << 141 void SetModel(G4OpticalSurfaceModel model); 168 void CoatedDielectricDielectric(); << 142 // Set the optical surface model to be followed >> 143 // (glisur || unified). 169 144 170 void ChooseReflection(); << 145 private: 171 void DoAbsorption(); << 172 void DoReflection(); << 173 146 174 G4double GetIncidentAngle(); << 147 void G4Swap(G4double* a, G4double* b) const; 175 // Returns the incident angle of optical pho << 176 148 177 G4double GetReflectivity(G4double E1_perp, G << 149 void G4Swap(G4Material* a, G4Material* b) const; 178 G4double incidentan << 179 G4double ImaginaryR << 180 // Returns the Reflectivity on a metallic su << 181 150 182 G4double GetReflectivityThroughThinLayer(G4d << 151 void G4VectorSwap(G4ThreeVector* vec1, G4ThreeVector* vec2) const; 183 G4d << 184 G4d << 185 // Returns the Reflectivity on a coated surf << 186 152 187 void CalculateReflectivity(); << 153 G4bool G4BooleanRand(const G4double prob) const; 188 154 189 void BoundaryProcessVerbose() const; << 155 G4ThreeVector G4IsotropicRand() const; 190 156 191 // Invoke SD for post step point if the phot << 157 G4ThreeVector G4LambertianRand(const G4ThreeVector& normal); 192 G4bool InvokeSD(const G4Step* step); << 193 158 194 G4ThreeVector fOldMomentum; << 159 G4ThreeVector G4PlaneVectorRand(const G4ThreeVector& normal) const; 195 G4ThreeVector fOldPolarization; << 196 160 197 G4ThreeVector fNewMomentum; << 161 G4ThreeVector GetFacetNormal(const G4ThreeVector& Momentum, 198 G4ThreeVector fNewPolarization; << 162 const G4ThreeVector& Normal) const; 199 163 200 G4ThreeVector fGlobalNormal; << 164 void DielectricMetal(); 201 G4ThreeVector fFacetNormal; << 165 void DielectricDielectric(); 202 166 203 const G4Material* fMaterial1; << 167 void ChooseReflection(); 204 const G4Material* fMaterial2; << 168 void DoAbsorption(); >> 169 void DoReflection(); 205 170 206 G4OpticalSurface* fOpticalSurface; << 171 private: 207 172 208 G4MaterialPropertyVector* fRealRIndexMPV; << 173 G4double thePhotonMomentum; 209 G4MaterialPropertyVector* fImagRIndexMPV; << 210 G4Physics2DVector* fDichroicVector; << 211 174 212 G4double fPhotonMomentum; << 175 G4ThreeVector OldMomentum; 213 G4double fRindex1; << 176 G4ThreeVector OldPolarization; 214 G4double fRindex2; << 215 177 216 G4double fSint1; << 178 G4ThreeVector NewMomentum; >> 179 G4ThreeVector NewPolarization; 217 180 218 G4double fReflectivity; << 181 G4ThreeVector theGlobalNormal; 219 G4double fEfficiency; << 182 G4ThreeVector theFacetNormal; 220 G4double fTransmittance; << 221 G4double fSurfaceRoughness; << 222 183 223 G4double fProb_sl, fProb_ss, fProb_bs; << 184 G4Material* Material1; 224 G4double fCarTolerance; << 185 G4Material* Material2; 225 186 226 // Used by CoatedDielectricDielectric() << 187 G4OpticalSurface* OpticalSurface; 227 G4double fCoatedRindex, fCoatedThickness; << 228 188 229 G4OpBoundaryProcessStatus fStatus; << 189 G4double Rindex1; 230 G4OpticalSurfaceModel fModel; << 190 G4double Rindex2; 231 G4OpticalSurfaceFinish fFinish; << 232 191 233 G4int f_iTE, f_iTM; << 192 G4double cost1, cost2, sint1, sint2; 234 193 235 G4int fNumSmallStepWarnings = 0; // number o << 194 G4OpBoundaryProcessStatus theStatus; 236 G4int fNumBdryTypeWarnings = 0; // number o << 237 195 238 size_t idx_dichroicX = 0; << 196 G4OpticalSurfaceModel theModel; 239 size_t idx_dichroicY = 0; << 240 size_t idx_rindex1 = 0; << 241 size_t idx_rindex_surface = 0; << 242 size_t idx_reflect = 0; << 243 size_t idx_eff = 0; << 244 size_t idx_trans = 0; << 245 size_t idx_lobe = 0; << 246 size_t idx_spike = 0; << 247 size_t idx_back = 0; << 248 size_t idx_rindex2 = 0; << 249 size_t idx_groupvel = 0; << 250 size_t idx_rrindex = 0; << 251 size_t idx_irindex = 0; << 252 size_t idx_coatedrindex = 0; << 253 197 254 // Used by CoatedDielectricDielectric() << 198 G4OpticalSurfaceFinish theFinish; 255 G4bool fCoatedFrustratedTransmission = true; << 199 >> 200 G4double theReflectivity; >> 201 G4double theEfficiency; >> 202 G4double prob_sl, prob_ss, prob_bs; 256 203 257 G4bool fInvokeSD; << 258 }; 204 }; 259 205 260 //////////////////// 206 //////////////////// 261 // Inline methods 207 // Inline methods 262 //////////////////// 208 //////////////////// 263 209 264 inline G4bool G4OpBoundaryProcess::G4BooleanRa << 210 inline >> 211 void G4OpBoundaryProcess::G4Swap(G4double* a, G4double* b) const >> 212 { >> 213 // swaps the contents of the objects pointed >> 214 // to by 'a' and 'b'! >> 215 >> 216 G4double temp; >> 217 >> 218 temp = *a; >> 219 *a = *b; >> 220 *b = temp; >> 221 } >> 222 >> 223 inline >> 224 void G4OpBoundaryProcess::G4Swap(G4Material* a, G4Material* b) const >> 225 { >> 226 // ONLY swaps the pointers; i.e. what used to be pointed >> 227 // to by 'a' is now pointed to by 'b' and vice versa! >> 228 >> 229 G4Material* temp = a; >> 230 >> 231 a = b; >> 232 b = temp; >> 233 } >> 234 >> 235 inline >> 236 void G4OpBoundaryProcess::G4VectorSwap(G4ThreeVector* vec1, >> 237 G4ThreeVector* vec2) const 265 { 238 { 266 // Returns a random boolean variable with th << 239 // swaps the contents of the objects pointed >> 240 // to by 'vec1' and 'vec2'! >> 241 >> 242 G4ThreeVector temp; >> 243 >> 244 temp = *vec1; >> 245 *vec1 = *vec2; >> 246 *vec2 = temp; >> 247 } >> 248 >> 249 inline >> 250 G4bool G4OpBoundaryProcess::G4BooleanRand(const G4double prob) const >> 251 { >> 252 /* Returns a random boolean variable with the specified probability */ >> 253 267 return (G4UniformRand() < prob); 254 return (G4UniformRand() < prob); 268 } 255 } 269 256 270 inline G4bool G4OpBoundaryProcess::IsApplicabl << 257 inline 271 const G4ParticleDefinition& aParticleType) << 258 G4ThreeVector G4OpBoundaryProcess::G4IsotropicRand() const 272 { 259 { 273 return (&aParticleType == G4OpticalPhoton::O << 260 /* Returns a random isotropic unit vector. */ >> 261 >> 262 G4ThreeVector vect; >> 263 G4double len2; >> 264 >> 265 do { >> 266 >> 267 vect.setX(G4UniformRand() - 0.5); >> 268 vect.setY(G4UniformRand() - 0.5); >> 269 vect.setZ(G4UniformRand() - 0.5); >> 270 >> 271 len2 = vect.mag2(); >> 272 >> 273 } while (len2 < 0.01 || len2 > 0.25); >> 274 >> 275 return vect.unit(); 274 } 276 } 275 277 276 inline G4OpBoundaryProcessStatus G4OpBoundaryP << 278 inline >> 279 G4ThreeVector G4OpBoundaryProcess:: >> 280 G4LambertianRand(const G4ThreeVector& normal) 277 { 281 { 278 return fStatus; << 282 /* Returns a random lambertian unit vector. */ 279 } << 283 280 << 284 G4ThreeVector vect; 281 inline void G4OpBoundaryProcess::ChooseReflect << 285 G4double ndotv; 282 { << 286 283 G4double rand = G4UniformRand(); << 287 do { 284 if(rand < fProb_ss) << 288 vect = G4IsotropicRand(); 285 { << 289 286 fStatus = SpikeReflection; << 290 ndotv = normal * vect; 287 fFacetNormal = fGlobalNormal; << 291 288 } << 292 if (ndotv < 0.0) { 289 else if(rand < fProb_ss + fProb_sl) << 293 vect = -vect; 290 { << 294 ndotv = -ndotv; 291 fStatus = LobeReflection; << 292 } << 293 else if(rand < fProb_ss + fProb_sl + fProb_b << 294 { << 295 fStatus = BackScattering; << 296 } << 297 else << 298 { << 299 fStatus = LambertianReflection; << 300 } << 301 } << 302 << 303 inline void G4OpBoundaryProcess::DoAbsorption( << 304 { << 305 fStatus = Absorption; << 306 << 307 if(G4BooleanRand(fEfficiency)) << 308 { << 309 // EnergyDeposited =/= 0 means: photon has << 310 fStatus = Detection; << 311 aParticleChange.ProposeLocalEnergyDeposit( << 312 } << 313 else << 314 { << 315 aParticleChange.ProposeLocalEnergyDeposit( << 316 } << 317 << 318 fNewMomentum = fOldMomentum; << 319 fNewPolarization = fOldPolarization; << 320 << 321 aParticleChange.ProposeTrackStatus(fStopAndK << 322 } << 323 << 324 inline void G4OpBoundaryProcess::DoReflection( << 325 { << 326 if(fStatus == LambertianReflection) << 327 { << 328 fNewMomentum = G4LambertianRand(fGlobalNor << 329 fFacetNormal = (fNewMomentum - fOldMomentu << 330 } << 331 else if(fFinish == ground) << 332 { << 333 fStatus = LobeReflection; << 334 if(!fRealRIndexMPV || !fImagRIndexMPV) << 335 { << 336 fFacetNormal = GetFacetNormal(fOldMoment << 337 } 295 } 338 // else << 296 339 // complex ref. index to be implemented << 297 } while (!G4BooleanRand(ndotv)); 340 fNewMomentum = << 298 return vect; 341 fOldMomentum - (2. * fOldMomentum * fFac << 299 } 342 } << 300 343 else << 301 inline 344 { << 302 G4ThreeVector G4OpBoundaryProcess:: 345 fStatus = SpikeReflection; << 303 G4PlaneVectorRand(const G4ThreeVector& normal) const 346 fFacetNormal = fGlobalNormal; << 304 347 fNewMomentum = << 305 /* This function chooses a random vector within a plane given 348 fOldMomentum - (2. * fOldMomentum * fFac << 306 by the unit normal */ 349 } << 307 { 350 fNewPolarization = << 308 G4ThreeVector vec1 = normal.orthogonal(); 351 -fOldPolarization + (2. * fOldPolarization << 309 >> 310 G4ThreeVector vec2 = vec1.cross(normal); >> 311 >> 312 G4double phi = twopi*G4UniformRand(); >> 313 G4double cosphi = std::cos(phi); >> 314 G4double sinphi = std::sin(phi); >> 315 >> 316 return cosphi * vec1 + sinphi * vec2; >> 317 } >> 318 >> 319 inline >> 320 G4bool G4OpBoundaryProcess::IsApplicable(const G4ParticleDefinition& >> 321 aParticleType) >> 322 { >> 323 return ( &aParticleType == G4OpticalPhoton::OpticalPhoton() ); >> 324 } >> 325 >> 326 inline >> 327 G4OpticalSurfaceModel G4OpBoundaryProcess::GetModel() const >> 328 { >> 329 return theModel; >> 330 } >> 331 >> 332 inline >> 333 G4OpBoundaryProcessStatus G4OpBoundaryProcess::GetStatus() const >> 334 { >> 335 return theStatus; >> 336 } >> 337 >> 338 inline >> 339 void G4OpBoundaryProcess::SetModel(G4OpticalSurfaceModel model) >> 340 { >> 341 theModel = model; >> 342 } >> 343 >> 344 inline >> 345 void G4OpBoundaryProcess::ChooseReflection() >> 346 { >> 347 G4double rand = G4UniformRand(); >> 348 if ( rand >= 0.0 && rand < prob_ss ) { >> 349 theStatus = SpikeReflection; >> 350 theFacetNormal = theGlobalNormal; >> 351 } >> 352 else if ( rand >= prob_ss && >> 353 rand <= prob_ss+prob_sl) { >> 354 theStatus = LobeReflection; >> 355 } >> 356 else if ( rand > prob_ss+prob_sl && >> 357 rand < prob_ss+prob_sl+prob_bs ) { >> 358 theStatus = BackScattering; >> 359 } >> 360 else { >> 361 theStatus = LambertianReflection; >> 362 } >> 363 } >> 364 >> 365 inline >> 366 void G4OpBoundaryProcess::DoAbsorption() >> 367 { >> 368 theStatus = Absorption; >> 369 >> 370 if ( G4BooleanRand(theEfficiency) ) { >> 371 >> 372 // EnergyDeposited =/= 0 means: photon has been detected >> 373 theStatus = Detection; >> 374 aParticleChange.ProposeLocalEnergyDeposit(thePhotonMomentum); >> 375 } >> 376 else { >> 377 aParticleChange.ProposeLocalEnergyDeposit(0.0); >> 378 } >> 379 >> 380 NewMomentum = OldMomentum; >> 381 NewPolarization = OldPolarization; >> 382 >> 383 // aParticleChange.ProposeEnergy(0.0); >> 384 aParticleChange.ProposeTrackStatus(fStopAndKill); >> 385 } >> 386 >> 387 inline >> 388 void G4OpBoundaryProcess::DoReflection() >> 389 { >> 390 if ( theStatus == LambertianReflection ) { >> 391 >> 392 NewMomentum = G4LambertianRand(theGlobalNormal); >> 393 theFacetNormal = (NewMomentum - OldMomentum).unit(); >> 394 >> 395 } >> 396 else if ( theFinish == ground ) { >> 397 >> 398 theStatus = LobeReflection; >> 399 theFacetNormal = GetFacetNormal(OldMomentum,theGlobalNormal); >> 400 G4double PdotN = OldMomentum * theFacetNormal; >> 401 NewMomentum = OldMomentum - (2.*PdotN)*theFacetNormal; >> 402 >> 403 } >> 404 else { >> 405 >> 406 theStatus = SpikeReflection; >> 407 theFacetNormal = theGlobalNormal; >> 408 G4double PdotN = OldMomentum * theFacetNormal; >> 409 NewMomentum = OldMomentum - (2.*PdotN)*theFacetNormal; >> 410 >> 411 } >> 412 G4double EdotN = OldPolarization * theFacetNormal; >> 413 NewPolarization = -OldPolarization + (2.*EdotN)*theFacetNormal; 352 } 414 } 353 415 354 #endif /* G4OpBoundaryProcess_h */ 416 #endif /* G4OpBoundaryProcess_h */ 355 417