Problem 1278

Summary: a problem in void G4SPSPosDistribution::SetBeamSigmaInR(G4double r)
Product: Geant4 Reporter: Fada Guan <guanfada>
Component: eventAssignee: Laurent Desorgher <desorgher>
Status: RESOLVED FIXED    
Severity: trivial CC: asai
Priority: P5    
Version: 9.4   
Hardware: All   
OS: All   
URL: http://www.lcsim.org/software/geant4/doxygen/html/G4SPSPosDistribution_8cc_source.html#l00154

Description Fada Guan 2012-01-11 23:52:53 CET
00028 // MODULE:        G4SPSPosDistribution.cc
00029 //
00030 // Version:      1.0
00031 // Date:         5/02/04
00032 // Author:       Fan Lei 
00033 // Organisation: QinetiQ ltd.
00034 // Customer:     ESA/ESTEC


00154 void G4SPSPosDistribution::SetBeamSigmaInR(G4double r)
00155 {
00156   SR = r;
00157   SX = SY = r/std::sqrt(2.);
00158 }


If we define the polar radius r = sqrt(x^2+y^2), we can get the variance of r: 
(sigma_r)^2 = [(sigma_x)^2*x^2+ (sigma_y)^2*y^2]/(x^2+y^2)
 
in this Circle Beam case, we can assume: 
sigma_x = sigma_y, so we can get: 
(sigma_r)^2 = [(sigma_x)^2*(x^2+ y^2)]/(x^2+y^2) = (sigma_x)^2 
then, we get: 
sigma_r = sigma_x = sigma_y

so, the line 00157 should be changed to :
00157   SX = SY = r;

I have contacted with the author Dr. Fan Lei (flei@space.qinetiq.com), and he accepted my suggestion.

I think reporting this bug here is official, and more users can know it.

Thanks very much.

Fada Guan
Comment 1 asai 2012-01-12 02:09:23 CET
Thank you for spotting this problem.
Comment 2 Laurent Desorgher 2012-07-23 16:33:48 CEST
Dear Fada,

Thanks you for spotting the problem. 
It has been resolved on January 12th, 2012, following  your suggestions. 
The modifications are now available in the last G4 patch.


Best Regards

Laurent Desorgher