126 G4double cost, sint, sinphi, cosphi;
133 sint = std::sqrt(1. - cost * cost);
140 sinphi = std::sin(rand);
141 cosphi = std::cos(rand);
144 newMomDir.
set(sint * cosphi, sint * sinphi, cost);
152 newPol = (oldPol - newMomDir.
dot(oldPol) * newMomDir).unit();
157 if(newPol.
mag() == 0.)
160 newPol.
set(std::cos(rand), std::sin(rand), 0.);
171 cosTheta = newPol.
dot(oldPol);
182 <<
G4endl <<
"New Momentum Direction: " << newMomDir <<
G4endl
204 for(
size_t i = 0; i < numOfMaterials; ++i)
212 if(rayleigh ==
nullptr)
248 betat = 7.658e-23 *
m3 /
MeV;
261 if(rIndex ==
nullptr)
281 temperature =
material->GetTemperature();
287 scaleFactor * betat * temperature *
k_Boltzmann / (6.0 *
pi);
289 for(
size_t uRIndex = 0; uRIndex < rIndex->
GetVectorLength(); ++uRIndex)
292 const G4double rIndexSquared = (*rIndex)[uRIndex] * (*rIndex)[uRIndex];
296 std::pow(((rIndexSquared - 1.0) * (rIndexSquared + 2.0) / 3.0), 2);
298 const G4double meanFreePath = 1.0 / (c1 * c2 * c3);
@ kISOTHERMAL_COMPRESSIBILITY
std::vector< G4Material * > G4MaterialTable
static constexpr double kelvin
static constexpr double twopi
static constexpr double m3
static constexpr double MeV
static constexpr double pi
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 GetTotalMomentum() const
const G4ThreeVector & GetPolarization() const
G4bool ConstPropertyExists(const G4String &key) const
G4double GetConstProperty(const G4String &key) const
G4MaterialPropertyVector * GetProperty(const char *key) const
static size_t GetNumberOfMaterials()
static G4MaterialTable * GetMaterialTable()
void SetVerboseLevel(G4int)
G4PhysicsTable * thePhysicsTable
virtual void BuildPhysicsTable(const G4ParticleDefinition &aParticleType) override
virtual G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *) override
G4PhysicsFreeVector * CalculateRayleighMeanFreePaths(const G4Material *material) const
virtual void PreparePhysicsTable(const G4ParticleDefinition &) override
G4OpRayleigh(const G4String &processName="OpRayleigh", G4ProcessType type=fOptical)
virtual G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
virtual void Initialise()
void SetRayleighVerboseLevel(G4int)
static G4OpticalParameters * Instance()
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
const G4ThreeVector * GetPolarization() const
const G4ThreeVector * GetMomentumDirection() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
virtual void Initialize(const G4Track &)
void InsertValues(const G4double energy, const G4double value)
void insertAt(std::size_t, G4PhysicsVector *)
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4ParticleChange aParticleChange
void SetProcessSubType(G4int)
const G4String & GetProcessName() const
G4double energy(const ThreeVector &p, const G4double m)