Import Geant4 8.1.0 source tree
This commit is contained in:
@@ -1,27 +1,30 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * License and 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 *
|
||||
// * 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. *
|
||||
// * 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 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. *
|
||||
// * 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: G4BraggModel.cc,v 1.11 2005/10/18 18:46:04 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
// $Id: G4BraggModel.cc,v 1.14 2006/06/29 19:52:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -41,9 +44,11 @@
|
||||
// 27-01-03 Make models region aware (V.Ivanchenko)
|
||||
// 13-02-03 Add name (V.Ivanchenko)
|
||||
// 04-06-03 Fix compilation warnings (V.Ivanchenko)
|
||||
// 12-09-04 Add lowestKinEnergy and change order of if in DEDX method (V.Ivanchenko)
|
||||
// 12-09-04 Add lowestKinEnergy and change order of if in DEDX method (VI)
|
||||
// 11-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
|
||||
// 16-06-05 Fix problem of chemical formula (V.Ivantchenko)
|
||||
// 15-02-06 ComputeCrossSectionPerElectron, ComputeCrossSectionPerAtom (mma)
|
||||
// 25-04-06 Add stopping data from PSTAR (V.Ivanchenko)
|
||||
|
||||
// Class Description:
|
||||
//
|
||||
@@ -54,15 +59,15 @@
|
||||
//
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4BraggModel.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4ParticleChangeForLoss.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -79,12 +84,12 @@ G4BraggModel::G4BraggModel(const G4ParticleDefinition* p, const G4String& nam)
|
||||
theElectron = G4Electron::Electron();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4BraggModel::~G4BraggModel()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4BraggModel::MinEnergyCut(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
@@ -92,7 +97,7 @@ G4double G4BraggModel::MinEnergyCut(const G4ParticleDefinition*,
|
||||
return couple->GetMaterial()->GetIonisation()->GetMeanExcitationEnergy();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4BraggModel::Initialise(const G4ParticleDefinition* p,
|
||||
const G4DataVector&)
|
||||
@@ -103,12 +108,69 @@ void G4BraggModel::Initialise(const G4ParticleDefinition* p,
|
||||
pname != "deuteron" && pname != "triton") isIon = true;
|
||||
|
||||
if(pParticleChange)
|
||||
fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>(pParticleChange);
|
||||
fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*>
|
||||
(pParticleChange);
|
||||
else
|
||||
fParticleChange = new G4ParticleChangeForLoss();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4BraggModel::ComputeCrossSectionPerElectron(
|
||||
const G4ParticleDefinition* p,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxKinEnergy)
|
||||
{
|
||||
|
||||
G4double cross = 0.0;
|
||||
G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
|
||||
G4double maxEnergy = min(tmax,maxKinEnergy);
|
||||
if(cutEnergy < tmax) {
|
||||
|
||||
G4double energy = kineticEnergy + mass;
|
||||
G4double energy2 = energy*energy;
|
||||
G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
|
||||
cross = 1.0/cutEnergy - 1.0/maxEnergy - beta2*log(maxEnergy/cutEnergy)/tmax;
|
||||
|
||||
cross *= twopi_mc2_rcl2*chargeSquare/beta2;
|
||||
}
|
||||
// G4cout << "BR: e= " << kineticEnergy << " tmin= " << cutEnergy
|
||||
// << " tmax= " << tmax << " cross= " << cross << G4endl;
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4BraggModel::ComputeCrossSectionPerAtom(
|
||||
const G4ParticleDefinition* p,
|
||||
G4double kineticEnergy,
|
||||
G4double Z, G4double,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
G4double cross = Z*ComputeCrossSectionPerElectron
|
||||
(p,kineticEnergy,cutEnergy,maxEnergy);
|
||||
return cross;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4BraggModel::CrossSectionPerVolume(
|
||||
const G4Material* material,
|
||||
const G4ParticleDefinition* p,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
G4double eDensity = material->GetElectronDensity();
|
||||
G4double cross = eDensity*ComputeCrossSectionPerElectron
|
||||
(p,kineticEnergy,cutEnergy,maxEnergy);
|
||||
return cross;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4BraggModel::ComputeDEDXPerVolume(const G4Material* material,
|
||||
const G4ParticleDefinition* p,
|
||||
@@ -142,34 +204,7 @@ G4double G4BraggModel::ComputeDEDXPerVolume(const G4Material* material,
|
||||
return dedx;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4BraggModel::CrossSectionPerVolume(
|
||||
const G4Material* material,
|
||||
const G4ParticleDefinition* p,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxKinEnergy)
|
||||
{
|
||||
|
||||
G4double cross = 0.0;
|
||||
G4double tmax = MaxSecondaryEnergy(p, kineticEnergy);
|
||||
G4double maxEnergy = min(tmax,maxKinEnergy);
|
||||
if(cutEnergy < tmax) {
|
||||
|
||||
G4double energy = kineticEnergy + mass;
|
||||
G4double energy2 = energy*energy;
|
||||
G4double beta2 = kineticEnergy*(kineticEnergy + 2.0*mass)/energy2;
|
||||
cross = 1.0/cutEnergy - 1.0/maxEnergy - beta2*log(maxEnergy/cutEnergy)/tmax;
|
||||
|
||||
cross *= twopi_mc2_rcl2*chargeSquare*(material->GetElectronDensity())/beta2;
|
||||
}
|
||||
// G4cout << "BR: e= " << kineticEnergy << " tmin= " << cutEnergy << " tmax= " << tmax
|
||||
// << " cross= " << cross << G4endl;
|
||||
return cross;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
vector<G4DynamicParticle*>* G4BraggModel::SampleSecondaries(
|
||||
const G4MaterialCutsCouple*,
|
||||
@@ -235,7 +270,7 @@ vector<G4DynamicParticle*>* G4BraggModel::SampleSecondaries(
|
||||
return vdp;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4BraggModel::HasMaterial(const G4Material* material)
|
||||
{
|
||||
@@ -267,7 +302,7 @@ G4bool G4BraggModel::HasMaterial(const G4Material* material)
|
||||
return false ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4BraggModel::StoppingPower(const G4Material* material,
|
||||
G4double kineticEnergy)
|
||||
@@ -332,7 +367,7 @@ G4double G4BraggModel::StoppingPower(const G4Material* material,
|
||||
return ionloss;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4BraggModel::ElectronicStoppingPower(G4double z,
|
||||
G4double kineticEnergy) const
|
||||
@@ -477,7 +512,7 @@ G4double G4BraggModel::ElectronicStoppingPower(G4double z,
|
||||
return ionloss;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4BraggModel::DEDX(const G4Material* material,
|
||||
G4double kineticEnergy)
|
||||
@@ -488,7 +523,12 @@ G4double G4BraggModel::DEDX(const G4Material* material,
|
||||
material->GetAtomicNumDensityVector();
|
||||
|
||||
// compaund material with parametrisation
|
||||
if( HasMaterial(material) ) {
|
||||
G4int iNist = pstar.GetIndex(material);
|
||||
|
||||
if( iNist >= 0 ) {
|
||||
return pstar.GetElectronicDEDX(iNist, kineticEnergy)*material->GetDensity();
|
||||
|
||||
} else if( HasMaterial(material) ) {
|
||||
|
||||
eloss = StoppingPower(material, kineticEnergy)*
|
||||
material->GetDensity()/amu;
|
||||
@@ -538,7 +578,7 @@ G4double G4BraggModel::DEDX(const G4Material* material,
|
||||
return eloss*theZieglerFactor;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4BraggModel::MolecIsInZiegler1988(const G4Material* material)
|
||||
{
|
||||
@@ -636,7 +676,7 @@ G4bool G4BraggModel::MolecIsInZiegler1988(const G4Material* material)
|
||||
return false;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4BraggModel::ChemicalFactor(G4double kineticEnergy,
|
||||
G4double eloss125) const
|
||||
@@ -659,5 +699,5 @@ G4double G4BraggModel::ChemicalFactor(G4double kineticEnergy,
|
||||
return factor ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
Reference in New Issue
Block a user