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(), and G4INCL::Math::pi.

00055   : Theta(0.), Phi(0.)
00056 {
00057   // Angular distribution Variables
00058   G4ThreeVector zero;
00059   particle_momentum_direction = G4ParticleMomentum(0,0,-1);
00060 
00061   AngDistType = "planar"; 
00062   AngRef1 = CLHEP::HepXHat;
00063   AngRef2 = CLHEP::HepYHat;
00064   AngRef3 = CLHEP::HepZHat;
00065   MinTheta = 0.;
00066   MaxTheta = pi;
00067   MinPhi = 0.;
00068   MaxPhi = twopi;
00069   DR = 0.;
00070   DX = 0.;
00071   DY = 0.;
00072   FocusPoint = G4ThreeVector(0., 0., 0.);
00073   UserDistType = "NULL";
00074   UserWRTSurface = true;
00075   UserAngRef = false;
00076   IPDFThetaExist = false;
00077   IPDFPhiExist = false;
00078   verbosityLevel = 0 ;
00079 }

G4SPSAngDistribution::~G4SPSAngDistribution (  ) 

Definition at line 81 of file G4SPSAngDistribution.cc.

00082 {}


Member Function Documentation

void G4SPSAngDistribution::DefineAngRefAxes ( G4String  ,
G4ThreeVector   
)

Definition at line 101 of file G4SPSAngDistribution.cc.

References G4cout, and G4endl.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00102 {
00103   if(refname == "angref1")
00104     AngRef1 = ref.unit(); // x'
00105   else if(refname == "angref2")
00106     AngRef2 = ref.unit(); // vector in x'y' plane
00107 
00108   // User defines x' (AngRef1) and a vector in the x'y'
00109   // plane (AngRef2). Then, AngRef1 x AngRef2 = AngRef3
00110   // the z' vector. Then, AngRef3 x AngRef1 = AngRef2
00111   // which will now be y'.
00112 
00113   AngRef3 = AngRef1.cross(AngRef2); // z'
00114   AngRef2 = AngRef3.cross(AngRef1); // y'
00115   UserAngRef = true ;
00116   if(verbosityLevel == 2)
00117     {
00118       G4cout << "Angular distribution rotation axes " << AngRef1 << " " << AngRef2 << " " << AngRef3 << G4endl;
00119     }
00120 }

G4ParticleMomentum G4SPSAngDistribution::GenerateOne (  ) 

Definition at line 602 of file G4SPSAngDistribution.cc.

References G4cout.

Referenced by G4SingleParticleSource::GeneratePrimaryVertex().

00603 {
00604   // Angular stuff
00605   if(AngDistType == "iso")
00606     GenerateIsotropicFlux();
00607   else if(AngDistType == "cos")
00608     GenerateCosineLawFlux();
00609   else if(AngDistType == "planar")
00610     GeneratePlanarFlux();
00611   else if(AngDistType == "beam1d" || AngDistType == "beam2d" )
00612     GenerateBeamFlux();
00613   else if(AngDistType == "user")
00614     GenerateUserDefFlux();
00615   else if(AngDistType == "focused")
00616     GenerateFocusedFlux();
00617   else
00618     G4cout << "Error: AngDistType has unusual value" << G4endl;
00619   return particle_momentum_direction;
00620 }

G4String G4SPSAngDistribution::GetDistType (  )  [inline]

Definition at line 188 of file G4SPSAngDistribution.hh.

00188 { return AngDistType;}

G4double G4SPSAngDistribution::GetMaxPhi (  )  [inline]

Definition at line 192 of file G4SPSAngDistribution.hh.

00192 { return MaxPhi; }

G4double G4SPSAngDistribution::GetMaxTheta (  )  [inline]

Definition at line 190 of file G4SPSAngDistribution.hh.

00190 { return MaxTheta; }

G4double G4SPSAngDistribution::GetMinPhi (  )  [inline]

Definition at line 191 of file G4SPSAngDistribution.hh.

00191 { return MinPhi; }

G4double G4SPSAngDistribution::GetMinTheta (  )  [inline]

Definition at line 189 of file G4SPSAngDistribution.hh.

00189 { return MinTheta; }

void G4SPSAngDistribution::ReSetHist ( G4String   ) 

Definition at line 588 of file G4SPSAngDistribution.cc.

References G4cout.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00589 {
00590   if (atype == "theta") {
00591     UDefThetaH = IPDFThetaH = ZeroPhysVector ;
00592     IPDFThetaExist = false ;}
00593   else if (atype == "phi"){    
00594     UDefPhiH = IPDFPhiH = ZeroPhysVector ;
00595     IPDFPhiExist = false ;} 
00596   else {
00597     G4cout << "Error, histtype not accepted " << G4endl;
00598   }
00599 }

void G4SPSAngDistribution::SetAngDistType ( G4String   ) 

Definition at line 85 of file G4SPSAngDistribution.cc.

References G4cout, G4endl, and G4INCL::Math::pi.

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

00086 {
00087   if(atype != "iso" && atype != "cos" && atype != "user" && atype != "planar"
00088      && atype != "beam1d" && atype != "beam2d"  && atype != "focused")
00089     G4cout << "Error, distribution must be iso, cos, planar, beam1d, beam2d, focused or user" << G4endl;
00090   else
00091     AngDistType = atype;
00092   if (AngDistType == "cos") MaxTheta = pi/2. ;
00093   if (AngDistType == "user") {
00094     UDefThetaH = IPDFThetaH = ZeroPhysVector ;
00095     IPDFThetaExist = false ;
00096     UDefPhiH = IPDFPhiH = ZeroPhysVector ;
00097     IPDFPhiExist = false ;
00098   }
00099 }

void G4SPSAngDistribution::SetBeamSigmaInAngR ( G4double   ) 

Definition at line 142 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00143 {
00144   DR = r;
00145 }

void G4SPSAngDistribution::SetBeamSigmaInAngX ( G4double   ) 

Definition at line 147 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00148 {
00149   DX = r;
00150 }

void G4SPSAngDistribution::SetBeamSigmaInAngY ( G4double   ) 

Definition at line 152 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00153 {
00154   DY = r;
00155 }

void G4SPSAngDistribution::SetBiasRndm ( G4SPSRandomGenerator a  )  [inline]

Definition at line 181 of file G4SPSAngDistribution.hh.

Referenced by G4SingleParticleSource::G4SingleParticleSource().

00181 {angRndm = a;}

void G4SPSAngDistribution::SetFocusPoint ( G4ThreeVector   ) 

Definition at line 181 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00182 {
00183   FocusPoint = input;
00184 }

void G4SPSAngDistribution::SetMaxPhi ( G4double   ) 

Definition at line 137 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00138 {
00139   MaxPhi = maxp;
00140 }

void G4SPSAngDistribution::SetMaxTheta ( G4double   ) 

Definition at line 132 of file G4SPSAngDistribution.cc.

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

00133 {
00134   MaxTheta = maxt;
00135 }

void G4SPSAngDistribution::SetMinPhi ( G4double   ) 

Definition at line 127 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00128 {
00129   MinPhi = minp;
00130 }

void G4SPSAngDistribution::SetMinTheta ( G4double   ) 

Definition at line 122 of file G4SPSAngDistribution.cc.

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

00123 {
00124   MinTheta = mint;
00125 }

void G4SPSAngDistribution::SetParticleMomentumDirection ( G4ParticleMomentum  aMomentumDirection  )  [inline]

Definition at line 175 of file G4SPSAngDistribution.hh.

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

00176   { particle_momentum_direction =  aMomentumDirection.unit(); }

void G4SPSAngDistribution::SetPosDistribution ( G4SPSPosDistribution a  )  [inline]

Definition at line 180 of file G4SPSAngDistribution.hh.

Referenced by G4SingleParticleSource::G4SingleParticleSource().

00180 {posDist = a; }

void G4SPSAngDistribution::SetUserWRTSurface ( G4bool   ) 

Definition at line 186 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00187 {
00188   // This is only applied in user mode?
00189   // if UserWRTSurface = true then the user wants momenta with respect
00190   // to the surface normals.
00191   // When doing this theta has to be 0-90 only otherwise there will be
00192   // errors, which currently are flagged anywhere.
00193   UserWRTSurface = wrtSurf;
00194 }

void G4SPSAngDistribution::SetUseUserAngAxis ( G4bool   ) 

Definition at line 196 of file G4SPSAngDistribution.cc.

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00197 {
00198   // if UserAngRef = true  the angular distribution is defined wrt 
00199   // the user defined co-ordinates
00200   UserAngRef = userang;
00201 }

void G4SPSAngDistribution::SetVerbosity ( G4int  a  )  [inline]

Definition at line 186 of file G4SPSAngDistribution.hh.

Referenced by G4SingleParticleSource::SetVerbosity().

00186 {verbosityLevel = a; }

void G4SPSAngDistribution::UserDefAngPhi ( G4ThreeVector   ) 

Definition at line 169 of file G4SPSAngDistribution.cc.

References G4cout, G4endl, and G4PhysicsOrderedFreeVector::InsertValues().

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00170 {
00171   if(UserDistType == "NULL") UserDistType = "phi";
00172   if(UserDistType == "theta") UserDistType = "both";  
00173   G4double phhi, val;
00174   phhi = input.x();
00175   val = input.y();
00176   if(verbosityLevel >= 1)
00177     G4cout << "In UserDefAngPhi" << G4endl;
00178   UDefPhiH.InsertValues(phhi, val); 
00179 }

void G4SPSAngDistribution::UserDefAngTheta ( G4ThreeVector   ) 

Definition at line 157 of file G4SPSAngDistribution.cc.

References G4cout, G4endl, and G4PhysicsOrderedFreeVector::InsertValues().

Referenced by G4GeneralParticleSourceMessenger::SetNewValue().

00158 {
00159   if(UserDistType == "NULL") UserDistType = "theta";
00160   if(UserDistType == "phi") UserDistType = "both";  
00161   G4double thi, val;
00162   thi = input.x();
00163   val = input.y();
00164   if(verbosityLevel >= 1)
00165     G4cout << "In UserDefAngTheta" << G4endl;
00166   UDefThetaH.InsertValues(thi, val);
00167 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:24 2013 for Geant4 by  doxygen 1.4.7