Import Geant4 10.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 12:08:39 +02:00
parent 286caacf06
commit c9b32a6c0a
5770 changed files with 1050949 additions and 367105 deletions
@@ -73,52 +73,53 @@ using namespace std;
G4eSingleCoulombScatteringModel::G4eSingleCoulombScatteringModel(const G4String& nam)
: G4VEmModel(nam),
cosThetaMin(1.0),
isInitialised(false)
{
fNistManager = G4NistManager::Instance();
theIonTable = G4ParticleTable::GetParticleTable()->GetIonTable();
fParticleChange = 0;
fNistManager = G4NistManager::Instance();
theIonTable = G4ParticleTable::GetParticleTable()->GetIonTable();
fParticleChange = 0;
pCuts=0;
currentMaterial = 0;
currentElement = 0;
currentCouple = 0;
pCuts=0;
currentMaterial = 0;
currentElement = 0;
currentCouple = 0;
lowEnergyLimit = 0*eV;
recoilThreshold = 0.*eV;
particle = 0;
mass=0;
currentMaterialIndex = -1;
Mottcross = new G4ScreeningMottCrossSection();
lowEnergyLimit = 0*eV;
recoilThreshold = 0.*eV;
particle = 0;
mass=0;
currentMaterialIndex = -1;
Mottcross = new G4ScreeningMottCrossSection();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4eSingleCoulombScatteringModel::~G4eSingleCoulombScatteringModel()
{ delete Mottcross;}
{
delete Mottcross;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4eSingleCoulombScatteringModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector& )
const G4DataVector& cuts)
{
SetupParticle(p);
currentCouple = 0;
currentMaterialIndex = -1;
cosThetaMin = cos(PolarAngleLimit());
Mottcross->Initialise(p,cosThetaMin);
SetupParticle(p);
currentCouple = 0;
currentMaterialIndex = -1;
//cosThetaMin = cos(PolarAngleLimit());
Mottcross->Initialise(p,cosThetaMin);
pCuts = G4ProductionCutsTable::GetProductionCutsTable()->GetEnergyCutsVector(3);
pCuts = &cuts;
//G4ProductionCutsTable::GetProductionCutsTable()->GetEnergyCutsVector(3);
if(!isInitialised) {
isInitialised = true;
fParticleChange = GetParticleChangeForGamma();
}
if(!isInitialised) {
isInitialised = true;
fParticleChange = GetParticleChangeForGamma();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -131,19 +132,18 @@ G4double G4eSingleCoulombScatteringModel::ComputeCrossSectionPerAtom(
G4double,
G4double )
{
SetupParticle(p);
SetupParticle(p);
G4double cross =0.0;
if(kinEnergy < lowEnergyLimit) return cross;
G4double cross =0.0;
if(kinEnergy < lowEnergyLimit) return cross;
DefineMaterial(CurrentCouple());
DefineMaterial(CurrentCouple());
//Total Cross section
Mottcross->SetupKinematic(kinEnergy, Z);
cross = Mottcross->NuclearCrossSection();
//Total Cross section
Mottcross->SetupKinematic(kinEnergy, Z);
cross = Mottcross->NuclearCrossSection();
//cout<< "....cross "<<G4BestUnit(cross,"Surface") << " cm2 "<< cross/cm2 <<endl;
//cout<< "....cross "<<G4BestUnit(cross,"Surface") << " cm2 "<< cross/cm2 <<endl;
return cross;
}
@@ -156,37 +156,37 @@ void G4eSingleCoulombScatteringModel::SampleSecondaries(
G4double cutEnergy,
G4double)
{
G4double kinEnergy = dp->GetKineticEnergy();
//cout<<"--- kinEnergy "<<kinEnergy<<endl;
G4double kinEnergy = dp->GetKineticEnergy();
//cout<<"--- kinEnergy "<<kinEnergy<<endl;
if(kinEnergy < lowEnergyLimit) return;
if(kinEnergy < lowEnergyLimit) return;
DefineMaterial(couple);
SetupParticle(dp->GetDefinition());
DefineMaterial(couple);
SetupParticle(dp->GetDefinition());
// Choose nucleus
//last two :cutEnergy= min e kinEnergy=max
currentElement = SelectRandomAtom(couple,particle,
kinEnergy,cutEnergy,kinEnergy);
// Choose nucleus
//last two :cutEnergy= min e kinEnergy=max
currentElement = SelectRandomAtom(couple,particle,
kinEnergy,cutEnergy,kinEnergy);
G4double Z = currentElement->GetZ();
G4int iz = G4int(Z);
G4int ia = SelectIsotopeNumber(currentElement);
G4double Z = currentElement->GetZ();
G4int iz = G4int(Z);
G4int ia = SelectIsotopeNumber(currentElement);
//cout<<"Element "<<currentElement->GetName()<<endl;;
//cout<<"Element "<<currentElement->GetName()<<endl;;
G4double cross= Mottcross->GetTotalCross();
G4double cross= Mottcross->GetTotalCross();
if(cross == 0.0) { return; }
if(cross == 0.0) { return; }
G4ThreeVector dir = dp->GetMomentumDirection(); //old direction
G4ThreeVector newDirection=Mottcross->GetNewDirection();//new direction
newDirection.rotateUz(dir);
G4ThreeVector dir = dp->GetMomentumDirection(); //old direction
G4ThreeVector newDirection=Mottcross->GetNewDirection();//new direction
newDirection.rotateUz(dir);
fParticleChange->ProposeMomentumDirection(newDirection);
fParticleChange->ProposeMomentumDirection(newDirection);
//Recoil energy
G4double trec= Mottcross->GetTrec();
//Recoil energy
G4double trec= Mottcross->GetTrec();
//Energy after scattering
if(trec > kinEnergy) { trec = kinEnergy; }