Problem 199 - No way to define Rayleigh scattering for arbit material.
Summary: No way to define Rayleigh scattering for arbit material.
Status: CLOSED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/optical (show other problems)
Version: other
Hardware: All All
: P2 normal
Assignee: gum
URL:
Depends on:
Blocks:
 
Reported: 2001-01-18 04:05 CET by v.choutko
Modified: 2012-02-15 05:15 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.