Import Geant4 8.3.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.261 2006/11/10 18:34:57 vnivanch Exp $
|
||||
$Id: History,v 1.276 2007/05/08 17:56:12 vnivanch Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,59 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
25 April 07: V.Ivant (emutils-V08-02-08)
|
||||
- G4VEnegryLossProcess - move initialisation of safety helper to
|
||||
BuildPhysicsTable
|
||||
|
||||
12 April 07: V.Ivant (emutils-V08-02-07)
|
||||
- G4VEnegryLossProcess - use unique G4SafetyHelper
|
||||
- G4VEmProcess - remove double call to Clear method
|
||||
|
||||
08 May 07: V.Ivant (emutils-V08-02-06a)
|
||||
- G4VEnegryLossProcess - use linearLossLimit 0.05 as in 8.2
|
||||
- G4EmCorrections - fix division by zero by using ion mass from G4IonTable
|
||||
|
||||
19 March 07: V.Ivant (emutils-V08-02-06)
|
||||
- G4VMultipleScattering - add protection against zero step or energy
|
||||
- G4EmModelManager - add maxCutInRange variable for sub-cutoff option
|
||||
- G4EmCalculator - add method ComputeEnergyCutFromRangeCut
|
||||
- G4EnergyLossMessenger - send message "/run/physicsModified" after all
|
||||
commands, which require reinitialisation
|
||||
- G4VEnergyLossProcess - use SafetyHelper instead of Navigator
|
||||
- add protection agains zero-length step
|
||||
|
||||
16 February 07: V.Ivant (emutils-V08-02-05)
|
||||
- G4VEnegryLossProcess - change initialisation: linLossLimit=1.e-6
|
||||
improve precision of energy loss for high
|
||||
energy incident and high cut
|
||||
|
||||
13 February 07: V.Ivant (emutils-V08-02-04)
|
||||
- G4LossTableManager, G4EmProcessOptions, G4EnergyLossMessenger
|
||||
add command MscSkin, linearLossLimit
|
||||
- G4VMultipleScattering - add SetSkin and Skin methods
|
||||
- G4LossTableBuilder - use more precise algorithm to build inverse
|
||||
range table using G4LPhysicsFreeVector
|
||||
|
||||
07 February 07: V.Ivant (emutils-V08-02-03)
|
||||
- G4LossTableManager, G4EmProcessOptions, G4EnergyLossMessenger
|
||||
add command MscLateralDisplacement
|
||||
|
||||
16 January 07: V.Ivant (emutils-V08-02-02)
|
||||
- G4LossTableBuilder - fill new vector for dedx (do not reuse old)
|
||||
- G4LossTableManager - fix problen of reinitialisation for the next run
|
||||
after activate/desactivate energy loss process
|
||||
- G4VEmEnergyLossProcess - add members theIonisationTable and
|
||||
theSubIonisationTables in order to save
|
||||
separately total energy loss and energy
|
||||
loss due to ionisation;
|
||||
|
||||
15 January 07: mma (emutils-V08-02-01)
|
||||
- G4VEmEnergyLossProcess - add SetEmModel(index) add SetFluctModel()
|
||||
|
||||
11 January 07: V.Ivant
|
||||
- G4LossTableManager - fix problen of initialisation
|
||||
- G4VEmEnergyLossProcess - fix subcutoff option for bremsstrahlung
|
||||
|
||||
10 November 06: V.Ivant (emutils-V08-01-06)
|
||||
- G4EnergyLossMessenger - add commands binsDEDX, binsLambda
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmCalculator.hh,v 1.17 2006/09/29 10:13:48 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4EmCalculator.hh,v 1.18 2007/03/15 12:34:46 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -44,6 +44,7 @@
|
||||
// 26.01.2006 Rename GetRange -> GetRangeFromRestricteDEDX (V.Ivanchenko)
|
||||
// 22.03.2006 Add ComputeElectronicDEDX and ComputeTotalDEDX (V.Ivanchenko)
|
||||
// 29.09.2006 Add member loweModel (V.Ivanchenko)
|
||||
// 15.03.2007 Add ComputeEnergyCutFromRangeCut methods (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -181,6 +182,13 @@ public:
|
||||
G4double kinEnergy, const G4String&, const G4String&,
|
||||
const G4String& processName, G4double cut = 0.0);
|
||||
|
||||
G4double ComputeEnergyCutFromRangeCut(
|
||||
G4double range, const G4ParticleDefinition*,
|
||||
const G4Material*);
|
||||
G4double ComputeEnergyCutFromRangeCut(
|
||||
G4double range, const G4String&,
|
||||
const G4String&);
|
||||
|
||||
const G4ParticleDefinition* FindParticle(const G4String&);
|
||||
|
||||
const G4Material* FindMaterial(const G4String&);
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmModelManager.hh,v 1.19 2006/06/29 19:54:25 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4EmModelManager.hh,v 1.21 2007/03/17 19:24:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -51,6 +51,7 @@
|
||||
// 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko)
|
||||
// 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:
|
||||
//
|
||||
@@ -184,6 +185,8 @@ private:
|
||||
G4RegionModels** setOfRegionModels;
|
||||
|
||||
G4double minSubRange;
|
||||
G4double maxCutInRange;
|
||||
G4double maxSubCutInRange;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
const G4ParticleDefinition* secondaryParticle;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmProcessOptions.hh,v 1.9 2006/06/29 19:54:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4EmProcessOptions.hh,v 1.11 2007/02/12 12:31:50 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -41,6 +41,7 @@
|
||||
// Modifications:
|
||||
// 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko)
|
||||
// 22-05-06 Add SetBremsstrahlungTh (V.Ivanchenko)
|
||||
// 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
@@ -102,12 +103,18 @@ public:
|
||||
|
||||
void SetLambdaFactor(G4double val);
|
||||
|
||||
void SetLinearLossLimit(G4double val);
|
||||
|
||||
void SetSkin(G4double val);
|
||||
|
||||
void ActivateDeexcitation(G4bool val, const G4Region* r = 0);
|
||||
|
||||
void SetMscStepLimitation(G4bool algorithm, G4double factor = -1.);
|
||||
|
||||
void SetLPMFlag(G4bool val);
|
||||
|
||||
void SetMscLateralDisplacement(G4bool val);
|
||||
|
||||
void SetBremsstrahlungTh(G4double val);
|
||||
|
||||
private:
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EmTableType.hh,v 1.2 2006/06/29 19:54:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4EmTableType.hh,v 1.3 2007/01/15 17:27:40 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
@@ -37,6 +37,8 @@
|
||||
// Author: Vladimir Ivanchenko
|
||||
//
|
||||
// Creation date: 19.01.2006
|
||||
// Modifications:
|
||||
// 15.01.07 Add two types (V.Ivanchenko)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -47,7 +49,9 @@ enum G4EmTableType
|
||||
{
|
||||
fTotal = 0,
|
||||
fRestricted,
|
||||
fSubRestricted
|
||||
fSubRestricted,
|
||||
fIonisation,
|
||||
fSubIonisation
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EnergyLossMessenger.hh,v 1.14 2006/11/10 18:34:57 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4EnergyLossMessenger.hh,v 1.17 2007/03/17 19:24:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -41,6 +41,8 @@
|
||||
// 10-01-06 SetStepLimits -> SetStepFunction (V.Ivantchenko)
|
||||
// 10-05-06 Add command MscStepLimit (V.Ivantchenko)
|
||||
// 10-11-06 Add command binsDEDX (V.Ivantchenko)
|
||||
// 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
|
||||
// 16-03-07 modify /process/eLoss/minsubsec command (V.Ivanchenko)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -74,6 +76,7 @@ class G4UIdirectory;
|
||||
class G4UIcommand;
|
||||
class G4UIcmdWithABool;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADouble;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -93,7 +96,7 @@ private:
|
||||
G4UIcmdWithABool* RndmStepCmd;
|
||||
G4UIcmdWithABool* EnlossFlucCmd;
|
||||
G4UIcmdWithABool* SubSecCmd;
|
||||
G4UIcmdWithADoubleAndUnit* MinSubSecCmd;
|
||||
G4UIcmdWithADouble* MinSubSecCmd;
|
||||
G4UIcommand* StepFuncCmd;
|
||||
G4UIcommand* mscCmd;
|
||||
G4UIcmdWithADoubleAndUnit* MinEnCmd;
|
||||
@@ -101,9 +104,12 @@ private:
|
||||
G4UIcmdWithABool* IntegCmd;
|
||||
G4UIcmdWithABool* rangeCmd;
|
||||
G4UIcmdWithABool* lpmCmd;
|
||||
G4UIcmdWithABool* latCmd;
|
||||
G4UIcmdWithAnInteger* verCmd;
|
||||
G4UIcmdWithAnInteger* dedxCmd;
|
||||
G4UIcmdWithAnInteger* lbCmd;
|
||||
G4UIcmdWithADouble* lllCmd;
|
||||
G4UIcmdWithADouble* skinCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LossTableManager.hh,v 1.43 2006/10/23 19:05:47 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4LossTableManager.hh,v 1.46 2007/02/12 12:31:50 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -58,6 +58,7 @@
|
||||
// 26-01-06 Rename GetRange -> GetRangeFromRestricteDEDX (V.Ivanchenko)
|
||||
// 10-05-06 Add methods SetMscStepLimitation, FacRange and MscFlag (VI)
|
||||
// 22-05-06 Add methods Set/Get bremsTh (VI)
|
||||
// 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -192,6 +193,12 @@ public:
|
||||
|
||||
void SetLPMFlag(G4bool val);
|
||||
|
||||
void SetMscLateralDisplacement(G4bool val);
|
||||
|
||||
void SetSkin(G4double val);
|
||||
|
||||
void SetLinearLossLimit(G4double val);
|
||||
|
||||
void SetBremsstrahlungTh(G4double val);
|
||||
|
||||
void SetVerbose(G4int val);
|
||||
@@ -206,11 +213,13 @@ public:
|
||||
|
||||
G4bool MscFlag() const;
|
||||
|
||||
G4bool MscLateralDisplacementFlag() const;
|
||||
|
||||
G4double FacRange() const;
|
||||
|
||||
G4double BremsstrahlungTh() const;
|
||||
|
||||
G4VEnergyLossProcess* GetEnergyLossProcess(const G4ParticleDefinition *aParticle);
|
||||
G4VEnergyLossProcess* GetEnergyLossProcess(const G4ParticleDefinition*);
|
||||
|
||||
const std::vector<G4VEnergyLossProcess*>& GetEnergyLossProcessVector();
|
||||
|
||||
@@ -259,9 +268,10 @@ private:
|
||||
PD theElectron;
|
||||
|
||||
G4int n_loss;
|
||||
G4int run;
|
||||
|
||||
G4bool all_tables_are_built;
|
||||
G4bool first_entry;
|
||||
// G4bool first_entry;
|
||||
G4bool lossFluctuationFlag;
|
||||
G4bool subCutoffFlag;
|
||||
G4bool rndmStepFlag;
|
||||
@@ -275,6 +285,7 @@ private:
|
||||
G4bool stepFunctionActive;
|
||||
G4bool flagLPM;
|
||||
G4bool flagMSC;
|
||||
G4bool flagMSCLateral;
|
||||
G4bool mscActive;
|
||||
|
||||
G4double minSubRange;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEnergyLossProcess.hh,v 1.57 2006/08/15 16:21:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VEnergyLossProcess.hh,v 1.62 2007/03/17 19:24:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -70,6 +70,10 @@
|
||||
// 22-03-06 Add SetDynamicMassCharge (V.Ivanchenko)
|
||||
// 23-03-06 Use isIonisation flag (V.Ivanchenko)
|
||||
// 13-05-06 Add method to access model by index (V.Ivanchenko)
|
||||
// 14-01-07 add SetEmModel(index) and SetFluctModel() (mma)
|
||||
// 15-01-07 Add separate ionisation tables and reorganise get/set methods for
|
||||
// dedx tables (V.Ivanchenko)
|
||||
// 13-03-07 use SafetyHelper instead of navigator (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -103,7 +107,7 @@ class G4VEmModel;
|
||||
class G4VEmFluctuationModel;
|
||||
class G4DataVector;
|
||||
class G4Region;
|
||||
class G4Navigator;
|
||||
class G4SafetyHelper;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -112,7 +116,7 @@ class G4VEnergyLossProcess : public G4VContinuousDiscreteProcess
|
||||
public:
|
||||
|
||||
G4VEnergyLossProcess(const G4String& name = "EnergyLoss",
|
||||
G4ProcessType type = fElectromagnetic);
|
||||
G4ProcessType type = fElectromagnetic);
|
||||
|
||||
virtual ~G4VEnergyLossProcess();
|
||||
|
||||
@@ -218,6 +222,18 @@ public:
|
||||
const G4String& directory,
|
||||
G4bool ascii);
|
||||
|
||||
// Assign a model to a process
|
||||
void SetEmModel(G4VEmModel*, G4int index=1);
|
||||
|
||||
// return the assigned model
|
||||
G4VEmModel* EmModel(G4int index=1);
|
||||
|
||||
// Assign a fluctuation model to a process
|
||||
void SetFluctModel(G4VEmFluctuationModel*);
|
||||
|
||||
// return the assigned fluctuation model
|
||||
G4VEmFluctuationModel* FluctModel();
|
||||
|
||||
// Add EM model coupled with fluctuation model for the region
|
||||
void AddEmModel(G4int, G4VEmModel*, G4VEmFluctuationModel* fluc = 0,
|
||||
const G4Region* region = 0);
|
||||
@@ -231,14 +247,12 @@ public:
|
||||
// Activate deexcitation code
|
||||
virtual void ActivateDeexcitation(G4bool, const G4Region* region = 0);
|
||||
|
||||
void SetDEDXTable(G4PhysicsTable* p);
|
||||
void SetDEDXTable(G4PhysicsTable* p, G4EmTableType tType);
|
||||
G4PhysicsTable* DEDXTable() const;
|
||||
|
||||
void SetDEDXTableForSubsec(G4PhysicsTable* p);
|
||||
G4PhysicsTable* DEDXTableForSubsec() const;
|
||||
|
||||
void SetDEDXunRestrictedTable(G4PhysicsTable* p);
|
||||
G4PhysicsTable* DEDXunRestrictedTable() const;
|
||||
G4PhysicsTable* IonisationTable() const;
|
||||
G4PhysicsTable* IonisationTableForSubsec() const;
|
||||
|
||||
void SetCSDARangeTable(G4PhysicsTable* pRange);
|
||||
G4PhysicsTable* CSDARangeTable() const;
|
||||
@@ -259,7 +273,8 @@ public:
|
||||
|
||||
// Return values for given G4MaterialCutsCouple
|
||||
G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*);
|
||||
G4double GetDEDXForSubsec(G4double& kineticEnergy, const G4MaterialCutsCouple*);
|
||||
G4double GetDEDXForSubsec(G4double& kineticEnergy,
|
||||
const G4MaterialCutsCouple*);
|
||||
G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
|
||||
G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
|
||||
G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*);
|
||||
@@ -313,7 +328,7 @@ public:
|
||||
void AddCollaborativeProcess(G4VEnergyLossProcess*);
|
||||
|
||||
void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&,
|
||||
G4double& cut, G4VEmModel* model);
|
||||
G4VEmModel* model, G4int matIdx);
|
||||
|
||||
// Set scaling parameters
|
||||
void SetDynamicMassCharge(G4double massratio, G4double charge2ratio);
|
||||
@@ -335,7 +350,8 @@ protected:
|
||||
|
||||
G4double GetCurrentRange() const;
|
||||
|
||||
G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*, G4double cut);
|
||||
G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*,
|
||||
G4double cut);
|
||||
|
||||
private:
|
||||
|
||||
@@ -348,6 +364,8 @@ private:
|
||||
//
|
||||
G4double GetDEDXForScaledEnergy(G4double scaledKinEnergy);
|
||||
G4double GetSubDEDXForScaledEnergy(G4double scaledKinEnergy);
|
||||
G4double GetIonisationForScaledEnergy(G4double scaledKinEnergy);
|
||||
G4double GetSubIonisationForScaledEnergy(G4double scaledKinEnergy);
|
||||
G4double GetScaledRangeForScaledEnergy(G4double scaledKinEnergy);
|
||||
G4double GetLimitScaledRangeForScaledEnergy(G4double scaledKinEnergy);
|
||||
G4double GetLambdaForScaledEnergy(G4double scaledKinEnergy);
|
||||
@@ -368,6 +386,8 @@ protected:
|
||||
private:
|
||||
|
||||
G4EmModelManager* modelManager;
|
||||
G4VEmModel* emModel[5];
|
||||
G4VEmFluctuationModel* fluctModel;
|
||||
std::vector<const G4Region*> scoffRegions;
|
||||
G4int nSCoffRegions;
|
||||
G4int* idxSCoffRegions;
|
||||
@@ -379,6 +399,8 @@ private:
|
||||
G4PhysicsTable* theDEDXTable;
|
||||
G4PhysicsTable* theDEDXSubTable;
|
||||
G4PhysicsTable* theDEDXunRestrictedTable;
|
||||
G4PhysicsTable* theIonisationTable;
|
||||
G4PhysicsTable* theIonisationSubTable;
|
||||
G4PhysicsTable* theRangeTableForLoss;
|
||||
G4PhysicsTable* theCSDARangeTable;
|
||||
G4PhysicsTable* theSecondaryRangeTable;
|
||||
@@ -393,7 +415,7 @@ private:
|
||||
const G4DataVector* theCuts;
|
||||
const G4DataVector* theSubCuts;
|
||||
|
||||
G4Navigator* navigator;
|
||||
G4SafetyHelper* safetyHelper;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
const G4ParticleDefinition* baseParticle;
|
||||
@@ -500,6 +522,35 @@ inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)
|
||||
{
|
||||
G4bool b;
|
||||
G4double x = 0.0;
|
||||
if(theIonisationTable) {
|
||||
x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b))
|
||||
*chargeSqRatio;
|
||||
if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline
|
||||
G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)
|
||||
{
|
||||
G4bool b;
|
||||
G4double x = 0.0;
|
||||
if(theIonisationSubTable) {
|
||||
x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b))
|
||||
*chargeSqRatio;
|
||||
if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEnergyLossProcess::GetRange(G4double& kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
@@ -556,7 +607,8 @@ inline G4double G4VEnergyLossProcess::GetRangeForLoss(
|
||||
G4double x = DBL_MAX;
|
||||
if(theRangeTableForLoss)
|
||||
x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
|
||||
// G4cout << "Range from " << GetProcessName() << " e= " << kineticEnergy << " r= " << x << G4endl;
|
||||
// G4cout << "Range from " << GetProcessName()
|
||||
// << " e= " << kineticEnergy << " r= " << x << G4endl;
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -805,6 +857,24 @@ inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const
|
||||
{
|
||||
G4PhysicsTable* t = theDEDXTable;
|
||||
if(theIonisationTable) t = theIonisationTable;
|
||||
return t;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const
|
||||
{
|
||||
G4PhysicsTable* t = theDEDXSubTable;
|
||||
if(theIonisationSubTable) t = theIonisationSubTable;
|
||||
return t;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const
|
||||
{
|
||||
return theCSDARangeTable;
|
||||
@@ -870,14 +940,6 @@ inline G4double G4VEnergyLossProcess::GetCurrentRange() const
|
||||
return fRange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEnergyLossProcess::AddCollaborativeProcess(
|
||||
G4VEnergyLossProcess* p)
|
||||
{
|
||||
scProcesses.push_back(p);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx)
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VMultipleScattering.hh,v 1.39 2006/06/29 19:54:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VMultipleScattering.hh,v 1.42 2007/03/15 12:33:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -48,7 +48,7 @@
|
||||
// part of calculations for all charged particles
|
||||
//
|
||||
// 26-11-03 bugfix in AlongStepDoIt (L.Urban)
|
||||
// 25-05-04 add protection against case when range is less than steplimit (V.Ivanchenko)
|
||||
// 25-05-04 add protection against case when range is less than steplimit (VI)
|
||||
// 30-06-04 make destructor virtual (V.Ivanchenko)
|
||||
// 27-08-04 Add InitialiseForRun method (V.Ivanchneko)
|
||||
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko)
|
||||
@@ -60,6 +60,7 @@
|
||||
// 17-02-06 Save table of transport cross sections not mfp (V.Ivanchenko)
|
||||
// 07-03-06 Move step limit calculation to model (V.Ivanchenko)
|
||||
// 13-05-06 Add method to access model by index (V.Ivanchenko)
|
||||
// 12-02-07 Add get/set skin (V.Ivanchenko)
|
||||
//
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
@@ -185,6 +186,10 @@ public:
|
||||
void SetLateralDisplasmentFlag(G4bool val);
|
||||
// lateral displacement to be/not to be computed
|
||||
|
||||
G4double Skin() const;
|
||||
void SetSkin(G4double val);
|
||||
// skin parameter
|
||||
|
||||
void SetBuildLambdaTable(G4bool val);
|
||||
|
||||
G4PhysicsTable* LambdaTable() const;
|
||||
@@ -252,6 +257,7 @@ private:
|
||||
|
||||
G4double minKinEnergy;
|
||||
G4double maxKinEnergy;
|
||||
G4double skin;
|
||||
|
||||
G4bool latDisplasment;
|
||||
G4bool buildLambdaTable;
|
||||
@@ -305,13 +311,20 @@ inline G4double G4VMultipleScattering::GetContinuousStepLimit(
|
||||
G4double currentMinimalStep,
|
||||
G4double&)
|
||||
{
|
||||
G4double x = currentMinimalStep;
|
||||
G4double e = track.GetKineticEnergy();
|
||||
DefineMaterial(track.GetMaterialCutsCouple());
|
||||
currentModel = SelectModel(track.GetKineticEnergy());
|
||||
G4double tPathLength =
|
||||
currentModel->ComputeTruePathLengthLimit(track, theLambdaTable, currentMinimalStep);
|
||||
if (tPathLength < currentMinimalStep) valueGPILSelectionMSC = CandidateForSelection;
|
||||
// G4cout << "tPathLength= " << tPathLength << " currentMinimalStep= " << currentMinimalStep<< G4endl;
|
||||
return currentModel->ComputeGeomPathLength(tPathLength);
|
||||
currentModel = SelectModel(e);
|
||||
if(x > 0.0 && e > 0.0) {
|
||||
G4double tPathLength =
|
||||
currentModel->ComputeTruePathLengthLimit(track, theLambdaTable, x);
|
||||
if (tPathLength < x) valueGPILSelectionMSC = CandidateForSelection;
|
||||
x = currentModel->ComputeGeomPathLength(tPathLength);
|
||||
// G4cout << "tPathLength= " << tPathLength
|
||||
// << " stepLimit= " << x
|
||||
// << " currentMinimalStep= " << currentMinimalStep<< G4endl;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -437,6 +450,20 @@ inline void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VMultipleScattering::Skin() const
|
||||
{
|
||||
return skin;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VMultipleScattering::SetSkin(G4double val)
|
||||
{
|
||||
skin = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
|
||||
{
|
||||
buildLambdaTable = val;
|
||||
|
||||
@@ -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