Skip to content
Snippets Groups Projects
Commit b9ccd1a2 authored by Michal Kreps's avatar Michal Kreps
Browse files

Backport fix from Geant4 11.0 of uninitialised variable in...

Backport fix from Geant4 11.0 of uninitialised variable in G4OpBoundaryProcess::DielectricDielectric() which caused some reflections to be wrong.
parent c0f76553
Branches
No related tags found
1 merge request!91LHCb optimisations of processes with optical photons
......@@ -960,6 +960,19 @@ void G4OpBoundaryProcess::DielectricDielectric()
G4bool Inside = false;
G4bool Swap = false;
if (theFinish == polished) {
theFacetNormal = theGlobalNormal;
}
else {
theFacetNormal = GetFacetNormal(OldMomentum, theGlobalNormal);
}
// These variables deliberately shadow at this moment, this is backport
// from Geant4 11.0
G4double cost1 = -OldMomentum * theFacetNormal;
G4double cost2 = 0.;
G4double sint2 = 0.;
G4bool SurfaceRoughnessCriterionPass = true;
if (theSurfaceRoughness != 0. && Rindex1 > Rindex2) {
G4double wavelength = h_Planck*c_light/thePhotonMomentum;
......@@ -1303,7 +1316,7 @@ void G4OpBoundaryProcess::CalculateReflectivity()
}
G4double PdotN = OldMomentum * theFacetNormal;
cost1 = -PdotN;
G4double cost1 = -PdotN;
if (std::abs(cost1) < 1.0 - kCarTolerance) {
sint1 = std::sqrt(1. - cost1*cost1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment