Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ()
 
G4ThreeVector GetDirection ()
 
G4ParticleMomentum GenerateOne ()
 

Detailed Description

Andrea Dotti Feb 2015 Important: This is a shared class between threads. Only one thread should use the set-methods here. Note that this is exactly what is achieved using UI commands. If you use the set methods to set defaults in your application take care that only one thread is executing them. In addition take care of calling these methods before the run is started Do not use these setters during the event loop

Definition at line 174 of file G4SPSAngDistribution.hh.

Constructor & Destructor Documentation

G4SPSAngDistribution::G4SPSAngDistribution ( )

Definition at line 55 of file G4SPSAngDistribution.cc.

56  : Theta(0.), Phi(0.), posDist(0),angRndm(0)
57 {
58  // Angular distribution Variables
59  G4ThreeVector zero;
60  particle_momentum_direction = G4ParticleMomentum(0,0,-1);
61 
62  AngDistType = "planar";
63  AngRef1 = CLHEP::HepXHat;
64  AngRef2 = CLHEP::HepYHat;
65  AngRef3 = CLHEP::HepZHat;
66  MinTheta = 0.;
67  MaxTheta = pi;
68  MinPhi = 0.;
69  MaxPhi = twopi;
70  DR = 0.;
71  DX = 0.;
72  DY = 0.;
73  FocusPoint = G4ThreeVector(0., 0., 0.);
74  UserDistType = "NULL";
75  UserWRTSurface = true;
76  UserAngRef = false;
77  IPDFThetaExist = false;
78  IPDFPhiExist = false;
79  verbosityLevel = 0 ;
80 
82 }
DLL_API const Hep3Vector HepZHat
CLHEP::Hep3Vector G4ThreeVector
#define G4MUTEXINIT(mutex)
Definition: G4Threading.hh:177
static constexpr double twopi
Definition: G4SIunits.hh:76
DLL_API const Hep3Vector HepYHat
DLL_API const Hep3Vector HepXHat
static constexpr double pi
Definition: G4SIunits.hh:75
G4ThreeVector G4ParticleMomentum
G4SPSAngDistribution::~G4SPSAngDistribution ( )

Definition at line 84 of file G4SPSAngDistribution.cc.

85 {
87 }
#define G4MUTEXDESTROY(mutex)
Definition: G4Threading.hh:178

Member Function Documentation

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

Definition at line 107 of file G4SPSAngDistribution.cc.

108 {
109  G4AutoLock l(&mutex);
110  if(refname == "angref1")
111  AngRef1 = ref.unit(); // x'
112  else if(refname == "angref2")
113  AngRef2 = ref.unit(); // vector in x'y' plane
114 
115  // User defines x' (AngRef1) and a vector in the x'y'
116  // plane (AngRef2). Then, AngRef1 x AngRef2 = AngRef3
117  // the z' vector. Then, AngRef3 x AngRef1 = AngRef2
118  // which will now be y'.
119 
120  AngRef3 = AngRef1.cross(AngRef2); // z'
121  AngRef2 = AngRef3.cross(AngRef1); // y'
122  UserAngRef = true ;
123  if(verbosityLevel == 2)
124  {
125  G4cout << "Angular distribution rotation axes " << AngRef1 << " " << AngRef2 << " " << AngRef3 << G4endl;
126  }
127 }
G4GLOB_DLL std::ostream G4cout
Hep3Vector unit() const
#define G4endl
Definition: G4ios.hh:61
Hep3Vector cross(const Hep3Vector &) const

Here is the call graph for this function:

Here is the caller graph for this function:

G4ParticleMomentum G4SPSAngDistribution::GenerateOne ( )

Definition at line 656 of file G4SPSAngDistribution.cc.

657 {
658  //Local copy for thread safety
659  G4ParticleMomentum localM = particle_momentum_direction;
660  // Angular stuff
661  if(AngDistType == "iso")
662  GenerateIsotropicFlux(localM);
663  else if(AngDistType == "cos")
664  GenerateCosineLawFlux(localM);
665  else if(AngDistType == "planar")
666  GeneratePlanarFlux(localM);
667  else if(AngDistType == "beam1d" || AngDistType == "beam2d" )
668  GenerateBeamFlux(localM);
669  else if(AngDistType == "user")
670  GenerateUserDefFlux(localM);
671  else if(AngDistType == "focused")
672  GenerateFocusedFlux(localM);
673  else
674  G4cout << "Error: AngDistType has unusual value" << G4endl;
675  return localM;
676 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

G4ThreeVector G4SPSAngDistribution::GetDirection ( )

Definition at line 215 of file G4SPSAngDistribution.cc.

215 { G4AutoLock l(&mutex); return particle_momentum_direction; }

Here is the caller graph for this function:

G4String G4SPSAngDistribution::GetDistType ( )

Definition at line 210 of file G4SPSAngDistribution.cc.

210 { G4AutoLock l(&mutex); return AngDistType;}

Here is the caller graph for this function:

G4double G4SPSAngDistribution::GetMaxPhi ( )

Definition at line 214 of file G4SPSAngDistribution.cc.

214 { G4AutoLock l(&mutex); return MaxPhi; }
G4double G4SPSAngDistribution::GetMaxTheta ( )

Definition at line 212 of file G4SPSAngDistribution.cc.

212 { G4AutoLock l(&mutex); return MaxTheta; }
G4double G4SPSAngDistribution::GetMinPhi ( )

Definition at line 213 of file G4SPSAngDistribution.cc.

213 { G4AutoLock l(&mutex); return MinPhi; }
G4double G4SPSAngDistribution::GetMinTheta ( )

Definition at line 211 of file G4SPSAngDistribution.cc.

211 { G4AutoLock l(&mutex); return MinTheta; }
void G4SPSAngDistribution::ReSetHist ( G4String  atype)

Definition at line 641 of file G4SPSAngDistribution.cc.

642 {
643  G4AutoLock l(&mutex);
644  if (atype == "theta") {
645  UDefThetaH = IPDFThetaH = ZeroPhysVector ;
646  IPDFThetaExist = false ;}
647  else if (atype == "phi"){
648  UDefPhiH = IPDFPhiH = ZeroPhysVector ;
649  IPDFPhiExist = false ;}
650  else {
651  G4cout << "Error, histtype not accepted " << G4endl;
652  }
653 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void G4SPSAngDistribution::SetAngDistType ( G4String  atype)

Definition at line 90 of file G4SPSAngDistribution.cc.

91 {
92  G4AutoLock l(&mutex);
93  if(atype != "iso" && atype != "cos" && atype != "user" && atype != "planar"
94  && atype != "beam1d" && atype != "beam2d" && atype != "focused")
95  G4cout << "Error, distribution must be iso, cos, planar, beam1d, beam2d, focused or user" << G4endl;
96  else
97  AngDistType = atype;
98  if (AngDistType == "cos") MaxTheta = pi/2. ;
99  if (AngDistType == "user") {
100  UDefThetaH = IPDFThetaH = ZeroPhysVector ;
101  IPDFThetaExist = false ;
102  UDefPhiH = IPDFPhiH = ZeroPhysVector ;
103  IPDFPhiExist = false ;
104  }
105 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
static constexpr double pi
Definition: G4SIunits.hh:75

Here is the caller graph for this function:

void G4SPSAngDistribution::SetBeamSigmaInAngR ( G4double  r)

Definition at line 153 of file G4SPSAngDistribution.cc.

154 {
155  G4AutoLock l(&mutex);
156  DR = r;
157 }

Here is the caller graph for this function:

void G4SPSAngDistribution::SetBeamSigmaInAngX ( G4double  r)

Definition at line 159 of file G4SPSAngDistribution.cc.

160 {
161  G4AutoLock l(&mutex);
162  DX = r;
163 }

Here is the caller graph for this function:

void G4SPSAngDistribution::SetBeamSigmaInAngY ( G4double  r)

Definition at line 165 of file G4SPSAngDistribution.cc.

166 {
167  G4AutoLock l(&mutex);
168  DY = r;
169 }

Here is the caller graph for this function:

void G4SPSAngDistribution::SetBiasRndm ( G4SPSRandomGenerator a)

Definition at line 184 of file G4SPSAngDistribution.cc.

185 {
186  G4AutoLock l(&mutex);
187  angRndm = a;
188 }
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33

Here is the caller graph for this function:

void G4SPSAngDistribution::SetFocusPoint ( G4ThreeVector  input)

Definition at line 230 of file G4SPSAngDistribution.cc.

231 {
232  G4AutoLock l(&mutex);
233  FocusPoint = input;
234 }

Here is the caller graph for this function:

void G4SPSAngDistribution::SetMaxPhi ( G4double  maxp)

Definition at line 147 of file G4SPSAngDistribution.cc.

148 {
149  G4AutoLock l(&mutex);
150  MaxPhi = maxp;
151 }

Here is the caller graph for this function:

void G4SPSAngDistribution::SetMaxTheta ( G4double  maxt)

Definition at line 141 of file G4SPSAngDistribution.cc.

142 {
143  G4AutoLock l(&mutex);
144  MaxTheta = maxt;
145 }

Here is the caller graph for this function:

void G4SPSAngDistribution::SetMinPhi ( G4double  minp)

Definition at line 135 of file G4SPSAngDistribution.cc.

136 {
137  G4AutoLock l(&mutex);
138  MinPhi = minp;
139 }

Here is the caller graph for this function:

void G4SPSAngDistribution::SetMinTheta ( G4double  mint)

Definition at line 129 of file G4SPSAngDistribution.cc.

130 {
131  G4AutoLock l(&mutex);
132  MinTheta = mint;
133 }

Here is the caller graph for this function:

void G4SPSAngDistribution::SetParticleMomentumDirection ( G4ParticleMomentum  aMomentumDirection)

Definition at line 171 of file G4SPSAngDistribution.cc.

172 {
173  G4AutoLock l(&mutex);
174  particle_momentum_direction = aMomentumDirection.unit();
175 
176 }
Hep3Vector unit() const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4SPSAngDistribution::SetPosDistribution ( G4SPSPosDistribution a)

Definition at line 178 of file G4SPSAngDistribution.cc.

179 {
180  G4AutoLock l(&mutex);
181  posDist = a;
182 }
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33

Here is the caller graph for this function:

void G4SPSAngDistribution::SetUserWRTSurface ( G4bool  wrtSurf)

Definition at line 236 of file G4SPSAngDistribution.cc.

237 {
238  G4AutoLock l(&mutex);
239  // This is only applied in user mode?
240  // if UserWRTSurface = true then the user wants momenta with respect
241  // to the surface normals.
242  // When doing this theta has to be 0-90 only otherwise there will be
243  // errors, which currently are flagged anywhere.
244  UserWRTSurface = wrtSurf;
245 }

Here is the caller graph for this function:

void G4SPSAngDistribution::SetUseUserAngAxis ( G4bool  userang)

Definition at line 247 of file G4SPSAngDistribution.cc.

248 {
249  G4AutoLock l(&mutex);
250  // if UserAngRef = true the angular distribution is defined wrt
251  // the user defined co-ordinates
252  UserAngRef = userang;
253 }

Here is the caller graph for this function:

void G4SPSAngDistribution::SetVerbosity ( G4int  a)

Definition at line 190 of file G4SPSAngDistribution.cc.

191 {
192  G4AutoLock l(&mutex);
193  verbosityLevel = a;
194 }
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33

Here is the caller graph for this function:

void G4SPSAngDistribution::UserDefAngPhi ( G4ThreeVector  input)

Definition at line 217 of file G4SPSAngDistribution.cc.

218 {
219  G4AutoLock l(&mutex);
220  if(UserDistType == "NULL") UserDistType = "phi";
221  if(UserDistType == "theta") UserDistType = "both";
222  G4double phhi, val;
223  phhi = input.x();
224  val = input.y();
225  if(verbosityLevel >= 1)
226  G4cout << "In UserDefAngPhi" << G4endl;
227  UDefPhiH.InsertValues(phhi, val);
228 }
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

Here is the call graph for this function:

Here is the caller graph for this function:

void G4SPSAngDistribution::UserDefAngTheta ( G4ThreeVector  input)

Definition at line 197 of file G4SPSAngDistribution.cc.

198 {
199  G4AutoLock l(&mutex);
200  if(UserDistType == "NULL") UserDistType = "theta";
201  if(UserDistType == "phi") UserDistType = "both";
202  G4double thi, val;
203  thi = input.x();
204  val = input.y();
205  if(verbosityLevel >= 1)
206  G4cout << "In UserDefAngTheta" << G4endl;
207  UDefThetaH.InsertValues(thi, val);
208 }
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

Here is the call graph for this function:

Here is the caller graph for this function:


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