Problem 199

Summary: No way to define Rayleigh scattering for arbit material.
Product: Geant4 Reporter: v.choutko
Component: processes/opticalAssignee: gum
Status: CLOSED FIXED    
Severity: normal    
Priority: P2    
Version: other   
Hardware: All   
OS: All   

Description v.choutko 2001-01-18 04:05:18 CET
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;
}
Comment 1 Hans-Peter.Wellisch 2001-01-23 03:10:59 CET
Hi Peter, can you have a look?

Many greetings,

Hans-Peter.