Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SPSAngDistribution Class Reference

#include <G4SPSAngDistribution.hh>

Public Member Functions

 G4SPSAngDistribution ()
 
 ~G4SPSAngDistribution ()
 
void SetAngDistType (const G4String &)
 
void DefineAngRefAxes (const G4String &, const G4ThreeVector &)
 
void SetMinTheta (G4double)
 
void SetMinPhi (G4double)
 
void SetMaxTheta (G4double)
 
void SetMaxPhi (G4double)
 
void SetBeamSigmaInAngR (G4double)
 
void SetBeamSigmaInAngX (G4double)
 
void SetBeamSigmaInAngY (G4double)
 
void UserDefAngTheta (const G4ThreeVector &)
 
void UserDefAngPhi (const G4ThreeVector &)
 
void SetFocusPoint (const G4ThreeVector &)
 
void SetParticleMomentumDirection (const G4ParticleMomentum &aMomDirection)
 
void SetUseUserAngAxis (G4bool)
 
void SetUserWRTSurface (G4bool)
 
void SetPosDistribution (G4SPSPosDistribution *a)
 
void SetBiasRndm (G4SPSRandomGenerator *a)
 
G4ParticleMomentum GenerateOne ()
 
void ReSetHist (const G4String &)
 
void SetVerbosity (G4int a)
 
G4String GetDistType ()
 
G4double GetMinTheta ()
 
G4double GetMaxTheta ()
 
G4double GetMinPhi ()
 
G4double GetMaxPhi ()
 
G4ThreeVector GetDirection ()
 

Detailed Description

Definition at line 66 of file G4SPSAngDistribution.hh.

Constructor & Destructor Documentation

◆ G4SPSAngDistribution()

G4SPSAngDistribution::G4SPSAngDistribution ( )

Definition at line 38 of file G4SPSAngDistribution.cc.

39 : Theta(0.), Phi(0.)
40{
41 // Angular distribution Variables
42 G4ThreeVector zero;
43 particle_momentum_direction = G4ParticleMomentum(0,0,-1);
44
45 AngDistType = "planar";
46 AngRef1 = CLHEP::HepXHat;
47 AngRef2 = CLHEP::HepYHat;
48 AngRef3 = CLHEP::HepZHat;
49 MinTheta = 0.;
50 MaxTheta = pi;
51 MinPhi = 0.;
52 MaxPhi = twopi;
53 DR = 0.;
54 DX = 0.;
55 DY = 0.;
56 FocusPoint = G4ThreeVector(0., 0., 0.);
57 UserDistType = "NULL";
58 UserWRTSurface = true;
59 UserAngRef = false;
60 IPDFThetaExist = false;
61 IPDFPhiExist = false;
62 verbosityLevel = 0;
63
65}
G4ThreeVector G4ParticleMomentum
#define G4MUTEXINIT(mutex)
Definition: G4Threading.hh:87
CLHEP::Hep3Vector G4ThreeVector
DLL_API const Hep3Vector HepZHat
Definition: ThreeVector.h:419
DLL_API const Hep3Vector HepXHat
DLL_API const Hep3Vector HepYHat
Definition: ThreeVector.h:419
const G4double pi

◆ ~G4SPSAngDistribution()

G4SPSAngDistribution::~G4SPSAngDistribution ( )

Definition at line 67 of file G4SPSAngDistribution.cc.

68{
70}
#define G4MUTEXDESTROY(mutex)
Definition: G4Threading.hh:90

Member Function Documentation

◆ DefineAngRefAxes()

void G4SPSAngDistribution::DefineAngRefAxes ( const G4String refname,
const G4ThreeVector ref 
)

Definition at line 95 of file G4SPSAngDistribution.cc.

97{
98 G4AutoLock l(&mutex);
99 if (refname == "angref1")
100 AngRef1 = ref.unit(); // x'
101 else if (refname == "angref2")
102 AngRef2 = ref.unit(); // vector in x'y' plane
103
104 // User defines x' (AngRef1) and a vector in the x'y'
105 // plane (AngRef2). Then, AngRef1 x AngRef2 = AngRef3
106 // the z' vector. Then, AngRef3 x AngRef1 = AngRef2
107 // which will now be y'.
108
109 AngRef3 = AngRef1.cross(AngRef2); // z'
110 AngRef2 = AngRef3.cross(AngRef1); // y'
111 UserAngRef = true ;
112 if(verbosityLevel == 2)
113 {
114 G4cout << "Angular distribution rotation axes " << AngRef1
115 << " " << AngRef2 << " " << AngRef3 << G4endl;
116 }
117}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
Hep3Vector unit() const
Hep3Vector cross(const Hep3Vector &) const

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ GenerateOne()

G4ParticleMomentum G4SPSAngDistribution::GenerateOne ( )

Definition at line 766 of file G4SPSAngDistribution.cc.

767{
768 // Local copy for thread safety
769 //
770 G4ParticleMomentum localM = particle_momentum_direction;
771
772 // Angular stuff
773 //
774 if(AngDistType == "iso")
775 GenerateIsotropicFlux(localM);
776 else if(AngDistType == "cos")
777 GenerateCosineLawFlux(localM);
778 else if(AngDistType == "planar")
779 GeneratePlanarFlux(localM);
780 else if(AngDistType == "beam1d" || AngDistType == "beam2d" )
781 GenerateBeamFlux(localM);
782 else if(AngDistType == "user")
783 GenerateUserDefFlux(localM);
784 else if(AngDistType == "focused")
785 GenerateFocusedFlux(localM);
786 else
787 G4cout << "Error: AngDistType has unusual value" << G4endl;
788 return localM;
789}

Referenced by G4SingleParticleSource::GeneratePrimaryVertex().

◆ GetDirection()

G4ThreeVector G4SPSAngDistribution::GetDirection ( )

Definition at line 228 of file G4SPSAngDistribution.cc.

229{
230 G4AutoLock l(&mutex);
231 return particle_momentum_direction;
232}

Referenced by G4GeneralParticleSource::ListSource().

◆ GetDistType()

G4String G4SPSAngDistribution::GetDistType ( )

Definition at line 198 of file G4SPSAngDistribution.cc.

199{
200 G4AutoLock l(&mutex);
201 return AngDistType;
202}

Referenced by G4GeneralParticleSource::ListSource().

◆ GetMaxPhi()

G4double G4SPSAngDistribution::GetMaxPhi ( )

Definition at line 222 of file G4SPSAngDistribution.cc.

223{
224 G4AutoLock l(&mutex);
225 return MaxPhi;
226}

◆ GetMaxTheta()

G4double G4SPSAngDistribution::GetMaxTheta ( )

Definition at line 210 of file G4SPSAngDistribution.cc.

211{
212 G4AutoLock l(&mutex);
213 return MaxTheta;
214}

◆ GetMinPhi()

G4double G4SPSAngDistribution::GetMinPhi ( )

Definition at line 216 of file G4SPSAngDistribution.cc.

217{
218 G4AutoLock l(&mutex);
219 return MinPhi;
220}

◆ GetMinTheta()

G4double G4SPSAngDistribution::GetMinTheta ( )

Definition at line 204 of file G4SPSAngDistribution.cc.

205{
206 G4AutoLock l(&mutex);
207 return MinTheta;
208}

◆ ReSetHist()

void G4SPSAngDistribution::ReSetHist ( const G4String atype)

Definition at line 747 of file G4SPSAngDistribution.cc.

748{
749 G4AutoLock l(&mutex);
750 if (atype == "theta")
751 {
752 UDefThetaH = IPDFThetaH = ZeroPhysVector ;
753 IPDFThetaExist = false ;
754 }
755 else if (atype == "phi")
756 {
757 UDefPhiH = IPDFPhiH = ZeroPhysVector ;
758 IPDFPhiExist = false ;
759 }
760 else
761 {
762 G4cout << "Error, histtype not accepted " << G4endl;
763 }
764}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetAngDistType()

void G4SPSAngDistribution::SetAngDistType ( const G4String atype)

Definition at line 72 of file G4SPSAngDistribution.cc.

73{
74 G4AutoLock l(&mutex);
75 if(atype != "iso" && atype != "cos" && atype != "user" && atype != "planar"
76 && atype != "beam1d" && atype != "beam2d" && atype != "focused")
77 {
78 G4cout << "Error, distribution must be iso, cos, planar, beam1d, beam2d, focused or user"
79 << G4endl;
80 }
81 else
82 {
83 AngDistType = atype;
84 }
85 if (AngDistType == "cos") { MaxTheta = pi/2.; }
86 if (AngDistType == "user")
87 {
88 UDefThetaH = IPDFThetaH = ZeroPhysVector;
89 IPDFThetaExist = false;
90 UDefPhiH = IPDFPhiH = ZeroPhysVector;
91 IPDFPhiExist = false;
92 }
93}

Referenced by G4AdjointPrimaryGenerator::G4AdjointPrimaryGenerator(), G4AdjointPrimaryGenerator::SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume(), G4GeneralParticleSourceMessenger::SetNewValue(), and G4AdjointPrimaryGenerator::SetSphericalAdjointPrimarySource().

◆ SetBeamSigmaInAngR()

void G4SPSAngDistribution::SetBeamSigmaInAngR ( G4double  r)

Definition at line 143 of file G4SPSAngDistribution.cc.

144{
145 G4AutoLock l(&mutex);
146 DR = r;
147}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetBeamSigmaInAngX()

void G4SPSAngDistribution::SetBeamSigmaInAngX ( G4double  r)

Definition at line 149 of file G4SPSAngDistribution.cc.

150{
151 G4AutoLock l(&mutex);
152 DX = r;
153}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetBeamSigmaInAngY()

void G4SPSAngDistribution::SetBeamSigmaInAngY ( G4double  r)

Definition at line 155 of file G4SPSAngDistribution.cc.

156{
157 G4AutoLock l(&mutex);
158 DY = r;
159}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetBiasRndm()

void G4SPSAngDistribution::SetBiasRndm ( G4SPSRandomGenerator a)

Definition at line 174 of file G4SPSAngDistribution.cc.

175{
176 G4AutoLock l(&mutex);
177 angRndm = a;
178}

Referenced by G4SingleParticleSource::G4SingleParticleSource().

◆ SetFocusPoint()

void G4SPSAngDistribution::SetFocusPoint ( const G4ThreeVector input)

Definition at line 246 of file G4SPSAngDistribution.cc.

247{
248 G4AutoLock l(&mutex);
249 FocusPoint = input;
250}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetMaxPhi()

void G4SPSAngDistribution::SetMaxPhi ( G4double  maxp)

Definition at line 137 of file G4SPSAngDistribution.cc.

138{
139 G4AutoLock l(&mutex);
140 MaxPhi = maxp;
141}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetMaxTheta()

void G4SPSAngDistribution::SetMaxTheta ( G4double  maxt)

◆ SetMinPhi()

void G4SPSAngDistribution::SetMinPhi ( G4double  minp)

Definition at line 125 of file G4SPSAngDistribution.cc.

126{
127 G4AutoLock l(&mutex);
128 MinPhi = minp;
129}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetMinTheta()

void G4SPSAngDistribution::SetMinTheta ( G4double  mint)

◆ SetParticleMomentumDirection()

void G4SPSAngDistribution::SetParticleMomentumDirection ( const G4ParticleMomentum aMomDirection)

◆ SetPosDistribution()

void G4SPSAngDistribution::SetPosDistribution ( G4SPSPosDistribution a)

Definition at line 168 of file G4SPSAngDistribution.cc.

169{
170 G4AutoLock l(&mutex);
171 posDist = a;
172}

Referenced by G4SingleParticleSource::G4SingleParticleSource().

◆ SetUserWRTSurface()

void G4SPSAngDistribution::SetUserWRTSurface ( G4bool  wrtSurf)

Definition at line 252 of file G4SPSAngDistribution.cc.

253{
254 G4AutoLock l(&mutex);
255
256 // if UserWRTSurface = true then the user wants momenta with respect
257 // to the surface normals.
258 // When doing this theta has to be 0-90 only otherwise there will be
259 // errors, which currently are flagged anywhere.
260 //
261 UserWRTSurface = wrtSurf;
262}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetUseUserAngAxis()

void G4SPSAngDistribution::SetUseUserAngAxis ( G4bool  userang)

Definition at line 264 of file G4SPSAngDistribution.cc.

265{
266 G4AutoLock l(&mutex);
267
268 // if UserAngRef = true the angular distribution is defined wrt
269 // the user defined coordinates
270 //
271 UserAngRef = userang;
272}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetVerbosity()

void G4SPSAngDistribution::SetVerbosity ( G4int  a)

Definition at line 180 of file G4SPSAngDistribution.cc.

181{
182 G4AutoLock l(&mutex);
183 verbosityLevel = a;
184}

Referenced by G4SingleParticleSource::SetVerbosity().

◆ UserDefAngPhi()

void G4SPSAngDistribution::UserDefAngPhi ( const G4ThreeVector input)

Definition at line 234 of file G4SPSAngDistribution.cc.

235{
236 G4AutoLock l(&mutex);
237 if(UserDistType == "NULL") UserDistType = "phi";
238 if(UserDistType == "theta") UserDistType = "both";
239 G4double phhi, val;
240 phhi = input.x();
241 val = input.y();
242 if(verbosityLevel >= 1) G4cout << "In UserDefAngPhi" << G4endl;
243 UDefPhiH.InsertValues(phhi, val);
244}
double G4double
Definition: G4Types.hh:83
double x() const
double y() const
void InsertValues(G4double energy, G4double value)

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ UserDefAngTheta()

void G4SPSAngDistribution::UserDefAngTheta ( const G4ThreeVector input)

Definition at line 186 of file G4SPSAngDistribution.cc.

187{
188 G4AutoLock l(&mutex);
189 if(UserDistType == "NULL") UserDistType = "theta";
190 if(UserDistType == "phi") UserDistType = "both";
191 G4double thi, val;
192 thi = input.x();
193 val = input.y();
194 if(verbosityLevel >= 1) G4cout << "In UserDefAngTheta" << G4endl;
195 UDefThetaH.InsertValues(thi, val);
196}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().


The documentation for this class was generated from the following files: