Import Geant4 8.3.0 source tree
This commit is contained in:
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmCalculator.cc,v 1.35 2006/10/27 14:07:00 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4EmCalculator.cc,v 1.36 2007/03/15 12:34:47 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -53,6 +53,7 @@
|
||||
// 29.09.2006 Uncomment computation of smoothing factor (V.Ivanchenko)
|
||||
// 27.10.2006 Change test energy to access lowEnergy model from
|
||||
// 10 keV to 1 keV (V. Ivanchenko)
|
||||
// 15.03.2007 Add ComputeEnergyCutFromRangeCut methods (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -688,6 +689,29 @@ G4double G4EmCalculator::ComputeMeanFreePath(G4double kinEnergy,
|
||||
FindMaterial(material),cut);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4EmCalculator::ComputeEnergyCutFromRangeCut(
|
||||
G4double range,
|
||||
const G4ParticleDefinition* part,
|
||||
const G4Material* mat)
|
||||
{
|
||||
return G4ProductionCutsTable::GetProductionCutsTable()->
|
||||
ConvertRangeToEnergy(part, mat, range);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4EmCalculator::ComputeEnergyCutFromRangeCut(
|
||||
G4double range,
|
||||
const G4String& particle,
|
||||
const G4String& material)
|
||||
{
|
||||
return ComputeEnergyCutFromRangeCut(range,FindParticle(particle),
|
||||
FindMaterial(material));
|
||||
}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4bool G4EmCalculator::UpdateParticle(const G4ParticleDefinition* p,
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmCorrections.cc,v 1.20 2006/06/29 19:54:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4EmCorrections.cc,v 1.21 2007/05/08 17:50:06 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -41,6 +41,8 @@
|
||||
// 26.11.2005 V.Ivanchenko Fix effective charge for heavy ions using original paper
|
||||
// 28.04.2006 V.Ivanchenko General cleanup, add finite size corrections
|
||||
// 13.05.2006 V.Ivanchenko Add corrections for ion stopping
|
||||
// 08.05.2007 V.Ivanchenko Use G4IonTable for ion mass instead of NistTable to avoid
|
||||
// division by zero
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
@@ -54,6 +56,8 @@
|
||||
#include "G4EmCorrections.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4IonTable.hh"
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4Proton.hh"
|
||||
#include "G4LPhysicsFreeVector.hh"
|
||||
@@ -671,7 +675,7 @@ G4double G4EmCorrections::EffectiveChargeCorrection(const G4ParticleDefinition*
|
||||
G4int Z = p->GetAtomicNumber();
|
||||
G4int A = p->GetAtomicMass();
|
||||
if(verbose > 1) G4cout << "Zion= " << Z << " Aion= " << A << G4endl;
|
||||
massFactor = proton_mass_c2/(nist->GetIsotopeMass(Z,A)*amu_c2);
|
||||
massFactor = proton_mass_c2/G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Z,A);
|
||||
idx = 0;
|
||||
for(; idx<nIons; idx++) {
|
||||
if(Z == Zion[idx] && A == Aion[idx]) {
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmModelManager.cc,v 1.36 2006/06/29 19:55:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4EmModelManager.cc,v 1.38 2007/03/17 19:24:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -58,6 +58,7 @@
|
||||
// 29-11-05 Add protection for arithmetic operations with cut=DBL_MAX (V.Ivanchenko)
|
||||
// 20-01-06 Introduce G4EmTableType and reducing number of methods (VI)
|
||||
// 13-05-06 Add GetModel by index method (VI)
|
||||
// 15-03-07 Add maxCutInRange (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -123,6 +124,8 @@ G4EmModelManager::G4EmModelManager():
|
||||
regions.clear();
|
||||
orderOfModels.clear();
|
||||
upperEkin.clear();
|
||||
maxCutInRange = 12.*cm;
|
||||
maxSubCutInRange = 0.7*mm;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -296,8 +299,8 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
}
|
||||
}
|
||||
|
||||
const G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
G4int numOfCouples = theCoupleTable->GetTableSize();
|
||||
idxOfRegionModels = new G4int[numOfCouples+1];
|
||||
idxOfRegionModels[numOfCouples] = 0;
|
||||
@@ -399,7 +402,15 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
if( secondaryParticle == G4Positron::Positron() && cut < DBL_MAX )
|
||||
cut += (*theCoupleTable->GetEnergyCutsVector(2))[i] +
|
||||
2.0*electron_mass_c2;
|
||||
|
||||
// compute subcut
|
||||
if( cut < DBL_MAX ) subcut = minSubRange*cut;
|
||||
if(pcuts->GetProductionCut(idx) < maxCutInRange) {
|
||||
G4double tcutmax =
|
||||
theCoupleTable->ConvertRangeToEnergy(secondaryParticle,
|
||||
material,maxSubCutInRange);
|
||||
if(tcutmax < subcut) subcut = tcutmax;
|
||||
}
|
||||
}
|
||||
|
||||
G4int nm = setOfRegionModels[reg]->NumberOfModels();
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmProcessOptions.cc,v 1.18 2006/06/29 19:55:05 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4EmProcessOptions.cc,v 1.20 2007/02/12 12:31:50 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -43,6 +43,7 @@
|
||||
// 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko)
|
||||
// 10-05-06 Add command MscStepLimit to G4LossTableManager (V.Ivantchenko)
|
||||
// 22-05-06 Add SetBremsstrahlungTh (V.Ivanchenko)
|
||||
// 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -421,6 +422,27 @@ void G4EmProcessOptions::SetLPMFlag(G4bool val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EmProcessOptions::SetMscLateralDisplacement(G4bool val)
|
||||
{
|
||||
theManager->SetMscLateralDisplacement(val);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EmProcessOptions::SetLinearLossLimit(G4double val)
|
||||
{
|
||||
theManager->SetLinearLossLimit(val);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EmProcessOptions::SetSkin(G4double val)
|
||||
{
|
||||
theManager->SetSkin(val);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EmProcessOptions::SetBremsstrahlungTh(G4double val)
|
||||
{
|
||||
theManager->SetBremsstrahlungTh(val);
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EnergyLossMessenger.cc,v 1.21 2006/11/10 18:34:57 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4EnergyLossMessenger.cc,v 1.27 2007/03/17 19:24:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -41,7 +41,12 @@
|
||||
// 10-01-06 SetStepLimits -> SetStepFunction (V.Ivanchenko)
|
||||
// 10-01-06 PreciseRange -> CSDARange (V.Ivanchenko)
|
||||
// 10-05-06 Add command MscStepLimit (V.Ivanchenko)
|
||||
// 10-10-06 Ann DEDXBinning command (V.Ivanchenko)
|
||||
// 10-10-06 Add DEDXBinning command (V.Ivanchenko)
|
||||
// 07-02-07 Add MscLateralDisplacement command (V.Ivanchenko)
|
||||
// 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
|
||||
// 15-03-07 Send a message "/run/physicsModified" if reinitialisation
|
||||
// is needed after the command (V.Ivanchenko)
|
||||
// 16-03-07 modify /process/eLoss/minsubsec command (V.Ivanchenko)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -59,8 +64,10 @@
|
||||
#include "G4UIparameter.hh"
|
||||
#include "G4UIcmdWithABool.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADouble.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4EmProcessOptions.hh"
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
@@ -89,8 +96,8 @@ G4EnergyLossMessenger::G4EnergyLossMessenger()
|
||||
SubSecCmd->SetDefaultValue(true);
|
||||
SubSecCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
MinSubSecCmd = new G4UIcmdWithADoubleAndUnit("/process/eLoss/minsubsec",this);
|
||||
MinSubSecCmd->SetGuidance("Set the min. cut for subcutoff delta in range.");
|
||||
MinSubSecCmd = new G4UIcmdWithADouble("/process/eLoss/minsubsec",this);
|
||||
MinSubSecCmd->SetGuidance("Set the ratio subcut/cut ");
|
||||
MinSubSecCmd->SetParameterName("rcmin",true);
|
||||
MinSubSecCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
@@ -149,19 +156,25 @@ G4EnergyLossMessenger::G4EnergyLossMessenger()
|
||||
lpmCmd->SetDefaultValue(true);
|
||||
lpmCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
latCmd = new G4UIcmdWithABool("/process/eLoss/MscLateralDisplacement",this);
|
||||
latCmd->SetGuidance("Switch true/false sampling of latra dislacent.");
|
||||
latCmd->SetParameterName("lat",true);
|
||||
latCmd->SetDefaultValue(true);
|
||||
latCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
dedxCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsDEDX",this);
|
||||
dedxCmd->SetGuidance("Set number of bins for DEDX tables.");
|
||||
dedxCmd->SetParameterName("binsDEDX",true);
|
||||
// dedxCmd->SetParameterRange("binsDEDX>59");
|
||||
dedxCmd->SetDefaultValue(120);
|
||||
dedxCmd->AvailableForStates(G4State_PreInit);
|
||||
dedxCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
lbCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsLambda",this);
|
||||
lbCmd->SetGuidance("Set number of bins for Lambda tables.");
|
||||
lbCmd->SetParameterName("binsL",true);
|
||||
// lbCmd->SetParameterRange("binsL>59");
|
||||
lbCmd->SetDefaultValue(120);
|
||||
lbCmd->AvailableForStates(G4State_PreInit);
|
||||
lbCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
verCmd = new G4UIcmdWithAnInteger("/process/eLoss/verbose",this);
|
||||
verCmd->SetGuidance("Set verbose level for EM physics.");
|
||||
@@ -171,18 +184,26 @@ G4EnergyLossMessenger::G4EnergyLossMessenger()
|
||||
|
||||
mscCmd = new G4UIcommand("/process/eLoss/MscStepLimit",this);
|
||||
mscCmd->SetGuidance("Set msc step limit flag and facRange value.");
|
||||
|
||||
G4UIparameter* facRange = new G4UIparameter("facRange",'d',false);
|
||||
facRange->SetGuidance("msc parameter facRange");
|
||||
facRange->SetParameterRange("facRange>0.");
|
||||
mscCmd->SetParameter(facRange);
|
||||
|
||||
G4UIparameter* msc = new G4UIparameter("algMsc",'s',true);
|
||||
msc->SetGuidance("msc step algorithm flag");
|
||||
msc->SetDefaultValue("true");
|
||||
mscCmd->SetParameter(msc);
|
||||
|
||||
mscCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
lllCmd = new G4UIcmdWithADouble("/process/eLoss/linLossLimit",this);
|
||||
lllCmd->SetGuidance("Set linearLossLimit parameter.");
|
||||
lllCmd->SetParameterName("linlim",true);
|
||||
lllCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
skinCmd = new G4UIcmdWithADouble("/process/eLoss/MscSkin",this);
|
||||
skinCmd->SetGuidance("Set skin parameter for multiple scattering.");
|
||||
skinCmd->SetParameterName("skin",true);
|
||||
skinCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -200,10 +221,13 @@ G4EnergyLossMessenger::~G4EnergyLossMessenger()
|
||||
delete IntegCmd;
|
||||
delete rangeCmd;
|
||||
delete lpmCmd;
|
||||
delete latCmd;
|
||||
delete verCmd;
|
||||
delete mscCmd;
|
||||
delete dedxCmd;
|
||||
delete lbCmd;
|
||||
delete lllCmd;
|
||||
delete skinCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -211,73 +235,95 @@ G4EnergyLossMessenger::~G4EnergyLossMessenger()
|
||||
void G4EnergyLossMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
G4LossTableManager* lossTables = G4LossTableManager::Instance();
|
||||
if (command == RndmStepCmd)
|
||||
{ G4VEnergyLoss::SetRndmStep(RndmStepCmd->GetNewBoolValue(newValue));
|
||||
lossTables->SetRandomStep(RndmStepCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
|
||||
if (command == RndmStepCmd) {
|
||||
G4VEnergyLoss::SetRndmStep(RndmStepCmd->GetNewBoolValue(newValue));
|
||||
lossTables->SetRandomStep(RndmStepCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
|
||||
if (command == EnlossFlucCmd)
|
||||
{ G4VEnergyLoss::SetEnlossFluc(EnlossFlucCmd->GetNewBoolValue(newValue));
|
||||
lossTables->SetLossFluctuations(EnlossFlucCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
if (command == EnlossFlucCmd) {
|
||||
G4VEnergyLoss::SetEnlossFluc(EnlossFlucCmd->GetNewBoolValue(newValue));
|
||||
lossTables->SetLossFluctuations(EnlossFlucCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
|
||||
if (command == SubSecCmd)
|
||||
{ G4VEnergyLoss::SetSubSec(SubSecCmd->GetNewBoolValue(newValue));
|
||||
lossTables->SetSubCutoff(SubSecCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
if (command == SubSecCmd) {
|
||||
G4VEnergyLoss::SetSubSec(SubSecCmd->GetNewBoolValue(newValue));
|
||||
lossTables->SetSubCutoff(SubSecCmd->GetNewBoolValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
|
||||
if (command == MinSubSecCmd)
|
||||
{ G4VEnergyLoss::SetMinDeltaCutInRange(
|
||||
MinSubSecCmd->GetNewDoubleValue(newValue));
|
||||
}
|
||||
if (command == MinSubSecCmd) {
|
||||
lossTables->SetMinSubRange(MinSubSecCmd->GetNewDoubleValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
|
||||
if (command == StepFuncCmd)
|
||||
{
|
||||
G4double v1,v2;
|
||||
G4String unt;
|
||||
std::istringstream is(newValue);
|
||||
is >> v1 >> v2 >> unt;
|
||||
v2 *= G4UIcommand::ValueOf(unt);
|
||||
G4VEnergyLoss::SetStepFunction(v1,v2);
|
||||
lossTables->SetStepFunction(v1,v2);
|
||||
}
|
||||
if (command == StepFuncCmd) {
|
||||
G4double v1,v2;
|
||||
G4String unt;
|
||||
std::istringstream is(newValue);
|
||||
is >> v1 >> v2 >> unt;
|
||||
v2 *= G4UIcommand::ValueOf(unt);
|
||||
G4VEnergyLoss::SetStepFunction(v1,v2);
|
||||
lossTables->SetStepFunction(v1,v2);
|
||||
}
|
||||
|
||||
if (command == mscCmd)
|
||||
{
|
||||
G4double f;
|
||||
G4bool a = true;
|
||||
G4String s;
|
||||
std::istringstream is(newValue);
|
||||
is >> f >> s;
|
||||
if(s == "false" || s == "0" || s == "no") a = false;
|
||||
lossTables->SetMscStepLimitation(a,f);
|
||||
}
|
||||
if (command == mscCmd) {
|
||||
G4double f;
|
||||
G4bool a = true;
|
||||
G4String s;
|
||||
std::istringstream is(newValue);
|
||||
is >> f >> s;
|
||||
if(s == "false" || s == "0" || s == "no") a = false;
|
||||
lossTables->SetMscStepLimitation(a,f);
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
|
||||
if (command == MinEnCmd) {
|
||||
lossTables->SetMinEnergy(MinEnCmd->GetNewDoubleValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
|
||||
if (command == MaxEnCmd) {
|
||||
if (command == MaxEnCmd) {
|
||||
lossTables->SetMaxEnergy(MaxEnCmd->GetNewDoubleValue(newValue));
|
||||
}
|
||||
if (command == IntegCmd) {
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
|
||||
if (command == IntegCmd)
|
||||
lossTables->SetIntegral(IntegCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
if (command == rangeCmd) {
|
||||
|
||||
if (command == rangeCmd)
|
||||
lossTables->SetBuildCSDARange(rangeCmd->GetNewBoolValue(newValue));
|
||||
}
|
||||
|
||||
if (command == lpmCmd) {
|
||||
lossTables->SetLPMFlag(lpmCmd->GetNewBoolValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
if (command == verCmd) {
|
||||
|
||||
if (command == latCmd) {
|
||||
lossTables->SetMscLateralDisplacement(latCmd->GetNewBoolValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
|
||||
if (command == verCmd)
|
||||
lossTables->SetVerbose(verCmd->GetNewIntValue(newValue));
|
||||
}
|
||||
|
||||
if (command == lllCmd)
|
||||
lossTables->SetLinearLossLimit(lllCmd->GetNewDoubleValue(newValue));
|
||||
|
||||
if (command == skinCmd) {
|
||||
lossTables->SetSkin(skinCmd->GetNewDoubleValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
|
||||
G4EmProcessOptions opt;
|
||||
if (command == dedxCmd) {
|
||||
opt.SetDEDXBinning(verCmd->GetNewIntValue(newValue));
|
||||
if (command == dedxCmd) {
|
||||
opt.SetDEDXBinning(dedxCmd->GetNewIntValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
|
||||
if (command == lbCmd) {
|
||||
opt.SetDEDXBinning(verCmd->GetNewIntValue(newValue));
|
||||
opt.SetDEDXBinning(lbCmd->GetNewIntValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LossTableBuilder.cc,v 1.20 2006/06/29 19:55:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4LossTableBuilder.cc,v 1.24 2007/02/16 11:59:35 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -41,9 +41,11 @@
|
||||
//
|
||||
// 23-01-03 V.Ivanchenko Cut per region
|
||||
// 21-07-04 V.Ivanchenko Fix problem of range for dedx=0
|
||||
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
|
||||
// 07-12-04 Fix of BuildDEDX table (V.Ivantchenko)
|
||||
// 27-03-06 Add bool options isIonisation (V.Ivantchenko)
|
||||
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko)
|
||||
// 07-12-04 Fix of BuildDEDX table (V.Ivanchenko)
|
||||
// 27-03-06 Add bool options isIonisation (V.Ivanchenko)
|
||||
// 16-01-07 Fill new (not old) DEDX table (V.Ivanchenko)
|
||||
// 12-02-07 Use G4LPhysicsFreeVector for the inverse range table (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -56,6 +58,7 @@
|
||||
#include "G4PhysicsTable.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4PhysicsTableHelper.hh"
|
||||
#include "G4LPhysicsFreeVector.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -75,16 +78,18 @@ void G4LossTableBuilder::BuildDEDXTable(G4PhysicsTable* dedxTable,
|
||||
size_t n_processes = list.size();
|
||||
if(1 >= n_processes) return;
|
||||
|
||||
size_t n_vectors = dedxTable->length();
|
||||
size_t n_vectors = (list[0])->length();
|
||||
if(0 >= n_vectors) return;
|
||||
|
||||
G4bool b;
|
||||
|
||||
G4PhysicsVector* pv = (*(list[0]))[0];
|
||||
size_t nbins = pv->GetVectorLength();
|
||||
G4double elow = pv->GetLowEdgeEnergy(0);
|
||||
G4double ehigh = pv->GetLowEdgeEnergy(nbins);
|
||||
for (size_t i=0; i<n_vectors; i++) {
|
||||
|
||||
G4PhysicsVector* pv = (*dedxTable)[i];
|
||||
size_t nbins = pv->GetVectorLength();
|
||||
|
||||
pv = new G4PhysicsLogVector(elow, ehigh, nbins);
|
||||
for (size_t j=0; j<nbins; j++) {
|
||||
G4double dedx = 0.0;
|
||||
G4double energy = pv->GetLowEdgeEnergy(j);
|
||||
@@ -93,6 +98,7 @@ void G4LossTableBuilder::BuildDEDXTable(G4PhysicsTable* dedxTable,
|
||||
dedx += ((*(list[k]))[i])->GetValue(energy, b);
|
||||
}
|
||||
pv->PutValue(j, dedx);
|
||||
G4PhysicsTableHelper::SetPhysicsVector(dedxTable, i, pv);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,7 +151,8 @@ void G4LossTableBuilder::BuildRangeTable(const G4PhysicsTable* dedxTable,
|
||||
G4double de = (energy2 - energy1) * del;
|
||||
G4double energy = energy1 - de*0.5;
|
||||
|
||||
G4bool yes = true;
|
||||
G4bool yes = true;
|
||||
//G4bool yes = false;
|
||||
if(dedx1 < DBL_MIN || dedx2 < DBL_MIN) yes = false;
|
||||
|
||||
G4double fac, f;
|
||||
@@ -159,6 +166,7 @@ void G4LossTableBuilder::BuildRangeTable(const G4PhysicsTable* dedxTable,
|
||||
else f = dedx1 + fac*(energy - energy1);
|
||||
if(f > DBL_MIN) range += de/f;
|
||||
}
|
||||
// G4cout << "Range i= " <<i << " j= " << j << G4endl;
|
||||
v->PutValue(j,range);
|
||||
energy1 = energy2;
|
||||
dedx1 = dedx2;
|
||||
@@ -191,36 +199,14 @@ void G4LossTableBuilder::BuildInverseRangeTable(const G4PhysicsTable* rangeTable
|
||||
|
||||
rhigh *= std::exp(std::log(rhigh/rlow)/((G4double)(nbins-1)));
|
||||
|
||||
G4PhysicsLogVector* v = new G4PhysicsLogVector(rlow, rhigh, nbins);
|
||||
|
||||
v->PutValue(0,elow);
|
||||
G4double energy1 = elow;
|
||||
G4double range1 = rlow;
|
||||
G4double energy2 = elow;
|
||||
G4double range2 = rlow;
|
||||
size_t ilow = 0;
|
||||
size_t ihigh;
|
||||
|
||||
for (size_t j=1; j<nbins; j++) {
|
||||
|
||||
G4double range = v->GetLowEdgeEnergy(j);
|
||||
|
||||
for (ihigh=ilow+1; ihigh<nbins; ihigh++) {
|
||||
energy2 = pv->GetLowEdgeEnergy(ihigh);
|
||||
range2 = pv->GetValue(energy2, b);
|
||||
if(range2 >= range || ihigh == nbins-1) {
|
||||
ilow = ihigh - 1;
|
||||
energy1 = pv->GetLowEdgeEnergy(ilow);
|
||||
range1 = pv->GetValue(energy1, b);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
G4double e = std::log(energy1) +
|
||||
std::log(energy2/energy1)*std::log(range/range1)/std::log(range2/range1);
|
||||
|
||||
v->PutValue(j,std::exp(e));
|
||||
|
||||
G4LPhysicsFreeVector* v = new G4LPhysicsFreeVector(nbins,rlow,rhigh);
|
||||
for (size_t j=0; j<nbins; j++) {
|
||||
G4double e = pv->GetLowEdgeEnergy(j);
|
||||
G4double r = pv->GetValue(e, b);
|
||||
v->PutValues(j,r,e);
|
||||
}
|
||||
|
||||
G4PhysicsTableHelper::SetPhysicsVector(invRangeTable, i, v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LossTableManager.cc,v 1.75 2006/12/13 15:44:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4LossTableManager.cc,v 1.82 2007/03/17 19:24:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -65,6 +65,9 @@
|
||||
// 10-05-06 Add methods SetMscStepLimitation, FacRange and MscFlag (VI)
|
||||
// 22-05-06 Add methods Set/Get bremsTh (VI)
|
||||
// 05-06-06 Do not clear loss_table map between runs (VI)
|
||||
// 16-01-07 Create new energy loss table for e+,e-,mu+,mu- and
|
||||
// left ionisation table for further usage (VI)
|
||||
// 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -127,7 +130,8 @@ G4LossTableManager::~G4LossTableManager()
|
||||
G4LossTableManager::G4LossTableManager()
|
||||
{
|
||||
n_loss = 0;
|
||||
first_entry = true;
|
||||
run = 0;
|
||||
// first_entry = true;
|
||||
all_tables_are_built = false;
|
||||
all_tables_are_stored = false;
|
||||
currentLoss = 0;
|
||||
@@ -154,6 +158,7 @@ G4LossTableManager::G4LossTableManager()
|
||||
stepFunctionActive = false;
|
||||
flagLPM = true;
|
||||
flagMSC = true;
|
||||
flagMSCLateral = true;
|
||||
facRange = 0.02;
|
||||
bremsTh = DBL_MAX;
|
||||
mscActive = false;
|
||||
@@ -289,7 +294,7 @@ void G4LossTableManager::EnergyLossProcessIsInitialised(
|
||||
const G4ParticleDefinition* particle,
|
||||
G4VEnergyLossProcess* p)
|
||||
{
|
||||
if (first_entry || (particle == firstParticle && all_tables_are_built) ) {
|
||||
if (run == 0 || (particle == firstParticle && all_tables_are_built) ) {
|
||||
all_tables_are_built = true;
|
||||
|
||||
if(1 < verbose)
|
||||
@@ -303,6 +308,8 @@ void G4LossTableManager::EnergyLossProcessIsInitialised(
|
||||
isActive[i] = pm->GetProcessActivation(el);
|
||||
tables_are_built[i] = false;
|
||||
all_tables_are_built = false;
|
||||
if(!isActive[i]) el->SetIonisation(false);
|
||||
|
||||
if(1 < verbose) {
|
||||
G4cout << i <<". "<< el->GetProcessName()
|
||||
<< " for " << pm->GetParticleType()->GetParticleName()
|
||||
@@ -316,13 +323,10 @@ void G4LossTableManager::EnergyLossProcessIsInitialised(
|
||||
part_vector[i] = 0;
|
||||
}
|
||||
}
|
||||
if (first_entry) {
|
||||
first_entry = false;
|
||||
firstParticle = particle;
|
||||
}
|
||||
if (0 == run) firstParticle = particle;
|
||||
run++;
|
||||
}
|
||||
|
||||
// if(!all_tables_are_built) loss_map.clear();
|
||||
currentParticle = 0;
|
||||
|
||||
SetParameters(p);
|
||||
@@ -428,9 +432,9 @@ void G4LossTableManager::CopyTables(const G4ParticleDefinition* part,
|
||||
|
||||
if (!tables_are_built[j] && part == base_part_vector[j]) {
|
||||
tables_are_built[j] = true;
|
||||
proc->SetDEDXTable(base_proc->DEDXTable());
|
||||
proc->SetDEDXTableForSubsec(base_proc->DEDXTableForSubsec());
|
||||
proc->SetDEDXunRestrictedTable(base_proc->DEDXunRestrictedTable());
|
||||
proc->SetDEDXTable(base_proc->DEDXTable(),fRestricted);
|
||||
proc->SetDEDXTable(base_proc->DEDXTableForSubsec(),fSubRestricted);
|
||||
proc->SetDEDXTable(base_proc->DEDXunRestrictedTable(),fTotal);
|
||||
proc->SetCSDARangeTable(base_proc->CSDARangeTable());
|
||||
proc->SetRangeTableForLoss(base_proc->RangeTableForLoss());
|
||||
proc->SetInverseRangeTable(base_proc->InverseRangeTable());
|
||||
@@ -462,7 +466,7 @@ G4VEnergyLossProcess* G4LossTableManager::BuildTables(
|
||||
<< aParticle->GetParticleName() << G4endl;
|
||||
}
|
||||
|
||||
std::vector<G4PhysicsTable*> list;
|
||||
std::vector<G4PhysicsTable*> t_list;
|
||||
std::vector<G4VEnergyLossProcess*> loss_list;
|
||||
loss_list.clear();
|
||||
G4VEnergyLossProcess* em = 0;
|
||||
@@ -474,19 +478,21 @@ G4VEnergyLossProcess* G4LossTableManager::BuildTables(
|
||||
for (i=0; i<n_loss; i++) {
|
||||
p = loss_vector[i];
|
||||
if (p && aParticle == part_vector[i] && !tables_are_built[i]) {
|
||||
if (p->IsIonisationProcess() && isActive[i] || !em || em && !isActive[iem] ) {
|
||||
if (p->IsIonisationProcess() && isActive[i] || !em || (em && !isActive[iem]) ) {
|
||||
em = p;
|
||||
iem= i;
|
||||
}
|
||||
dedx = p->BuildDEDXTable(fRestricted);
|
||||
p->SetDEDXTable(dedx);
|
||||
list.push_back(dedx);
|
||||
// G4cout << "Build DEDX table for " << aParticle->GetParticleName()
|
||||
// << " " << dedx << " " << dedx->length() << G4endl;
|
||||
p->SetDEDXTable(dedx,fRestricted);
|
||||
t_list.push_back(dedx);
|
||||
loss_list.push_back(p);
|
||||
tables_are_built[i] = true;
|
||||
}
|
||||
}
|
||||
|
||||
G4int n_dedx = list.size();
|
||||
G4int n_dedx = t_list.size();
|
||||
if (!n_dedx) {
|
||||
G4cout << "G4LossTableManager WARNING: no DEDX processes for "
|
||||
<< aParticle->GetParticleName() << G4endl;
|
||||
@@ -503,8 +509,14 @@ G4VEnergyLossProcess* G4LossTableManager::BuildTables(
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
dedx = em->DEDXTable();
|
||||
if (1 < n_dedx) tableBuilder->BuildDEDXTable(dedx, list);
|
||||
dedx = em->IonisationTable();
|
||||
if (1 < n_dedx) {
|
||||
em->SetDEDXTable(dedx, fIonisation);
|
||||
dedx = 0;
|
||||
dedx = G4PhysicsTableHelper::PreparePhysicsTable(dedx);
|
||||
tableBuilder->BuildDEDXTable(dedx, t_list);
|
||||
em->SetDEDXTable(dedx, fRestricted);
|
||||
}
|
||||
dedx_vector[iem] = dedx;
|
||||
|
||||
G4PhysicsTable* range = em->RangeTableForLoss();
|
||||
@@ -524,7 +536,7 @@ G4VEnergyLossProcess* G4LossTableManager::BuildTables(
|
||||
em->SetRangeTableForLoss(range);
|
||||
em->SetInverseRangeTable(invrange);
|
||||
|
||||
if(1<verbose) G4cout << *range << G4endl;
|
||||
// if(1<verbose) G4cout << *range << G4endl;
|
||||
|
||||
std::vector<G4PhysicsTable*> listSub;
|
||||
std::vector<G4PhysicsTable*> listCSDA;
|
||||
@@ -533,36 +545,47 @@ G4VEnergyLossProcess* G4LossTableManager::BuildTables(
|
||||
p = loss_list[i];
|
||||
p->SetIonisation(false);
|
||||
p->SetLambdaTable(p->BuildLambdaTable(fRestricted));
|
||||
if (0 < p->NumberOfSubCutoffRegions()) {
|
||||
if (0 < nSubRegions) {
|
||||
dedx = p->BuildDEDXTable(fSubRestricted);
|
||||
p->SetDEDXTableForSubsec(dedx);
|
||||
p->SetDEDXTable(dedx,fSubRestricted);
|
||||
listSub.push_back(dedx);
|
||||
p->SetSubLambdaTable(p->BuildLambdaTable(fSubRestricted));
|
||||
if(p != em) em->AddCollaborativeProcess(p);
|
||||
}
|
||||
if(buildCSDARange) {
|
||||
dedx = p->BuildDEDXTable(fTotal);
|
||||
p->SetDEDXunRestrictedTable(dedx);
|
||||
p->SetDEDXTable(dedx,fTotal);
|
||||
listCSDA.push_back(dedx);
|
||||
}
|
||||
}
|
||||
|
||||
if (0 < nSubRegions) {
|
||||
G4PhysicsTable* dedxSub = em->DEDXTableForSubsec();
|
||||
if (1 < listSub.size()) tableBuilder->BuildDEDXTable(dedxSub, listSub);
|
||||
em->SetDEDXTableForSubsec(dedxSub);
|
||||
G4PhysicsTable* dedxSub = em->IonisationTableForSubsec();
|
||||
if (1 < listSub.size()) {
|
||||
em->SetDEDXTable(dedxSub, fSubIonisation);
|
||||
dedxSub = 0;
|
||||
dedxSub = G4PhysicsTableHelper::PreparePhysicsTable(dedxSub);
|
||||
tableBuilder->BuildDEDXTable(dedxSub, listSub);
|
||||
em->SetDEDXTable(dedxSub, fSubRestricted);
|
||||
}
|
||||
}
|
||||
if(buildCSDARange) {
|
||||
G4PhysicsTable* dedxCSDA = em->DEDXunRestrictedTable();
|
||||
if (1 < n_dedx) tableBuilder->BuildDEDXTable(dedxCSDA, listCSDA);
|
||||
em->SetDEDXunRestrictedTable(dedxCSDA);
|
||||
if (1 < n_dedx) {
|
||||
dedxCSDA = 0;
|
||||
dedxCSDA = G4PhysicsTableHelper::PreparePhysicsTable(dedxCSDA);
|
||||
tableBuilder->BuildDEDXTable(dedxCSDA, listCSDA);
|
||||
em->SetDEDXTable(dedxCSDA,fTotal);
|
||||
}
|
||||
G4PhysicsTable* rCSDA = em->CSDARangeTable();
|
||||
if(!rCSDA) range = G4PhysicsTableHelper::PreparePhysicsTable(rCSDA);
|
||||
if(!rCSDA) rCSDA = G4PhysicsTableHelper::PreparePhysicsTable(rCSDA);
|
||||
tableBuilder->BuildRangeTable(dedxCSDA, rCSDA, flag);
|
||||
em->SetCSDARangeTable(rCSDA);
|
||||
}
|
||||
|
||||
em->SetIonisation(true);
|
||||
loss_map[aParticle] = em;
|
||||
|
||||
if (1 < verbose) {
|
||||
G4cout << "G4LossTableManager::BuildTables: Tables are built for "
|
||||
<< aParticle->GetParticleName()
|
||||
@@ -750,6 +773,15 @@ void G4LossTableManager::SetStepFunction(G4double v1, G4double v2)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void G4LossTableManager::SetLinearLossLimit(G4double val)
|
||||
{
|
||||
for(G4int i=0; i<n_loss; i++) {
|
||||
if(loss_vector[i]) loss_vector[i]->SetLinearLossLimit(val);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void G4LossTableManager::SetBuildCSDARange(G4bool val)
|
||||
{
|
||||
buildCSDARange = val;
|
||||
@@ -798,11 +830,40 @@ void G4LossTableManager::SetLPMFlag(G4bool val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void G4LossTableManager::SetMscLateralDisplacement(G4bool val)
|
||||
{
|
||||
flagMSCLateral = val;
|
||||
size_t msc = msc_vector.size();
|
||||
for (size_t j=0; j<msc; j++) {
|
||||
if(msc_vector[j]) msc_vector[j]->SetLateralDisplasmentFlag(val);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
void G4LossTableManager::SetSkin(G4double val)
|
||||
{
|
||||
if(val < 0.0) return;
|
||||
size_t msc = msc_vector.size();
|
||||
for (size_t j=0; j<msc; j++) {
|
||||
if(msc_vector[j]) msc_vector[j]->SetSkin(val);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
G4bool G4LossTableManager::LPMFlag() const
|
||||
{
|
||||
return flagLPM;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
G4bool G4LossTableManager::MscLateralDisplacementFlag() const
|
||||
{
|
||||
return flagMSCLateral;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4LossTableManager::SetMscStepLimitation(G4bool val, G4double factor)
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEnergyLossProcess.cc,v 1.90 2006/06/29 19:55:23 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VEnergyLossProcess.cc,v 1.102 2007/05/08 17:52:00 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -98,6 +98,10 @@
|
||||
// 22-03-06 Add control on warning printout AlongStep (VI)
|
||||
// 23-03-06 Use isIonisation flag (V.Ivanchenko)
|
||||
// 07-06-06 Do not reflect AlongStep in subcutoff regime (V.Ivanchenko)
|
||||
// 14-01-07 add SetEmModel(index) and SetFluctModel() (mma)
|
||||
// 16-01-07 add IonisationTable and IonisationSubTable (V.Ivanchenko)
|
||||
// 16-02-07 set linLossLimit=1.e-6 (V.Ivanchenko)
|
||||
// 13-03-07 use SafetyHelper instead of navigator (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -131,7 +135,7 @@
|
||||
#include "G4Region.hh"
|
||||
#include "G4RegionStore.hh"
|
||||
#include "G4PhysicsTableHelper.hh"
|
||||
#include "G4Navigator.hh"
|
||||
#include "G4SafetyHelper.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -144,6 +148,8 @@ G4VEnergyLossProcess::G4VEnergyLossProcess(const G4String& name,
|
||||
theDEDXTable(0),
|
||||
theDEDXSubTable(0),
|
||||
theDEDXunRestrictedTable(0),
|
||||
theIonisationTable(0),
|
||||
theIonisationSubTable(0),
|
||||
theRangeTableForLoss(0),
|
||||
theCSDARangeTable(0),
|
||||
theSecondaryRangeTable(0),
|
||||
@@ -190,11 +196,13 @@ G4VEnergyLossProcess::G4VEnergyLossProcess(const G4String& name,
|
||||
|
||||
modelManager = new G4EmModelManager();
|
||||
(G4LossTableManager::Instance())->Register(this);
|
||||
emModel[0]=emModel[1]=emModel[2]=emModel[3]=emModel[4]=0;
|
||||
fluctModel = 0;
|
||||
scoffRegions.clear();
|
||||
scProcesses.clear();
|
||||
|
||||
navigator = (G4TransportationManager::GetTransportationManager())
|
||||
->GetNavigatorForTracking();
|
||||
safetyHelper = new G4SafetyHelper();
|
||||
|
||||
const G4int n = 7;
|
||||
vstrag = new G4PhysicsLogVector(keV, GeV, n);
|
||||
G4double s[n] = {-0.2, -0.85, -1.3, -1.578, -1.76, -1.85, -1.9};
|
||||
@@ -206,6 +214,7 @@ G4VEnergyLossProcess::G4VEnergyLossProcess(const G4String& name,
|
||||
G4VEnergyLossProcess::~G4VEnergyLossProcess()
|
||||
{
|
||||
delete vstrag;
|
||||
delete safetyHelper;
|
||||
Clear();
|
||||
|
||||
if ( !baseParticle ) {
|
||||
@@ -213,6 +222,8 @@ G4VEnergyLossProcess::~G4VEnergyLossProcess()
|
||||
theDEDXTable->clearAndDestroy();
|
||||
if(theDEDXSubTable) theDEDXSubTable->clearAndDestroy();
|
||||
}
|
||||
if(theIonisationTable) theIonisationTable->clearAndDestroy();
|
||||
if(theIonisationSubTable) theIonisationSubTable->clearAndDestroy();
|
||||
if(theDEDXunRestrictedTable && theCSDARangeTable)
|
||||
theDEDXunRestrictedTable->clearAndDestroy();
|
||||
if(theCSDARangeTable) theCSDARangeTable->clearAndDestroy();
|
||||
@@ -334,6 +345,9 @@ void G4VEnergyLossProcess::PreparePhysicsTable(
|
||||
minSubRange, verboseLevel);
|
||||
|
||||
// Sub Cutoff Regime
|
||||
scProcesses.clear();
|
||||
nProcesses = 0;
|
||||
|
||||
if (nSCoffRegions>0) {
|
||||
theSubCuts = modelManager->SubCutoff();
|
||||
|
||||
@@ -402,6 +416,34 @@ void G4VEnergyLossProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEnergyLossProcess::SetEmModel(G4VEmModel* p, G4int index)
|
||||
{
|
||||
emModel[index] = p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4VEmModel* G4VEnergyLossProcess::EmModel(G4int index)
|
||||
{
|
||||
return emModel[index];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p)
|
||||
{
|
||||
fluctModel = p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel()
|
||||
{
|
||||
return fluctModel;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p,
|
||||
G4VEmFluctuationModel* fluc,
|
||||
const G4Region* region)
|
||||
@@ -463,8 +505,15 @@ G4PhysicsTable* G4VEnergyLossProcess::BuildDEDXTable(G4EmTableType tType)
|
||||
table = theDEDXunRestrictedTable;
|
||||
} else if(fRestricted == tType) {
|
||||
table = theDEDXTable;
|
||||
if(theIonisationTable)
|
||||
table = G4PhysicsTableHelper::PreparePhysicsTable(theIonisationTable);
|
||||
} else if(fSubRestricted == tType) {
|
||||
table = theDEDXSubTable;
|
||||
if(theIonisationSubTable)
|
||||
table = G4PhysicsTableHelper::PreparePhysicsTable(theIonisationSubTable);
|
||||
} else {
|
||||
G4cout << "G4VEnergyLossProcess::BuildDEDXTable WARNING: wrong type "
|
||||
<< tType << G4endl;
|
||||
}
|
||||
|
||||
// Access to materials
|
||||
@@ -484,7 +533,7 @@ G4PhysicsTable* G4VEnergyLossProcess::BuildDEDXTable(G4EmTableType tType)
|
||||
|
||||
for(size_t i=0; i<numOfCouples; i++) {
|
||||
|
||||
if(2 < verboseLevel)
|
||||
if(1 < verboseLevel)
|
||||
G4cout << "G4VEnergyLossProcess::BuildDEDXVector flag= "
|
||||
<< table->GetFlag(i) << G4endl;
|
||||
|
||||
@@ -504,6 +553,7 @@ G4PhysicsTable* G4VEnergyLossProcess::BuildDEDXTable(G4EmTableType tType)
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4VEnergyLossProcess::BuildDEDXTable(): table is built for "
|
||||
<< particle->GetParticleName()
|
||||
<< " and process " << GetProcessName()
|
||||
<< G4endl;
|
||||
// if(2 < verboseLevel) G4cout << (*table) << G4endl;
|
||||
}
|
||||
@@ -521,6 +571,9 @@ G4PhysicsTable* G4VEnergyLossProcess::BuildLambdaTable(G4EmTableType tType)
|
||||
table = theLambdaTable;
|
||||
} else if(fSubRestricted == tType) {
|
||||
table = theSubLambdaTable;
|
||||
} else {
|
||||
G4cout << "G4VEnergyLossProcess::BuildLambdaTable WARNING: wrong type "
|
||||
<< tType << G4endl;
|
||||
}
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
@@ -576,9 +629,10 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
|
||||
// Get the actual (true) Step length
|
||||
G4double length = step.GetStepLength();
|
||||
if(length == 0.0) return &fParticleChange;
|
||||
G4double eloss = 0.0;
|
||||
|
||||
/*
|
||||
/*
|
||||
if(-1 < verboseLevel) {
|
||||
const G4ParticleDefinition* d = track.GetDefinition();
|
||||
G4cout << "AlongStepDoIt for "
|
||||
@@ -634,7 +688,7 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
|
||||
const G4DynamicParticle* dynParticle = track.GetDynamicParticle();
|
||||
G4VEmModel* currentModel = SelectModel(preStepScaledEnergy);
|
||||
/*
|
||||
/*
|
||||
G4double eloss0 = eloss;
|
||||
if(-1 < verboseLevel ) {
|
||||
G4cout << "Before fluct: eloss(MeV)= " << eloss/MeV
|
||||
@@ -644,22 +698,46 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
<< " fluct= " << lossFluctuationFlag
|
||||
<< G4endl;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
G4double cut = (*theCuts)[currentMaterialIndex];
|
||||
G4double esec = 0.0;
|
||||
G4double esecdep = 0.0;
|
||||
|
||||
// SubCutOff
|
||||
if(useSubCutoff) {
|
||||
if(idxSCoffRegions[currentMaterialIndex]) {
|
||||
|
||||
G4double preSafety = step.GetPreStepPoint()->GetSafety();
|
||||
G4double currentMinSafety = 0.0;
|
||||
G4StepPoint* prePoint = step.GetPreStepPoint();
|
||||
G4StepPoint* postPoint = step.GetPostStepPoint();
|
||||
G4double preSafety = prePoint->GetSafety();
|
||||
G4double postSafety = preSafety - length;
|
||||
G4double rcut = currentCouple->GetProductionCuts()->GetProductionCut(1);
|
||||
if(preSafety < rcut) preSafety =
|
||||
navigator->ComputeSafety(step.GetPreStepPoint()->GetPosition());
|
||||
if(preSafety - length < rcut) {
|
||||
G4double postSafety =
|
||||
navigator->ComputeSafety(step.GetPostStepPoint()->GetPosition());
|
||||
|
||||
// recompute safety
|
||||
if(prePoint->GetStepStatus() != fGeomBoundary &&
|
||||
postPoint->GetStepStatus() != fGeomBoundary) {
|
||||
|
||||
/*
|
||||
// G4bool yes = (track.GetTrackID() == 5512);
|
||||
G4bool yes = false;
|
||||
if(yes)
|
||||
G4cout << "G4VEnergyLoss: presafety= " << preSafety
|
||||
<< " rcut= " << rcut << " length= " << length
|
||||
<< " dir " << track.GetMomentumDirection()
|
||||
<< G4endl;
|
||||
*/
|
||||
|
||||
if(preSafety < rcut)
|
||||
preSafety = safetyHelper->ComputeSafety(prePoint->GetPosition());
|
||||
|
||||
//if(yes) {
|
||||
// G4cout << "G4VEnergyLoss: newsafety= " << preSafety << G4endl;
|
||||
// if(preSafety==0.0 && track.GetTrackID() == 5512 ) exit(1);
|
||||
//}
|
||||
if(postSafety < rcut)
|
||||
postSafety = safetyHelper->ComputeSafety(postPoint->GetPosition());
|
||||
/*
|
||||
if(-1 < verboseLevel)
|
||||
G4cout << "Subcutoff: presafety(mm)= " << preSafety/mm
|
||||
@@ -667,33 +745,57 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
<< " rcut(mm)= " << rcut/mm
|
||||
<< G4endl;
|
||||
*/
|
||||
if(preSafety < rcut || postSafety < rcut) {
|
||||
currentMinSafety = std::min(preSafety,postSafety);
|
||||
}
|
||||
|
||||
eloss -= GetSubDEDXForScaledEnergy(preStepScaledEnergy)*length;
|
||||
if(eloss < 0.0) eloss = 0.0;
|
||||
SampleSubCutSecondaries(scTracks, step, cut, currentModel);
|
||||
if(nProcesses) {
|
||||
for(G4int i=0; i<nProcesses; i++) {
|
||||
(scProcesses[i])->SampleSubCutSecondaries(scTracks, step, rcut,
|
||||
(scProcesses[i])->SelectModelForMaterial(
|
||||
preStepKinEnergy, currentMaterialIndex));
|
||||
}
|
||||
}
|
||||
G4int n = scTracks.size();
|
||||
if(n) {
|
||||
G4ThreeVector mom = dynParticle->GetMomentum();
|
||||
fParticleChange.SetNumberOfSecondaries(n);
|
||||
for(G4int i=0; i<n; i++) {
|
||||
G4Track* t = scTracks[i];
|
||||
G4double e = t->GetKineticEnergy();
|
||||
if (t->GetDefinition() == thePositron) e += 2.0*electron_mass_c2;
|
||||
esec += e;
|
||||
pParticleChange->AddSecondary(t);
|
||||
mom -= t->GetMomentum();
|
||||
}
|
||||
scTracks.clear();
|
||||
// fParticleChange.SetProposedMomentum(mom);
|
||||
// Decide to start subcut sampling
|
||||
if(currentMinSafety < rcut) {
|
||||
|
||||
cut = (*theSubCuts)[currentMaterialIndex];
|
||||
eloss -= GetSubDEDXForScaledEnergy(preStepScaledEnergy)*length;
|
||||
if(eloss < 0.0) eloss = 0.0;
|
||||
SampleSubCutSecondaries(scTracks, step, currentModel,currentMaterialIndex);
|
||||
/*
|
||||
if(nProcesses) {
|
||||
for(G4int i=0; i<nProcesses; i++) {
|
||||
(scProcesses[i])->SampleSubCutSecondaries(
|
||||
scTracks, step, (scProcesses[i])->
|
||||
SelectModelForMaterial(preStepKinEnergy, currentMaterialIndex),
|
||||
currentMaterialIndex);
|
||||
}
|
||||
}
|
||||
*/
|
||||
G4int n = scTracks.size();
|
||||
if(n) {
|
||||
G4ThreeVector mom = dynParticle->GetMomentum();
|
||||
fParticleChange.SetNumberOfSecondaries(n);
|
||||
for(G4int i=0; i<n; i++) {
|
||||
G4Track* t = scTracks[i];
|
||||
G4double ekin = t->GetKineticEnergy();
|
||||
G4double e = ekin;
|
||||
if (t->GetDefinition() == thePositron) e += 2.0*electron_mass_c2;
|
||||
G4bool addSec = true;
|
||||
|
||||
// do not track very low-energy delta-electrons
|
||||
if(theSecondaryRangeTable) {
|
||||
G4bool b;
|
||||
G4double rg =
|
||||
((*theSecondaryRangeTable)[currentMaterialIndex]->GetValue(e, b));
|
||||
// if(rg < currentMinSafety) {
|
||||
if(rg < safetyHelper->ComputeSafety(t->GetPosition())) {
|
||||
esecdep += e;
|
||||
delete t;
|
||||
addSec = false;
|
||||
}
|
||||
}
|
||||
if(addSec) {
|
||||
esec += e;
|
||||
pParticleChange->AddSecondary(t);
|
||||
mom -= t->GetMomentum();
|
||||
}
|
||||
}
|
||||
scTracks.clear();
|
||||
// fParticleChange.SetProposedMomentum(mom);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -703,14 +805,15 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
CorrectionsAlongStep(currentCouple, dynParticle, eloss, length);
|
||||
|
||||
// Sample fluctuations
|
||||
if (lossFluctuationFlag && eloss + esec + lowestKinEnergy < preStepKinEnergy) {
|
||||
if (lossFluctuationFlag &&
|
||||
eloss + esec + esecdep + lowestKinEnergy < preStepKinEnergy) {
|
||||
|
||||
G4double tmax =
|
||||
std::min(currentModel->MaxSecondaryKinEnergy(dynParticle),cut);
|
||||
eloss = currentModel->GetModelOfFluctuations()->
|
||||
SampleFluctuations(currentMaterial,dynParticle,tmax,length,eloss);
|
||||
|
||||
/*
|
||||
/*
|
||||
if(-1 < verboseLevel)
|
||||
G4cout << "After fluct: eloss(MeV)= " << eloss/MeV
|
||||
<< " fluc= " << (eloss-eloss0)/MeV
|
||||
@@ -720,6 +823,8 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
<< G4endl;
|
||||
*/
|
||||
}
|
||||
// add low-energy subcutoff particles
|
||||
eloss += esecdep;
|
||||
|
||||
// Energy balanse
|
||||
G4double finalT = preStepKinEnergy - eloss - esec;
|
||||
@@ -731,7 +836,7 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
fParticleChange.SetProposedKineticEnergy(finalT);
|
||||
fParticleChange.ProposeLocalEnergyDeposit(eloss);
|
||||
|
||||
/*
|
||||
/*
|
||||
if(-1 < verboseLevel) {
|
||||
G4cout << "Final value eloss(MeV)= " << eloss/MeV
|
||||
<< " preStepKinEnergy= " << preStepKinEnergy
|
||||
@@ -750,46 +855,44 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
|
||||
void G4VEnergyLossProcess::SampleSubCutSecondaries(
|
||||
std::vector<G4Track*>& tracks,
|
||||
const G4Step& step,
|
||||
G4double& currentCut,
|
||||
G4VEmModel* model)
|
||||
G4VEmModel* model,
|
||||
G4int idx)
|
||||
{
|
||||
// Fast check weather subcutoff can work
|
||||
G4double subcut = (*theSubCuts)[currentMaterialIndex];
|
||||
G4double cut = (*theCuts)[currentMaterialIndex];
|
||||
G4double subcut = (*theSubCuts)[idx];
|
||||
G4double cut = (*theCuts)[idx];
|
||||
if(cut <= subcut) return;
|
||||
|
||||
const G4Track* track = step.GetTrack();
|
||||
const G4DynamicParticle* dp = track->GetDynamicParticle();
|
||||
G4bool b;
|
||||
G4double cross =
|
||||
chargeSqRatio*(((*theSubLambdaTable)[currentMaterialIndex])->
|
||||
GetValue(preStepScaledEnergy, b));
|
||||
chargeSqRatio*(((*theSubLambdaTable)[idx])->GetValue(dp->GetKineticEnergy(),b));
|
||||
G4double length = step.GetStepLength();
|
||||
currentCut = subcut;
|
||||
if(length*cross < 1.e-9) return;
|
||||
/*
|
||||
/*
|
||||
if(-1 < verboseLevel)
|
||||
G4cout << "<<< Subcutoff for " << GetProcessName()
|
||||
<< " cross(1/mm)= " << cross*mm << ">>>"
|
||||
<< G4endl;
|
||||
<< " e(MeV)= " << preStepScaledEnergy
|
||||
<< " matIdx= " << currentMaterialIndex
|
||||
<< G4endl;
|
||||
*/
|
||||
|
||||
// Sample subcutoff secondaries
|
||||
G4StepPoint* preStepPoint = step.GetPreStepPoint();
|
||||
|
||||
G4ThreeVector prepoint = preStepPoint->GetPosition();
|
||||
G4ThreeVector dr = step.GetPostStepPoint()->GetPosition() - prepoint;
|
||||
G4double pretime = preStepPoint->GetGlobalTime();
|
||||
G4double dt = length/preStepPoint->GetVelocity();
|
||||
G4double fragment = 0.0;
|
||||
|
||||
const G4Track* track = step.GetTrack();
|
||||
const G4DynamicParticle* dp = track->GetDynamicParticle();
|
||||
const G4TouchableHandle& hand = track->GetTouchableHandle();
|
||||
|
||||
do {
|
||||
G4double del = -std::log(G4UniformRand())/cross;
|
||||
fragment += del/length;
|
||||
if (fragment > 1.0) break;
|
||||
std::vector<G4DynamicParticle*>* newp =
|
||||
model->SampleSecondaries(currentCouple, dp, subcut, cut);
|
||||
model->SampleSecondaries(track->GetMaterialCutsCouple(),dp,subcut,cut);
|
||||
if (newp) {
|
||||
|
||||
G4DynamicParticle* p;
|
||||
@@ -799,9 +902,9 @@ void G4VEnergyLossProcess::SampleSubCutSecondaries(
|
||||
p = (*newp)[i];
|
||||
G4ThreeVector r = prepoint + fragment*dr;
|
||||
G4Track* t = new G4Track(p, pretime + fragment*dt, r);
|
||||
t->SetTouchableHandle(hand);
|
||||
t->SetTouchableHandle(track->GetTouchableHandle());
|
||||
tracks.push_back(t);
|
||||
/*
|
||||
/*
|
||||
if(-1 < verboseLevel)
|
||||
G4cout << "New track " << p->GetDefinition()->GetParticleName()
|
||||
<< " e(keV)= " << p->GetKineticEnergy()/keV
|
||||
@@ -926,60 +1029,64 @@ void G4VEnergyLossProcess::PrintInfoDefinition()
|
||||
if(theDEDXTable && isIonisation) G4cout << (*theDEDXTable) << G4endl;
|
||||
G4cout << "non restricted DEDXTable address= "
|
||||
<< theDEDXunRestrictedTable << G4endl;
|
||||
if(theDEDXunRestrictedTable && isIonisation) G4cout << (*theDEDXunRestrictedTable)
|
||||
<< G4endl;
|
||||
if(theDEDXunRestrictedTable && isIonisation)
|
||||
G4cout << (*theDEDXunRestrictedTable) << G4endl;
|
||||
if(theDEDXSubTable && isIonisation) G4cout << (*theDEDXSubTable)
|
||||
<< G4endl;
|
||||
G4cout << "CSDARangeTable address= " << theCSDARangeTable
|
||||
<< G4endl;
|
||||
if(theCSDARangeTable && isIonisation) G4cout << (*theCSDARangeTable) << G4endl;
|
||||
if(theCSDARangeTable && isIonisation) G4cout << (*theCSDARangeTable)
|
||||
<< G4endl;
|
||||
G4cout << "RangeTableForLoss address= " << theRangeTableForLoss
|
||||
<< G4endl;
|
||||
if(theRangeTableForLoss && isIonisation) G4cout << (*theRangeTableForLoss) << G4endl;
|
||||
if(theRangeTableForLoss && isIonisation)
|
||||
G4cout << (*theRangeTableForLoss) << G4endl;
|
||||
G4cout << "InverseRangeTable address= " << theInverseRangeTable
|
||||
<< G4endl;
|
||||
if(theInverseRangeTable && isIonisation) G4cout << (*theInverseRangeTable) << G4endl;
|
||||
if(theInverseRangeTable && isIonisation)
|
||||
G4cout << (*theInverseRangeTable) << G4endl;
|
||||
G4cout << "LambdaTable address= " << theLambdaTable << G4endl;
|
||||
if(theLambdaTable && isIonisation) G4cout << (*theLambdaTable) << G4endl;
|
||||
G4cout << "SubLambdaTable address= " << theSubLambdaTable << G4endl;
|
||||
if(theSubLambdaTable && isIonisation) G4cout << (*theSubLambdaTable) << G4endl;
|
||||
if(theSubLambdaTable && isIonisation) G4cout << (*theSubLambdaTable)
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEnergyLossProcess::SetDEDXTable(G4PhysicsTable* p)
|
||||
void G4VEnergyLossProcess::SetDEDXTable(G4PhysicsTable* p, G4EmTableType tType)
|
||||
{
|
||||
if(theDEDXTable != p) theDEDXTable = p;
|
||||
}
|
||||
if(fTotal == tType && theDEDXunRestrictedTable != p) {
|
||||
if(theDEDXunRestrictedTable) theDEDXunRestrictedTable->clearAndDestroy();
|
||||
theDEDXunRestrictedTable = p;
|
||||
if(p) {
|
||||
size_t n = p->length();
|
||||
G4PhysicsVector* pv = (*p)[0];
|
||||
G4double emax = maxKinEnergyCSDA;
|
||||
G4bool b;
|
||||
theDEDXAtMaxEnergy = new G4double [n];
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEnergyLossProcess::SetDEDXTableForSubsec(G4PhysicsTable* p)
|
||||
{
|
||||
if(theDEDXSubTable != p) theDEDXSubTable = p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEnergyLossProcess::SetDEDXunRestrictedTable(G4PhysicsTable* p)
|
||||
{
|
||||
if(theDEDXunRestrictedTable != p) theDEDXunRestrictedTable = p;
|
||||
if(p) {
|
||||
size_t n = p->length();
|
||||
G4PhysicsVector* pv = (*p)[0];
|
||||
G4double emax = maxKinEnergyCSDA;
|
||||
G4bool b;
|
||||
theDEDXAtMaxEnergy = new G4double [n];
|
||||
|
||||
for (size_t i=0; i<n; i++) {
|
||||
pv = (*p)[i];
|
||||
G4double dedx = pv->GetValue(emax, b);
|
||||
theDEDXAtMaxEnergy[i] = dedx;
|
||||
//G4cout << "i= " << i << " emax(MeV)= " << emax/MeV<< " dedx= "
|
||||
//<< dedx << G4endl;
|
||||
for (size_t i=0; i<n; i++) {
|
||||
pv = (*p)[i];
|
||||
G4double dedx = pv->GetValue(emax, b);
|
||||
theDEDXAtMaxEnergy[i] = dedx;
|
||||
//G4cout << "i= " << i << " emax(MeV)= " << emax/MeV<< " dedx= "
|
||||
//<< dedx << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
} else if(fRestricted == tType) {
|
||||
theDEDXTable = p;
|
||||
} else if(fSubRestricted == tType) {
|
||||
theDEDXSubTable = p;
|
||||
} else if(fIonisation == tType && theIonisationTable != p) {
|
||||
if(theIonisationTable) theIonisationTable->clearAndDestroy();
|
||||
theIonisationTable = p;
|
||||
} else if(fSubIonisation == tType && theIonisationSubTable != p) {
|
||||
if(theIonisationSubTable) theIonisationSubTable->clearAndDestroy();
|
||||
theIonisationSubTable = p;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1208,6 +1315,18 @@ G4bool G4VEnergyLossProcess::StorePhysicsTable(
|
||||
if( !theDEDXSubTable->StorePhysicsTable(name,ascii)) res = false;
|
||||
}
|
||||
|
||||
if ( theIonisationTable ) {
|
||||
const G4String name =
|
||||
GetPhysicsTableFileName(part,directory,"Ionisation",ascii);
|
||||
if( !theIonisationTable->StorePhysicsTable(name,ascii)) res = false;
|
||||
}
|
||||
|
||||
if ( theIonisationSubTable ) {
|
||||
const G4String name =
|
||||
GetPhysicsTableFileName(part,directory,"SubIonisation",ascii);
|
||||
if( !theIonisationSubTable->StorePhysicsTable(name,ascii)) res = false;
|
||||
}
|
||||
|
||||
if ( theCSDARangeTable && isIonisation ) {
|
||||
const G4String name =
|
||||
GetPhysicsTableFileName(part,directory,"CSDARange",ascii);
|
||||
@@ -1343,13 +1462,13 @@ G4bool G4VEnergyLossProcess::RetrievePhysicsTable(
|
||||
theCSDARangeTable,filename,ascii);
|
||||
if(yes) {
|
||||
if (0 < verboseLevel) {
|
||||
G4cout << "Precise Range table for " << particleName
|
||||
G4cout << "CSDA Range table for " << particleName
|
||||
<< " is Retrieved from <"
|
||||
<< filename << ">"
|
||||
<< G4endl;
|
||||
}
|
||||
} else {
|
||||
G4cout << "Precise Range table for loss for " << particleName
|
||||
G4cout << "CSDA Range table for loss for " << particleName
|
||||
<< " does not exist"
|
||||
<< G4endl;
|
||||
}
|
||||
@@ -1426,7 +1545,7 @@ G4bool G4VEnergyLossProcess::RetrievePhysicsTable(
|
||||
<< " is Retrieved from <"
|
||||
<< filename << ">"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(nSCoffRegions) {
|
||||
res=false;
|
||||
@@ -1435,6 +1554,41 @@ G4bool G4VEnergyLossProcess::RetrievePhysicsTable(
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
filename = GetPhysicsTableFileName(part,directory,"Ionisation",ascii);
|
||||
yes = theIonisationTable->ExistPhysicsTable(filename);
|
||||
if(yes) {
|
||||
theIonisationTable =
|
||||
G4PhysicsTableHelper::PreparePhysicsTable(theIonisationTable);
|
||||
|
||||
yes = G4PhysicsTableHelper::RetrievePhysicsTable(
|
||||
theIonisationTable,filename,ascii);
|
||||
}
|
||||
if(yes) {
|
||||
if (0 < verboseLevel) {
|
||||
G4cout << "Ionisation table for " << particleName
|
||||
<< " is Retrieved from <"
|
||||
<< filename << ">"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
filename = GetPhysicsTableFileName(part,directory,"SubIonisation",ascii);
|
||||
yes = theIonisationSubTable->ExistPhysicsTable(filename);
|
||||
if(yes) {
|
||||
theIonisationSubTable =
|
||||
G4PhysicsTableHelper::PreparePhysicsTable(theIonisationSubTable);
|
||||
yes = G4PhysicsTableHelper::RetrievePhysicsTable(
|
||||
theIonisationSubTable,filename,ascii);
|
||||
}
|
||||
if(yes) {
|
||||
if (0 < verboseLevel) {
|
||||
G4cout << "SubIonisation table for " << particleName
|
||||
<< " is Retrieved from <"
|
||||
<< filename << ">"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1568,4 +1722,17 @@ G4bool G4VEnergyLossProcess::IsIonisationProcess() const
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEnergyLossProcess::AddCollaborativeProcess(
|
||||
G4VEnergyLossProcess* p)
|
||||
{
|
||||
scProcesses.push_back(p);
|
||||
nProcesses++;
|
||||
if (0 < verboseLevel)
|
||||
G4cout << "### The process " << p->GetProcessName()
|
||||
<< " is added to the list of collaborative processes of "
|
||||
<< GetProcessName() << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VMultipleScattering.cc,v 1.39 2006/06/29 19:55:25 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VMultipleScattering.cc,v 1.41 2007/02/12 17:04:51 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -88,6 +88,7 @@ G4VMultipleScattering::G4VMultipleScattering(const G4String& name, G4ProcessType
|
||||
currentParticle(0),
|
||||
currentCouple(0),
|
||||
nBins(120),
|
||||
skin(0.0),
|
||||
latDisplasment(true),
|
||||
buildLambdaTable(true)
|
||||
{
|
||||
@@ -222,6 +223,8 @@ void G4VMultipleScattering::PrintInfoDefinition()
|
||||
<< " in " << nBins << " bins."
|
||||
<< G4endl;
|
||||
}
|
||||
G4cout << " LateralDisplacementFlag= " << latDisplasment
|
||||
<< " Skin= " << skin << G4endl;
|
||||
PrintInfo();
|
||||
if (2 < verboseLevel) {
|
||||
G4cout << "LambdaTable address= " << theLambdaTable << G4endl;
|
||||
|
||||
Reference in New Issue
Block a user