142 G4cout<<
"G4PolarizedComptonModel::SampleSecondaries in " 165 if (targetIsPolarized) {
191 G4double alpha2 = alpha1 + 0.5*(1.- epsilon0sq);
207 PrintWarning(aDynamicGamma, nloop, greject, onecost, Phi,
208 "too many iterations");
215 if ( alpha1 > alpha2*rndm[0]) {
216 epsilon =
G4Exp(-alpha1*rndm[1]);
218 epsilon = std::sqrt(epsilon0sq + (1.- epsilon0sq)*rndm[1]);
221 onecost = (1.-
epsilon)/(epsilon*E0_m);
222 sint2 = onecost*(2.-onecost);
225 G4double gdist = 1./epsilon + epsilon - sint2
226 - polarization*(1./epsilon-
epsilon)*(1.-onecost);
228 greject = gdist/gdiced;
231 PrintWarning(aDynamicGamma, nloop, greject, onecost, Phi,
232 "theta majoranta wrong");
235 }
while (greject < rndm[2]);
243 cosTeta = 1. - onecost;
244 sinTeta = std::sqrt(sint2);
252 Phi =
twopi * rndm[0];
254 PrintWarning(aDynamicGamma, nloop, greject, onecost, Phi,
255 "too many iterations");
259 G4double gdiced = 1./epsilon + epsilon - sint2
267 G4double gdist = 1./epsilon + epsilon - sint2
274 greject = gdist/gdiced;
277 PrintWarning(aDynamicGamma, nloop, greject, onecost, Phi,
278 "phi majoranta wrong");
281 if(greject < 1.
e-3) {
282 PrintWarning(aDynamicGamma, nloop, greject, onecost, Phi,
283 "phi loop ineffective");
290 }
while (greject < rndm[1]);
292 G4double dirx = sinTeta*std::cos(Phi), diry = sinTeta*std::sin(Phi),
300 gamDirection1.rotateUz(gamDirection0);
301 G4double gamEnergy1 = epsilon*gamEnergy0;
322 G4cout <<
"========================================\n";
323 G4cout <<
" nInteractionFrame = " <<nInteractionFrame<<
"\n";
324 G4cout <<
" GammaDirection0 = " <<gamDirection0<<
"\n";
333 G4cout <<
"----------------------------------------\n";
336 G4cout <<
"----------------------------------------\n";
357 G4cout<<
"ERROR in Polarizaed Compton Scattering !"<<
G4endl;
358 G4cout<<
"Polarization of final photon more than 100%"<<
G4endl;
366 G4cout <<
" GammaDirection1 = " <<gamDirection1<<
"\n";
373 G4double eKinEnergy = gamEnergy0 - gamEnergy1;
378 gamEnergy0*gamDirection0 - gamEnergy1*gamDirection1;
379 eDirection = eDirection.
unit();
383 G4cout <<
" electronPolarization1 = " 389 G4cout <<
" electronPolarization1 = " 391 G4cout <<
" ElecDirection = " <<eDirection<<
"\n";
399 G4cout<<
"ERROR in Polarizaed Compton Scattering !"<<
G4endl;
400 G4cout<<
"Polarization of final electron more than 100%"<<
G4endl;
407 fvect->push_back(aElectron);
G4double LowEnergyLimit() const
G4ParticleChangeForGamma * fParticleChange
G4StokesVector theTargetPolarization
const G4ThreeVector & GetVolumePolarization(G4LogicalVolume *lVol) const
static const G4int nlooplim
static G4PolarizationManager * GetInstance()
void PrintWarning(const G4DynamicParticle *, G4int, G4double grej, G4double onecos, G4double phi, const G4String) const
G4StokesVector finalGammaPolarization
G4double GetKineticEnergy() const
bool IsPolarized(G4LogicalVolume *lVol) const
G4StokesVector finalElectronPolarization
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
G4PolarizedComptonCrossSection * crossSectionCalculator
Hep3Vector & rotateUz(const Hep3Vector &)
static const double twopi
static G4ThreeVector GetFrame(const G4ThreeVector &, const G4ThreeVector &)
G4double lowestSecondaryEnergy
void SetPolarization(G4double polX, G4double polY, G4double polZ)
G4double G4Log(G4double x)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
void InvRotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
const G4ThreeVector & GetMomentumDirection() const
G4StokesVector theBeamPolarization
const G4ThreeVector & GetPolarization() const
G4ParticleDefinition * theElectron
G4LogicalVolume * GetLogicalVolume() const
virtual void flatArray(const int size, double *vect)=0
virtual void Initialize(G4double eps, G4double X, G4double phi, const G4StokesVector &p0, const G4StokesVector &p1, G4int flag=0)
double epsilon(double density, double temperature)
void RotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)