95 BuildThePhysicsTable();
130 G4cout <<
"Old Momentum Direction: "
132 G4cout <<
"Old Polarization: "
145 G4double SinTheta = std::sqrt(1.-CosTheta*CosTheta);
155 G4double unit_x = SinTheta * CosPhi;
156 G4double unit_y = SinTheta * SinPhi;
158 NewMomentumDirection.
set (unit_x,unit_y,unit_z);
162 OldMomentumDirection = OldMomentumDirection.
unit();
163 NewMomentumDirection.
rotateUz(OldMomentumDirection);
164 NewMomentumDirection = NewMomentumDirection.
unit();
170 G4double constant = -1./NewMomentumDirection.
dot(OldPolarization);
172 NewPolarization = NewMomentumDirection + constant*OldPolarization;
173 NewPolarization = NewPolarization.
unit();
178 if (NewPolarization.
mag() == 0.) {
180 NewPolarization.
set(std::cos(rand),std::sin(rand),0.);
181 NewPolarization.
rotateUz(NewMomentumDirection);
185 if (
G4UniformRand() < 0.5) NewPolarization = -NewPolarization;
189 cosTheta = NewPolarization.
dot(OldPolarization);
196 G4cout <<
"New Polarization: "
197 << NewPolarization <<
G4endl;
198 G4cout <<
"Polarization Change: "
200 G4cout <<
"New Momentum Direction: "
201 << NewMomentumDirection <<
G4endl;
202 G4cout <<
"Momentum Change: "
212void G4OpRayleigh::BuildThePhysicsTable()
228 for (
G4int i=0 ; i < numOfMaterials; i++)
233 (*theMaterialTable)[i]->GetMaterialPropertiesTable();
235 if(aMaterialPropertiesTable){
240 if(!AttenuationLengthVector){
242 if ((*theMaterialTable)[i]->GetName() ==
"Water")
250 RayleighAttenuationLengthGenerator(aMaterialPropertiesTable);
273 if (aMaterial->
GetName() ==
"Water" && DefaultWater){
278 (*thePhysicsTable)(aMaterial->
GetIndex())->
279 GetValue(thePhotonEnergy, isOutRange);
286 if(aMaterialPropertyTable){
289 if(AttenuationLengthVector){
290 AttenuationLength = AttenuationLengthVector ->
291 Value(thePhotonEnergy);
302 return AttenuationLength;
318 G4double kboltz = 8.61739e-11*MeV/kelvin;
346 refraction_index = (*Rindex)[i];
348 refsq = refraction_index*refraction_index;
349 xlambda = h_Planck*c_light/e;
353 G4cout << xlambda <<
" mm\t";
357 c2 = std::pow((2.0 * pi / xlambda), 4);
358 c3 = std::pow( ( (refsq - 1.0) * (refsq + 2.0) / 3.0 ), 2);
359 c4 = betat * temp * kboltz;
361 Dist = 1.0 / (c1*c2*c3*c4);
366 RayleighScatteringLengths->
367 InsertValues(Rindex->
Energy(i), Dist);
372 return RayleighScatteringLengths;
std::vector< G4Material * > G4MaterialTable
G4DLLIMPORT 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
G4MaterialPropertyVector * GetProperty(const char *key)
static const G4MaterialTable * GetMaterialTable()
G4MaterialPropertiesTable * GetMaterialPropertiesTable() const
static size_t GetNumberOfMaterials()
const G4String & GetName() const
G4PhysicsTable * thePhysicsTable
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
G4OpRayleigh(const G4String &processName="OpRayleigh", G4ProcessType type=fOptical)
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 insertAt(size_t, G4PhysicsVector *)
size_t GetVectorLength() const
G4double Energy(size_t index) const
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4ParticleChange aParticleChange
void SetProcessSubType(G4int)
const G4String & GetProcessName() const