Import Geant4 10.3.0.beta source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DNAMeltonAttachmentModel.cc 85244 2014-10-27 08:24:13Z gcosmo $
|
||||
// $Id: G4DNAMeltonAttachmentModel.cc 96606 2016-04-25 13:33:42Z gcosmo $
|
||||
//
|
||||
|
||||
// Created by Z. Francis
|
||||
@@ -37,20 +37,18 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
//#define MELTON_VERBOSE // prevent checking conditions at run time
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4DNAMeltonAttachmentModel::G4DNAMeltonAttachmentModel(const G4ParticleDefinition*,
|
||||
const G4String& nam) :
|
||||
G4VEmModel(nam), isInitialised(false)
|
||||
{
|
||||
// nistwater = G4NistManager::Instance()->FindOrBuildMaterial("G4_WATER");
|
||||
fpWaterDensity = 0;
|
||||
|
||||
lowEnergyLimit = 4 * eV;
|
||||
lowEnergyLimitOfModel = 4 * eV;
|
||||
highEnergyLimit = 13 * eV;
|
||||
SetLowEnergyLimit(lowEnergyLimit);
|
||||
SetHighEnergyLimit(highEnergyLimit);
|
||||
SetLowEnergyLimit(4.*eV);
|
||||
SetHighEnergyLimit(13.*eV);
|
||||
|
||||
verboseLevel = 0;
|
||||
// Verbosity scale:
|
||||
@@ -60,197 +58,201 @@ G4DNAMeltonAttachmentModel::G4DNAMeltonAttachmentModel(const G4ParticleDefinitio
|
||||
// 3 = calculation of cross sections, file openings, sampling of atoms
|
||||
// 4 = entering in methods
|
||||
|
||||
#ifdef MELTON_VERBOSE
|
||||
if (verboseLevel > 0)
|
||||
{
|
||||
G4cout << "Melton Attachment model is constructed " << G4endl<< "Energy range: "
|
||||
<< lowEnergyLimit / eV << " eV - "
|
||||
<< highEnergyLimit / eV << " eV"
|
||||
<< G4endl;
|
||||
G4cout << "Melton Attachment model is constructed "
|
||||
<< G4endl
|
||||
<< "Energy range: "
|
||||
<< LowEnergyLimit() / eV << " eV - "
|
||||
<< HighEnergyLimit() / eV << " eV"
|
||||
<< G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
fParticleChangeForGamma = 0;
|
||||
fDissociationFlag = true;
|
||||
fData = 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4DNAMeltonAttachmentModel::~G4DNAMeltonAttachmentModel()
|
||||
{
|
||||
// For total cross section
|
||||
|
||||
std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator pos;
|
||||
|
||||
for (pos = tableData.begin(); pos != tableData.end(); ++pos)
|
||||
{
|
||||
G4DNACrossSectionDataSet* table = pos->second;
|
||||
delete table;
|
||||
}
|
||||
|
||||
// For final state
|
||||
|
||||
if(fData) delete fData;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4DNAMeltonAttachmentModel::Initialise(const G4ParticleDefinition* /*particle*/,
|
||||
void G4DNAMeltonAttachmentModel::Initialise(const G4ParticleDefinition* particle,
|
||||
const G4DataVector& /*cuts*/)
|
||||
{
|
||||
|
||||
if (verboseLevel > 3) G4cout
|
||||
#ifdef MELTON_VERBOSE
|
||||
if (verboseLevel > 3)
|
||||
G4cout
|
||||
<< "Calling G4DNAMeltonAttachmentModel::Initialise()" << G4endl;
|
||||
#endif
|
||||
|
||||
// ONLY ELECTRON
|
||||
|
||||
if(particle->GetParticleName() != "e-")
|
||||
{
|
||||
G4Exception("G4DNAMeltonAttachmentModel::Initialise",
|
||||
"em0002",
|
||||
FatalException,
|
||||
"Model not applicable to particle type.");
|
||||
}
|
||||
|
||||
// Energy limits
|
||||
|
||||
if (LowEnergyLimit() < lowEnergyLimit)
|
||||
if (LowEnergyLimit() < 4.*eV)
|
||||
{
|
||||
G4cout << "G4DNAMeltonAttachmentModel: low energy limit increased from " <<
|
||||
LowEnergyLimit()/eV << " eV to " << lowEnergyLimit/eV << " eV" << G4endl;
|
||||
SetLowEnergyLimit(lowEnergyLimit);
|
||||
G4ExceptionDescription errMsg;
|
||||
errMsg << "G4DNAMeltonAttachmentModel: low energy limit increased from " <<
|
||||
LowEnergyLimit()/eV << " eV to " << 4. << " eV" << G4endl;
|
||||
|
||||
G4Exception("G4DNAMeltonAttachmentModel::Initialise",
|
||||
"Melton_LowerEBoundary",
|
||||
JustWarning,
|
||||
errMsg);
|
||||
|
||||
SetLowEnergyLimit(4*eV);
|
||||
}
|
||||
|
||||
if (HighEnergyLimit() > highEnergyLimit)
|
||||
if (HighEnergyLimit() > 13.*eV)
|
||||
{
|
||||
G4cout << "G4DNAMeltonAttachmentModel: high energy limit decreased from " <<
|
||||
HighEnergyLimit()/eV << " eV to " << highEnergyLimit/eV << " eV" << G4endl;
|
||||
SetHighEnergyLimit(highEnergyLimit);
|
||||
G4ExceptionDescription errMsg;
|
||||
errMsg << "G4DNAMeltonAttachmentModel: high energy limit decreased from " <<
|
||||
HighEnergyLimit()/eV << " eV to " << 13. << " eV" << G4endl;
|
||||
|
||||
G4Exception("G4DNAMeltonAttachmentModel::Initialise",
|
||||
"Melton_HigherEBoundary",
|
||||
JustWarning,
|
||||
errMsg);
|
||||
|
||||
SetHighEnergyLimit(13.*eV);
|
||||
}
|
||||
|
||||
// Reading of data files
|
||||
|
||||
G4double scaleFactor = 1e-18*cm*cm;
|
||||
|
||||
G4String fileElectron("dna/sigma_attachment_e_melton");
|
||||
|
||||
G4ParticleDefinition* electronDef = G4Electron::ElectronDefinition();
|
||||
G4String electron;
|
||||
|
||||
// ELECTRON
|
||||
G4double scaleFactor = 1e-18*cm2;
|
||||
|
||||
// For total cross section
|
||||
G4String fileElectron("dna/sigma_attachment_e_melton");
|
||||
|
||||
electron = electronDef->GetParticleName();
|
||||
fData = new G4DNACrossSectionDataSet(new G4LogLogInterpolation(),
|
||||
eV, scaleFactor);
|
||||
fData->LoadData(fileElectron);
|
||||
|
||||
tableFile[electron] = fileElectron;
|
||||
|
||||
G4DNACrossSectionDataSet* tableE =
|
||||
new G4DNACrossSectionDataSet(new G4LogLogInterpolation, eV,scaleFactor );
|
||||
tableE->LoadData(fileElectron);
|
||||
tableData[electron] = tableE;
|
||||
|
||||
//
|
||||
|
||||
if (verboseLevel > 2)
|
||||
G4cout << "Loaded cross section data for Melton Attachment model" << G4endl;
|
||||
|
||||
if( verboseLevel>0 )
|
||||
#ifdef MELTON_VERBOSE
|
||||
if( verboseLevel >0)
|
||||
{
|
||||
if (verboseLevel > 2)
|
||||
{
|
||||
G4cout << "Loaded cross section data for Melton Attachment model" << G4endl;
|
||||
}
|
||||
|
||||
G4cout << "Melton Attachment model is initialized " << G4endl
|
||||
<< "Energy range: "
|
||||
<< LowEnergyLimit() / eV << " eV - "
|
||||
<< HighEnergyLimit() / eV << " eV"
|
||||
<< G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Initialize water density pointer
|
||||
fpWaterDensity = G4DNAMolecularMaterial::Instance()->
|
||||
GetNumMolPerVolTableFor(G4Material::GetMaterial("G4_WATER"));
|
||||
|
||||
if (isInitialised)
|
||||
{ return;}
|
||||
{
|
||||
return;
|
||||
}
|
||||
fParticleChangeForGamma = GetParticleChangeForGamma();
|
||||
isInitialised = true;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double
|
||||
G4DNAMeltonAttachmentModel::CrossSectionPerVolume(const G4Material* material,
|
||||
const G4ParticleDefinition* particleDefinition,
|
||||
G4double ekin,
|
||||
G4double,
|
||||
G4double)
|
||||
const G4ParticleDefinition*,
|
||||
G4double ekin,
|
||||
G4double,
|
||||
G4double)
|
||||
{
|
||||
if (verboseLevel > 3) G4cout
|
||||
#ifdef MELTON_VERBOSE
|
||||
if (verboseLevel > 3)
|
||||
G4cout
|
||||
<< "Calling CrossSectionPerVolume() of G4DNAMeltonAttachmentModel"
|
||||
<< G4endl;
|
||||
#endif
|
||||
|
||||
// Calculate total cross section for model
|
||||
|
||||
G4double sigma=0;
|
||||
G4double sigma = 0.;
|
||||
|
||||
G4double waterDensity = (*fpWaterDensity)[material->GetIndex()];
|
||||
|
||||
if(waterDensity!= 0.0)
|
||||
// if (material == nistwater || material->GetBaseMaterial() == nistwater)
|
||||
if(waterDensity != 0.0)
|
||||
{
|
||||
const G4String& particleName = particleDefinition->GetParticleName();
|
||||
|
||||
if (ekin >= lowEnergyLimit && ekin < highEnergyLimit)
|
||||
if (ekin >= LowEnergyLimit() && ekin < HighEnergyLimit())
|
||||
// necessaire ?
|
||||
{
|
||||
|
||||
std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
|
||||
pos = tableData.find(particleName);
|
||||
|
||||
if (pos != tableData.end())
|
||||
{
|
||||
G4DNACrossSectionDataSet* table = pos->second;
|
||||
if (table != 0)
|
||||
{
|
||||
sigma = table->FindValue(ekin);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Exception("G4DNAMeltonAttachmentModel::ComputeCrossSectionPerVolume",
|
||||
"em0002",
|
||||
FatalException,"Model not applicable to particle type.");
|
||||
}
|
||||
sigma = fData->FindValue(ekin);
|
||||
}
|
||||
|
||||
#ifdef MELTON_VERBOSE
|
||||
if (verboseLevel > 2)
|
||||
{
|
||||
G4cout << "__________________________________" << G4endl;
|
||||
G4cout << "=== G4DNAMeltonAttachmentModel - XS INFO START" << G4endl;
|
||||
G4cout << "--- Kinetic energy(eV)=" << ekin/eV
|
||||
<< " particle : " << particleDefinition->GetParticleName() << G4endl;
|
||||
<< " particle : " << particleDefinition->GetParticleName()
|
||||
<< G4endl;
|
||||
G4cout << "--- Cross section per water molecule (cm^2)="
|
||||
<< sigma/cm/cm << G4endl;
|
||||
<< sigma/cm/cm << G4endl;
|
||||
G4cout << "--- Cross section per water molecule (cm^-1)="
|
||||
<< sigma*waterDensity/(1./cm) << G4endl;
|
||||
// G4cout << "--- Cross section per water molecule (cm^-1)="
|
||||
// << sigma*material->GetAtomicNumDensityVector()[1]/(1./cm)
|
||||
// << G4endl;
|
||||
<< sigma*waterDensity/(1./cm) << G4endl;
|
||||
G4cout << "--- G4DNAMeltonAttachmentModel - XS INFO END" << G4endl;
|
||||
}
|
||||
|
||||
#endif
|
||||
} // if water
|
||||
|
||||
return sigma*waterDensity;
|
||||
// return sigma*material->GetAtomicNumDensityVector()[1];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4DNAMeltonAttachmentModel::SampleSecondaries(std::vector<G4DynamicParticle*>* /*fvect*/,
|
||||
const G4MaterialCutsCouple* /*couple*/,
|
||||
const G4DynamicParticle* aDynamicElectron,
|
||||
G4double,
|
||||
G4double)
|
||||
void
|
||||
G4DNAMeltonAttachmentModel::
|
||||
SampleSecondaries(std::vector<G4DynamicParticle*>* /*fvect*/,
|
||||
const G4MaterialCutsCouple* /*couple*/,
|
||||
const G4DynamicParticle* aDynamicElectron,
|
||||
G4double,
|
||||
G4double)
|
||||
{
|
||||
|
||||
if (verboseLevel > 3) G4cout
|
||||
<< "Calling SampleSecondaries() of G4DNAMeltonAttachmentModel" << G4endl;
|
||||
|
||||
// Electron is killed
|
||||
|
||||
G4double electronEnergy0 = aDynamicElectron->GetKineticEnergy();
|
||||
fParticleChangeForGamma->SetProposedKineticEnergy(0.);
|
||||
fParticleChangeForGamma->ProposeTrackStatus(fStopAndKill);
|
||||
fParticleChangeForGamma->ProposeLocalEnergyDeposit(electronEnergy0);
|
||||
|
||||
if(fDissociationFlag)
|
||||
{
|
||||
G4DNAChemistryManager::Instance()->CreateWaterMolecule(eDissociativeAttachment,-1,
|
||||
fParticleChangeForGamma->GetCurrentTrack());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef MELTON_VERBOSE
|
||||
if (verboseLevel > 3)
|
||||
G4cout
|
||||
<< "Calling SampleSecondaries() of G4DNAMeltonAttachmentModel" << G4endl;
|
||||
#endif
|
||||
|
||||
// Electron is killed
|
||||
|
||||
G4double electronEnergy0 = aDynamicElectron->GetKineticEnergy();
|
||||
fParticleChangeForGamma->SetProposedKineticEnergy(0.);
|
||||
fParticleChangeForGamma->ProposeTrackStatus(fStopAndKill);
|
||||
fParticleChangeForGamma->ProposeLocalEnergyDeposit(electronEnergy0);
|
||||
|
||||
if(fDissociationFlag)
|
||||
{
|
||||
G4DNAChemistryManager::Instance()->
|
||||
CreateWaterMolecule(eDissociativeAttachment,
|
||||
-1,
|
||||
fParticleChangeForGamma->GetCurrentTrack());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user