G4PEEffectModel.cc

Go to the documentation of this file.
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$
00027 //
00028 // -------------------------------------------------------------------
00029 //
00030 // GEANT4 Class file
00031 //
00032 //
00033 // File name:     G4PEEffectModel
00034 //
00035 // Author:        Vladimir Ivanchenko on base of Michel Maire code
00036 //
00037 // Creation date: 21.03.2005
00038 //
00039 // Modifications:
00040 //
00041 // 04.12.05 : SetProposedKineticEnergy(0.) for the killed photon (mma)
00042 // 20.02.09 : Added initialisation of deexcitation flag and method
00043 //            CrossSectionPerVolume instead of mfp (V.Ivanchenko)
00044 //
00045 // Class Description:
00046 //
00047 // -------------------------------------------------------------------
00048 //
00049 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00050 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00051 
00052 #include "G4PEEffectModel.hh"
00053 #include "G4PhysicalConstants.hh"
00054 #include "G4SystemOfUnits.hh"
00055 #include "G4Electron.hh"
00056 #include "G4Gamma.hh"
00057 #include "Randomize.hh"
00058 #include "G4DataVector.hh"
00059 #include "G4ParticleChangeForGamma.hh"
00060 #include "G4SauterGavrilaAngularDistribution.hh"
00061 
00062 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00063 
00064 using namespace std;
00065 
00066 G4PEEffectModel::G4PEEffectModel(const G4ParticleDefinition*, 
00067                                  const G4String& nam)
00068   : G4VEmModel(nam)
00069 {
00070   G4cout << "### G4PEEffectModel is obsolete "
00071          << "and will be removed for the next release." << G4endl;
00072 
00073   theGamma    = G4Gamma::Gamma();
00074   theElectron = G4Electron::Electron();
00075   fminimalEnergy = 1.0*eV;
00076   fParticleChange = 0;
00077 
00078   // default generator
00079   SetAngularDistribution(new G4SauterGavrilaAngularDistribution());
00080 }
00081 
00082 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00083 
00084 G4PEEffectModel::~G4PEEffectModel()
00085 {}
00086 
00087 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00088 
00089 void G4PEEffectModel::Initialise(const G4ParticleDefinition*,
00090                                  const G4DataVector&)
00091 {
00092   // always false before the run
00093   SetDeexcitationFlag(false);
00094   if(!fParticleChange) { fParticleChange = GetParticleChangeForGamma(); }
00095 }
00096 
00097 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
00098 
00099 G4double G4PEEffectModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
00100                                                      G4double energy,
00101                                                      G4double Z, G4double,
00102                                                      G4double, G4double)
00103 {
00104   G4double* SandiaCof = G4SandiaTable::GetSandiaCofPerAtom((G4int)Z, energy);
00105 
00106   G4double energy2 = energy*energy;
00107   G4double energy3 = energy*energy2;
00108   G4double energy4 = energy2*energy2;
00109 
00110   return SandiaCof[0]/energy  + SandiaCof[1]/energy2 +
00111     SandiaCof[2]/energy3 + SandiaCof[3]/energy4;
00112 }
00113 
00114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00115 
00116 G4double G4PEEffectModel::CrossSectionPerVolume(const G4Material* material,
00117                                                 const G4ParticleDefinition*,
00118                                                 G4double energy,
00119                                                 G4double, G4double)
00120 {
00121   G4double* SandiaCof = 
00122     material->GetSandiaTable()->GetSandiaCofForMaterial(energy);
00123                                 
00124   G4double energy2 = energy*energy;
00125   G4double energy3 = energy*energy2;
00126   G4double energy4 = energy2*energy2;
00127           
00128   return SandiaCof[0]/energy  + SandiaCof[1]/energy2 +
00129     SandiaCof[2]/energy3 + SandiaCof[3]/energy4; 
00130 }
00131 
00132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00133 
00134 void G4PEEffectModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
00135                                         const G4MaterialCutsCouple* couple,
00136                                         const G4DynamicParticle* aDynamicPhoton,
00137                                         G4double,
00138                                         G4double)
00139 {
00140   const G4Material* aMaterial = couple->GetMaterial();
00141 
00142   G4double energy = aDynamicPhoton->GetKineticEnergy();
00143   G4ParticleMomentum PhotonDirection = aDynamicPhoton->GetMomentumDirection();
00144 
00145   // select randomly one element constituing the material.
00146   const G4Element* anElement = SelectRandomAtom(aMaterial,theGamma,energy);
00147   
00148   //
00149   // Photo electron
00150   //
00151 
00152   // Select atomic shell
00153   G4int nShells = anElement->GetNbOfAtomicShells();
00154   G4int i  = 0;  
00155   while ((i<nShells) && (energy<anElement->GetAtomicShell(i))) { ++i; }
00156 
00157   G4double edep = energy;
00158 
00159   // no shell available
00160   if (i < nShells) {
00161   
00162     G4double bindingEnergy = anElement->GetAtomicShell(i);
00163     G4double elecKineEnergy = energy - bindingEnergy;
00164 
00165     if (elecKineEnergy > fminimalEnergy) {
00166 
00167       edep = bindingEnergy;
00168       G4ThreeVector elecDirection =
00169         GetAngularDistribution()->SampleDirection(aDynamicPhoton, 
00170                                                   elecKineEnergy,
00171                                                   i, 
00172                                                   couple->GetMaterial());
00173 
00174       G4DynamicParticle* aParticle = 
00175         new G4DynamicParticle(theElectron, elecDirection, elecKineEnergy);
00176       fvect->push_back(aParticle);
00177 
00178     } 
00179   }
00180     
00181   fParticleChange->SetProposedKineticEnergy(0.);
00182   fParticleChange->ProposeTrackStatus(fStopAndKill);
00183   if(edep > 0.0) {
00184     fParticleChange->ProposeLocalEnergyDeposit(edep);
00185   }
00186 }
00187 
00188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

Generated on Mon May 27 17:49:17 2013 for Geant4 by  doxygen 1.4.7