79 if (crossSectionCalculator)
delete crossSectionCalculator;
90 G4double k0 = gammaEnergy / electron_mass_c2 ;
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;
115 G4double polzz = theBeamPolarization.
p3()*theTargetPolarization.
z();
137 G4cout<<
"G4PolarizedComptonModel::SampleSecondaries in "
158 if (targetIsPolarized)
159 theTargetPolarization.
rotateUz(gamDirection0);
167 G4double E0_m = gamEnergy0 / electron_mass_c2 ;
174 G4double epsilon, epsilonsq, onecost, sint2, greject ;
179 G4double alpha2 = 0.5*(1.- epsilon0sq);
181 G4double polarization = theBeamPolarization.
p3()*theTargetPolarization.
p3();
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
217 + std::abs(theBeamPolarization.
p3())*
218 ( std::abs((1./epsilon-epsilon)*cosTeta*theTargetPolarization.
p3())
219 +(1.-epsilon)*sinTeta*(std::sqrt(
sqr(theTargetPolarization.
p1())
220 +
sqr(theTargetPolarization.
p2()))))
221 +sint2*(std::sqrt(
sqr(theBeamPolarization.
p1()) +
sqr(theBeamPolarization.
p2())));
223 G4double gdist = 1./epsilon + epsilon - sint2
224 + theBeamPolarization.
p3()*
225 ((1./epsilon-epsilon)*cosTeta*theTargetPolarization.
p3()
226 +(1.-epsilon)*sinTeta*(std::cos(Phi)*theTargetPolarization.
p1()+
227 std::sin(Phi)*theTargetPolarization.
p2()))
228 -sint2*(std::cos(2.*Phi)*theBeamPolarization.
p1()
229 +std::sin(2.*Phi)*theBeamPolarization.
p2());
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();
289 if (verboseLevel>=1) {
290 G4cout <<
"========================================\n";
291 G4cout <<
" nInteractionFrame = " <<nInteractionFrame<<
"\n";
292 G4cout <<
" GammaDirection0 = " <<gamDirection0<<
"\n";
293 G4cout <<
" gammaPolarization = " <<theBeamPolarization<<
"\n";
294 G4cout <<
" electronPolarization = " <<theTargetPolarization<<
"\n";
297 theBeamPolarization.
InvRotateAz(nInteractionFrame,gamDirection0);
298 theTargetPolarization.
InvRotateAz(nInteractionFrame,gamDirection0);
300 if (verboseLevel>=1) {
301 G4cout <<
"----------------------------------------\n";
302 G4cout <<
" gammaPolarization = " <<theBeamPolarization<<
"\n";
303 G4cout <<
" electronPolarization = " <<theTargetPolarization<<
"\n";
304 G4cout <<
"----------------------------------------\n";
308 crossSectionCalculator->
Initialize(epsilon,E0_m,0.,
310 theTargetPolarization,2);
317 finalGammaPolarization = crossSectionCalculator->
GetPol2();
318 if (verboseLevel>=1)
G4cout <<
" gammaPolarization1 = " <<finalGammaPolarization<<
"\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;
330 if (verboseLevel>=1) {
331 G4cout <<
" gammaPolarization1 = " <<finalGammaPolarization<<
"\n";
332 G4cout <<
" GammaDirection1 = " <<gamDirection1<<
"\n";
338 finalElectronPolarization = crossSectionCalculator->
GetPol3();
340 G4cout <<
" electronPolarization1 = " <<finalElectronPolarization<<
"\n";
343 finalElectronPolarization.
RotateAz(nInteractionFrame,eDirection);
344 if (verboseLevel>=1) {
345 G4cout <<
" electronPolarization1 = " <<finalElectronPolarization<<
"\n";
346 G4cout <<
" ElecDirection = " <<eDirection<<
"\n";
350 G4cout <<
"========================================\n";
358 if (finalElectronPolarization.
mag() > 1.+1.e-8){
359 G4cout<<
"ERROR in Polarizaed Compton Scattering !"<<
G4endl;
360 G4cout<<
"Polarization of final electron more than 100%"<<
G4endl;
361 G4cout<<finalElectronPolarization<<
" mag = "<<finalElectronPolarization.
mag()<<
G4endl;
364 finalElectronPolarization.
p2(),
365 finalElectronPolarization.
p3());
366 fvect->push_back(aElectron);
G4DLLIMPORT std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ThreeVector & GetMomentumDirection() const
void SetPolarization(G4double polX, G4double polY, G4double polZ)
G4double GetKineticEnergy() const
const G4ThreeVector & GetPolarization() const
G4ParticleChangeForGamma * fParticleChange
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax)
G4double lowestGammaEnergy
G4ParticleDefinition * theElectron
const G4Track * GetCurrentTrack() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposePolarization(const G4ThreeVector &dir)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
static G4ThreeVector GetFrame(const G4ThreeVector &, const G4ThreeVector &)
bool IsPolarized(G4LogicalVolume *lVol) const
static G4PolarizationManager * GetInstance()
const G4ThreeVector & GetVolumePolarization(G4LogicalVolume *lVol) const
virtual void Initialize(G4double eps, G4double X, G4double phi, const G4StokesVector &p0, const G4StokesVector &p1, G4int flag=0)
G4double ComputeAsymmetryPerAtom(G4double gammaEnergy, G4double Z)
virtual ~G4PolarizedComptonModel()
G4PolarizedComptonModel(const G4ParticleDefinition *p=0, const G4String &nam="Polarized-Compton")
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A, G4double cut, G4double emax)
void InvRotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
void RotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
G4VPhysicalVolume * GetVolume() const
void ProposeTrackStatus(G4TrackStatus status)
G4double GetLocalEnergyDeposit() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4LogicalVolume * GetLogicalVolume() const