121 if(fVerboseLevel >= 1)
123 G4cout <<
"G4PolarizedComptonModel::SampleSecondaries in "
144 if(targetIsPolarized)
146 fTargetPolarization.
rotateUz(gamDirection0);
155 G4double E0_m = gamEnergy0 / electron_mass_c2;
165 G4double eps0 = 1. / (1. + 2. * E0_m);
170 G4double polarization = fBeamPolarization.
p3() * fTargetPolarization.
p3();
186 PrintWarning(aDynamicGamma, nloop, greject, onecost, Phi,
187 "too many iterations");
194 if(alpha1 >
alpha2 * rndm[0])
200 epsilon = std::sqrt(epsilon0sq + (1. - epsilon0sq) * rndm[1]);
204 sint2 = onecost * (2. - onecost);
210 greject = gdist / gdiced;
214 PrintWarning(aDynamicGamma, nloop, greject, onecost, Phi,
215 "theta majoranta wrong");
218 }
while(greject < rndm[2]);
224 cosTeta = 1. - onecost;
225 sinTeta = std::sqrt(sint2);
234 Phi = twopi * rndm[0];
237 PrintWarning(aDynamicGamma, nloop, greject, onecost, Phi,
238 "too many iterations");
243 std::abs(fBeamPolarization.
p3()) *
245 fTargetPolarization.
p3()) +
247 (std::sqrt(
sqr(fTargetPolarization.
p1()) +
248 sqr(fTargetPolarization.
p2())))) +
249 sint2 * (std::sqrt(
sqr(fBeamPolarization.
p1()) +
250 sqr(fBeamPolarization.
p2())));
254 fBeamPolarization.
p3() *
257 (std::cos(Phi) * fTargetPolarization.
p1() +
258 std::sin(Phi) * fTargetPolarization.
p2())) -
259 sint2 * (std::cos(2. * Phi) * fBeamPolarization.
p1() +
260 std::sin(2. * Phi) * fBeamPolarization.
p2());
261 greject = gdist / gdiced;
265 PrintWarning(aDynamicGamma, nloop, greject, onecost, Phi,
266 "phi majoranta wrong");
271 PrintWarning(aDynamicGamma, nloop, greject, onecost, Phi,
272 "phi loop ineffective");
279 }
while(greject < rndm[1]);
281 G4double dirx = sinTeta * std::cos(Phi);
282 G4double diry = sinTeta * std::sin(Phi);
287 gamDirection1.
rotateUz(gamDirection0);
309 if(fVerboseLevel >= 1)
311 G4cout <<
"========================================" <<
G4endl;
312 G4cout <<
" nInteractionFrame = " << nInteractionFrame <<
G4endl;
313 G4cout <<
" GammaDirection0 = " << gamDirection0 <<
G4endl;
314 G4cout <<
" gammaPolarization = " << fBeamPolarization <<
G4endl;
315 G4cout <<
" electronPolarization = " << fTargetPolarization <<
G4endl;
318 fBeamPolarization.
InvRotateAz(nInteractionFrame, gamDirection0);
319 fTargetPolarization.
InvRotateAz(nInteractionFrame, gamDirection0);
321 if(fVerboseLevel >= 1)
323 G4cout <<
"----------------------------------------" <<
G4endl;
324 G4cout <<
" gammaPolarization = " << fBeamPolarization <<
G4endl;
325 G4cout <<
" electronPolarization = " << fTargetPolarization <<
G4endl;
326 G4cout <<
"----------------------------------------" <<
G4endl;
331 fTargetPolarization, 2);
337 fFinalGammaPolarization = fCrossSectionCalculator->
GetPol2();
338 if(fVerboseLevel >= 1)
340 G4cout <<
" gammaPolarization1 = " << fFinalGammaPolarization <<
G4endl;
345 fFinalGammaPolarization.
RotateAz(nInteractionFrame, gamDirection1);
346 if(fFinalGammaPolarization.
mag() > 1. + 1.e-8)
349 ed <<
"ERROR in Polarizaed Compton Scattering !\n";
350 ed <<
"Polarization of final photon more than 100%.\n";
351 ed << fFinalGammaPolarization
352 <<
" mag = " << fFinalGammaPolarization.
mag() <<
"\n";
353 G4Exception(
"G4PolarizedComptonModel::SampleSecondaries",
"pol033",
358 if(fVerboseLevel >= 1)
360 G4cout <<
" gammaPolarization1 = " << fFinalGammaPolarization <<
G4endl;
361 G4cout <<
" GammaDirection1 = " << gamDirection1 <<
G4endl;
366 G4double eKinEnergy = gamEnergy0 - gamEnergy1;
371 gamEnergy0 * gamDirection0 - gamEnergy1 * gamDirection1;
372 eDirection = eDirection.
unit();
374 finalElectronPolarization = fCrossSectionCalculator->
GetPol3();
375 if(fVerboseLevel >= 1)
377 G4cout <<
" electronPolarization1 = " << finalElectronPolarization
381 finalElectronPolarization.
RotateAz(nInteractionFrame, eDirection);
382 if(fVerboseLevel >= 1)
384 G4cout <<
" electronPolarization1 = " << finalElectronPolarization
385 <<
G4endl <<
" ElecDirection = " << eDirection <<
G4endl;
392 if(finalElectronPolarization.
mag() > 1. + 1.e-8)
395 ed <<
"ERROR in Polarized Compton Scattering !\n";
396 ed <<
"Polarization of final electron more than 100%.\n";
397 ed << finalElectronPolarization
398 <<
" mag = " << finalElectronPolarization.
mag() <<
G4endl;
399 G4Exception(
"G4PolarizedComptonModel::SampleSecondaries",
"pol034",
403 finalElectronPolarization.
p2(),
404 finalElectronPolarization.
p3());
405 fvect->push_back(aElectron);
void SetPolarization(const G4ThreeVector &)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
const G4ThreeVector & GetPolarization() const
void ProposeTrackStatus(G4TrackStatus status)
const G4Track * GetCurrentTrack() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)