Problem 1278 - a problem in void G4SPSPosDistribution::SetBeamSigmaInR(G4double r)
Summary: a problem in void G4SPSPosDistribution::SetBeamSigmaInR(G4double r)
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: event (show other problems)
Version: 9.4
Hardware: All All
: P5 trivial
Assignee: Laurent Desorgher
URL: http://www.lcsim.org/software/geant4/...
Depends on:
Blocks:
 
Reported: 2012-01-11 23:52 CET by Fada Guan
Modified: 2012-07-23 16:33 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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