| Summary: | No way to define Rayleigh scattering for arbit material. | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | v.choutko |
| Component: | processes/optical | Assignee: | gum |
| Status: | CLOSED FIXED | ||
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | other | ||
| Hardware: | All | ||
| OS: | All | ||
Hi Peter, can you have a look? Many greetings, Hans-Peter. |
Well the subject says it all. I am currently using a simple fix: Was: // GetMeanFreePath() // ----------------- // G4double G4OpRayleigh::GetMeanFreePath(const G4Track& aTrack, G4double , G4ForceCondition* ) { const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle(); const G4Material* aMaterial = aTrack.GetMaterial(); G4double thePhotonMomentum = aParticle->GetTotalMomentum(); G4double AttenuationLength = DBL_MAX; G4bool isOutRange; if (aMaterial->GetName() == "Water") { AttenuationLength = (*thePhysicsTable)(aMaterial->GetIndex())-> GetValue(thePhotonMomentum, isOutRange); } return AttenuationLength; } Now: // GetMeanFreePath() // ----------------- // G4double G4OpRayleigh::GetMeanFreePath(const G4Track& aTrack, G4double , G4ForceCondition* ) { const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle(); const G4Material* aMaterial = aTrack.GetMaterial(); G4double thePhotonMomentum = aParticle->GetTotalMomentum(); G4double AttenuationLength = DBL_MAX; G4bool isOutRange; if (aMaterial->GetName() == "Water") { AttenuationLength = (*thePhysicsTable)(aMaterial->GetIndex())-> GetValue(thePhotonMomentum, isOutRange); } else{ G4MaterialPropertiesTable* pt = aMaterial->GetMaterialPropertiesTable() ; if(pt){ G4MaterialPropertyVector * pv=pt->GetProperty("RAYLEIGH"); if(pv){ AttenuationLength=pv->GetProperty(thePhotonMomentum); } } } return AttenuationLength; }