00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // $Id: G4StopElementSelector.cc 69960 2013-05-21 09:26:16Z gcosmo $ 00027 // 00028 // File: G4StopElementSelector 00029 // 00030 // Author: V.Ivanchenko (Vladimir.Ivanchenko@cern.ch) 00031 // 00032 // Creation date: 2 April 2000 00033 // 00034 // Modifications: 00035 // 18/08/2000 V.Ivanchenko Update description 00036 // 17/05/2006 V.Ivanchenko Cleanup 00037 // 02/10/2007 V.Ivanchenko Fixed typo in computation of Lambda-factor 00038 // proposed by Victor Pec 00039 // 04/23/2013 K.Genser used new G4MuonMinusBoundDecay 00040 // in GetMuonCaptureRate and GetMuonDecayRate 00041 //--------------------------------------------------------------------- 00042 00043 #include "G4StopElementSelector.hh" 00044 #include "G4PhysicalConstants.hh" 00045 #include "G4SystemOfUnits.hh" 00046 #include "Randomize.hh" 00047 #include "G4Material.hh" 00048 #include "G4MuonMinusBoundDecay.hh" 00049 00050 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00051 00052 // constructor 00053 G4StopElementSelector::G4StopElementSelector() 00054 { } 00055 00056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00057 00058 // destructor 00059 G4StopElementSelector::~G4StopElementSelector() 00060 { } 00061 00062 00063 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00064 00065 G4Element* G4StopElementSelector::GetElement(const G4Material* aMaterial) 00066 { 00067 // Fermi-Teller Z-low of mu- capture and exceptions 00068 // for halogens and oxigen. 00069 // N.C.Mukhopadhyay Phys. Rep. 30 (1977) 1. 00070 G4int i; 00071 G4double Z; 00072 const G4int numberOfElements = aMaterial->GetNumberOfElements(); 00073 const G4ElementVector* theElementVector = aMaterial->GetElementVector(); 00074 00075 if(1 == numberOfElements) return (*theElementVector)[0]; 00076 00077 const G4double* theAtomicNumberDensity = aMaterial->GetAtomicNumDensityVector(); 00078 00079 G4double sum = 0.0; 00080 for ( i=0; i < numberOfElements; i++ ) { 00081 00082 Z = (*theElementVector)[i]->GetZ(); 00083 00084 // Halogens 00085 if( (9.0 == Z) || (17.0 == Z) || (35.0 == Z) || (53.0 == Z) || (85.0 == Z) ) { 00086 sum += 0.66 * Z * theAtomicNumberDensity[i] ; 00087 00088 // Oxigen 00089 } else if( 8.0 == Z ) { 00090 sum += 0.56 * Z * theAtomicNumberDensity[i] ; 00091 00092 // Others 00093 } else { 00094 sum += Z * theAtomicNumberDensity[i] ; 00095 } 00096 } 00097 00098 G4double random = G4UniformRand() * sum; 00099 sum = 0.0 ; 00100 i = -1; 00101 00102 // Selection of element 00103 do { 00104 i++; 00105 Z = (*theElementVector)[i]->GetZ(); 00106 00107 // Galogens 00108 if( (9.0 == Z) || (17.0 == Z) || (35.0 == Z) || (53.0 == Z) || (85.0 == Z) ) { 00109 sum += 0.66 * Z * theAtomicNumberDensity[i] ; 00110 00111 // Oxigen 00112 } else if( 8.0 == Z ) { 00113 sum += 0.56 * Z * theAtomicNumberDensity[i] ; 00114 00115 // Others 00116 } else { 00117 sum += Z * theAtomicNumberDensity[i] ; 00118 } 00119 } while ( (sum < random) && (i < numberOfElements - 1) ); 00120 00121 return (*theElementVector)[i]; 00122 } 00123 00124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00125 00126 G4double G4StopElementSelector::GetMuonCaptureRate(G4double Z, G4double A) 00127 { 00128 return G4MuonMinusBoundDecay::GetMuonCaptureRate(G4int(Z),G4int(A)); 00129 } 00130 00131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 00132 00133 G4double G4StopElementSelector::GetMuonDecayRate(G4double Z, G4double /* A */) 00134 { 00135 return G4MuonMinusBoundDecay::GetMuonDecayRate(G4int(Z)); 00136 }