113 theta = std::acos(2. * r * (1. + gg) * (1. + gg) * (1. - gg + gg * r) /
114 ((1. - gg + 2. * gg * r) * (1. - gg + 2. * gg * r)) -
119 theta = std::acos(2. * r - 1.);
130 newMomDir.
set(sinth * std::cos(phi), sinth * std::sin(phi), std::cos(theta));
133 newMomDir = newMomDir.
unit();
136 newPol = newMomDir - oldPol / newMomDir.
dot(oldPol);
137 newPol = newPol.
unit();
139 if(newPol.
mag() == 0.)
142 newPol.
set(std::cos(r), std::sin(r), 0.);
157 G4cout <<
"OpMie New Polarization: " << newPol <<
G4endl
159 <<
G4endl <<
" New Momentum Direction: " << newMomDir <<
G4endl
179 attLength = attVector->
Value(
G4GLOB_DLL std::ostream G4cout
double dot(const Hep3Vector &) const
void set(double x, double y, double z)
Hep3Vector & rotateUz(const Hep3Vector &)
const G4ThreeVector & GetMomentumDirection() const
G4double GetTotalEnergy() const
const G4ThreeVector & GetPolarization() const
G4double GetConstProperty(const G4String &key) const
G4MaterialPropertyVector * GetProperty(const char *key) const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
virtual G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *) override
G4OpMieHG(const G4String &processName="OpMieHG", G4ProcessType type=fOptical)
virtual void PreparePhysicsTable(const G4ParticleDefinition &) override
void SetVerboseLevel(G4int)
virtual void Initialise()
virtual G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
static G4OpticalParameters * Instance()
void SetMieVerboseLevel(G4int)
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
const G4ThreeVector * GetPolarization() const
void Initialize(const G4Track &) override
const G4ThreeVector * GetMomentumDirection() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double Value(const G4double energy, std::size_t &lastidx) const
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4ParticleChange aParticleChange
void SetProcessSubType(G4int)
const G4String & GetProcessName() const