83 G4cout <<
"MIE Old Momentum Direction: "
85 G4cout <<
"MIE Old Polarization: "
104 Theta = std::acos(2.*r*(1.+gg)*(1.+gg)*(1.-gg+gg*r)/((1.-gg+2.*gg*r)*(1.-gg+2.*gg*r)) -1.);
106 Theta = std::acos(2.*r-1.);
111 if (direction == -1) Theta =
pi - Theta;
116 NewMomentumDirection.
set
117 (std::sin(Theta)*std::cos(Phi), std::sin(Theta)*std::sin(Phi), std::cos(Theta));
119 NewMomentumDirection.
rotateUz(OldMomentumDirection);
120 NewMomentumDirection = NewMomentumDirection.
unit();
123 G4double constant = -1./NewMomentumDirection.
dot(OldPolarization);
125 NewPolarization = NewMomentumDirection + constant*OldPolarization;
126 NewPolarization = NewPolarization.
unit();
128 if (NewPolarization.
mag() == 0.) {
130 NewPolarization.
set(std::cos(r),std::sin(r),0.);
131 NewPolarization.
rotateUz(NewMomentumDirection);
135 if (
G4UniformRand() < 0.5) NewPolarization = -NewPolarization;
142 G4cout <<
"MIE New Polarization: " << NewPolarization <<
G4endl;
144 G4cout <<
"MIE New Momentum Direction: " << NewMomentumDirection <<
G4endl;
167 if (aMaterialPropertyTable) {
170 if (AttenuationLengthVector) {
171 AttenuationLength = AttenuationLengthVector->
Value(thePhotonEnergy);
183 return AttenuationLength;