Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
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 ( )

Definition at line 54 of file G4SPSAngDistribution.cc.

References CLHEP::HepXHat, CLHEP::HepYHat, CLHEP::HepZHat, python.hepunit::pi, and python.hepunit::twopi.

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 }
DLL_API const Hep3Vector HepZHat
CLHEP::Hep3Vector G4ThreeVector
DLL_API const Hep3Vector HepYHat
DLL_API const Hep3Vector HepXHat
G4ThreeVector G4ParticleMomentum
G4SPSAngDistribution::~G4SPSAngDistribution ( )

Definition at line 81 of file G4SPSAngDistribution.cc.

82 {}

Member Function Documentation

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

Definition at line 101 of file G4SPSAngDistribution.cc.

References CLHEP::Hep3Vector::cross(), G4cout, G4endl, and CLHEP::Hep3Vector::unit().

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

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 }
G4GLOB_DLL std::ostream G4cout
Hep3Vector unit() const
#define G4endl
Definition: G4ios.hh:61
Hep3Vector cross(const Hep3Vector &) const
G4ParticleMomentum G4SPSAngDistribution::GenerateOne ( )

Definition at line 602 of file G4SPSAngDistribution.cc.

References G4cout, and G4endl.

Referenced by G4SingleParticleSource::GeneratePrimaryVertex().

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 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4String G4SPSAngDistribution::GetDistType ( )
inline

Definition at line 188 of file G4SPSAngDistribution.hh.

188 { return AngDistType;}
G4double G4SPSAngDistribution::GetMaxPhi ( )
inline

Definition at line 192 of file G4SPSAngDistribution.hh.

192 { return MaxPhi; }
G4double G4SPSAngDistribution::GetMaxTheta ( )
inline

Definition at line 190 of file G4SPSAngDistribution.hh.

190 { return MaxTheta; }
G4double G4SPSAngDistribution::GetMinPhi ( )
inline

Definition at line 191 of file G4SPSAngDistribution.hh.

191 { return MinPhi; }
G4double G4SPSAngDistribution::GetMinTheta ( )
inline

Definition at line 189 of file G4SPSAngDistribution.hh.

189 { return MinTheta; }
void G4SPSAngDistribution::ReSetHist ( G4String  atype)

Definition at line 588 of file G4SPSAngDistribution.cc.

References G4cout, and G4endl.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

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 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4SPSAngDistribution::SetAngDistType ( G4String  atype)

Definition at line 85 of file G4SPSAngDistribution.cc.

References G4cout, G4endl, and python.hepunit::pi.

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

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 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4SPSAngDistribution::SetBeamSigmaInAngR ( G4double  r)

Definition at line 142 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

143 {
144  DR = r;
145 }
void G4SPSAngDistribution::SetBeamSigmaInAngX ( G4double  r)

Definition at line 147 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

148 {
149  DX = r;
150 }
void G4SPSAngDistribution::SetBeamSigmaInAngY ( G4double  r)

Definition at line 152 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

153 {
154  DY = r;
155 }
void G4SPSAngDistribution::SetBiasRndm ( G4SPSRandomGenerator a)
inline

Definition at line 181 of file G4SPSAngDistribution.hh.

References test::a.

Referenced by G4SingleParticleSource::G4SingleParticleSource().

181 {angRndm = a;}
void G4SPSAngDistribution::SetFocusPoint ( G4ThreeVector  input)

Definition at line 181 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

182 {
183  FocusPoint = input;
184 }
void G4SPSAngDistribution::SetMaxPhi ( G4double  maxp)

Definition at line 137 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

138 {
139  MaxPhi = maxp;
140 }
void G4SPSAngDistribution::SetMaxTheta ( G4double  maxt)

Definition at line 132 of file G4SPSAngDistribution.cc.

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

133 {
134  MaxTheta = maxt;
135 }
void G4SPSAngDistribution::SetMinPhi ( G4double  minp)

Definition at line 127 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

128 {
129  MinPhi = minp;
130 }
void G4SPSAngDistribution::SetMinTheta ( G4double  mint)

Definition at line 122 of file G4SPSAngDistribution.cc.

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

123 {
124  MinTheta = mint;
125 }
void G4SPSAngDistribution::SetParticleMomentumDirection ( G4ParticleMomentum  aMomentumDirection)
inline
void G4SPSAngDistribution::SetPosDistribution ( G4SPSPosDistribution a)
inline

Definition at line 180 of file G4SPSAngDistribution.hh.

References test::a.

Referenced by G4SingleParticleSource::G4SingleParticleSource().

180 {posDist = a; }
void G4SPSAngDistribution::SetUserWRTSurface ( G4bool  wrtSurf)

Definition at line 186 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

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 }
void G4SPSAngDistribution::SetUseUserAngAxis ( G4bool  userang)

Definition at line 196 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

197 {
198  // if UserAngRef = true the angular distribution is defined wrt
199  // the user defined co-ordinates
200  UserAngRef = userang;
201 }
void G4SPSAngDistribution::SetVerbosity ( G4int  a)
inline

Definition at line 186 of file G4SPSAngDistribution.hh.

References test::a.

Referenced by G4SingleParticleSource::SetVerbosity().

186 {verbosityLevel = a; }
void G4SPSAngDistribution::UserDefAngPhi ( G4ThreeVector  input)

Definition at line 169 of file G4SPSAngDistribution.cc.

References G4cout, G4endl, G4PhysicsOrderedFreeVector::InsertValues(), CLHEP::Hep3Vector::x(), and CLHEP::Hep3Vector::y().

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

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 x() const
void InsertValues(G4double energy, G4double value)
G4GLOB_DLL std::ostream G4cout
double y() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void G4SPSAngDistribution::UserDefAngTheta ( G4ThreeVector  input)

Definition at line 157 of file G4SPSAngDistribution.cc.

References G4cout, G4endl, G4PhysicsOrderedFreeVector::InsertValues(), CLHEP::Hep3Vector::x(), and CLHEP::Hep3Vector::y().

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

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 }
double x() const
void InsertValues(G4double energy, G4double value)
G4GLOB_DLL std::ostream G4cout
double y() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

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