123 G4double cost, sint, sinphi, cosphi;
130 sint = std::sqrt(1. - cost * cost);
137 sinphi = std::sin(rand);
138 cosphi = std::cos(rand);
141 newMomDir.
set(sint * cosphi, sint * sinphi, cost);
149 newPol = (oldPol - newMomDir.
dot(oldPol) * newMomDir).unit();
154 if(newPol.
mag() == 0.)
157 newPol.
set(std::cos(rand), std::sin(rand), 0.);
168 cosTheta = newPol.
dot(oldPol);
179 <<
G4endl <<
"New Momentum Direction: " << newMomDir <<
G4endl
201 for(
size_t i = 0; i < numOfMaterials; ++i)
203 G4Material* material = (*theMaterialTable)[i];
209 if(rayleigh ==
nullptr)
210 rayleigh = CalculateRayleighMeanFreePaths(material);
242 if(material->
GetName() ==
"Water")
244 betat = 7.658e-23 * m3 / MeV;
257 if(rIndex ==
nullptr)
270 if(material->
GetName() ==
"Water")
283 scaleFactor * betat * temperature * k_Boltzmann / (6.0 *
pi);
285 for(
size_t uRIndex = 0; uRIndex < rIndex->
GetVectorLength(); ++uRIndex)
288 const G4double rIndexSquared = (*rIndex)[uRIndex] * (*rIndex)[uRIndex];
290 const G4double c2 = std::pow(twopi / xlambda, 4);
292 std::pow(((rIndexSquared - 1.0) * (rIndexSquared + 2.0) / 3.0), 2);
294 const G4double meanFreePath = 1.0 / (c1 * c2 * c3);
301 rayleighMFPs->InsertValues(energy, meanFreePath);
@ kISOTHERMAL_COMPRESSIBILITY
std::vector< G4Material * > G4MaterialTable
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
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
static size_t GetNumberOfMaterials()
G4double GetTemperature() const
static G4MaterialTable * GetMaterialTable()
const G4String & GetName() const
void SetVerboseLevel(G4int)
G4PhysicsTable * thePhysicsTable
virtual void BuildPhysicsTable(const G4ParticleDefinition &aParticleType) override
virtual G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *) override
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
void Initialize(const G4Track &) override
const G4ThreeVector * GetMomentumDirection() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void insertAt(std::size_t, G4PhysicsVector *)
G4double Energy(const std::size_t index) 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)