Geant4 9.6.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 (G4String)
 
void DefineAngRefAxes (G4String, G4ThreeVector)
 
void SetMinTheta (G4double)
 
void SetMinPhi (G4double)
 
void SetMaxTheta (G4double)
 
void SetMaxPhi (G4double)
 
void SetBeamSigmaInAngR (G4double)
 
void SetBeamSigmaInAngX (G4double)
 
void SetBeamSigmaInAngY (G4double)
 
void UserDefAngTheta (G4ThreeVector)
 
void UserDefAngPhi (G4ThreeVector)
 
void SetFocusPoint (G4ThreeVector)
 
void SetParticleMomentumDirection (G4ParticleMomentum aMomentumDirection)
 
void SetUseUserAngAxis (G4bool)
 
void SetUserWRTSurface (G4bool)
 
void SetPosDistribution (G4SPSPosDistribution *a)
 
void SetBiasRndm (G4SPSRandomGenerator *a)
 
void ReSetHist (G4String)
 
void SetVerbosity (G4int a)
 
G4String GetDistType ()
 
G4double GetMinTheta ()
 
G4double GetMaxTheta ()
 
G4double GetMinPhi ()
 
G4double GetMaxPhi ()
 
G4ParticleMomentum GenerateOne ()
 

Detailed Description

Definition at line 155 of file G4SPSAngDistribution.hh.

Constructor & Destructor Documentation

◆ G4SPSAngDistribution()

G4SPSAngDistribution::G4SPSAngDistribution ( )

Definition at line 54 of file G4SPSAngDistribution.cc.

55 : Theta(0.), Phi(0.)
56{
57 // Angular distribution Variables
58 G4ThreeVector zero;
59 particle_momentum_direction = G4ParticleMomentum(0,0,-1);
60
61 AngDistType = "planar";
62 AngRef1 = CLHEP::HepXHat;
63 AngRef2 = CLHEP::HepYHat;
64 AngRef3 = CLHEP::HepZHat;
65 MinTheta = 0.;
66 MaxTheta = pi;
67 MinPhi = 0.;
68 MaxPhi = twopi;
69 DR = 0.;
70 DX = 0.;
71 DY = 0.;
72 FocusPoint = G4ThreeVector(0., 0., 0.);
73 UserDistType = "NULL";
74 UserWRTSurface = true;
75 UserAngRef = false;
76 IPDFThetaExist = false;
77 IPDFPhiExist = false;
78 verbosityLevel = 0 ;
79}
G4ThreeVector G4ParticleMomentum
CLHEP::Hep3Vector G4ThreeVector
DLL_API const Hep3Vector HepZHat
Definition: ThreeVector.h:424
DLL_API const Hep3Vector HepXHat
DLL_API const Hep3Vector HepYHat
Definition: ThreeVector.h:424
const G4double pi

◆ ~G4SPSAngDistribution()

G4SPSAngDistribution::~G4SPSAngDistribution ( )

Definition at line 81 of file G4SPSAngDistribution.cc.

82{}

Member Function Documentation

◆ DefineAngRefAxes()

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

Definition at line 101 of file G4SPSAngDistribution.cc.

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

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ GenerateOne()

G4ParticleMomentum G4SPSAngDistribution::GenerateOne ( )

Definition at line 602 of file G4SPSAngDistribution.cc.

603{
604 // Angular stuff
605 if(AngDistType == "iso")
606 GenerateIsotropicFlux();
607 else if(AngDistType == "cos")
608 GenerateCosineLawFlux();
609 else if(AngDistType == "planar")
610 GeneratePlanarFlux();
611 else if(AngDistType == "beam1d" || AngDistType == "beam2d" )
612 GenerateBeamFlux();
613 else if(AngDistType == "user")
614 GenerateUserDefFlux();
615 else if(AngDistType == "focused")
616 GenerateFocusedFlux();
617 else
618 G4cout << "Error: AngDistType has unusual value" << G4endl;
619 return particle_momentum_direction;
620}

Referenced by G4SingleParticleSource::GeneratePrimaryVertex().

◆ GetDistType()

G4String G4SPSAngDistribution::GetDistType ( )
inline

Definition at line 188 of file G4SPSAngDistribution.hh.

188{ return AngDistType;}

◆ GetMaxPhi()

G4double G4SPSAngDistribution::GetMaxPhi ( )
inline

Definition at line 192 of file G4SPSAngDistribution.hh.

192{ return MaxPhi; }

◆ GetMaxTheta()

G4double G4SPSAngDistribution::GetMaxTheta ( )
inline

Definition at line 190 of file G4SPSAngDistribution.hh.

190{ return MaxTheta; }

◆ GetMinPhi()

G4double G4SPSAngDistribution::GetMinPhi ( )
inline

Definition at line 191 of file G4SPSAngDistribution.hh.

191{ return MinPhi; }

◆ GetMinTheta()

G4double G4SPSAngDistribution::GetMinTheta ( )
inline

Definition at line 189 of file G4SPSAngDistribution.hh.

189{ return MinTheta; }

◆ ReSetHist()

void G4SPSAngDistribution::ReSetHist ( G4String  atype)

Definition at line 588 of file G4SPSAngDistribution.cc.

589{
590 if (atype == "theta") {
591 UDefThetaH = IPDFThetaH = ZeroPhysVector ;
592 IPDFThetaExist = false ;}
593 else if (atype == "phi"){
594 UDefPhiH = IPDFPhiH = ZeroPhysVector ;
595 IPDFPhiExist = false ;}
596 else {
597 G4cout << "Error, histtype not accepted " << G4endl;
598 }
599}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetAngDistType()

void G4SPSAngDistribution::SetAngDistType ( G4String  atype)

Definition at line 85 of file G4SPSAngDistribution.cc.

86{
87 if(atype != "iso" && atype != "cos" && atype != "user" && atype != "planar"
88 && atype != "beam1d" && atype != "beam2d" && atype != "focused")
89 G4cout << "Error, distribution must be iso, cos, planar, beam1d, beam2d, focused or user" << G4endl;
90 else
91 AngDistType = atype;
92 if (AngDistType == "cos") MaxTheta = pi/2. ;
93 if (AngDistType == "user") {
94 UDefThetaH = IPDFThetaH = ZeroPhysVector ;
95 IPDFThetaExist = false ;
96 UDefPhiH = IPDFPhiH = ZeroPhysVector ;
97 IPDFPhiExist = false ;
98 }
99}

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 DR = r;
145}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetBeamSigmaInAngX()

void G4SPSAngDistribution::SetBeamSigmaInAngX ( G4double  r)

Definition at line 147 of file G4SPSAngDistribution.cc.

148{
149 DX = r;
150}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetBeamSigmaInAngY()

void G4SPSAngDistribution::SetBeamSigmaInAngY ( G4double  r)

Definition at line 152 of file G4SPSAngDistribution.cc.

153{
154 DY = r;
155}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetBiasRndm()

void G4SPSAngDistribution::SetBiasRndm ( G4SPSRandomGenerator a)
inline

Definition at line 181 of file G4SPSAngDistribution.hh.

181{angRndm = a;}

Referenced by G4SingleParticleSource::G4SingleParticleSource().

◆ SetFocusPoint()

void G4SPSAngDistribution::SetFocusPoint ( G4ThreeVector  input)

Definition at line 181 of file G4SPSAngDistribution.cc.

182{
183 FocusPoint = input;
184}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetMaxPhi()

void G4SPSAngDistribution::SetMaxPhi ( G4double  maxp)

Definition at line 137 of file G4SPSAngDistribution.cc.

138{
139 MaxPhi = maxp;
140}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetMaxTheta()

void G4SPSAngDistribution::SetMaxTheta ( G4double  maxt)

◆ SetMinPhi()

void G4SPSAngDistribution::SetMinPhi ( G4double  minp)

Definition at line 127 of file G4SPSAngDistribution.cc.

128{
129 MinPhi = minp;
130}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetMinTheta()

void G4SPSAngDistribution::SetMinTheta ( G4double  mint)

◆ SetParticleMomentumDirection()

void G4SPSAngDistribution::SetParticleMomentumDirection ( G4ParticleMomentum  aMomentumDirection)
inline

Definition at line 174 of file G4SPSAngDistribution.hh.

176 { particle_momentum_direction = aMomentumDirection.unit(); }

Referenced by G4AdjointPrimaryGenerator::GenerateAdjointPrimaryVertex(), and G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetPosDistribution()

void G4SPSAngDistribution::SetPosDistribution ( G4SPSPosDistribution a)
inline

Definition at line 180 of file G4SPSAngDistribution.hh.

180{posDist = a; }

Referenced by G4SingleParticleSource::G4SingleParticleSource().

◆ SetUserWRTSurface()

void G4SPSAngDistribution::SetUserWRTSurface ( G4bool  wrtSurf)

Definition at line 186 of file G4SPSAngDistribution.cc.

187{
188 // This is only applied in user mode?
189 // if UserWRTSurface = true then the user wants momenta with respect
190 // to the surface normals.
191 // When doing this theta has to be 0-90 only otherwise there will be
192 // errors, which currently are flagged anywhere.
193 UserWRTSurface = wrtSurf;
194}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetUseUserAngAxis()

void G4SPSAngDistribution::SetUseUserAngAxis ( G4bool  userang)

Definition at line 196 of file G4SPSAngDistribution.cc.

197{
198 // if UserAngRef = true the angular distribution is defined wrt
199 // the user defined co-ordinates
200 UserAngRef = userang;
201}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ SetVerbosity()

void G4SPSAngDistribution::SetVerbosity ( G4int  a)
inline

Definition at line 186 of file G4SPSAngDistribution.hh.

186{verbosityLevel = a; }

Referenced by G4SingleParticleSource::SetVerbosity().

◆ UserDefAngPhi()

void G4SPSAngDistribution::UserDefAngPhi ( G4ThreeVector  input)

Definition at line 169 of file G4SPSAngDistribution.cc.

170{
171 if(UserDistType == "NULL") UserDistType = "phi";
172 if(UserDistType == "theta") UserDistType = "both";
173 G4double phhi, val;
174 phhi = input.x();
175 val = input.y();
176 if(verbosityLevel >= 1)
177 G4cout << "In UserDefAngPhi" << G4endl;
178 UDefPhiH.InsertValues(phhi, val);
179}
double G4double
Definition: G4Types.hh:64
double x() const
double y() const
void InsertValues(G4double energy, G4double value)

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

◆ UserDefAngTheta()

void G4SPSAngDistribution::UserDefAngTheta ( G4ThreeVector  input)

Definition at line 157 of file G4SPSAngDistribution.cc.

158{
159 if(UserDistType == "NULL") UserDistType = "theta";
160 if(UserDistType == "phi") UserDistType = "both";
161 G4double thi, val;
162 thi = input.x();
163 val = input.y();
164 if(verbosityLevel >= 1)
165 G4cout << "In UserDefAngTheta" << G4endl;
166 UDefThetaH.InsertValues(thi, val);
167}

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().


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