| Summary: | Incorrect normal in G4Para - vector is not normalised | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | John Apostolakis <John.Apostolakis> |
| Component: | geometry/solids | Assignee: | Gabriele Cosmo <Gabriele.Cosmo> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P4 | ||
| Version: | 9.5 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
John Apostolakis
2012-10-03 18:16:44 CEST
There is a simple correction.
Revise the following line:
if (fTalpha) {salpha = -calpha/fTalpha;} // NOTE: using MINUS std::sin(alpha)
to this:
if (fTalpha) {salpha = -calpha*fTalpha;} // NOTE: using MINUS std::sin(alpha)
Below is a patch, which can be applied to the source.
Index: src/G4Para.cc
===================================================================
--- src/G4Para.cc (revision 62306)
+++ src/G4Para.cc (revision 62307)
@@ -495,7 +495,7 @@
newpy = p.y()-fTthetaSphi*p.z();
calpha = 1/std::sqrt(1+fTalpha*fTalpha);
- if (fTalpha) {salpha = -calpha/fTalpha;} // NOTE: using MINUS std::sin(alpha)
+ if (fTalpha) {salpha = -calpha*fTalpha;} // NOTE: using MINUS std::sin(alpha)
else {salpha = 0.;}
// xshift = newpx*calpha+newpy*salpha;
|