// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * 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. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // $Id: G4ElectronIonPair.cc,v 1.5 2010/10/25 17:23:01 vnivanch Exp $ // GEANT4 tag $Name: emutils-V09-03-23 $ // // ------------------------------------------------------------------- // // GEANT4 Class file // // // File name: G4ElectronIonPair // // Author: Vladimir Ivanchenko // // Creation date: 08.07.2008 // // Modifications: // // ------------------------------------------------------------- //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... #include "G4ElectronIonPair.hh" #include "G4Material.hh" #include "G4MaterialTable.hh" #include "G4StepPoint.hh" #include "G4VProcess.hh" #include "G4ProcessType.hh" #include "G4Track.hh" #include "Randomize.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... G4ElectronIonPair::G4ElectronIonPair() { verbose = 1; curMaterial = 0; curMeanEnergy = 0.0; nMaterials = 0; FanoFactor = 0.2; Initialise(); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... G4ElectronIonPair::~G4ElectronIonPair() {} //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... G4double G4ElectronIonPair::MeanNumberOfIonsAlongStep( const G4ParticleDefinition* part, const G4Material* material, G4double edep, G4double niel) { G4double nion = 0.0; // NIEL does not provide ionisation clusters if(edep > niel) { // neutral particles do not produce ionisation along step if(part->GetPDGCharge() != 0.0) { // select material if(material != curMaterial) { curMaterial = material; curMeanEnergy = material->GetIonisation()->GetMeanEnergyPerIonPair(); // if mean energy is not defined then look into G4 DB if(0.0 == curMeanEnergy) { curMeanEnergy = FindG4MeanEnergyPerIonPair(material); } } if(curMeanEnergy > 0.0) { nion = (edep - niel)/curMeanEnergy; } } } return nion; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... std::vector* G4ElectronIonPair::SampleIonsAlongStep(const G4Step* step) { std::vector* v = 0; G4int nion = SampleNumberOfIonsAlongStep(step); // sample ionisation along step if(nion > 0) { v = new std::vector; G4ThreeVector prePos = step->GetPreStepPoint()->GetPosition(); G4ThreeVector deltaPos = step->GetPostStepPoint()->GetPosition() - prePos; for(G4int i=0; ipush_back( prePos + deltaPos*G4UniformRand() ); } if(verbose > 1 ) { G4cout << "### G4ElectronIonPair::SampleIonisationPoints: " << v->size() << " ion pairs are added" << G4endl; } } return v; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... G4int G4ElectronIonPair::ResidualeChargePostStep(const G4ParticleDefinition*, const G4TrackVector*, G4int subType) { G4int nholes = 0; if(2 == subType || 12 == subType || 13 == subType) { nholes = 1; } return nholes; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... G4double G4ElectronIonPair::FindG4MeanEnergyPerIonPair(const G4Material* mat) { G4String name = mat->GetName(); G4double res = 0.0; // is this material in the vector? for(G4int j=0; jGetIonisation()->SetMeanEnergyPerIonPair(res); if(verbose > 0) { G4cout << "### G4ElectronIonPair::FindG4MeanEnergyPerIonPair for " << name << " Epair= " << res/eV << " eV is set" << G4endl; } break; } } return res; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... void G4ElectronIonPair:: DumpMeanEnergyPerIonPair() { G4int nmat = G4Material::GetNumberOfMaterials(); const G4MaterialTable* mtable = G4Material::GetMaterialTable(); if(nmat > 0) { G4cout << "### G4ElectronIonPair: mean energy per ion pair avalable:" << G4endl; for(G4int i=0; iGetIonisation()->GetMeanEnergyPerIonPair(); if(x > 0.0) { G4cout << " " << mat->GetName() << " Epair= " << x/eV << " eV" << G4endl; } } } } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... void G4ElectronIonPair::DumpG4MeanEnergyPerIonPair() { if(nMaterials > 0) { G4cout << "### G4ElectronIonPair: mean energy per ion pair " << " for Geant4 materials" << G4endl; for(G4int i=0; i