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)
206 G4Material* material = (*theMaterialTable)[i];
212 if(rayleigh ==
nullptr)
213 rayleigh = CalculateRayleighMeanFreePaths(material);
246 if(material->
GetName() ==
"Water")
248 betat = 7.658e-23 * m3 / MeV;
261 if(rIndex ==
nullptr)
274 if(material->
GetName() ==
"Water")
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];
294 const G4double c2 = std::pow(twopi / xlambda, 4);
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
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
G4MaterialPropertyVector * GetProperty(const char *key, G4bool warning=false)
G4bool ConstPropertyExists(const G4String &key) const
G4double GetConstProperty(const G4String &key) const
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
static size_t GetNumberOfMaterials()
G4double GetTemperature() const
static G4MaterialTable * GetMaterialTable()
const G4String & GetName() const
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()
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(G4double energy, G4double value)
void insertAt(std::size_t, G4PhysicsVector *)
G4double Energy(std::size_t index) const
G4double Value(G4double theEnergy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void SetVerboseLevel(G4int value)
G4ParticleChange aParticleChange
void SetProcessSubType(G4int)
const G4String & GetProcessName() const
G4double energy(const ThreeVector &p, const G4double m)