94 asymmetry *= (k0 + 1.)*
sqr(k1)*std::log(k1) - 2.*k0*(5.*
sqr(k0) + 4.*k0 + 1.);
95 asymmetry /= ((k0 - 2.)*k0 -2.)*
sqr(k1)*std::log(k1) + 2.*k0*(k0*(k0 + 1.)*(k0 + 8.) + 2.);
98 if (asymmetry>1.)
G4cout<<
"ERROR in G4PolarizedComptonModel::ComputeAsymmetryPerAtom"<<
G4endl;
137 G4cout<<
"G4PolarizedComptonModel::SampleSecondaries in "
158 if (targetIsPolarized)
167 G4double E0_m = gamEnergy0 / electron_mass_c2 ;
174 G4double epsilon, epsilonsq, onecost, sint2, greject ;
179 G4double alpha2 = 0.5*(1.- epsilon0sq);
185 epsilonsq = epsilon*epsilon;
189 epsilon = std::sqrt(epsilonsq);
192 onecost = (1.- epsilon)/(epsilon*E0_m);
193 sint2 = onecost*(2.-onecost);
196 G4double gdiced = 2.*(1./epsilon+epsilon);
197 G4double gdist = 1./epsilon + epsilon - sint2
198 - polarization*(1./epsilon-epsilon)*(1.-onecost);
200 greject = gdist/gdiced;
202 if (greject>1)
G4cout<<
"ERROR in PolarizedComptonScattering::PostStepDoIt\n"
203 <<
" costh rejection does not work properly: "<<greject<<
G4endl;
212 G4double sinTeta = std::sqrt (sint2);
216 G4double gdiced = 1./epsilon + epsilon - sint2
223 G4double gdist = 1./epsilon + epsilon - sint2
230 greject = gdist/gdiced;
232 if (greject>1.+1.e-10 || greject<0)
G4cout<<
"ERROR in PolarizedComptonScattering::PostStepDoIt\n"
233 <<
" phi rejection does not work properly: "<<greject<<
G4endl;
236 G4cout<<
"ERROR in PolarizedComptonScattering::PostStepDoIt\n"
237 <<
" phi rejection does not work properly: "<<greject<<
"\n";
238 G4cout<<
" greject="<<greject<<
" phi="<<Phi<<
" cost="<<cosTeta<<
"\n";
239 G4cout<<
" gdiced="<<gdiced<<
" gdist="<<gdist<<
"\n";
240 G4cout<<
" eps="<<epsilon<<
" 1/eps="<<1./epsilon<<
"\n";
244 G4double dirx = sinTeta*std::cos(Phi), diry = sinTeta*std::sin(Phi), dirz = cosTeta;
251 gamDirection1.rotateUz(gamDirection0);
252 G4double gamEnergy1 = epsilon*gamEnergy0;
268 G4double eKinEnergy = gamEnergy0 - gamEnergy1;
269 G4ThreeVector eDirection = gamEnergy0*gamDirection0 - gamEnergy1*gamDirection1;
270 eDirection = eDirection.unit();
290 G4cout <<
"========================================\n";
291 G4cout <<
" nInteractionFrame = " <<nInteractionFrame<<
"\n";
292 G4cout <<
" GammaDirection0 = " <<gamDirection0<<
"\n";
301 G4cout <<
"----------------------------------------\n";
304 G4cout <<
"----------------------------------------\n";
322 finalGammaPolarization.RotateAz(nInteractionFrame,gamDirection1);
325 if (finalGammaPolarization.mag() > 1.+1.e-8){
326 G4cout<<
"ERROR in Polarizaed Compton Scattering !"<<
G4endl;
327 G4cout<<
"Polarization of final photon more than 100%"<<
G4endl;
328 G4cout<<finalGammaPolarization<<
" mag = "<<finalGammaPolarization.mag()<<
G4endl;
331 G4cout <<
" gammaPolarization1 = " <<finalGammaPolarization<<
"\n";
332 G4cout <<
" GammaDirection1 = " <<gamDirection1<<
"\n";
343 finalElectronPolarization.
RotateAz(nInteractionFrame,eDirection);
345 G4cout <<
" electronPolarization1 = " <<finalElectronPolarization<<
"\n";
346 G4cout <<
" ElecDirection = " <<eDirection<<
"\n";
350 G4cout <<
"========================================\n";
359 G4cout<<
"ERROR in Polarizaed Compton Scattering !"<<
G4endl;
360 G4cout<<
"Polarization of final electron more than 100%"<<
G4endl;
366 fvect->push_back(aElectron);
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4ParticleChangeForGamma * fParticleChange
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
G4StokesVector theTargetPolarization
static G4PolarizationManager * GetInstance()
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double lowestGammaEnergy
G4StokesVector finalGammaPolarization
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax)
G4StokesVector finalElectronPolarization
G4GLOB_DLL std::ostream G4cout
G4PolarizedComptonCrossSection * crossSectionCalculator
const G4ThreeVector & GetMomentumDirection() const
void ProposePolarization(const G4ThreeVector &dir)
static G4ThreeVector GetFrame(const G4ThreeVector &, const G4ThreeVector &)
void SetPolarization(G4double polX, G4double polY, G4double polZ)
static const G4double A[nN]
void InvRotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
virtual void Initialize(G4double eps, G4double X, G4double phi, const G4StokesVector &p0, const G4StokesVector &p1, G4int flag=0)
G4PolarizedComptonModel(const G4ParticleDefinition *p=0, const G4String &nam="Polarized-Compton")
G4LogicalVolume * GetLogicalVolume() const
G4double ComputeAsymmetryPerAtom(G4double gammaEnergy, G4double Z)
G4double GetLocalEnergyDeposit() const
G4StokesVector theBeamPolarization
bool IsPolarized(G4LogicalVolume *lVol) const
const G4ThreeVector & GetPolarization() const
virtual ~G4PolarizedComptonModel()
G4VPhysicalVolume * GetVolume() const
const G4Track * GetCurrentTrack() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4ParticleDefinition * theElectron
void ProposeTrackStatus(G4TrackStatus status)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax)
const G4ThreeVector & GetVolumePolarization(G4LogicalVolume *lVol) const
void RotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)