G4ElectronIonPair.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:     G4ElectronIonPair
00034 //
00035 // Author:        Vladimir Ivanchenko
00036 //
00037 // Creation date: 08.07.2008
00038 //
00039 // Modifications:
00040 //
00041 // -------------------------------------------------------------
00042 
00043 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00045 
00046 #include "G4ElectronIonPair.hh"
00047 #include "G4SystemOfUnits.hh"
00048 #include "G4Material.hh"
00049 #include "G4MaterialTable.hh"
00050 #include "G4StepPoint.hh"
00051 #include "G4VProcess.hh"
00052 #include "G4ProcessType.hh"
00053 #include "G4Track.hh"
00054 #include "Randomize.hh"
00055 
00056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00057 
00058 G4ElectronIonPair::G4ElectronIonPair()
00059 {
00060   verbose = 1;
00061   curMaterial = 0;
00062   curMeanEnergy = 0.0;
00063   nMaterials = 0;
00064   invFanoFactor = 1.0/0.2;
00065   Initialise();
00066 }
00067 
00068 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00069 
00070 G4ElectronIonPair::~G4ElectronIonPair()
00071 {}
00072 
00073 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00074 
00075 G4double G4ElectronIonPair::MeanNumberOfIonsAlongStep(
00076                                    const G4ParticleDefinition* part, 
00077                                    const G4Material* material,
00078                                    G4double edep,
00079                                    G4double niel)
00080 {
00081   G4double nion = 0.0;
00082 
00083   // NIEL does not provide ionisation clusters
00084   if(edep > niel) {
00085 
00086     // neutral particles do not produce ionisation along step
00087     if(part->GetPDGCharge() != 0.0) {
00088 
00089       // select material
00090       if(material != curMaterial) {
00091         curMaterial = material;
00092         curMeanEnergy = material->GetIonisation()->GetMeanEnergyPerIonPair();
00093 
00094         // if mean energy is not defined then look into G4 DB
00095         if(0.0 == curMeanEnergy) {
00096           curMeanEnergy = FindG4MeanEnergyPerIonPair(material);
00097         } 
00098       }
00099       if(curMeanEnergy > 0.0) { nion = (edep - niel)/curMeanEnergy; }
00100     }
00101   }
00102   return nion;
00103 }
00104 
00105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00106 
00107 std::vector<G4ThreeVector>* 
00108 G4ElectronIonPair::SampleIonsAlongStep(const G4Step* step)
00109 {
00110   std::vector<G4ThreeVector>* v = 0;
00111 
00112   G4int nion = SampleNumberOfIonsAlongStep(step);
00113 
00114   // sample ionisation along step
00115   if(nion > 0) {
00116 
00117     v = new std::vector<G4ThreeVector>;
00118     G4ThreeVector prePos = step->GetPreStepPoint()->GetPosition();
00119     G4ThreeVector deltaPos = step->GetPostStepPoint()->GetPosition() - prePos;  
00120     for(G4int i=0; i<nion; ++i) {
00121       v->push_back( prePos + deltaPos*G4UniformRand() );
00122     }
00123     if(verbose > 1 ) { 
00124       G4cout << "### G4ElectronIonPair::SampleIonisationPoints: "
00125              << v->size() << "  ion pairs are added" << G4endl;
00126     }
00127   }
00128   return v;
00129 }
00130 
00131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00132 
00133 G4int G4ElectronIonPair::ResidualeChargePostStep(const G4ParticleDefinition*,
00134                                                  const G4TrackVector*,
00135                                                  G4int subType)
00136 {
00137   G4int nholes = 0;
00138 
00139   if(2 == subType || 12 == subType || 13 == subType) { nholes = 1; }
00140   return nholes;
00141 }
00142 
00143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00144 
00145 G4double G4ElectronIonPair::FindG4MeanEnergyPerIonPair(const G4Material* mat)
00146 {
00147   G4String name = mat->GetName();
00148   G4double res  = 0.0;
00149 
00150   // is this material in the vector?  
00151   for(G4int j=0; j<nMaterials; j++) {
00152     if(name == g4MatNames[j]) {
00153       res = g4MatData[j];
00154       mat->GetIonisation()->SetMeanEnergyPerIonPair(res);
00155       if(verbose > 0) {
00156         G4cout << "### G4ElectronIonPair::FindG4MeanEnergyPerIonPair for "
00157                << name << " Epair= " << res/eV << " eV is set"
00158                << G4endl;
00159       }
00160       break;
00161     }
00162   }
00163   return res;
00164 }
00165 
00166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00167 
00168 void G4ElectronIonPair:: DumpMeanEnergyPerIonPair()
00169 {
00170   G4int nmat = G4Material::GetNumberOfMaterials();
00171   const G4MaterialTable* mtable = G4Material::GetMaterialTable();
00172   if(nmat > 0) {
00173     G4cout << "### G4ElectronIonPair: mean energy per ion pair avalable:" << G4endl;
00174     for(G4int i=0; i<nmat; ++i) {
00175       const G4Material* mat = (*mtable)[i];
00176       G4double x = mat->GetIonisation()->GetMeanEnergyPerIonPair();
00177       if(x > 0.0) {
00178         G4cout << "   " << mat->GetName() << "   Epair=  " 
00179                << x/eV << " eV" << G4endl;
00180       }
00181     }
00182   }
00183 }
00184 
00185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00186 
00187 void G4ElectronIonPair::DumpG4MeanEnergyPerIonPair()
00188 {
00189   if(nMaterials > 0) {
00190     G4cout << "### G4ElectronIonPair: mean energy per ion pair "
00191            << " for Geant4 materials" << G4endl;
00192     for(G4int i=0; i<nMaterials; ++i) {
00193       G4cout << "   " << g4MatNames[i] << "    Epair= " 
00194              << g4MatData[i]/eV << " eV" << G4endl;
00195     }
00196   }
00197 }
00198 
00199 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00200 
00201 void G4ElectronIonPair::Initialise()
00202 {
00203   // ICRU Report 31, 1979
00204   g4MatNames.push_back("G4_Si");
00205   g4MatData.push_back(3.62*eV);
00206 
00207   g4MatNames.push_back("G4_Ge");
00208   g4MatData.push_back(2.97*eV);
00209 
00210   g4MatNames.push_back("G4_He");
00211   g4MatData.push_back(44.4*eV);
00212 
00213   g4MatNames.push_back("G4_N");
00214   g4MatData.push_back(36.4*eV);
00215 
00216   g4MatNames.push_back("G4_O");
00217   g4MatData.push_back(32.3*eV);
00218 
00219   g4MatNames.push_back("G4_Ne");
00220   g4MatData.push_back(36.8*eV);
00221 
00222   g4MatNames.push_back("G4_Ar");
00223   g4MatData.push_back(26.34*eV);
00224 
00225   g4MatNames.push_back("G4_Kr");
00226   g4MatData.push_back(24.1*eV);
00227 
00228   g4MatNames.push_back("G4_Xe");
00229   g4MatData.push_back(21.6*eV);
00230 
00231   g4MatNames.push_back("G4_lAr");
00232   g4MatData.push_back(23.6*eV);
00233 
00234   g4MatNames.push_back("G4_lKr");
00235   g4MatData.push_back(20.5*eV);
00236 
00237   g4MatNames.push_back("G4_lXe");
00238   g4MatData.push_back(15.6*eV);
00239 
00240   g4MatNames.push_back("G4_AIR");
00241   g4MatData.push_back(35.1*eV);
00242 
00243   nMaterials = g4MatData.size();
00244 }
00245 
00246 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....

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