// // ******************************************************************** // * DISCLAIMER * // * * // * The following disclaimer summarizes all the specific disclaimers * // * of contributors to this software. The specific disclaimers,which * // * govern, are listed with their locations in: * // * http://cern.ch/geant4/license * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. * // * * // * This code implementation is the intellectual property of the * // * GEANT4 collaboration. * // * By copying, distributing or modifying the Program (or any work * // * based on the Program) you indicate your acceptance of this * // * statement, and all its terms. * // ******************************************************************** // // // $Id: G4ComptonScattering.icc,v 1.8 2001/09/21 09:50:53 maire Exp $ // GEANT4 tag $Name: geant4-05-02-patch-01 $ // //------------------ G4ComptonScattering physics process ----------------------- // by Michel Maire, April 1996 // // 10-06-96, updated by M.Maire // 06-01-97, crossection table + meanfreepath table, M.Maire // 12-03-97, new Physics scheme // 21-11-97, change for lowest energy limit default action // 15-12-98, return DBL_MAX below LowestEnergyLimit // 28-05-01, V.Ivanchenko minor changes to provide ANSI -wall compilation // 17-09-01, migration of Materials to pure STL (mma) //------------------------------------------------------------------------------ //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... inline G4bool G4ComptonScattering::IsApplicable( const G4ParticleDefinition& particle) { return ( &particle == G4Gamma::Gamma() ); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... inline G4double G4ComptonScattering::GetMeanFreePath(const G4Track& aTrack, G4double, G4ForceCondition*) // returns the gamma mean free path in GEANT4 internal units { const G4DynamicParticle* aDynamicGamma = aTrack.GetDynamicParticle(); G4double GammaEnergy = aDynamicGamma->GetKineticEnergy(); G4Material* aMaterial = aTrack.GetMaterial(); G4double MeanFreePath; G4bool isOutRange; if (GammaEnergy > HighestEnergyLimit || GammaEnergy < LowestEnergyLimit) MeanFreePath = DBL_MAX; else MeanFreePath = (*theMeanFreePathTable)(aMaterial->GetIndex())-> GetValue(GammaEnergy, isOutRange); return MeanFreePath; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... inline G4double G4ComptonScattering::ComputeMeanFreePath(G4double GammaEnergy, G4Material* aMaterial) // returns the gamma mean free path in GEANT4 internal units { const G4ElementVector* theElementVector = aMaterial->GetElementVector() ; const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume(); G4double SIGMA = 0.; for ( size_t elm=0 ; elm < aMaterial->GetNumberOfElements() ; elm++ ) { SIGMA += NbOfAtomsPerVolume[elm] * ComputeCrossSectionPerAtom(GammaEnergy, (*theElementVector)[elm]->GetZ()); } return SIGMA > DBL_MIN ? 1./SIGMA : DBL_MAX; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... inline G4double G4ComptonScattering::GetMicroscopicCrossSection( G4DynamicParticle* aDynamicGamma, G4Element* anElement) // gives the microscopic total cross section in GEANT4 internal units { G4double crossSection; G4double GammaEnergy = aDynamicGamma->GetKineticEnergy(); G4bool isOutRange ; if (GammaEnergy < LowestEnergyLimit || GammaEnergy > HighestEnergyLimit) crossSection = 0.; else crossSection = (*theCrossSectionTable)(anElement->GetIndex())-> GetValue(GammaEnergy, isOutRange); return crossSection; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......