Geant4 11.2.2
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{
40 // Angular distribution Variables
41 G4ThreeVector zero;
42 particle_momentum_direction = G4ParticleMomentum(0,0,-1);
43
44 AngDistType = "planar";
45 AngRef1 = CLHEP::HepXHat;
46 AngRef2 = CLHEP::HepYHat;
47 AngRef3 = CLHEP::HepZHat;
48 MinTheta = 0.;
49 MaxTheta = pi;
50 MinPhi = 0.;
51 MaxPhi = twopi;
52 DR = 0.;
53 DX = 0.;
54 DY = 0.;
55 FocusPoint = G4ThreeVector(0., 0., 0.);
56 UserDistType = "NULL";
57 UserWRTSurface = true;
58 UserAngRef = false;
59 IPDFThetaExist = false;
60 IPDFPhiExist = false;
61 verbosityLevel = 0;
62
64}
G4ThreeVector G4ParticleMomentum
#define G4MUTEXINIT(mutex)
CLHEP::Hep3Vector G4ThreeVector
DLL_API const Hep3Vector HepZHat
DLL_API const Hep3Vector HepXHat
DLL_API const Hep3Vector HepYHat

◆ ~G4SPSAngDistribution()

G4SPSAngDistribution::~G4SPSAngDistribution ( )

Definition at line 66 of file G4SPSAngDistribution.cc.

67{
69}
#define G4MUTEXDESTROY(mutex)

Member Function Documentation

◆ DefineAngRefAxes()

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

Definition at line 94 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ GenerateOne()

G4ParticleMomentum G4SPSAngDistribution::GenerateOne ( )

Definition at line 760 of file G4SPSAngDistribution.cc.

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

Referenced by G4SingleParticleSource::GeneratePrimaryVertex().

◆ GetDirection()

G4ThreeVector G4SPSAngDistribution::GetDirection ( )

Definition at line 227 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSource::ListSource().

◆ GetDistType()

G4String G4SPSAngDistribution::GetDistType ( )

Definition at line 197 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSource::ListSource().

◆ GetMaxPhi()

G4double G4SPSAngDistribution::GetMaxPhi ( )

Definition at line 221 of file G4SPSAngDistribution.cc.

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

◆ GetMaxTheta()

G4double G4SPSAngDistribution::GetMaxTheta ( )

Definition at line 209 of file G4SPSAngDistribution.cc.

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

◆ GetMinPhi()

G4double G4SPSAngDistribution::GetMinPhi ( )

Definition at line 215 of file G4SPSAngDistribution.cc.

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

◆ GetMinTheta()

G4double G4SPSAngDistribution::GetMinTheta ( )

Definition at line 203 of file G4SPSAngDistribution.cc.

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

◆ ReSetHist()

void G4SPSAngDistribution::ReSetHist ( const G4String & atype)

Definition at line 741 of file G4SPSAngDistribution.cc.

742{
743 G4AutoLock l(&mutex);
744 if (atype == "theta")
745 {
746 UDefThetaH = IPDFThetaH = ZeroPhysVector ;
747 IPDFThetaExist = false ;
748 }
749 else if (atype == "phi")
750 {
751 UDefPhiH = IPDFPhiH = ZeroPhysVector ;
752 IPDFPhiExist = false ;
753 }
754 else
755 {
756 G4cout << "Error, histtype not accepted " << G4endl;
757 }
758}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetAngDistType()

void G4SPSAngDistribution::SetAngDistType ( const G4String & atype)

Definition at line 71 of file G4SPSAngDistribution.cc.

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

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

◆ SetBeamSigmaInAngR()

void G4SPSAngDistribution::SetBeamSigmaInAngR ( G4double r)

Definition at line 142 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetBeamSigmaInAngX()

void G4SPSAngDistribution::SetBeamSigmaInAngX ( G4double r)

Definition at line 148 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetBeamSigmaInAngY()

void G4SPSAngDistribution::SetBeamSigmaInAngY ( G4double r)

Definition at line 154 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetBiasRndm()

void G4SPSAngDistribution::SetBiasRndm ( G4SPSRandomGenerator * a)

Definition at line 173 of file G4SPSAngDistribution.cc.

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

Referenced by G4SingleParticleSource::G4SingleParticleSource().

◆ SetFocusPoint()

void G4SPSAngDistribution::SetFocusPoint ( const G4ThreeVector & input)

Definition at line 245 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetMaxPhi()

void G4SPSAngDistribution::SetMaxPhi ( G4double maxp)

Definition at line 136 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetMaxTheta()

void G4SPSAngDistribution::SetMaxTheta ( G4double maxt)

◆ SetMinPhi()

void G4SPSAngDistribution::SetMinPhi ( G4double minp)

Definition at line 124 of file G4SPSAngDistribution.cc.

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

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 167 of file G4SPSAngDistribution.cc.

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

Referenced by G4SingleParticleSource::G4SingleParticleSource().

◆ SetUserWRTSurface()

void G4SPSAngDistribution::SetUserWRTSurface ( G4bool wrtSurf)

Definition at line 251 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetUseUserAngAxis()

void G4SPSAngDistribution::SetUseUserAngAxis ( G4bool userang)

Definition at line 263 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetVerbosity()

void G4SPSAngDistribution::SetVerbosity ( G4int a)

Definition at line 179 of file G4SPSAngDistribution.cc.

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

Referenced by G4SingleParticleSource::SetVerbosity().

◆ UserDefAngPhi()

void G4SPSAngDistribution::UserDefAngPhi ( const G4ThreeVector & input)

Definition at line 233 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ UserDefAngTheta()

void G4SPSAngDistribution::UserDefAngTheta ( const G4ThreeVector & input)

Definition at line 185 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().


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