Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmBiasingManager.cc 92921 2015-09-21 15:06:51Z gcosmo $
|
||||
// $Id: G4EmBiasingManager.cc 98860 2016-08-15 09:59:59Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -296,7 +296,7 @@ G4EmBiasingManager::ApplySecondaryBiasing(
|
||||
if(safety > fSafetyMin) { ApplyRangeCut(vd, track, eloss, safety); }
|
||||
|
||||
// Russian Roulette
|
||||
} if(1 == nsplit) {
|
||||
} else if(1 == nsplit) {
|
||||
weight = ApplyRussianRoulette(vd, index);
|
||||
|
||||
// Splitting
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmCorrections.cc 96698 2016-05-02 07:19:24Z gcosmo $
|
||||
// $Id: G4EmCorrections.cc 100363 2016-10-19 09:24:47Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -129,7 +129,7 @@ G4EmCorrections::G4EmCorrections(G4int verb)
|
||||
eCorrMax = 250.*CLHEP::MeV;
|
||||
|
||||
ionTable = G4ParticleTable::GetParticleTable()->GetIonTable();
|
||||
g4pow = G4Pow::GetInstance();
|
||||
g4calc = G4Pow::GetInstance();
|
||||
|
||||
nIons = ncouples = numberOfElements = idx = currentZ = 0;
|
||||
mass = tau = gamma = bg2 = beta2 = beta = ba2 = tmax = charge = q2 = 0.0;
|
||||
@@ -782,8 +782,8 @@ G4double G4EmCorrections::NuclearStoppingPower(G4double kineticEnergy,
|
||||
G4double nloss = 0.0;
|
||||
|
||||
G4double rm;
|
||||
if(z1 > 1.5) rm = (mass1 + mass2) * ( g4pow->Z23(G4lrint(z1)) + g4pow->Z23(G4lrint(z2)) ) ;
|
||||
else rm = (mass1 + mass2) * g4pow->Z13(G4lrint(z2));
|
||||
if(z1 > 1.5) rm = (mass1 + mass2) * ( g4calc->Z23(G4lrint(z1)) + g4calc->Z23(G4lrint(z2)) ) ;
|
||||
else rm = (mass1 + mass2) * g4calc->Z13(G4lrint(z2));
|
||||
|
||||
G4double er = 32.536 * mass2 * energy / ( z1 * z2 * rm ) ; // reduced energy
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ G4EmParameters* G4EmParameters::theInstance = nullptr;
|
||||
|
||||
G4EmParameters* G4EmParameters::Instance()
|
||||
{
|
||||
if(0 == theInstance) {
|
||||
if(nullptr == theInstance) {
|
||||
static G4EmParameters manager;
|
||||
theInstance = &manager;
|
||||
}
|
||||
@@ -78,6 +78,7 @@ G4EmParameters* G4EmParameters::Instance()
|
||||
G4EmParameters::~G4EmParameters()
|
||||
{
|
||||
delete theMessenger;
|
||||
delete emSaturation;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
@@ -88,13 +89,17 @@ G4EmParameters::G4EmParameters()
|
||||
theMessenger = new G4EmParametersMessenger(this);
|
||||
|
||||
fStateManager = G4StateManager::GetStateManager();
|
||||
SetDefaults();
|
||||
Initialise();
|
||||
emSaturation = nullptr;
|
||||
}
|
||||
|
||||
void G4EmParameters::SetDefaults()
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
|
||||
if(!IsLocked()) { Initialise(); }
|
||||
}
|
||||
|
||||
void G4EmParameters::Initialise()
|
||||
{
|
||||
lossFluctuation = true;
|
||||
buildCSDARange = false;
|
||||
flagLPM = true;
|
||||
@@ -113,10 +118,11 @@ void G4EmParameters::SetDefaults()
|
||||
useAngGeneratorForIonisation = false;
|
||||
useMottCorrection = false;
|
||||
integral = true;
|
||||
birks = false;
|
||||
|
||||
minSubRange = 1.0;
|
||||
minKinEnergy = 0.1*CLHEP::keV;
|
||||
maxKinEnergy = 10.0*CLHEP::TeV;
|
||||
maxKinEnergy = 100.0*CLHEP::TeV;
|
||||
maxKinEnergyCSDA = 1.0*CLHEP::GeV;
|
||||
lowestElectronEnergy = 1.0*CLHEP::keV;
|
||||
lowestMuHadEnergy = 1.0*CLHEP::keV;
|
||||
@@ -348,6 +354,35 @@ G4bool G4EmParameters::Integral() const
|
||||
return integral;
|
||||
}
|
||||
|
||||
void G4EmParameters::SetBirksActive(G4bool val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
birks = val;
|
||||
if(birks) {
|
||||
if(!emSaturation) { emSaturation = new G4EmSaturation(1); }
|
||||
emSaturation->InitialiseG4Saturation();
|
||||
}
|
||||
}
|
||||
|
||||
G4bool G4EmParameters::BirksActive() const
|
||||
{
|
||||
return birks;
|
||||
}
|
||||
|
||||
void G4EmParameters::SetEmSaturation(G4EmSaturation* ptr)
|
||||
{
|
||||
if(emSaturation != ptr) {
|
||||
delete emSaturation;
|
||||
emSaturation = ptr;
|
||||
}
|
||||
}
|
||||
|
||||
G4EmSaturation* G4EmParameters::GetEmSaturation()
|
||||
{
|
||||
if(!emSaturation) { SetBirksActive(true); }
|
||||
return emSaturation;
|
||||
}
|
||||
|
||||
void G4EmParameters::SetMinSubRange(G4double val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
@@ -856,6 +891,27 @@ const std::vector<G4String>& G4EmParameters::TypesDNA() const
|
||||
return m_typesDNA;
|
||||
}
|
||||
|
||||
void G4EmParameters::AddMsc(const G4String& region, const G4String& type)
|
||||
{
|
||||
G4String r = CheckRegion(region);
|
||||
G4int nreg = m_regnamesMsc.size();
|
||||
for(G4int i=0; i<nreg; ++i) {
|
||||
if(r == m_regnamesMsc[i]) { return; }
|
||||
}
|
||||
m_regnamesMsc.push_back(r);
|
||||
m_typesMsc.push_back(type);
|
||||
}
|
||||
|
||||
const std::vector<G4String>& G4EmParameters::RegionsMsc() const
|
||||
{
|
||||
return m_regnamesMsc;
|
||||
}
|
||||
|
||||
const std::vector<G4String>& G4EmParameters::TypesMsc() const
|
||||
{
|
||||
return m_typesMsc;
|
||||
}
|
||||
|
||||
void G4EmParameters::SetSubCutoff(G4bool val, const G4String& region)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
@@ -876,8 +932,16 @@ G4EmParameters::SetDeexActiveRegion(const G4String& region, G4bool fdeex,
|
||||
G4bool fauger, G4bool fpixe)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
if(fdeex) { fluo = true; }
|
||||
G4String r = CheckRegion(region);
|
||||
G4int nreg = m_regnamesDeex.size();
|
||||
if(0 == nreg && r != "DefaultRegionForTheWorld") {
|
||||
m_regnamesDeex.push_back("DefaultRegionForTheWorld");
|
||||
m_fluo.push_back(false);
|
||||
m_auger.push_back(false);
|
||||
m_pixe.push_back(false);
|
||||
nreg = 1;
|
||||
}
|
||||
for(G4int i=0; i<nreg; ++i) {
|
||||
if(r == m_regnamesDeex[i]) {
|
||||
m_fluo[i] = fdeex;
|
||||
@@ -1083,6 +1147,8 @@ std::ostream& G4EmParameters::StreamInfo(std::ostream& os) const
|
||||
<<useMottCorrection << "\n";
|
||||
os << "Use integral approach for tracking "
|
||||
<<integral << "\n";
|
||||
os << "Use built-in Birks satuaration "
|
||||
<< birks << "\n";
|
||||
|
||||
os << "Factor of cut reduction for sub-cutoff method " <<minSubRange << "\n";
|
||||
os << "Min kinetic energy for tables "
|
||||
@@ -1142,8 +1208,9 @@ std::ostream& operator<< (std::ostream& os, const G4EmParameters& par)
|
||||
|
||||
G4bool G4EmParameters::IsLocked() const
|
||||
{
|
||||
return (G4Threading::IsWorkerThread() ||
|
||||
return (!G4Threading::IsMasterThread() ||
|
||||
(fStateManager->GetCurrentState() != G4State_PreInit &&
|
||||
fStateManager->GetCurrentState() != G4State_Init &&
|
||||
fStateManager->GetCurrentState() != G4State_Idle));
|
||||
}
|
||||
|
||||
|
||||
@@ -167,12 +167,24 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
|
||||
delCmd->SetDefaultValue(false);
|
||||
delCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
IntegCmd = new G4UIcmdWithABool("/process/eLoss/integral",this);
|
||||
IntegCmd->SetGuidance("Switch true/false the integral option");
|
||||
IntegCmd->SetParameterName("integ",true);
|
||||
IntegCmd->SetDefaultValue(true);
|
||||
IntegCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
mottCmd = new G4UIcmdWithABool("/process/msc/UseMottCorrection",this);
|
||||
mottCmd->SetGuidance("Enable usage of Mott corrections for e- elastic scattering");
|
||||
mottCmd->SetParameterName("mott",true);
|
||||
mottCmd->SetDefaultValue(false);
|
||||
mottCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
birksCmd = new G4UIcmdWithABool("/process/msc/UseG4EmSaturation",this);
|
||||
birksCmd->SetGuidance("Enable usage of built-in Birks saturation");
|
||||
birksCmd->SetParameterName("birks",true);
|
||||
birksCmd->SetDefaultValue(false);
|
||||
birksCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
minSubSecCmd = new G4UIcmdWithADouble("/process/eLoss/minsubsec",this);
|
||||
minSubSecCmd->SetGuidance("Set the ratio subcut/cut ");
|
||||
minSubSecCmd->SetParameterName("rcmin",true);
|
||||
@@ -345,17 +357,29 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
|
||||
meCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
dnaCmd = new G4UIcommand("/process/em/AddDNARegion",this);
|
||||
dnaCmd->SetGuidance("Activate DNA in the G4Region.");
|
||||
dnaCmd->SetGuidance("Activate DNA in a G4Region.");
|
||||
dnaCmd->SetGuidance(" regName : G4Region name");
|
||||
dnaCmd->SetGuidance(" dnaType : opt0, opt1, opt2");
|
||||
dnaCmd->SetGuidance(" dnaType : DNA_opt0, DNA_opt1, DNA_opt2");
|
||||
dnaCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
G4UIparameter* regName = new G4UIparameter("regName",'s',false);
|
||||
dnaCmd->SetParameter(regName);
|
||||
|
||||
G4UIparameter* type = new G4UIparameter("type",'s',false);
|
||||
G4UIparameter* type = new G4UIparameter("dnaType",'s',false);
|
||||
dnaCmd->SetParameter(type);
|
||||
|
||||
mscoCmd = new G4UIcommand("/process/em/AddEmRegion",this);
|
||||
mscoCmd->SetGuidance("Add optional EM configuration for a G4Region.");
|
||||
mscoCmd->SetGuidance(" regName : G4Region name");
|
||||
mscoCmd->SetGuidance(" mscType : G4EmStandard, G4EmStandard_opt1, ...");
|
||||
mscoCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
G4UIparameter* mregName = new G4UIparameter("regName",'s',false);
|
||||
mscoCmd->SetParameter(mregName);
|
||||
|
||||
G4UIparameter* mtype = new G4UIparameter("mscType",'s',false);
|
||||
mscoCmd->SetParameter(mtype);
|
||||
|
||||
dumpCmd = new G4UIcommand("/process/em/printParameters",this);
|
||||
dumpCmd->SetGuidance("Print all EM parameters.");
|
||||
|
||||
@@ -407,12 +431,6 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
|
||||
unitPrm1->SetDefaultValue("mm");
|
||||
StepFuncCmd1->SetParameter(unitPrm1);
|
||||
|
||||
IntegCmd = new G4UIcmdWithABool("/process/eLoss/integral",this);
|
||||
IntegCmd->SetGuidance("Switch true/false the integral option");
|
||||
IntegCmd->SetParameterName("integ",true);
|
||||
IntegCmd->SetDefaultValue(true);
|
||||
IntegCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
deexCmd = new G4UIcommand("/process/em/deexcitation",this);
|
||||
deexCmd->SetGuidance("Set deexcitation flags per G4Region.");
|
||||
deexCmd->SetGuidance(" regName : G4Region name");
|
||||
@@ -438,7 +456,7 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
|
||||
bfCmd->SetGuidance(" procName : process name");
|
||||
bfCmd->SetGuidance(" procFact : factor");
|
||||
bfCmd->SetGuidance(" flagFact : flag to change weight");
|
||||
bfCmd->AvailableForStates(G4State_Idle,G4State_Idle);
|
||||
bfCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
G4UIparameter* procName = new G4UIparameter("procName",'s',false);
|
||||
bfCmd->SetParameter(procName);
|
||||
@@ -456,7 +474,7 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
|
||||
fiCmd->SetGuidance(" tlength : fixed target length");
|
||||
fiCmd->SetGuidance(" unitT : length unit");
|
||||
fiCmd->SetGuidance(" tflag : flag to change weight");
|
||||
fiCmd->AvailableForStates(G4State_Idle,G4State_Idle);
|
||||
fiCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
G4UIparameter* procNam = new G4UIparameter("procNam",'s',false);
|
||||
fiCmd->SetParameter(procNam);
|
||||
@@ -528,7 +546,9 @@ G4EmParametersMessenger::~G4EmParametersMessenger()
|
||||
delete mulatCmd;
|
||||
delete catCmd;
|
||||
delete delCmd;
|
||||
delete IntegCmd;
|
||||
delete mottCmd;
|
||||
delete birksCmd;
|
||||
|
||||
delete minSubSecCmd;
|
||||
delete minEnCmd;
|
||||
@@ -562,12 +582,12 @@ G4EmParametersMessenger::~G4EmParametersMessenger()
|
||||
delete paiCmd;
|
||||
delete meCmd;
|
||||
delete dnaCmd;
|
||||
delete mscoCmd;
|
||||
delete dumpCmd;
|
||||
|
||||
delete SubSecCmd;
|
||||
delete StepFuncCmd;
|
||||
delete StepFuncCmd1;
|
||||
delete IntegCmd;
|
||||
delete deexCmd;
|
||||
delete bfCmd;
|
||||
delete fiCmd;
|
||||
@@ -626,8 +646,13 @@ void G4EmParametersMessenger::SetNewValue(G4UIcommand* command,
|
||||
physicsModified = true;
|
||||
} else if (command == delCmd) {
|
||||
theParameters->ActivateAngularGeneratorForIonisation(delCmd->GetNewBoolValue(newValue));
|
||||
} else if (command == IntegCmd) {
|
||||
theParameters->SetIntegral(IntegCmd->GetNewBoolValue(newValue));
|
||||
physicsModified = true;
|
||||
} else if (command == mottCmd) {
|
||||
theParameters->SetUseMottCorrection(mottCmd->GetNewBoolValue(newValue));
|
||||
} else if (command == birksCmd) {
|
||||
theParameters->SetBirksActive(birksCmd->GetNewBoolValue(newValue));
|
||||
|
||||
} else if (command == minSubSecCmd) {
|
||||
theParameters->SetMinSubRange(minSubSecCmd->GetNewDoubleValue(newValue));
|
||||
@@ -729,6 +754,11 @@ void G4EmParametersMessenger::SetNewValue(G4UIcommand* command,
|
||||
std::istringstream is(newValue);
|
||||
is >> s1 >> s2;
|
||||
theParameters->AddDNA(s1, s2);
|
||||
} else if (command == mscoCmd) {
|
||||
G4String s1(""),s2("");
|
||||
std::istringstream is(newValue);
|
||||
is >> s1 >> s2;
|
||||
theParameters->AddMsc(s1, s2);
|
||||
} else if (command == dumpCmd) {
|
||||
theParameters->Dump();
|
||||
} else if (command == SubSecCmd) {
|
||||
@@ -750,9 +780,6 @@ void G4EmParametersMessenger::SetNewValue(G4UIcommand* command,
|
||||
theParameters->SetStepFunctionMuHad(v1,v2);
|
||||
}
|
||||
physicsModified = true;
|
||||
} else if (command == IntegCmd) {
|
||||
theParameters->SetIntegral(IntegCmd->GetNewBoolValue(newValue));
|
||||
physicsModified = true;
|
||||
} else if (command == deexCmd) {
|
||||
G4String s1 (""), s2(""), s3(""), s4("");
|
||||
G4bool b2(false), b3(false), b4(false);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmSaturation.cc 92921 2015-09-21 15:06:51Z gcosmo $
|
||||
// $Id: G4EmSaturation.cc 100346 2016-10-18 15:30:36Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -54,22 +54,21 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4int G4EmSaturation::nMaterials = 0;
|
||||
std::vector<G4double> G4EmSaturation::massFactors;
|
||||
std::vector<G4double> G4EmSaturation::effCharges;
|
||||
std::vector<G4double> G4EmSaturation::g4MatData;
|
||||
std::vector<G4String> G4EmSaturation::g4MatNames;
|
||||
|
||||
G4EmSaturation::G4EmSaturation(G4int verb)
|
||||
: manager(nullptr)
|
||||
{
|
||||
verbose = verb;
|
||||
|
||||
curMaterial = nullptr;
|
||||
curBirks = 0.0;
|
||||
curRatio = 1.0;
|
||||
curChargeSq = 1.0;
|
||||
nMaterials = nWarnings = 0;
|
||||
nWarnings = nG4Birks = 0;
|
||||
|
||||
electron = nullptr;
|
||||
proton = nullptr;
|
||||
nist = G4NistManager::Instance();
|
||||
|
||||
InitialiseG4materials();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -84,62 +83,79 @@ G4double G4EmSaturation::VisibleEnergyDeposition(
|
||||
const G4MaterialCutsCouple* couple,
|
||||
G4double length,
|
||||
G4double edep,
|
||||
G4double niel)
|
||||
G4double niel) const
|
||||
{
|
||||
if(edep <= 0.0) { return 0.0; }
|
||||
|
||||
G4double evis = edep;
|
||||
G4double bfactor = FindBirksCoefficient(couple->GetMaterial());
|
||||
G4double bfactor = couple->GetMaterial()->GetIonisation()->GetBirksConstant();
|
||||
|
||||
if(bfactor > 0.0) {
|
||||
|
||||
G4int pdgCode = p->GetPDGEncoding();
|
||||
// atomic relaxations for gamma incident
|
||||
if(22 == pdgCode && electron) {
|
||||
if(22 == p->GetPDGEncoding()) {
|
||||
//G4cout << "%% gamma edep= " << edep/keV << " keV " <<manager << G4endl;
|
||||
evis /= (1.0 + bfactor*edep/manager->GetRange(electron,edep,couple));
|
||||
evis /= (1.0 + bfactor*edep/
|
||||
G4LossTableManager::Instance()->GetRange(electron,edep,couple));
|
||||
|
||||
// energy loss
|
||||
} else {
|
||||
|
||||
// protections
|
||||
G4double nloss = niel;
|
||||
if(nloss < 0.0) { nloss = 0.0; }
|
||||
G4double nloss = std::max(niel, 0.0);
|
||||
G4double eloss = edep - nloss;
|
||||
|
||||
// neutrons and neutral hadrons
|
||||
if(0.0 == p->GetPDGCharge() || eloss < 0.0 || length <= 0.0) {
|
||||
nloss = edep;
|
||||
eloss = 0.0;
|
||||
}
|
||||
} else {
|
||||
|
||||
// continues energy loss
|
||||
if(eloss > 0.0) { eloss /= (1.0 + bfactor*eloss/length); }
|
||||
|
||||
// continues energy loss
|
||||
eloss /= (1.0 + bfactor*eloss/length);
|
||||
}
|
||||
// non-ionizing energy loss
|
||||
if(nloss > 0.0 && proton) {
|
||||
G4double escaled = nloss*curRatio;
|
||||
if(nloss > 0.0) {
|
||||
G4int idx = couple->GetMaterial()->GetIndex();
|
||||
G4double escaled = nloss*massFactors[idx];
|
||||
/*
|
||||
G4cout << "%% p edep= " << nloss/keV << " keV Escaled= "
|
||||
<< escaled << " MeV in " << couple->GetMaterial()->GetName()
|
||||
<< " " << p->GetParticleName()
|
||||
<< G4endl;
|
||||
*/
|
||||
G4double range = manager->GetRange(proton,escaled,couple)/curChargeSq;
|
||||
G4double range = G4LossTableManager::Instance()
|
||||
->GetRange(proton,escaled,couple)/effCharges[idx];
|
||||
nloss /= (1.0 + bfactor*nloss/range);
|
||||
}
|
||||
|
||||
evis = eloss + nloss;
|
||||
}
|
||||
}
|
||||
|
||||
return evis;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EmSaturation::InitialiseG4Saturation()
|
||||
{
|
||||
nMaterials = G4Material::GetNumberOfMaterials();
|
||||
massFactors.resize(nMaterials, 1.0);
|
||||
effCharges.resize(nMaterials, 1.0);
|
||||
|
||||
if(0 == nG4Birks) { InitialiseG4materials(); }
|
||||
|
||||
for(G4int i=0; i<nMaterials; ++i) {
|
||||
InitialiseBirksCoefficient((*G4Material::GetMaterialTable())[i]);
|
||||
}
|
||||
if(verbose > 0) { DumpBirksCoefficients(); }
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4EmSaturation::FindG4BirksCoefficient(const G4Material* mat)
|
||||
{
|
||||
if(0 == nG4Birks) { InitialiseG4materials(); }
|
||||
|
||||
G4String name = mat->GetName();
|
||||
// is this material in the vector?
|
||||
|
||||
@@ -152,7 +168,7 @@ G4double G4EmSaturation::FindG4BirksCoefficient(const G4Material* mat)
|
||||
return g4MatData[j];
|
||||
}
|
||||
}
|
||||
return FindBirksCoefficient(mat);
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -160,29 +176,18 @@ G4double G4EmSaturation::FindG4BirksCoefficient(const G4Material* mat)
|
||||
void G4EmSaturation::InitialiseBirksCoefficient(const G4Material* mat)
|
||||
{
|
||||
// electron and proton should exist in any case
|
||||
if(!manager) {
|
||||
manager = G4LossTableManager::Instance();
|
||||
if(!electron) {
|
||||
electron = G4ParticleTable::GetParticleTable()->FindParticle("e-");
|
||||
proton = G4ParticleTable::GetParticleTable()->FindParticle("proton");
|
||||
}
|
||||
|
||||
curMaterial = mat;
|
||||
curBirks = 0.0;
|
||||
curRatio = 1.0;
|
||||
curChargeSq = 1.0;
|
||||
|
||||
// seach in the run-time list
|
||||
for(G4int i=0; i<nMaterials; ++i) {
|
||||
if(mat == matPointers[i]) {
|
||||
curBirks = mat->GetIonisation()->GetBirksConstant();
|
||||
curRatio = massFactors[i];
|
||||
curChargeSq = effCharges[i];
|
||||
return;
|
||||
if(!electron || !proton) {
|
||||
G4Exception("G4EmSaturation::InitialiseBirksCoefficient", "em0001",
|
||||
FatalException, "both electron and proton should exist");
|
||||
}
|
||||
}
|
||||
|
||||
G4double curBirks = mat->GetIonisation()->GetBirksConstant();
|
||||
|
||||
G4String name = mat->GetName();
|
||||
curBirks = mat->GetIonisation()->GetBirksConstant();
|
||||
|
||||
// material has no Birks coeffitient defined
|
||||
// seach in the Geant4 list
|
||||
@@ -196,22 +201,11 @@ void G4EmSaturation::InitialiseBirksCoefficient(const G4Material* mat)
|
||||
}
|
||||
}
|
||||
|
||||
if(curBirks == 0.0) {
|
||||
if(0 < nWarnings) {
|
||||
++nWarnings;
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Birks constants are not defined for material " << name
|
||||
<< " ! \n Define Birks constants for the material"
|
||||
<< " or not apply saturation.";
|
||||
G4Exception("G4EmSaturation::InitialiseBirksCoefficient", "em0088",
|
||||
JustWarning, ed);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(curBirks == 0.0) { return; }
|
||||
|
||||
// compute mean mass ratio
|
||||
curRatio = 0.0;
|
||||
curChargeSq = 0.0;
|
||||
G4double curRatio = 0.0;
|
||||
G4double curChargeSq = 0.0;
|
||||
G4double norm = 0.0;
|
||||
const G4ElementVector* theElementVector = mat->GetElementVector();
|
||||
const G4double* theAtomNumDensityVector = mat->GetVecNbOfAtomsPerVolume();
|
||||
@@ -228,31 +222,26 @@ void G4EmSaturation::InitialiseBirksCoefficient(const G4Material* mat)
|
||||
curChargeSq /= norm;
|
||||
|
||||
// store results
|
||||
matPointers.push_back(mat);
|
||||
matNames.push_back(name);
|
||||
massFactors.push_back(curRatio);
|
||||
effCharges.push_back(curChargeSq);
|
||||
nMaterials++;
|
||||
if(verbose > 0) {
|
||||
G4cout << "### G4EmSaturation::FindBirksCoefficient Birks coefficient for "
|
||||
<< name << " " << curBirks*MeV/mm << " mm/MeV" << G4endl;
|
||||
}
|
||||
return;
|
||||
G4int idx = mat->GetIndex();
|
||||
massFactors[idx] = curRatio;
|
||||
effCharges[idx] = curChargeSq;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EmSaturation::DumpBirksCoefficients()
|
||||
{
|
||||
if(nMaterials > 0) {
|
||||
G4cout << "### Birks coeffitients used in run time" << G4endl;
|
||||
for(G4int i=0; i<nMaterials; ++i) {
|
||||
G4double br = matPointers[i]->GetIonisation()->GetBirksConstant();
|
||||
G4cout << " " << matNames[i] << " "
|
||||
<< br*MeV/mm << " mm/MeV" << " "
|
||||
<< br*matPointers[i]->GetDensity()*MeV*cm2/g
|
||||
<< " g/cm^2/MeV"
|
||||
<< G4endl;
|
||||
G4cout << "### Birks coeffitients used in run time" << G4endl;
|
||||
const G4MaterialTable* mtable = G4Material::GetMaterialTable();
|
||||
for(G4int i=0; i<nMaterials; ++i) {
|
||||
const G4Material* mat = (*mtable)[i];
|
||||
G4double br = mat->GetIonisation()->GetBirksConstant();
|
||||
if(br > 0.0) {
|
||||
G4cout << " " << mat->GetName() << " "
|
||||
<< br*MeV/mm << " mm/MeV" << " "
|
||||
<< br*mat->GetDensity()*MeV*cm2/g
|
||||
<< " g/cm^2/MeV massFactor= " << massFactors[i]
|
||||
<< " effCharge= " << effCharges[i] << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -274,6 +263,9 @@ void G4EmSaturation::DumpG4BirksCoefficients()
|
||||
|
||||
void G4EmSaturation::InitialiseG4materials()
|
||||
{
|
||||
nG4Birks = 4;
|
||||
g4MatData.reserve(nG4Birks);
|
||||
|
||||
// M.Hirschberg et al., IEEE Trans. Nuc. Sci. 39 (1992) 511
|
||||
// SCSN-38 kB = 0.00842 g/cm^2/MeV; rho = 1.06 g/cm^3
|
||||
g4MatNames.push_back("G4_POLYSTYRENE");
|
||||
@@ -288,9 +280,12 @@ void G4EmSaturation::InitialiseG4materials()
|
||||
// Scallettar et al., Phys. Rev. A25 (1982) 2419.
|
||||
// NIM A 523 (2004) 275.
|
||||
// kB = 0.022 g/cm^2/MeV; rho = 1.396 g/cm^3;
|
||||
// ATLAS Efield = 10 kV/cm provide the strongest effect
|
||||
// ATLAS Efield = 10 kV/cm provide the strongest effect
|
||||
// kB = 0.1576*mm/MeV
|
||||
// A. Kiryunin and P.Strizenec "Geant4 hadronic
|
||||
// working group meeting " kB = 0.041/9.13 g/cm^2/MeV
|
||||
g4MatNames.push_back("G4_lAr");
|
||||
g4MatData.push_back(0.1576*mm/MeV);
|
||||
g4MatData.push_back(0.032*mm/MeV);
|
||||
|
||||
//G4_BARIUM_FLUORIDE
|
||||
//G4_CESIUM_IODIDE
|
||||
@@ -300,10 +295,13 @@ void G4EmSaturation::InitialiseG4materials()
|
||||
//G4_SODIUM_IODIDE
|
||||
//G4_STILBENE
|
||||
//G4_lAr
|
||||
//G4_PbWO4
|
||||
|
||||
//G4_PbWO4 - CMS value
|
||||
g4MatNames.push_back("G4_PbWO4");
|
||||
g4MatData.push_back(0.0333333*mm/MeV);
|
||||
|
||||
//G4_Lucite
|
||||
|
||||
nG4Birks = g4MatData.size();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LossTableManager.cc 97742 2016-06-08 09:24:54Z gcosmo $
|
||||
// $Id: G4LossTableManager.cc 99151 2016-09-07 08:03:17Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -158,7 +158,6 @@ G4LossTableManager::~G4LossTableManager()
|
||||
Clear();
|
||||
delete tableBuilder;
|
||||
delete emCorrections;
|
||||
delete emSaturation;
|
||||
delete emConfigurator;
|
||||
delete emElectronIonPair;
|
||||
delete atomDeexcitation;
|
||||
@@ -188,7 +187,6 @@ G4LossTableManager::G4LossTableManager()
|
||||
}
|
||||
tableBuilder = new G4LossTableBuilder();
|
||||
emCorrections= new G4EmCorrections(verbose);
|
||||
emSaturation = nullptr;
|
||||
emConfigurator = nullptr;
|
||||
emElectronIonPair = nullptr;
|
||||
atomDeexcitation = nullptr;
|
||||
@@ -252,7 +250,6 @@ void G4LossTableManager::ResetParameters()
|
||||
tableBuilder->SetSplineFlag(theParameters->Spline());
|
||||
tableBuilder->SetInitialisationFlag(false);
|
||||
emCorrections->SetVerbose(verbose);
|
||||
if(emSaturation) { emSaturation->SetVerbose(verbose); }
|
||||
if(emConfigurator) { emConfigurator->SetVerbose(verbose); };
|
||||
if(emElectronIonPair) { emElectronIonPair->SetVerbose(verbose); };
|
||||
if(atomDeexcitation) {
|
||||
@@ -515,7 +512,7 @@ void G4LossTableManager::LocalPhysicsTables(
|
||||
if(1 < verbose) {
|
||||
G4cout << "### G4LossTableManager::LocalPhysicsTable() for "
|
||||
<< aParticle->GetParticleName()
|
||||
<< " and process " << p->GetProcessName()
|
||||
<< " and process " << p->GetProcessName()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
@@ -530,7 +527,6 @@ void G4LossTableManager::LocalPhysicsTables(
|
||||
G4cout << "===== G4LossTableManager::LocalPhysicsTable() for run "
|
||||
<< run << " =====" << G4endl;
|
||||
}
|
||||
if(0 < verbose) { emSaturation->DumpG4BirksCoefficients(); }
|
||||
currentParticle = nullptr;
|
||||
startInitialisation = false;
|
||||
for (G4int i=0; i<n_loss; ++i) {
|
||||
@@ -968,8 +964,7 @@ G4LossTableManager::GetMultipleScatteringVector()
|
||||
|
||||
G4EmSaturation* G4LossTableManager::EmSaturation()
|
||||
{
|
||||
if(!emSaturation) { emSaturation = new G4EmSaturation(verbose); }
|
||||
return emSaturation;
|
||||
return theParameters->GetEmSaturation();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VAtomDeexcitation.cc 97432 2016-06-03 07:23:39Z gcosmo $
|
||||
// $Id: G4VAtomDeexcitation.cc 101248 2016-11-10 08:51:37Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -92,6 +92,8 @@ G4VAtomDeexcitation::~G4VAtomDeexcitation()
|
||||
|
||||
void G4VAtomDeexcitation::InitialiseAtomicDeexcitation()
|
||||
{
|
||||
theParameters->DefineRegParamForDeex(this);
|
||||
|
||||
// Define list of couples
|
||||
theCoupleTable = G4ProductionCutsTable::GetProductionCutsTable();
|
||||
G4int numOfCouples = theCoupleTable->GetTableSize();
|
||||
@@ -111,12 +113,12 @@ void G4VAtomDeexcitation::InitialiseAtomicDeexcitation()
|
||||
if(!isPIXELocked) { flagPIXE = theParameters->Pixe(); }
|
||||
ignoreCuts = theParameters->DeexcitationIgnoreCut();
|
||||
|
||||
// check if deexcitation is active for the given run
|
||||
if( !isActive ) { return; }
|
||||
|
||||
// Define list of regions
|
||||
size_t nRegions = deRegions.size();
|
||||
// check if deexcitation is active for the given run
|
||||
if(!isActive && 0 == nRegions) { return; }
|
||||
|
||||
// if no active regions add a world
|
||||
if(0 == nRegions) {
|
||||
SetDeexcitationActiveRegion("World",isActive,flagAuger,flagPIXE);
|
||||
nRegions = deRegions.size();
|
||||
@@ -195,23 +197,23 @@ G4VAtomDeexcitation::SetDeexcitationActiveRegion(const G4String& rname,
|
||||
if(rname == "DefaultRegionForParallelWorld") { return; }
|
||||
|
||||
G4String ss = rname;
|
||||
//G4cout << "### G4VAtomDeexcitation::SetDeexcitationActiveRegion " << ss
|
||||
// << " " << valDeexcitation << " " << valAuger
|
||||
// << " " << valPIXE << G4endl;
|
||||
/*
|
||||
G4cout << "### G4VAtomDeexcitation::SetDeexcitationActiveRegion " << ss
|
||||
<< " " << valDeexcitation << " " << valAuger
|
||||
<< " " << valPIXE << G4endl;
|
||||
*/
|
||||
if(ss == "world" || ss == "World" || ss == "WORLD") {
|
||||
ss = "DefaultRegionForTheWorld";
|
||||
}
|
||||
size_t n = deRegions.size();
|
||||
if(n > 0) {
|
||||
for(size_t i=0; i<n; ++i) {
|
||||
for(size_t i=0; i<n; ++i) {
|
||||
|
||||
// Region already exist
|
||||
if(ss == activeRegions[i]) {
|
||||
deRegions[i] = valDeexcitation;
|
||||
AugerRegions[i] = valAuger;
|
||||
PIXERegions[i] = valPIXE;
|
||||
return;
|
||||
}
|
||||
// Region already exist
|
||||
if(ss == activeRegions[i]) {
|
||||
deRegions[i] = valDeexcitation;
|
||||
AugerRegions[i] = valAuger;
|
||||
PIXERegions[i] = valPIXE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// New region
|
||||
@@ -220,12 +222,13 @@ G4VAtomDeexcitation::SetDeexcitationActiveRegion(const G4String& rname,
|
||||
AugerRegions.push_back(valAuger);
|
||||
PIXERegions.push_back(valPIXE);
|
||||
|
||||
// if de-excitation defined fo rthe world volume
|
||||
// it should be active everywhere
|
||||
// if de-excitation defined for the world volume
|
||||
// it should be active for all G4Regions
|
||||
if(ss == "DefaultRegionForTheWorld") {
|
||||
G4RegionStore* regions = G4RegionStore::GetInstance();
|
||||
G4int nn = regions->size();
|
||||
for(G4int i=0; i<nn; ++i) {
|
||||
if(ss == (*regions)[i]->GetName()) { continue; }
|
||||
SetDeexcitationActiveRegion((*regions)[i]->GetName(), valDeexcitation,
|
||||
valAuger, valPIXE);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmProcess.cc 96115 2016-03-16 18:53:00Z gcosmo $
|
||||
// $Id: G4VEmProcess.cc 98778 2016-08-09 14:41:08Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -111,7 +111,7 @@ G4VEmProcess::G4VEmProcess(const G4String& name, G4ProcessType type):
|
||||
|
||||
// Size of tables assuming spline
|
||||
minKinEnergy = 0.1*keV;
|
||||
maxKinEnergy = 10.0*TeV;
|
||||
maxKinEnergy = 100.0*TeV;
|
||||
nLambdaBins = 77;
|
||||
minKinEnergyPrim = DBL_MAX;
|
||||
actBinning = actSpline = actMinKinEnergy = actMaxKinEnergy = false;
|
||||
@@ -468,9 +468,10 @@ void G4VEmProcess::BuildLambdaTable()
|
||||
G4PhysicsLogVector* aVectorPrim = nullptr;
|
||||
G4PhysicsLogVector* bVectorPrim = nullptr;
|
||||
|
||||
G4double scale =
|
||||
G4Log(theParameters->MaxKinEnergy()/theParameters->MinKinEnergy());
|
||||
G4int nbin = theParameters->NumberOfBins();
|
||||
G4double scale = theParameters->MaxKinEnergy()/theParameters->MinKinEnergy();
|
||||
G4int nbin = theParameters->NumberOfBinsPerDecade()
|
||||
*G4lrint(std::log10(scale));
|
||||
scale = G4Log(scale);
|
||||
if(actBinning) { nbin = std::max(nbin, nLambdaBins); }
|
||||
G4double emax1 = std::min(maxKinEnergy, minKinEnergyPrim);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEnergyLossProcess.cc 96115 2016-03-16 18:53:00Z gcosmo $
|
||||
// $Id: G4VEnergyLossProcess.cc 98778 2016-08-09 14:41:08Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -208,7 +208,7 @@ G4VEnergyLossProcess::G4VEnergyLossProcess(const G4String& name,
|
||||
|
||||
// Size of tables assuming spline
|
||||
minKinEnergy = 0.1*keV;
|
||||
maxKinEnergy = 10.0*TeV;
|
||||
maxKinEnergy = 100.0*TeV;
|
||||
nBins = 77;
|
||||
maxKinEnergyCSDA = 1.0*GeV;
|
||||
nBinsCSDA = 35;
|
||||
@@ -528,7 +528,10 @@ G4VEnergyLossProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
|
||||
rndmStepFlag = theParameters->UseCutAsFinalRange();
|
||||
if(!actMinKinEnergy) { minKinEnergy = theParameters->MinKinEnergy(); }
|
||||
if(!actMaxKinEnergy) { maxKinEnergy = theParameters->MaxKinEnergy(); }
|
||||
if(!actBinning) { nBins = theParameters->NumberOfBins(); }
|
||||
if(!actBinning) {
|
||||
nBins = theParameters->NumberOfBinsPerDecade()
|
||||
*G4lrint(std::log10(maxKinEnergy/minKinEnergy));
|
||||
}
|
||||
maxKinEnergyCSDA = theParameters->MaxEnergyForCSDARange();
|
||||
nBinsCSDA = theParameters->NumberOfBinsPerDecade()
|
||||
*G4lrint(std::log10(maxKinEnergyCSDA/minKinEnergy));
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ionEffectiveCharge.cc 92921 2015-09-21 15:06:51Z gcosmo $
|
||||
// $Id: G4ionEffectiveCharge.cc 100363 2016-10-19 09:24:47Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -76,7 +76,7 @@ G4ionEffectiveCharge::G4ionEffectiveCharge()
|
||||
lastMat = 0;
|
||||
lastKinEnergy = 0.0;
|
||||
effCharge = eplus;
|
||||
g4pow = G4Pow::GetInstance();
|
||||
g4calc = G4Pow::GetInstance();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -149,7 +149,7 @@ G4double G4ionEffectiveCharge::EffectiveCharge(const G4ParticleDefinition* p,
|
||||
} else {
|
||||
|
||||
G4double y;
|
||||
G4double zi13 = g4pow->A13(Zi);
|
||||
G4double zi13 = g4calc->A13(Zi);
|
||||
G4double zi23 = zi13*zi13;
|
||||
|
||||
// v1 is ion velocity in vF unit
|
||||
@@ -185,7 +185,7 @@ G4double G4ionEffectiveCharge::EffectiveCharge(const G4ParticleDefinition* p,
|
||||
// J.F.Ziegler and J.M.Manoyan, The stopping of ions in compaunds,
|
||||
// Nucl. Inst. & Meth. in Phys. Res. B35 (1988) 215-228.
|
||||
|
||||
G4double lambda = 10.0 * vF *g4pow->A23(1.0 - q)/ (zi13 * (6.0 + q));
|
||||
G4double lambda = 10.0 * vF *g4calc->A23(1.0 - q)/ (zi13 * (6.0 + q));
|
||||
|
||||
G4double lambda2 = lambda*lambda;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user