56 : Theta(0.), Phi(0.), posDist(0),angRndm(0)
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;
110 if(refname ==
"angref1")
112 else if(refname ==
"angref2")
268 theta = std::sqrt (px*px + py*py);
270 phi = std::acos(px/theta);
271 if ( py < 0.) phi = -
phi;
276 px = -std::sin(theta) * std::cos(phi);
277 py = -std::sin(theta) * std::sin(phi);
278 pz = -std::cos(theta);
280 finx = px, finy =py, finz =pz;
287 G4double ResMag = std::sqrt((finx*finx) + (finy*finy) + (finz*finz));
307 G4cout <<
"Generating focused vector: " << mom <<
G4endl;
318 G4double sintheta, sinphi,costheta,cosphi;
321 sintheta = std::sqrt(1. - costheta*costheta);
325 sinphi = std::sin(
Phi);
326 cosphi = std::cos(
Phi);
328 px = -sintheta * cosphi;
329 py = -sintheta * sinphi;
361 G4double ResMag = std::sqrt((finx*finx) + (finy*finy) + (finz*finz));
372 G4cout <<
"Generating isotropic vector: " << mom <<
G4endl;
381 G4double sintheta, sinphi,costheta,cosphi;
385 costheta = std::sqrt(1. -sintheta*sintheta);
389 sinphi = std::sin(
Phi);
390 cosphi = std::cos(
Phi);
392 px = -sintheta * cosphi;
393 py = -sintheta * sinphi;
423 G4double ResMag = std::sqrt((finx*finx) + (finy*finy) + (finz*finz));
435 G4cout <<
"Resultant cosine-law unit momentum vector " << mom <<
G4endl;
446 G4cout <<
"Resultant Planar wave momentum vector " << mom <<
G4endl;
471 Theta = std::acos(1. - (2. * rndm));
486 px = -std::sin(
Theta) * std::cos(
Phi);
487 py = -std::sin(
Theta) * std::sin(
Phi);
488 pz = -std::cos(
Theta);
490 pmag = std::sqrt((px*px) + (py*py) + (pz*pz));
505 G4double ResMag = std::sqrt((finx*finx) + (finy*finy) + (finz*finz));
520 G4cout <<
"Raw Unit vector "<<pxh<<
","<<pyh<<
","<<pzh<<
G4endl;
531 G4double ResMag = std::sqrt((resultx*resultx) + (resulty*resulty) + (resultz*resultz));
532 resultx = resultx/ResMag;
533 resulty = resulty/ResMag;
534 resultz = resultz/ResMag;
573 for(ii=1;ii<maxbin;ii++)
576 vals[ii] =
UDefThetaH(
size_t(ii)) + vals[ii-1];
579 for(ii=0;ii<maxbin;ii++)
581 vals[ii] = vals[ii]/
sum;
620 for(ii=1;ii<maxbin;ii++)
623 vals[ii] =
UDefPhiH(
size_t(ii)) + vals[ii-1];
626 for(ii=0;ii<maxbin;ii++)
628 vals[ii] = vals[ii]/
sum;
644 if (atype ==
"theta") {
647 else if (atype ==
"phi"){
674 G4cout <<
"Error: AngDistType has unusual value" <<
G4endl;