73 G4int G4LowEPPolarizedComptonModel::maxZ = 99;
75 G4ShellData* G4LowEPPolarizedComptonModel::shellData = 0;
92 if( verboseLevel>1 ) {
93 G4cout <<
"Low energy photon Compton model is constructed " <<
G4endl;
100 fAtomDeexcitation = 0;
120 if (verboseLevel > 1) {
121 G4cout <<
"Calling G4LowEPPolarizedComptonModel::Initialise()" <<
G4endl;
130 char* path = getenv(
"G4LEDATA");
136 for(
G4int i=0; i<numOfCouples; ++i) {
142 for (
G4int j=0; j<nelm; ++j) {
145 else if(Z > maxZ){ Z = maxZ; }
147 if( (!
data[Z]) ) { ReadData(Z, path); }
155 G4String file =
"/doppler/shell-doppler";
163 if (verboseLevel > 2) {
167 if( verboseLevel>1 ) {
168 G4cout <<
"G4LowEPPolarizedComptonModel is initialized " <<
G4endl
175 if(isInitialised) {
return; }
179 isInitialised =
true;
192 void G4LowEPPolarizedComptonModel::ReadData(
size_t Z,
const char* path)
194 if (verboseLevel > 1)
196 G4cout <<
"G4LowEPPolarizedComptonModel::ReadData()"
199 if(
data[Z]) {
return; }
200 const char* datadir = path;
203 datadir = getenv(
"G4LEDATA");
206 G4Exception(
"G4LowEPPolarizedComptonModel::ReadData()",
208 "Environment variable G4LEDATA not defined");
216 data[
Z]->SetSpline(
false);
218 std::ostringstream ost;
219 ost << datadir <<
"/livermore/comp/ce-cs-" << Z <<
".dat";
220 std::ifstream fin(ost.str().c_str());
225 ed <<
"G4LowEPPolarizedComptonModel data file <" << ost.str().c_str()
226 <<
"> is not opened!" <<
G4endl;
227 G4Exception(
"G4LowEPPolarizedComptonModel::ReadData()",
229 ed,
"G4LEDATA version should be G4EMLOW6.34 or later");
232 if(verboseLevel > 3) {
233 G4cout <<
"File " << ost.str()
234 <<
" is opened by G4LowEPPolarizedComptonModel" <<
G4endl;
236 data[
Z]->Retrieve(fin,
true);
251 if (verboseLevel > 3) {
252 G4cout <<
"G4LowEPPolarizedComptonModel::ComputeCrossSectionPerAtom()"
260 if(intZ < 1 || intZ > maxZ) {
return cs; }
270 if(!pv) {
return cs; }
277 if(GammaEnergy <= e1) { cs = GammaEnergy/(e1*e1)*pv->
Value(e1); }
278 else if(GammaEnergy <= e2) { cs = pv->
Value(GammaEnergy)/GammaEnergy; }
279 else if(GammaEnergy > e2) { cs = pv->
Value(e2)/GammaEnergy; }
294 G4double g4d_limit = std::pow(10.,-g4d_order);
313 if (verboseLevel > 3) {
314 G4cout <<
"G4LowEPPolarizedComptonModel::SampleSecondaries() E(MeV)= "
334 if (!(photonPolarization0.
isOrthogonal(photonDirection0, 1e-6))||(photonPolarization0.
mag()==0))
336 photonPolarization0 = GetRandomPolarization(photonDirection0);
341 if ((photonPolarization0.
howOrthogonal(photonDirection0) !=0) && (photonPolarization0.
howOrthogonal(photonDirection0) > g4d_limit))
343 photonPolarization0 = GetPerpendicularPolarization(photonDirection0,photonPolarization0);
353 G4double LowEPPCepsilon0 = 1. / (1. + 2. * e0m);
354 G4double LowEPPCepsilon0Sq = LowEPPCepsilon0 * LowEPPCepsilon0;
355 G4double alpha1 = -std::log(LowEPPCepsilon0);
356 G4double alpha2 = 0.5 * (1. - LowEPPCepsilon0Sq);
367 if (verboseLevel > 3) {
368 G4cout <<
"Started loop to sample gamma energy" <<
G4endl;
376 LowEPPCepsilonSq = LowEPPCepsilon * LowEPPCepsilon;
380 LowEPPCepsilonSq = LowEPPCepsilon0Sq + (1. - LowEPPCepsilon0Sq) *
G4UniformRand();
381 LowEPPCepsilon = std::sqrt(LowEPPCepsilonSq);
384 oneCosT = (1. - LowEPPCepsilon) / ( LowEPPCepsilon * e0m);
385 sinT2 = oneCosT * (2. - oneCosT);
386 G4double x = std::sqrt(oneCosT/2.) / (wlPhoton/
cm);
387 G4double scatteringFunction = ComputeScatteringFunction(x, Z);
388 gReject = (1. - LowEPPCepsilon * sinT2 / (1. + LowEPPCepsilonSq)) * scatteringFunction;
393 G4double sinTheta = std::sqrt(sinT2);
394 G4double phi = SetPhi(LowEPPCepsilon,sinT2);
395 G4double dirx = sinTheta * std::cos(phi);
396 G4double diry = sinTheta * std::sin(phi);
401 G4ThreeVector photonPolarization1 = SetNewPolarization(LowEPPCepsilon,
417 const G4int maxDopplerIterations = 1000;
419 G4double pEIncident = photonEnergy0 ;
434 if (verboseLevel > 3) {
435 G4cout <<
"Started loop to sample photon energy and electron direction" <<
G4endl;
464 G4double ePSI = ePAU * momentum_au_to_nat;
467 u_temp = sqrt( ((ePSI*ePSI)*(vel_c*vel_c)) / ((e_mass_kg*e_mass_kg)*(vel_c*vel_c)+(ePSI*ePSI)) )/vel_c;
477 G4double systemE = eEIncident + pEIncident;
480 G4double gamma_temp = 1.0 / sqrt( 1 - (u_temp*u_temp));
482 G4double subdenom1 = u_temp*cosTheta*std::cos(e_alpha);
483 G4double subdenom2 = u_temp*sinTheta*std::sin(e_alpha)*std::cos(e_beta);
485 pERecoil = (numerator/denominator);
486 eERecoil = systemE - pERecoil;
487 CE_emission_flag = pEIncident - pERecoil;
488 }
while ( (iteration <= maxDopplerIterations) && (CE_emission_flag < bindingE));
501 G4double u_p_temp = sqrt(1 - (1 / (a_temp*a_temp)));
505 G4double sinAlpha = std::sin(e_alpha);
506 G4double cosAlpha = std::cos(e_alpha);
507 G4double sinBeta = std::sin(e_beta);
508 G4double cosBeta = std::cos(e_beta);
510 G4double gamma = 1.0 / sqrt(1 - (u_temp*u_temp));
511 G4double gamma_p = 1.0 / sqrt(1 - (u_p_temp*u_p_temp));
513 G4double var_A = pERecoil*u_p_temp*sinTheta;
514 G4double var_B = u_p_temp* (pERecoil*cosTheta-pEIncident);
518 G4double var_D2 = (1 - (u_temp*cosTheta*cosAlpha) - (u_temp*sinTheta*cosBeta*sinAlpha));
520 G4double var_D = var_D1*var_D2 + var_D3;
523 G4double var_E2 = gamma_p*electron_mass_c2*pERecoil*u_p_temp*cosTheta;
526 G4double var_F1 = ((gamma*gamma_p)*(electron_mass_c2*electron_mass_c2)*(u_temp*u_p_temp)*cosBeta*sinAlpha);
527 G4double var_F2 = (gamma_p*electron_mass_c2*pERecoil*u_p_temp*sinTheta);
530 G4double var_G = (gamma*gamma_p)*(electron_mass_c2*electron_mass_c2)*(u_temp*u_p_temp)*sinBeta*sinAlpha;
535 G4double var_W1 = (var_F*var_B - var_E*var_A)*(var_F*var_B - var_E*var_A);
536 G4double var_W2 = (var_G*var_G)*(var_A*var_A) + (var_G*var_G)*(var_B*var_B);
539 G4double var_Y = 2.0*(((var_A*var_D-var_F*var_C)*(var_F*var_B-var_E*var_A)) - ((var_G*var_G)*var_B*var_C));
541 G4double var_Z1 = (var_A*var_D - var_F*var_C)*(var_A*var_D - var_F*var_C);
542 G4double var_Z2 = (var_G*var_G)*(var_C*var_C) - (var_G*var_G)*(var_A*var_A);
554 if ((diff < 0.0) && (abs(diff / diff1) < g4d_limit) && (abs(diff / diff2) < g4d_limit) )
561 G4double X_p = (-var_Y + sqrt (diff))/(2*var_W);
562 G4double X_m = (-var_Y - sqrt (diff))/(2*var_W);
568 if(X_p >1){X_p=1;}
if(X_p<-1){X_p=-1;}
569 if(X_m >1){X_m=1;}
if(X_m<-1){X_m=-1;}
577 if (sol_select < 0.5)
579 ThetaE = std::acos(X_p);
581 if (sol_select > 0.5)
583 ThetaE = std::acos(X_m);
586 cosThetaE = std::cos(ThetaE);
587 sinThetaE = std::sin(ThetaE);
588 G4double Theta = std::acos(cosTheta);
591 G4double iSinThetaE = std::sqrt(1+std::tan((
pi/2.0)-ThetaE)*std::tan((
pi/2.0)-ThetaE));
592 G4double iSinTheta = std::sqrt(1+std::tan((
pi/2.0)-Theta)*std::tan((
pi/2.0)-Theta));
593 G4double ivar_A = iSinTheta/ (pERecoil*u_p_temp);
595 cosPhiE = (var_C - var_B*cosThetaE)*(ivar_A*iSinThetaE);
601 }
while ( (iteration <= maxDopplerIterations) && (abs(cosPhiE) > 1));
604 if (iteration >= maxDopplerIterations)
606 pERecoil = photonEnergy0 ;
616 photonDirection1.
rotateUz(photonDirection0);
617 photonPolarization1.
rotateUz(photonDirection0);
626 G4double eDirX = sinThetaE * std::cos(phi+PhiE);
627 G4double eDirY = sinThetaE * std::sin(phi+PhiE);
630 G4double eKineticEnergy = pEIncident - pERecoil - bindingE;
633 eDirection.
rotateUz(photonDirection0);
635 eDirection,eKineticEnergy) ;
636 fvect->push_back(dp);
648 if (verboseLevel > 3) {
649 G4cout <<
"Started atomic de-excitation " << fAtomDeexcitation <<
G4endl;
652 if(fAtomDeexcitation && iteration < maxDopplerIterations) {
655 size_t nbefore = fvect->size();
659 size_t nafter = fvect->size();
660 if(nafter > nbefore) {
661 for (
size_t i=nbefore; i<nafter; ++i) {
663 if (bindingE >= ((*fvect)[i])->GetKineticEnergy())
666 bindingE -= ((*fvect)[i])->GetKineticEnergy();
682 G4Exception(
"G4LowEPPolarizedComptonModel::SampleSecondaries()",
692 G4LowEPPolarizedComptonModel::ComputeScatteringFunction(
G4double x,
G4int Z)
695 if (x <= ScatFuncFitParam[Z][2]) {
699 if (lgq < ScatFuncFitParam[Z][1]) {
700 value = ScatFuncFitParam[
Z][3] + lgq*ScatFuncFitParam[
Z][4];
702 value = ScatFuncFitParam[
Z][5] + lgq*ScatFuncFitParam[
Z][6] +
703 lgq*lgq*ScatFuncFitParam[
Z][7] + lgq*lgq*lgq*ScatFuncFitParam[
Z][8];
720 G4AutoLock l(&LowEPPolarizedComptonModelMutex);
721 if(!
data[Z]) { ReadData(Z); }
729 const G4double G4LowEPPolarizedComptonModel::ScatFuncFitParam[101][9] = {
730 { 0, 0., 0., 0., 0., 0., 0., 0., 0.},
731 { 1, 6.673, 1.49968E+08, -14.352, 1.999, -143.374, 50.787, -5.951, 0.2304418},
732 { 2, 6.500, 2.50035E+08, -14.215, 1.970, -53.649, 13.892, -0.948, 0.006996759},
733 { 3, 6.551, 3.99945E+08, -13.555, 1.993, -62.090, 21.462, -2.453, 0.093416},
734 { 4, 6.500, 5.00035E+08, -13.746, 1.998, -127.906, 46.491, -5.614, 0.2262103},
735 { 5, 6.500, 5.99791E+08, -13.800, 1.998, -131.153, 47.132, -5.619, 0.2233819},
736 { 6, 6.708, 6.99842E+08, -13.885, 1.999, -128.143, 45.379, -5.325, 0.2083009},
737 { 7, 6.685, 7.99834E+08, -13.885, 2.000, -131.048, 46.314, -5.421, 0.2114925},
738 { 8, 6.669, 7.99834E+08, -13.962, 2.001, -128.225, 44.818, -5.183, 0.1997155},
739 { 9, 6.711, 7.99834E+08, -13.999, 2.000, -122.112, 42.103, -4.796, 0.1819099},
740 { 10, 6.702, 7.99834E+08, -14.044, 1.999, -110.143, 37.225, -4.143, 0.1532094},
741 { 11, 6.425, 1.00000E+09, -13.423, 1.993, -41.137, 12.313, -1.152, 0.03384553},
742 { 12, 6.542, 1.00000E+09, -13.389, 1.997, -53.549, 17.420, -1.840, 0.06431849},
743 { 13, 6.570, 1.49968E+09, -13.401, 1.997, -66.243, 22.297, -2.460, 0.09045854},
744 { 14, 6.364, 1.49968E+09, -13.452, 1.999, -78.271, 26.757, -3.008, 0.1128195},
745 { 15, 6.500, 1.49968E+09, -13.488, 1.998, -85.069, 29.164, -3.291, 0.1239113},
746 { 16, 6.500, 1.49968E+09, -13.532, 1.998, -93.640, 32.274, -3.665, 0.1388633},
747 { 17, 6.500, 1.49968E+09, -13.584, 2.000, -98.534, 33.958, -3.857, 0.1461557},
748 { 18, 6.500, 1.49968E+09, -13.618, 1.999, -100.077, 34.379, -3.891, 0.1468902},
749 { 19, 6.500, 1.99986E+09, -13.185, 1.992, -53.819, 17.528, -1.851, 0.0648722},
750 { 20, 6.490, 1.99986E+09, -13.123, 1.993, -52.221, 17.169, -1.832, 0.06502094},
751 { 21, 6.498, 1.99986E+09, -13.157, 1.994, -55.365, 18.276, -1.961, 0.07002778},
752 { 22, 6.495, 1.99986E+09, -13.183, 1.994, -57.412, 18.957, -2.036, 0.07278856},
753 { 23, 6.487, 1.99986E+09, -13.216, 1.995, -58.478, 19.270, -2.065, 0.07362722},
754 { 24, 6.500, 1.99986E+09, -13.330, 1.997, -62.192, 20.358, -2.167, 0.07666583},
755 { 25, 6.488, 1.99986E+09, -13.277, 1.997, -58.007, 18.924, -2.003, 0.0704305},
756 { 26, 6.500, 5.00035E+09, -13.292, 1.997, -61.176, 20.067, -2.141, 0.0760269},
757 { 27, 6.500, 5.00035E+09, -13.321, 1.998, -61.909, 20.271, -2.159, 0.07653559},
758 { 28, 6.500, 5.00035E+09, -13.340, 1.998, -62.402, 20.391, -2.167, 0.07664243},
759 { 29, 6.500, 5.00035E+09, -13.439, 1.998, -67.305, 21.954, -2.331, 0.0823267},
760 { 30, 6.500, 5.00035E+09, -13.383, 1.999, -62.064, 20.136, -2.122, 0.07437589},
761 { 31, 6.500, 5.00035E+09, -13.349, 1.997, -61.068, 19.808, -2.086, 0.07307488},
762 { 32, 6.500, 5.00035E+09, -13.373, 1.999, -63.126, 20.553, -2.175, 0.07660222},
763 { 33, 6.500, 5.00035E+09, -13.395, 1.999, -65.674, 21.445, -2.278, 0.08054694},
764 { 34, 6.500, 5.00035E+09, -13.417, 1.999, -69.457, 22.811, -2.442, 0.08709536},
765 { 35, 6.500, 5.00035E+09, -13.442, 2.000, -72.283, 23.808, -2.558, 0.09156808},
766 { 36, 6.500, 5.00035E+09, -13.451, 1.998, -74.696, 24.641, -2.653, 0.09516597},
767 { 37, 6.500, 5.00035E+09, -13.082, 1.991, -46.235, 14.519, -1.458, 0.04837659},
768 { 38, 6.465, 5.00035E+09, -13.022, 1.993, -41.784, 13.065, -1.300, 0.04267703},
769 { 39, 6.492, 5.00035E+09, -13.043, 1.994, -44.609, 14.114, -1.429, 0.0479348},
770 { 40, 6.499, 5.00035E+09, -13.064, 1.994, -47.142, 15.019, -1.536, 0.0521347},
771 { 41, 6.384, 5.00035E+09, -13.156, 1.996, -53.114, 17.052, -1.766, 0.06079426},
772 { 42, 6.500, 5.00035E+09, -13.176, 1.996, -54.590, 17.550, -1.822, 0.06290335},
773 { 43, 6.500, 5.00035E+09, -13.133, 1.997, -51.272, 16.423, -1.694, 0.05806108},
774 { 44, 6.500, 5.00035E+09, -13.220, 1.996, -58.314, 18.839, -1.969, 0.0684608},
775 { 45, 6.500, 5.00035E+09, -13.246, 1.998, -59.674, 19.295, -2.020, 0.07037294},
776 { 46, 6.500, 5.00035E+09, -13.407, 1.999, -72.228, 23.693, -2.532, 0.09017969},
777 { 47, 6.500, 5.00035E+09, -13.277, 1.998, -60.890, 19.647, -2.053, 0.07138694},
778 { 48, 6.500, 5.00035E+09, -13.222, 1.998, -56.152, 18.002, -1.863, 0.06410123},
779 { 49, 6.500, 5.00035E+09, -13.199, 1.997, -56.208, 18.052, -1.872, 0.06456884},
780 { 50, 6.500, 5.00035E+09, -13.215, 1.998, -58.478, 18.887, -1.973, 0.06860356},
781 { 51, 6.500, 5.00035E+09, -13.230, 1.998, -60.708, 19.676, -2.066, 0.07225841},
782 { 52, 6.500, 7.99834E+09, -13.246, 1.998, -63.341, 20.632, -2.180, 0.0767412},
783 { 53, 6.500, 5.00035E+09, -13.262, 1.998, -66.339, 21.716, -2.310, 0.08191981},
784 { 54, 6.500, 7.99834E+09, -13.279, 1.998, -67.649, 22.151, -2.357, 0.08357825},
785 { 55, 6.500, 5.00035E+09, -12.951, 1.990, -45.302, 14.219, -1.423, 0.04712317},
786 { 56, 6.425, 5.00035E+09, -12.882, 1.992, -39.825, 12.363, -1.214, 0.03931009},
787 { 57, 6.466, 2.82488E+09, -12.903, 1.992, -38.952, 11.982, -1.160, 0.03681554},
788 { 58, 6.451, 5.00035E+09, -12.915, 1.993, -41.959, 13.118, -1.302, 0.04271291},
789 { 59, 6.434, 5.00035E+09, -12.914, 1.993, -40.528, 12.555, -1.230, 0.03971407},
790 { 60, 6.444, 5.00035E+09, -12.922, 1.992, -39.986, 12.329, -1.200, 0.03843737},
791 { 61, 6.414, 7.99834E+09, -12.930, 1.993, -42.756, 13.362, -1.327, 0.0436124},
792 { 62, 6.420, 7.99834E+09, -12.938, 1.992, -42.682, 13.314, -1.319, 0.04322509},
793 { 63, 6.416, 7.99834E+09, -12.946, 1.993, -42.399, 13.185, -1.301, 0.04243861},
794 { 64, 6.443, 7.99834E+09, -12.963, 1.993, -43.226, 13.475, -1.335, 0.04377341},
795 { 65, 6.449, 7.99834E+09, -12.973, 1.993, -43.232, 13.456, -1.330, 0.04347536},
796 { 66, 6.419, 7.99834E+09, -12.966, 1.993, -42.047, 12.990, -1.270, 0.04095499},
797 { 67, 6.406, 7.99834E+09, -12.976, 1.993, -42.405, 13.106, -1.283, 0.04146024},
798 { 68, 6.424, 7.99834E+09, -12.986, 1.993, -41.974, 12.926, -1.259, 0.040435},
799 { 69, 6.417, 7.99834E+09, -12.989, 1.993, -42.132, 12.967, -1.262, 0.04048908},
800 { 70, 6.405, 7.99834E+09, -13.000, 1.994, -42.582, 13.122, -1.280, 0.04119599},
801 { 71, 6.449, 7.99834E+09, -13.015, 1.994, -42.586, 13.115, -1.278, 0.04107587},
802 { 72, 6.465, 7.99834E+09, -13.030, 1.994, -43.708, 13.509, -1.324, 0.04286491},
803 { 73, 6.447, 7.99834E+09, -13.048, 1.996, -44.838, 13.902, -1.369, 0.04457132},
804 { 74, 6.452, 7.99834E+09, -13.073, 1.997, -45.545, 14.137, -1.395, 0.04553459},
805 { 75, 6.432, 7.99834E+09, -13.082, 1.997, -46.426, 14.431, -1.428, 0.04678218},
806 { 76, 6.439, 7.99834E+09, -13.100, 1.997, -47.513, 14.806, -1.471, 0.04842566},
807 { 77, 6.432, 7.99834E+09, -13.110, 1.997, -48.225, 15.042, -1.497, 0.04938364},
808 { 78, 6.500, 7.99834E+09, -13.185, 1.997, -53.256, 16.739, -1.687, 0.05645173},
809 { 79, 6.500, 7.99834E+09, -13.200, 1.997, -53.900, 16.946, -1.709, 0.05723134},
810 { 80, 6.500, 7.99834E+09, -13.156, 1.998, -49.801, 15.536, -1.547, 0.05103522},
811 { 81, 6.500, 7.99834E+09, -13.128, 1.997, -49.651, 15.512, -1.548, 0.05123203},
812 { 82, 6.500, 7.99834E+09, -13.134, 1.997, -51.021, 16.018, -1.609, 0.05364831},
813 { 83, 6.500, 7.99834E+09, -13.148, 1.998, -52.693, 16.612, -1.679, 0.05638698},
814 { 84, 6.500, 7.99834E+09, -13.161, 1.998, -54.415, 17.238, -1.754, 0.05935566},
815 { 85, 6.500, 7.99834E+09, -13.175, 1.998, -56.083, 17.834, -1.824, 0.06206068},
816 { 86, 6.500, 7.99834E+09, -13.189, 1.998, -57.860, 18.463, -1.898, 0.0649633},
817 { 87, 6.500, 7.99834E+09, -12.885, 1.990, -39.973, 12.164, -1.162, 0.0364598},
818 { 88, 6.417, 7.99834E+09, -12.816, 1.991, -34.591, 10.338, -0.956, 0.0287409},
819 { 89, 6.442, 7.99834E+09, -12.831, 1.992, -36.002, 10.867, -1.021, 0.03136835},
820 { 90, 6.463, 7.99834E+09, -12.850, 1.993, -37.660, 11.475, -1.095, 0.03435334},
821 { 91, 6.447, 7.99834E+09, -12.852, 1.993, -37.268, 11.301, -1.071, 0.0330539},
822 { 92, 6.439, 7.99834E+09, -12.858, 1.993, -37.695, 11.438, -1.085, 0.03376669},
823 { 93, 6.437, 1.00000E+10, -12.866, 1.993, -39.010, 11.927, -1.146, 0.03630848},
824 { 94, 6.432, 7.99834E+09, -12.862, 1.993, -37.192, 11.229, -1.057, 0.0325621},
825 { 95, 6.435, 7.99834E+09, -12.869, 1.993, -37.589, 11.363, -1.072, 0.03312393},
826 { 96, 6.449, 1.00000E+10, -12.886, 1.993, -39.573, 12.095, -1.162, 0.03680527},
827 { 97, 6.446, 1.00000E+10, -12.892, 1.993, -40.007, 12.242, -1.178, 0.03737377},
828 { 98, 6.421, 1.00000E+10, -12.887, 1.993, -39.509, 12.041, -1.152, 0.03629023},
829 { 99, 6.414, 1.00000E+10, -12.894, 1.993, -39.939, 12.183, -1.168, 0.03690464},
830 {100, 6.412, 1.00000E+10, -12.900, 1.993, -39.973, 12.180, -1.166, 0.036773}
854 b = energyRate + 1/energyRate;
856 phiProbability = 1 - (a/
b)*(std::cos(phi)*std::cos(phi));
861 while ( rand2 > phiProbability );
876 return x < z ?
G4ThreeVector(-dy,dx,0) : G4ThreeVector(0,-dz,dy);
878 return y < z ?
G4ThreeVector(dz,0,-dx) : G4ThreeVector(-dy,dx,0);
897 c.
setX(std::cos(angle)*(a0.
x())+std::sin(angle)*b0.
x());
898 c.
setY(std::cos(angle)*(a0.
y())+std::sin(angle)*b0.
y());
899 c.
setZ(std::cos(angle)*(a0.
z())+std::sin(angle)*b0.
z());
909 G4ThreeVector G4LowEPPolarizedComptonModel::GetPerpendicularPolarization
923 return photonPolarization - photonPolarization.
dot(photonDirection)/photonDirection.
dot(photonDirection) * photonDirection;
937 G4double sinTheta = std::sqrt(sinT2);
939 G4double normalisation = std::sqrt(1. - cosP2*sinT2);
954 if (rand1<(LowEPPCepsilon+1.0/LowEPPCepsilon-2)/(2.0*(LowEPPCepsilon+1.0/LowEPPCepsilon)-4.0*sinT2*cosP2))
969 G4double sinBeta = std::sqrt(1-cosBeta*cosBeta);
973 G4double xParallel = normalisation*cosBeta;
974 G4double yParallel = -(sinT2*cosPhi*sinPhi)*cosBeta/normalisation;
975 G4double zParallel = -(costheta*sinTheta*cosPhi)*cosBeta/normalisation;
977 G4double yPerpendicular = (costheta)*sinBeta/normalisation;
978 G4double zPerpendicular = -(sinTheta*sinPhi)*sinBeta/normalisation;
980 G4double xTotal = (xParallel + xPerpendicular);
981 G4double yTotal = (yParallel + yPerpendicular);
982 G4double zTotal = (zParallel + zPerpendicular);
984 photonPolarization1.
setX(xTotal);
985 photonPolarization1.
setY(yTotal);
986 photonPolarization1.
setZ(zTotal);
988 return photonPolarization1;
G4double LowEnergyLimit() const
virtual ~G4LowEPPolarizedComptonModel()
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
static G4LossTableManager * Instance()
virtual void InitialiseForElement(const G4ParticleDefinition *, G4int Z)
std::vector< G4Element * > G4ElementVector
std::ostringstream G4ExceptionDescription
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)
G4double HighEnergyLimit() const
double dot(const Hep3Vector &) const
std::vector< ExP01TrackerHit * > a
const G4String & GetName() const
static G4double angle[DIM]
G4ParticleDefinition * GetDefinition() const
bool isOrthogonal(const Hep3Vector &v, double epsilon=tolerance) const
size_t GetVectorLength() const
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
const G4ElementVector * GetElementVector() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
#define G4MUTEX_INITIALIZER
G4int SelectRandomShell(G4int Z) const
double howOrthogonal(const Hep3Vector &v) const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double twopi
void LoadData(const G4String &fileName)
static const G4double ln10
const XML_Char const XML_Char * data
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
G4GLOB_DLL std::ostream G4cout
static constexpr double m
const XML_Char int const XML_Char * value
size_t GetTableSize() const
const G4ThreeVector & GetMomentumDirection() const
G4double BindingEnergy(G4int Z, G4int shellIndex) const
static constexpr double cm
Hep3Vector & rotateUz(const Hep3Vector &)
void ProposePolarization(const G4ThreeVector &dir)
static constexpr double eV
static constexpr double kg
G4double Energy(size_t index) const
std::vector< G4EmElementSelector * > * GetElementSelectors()
G4double Value(G4double theEnergy, size_t &lastidx) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4Log(G4double x)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4LowEPPolarizedComptonModel(const G4ParticleDefinition *p=0, const G4String &nam="LowEPComptonModel")
static G4ProductionCutsTable * GetProductionCutsTable()
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
const G4ThreeVector & GetPolarization() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
static constexpr double GeV
static G4Electron * Electron()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static constexpr double MeV
static constexpr double pi
size_t GetNumberOfElements() const
Hep3Vector cross(const Hep3Vector &) const
static constexpr double halfpi
G4VAtomDeexcitation * AtomDeexcitation()
void ProposeTrackStatus(G4TrackStatus status)
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
void SetDeexcitationFlag(G4bool val)
static constexpr double barn
G4double RandomSelectMomentum(G4int Z, G4int shellIndex) const
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX)
const G4Material * GetMaterial() const