Import Geant4 9.3.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.364 2008/11/20 20:32:40 vnivanch Exp $
|
||||
$Id: History,v 1.400 2009/11/22 19:48:30 vnivanch Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,145 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
23 November 09: V.Ivant (emutils-V09-02-24)
|
||||
G4EmConfigurator - fixed bug in selection of models
|
||||
|
||||
22 November 09: V.Ivant (emutils-V09-02-23)
|
||||
G4EmCalculator - take into account CorrectionAlongStep for ions
|
||||
|
||||
10 November 09: V.Ivant (emutils-V09-02-22)
|
||||
G4EmCalculator - added method FindIon; improve computation for ions
|
||||
allowing to be applied for the model based on ICRU'73
|
||||
|
||||
10 November 09: V.Ivant (emutils-V09-02-21)
|
||||
G4VEmProcess - improved printout
|
||||
|
||||
29 September 09: V.Ivant (emutils-V09-02-20)
|
||||
- G4VMultipleScattering - added SetModel method
|
||||
- G4EmCorrections - fixed bug reported in phys-list forum #532
|
||||
- G4ionEffectiveCharge - return back lost protection for zero energy
|
||||
- G4LossTableManager, G4EmProcessOptions, G4EnergyLossMessenger - added
|
||||
parameter FactorForAngleLimit, Set/Get methods and UI command
|
||||
to be used computation of limit on -t (invariant momentum transfer)
|
||||
inside single scattering and G4WentzelVI models
|
||||
|
||||
29 September 09: V.Ivant (emutils-V09-02-19)
|
||||
- G4EmElementSelector - fixed forgotten migration to updated G4PhysicsVector
|
||||
|
||||
25 September 09: V.Ivant (emutils-V09-02-18)
|
||||
- G4VEmModel - insure definition of pointer to the G4MaterialCutsCouple
|
||||
object both at initialisation and in run time
|
||||
- G4EmSaturation - use PDG encoding instead of pointer to G4ParticleDefinition
|
||||
|
||||
11 August 09: V.Ivant (emutils-V09-02-17)
|
||||
- G4EmModelManager - reduced length of internal arrays, simplified
|
||||
initialisation, in particular, smoothing procedure, the size of
|
||||
executable should be reduced
|
||||
- G4VEmProcess, G4VMultipleScattering, G4VEnergyLossProcess,
|
||||
G4LossTableBuilder - use copy constructors to create Physics Vectors in
|
||||
order to reduce number of calls to log function
|
||||
|
||||
30 July 09: V.Ivant (emutils-V09-02-16)
|
||||
- G4VEmProcess, G4VMultipleScattering, G4VEnergyLossProcess - fixed
|
||||
bug in RetrieveTables - check that each its PhysicsVector was
|
||||
retrieved before set of SplineFlag
|
||||
|
||||
24 July 09: V.Ivant (emutils-V09-02-15)
|
||||
- G4AtomicShell class moved from lowenergy
|
||||
- G4VEmProcess, G4VMultipleScattering, G4VEnergyLossProcess - added
|
||||
initialisation of polarAngleLimit and highEnergyLimit parameters
|
||||
for all models
|
||||
|
||||
22 July 09: V.Ivant (emutils-V09-02-14)
|
||||
- G4VEmProcess - modified method SelectModel required for the
|
||||
G4NuclearStopping process
|
||||
|
||||
20 July 09: V.Ivant (emutils-V09-02-13)
|
||||
- G4VMultipleScattering - added initialisation of generic msc model
|
||||
parameters in this base class (allowing
|
||||
to overwrite default models)
|
||||
- G4EmConfigurator - cleanup
|
||||
- G4VMscModel - set facsafety=0.3 as it is defined in Urban models
|
||||
|
||||
9 July 09: V.Ivant (emutils-V09-02-12)
|
||||
- G4VEnergyLossProcess, G4VEmProcess, G4VMultipleScattering,
|
||||
G4LossTableBuilder - used updated G4PhysicsVector (no hidden bin anymore);
|
||||
used Energy() and Value() methods instead of
|
||||
GetLowEdgeEnergy() and GetValue()
|
||||
- G4VEnergyLossProcess - fixed retrieve from ASCII files
|
||||
- G4VMultipleScattering - remove method obsolete GetMscContinuesStepLimit
|
||||
- G4VAtomDeexcitation - a new header file
|
||||
|
||||
27 May 09: V.Ivant (emutils-V09-02-11)
|
||||
- G4VMultipleScattering - discarded changes from the previous tag
|
||||
|
||||
26 May 09: V.Ivant (emutils-V09-02-10)
|
||||
- G4VEmModel: remove protection in from previous tag and include protection
|
||||
to G4ParticleChangeForLoss;
|
||||
more save initialisation of G4EmElementSelectors
|
||||
- G4VMultipleScattering - added a protection against zero kinetic energy
|
||||
- G4EmElementSelector - do not use spline
|
||||
|
||||
22 May 09: V.Ivant (emutils-V09-02-09)
|
||||
- Added protection into G4VEmModel for zero input energy
|
||||
|
||||
15 May 09: V.Ivant (emutils-V09-02-08)
|
||||
- Added new testG4EnergyLossTables and fixed GNUmakefile for tests
|
||||
|
||||
10 May 09: V.Ivant (emutils-V09-02-07)
|
||||
G4EmElementSelector - added protection for zero cross section at first and last
|
||||
bins of physics vector
|
||||
G4VMscModel, G4VMultipleScattering - set default Range Factor to 0.04
|
||||
|
||||
17 April 09: V.Ivant (emutils-V09-02-06)
|
||||
- G4EmModelManager - fixed energy range selection algorithm for the case of
|
||||
a small intersection of model energy intervals
|
||||
- G4VEnergyLossProcess, G4VEmProcess, G4VMultipleScattering - set high enegry
|
||||
limit 10 TeV and number of bins 77
|
||||
|
||||
08 April 09: V.Ivant (emutils-V09-02-05)
|
||||
- G4LossTableManager - added G4EmConfigurator providing easier addition of
|
||||
models per region
|
||||
- G4VMultipleScattering, G4VEmProcess, G4VEnergyLossProcess: added
|
||||
initialisation of the G4EmConfigurator
|
||||
|
||||
08 April 09: V.Ivant (emutils-V09-02-04)
|
||||
- G4EmModelManager - fixed energy range selection algorithm for the case
|
||||
when there is an intersection of energy regions of standard
|
||||
and low-energy models,
|
||||
- reduce internal vectors if no model per region are initialized.
|
||||
- do not initilise unused models.
|
||||
- G4VEmModel - msc methods are moved to G4VMscModel, added protected
|
||||
methods for initialisation of ParticleChange
|
||||
- G4VMultipleScattering, G4VEmProcess, G4VEnergyLossProcess:
|
||||
methods for initialisations are moved from inline to source
|
||||
|
||||
26 February 09: V.Ivant (emutils-V09-02-03)
|
||||
G4EmConfigurator - fixed for the case if only fluctuation model is set
|
||||
and main model is default
|
||||
|
||||
22 February 09: V.Ivant (emutils-V09-02-02)
|
||||
- G4VEmModel - make methods to access geometry protected, added new
|
||||
method SetSampleZ, added geommax private member
|
||||
- G4EmCalculator - added possibility to be used by DNA processes:
|
||||
take into account special DNA particles
|
||||
|
||||
18 February 09: V.Ivant (emutils-V09-02-01)
|
||||
G4VEmModel, G4VEmFluctuationModel, G4VEnegryLossProcess, G4VEmProcess,
|
||||
G4VMultipleScattering - move all virtual methods to source, update comments
|
||||
G4VEmModel - added flagDeexcitation and Get/Set methods
|
||||
G4VEnegryLossProcess, G4VEmProcess - added calls to deexcitation PostStep
|
||||
G4EmProcessOptions - added ActivateDeexcitation method
|
||||
G4EnergyLossMessenger - added /process/em/deexcitation UI command
|
||||
G4LossTableBuilder - added protection in BuildRangeTable against zero dedx
|
||||
|
||||
27 January 09: V.Ivant (emutils-V09-02-00)
|
||||
G4VEmModel - added method SampleDeexcitationAlongStep
|
||||
G4VEnegryLossProcess - added deexcitation AlongStep per region
|
||||
G4VMscModel - added methdos: InitialiseSafetyHelper, ComputeSafety,
|
||||
ComputeGeomLimit, ComputeDisplacement
|
||||
G4VEmProcess - added possibility to set more than 1 model
|
||||
|
||||
20 November 08: V.Ivant (emutils-V09-01-37)
|
||||
G4EmConfigurator - fixed energy interval selection for a model
|
||||
G4VMultipleScattering - set process sub-type 10 to distinguish with
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AtomicShell.hh,v 1.1 2009/07/24 17:22:32 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class header file
|
||||
//
|
||||
//
|
||||
// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
|
||||
// Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
|
||||
//
|
||||
// History:
|
||||
// -----------
|
||||
//
|
||||
// 16 Sept 2001 Modified according to a design iteration in the
|
||||
// LowEnergy category
|
||||
// 24 July 2009 Moved to utils subdirectory and make inline methods (VI)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// Class description:
|
||||
// A container of atomic shell data
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef G4AtomicShell_h
|
||||
#define G4AtomicShell_h 1
|
||||
#include "globals.hh"
|
||||
|
||||
class G4AtomicShell {
|
||||
|
||||
public:
|
||||
|
||||
// The data and the methods of this class are relative to
|
||||
// a given shell
|
||||
|
||||
G4AtomicShell(G4int id, G4double bindingEnergy);
|
||||
|
||||
~G4AtomicShell();
|
||||
|
||||
// Returns the binding energy of the shell
|
||||
inline G4double BindingEnergy() const;
|
||||
|
||||
// Returns the id of the shell
|
||||
inline G4int ShellId() const;
|
||||
|
||||
private:
|
||||
|
||||
G4int identifier;
|
||||
G4double bindingEnergy;
|
||||
|
||||
};
|
||||
|
||||
inline G4double G4AtomicShell::BindingEnergy() const {
|
||||
|
||||
return bindingEnergy;
|
||||
}
|
||||
|
||||
inline G4int G4AtomicShell::ShellId() const{
|
||||
|
||||
return identifier;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DummyModel.hh,v 1.3 2007/05/22 17:31:57 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4DummyModel.hh,v 1.4 2009/04/07 18:39:47 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -50,9 +50,9 @@
|
||||
#define G4DummyModel_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4VMscModel.hh"
|
||||
|
||||
class G4DummyModel : public G4VEmModel
|
||||
class G4DummyModel : public G4VMscModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmCalculator.hh,v 1.18 2007/03/15 12:34:46 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmCalculator.hh,v 1.19 2009/11/11 23:59:48 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -59,6 +59,7 @@
|
||||
#include <vector>
|
||||
#include "globals.hh"
|
||||
#include "G4DataVector.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
|
||||
class G4LossTableManager;
|
||||
class G4Material;
|
||||
@@ -81,8 +82,10 @@ public:
|
||||
|
||||
~G4EmCalculator();
|
||||
|
||||
//==================================================================================
|
||||
// Methods to access precalculated dE/dx and cross sections
|
||||
// Materials should exist in the list of the G4MaterialCutsCouple
|
||||
//==================================================================================
|
||||
|
||||
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition*, const G4Material*,
|
||||
const G4Region* r = 0);
|
||||
@@ -135,8 +138,10 @@ public:
|
||||
|
||||
void PrintInverseRangeTable(const G4ParticleDefinition*);
|
||||
|
||||
//==================================================================================
|
||||
// Methods to calculate dE/dx and cross sections "on fly"
|
||||
// Existing tables and G4MaterialCutsCouples are not used
|
||||
//==================================================================================
|
||||
|
||||
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition*,
|
||||
const G4String& processName, const G4Material*,
|
||||
@@ -149,8 +154,10 @@ public:
|
||||
G4double ComputeElectronicDEDX(G4double kinEnergy, const G4String& part,
|
||||
const G4String& mat, G4double cut = DBL_MAX);
|
||||
|
||||
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition*, const G4Material*);
|
||||
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4String& part, const G4String& mat);
|
||||
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition*,
|
||||
const G4Material*);
|
||||
G4double ComputeNuclearDEDX(G4double kinEnergy, const G4String& part,
|
||||
const G4String& mat);
|
||||
|
||||
G4double ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition*,
|
||||
const G4Material*, G4double cut = DBL_MAX);
|
||||
@@ -189,8 +196,14 @@ public:
|
||||
G4double range, const G4String&,
|
||||
const G4String&);
|
||||
|
||||
//==================================================================================
|
||||
// Methods to access particles, materials, regions
|
||||
//==================================================================================
|
||||
|
||||
const G4ParticleDefinition* FindParticle(const G4String&);
|
||||
|
||||
const G4ParticleDefinition* FindIon(G4int Z, G4int A);
|
||||
|
||||
const G4Material* FindMaterial(const G4String&);
|
||||
|
||||
const G4Region* FindRegion(const G4String&);
|
||||
@@ -199,6 +212,10 @@ public:
|
||||
|
||||
void SetVerbose(G4int val);
|
||||
|
||||
//==================================================================================
|
||||
// Private methods
|
||||
//==================================================================================
|
||||
|
||||
private:
|
||||
|
||||
G4bool UpdateParticle(const G4ParticleDefinition*, G4double kinEnergy);
|
||||
@@ -239,6 +256,7 @@ private:
|
||||
|
||||
const G4ParticleDefinition* theGenericIon;
|
||||
G4ionEffectiveCharge* ionEffCharge;
|
||||
G4DynamicParticle dynParticle;
|
||||
|
||||
G4String currentName;
|
||||
G4double currentCut;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmElementSelector.hh,v 1.2 2008/07/22 15:55:15 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmElementSelector.hh,v 1.6 2009/09/29 11:31:37 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -88,6 +88,7 @@ private:
|
||||
|
||||
G4VEmModel* model;
|
||||
const G4Material* material;
|
||||
const G4Element* element;
|
||||
const G4ElementVector* theElementVector;
|
||||
|
||||
G4int nElmMinusOne;
|
||||
@@ -106,18 +107,17 @@ private:
|
||||
|
||||
inline const G4Element* G4EmElementSelector::SelectRandomAtom(G4double e)
|
||||
{
|
||||
const G4Element* elm = (*theElementVector)[nElmMinusOne];
|
||||
if (nElmMinusOne > 0) {
|
||||
G4bool b;
|
||||
G4double x = G4UniformRand();
|
||||
for(G4int i=0; i<nElmMinusOne; i++) {
|
||||
if (x <= (xSections[i])->GetValue(e,b)) {
|
||||
elm = (*theElementVector)[i];
|
||||
element = (*theElementVector)[nElmMinusOne];
|
||||
for(G4int i=0; i<nElmMinusOne; ++i) {
|
||||
if (x <= (xSections[i])->Value(e)) {
|
||||
element = (*theElementVector)[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return elm;
|
||||
return element;
|
||||
}
|
||||
|
||||
inline const G4Material* G4EmElementSelector::GetMaterial() const
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmModelManager.hh,v 1.25 2008/10/13 14:56:56 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmModelManager.hh,v 1.34 2009/08/11 10:29:30 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -52,6 +52,9 @@
|
||||
// 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)
|
||||
// 08-04-08 Simplify Select method for only one G4RegionModel (VI)
|
||||
// 03-08-09 Removed unused members and simplify model search if only one
|
||||
// model is used (VI)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -90,28 +93,28 @@ private:
|
||||
|
||||
~G4RegionModels();
|
||||
|
||||
G4int SelectIndex(G4double e) const {
|
||||
inline G4int SelectIndex(G4double e) const {
|
||||
G4int idx = 0;
|
||||
if (nModelsForRegion>1) {
|
||||
idx = nModelsForRegion;
|
||||
do {idx--;} while (idx && e <= lowKineticEnergy[idx]);
|
||||
do {--idx;} while (idx > 0 && e <= lowKineticEnergy[idx]);
|
||||
}
|
||||
return theListOfModelIndexes[idx];
|
||||
};
|
||||
|
||||
G4int ModelIndex(G4int n) const {
|
||||
inline G4int ModelIndex(G4int n) const {
|
||||
return theListOfModelIndexes[n];
|
||||
};
|
||||
|
||||
G4int NumberOfModels() const {
|
||||
inline G4int NumberOfModels() const {
|
||||
return nModelsForRegion;
|
||||
};
|
||||
|
||||
G4double LowEdgeEnergy(G4int n) const {
|
||||
inline G4double LowEdgeEnergy(G4int n) const {
|
||||
return lowKineticEnergy[n];
|
||||
};
|
||||
|
||||
const G4Region* Region() const {
|
||||
inline const G4Region* Region() const {
|
||||
return theRegion;
|
||||
};
|
||||
|
||||
@@ -128,7 +131,6 @@ private:
|
||||
|
||||
class G4Region;
|
||||
class G4ParticleDefinition;
|
||||
class G4DataVector;
|
||||
class G4PhysicsVector;
|
||||
class G4MaterialCutsCouple;
|
||||
|
||||
@@ -149,30 +151,36 @@ public:
|
||||
G4double,
|
||||
G4int);
|
||||
|
||||
const G4DataVector* Cuts() const;
|
||||
|
||||
const G4DataVector* SubCutoff() const;
|
||||
|
||||
void FillDEDXVector(G4PhysicsVector*, const G4MaterialCutsCouple*,
|
||||
G4EmTableType t = fRestricted);
|
||||
|
||||
void FillLambdaVector(G4PhysicsVector*, const G4MaterialCutsCouple*,
|
||||
G4bool startFromNull = true, G4EmTableType t = fRestricted);
|
||||
|
||||
G4VEmModel* SelectModel(G4double& energy, size_t& index);
|
||||
|
||||
G4VEmModel* GetModel(G4int, G4bool ver = false);
|
||||
|
||||
G4int NumberOfModels() const;
|
||||
|
||||
void AddEmModel(G4int, G4VEmModel*, G4VEmFluctuationModel*, const G4Region*);
|
||||
|
||||
void UpdateEmModel(const G4String&, G4double, G4double);
|
||||
|
||||
void DumpModelList(G4int verb);
|
||||
|
||||
inline G4VEmModel* SelectModel(G4double& energy, size_t& index);
|
||||
|
||||
inline const G4DataVector* Cuts() const;
|
||||
|
||||
inline const G4DataVector* SubCutoff() const;
|
||||
|
||||
inline G4int NumberOfModels() const;
|
||||
|
||||
private:
|
||||
|
||||
inline G4double ComputeDEDX(G4VEmModel* model,
|
||||
const G4MaterialCutsCouple*,
|
||||
G4double kinEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double minEnergy);
|
||||
|
||||
// hide assignment operator
|
||||
|
||||
G4EmModelManager(G4EmModelManager &);
|
||||
@@ -189,28 +197,24 @@ private:
|
||||
std::vector<G4VEmFluctuationModel*> flucModels;
|
||||
std::vector<const G4Region*> regions;
|
||||
std::vector<G4int> orderOfModels;
|
||||
std::vector<G4int> isUsed;
|
||||
|
||||
G4int nEmModels;
|
||||
G4int nRegions;
|
||||
G4int nCouples;
|
||||
|
||||
G4int* idxOfRegionModels;
|
||||
G4RegionModels** setOfRegionModels;
|
||||
std::vector<G4int> idxOfRegionModels;
|
||||
std::vector<G4RegionModels*> setOfRegionModels;
|
||||
|
||||
G4double minSubRange;
|
||||
G4double maxCutInRange;
|
||||
G4double maxSubCutInRange;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
const G4ParticleDefinition* secondaryParticle;
|
||||
const G4ParticleDefinition* theGamma;
|
||||
const G4ParticleDefinition* thePositron;
|
||||
|
||||
G4int verboseLevel;
|
||||
G4bool severalModels;
|
||||
|
||||
// cash
|
||||
G4int currentIdx;
|
||||
|
||||
// may be changed in run time
|
||||
G4RegionModels* currRegionModel;
|
||||
G4VEmModel* currModel;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -219,9 +223,13 @@ private:
|
||||
inline G4VEmModel* G4EmModelManager::SelectModel(G4double& kinEnergy,
|
||||
size_t& index)
|
||||
{
|
||||
currentIdx =
|
||||
(setOfRegionModels[idxOfRegionModels[index]])->SelectIndex(kinEnergy);
|
||||
return models[currentIdx];
|
||||
if(severalModels) {
|
||||
if(nRegions > 1) {
|
||||
currRegionModel = setOfRegionModels[idxOfRegionModels[index]];
|
||||
}
|
||||
currModel = models[currRegionModel->SelectIndex(kinEnergy)];
|
||||
}
|
||||
return currModel;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -247,5 +255,22 @@ inline G4int G4EmModelManager::NumberOfModels() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double
|
||||
G4EmModelManager::ComputeDEDX(G4VEmModel* model,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
G4double e,
|
||||
G4double cut,
|
||||
G4double emin)
|
||||
{
|
||||
G4double dedx = 0.0;
|
||||
if(model && cut > emin) {
|
||||
dedx = model->ComputeDEDX(couple,particle,e,cut);
|
||||
if(emin > 0.0) {dedx -= model->ComputeDEDX(couple,particle,e,emin);}
|
||||
}
|
||||
return dedx;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmProcessOptions.hh,v 1.14 2008/04/17 10:33:26 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmProcessOptions.hh,v 1.16 2009/10/29 19:25:28 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -106,7 +106,8 @@ public:
|
||||
|
||||
void SetLinearLossLimit(G4double val);
|
||||
|
||||
void ActivateDeexcitation(G4bool val, const G4Region* r = 0);
|
||||
void ActivateDeexcitation(const G4String& proc, G4bool val,
|
||||
const G4String& reg = "");
|
||||
|
||||
void SetMscStepLimitation(G4MscStepLimitType val);
|
||||
|
||||
@@ -126,6 +127,8 @@ public:
|
||||
|
||||
void SetPolarAngleLimit(G4double val);
|
||||
|
||||
void SetFactorForAngleLimit(G4double val);
|
||||
|
||||
private:
|
||||
|
||||
G4EmProcessOptions & operator=(const G4EmProcessOptions &right);
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmSaturation.hh,v 1.6 2008/03/17 11:27:32 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmSaturation.hh,v 1.7 2009/09/25 09:16:40 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
//
|
||||
#ifndef G4EmSaturation_h
|
||||
@@ -103,9 +103,7 @@ private:
|
||||
|
||||
void Initialise();
|
||||
|
||||
const G4ParticleDefinition* gamma;
|
||||
const G4ParticleDefinition* electron;
|
||||
const G4ParticleDefinition* neutron;
|
||||
const G4ParticleDefinition* proton;
|
||||
G4LossTableManager* manager;
|
||||
G4NistManager* nist;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EnergyLossMessenger.hh,v 1.22 2008/10/20 13:27:45 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EnergyLossMessenger.hh,v 1.24 2009/10/29 19:25:28 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -106,6 +106,7 @@ private:
|
||||
G4UIcmdWithABool* SubSecCmd;
|
||||
G4UIcmdWithADouble* MinSubSecCmd;
|
||||
G4UIcommand* StepFuncCmd;
|
||||
G4UIcommand* deexCmd;
|
||||
G4UIcmdWithAString* mscCmd;
|
||||
G4UIcmdWithADoubleAndUnit* MinEnCmd;
|
||||
G4UIcmdWithADoubleAndUnit* MaxEnCmd;
|
||||
@@ -124,6 +125,7 @@ private:
|
||||
G4UIcmdWithADouble* skinCmd;
|
||||
G4UIcmdWithADouble* frCmd;
|
||||
G4UIcmdWithADouble* fgCmd;
|
||||
G4UIcmdWithADouble* mscfCmd;
|
||||
G4UIcmdWithADoubleAndUnit* angCmd;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LossTableManager.hh,v 1.53 2008/07/15 16:56:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4LossTableManager.hh,v 1.55 2009/10/29 19:25:28 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -90,6 +90,7 @@ class G4VMultipleScattering;
|
||||
class G4VEmProcess;
|
||||
class G4EmCorrections;
|
||||
class G4EmSaturation;
|
||||
class G4EmConfigurator;
|
||||
class G4LossTableBuilder;
|
||||
|
||||
class G4LossTableManager
|
||||
@@ -208,6 +209,8 @@ public:
|
||||
|
||||
void SetBremsstrahlungTh(G4double val);
|
||||
|
||||
void SetFactorForAngleLimit(G4double val);
|
||||
|
||||
void SetVerbose(G4int val);
|
||||
|
||||
G4EnergyLossMessenger* GetMessenger();
|
||||
@@ -220,6 +223,8 @@ public:
|
||||
|
||||
G4double BremsstrahlungTh() const;
|
||||
|
||||
G4double FactorForAngleLimit() const;
|
||||
|
||||
const std::vector<G4VEnergyLossProcess*>& GetEnergyLossProcessVector();
|
||||
|
||||
const std::vector<G4VEmProcess*>& GetEmProcessVector();
|
||||
@@ -232,6 +237,8 @@ public:
|
||||
|
||||
G4EmSaturation* EmSaturation();
|
||||
|
||||
G4EmConfigurator* EmConfigurator();
|
||||
|
||||
private:
|
||||
|
||||
G4LossTableManager();
|
||||
@@ -298,11 +305,13 @@ private:
|
||||
G4double maxKinEnergy;
|
||||
G4double maxKinEnergyForMuons;
|
||||
G4double bremsTh;
|
||||
G4double factorForAngleLimit;
|
||||
|
||||
G4LossTableBuilder* tableBuilder;
|
||||
G4EnergyLossMessenger* theMessenger;
|
||||
G4EmCorrections* emCorrections;
|
||||
G4EmSaturation* emSaturation;
|
||||
G4EmConfigurator* emConfigurator;
|
||||
|
||||
const G4ParticleDefinition* firstParticle;
|
||||
G4int verbose;
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VAtomDeexcitation.hh,v 1.1 2009/07/09 11:42:52 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class header file
|
||||
//
|
||||
//
|
||||
// File name: G4VAtomDeexcitation
|
||||
//
|
||||
// Author: Alfonso Mantero & Vladimir Ivanchenko
|
||||
//
|
||||
// Creation date: 30.06.2009
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// Abstract interface to energy loss models
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#ifndef G4VAtomDeexcitation_h
|
||||
#define G4VAtomDeexcitation_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
|
||||
class G4AtomicShell;
|
||||
class G4ParticleDefinition;
|
||||
class G4DynamicParticle;
|
||||
|
||||
class G4VAtomDeexcitation {
|
||||
|
||||
G4VAtomDeexcitation(const G4String& pname = "");
|
||||
|
||||
virtual ~G4VAtomDeexcitation();
|
||||
|
||||
//initialization
|
||||
virtual void PreparePhysicsTable(const G4ParticleDefinition&);
|
||||
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
|
||||
|
||||
// Get atomic shell by shell index, used by discrete processes
|
||||
// (for example, photoelectric), when shell vacancy sampled by the model
|
||||
virtual const G4AtomicChell* GetAtomicShell(G4int Z, G4int ShellIndex);
|
||||
|
||||
// selection of random shell for ionisation process
|
||||
virtual const G4AtomicShell* SelectRandomShell(const G4DynamicParticle*,
|
||||
G4int Z);
|
||||
|
||||
// generation of deexcitation for given atom and shell vacancy
|
||||
virtual void GenerateParticles(std::vector<G4DynamicParticle*>*,
|
||||
const G4AtomicChell*, G4int Z);
|
||||
|
||||
// access or compute PIXE cross section
|
||||
virtual G4double GetPIXECrossSection (const G4ParticleDefinition*,
|
||||
G4int Z, G4double kinE);
|
||||
|
||||
// calculate PIXE cross section from the models
|
||||
virtual G4double CalculatePIXECrossSection(const G4ParticleDefinition*,
|
||||
G4int Z, G4double kinE);
|
||||
|
||||
// Sampling of PIXE for ionisation processes
|
||||
virtual void
|
||||
AlongStepDeexcitation(std::vector<G4DynamicParticle*>* secVect,
|
||||
const G4DynamicParticle* icidentParticle,
|
||||
const G4MaterialCutsCouple*,
|
||||
G4double trueStepLenght,
|
||||
G4double eLoss);
|
||||
|
||||
// Check if deexcitation is active for a given geometry volume
|
||||
G4bool CheckActiveRegion(G4int coupleIndex);
|
||||
|
||||
// Access flags defined in the CheckActiveVolume method
|
||||
inline G4bool IsFluorescenceActive() const;
|
||||
inline G4bool IsPIXECrossSectionActive() const;
|
||||
|
||||
// PIXE model name
|
||||
inline void SetPIXECrossSectionModel(const G4String&);
|
||||
inline const G4String& PIXECrossSectionModel() const;
|
||||
|
||||
// Activation of deexcitation per detector region
|
||||
void SetFluorescenceActiveRegion(const G4Region* region = 0);
|
||||
void SetAugerActiveRegion(const G4Region* region = 0);
|
||||
void SetPIXECrossSectionActiveRegion(const G4Region* region = 0);
|
||||
|
||||
void SetFluorescenceActiveRegion(const G4String& rname = "");
|
||||
void SetAugerActiveRegion(const G4String& rname = "");
|
||||
void SetPIXECrossSectionActiveRegion(const G4String& rname = "");
|
||||
|
||||
private:
|
||||
|
||||
// copy constructor and hide assignment operator
|
||||
G4VAtomDeexcitation(G4VAtomDeexcitation &);
|
||||
G4VAtomDeexcitation & operator=(const G4VAtomDeexcitation &right);
|
||||
|
||||
G4String namePIXE;
|
||||
G4bool isFluoActive;
|
||||
G4bool isPIXEActive;
|
||||
|
||||
};
|
||||
|
||||
inline G4bool IsFluorescenceActive() const
|
||||
{
|
||||
return isFluoActive;
|
||||
}
|
||||
|
||||
inline G4bool IsPIXECrossSectionActive() const
|
||||
{
|
||||
return isPIXEActive;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4VAtomDeexcitation::SetPIXECrossSectionModel(const G4String& n)
|
||||
{
|
||||
namePIXE = n;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4String& G4VAtomDeexcitation::PIXECrossSectionModel() const
|
||||
{
|
||||
return namePIXE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmFluctuationModel.hh,v 1.11 2008/09/12 14:47:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VEmFluctuationModel.hh,v 1.12 2009/02/19 11:25:50 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -100,7 +100,7 @@ public:
|
||||
// Generic methods common to all models
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
G4String GetName() const;
|
||||
inline G4String GetName() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -114,14 +114,6 @@ private:
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmFluctuationModel::InitialiseMe(const G4ParticleDefinition*)
|
||||
{}
|
||||
|
||||
inline
|
||||
void G4VEmFluctuationModel::SetParticleAndCharge(const G4ParticleDefinition*,
|
||||
G4double)
|
||||
{}
|
||||
|
||||
inline G4String G4VEmFluctuationModel::GetName() const
|
||||
{
|
||||
return name;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmModel.hh,v 1.59 2008/11/13 19:29:41 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VEmModel.hh,v 1.72 2009/09/23 14:42:47 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -64,6 +64,8 @@
|
||||
// 21-07-08 Added vector of G4ElementSelector and methods to use it (VI)
|
||||
// 12-09-08 Added methods GetParticleCharge, GetChargeSquareRatio,
|
||||
// CorrectionsAlongStep, ActivateNuclearStopping (VI)
|
||||
// 16-02-09 Moved implementations of virtual methods to source (VI)
|
||||
// 07-04-09 Moved msc methods from G4VEmModel to G4VMscModel (VI)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -91,6 +93,8 @@
|
||||
class G4PhysicsTable;
|
||||
class G4Region;
|
||||
class G4VParticleChange;
|
||||
class G4ParticleChangeForLoss;
|
||||
class G4ParticleChangeForGamma;
|
||||
class G4Track;
|
||||
|
||||
class G4VEmModel
|
||||
@@ -119,25 +123,12 @@ public:
|
||||
// Methods with standard implementation; may be overwritten if needed
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// dEdx per unit length
|
||||
virtual G4double ComputeDEDX(const G4MaterialCutsCouple*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = DBL_MAX);
|
||||
|
||||
// main method to compute dEdx
|
||||
virtual G4double ComputeDEDXPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = DBL_MAX);
|
||||
|
||||
// cross section per volume
|
||||
virtual G4double CrossSection(const G4MaterialCutsCouple*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
// main method to compute cross section per Volume
|
||||
virtual G4double CrossSectionPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
@@ -145,7 +136,7 @@ public:
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
// main method to compute cross section depending on atom
|
||||
// main method to compute cross section per atom
|
||||
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
|
||||
G4double kinEnergy,
|
||||
G4double Z,
|
||||
@@ -167,42 +158,40 @@ public:
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
// add correction to energy loss and ompute non-ionizing energy loss
|
||||
// add correction to energy loss and compute non-ionizing energy loss
|
||||
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double& eloss,
|
||||
G4double& niel,
|
||||
G4double length);
|
||||
|
||||
// sample PIXE deexcitation
|
||||
virtual void SampleDeexcitationAlongStep(const G4Material*,
|
||||
const G4Track&,
|
||||
G4double& eloss);
|
||||
|
||||
// initilisation at run time for a given material
|
||||
virtual void SetupForMaterial(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
// add a region for the model
|
||||
virtual void DefineForRegion(const G4Region*);
|
||||
|
||||
protected:
|
||||
|
||||
// initialisation of the ParticleChange for the model
|
||||
G4ParticleChangeForLoss* GetParticleChangeForLoss();
|
||||
|
||||
// initialisation of the ParticleChange for the model
|
||||
G4ParticleChangeForGamma* GetParticleChangeForGamma();
|
||||
|
||||
// kinematically allowed max kinetic energy of a secondary
|
||||
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Methods for msc simulation which needs to be overwritten
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
public:
|
||||
|
||||
virtual void SampleScattering(const G4DynamicParticle*,
|
||||
G4double safety);
|
||||
|
||||
virtual G4double ComputeTruePathLengthLimit(const G4Track& track,
|
||||
G4PhysicsTable* theLambdaTable,
|
||||
G4double currentMinimalStep);
|
||||
|
||||
virtual G4double ComputeGeomPathLength(G4double truePathLength);
|
||||
|
||||
virtual G4double ComputeTrueStepLength(G4double geomPathLength);
|
||||
|
||||
virtual void DefineForRegion(const G4Region*);
|
||||
|
||||
virtual void SetupForMaterial(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Generic methods common to all models
|
||||
//------------------------------------------------------------------------
|
||||
@@ -211,13 +200,26 @@ public:
|
||||
void InitialiseElementSelectors(const G4ParticleDefinition*,
|
||||
const G4DataVector&);
|
||||
|
||||
// compute mean free path via cross section per volume
|
||||
G4double ComputeMeanFreePath(const G4ParticleDefinition*,
|
||||
// dEdx per unit length
|
||||
inline G4double ComputeDEDX(const G4MaterialCutsCouple*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = DBL_MAX);
|
||||
|
||||
// cross section per volume
|
||||
inline G4double CrossSection(const G4MaterialCutsCouple*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
const G4Material*,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
// compute mean free path via cross section per volume
|
||||
inline G4double ComputeMeanFreePath(const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
const G4Material*,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
// generic cross section per element
|
||||
inline G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
|
||||
const G4Element*,
|
||||
@@ -232,8 +234,7 @@ public:
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
// this method can be used only in the case if generic method to compute
|
||||
// cross section per volume is used and not overwritten in derived class
|
||||
// to select atom cross section per volume is recomputed for each element
|
||||
inline const G4Element* SelectRandomAtom(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
@@ -259,16 +260,26 @@ public:
|
||||
|
||||
inline G4bool LPMFlag() const;
|
||||
|
||||
inline G4bool DeexcitationFlag() const;
|
||||
|
||||
inline void SetHighEnergyLimit(G4double);
|
||||
|
||||
inline void SetLowEnergyLimit(G4double);
|
||||
|
||||
inline void SetActivationHighEnergyLimit(G4double);
|
||||
|
||||
inline void SetActivationLowEnergyLimit(G4double);
|
||||
|
||||
inline G4bool IsActive(G4double kinEnergy);
|
||||
|
||||
inline void SetPolarAngleLimit(G4double);
|
||||
|
||||
inline void SetSecondaryThreshold(G4double);
|
||||
|
||||
inline void SetLPMFlag(G4bool val);
|
||||
|
||||
inline void SetDeexcitationFlag(G4bool val);
|
||||
|
||||
inline void ActivateNuclearStopping(G4bool);
|
||||
|
||||
inline G4double MaxSecondaryKinEnergy(const G4DynamicParticle* dynParticle);
|
||||
@@ -277,12 +288,16 @@ public:
|
||||
|
||||
inline void SetParticleChange(G4VParticleChange*, G4VEmFluctuationModel*);
|
||||
|
||||
inline void SetCurrentCouple(const G4MaterialCutsCouple*);
|
||||
|
||||
protected:
|
||||
|
||||
inline const G4Element* GetCurrentElement() const;
|
||||
inline const G4MaterialCutsCouple* CurrentCouple() const;
|
||||
|
||||
inline void SetCurrentElement(const G4Element*);
|
||||
|
||||
inline const G4Element* GetCurrentElement() const;
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
@@ -298,6 +313,8 @@ private:
|
||||
|
||||
G4double lowLimit;
|
||||
G4double highLimit;
|
||||
G4double eMinActive;
|
||||
G4double eMaxActive;
|
||||
G4double polarAngleLimit;
|
||||
G4double secondaryThreshold;
|
||||
G4bool theLPMflag;
|
||||
@@ -314,8 +331,11 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
const G4Element* currentElement;
|
||||
const G4MaterialCutsCouple* currentCouple;
|
||||
const G4Element* currentElement;
|
||||
|
||||
G4int nsec;
|
||||
G4bool flagDeexcitation;
|
||||
std::vector<G4double> xsec;
|
||||
|
||||
};
|
||||
@@ -323,79 +343,39 @@ private:
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::HighEnergyLimit() const
|
||||
inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c,
|
||||
const G4ParticleDefinition* p,
|
||||
G4double kinEnergy,
|
||||
G4double cutEnergy)
|
||||
{
|
||||
return highLimit;
|
||||
currentCouple = c;
|
||||
return ComputeDEDXPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::LowEnergyLimit() const
|
||||
inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* c,
|
||||
const G4ParticleDefinition* p,
|
||||
G4double kinEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
return lowLimit;
|
||||
currentCouple = c;
|
||||
return CrossSectionPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy,maxEnergy);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::PolarAngleLimit() const
|
||||
inline G4double G4VEmModel::ComputeMeanFreePath(const G4ParticleDefinition* p,
|
||||
G4double ekin,
|
||||
const G4Material* material,
|
||||
G4double emin,
|
||||
G4double emax)
|
||||
{
|
||||
return polarAngleLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::SecondaryThreshold() const
|
||||
{
|
||||
return secondaryThreshold;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4bool G4VEmModel::LPMFlag() const
|
||||
{
|
||||
return theLPMflag;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetHighEnergyLimit(G4double val)
|
||||
{
|
||||
highLimit = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetLowEnergyLimit(G4double val)
|
||||
{
|
||||
lowLimit = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetPolarAngleLimit(G4double val)
|
||||
{
|
||||
polarAngleLimit = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetSecondaryThreshold(G4double val)
|
||||
{
|
||||
secondaryThreshold = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmModel::SetLPMFlag(G4bool val)
|
||||
{
|
||||
theLPMflag = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmModel::ActivateNuclearStopping(G4bool val)
|
||||
{
|
||||
nuclearStopping = val;
|
||||
G4double mfp = DBL_MAX;
|
||||
G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax);
|
||||
if (cross > DBL_MIN) mfp = 1./cross;
|
||||
return mfp;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -414,96 +394,6 @@ inline G4double G4VEmModel::ComputeCrossSectionPerAtom(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetParticleChange(G4VParticleChange* p,
|
||||
G4VEmFluctuationModel* f = 0)
|
||||
{
|
||||
if(p && pParticleChange != p) pParticleChange = p;
|
||||
fluc = f;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()
|
||||
{
|
||||
return fluc;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple*)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
|
||||
const G4Material*, G4double)
|
||||
{
|
||||
G4double q = p->GetPDGCharge()/CLHEP::eplus;
|
||||
return q*q;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p,
|
||||
const G4Material*, G4double)
|
||||
{
|
||||
return p->GetPDGCharge();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double&,G4double&,G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double,G4double)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c,
|
||||
const G4ParticleDefinition* p,
|
||||
G4double kinEnergy,
|
||||
G4double cutEnergy)
|
||||
{
|
||||
return ComputeDEDXPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* c,
|
||||
const G4ParticleDefinition* p,
|
||||
G4double kinEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
return CrossSectionPerVolume(c->GetMaterial(),p,
|
||||
kinEnergy,cutEnergy,maxEnergy);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::ComputeCrossSectionPerAtom(
|
||||
const G4ParticleDefinition*,
|
||||
G4double, G4double, G4double,
|
||||
G4double, G4double)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline
|
||||
const G4Element* G4VEmModel::SelectRandomAtom(const G4MaterialCutsCouple* couple,
|
||||
const G4ParticleDefinition* p,
|
||||
@@ -511,6 +401,7 @@ const G4Element* G4VEmModel::SelectRandomAtom(const G4MaterialCutsCouple* couple
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
currentCouple = couple;
|
||||
if(nSelectors > 0) {
|
||||
currentElement =
|
||||
elmSelectors[couple->GetIndex()]->SelectRandomAtom(kinEnergy);
|
||||
@@ -550,12 +441,13 @@ const G4Element* G4VEmModel::SelectRandomAtom(const G4Material* material,
|
||||
|
||||
inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm)
|
||||
{
|
||||
currentElement = elm;
|
||||
G4int N = G4int(elm->GetN() + 0.5);
|
||||
G4int ni = elm->GetNumberOfIsotopes();
|
||||
if(ni > 0) {
|
||||
G4int idx = 0;
|
||||
if(ni > 1) {
|
||||
G4double* ab = currentElement->GetRelativeAbundanceVector();
|
||||
G4double* ab = elm->GetRelativeAbundanceVector();
|
||||
G4double x = G4UniformRand();
|
||||
for(; idx<ni; idx++) {
|
||||
x -= ab[idx];
|
||||
@@ -570,16 +462,121 @@ inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline const G4Element* G4VEmModel::GetCurrentElement() const
|
||||
inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()
|
||||
{
|
||||
return currentElement;
|
||||
return fluc;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
|
||||
inline G4double G4VEmModel::HighEnergyLimit() const
|
||||
{
|
||||
currentElement = elm;
|
||||
return highLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::LowEnergyLimit() const
|
||||
{
|
||||
return lowLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::PolarAngleLimit() const
|
||||
{
|
||||
return polarAngleLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::SecondaryThreshold() const
|
||||
{
|
||||
return secondaryThreshold;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4bool G4VEmModel::LPMFlag() const
|
||||
{
|
||||
return theLPMflag;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4bool G4VEmModel::DeexcitationFlag() const
|
||||
{
|
||||
return flagDeexcitation;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetHighEnergyLimit(G4double val)
|
||||
{
|
||||
highLimit = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetLowEnergyLimit(G4double val)
|
||||
{
|
||||
lowLimit = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetActivationHighEnergyLimit(G4double val)
|
||||
{
|
||||
eMaxActive = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetActivationLowEnergyLimit(G4double val)
|
||||
{
|
||||
eMinActive = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4bool G4VEmModel::IsActive(G4double kinEnergy)
|
||||
{
|
||||
return (kinEnergy >= eMinActive && kinEnergy <= eMaxActive);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetPolarAngleLimit(G4double val)
|
||||
{
|
||||
polarAngleLimit = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetSecondaryThreshold(G4double val)
|
||||
{
|
||||
secondaryThreshold = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmModel::SetLPMFlag(G4bool val)
|
||||
{
|
||||
theLPMflag = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmModel::SetDeexcitationFlag(G4bool val)
|
||||
{
|
||||
flagDeexcitation = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmModel::ActivateNuclearStopping(G4bool val)
|
||||
{
|
||||
nuclearStopping = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -593,60 +590,47 @@ G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
|
||||
G4double kineticEnergy)
|
||||
{
|
||||
return kineticEnergy;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline const G4String& G4VEmModel::GetName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
// Methods for msc simulation
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SampleScattering(const G4DynamicParticle*, G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::ComputeTruePathLengthLimit(
|
||||
const G4Track&,
|
||||
G4PhysicsTable*,
|
||||
G4double)
|
||||
inline void G4VEmModel::SetParticleChange(G4VParticleChange* p,
|
||||
G4VEmFluctuationModel* f = 0)
|
||||
{
|
||||
return DBL_MAX;
|
||||
if(p && pParticleChange != p) pParticleChange = p;
|
||||
fluc = f;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::ComputeGeomPathLength(G4double truePathLength)
|
||||
inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p)
|
||||
{
|
||||
return truePathLength;
|
||||
currentCouple = p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::ComputeTrueStepLength(G4double geomPathLength)
|
||||
inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const
|
||||
{
|
||||
return geomPathLength;
|
||||
return currentCouple;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::DefineForRegion(const G4Region*)
|
||||
{}
|
||||
inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
|
||||
{
|
||||
currentElement = elm;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*,
|
||||
const G4Material*, G4double)
|
||||
{}
|
||||
inline const G4Element* G4VEmModel::GetCurrentElement() const
|
||||
{
|
||||
return currentElement;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmProcess.hh,v 1.47 2008/07/31 13:01:26 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VEmProcess.hh,v 1.55 2009/09/23 14:42:47 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -107,28 +107,29 @@ protected:
|
||||
virtual void InitialiseProcess(const G4ParticleDefinition*) = 0;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Methods with standard implementation; may be overwritten if needed
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
inline G4double RecalculateLambda(G4double kinEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Generic methods common to all Discrete processes
|
||||
// Implementation of virtual methods common to all Discrete processes
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
public:
|
||||
|
||||
void PrintInfoDefinition();
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
// Initialise for build of tables
|
||||
void PreparePhysicsTable(const G4ParticleDefinition&);
|
||||
|
||||
// Build physics table during initialisation
|
||||
void BuildPhysicsTable(const G4ParticleDefinition&);
|
||||
|
||||
void PrintInfoDefinition();
|
||||
|
||||
// implementation of virtual method, specific for G4VEmProcess
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
// implementation of virtual method, specific for G4VEmProcess
|
||||
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
// Store PhysicsTable in a file.
|
||||
// Return false in case of failure at I/O
|
||||
G4bool StorePhysicsTable(const G4ParticleDefinition*,
|
||||
@@ -144,6 +145,9 @@ public:
|
||||
const G4String& directory,
|
||||
G4bool ascii);
|
||||
|
||||
// deexcitation activated per G4Region
|
||||
void ActivateDeexcitation(G4bool, const G4Region* r = 0);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Specific methods for Discrete EM post step simulation
|
||||
//------------------------------------------------------------------------
|
||||
@@ -152,13 +156,6 @@ public:
|
||||
G4double CrossSectionPerVolume(G4double kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
|
||||
// implementation of virtual method
|
||||
virtual G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
// It returns the cross section of the process per atom
|
||||
inline G4double ComputeCrossSectionPerAtom(G4double kineticEnergy,
|
||||
G4double Z, G4double A=0.,
|
||||
@@ -166,9 +163,6 @@ public:
|
||||
|
||||
inline G4double MeanFreePath(const G4Track& track);
|
||||
|
||||
inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy,
|
||||
size_t& idxRegion) const;
|
||||
|
||||
// It returns cross section per volume
|
||||
inline G4double GetLambda(G4double& kinEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
@@ -202,29 +196,33 @@ public:
|
||||
inline const G4ParticleDefinition* SecondaryParticle() const;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Specific methods to set, access, modify models
|
||||
// Specific methods to set, access, modify models and basic parameters
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// Add EM model coupled for the region
|
||||
inline void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
|
||||
protected:
|
||||
// Select model in run time
|
||||
inline G4VEmModel* SelectModel(G4double& kinEnergy, size_t index);
|
||||
|
||||
public:
|
||||
// Select model by energy and region index
|
||||
inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy,
|
||||
size_t& idxRegion) const;
|
||||
|
||||
// Add model for region, smaller value of order defines which
|
||||
// model will be selected for a given energy interval
|
||||
void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
|
||||
|
||||
// Assign a model to a process
|
||||
inline void SetModel(G4VEmModel*);
|
||||
void SetModel(G4VEmModel*, G4int index = 1);
|
||||
|
||||
// return the assigned model
|
||||
inline G4VEmModel* Model();
|
||||
G4VEmModel* Model(G4int index = 1);
|
||||
|
||||
// Define new energy range for the model identified by the name
|
||||
inline void UpdateEmModel(const G4String&, G4double, G4double);
|
||||
void UpdateEmModel(const G4String&, G4double, G4double);
|
||||
|
||||
// Access to models
|
||||
inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Get/set parameters used for simulation of energy loss
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
inline void ActivateDeexcitation(G4bool, const G4Region* r = 0);
|
||||
G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
|
||||
|
||||
inline void SetLambdaFactor(G4double val);
|
||||
|
||||
@@ -232,6 +230,10 @@ public:
|
||||
inline G4bool IsIntegral() const;
|
||||
|
||||
inline void SetApplyCuts(G4bool val);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Other generic methods
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
protected:
|
||||
|
||||
@@ -241,14 +243,15 @@ protected:
|
||||
|
||||
G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*);
|
||||
|
||||
inline G4double RecalculateLambda(G4double kinEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
|
||||
inline G4ParticleChangeForGamma* GetParticleChange();
|
||||
|
||||
inline void SetParticle(const G4ParticleDefinition* p);
|
||||
|
||||
inline void SetSecondaryParticle(const G4ParticleDefinition* p);
|
||||
|
||||
inline G4VEmModel* SelectModel(G4double& kinEnergy);
|
||||
|
||||
inline size_t CurrentMaterialCutsCoupleIndex() const;
|
||||
|
||||
inline G4double GetGammaEnergyCut();
|
||||
@@ -279,8 +282,7 @@ private:
|
||||
|
||||
inline G4double ComputeCurrentLambda(G4double kinEnergy);
|
||||
|
||||
// hide assignment operator
|
||||
|
||||
// copy constructor and hide assignment operator
|
||||
G4VEmProcess(G4VEmProcess &);
|
||||
G4VEmProcess & operator=(const G4VEmProcess &right);
|
||||
|
||||
@@ -296,6 +298,8 @@ private:
|
||||
|
||||
// ======== Parameters of the class fixed at initialisation =======
|
||||
|
||||
std::vector<G4VEmModel*> emModels;
|
||||
|
||||
// tables and vectors
|
||||
G4PhysicsTable* theLambdaTable;
|
||||
G4double* theEnergyOfCrossSectionMax;
|
||||
@@ -316,10 +320,11 @@ private:
|
||||
G4bool integral;
|
||||
G4bool applyCuts;
|
||||
G4bool startFromNull;
|
||||
G4bool useDeexcitation;
|
||||
|
||||
G4int nRegions;
|
||||
std::vector<G4Region*> regions;
|
||||
std::vector<G4bool> flagsDeexcitation;
|
||||
G4int nDERegions;
|
||||
std::vector<const G4Region*> deRegions;
|
||||
G4bool* idxDERegions;
|
||||
|
||||
// ======== Cashed values - may be state dependent ================
|
||||
|
||||
@@ -331,14 +336,14 @@ private:
|
||||
|
||||
std::vector<G4DynamicParticle*> secParticles;
|
||||
|
||||
G4VEmModel* selectedModel;
|
||||
G4VEmModel* currentModel;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
|
||||
// cash
|
||||
const G4Material* currentMaterial;
|
||||
const G4MaterialCutsCouple* currentCouple;
|
||||
size_t currentMaterialIndex;
|
||||
size_t currentCoupleIndex;
|
||||
|
||||
G4double mfpKinEnergy;
|
||||
G4double preStepKinEnergy;
|
||||
@@ -349,94 +354,16 @@ private:
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
if(couple != currentCouple) {
|
||||
currentCouple = couple;
|
||||
currentMaterial = couple->GetMaterial();
|
||||
currentMaterialIndex = couple->GetIndex();
|
||||
mfpKinEnergy = DBL_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::InitialiseStep(const G4Track& track)
|
||||
{
|
||||
preStepKinEnergy = track.GetKineticEnergy();
|
||||
DefineMaterial(track.GetMaterialCutsCouple());
|
||||
if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
DefineMaterial(couple);
|
||||
return GetCurrentLambda(kineticEnergy);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::GetCurrentLambda(G4double e)
|
||||
inline G4double G4VEmProcess::ComputeCrossSectionPerAtom(
|
||||
G4double kineticEnergy, G4double Z, G4double A, G4double cut)
|
||||
{
|
||||
SelectModel(kineticEnergy, currentCoupleIndex);
|
||||
G4double x = 0.0;
|
||||
if(theLambdaTable) x = GetLambdaFromTable(e);
|
||||
else x = ComputeCurrentLambda(e);
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::RecalculateLambda(G4double e,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
DefineMaterial(couple);
|
||||
return ComputeCurrentLambda(e);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e)
|
||||
{
|
||||
G4VEmModel* currentModel = SelectModel(e);
|
||||
G4double x = 0.0;
|
||||
if(currentModel)
|
||||
x = currentModel->CrossSectionPerVolume(currentMaterial,particle,
|
||||
e,(*theCuts)[currentMaterialIndex]);
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::GetLambdaFromTable(G4double e)
|
||||
{
|
||||
G4bool b;
|
||||
return (((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::ComputeIntegralLambda(G4double e)
|
||||
{
|
||||
mfpKinEnergy = theEnergyOfCrossSectionMax[currentMaterialIndex];
|
||||
if (e <= mfpKinEnergy) {
|
||||
preStepLambda = GetLambdaFromTable(e);
|
||||
|
||||
} else {
|
||||
G4double e1 = e*lambdaFactor;
|
||||
if(e1 > mfpKinEnergy) {
|
||||
preStepLambda = GetLambdaFromTable(e);
|
||||
G4double preStepLambda1 = GetLambdaFromTable(e1);
|
||||
if(preStepLambda1 > preStepLambda) {
|
||||
mfpKinEnergy = e1;
|
||||
preStepLambda = preStepLambda1;
|
||||
}
|
||||
} else {
|
||||
preStepLambda = theCrossSectionMax[currentMaterialIndex];
|
||||
}
|
||||
if(currentModel) {
|
||||
x = currentModel->ComputeCrossSectionPerAtom(particle,kineticEnergy,
|
||||
Z,A,cut);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -452,121 +379,11 @@ inline G4double G4VEmProcess::MeanFreePath(const G4Track& track)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy)
|
||||
inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VEmProcess::SelectModelForMaterial(
|
||||
G4double kinEnergy, size_t& idxRegion) const
|
||||
{
|
||||
return modelManager->SelectModel(kinEnergy, idxRegion);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline const G4ParticleDefinition* G4VEmProcess::Particle() const
|
||||
{
|
||||
return particle;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const
|
||||
{
|
||||
return secondaryParticle;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::GetGammaEnergyCut()
|
||||
{
|
||||
return (*theCutsGamma)[currentMaterialIndex];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::GetElectronEnergyCut()
|
||||
{
|
||||
return (*theCutsElectron)[currentMaterialIndex];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetLambdaFactor(G4double val)
|
||||
{
|
||||
if(val > 0.0 && val <= 1.0) lambdaFactor = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VEmProcess::GetModelByIndex(G4int idx, G4bool ver)
|
||||
{
|
||||
return modelManager->GetModel(idx, ver);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4ParticleChangeForGamma* G4VEmProcess::GetParticleChange()
|
||||
{
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetParticle(const G4ParticleDefinition* p)
|
||||
{
|
||||
particle = p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
|
||||
{
|
||||
secondaryParticle = p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::AddEmModel(G4int order, G4VEmModel* p,
|
||||
const G4Region* region)
|
||||
{
|
||||
G4VEmFluctuationModel* fm = 0;
|
||||
modelManager->AddEmModel(order, p, fm, region);
|
||||
if(p) p->SetParticleChange(pParticleChange);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetModel(G4VEmModel* model)
|
||||
{
|
||||
selectedModel = model;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VEmProcess::Model()
|
||||
{
|
||||
return selectedModel;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::UpdateEmModel(const G4String& nam,
|
||||
G4double emin, G4double emax)
|
||||
{
|
||||
modelManager->UpdateEmModel(nam, emin, emax);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::ComputeCrossSectionPerAtom(
|
||||
G4double kineticEnergy, G4double Z, G4double A, G4double cut)
|
||||
{
|
||||
G4VEmModel* model = SelectModel(kineticEnergy);
|
||||
return model->ComputeCrossSectionPerAtom(particle,kineticEnergy,Z,A,cut);
|
||||
DefineMaterial(couple);
|
||||
return GetCurrentLambda(kineticEnergy);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -629,11 +446,6 @@ inline G4double G4VEmProcess::PolarAngleLimit() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::ActivateDeexcitation(G4bool, const G4Region*)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline const G4PhysicsTable* G4VEmProcess::LambdaTable() const
|
||||
{
|
||||
return theLambdaTable;
|
||||
@@ -641,6 +453,46 @@ inline const G4PhysicsTable* G4VEmProcess::LambdaTable() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline const G4ParticleDefinition* G4VEmProcess::Particle() const
|
||||
{
|
||||
return particle;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const
|
||||
{
|
||||
return secondaryParticle;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline
|
||||
G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy, size_t index)
|
||||
{
|
||||
currentModel = modelManager->SelectModel(kinEnergy, index);
|
||||
currentModel->SetCurrentCouple(currentCouple);
|
||||
return currentModel;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline
|
||||
G4VEmModel* G4VEmProcess::SelectModelForMaterial(G4double kinEnergy,
|
||||
size_t& idxRegion) const
|
||||
{
|
||||
return modelManager->SelectModel(kinEnergy, idxRegion);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetLambdaFactor(G4double val)
|
||||
{
|
||||
if(val > 0.0 && val <= 1.0) lambdaFactor = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetIntegral(G4bool val)
|
||||
{
|
||||
if(particle && particle != theGamma) integral = val;
|
||||
@@ -656,6 +508,64 @@ inline G4bool G4VEmProcess::IsIntegral() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetApplyCuts(G4bool val)
|
||||
{
|
||||
applyCuts = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::RecalculateLambda(G4double e,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
DefineMaterial(couple);
|
||||
return ComputeCurrentLambda(e);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4ParticleChangeForGamma* G4VEmProcess::GetParticleChange()
|
||||
{
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetParticle(const G4ParticleDefinition* p)
|
||||
{
|
||||
particle = p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
|
||||
{
|
||||
secondaryParticle = p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex() const
|
||||
{
|
||||
return currentCoupleIndex;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::GetGammaEnergyCut()
|
||||
{
|
||||
return (*theCutsGamma)[currentCoupleIndex];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::GetElectronEnergyCut()
|
||||
{
|
||||
return (*theCutsElectron)[currentCoupleIndex];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetBuildTableFlag(G4bool val)
|
||||
{
|
||||
buildLambdaTable = val;
|
||||
@@ -671,16 +581,73 @@ inline void G4VEmProcess::SetStartFromNullFlag(G4bool val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetApplyCuts(G4bool val)
|
||||
inline void G4VEmProcess::InitialiseStep(const G4Track& track)
|
||||
{
|
||||
applyCuts = val;
|
||||
preStepKinEnergy = track.GetKineticEnergy();
|
||||
DefineMaterial(track.GetMaterialCutsCouple());
|
||||
SelectModel(preStepKinEnergy, currentCoupleIndex);
|
||||
if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex() const
|
||||
inline void G4VEmProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
return currentMaterialIndex;
|
||||
if(couple != currentCouple) {
|
||||
currentCouple = couple;
|
||||
currentMaterial = couple->GetMaterial();
|
||||
currentCoupleIndex = couple->GetIndex();
|
||||
mfpKinEnergy = DBL_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::ComputeIntegralLambda(G4double e)
|
||||
{
|
||||
mfpKinEnergy = theEnergyOfCrossSectionMax[currentCoupleIndex];
|
||||
if (e <= mfpKinEnergy) {
|
||||
preStepLambda = GetLambdaFromTable(e);
|
||||
|
||||
} else {
|
||||
G4double e1 = e*lambdaFactor;
|
||||
if(e1 > mfpKinEnergy) {
|
||||
preStepLambda = GetLambdaFromTable(e);
|
||||
G4double preStepLambda1 = GetLambdaFromTable(e1);
|
||||
if(preStepLambda1 > preStepLambda) {
|
||||
mfpKinEnergy = e1;
|
||||
preStepLambda = preStepLambda1;
|
||||
}
|
||||
} else {
|
||||
preStepLambda = theCrossSectionMax[currentCoupleIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::GetLambdaFromTable(G4double e)
|
||||
{
|
||||
return (((*theLambdaTable)[currentCoupleIndex])->Value(e));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::GetCurrentLambda(G4double e)
|
||||
{
|
||||
G4double x = 0.0;
|
||||
if(theLambdaTable) { x = GetLambdaFromTable(e); }
|
||||
else { x = ComputeCurrentLambda(e); }
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e)
|
||||
{
|
||||
SelectModel(e, currentCoupleIndex);
|
||||
return currentModel->CrossSectionPerVolume(currentMaterial,particle,
|
||||
e,(*theCuts)[currentCoupleIndex]);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VMscModel.hh,v 1.4 2008/03/10 10:39:28 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VMscModel.hh,v 1.9 2009/04/07 18:39:47 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -38,7 +38,7 @@
|
||||
// Creation date: 07.03.2008
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// 07.04.2009 V.Ivanchenko moved msc methods from G4VEmModel to G4VMscModel
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -53,6 +53,11 @@
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4MscStepLimitType.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4SafetyHelper.hh"
|
||||
|
||||
class G4ParticleChangeForMSC;
|
||||
|
||||
class G4VMscModel : public G4VEmModel
|
||||
{
|
||||
@@ -63,6 +68,28 @@ public:
|
||||
|
||||
virtual ~G4VMscModel();
|
||||
|
||||
virtual G4double ComputeTruePathLengthLimit(const G4Track& track,
|
||||
G4PhysicsTable* theLambdaTable,
|
||||
G4double currentMinimalStep);
|
||||
|
||||
virtual G4double ComputeGeomPathLength(G4double truePathLength);
|
||||
|
||||
virtual G4double ComputeTrueStepLength(G4double geomPathLength);
|
||||
|
||||
virtual void SampleScattering(const G4DynamicParticle*,
|
||||
G4double safety);
|
||||
|
||||
// empty
|
||||
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
||||
const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double tmin,
|
||||
G4double tmax);
|
||||
|
||||
//================================================================
|
||||
// Set parameters of multiple scattering models
|
||||
//================================================================
|
||||
|
||||
inline void SetStepLimitType(G4MscStepLimitType);
|
||||
|
||||
inline void SetLateralDisplasmentFlag(G4bool val);
|
||||
@@ -73,12 +100,37 @@ public:
|
||||
|
||||
inline void SetSkin(G4double);
|
||||
|
||||
inline void SetSampleZ(G4bool);
|
||||
|
||||
protected:
|
||||
|
||||
// initialisation of the ParticleChange for the model
|
||||
G4ParticleChangeForMSC* GetParticleChangeForMSC();
|
||||
|
||||
// initialisation of interface with geometry
|
||||
void InitialiseSafetyHelper();
|
||||
|
||||
// shift point of the track PostStep
|
||||
void ComputeDisplacement(G4ParticleChangeForMSC*,
|
||||
const G4ThreeVector& displDir,
|
||||
G4double displacement,
|
||||
G4double postsafety);
|
||||
|
||||
// compute safety
|
||||
inline G4double ComputeSafety(const G4ThreeVector& position, G4double limit);
|
||||
|
||||
// compute linear distance to a geometry boundary
|
||||
inline G4double ComputeGeomLimit(const G4Track& position, G4double& presafety,
|
||||
G4double limit);
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
G4VMscModel & operator=(const G4VMscModel &right);
|
||||
G4VMscModel(const G4VMscModel&);
|
||||
|
||||
G4SafetyHelper* safetyHelper;
|
||||
|
||||
protected:
|
||||
|
||||
G4double facrange;
|
||||
@@ -87,6 +139,7 @@ protected:
|
||||
G4double skin;
|
||||
G4double dtrl;
|
||||
G4double lambdalimit;
|
||||
G4double geommax;
|
||||
|
||||
G4MscStepLimitType steppingAlgorithm;
|
||||
|
||||
@@ -133,5 +186,36 @@ inline void G4VMscModel::SetStepLimitType(G4MscStepLimitType val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VMscModel::SetSampleZ(G4bool val)
|
||||
{
|
||||
samplez = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VMscModel::ComputeSafety(const G4ThreeVector& position,
|
||||
G4double)
|
||||
{
|
||||
return safetyHelper->ComputeSafety(position);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VMscModel::ComputeGeomLimit(const G4Track& track,
|
||||
G4double& presafety,
|
||||
G4double limit)
|
||||
{
|
||||
G4double res = geommax;
|
||||
if(track.GetVolume() != safetyHelper->GetWorldVolume()) {
|
||||
res = safetyHelper->CheckNextStep(
|
||||
track.GetStep()->GetPreStepPoint()->GetPosition(),
|
||||
track.GetMomentumDirection(),
|
||||
limit, presafety);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VMultipleScattering.hh,v 1.54 2008/07/31 13:01:26 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VMultipleScattering.hh,v 1.62 2009/10/29 17:56:04 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -63,6 +63,7 @@
|
||||
// 12-02-07 Add get/set skin (V.Ivanchenko)
|
||||
// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
|
||||
// 15-07-08 Reorder class members for further multi-thread development (VI)
|
||||
// 07-04-09 Moved msc methods from G4VEmModel to G4VMscModel (VI)
|
||||
//
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
@@ -79,7 +80,7 @@
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4EmModelManager.hh"
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4VMscModel.hh"
|
||||
#include "G4MscStepLimitType.hh"
|
||||
|
||||
class G4ParticleDefinition;
|
||||
@@ -125,10 +126,6 @@ public:
|
||||
// Print out of generic class parameters
|
||||
void PrintInfoDefinition();
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
// Store PhysicsTable in a file.
|
||||
// Return false in case of failure at I/O
|
||||
G4bool StorePhysicsTable(const G4ParticleDefinition*,
|
||||
@@ -144,14 +141,10 @@ public:
|
||||
const G4String& directory,
|
||||
G4bool ascii);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Specific methods for msc processes
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// The function overloads the corresponding function of the base
|
||||
// class.It limits the step near to boundaries only
|
||||
// and invokes the method GetMscContinuousStepLimit at every step.
|
||||
virtual G4double AlongStepGetPhysicalInteractionLength(
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimalStep,
|
||||
@@ -160,11 +153,17 @@ public:
|
||||
|
||||
// The function overloads the corresponding function of the base
|
||||
// class.
|
||||
G4double PostStepGetPhysicalInteractionLength(
|
||||
inline G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
// Along step actions
|
||||
inline G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
// Post step actions
|
||||
inline G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
// This method does not used for tracking, it is intended only for tests
|
||||
inline G4double ContinuousStepLimit(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
@@ -191,97 +190,86 @@ public:
|
||||
|
||||
inline G4PhysicsTable* LambdaTable() const;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Define and access particle type
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// access particle type
|
||||
inline const G4ParticleDefinition* Particle() const;
|
||||
inline void SetParticle(const G4ParticleDefinition*);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Specific methods to set, access, modify models
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
inline void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
|
||||
protected:
|
||||
// Select model in run time
|
||||
inline G4VEmModel* SelectModel(G4double kinEnergy);
|
||||
|
||||
public:
|
||||
// Select model in run time
|
||||
inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy,
|
||||
size_t& idxRegion) const;
|
||||
|
||||
// Access to models
|
||||
inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
|
||||
// Add model for region, smaller value of order defines which
|
||||
// model will be selected for a given energy interval
|
||||
void AddEmModel(G4int order, G4VEmModel*, const G4Region* region = 0);
|
||||
|
||||
// Assign a model to a process
|
||||
void SetModel(G4VMscModel*, G4int index = 1);
|
||||
|
||||
// return the assigned model
|
||||
G4VMscModel* Model(G4int index = 1);
|
||||
|
||||
// Access to models by index
|
||||
G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false) const;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Set parameters for simulation of multiple scattering
|
||||
// Get/Set parameters for simulation of multiple scattering
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
inline G4bool LateralDisplasmentFlag() const;
|
||||
inline void SetLateralDisplasmentFlag(G4bool val);
|
||||
|
||||
inline G4double Skin() const;
|
||||
inline void SetSkin(G4double val);
|
||||
|
||||
inline G4double RangeFactor() const;
|
||||
inline void SetRangeFactor(G4double val);
|
||||
|
||||
inline G4double GeomFactor() const;
|
||||
inline void SetGeomFactor(G4double val);
|
||||
|
||||
inline G4double PolarAngleLimit() const;
|
||||
inline void SetPolarAngleLimit(G4double val);
|
||||
|
||||
inline G4MscStepLimitType StepLimitType() const;
|
||||
inline void SetStepLimitType(G4MscStepLimitType val);
|
||||
|
||||
protected:
|
||||
|
||||
// This method is used for tracking, it returns mean free path value
|
||||
G4double GetMeanFreePath(const G4Track& track,
|
||||
G4double,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Run time methods
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
protected:
|
||||
|
||||
// This method is not used for tracking, it returns mean free path value
|
||||
G4double GetMeanFreePath(const G4Track& track,
|
||||
G4double,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
// This method is not used for tracking, it returns step limit
|
||||
G4double GetContinuousStepLimit(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimalStep,
|
||||
G4double& currentSafety);
|
||||
|
||||
// This method returns inversed transport cross section
|
||||
inline G4double GetLambda(const G4ParticleDefinition* p,
|
||||
G4double& kineticEnergy);
|
||||
|
||||
// This method is used for tracking, it returns step limit
|
||||
inline G4double GetMscContinuousStepLimit(const G4Track& track,
|
||||
G4double scaledKinEnergy,
|
||||
G4double currentMinimalStep,
|
||||
G4double& currentSafety);
|
||||
|
||||
inline G4VEmModel* SelectModel(G4double kinEnergy);
|
||||
// Select concrete model
|
||||
|
||||
inline const G4MaterialCutsCouple* CurrentMaterialCutsCouple() const;
|
||||
|
||||
// define current material
|
||||
// defines current material in run time
|
||||
inline void DefineMaterial(const G4MaterialCutsCouple* couple);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Access parameters of multiple scattering
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
inline G4ParticleChangeForMSC* GetParticleChange();
|
||||
|
||||
inline G4double Skin() const;
|
||||
|
||||
inline G4double RangeFactor() const;
|
||||
|
||||
inline G4double GeomFactor() const;
|
||||
|
||||
inline G4double PolarAngleLimit() const;
|
||||
|
||||
inline G4MscStepLimitType StepLimitType() const;
|
||||
|
||||
inline G4bool LateralDisplasmentFlag() const;
|
||||
inline const G4MaterialCutsCouple* CurrentMaterialCutsCouple() const;
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
|
||||
G4VMultipleScattering(G4VMultipleScattering &);
|
||||
G4VMultipleScattering & operator=(const G4VMultipleScattering &right);
|
||||
|
||||
@@ -292,6 +280,8 @@ private:
|
||||
|
||||
// ======== Parameters of the class fixed at initialisation =======
|
||||
|
||||
std::vector<G4VMscModel*> mscModels;
|
||||
|
||||
G4PhysicsTable* theLambdaTable;
|
||||
const G4ParticleDefinition* firstParticle;
|
||||
|
||||
@@ -307,6 +297,7 @@ private:
|
||||
G4int nBins;
|
||||
|
||||
G4bool latDisplasment;
|
||||
G4bool isIon;
|
||||
|
||||
// ======== Cashed values - may be state dependent ================
|
||||
|
||||
@@ -317,7 +308,7 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
G4VEmModel* currentModel;
|
||||
G4VMscModel* currentModel;
|
||||
|
||||
// cache
|
||||
const G4ParticleDefinition* currentParticle;
|
||||
@@ -329,81 +320,14 @@ private:
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline
|
||||
void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
if(couple != currentCouple) {
|
||||
currentCouple = couple;
|
||||
currentMaterialIndex = couple->GetIndex();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VMultipleScattering::GetMscContinuousStepLimit(
|
||||
const G4Track& track,
|
||||
G4double scaledKinEnergy,
|
||||
G4double currentMinimalStep,
|
||||
G4double&)
|
||||
{
|
||||
G4double x = currentMinimalStep;
|
||||
DefineMaterial(track.GetMaterialCutsCouple());
|
||||
currentModel = SelectModel(scaledKinEnergy);
|
||||
if(x > 0.0 && scaledKinEnergy > 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....
|
||||
|
||||
inline G4double G4VMultipleScattering::ContinuousStepLimit(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimalStep,
|
||||
G4double& currentSafety)
|
||||
{
|
||||
return GetMscContinuousStepLimit(track,previousStepSize,currentMinimalStep,
|
||||
currentSafety);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline
|
||||
G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p,
|
||||
G4double& e)
|
||||
{
|
||||
G4double x;
|
||||
if(theLambdaTable) {
|
||||
G4bool b;
|
||||
x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
|
||||
} else {
|
||||
x = currentModel->CrossSection(currentCouple,p,e);
|
||||
}
|
||||
if(x > DBL_MIN) x = 1./x;
|
||||
else x = DBL_MAX;
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy)
|
||||
{
|
||||
return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
|
||||
G4double kinEnergy, size_t& idxRegion) const
|
||||
{
|
||||
return modelManager->SelectModel(kinEnergy, idxRegion);
|
||||
return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep,
|
||||
currentSafety);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -450,6 +374,42 @@ inline G4double G4VMultipleScattering::MaxKinEnergy() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
|
||||
{
|
||||
buildLambdaTable = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
|
||||
{
|
||||
return theLambdaTable;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline const G4ParticleDefinition* G4VMultipleScattering::Particle() const
|
||||
{
|
||||
return currentParticle;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy)
|
||||
{
|
||||
return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
|
||||
G4double kinEnergy, size_t& idxRegion) const
|
||||
{
|
||||
return modelManager->SelectModel(kinEnergy, idxRegion);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4bool G4VMultipleScattering::LateralDisplasmentFlag() const
|
||||
{
|
||||
return latDisplasment;
|
||||
@@ -464,13 +424,6 @@ inline void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4ParticleChangeForMSC* G4VMultipleScattering::GetParticleChange()
|
||||
{
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VMultipleScattering::Skin() const
|
||||
{
|
||||
return skin;
|
||||
@@ -545,49 +498,76 @@ inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
|
||||
inline
|
||||
G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p,
|
||||
G4double& e)
|
||||
{
|
||||
buildLambdaTable = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline const G4ParticleDefinition* G4VMultipleScattering::Particle() const
|
||||
{
|
||||
return currentParticle;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
|
||||
{
|
||||
return theLambdaTable;
|
||||
G4double x;
|
||||
if(theLambdaTable) {
|
||||
x = ((*theLambdaTable)[currentMaterialIndex])->Value(e);
|
||||
} else {
|
||||
x = currentModel->CrossSection(currentCouple,p,e);
|
||||
}
|
||||
if(x > DBL_MIN) x = 1./x;
|
||||
else x = DBL_MAX;
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline
|
||||
const G4MaterialCutsCouple* G4VMultipleScattering::CurrentMaterialCutsCouple() const
|
||||
void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
if(couple != currentCouple) {
|
||||
currentCouple = couple;
|
||||
currentMaterialIndex = couple->GetIndex();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline const G4MaterialCutsCouple*
|
||||
G4VMultipleScattering::CurrentMaterialCutsCouple() const
|
||||
{
|
||||
return currentCouple;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VMultipleScattering::AddEmModel(G4int order, G4VEmModel* p,
|
||||
const G4Region* region)
|
||||
// Follwoing methods are virtual, they are inlined because they applied at
|
||||
// each simulation step and some compilers may inline these methods
|
||||
|
||||
inline G4double
|
||||
G4VMultipleScattering::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track&, G4double, G4ForceCondition* condition)
|
||||
{
|
||||
G4VEmFluctuationModel* fm = 0;
|
||||
modelManager->AddEmModel(order, p, fm, region);
|
||||
if(p) p->SetParticleChange(pParticleChange);
|
||||
*condition = Forced;
|
||||
return DBL_MAX;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline
|
||||
G4VEmModel* G4VMultipleScattering::GetModelByIndex(G4int idx, G4bool ver)
|
||||
inline G4VParticleChange*
|
||||
G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step)
|
||||
{
|
||||
return modelManager->GetModel(idx, ver);
|
||||
if(currentModel->IsActive(track.GetKineticEnergy())) {
|
||||
fParticleChange.ProposeTrueStepLength(currentModel->ComputeTrueStepLength(step.GetStepLength()));
|
||||
}
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VParticleChange*
|
||||
G4VMultipleScattering::PostStepDoIt(const G4Track& track, const G4Step& step)
|
||||
{
|
||||
fParticleChange.Initialize(track);
|
||||
if(currentModel->IsActive(track.GetKineticEnergy())) {
|
||||
currentModel->SampleScattering(track.GetDynamicParticle(),
|
||||
step.GetPostStepPoint()->GetSafety());
|
||||
}
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4AtomicShell.cc,v 1.2 ????
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
|
||||
// Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
|
||||
//
|
||||
// History:
|
||||
// -----------
|
||||
// 16 Sept 2001 EG Modified according to a design iteration in the
|
||||
// LowEnergy category
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#include "G4AtomicShell.hh"
|
||||
|
||||
G4AtomicShell::G4AtomicShell(G4int id, G4double energy)
|
||||
{
|
||||
identifier = id;
|
||||
bindingEnergy = energy;
|
||||
}
|
||||
|
||||
G4AtomicShell::~G4AtomicShell()
|
||||
{}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DummyModel.cc,v 1.3 2007/05/22 17:31:58 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4DummyModel.cc,v 1.4 2009/04/07 18:39:47 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -51,7 +51,7 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4DummyModel::G4DummyModel(const G4String& nam)
|
||||
: G4VEmModel(nam)
|
||||
: G4VMscModel(nam)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmCalculator.cc,v 1.44 2008/08/03 18:47:15 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmCalculator.cc,v 1.49 2009/11/22 17:58:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -126,26 +126,30 @@ G4double G4EmCalculator::GetDEDX(G4double kinEnergy, const G4ParticleDefinition*
|
||||
const G4MaterialCutsCouple* couple = FindCouple(mat, region);
|
||||
if(couple && UpdateParticle(p, kinEnergy) ) {
|
||||
res = manager->GetDEDX(p, kinEnergy, couple);
|
||||
|
||||
if(isIon) {
|
||||
G4double eth = 2.0*MeV/massRatio;
|
||||
if(kinEnergy > eth) {
|
||||
G4double x1 = corr->ComputeIonCorrections(p,mat,kinEnergy);
|
||||
G4double x2 = corr->ComputeIonCorrections(p,mat,eth);
|
||||
res += x1 - x2*eth/kinEnergy;
|
||||
/*
|
||||
G4cout << "### GetDEDX: E= " << kinEnergy << " res= " << res
|
||||
<< " x1= " << x1 << " x2= " << x2
|
||||
<< " del= " << x1 - x2*eth/kinEnergy << G4endl;;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
if(FindEmModel(p, currentProcessName, kinEnergy)) {
|
||||
G4double length = CLHEP::nm;
|
||||
G4double eloss = res*length;
|
||||
//G4cout << "### GetDEDX: E= " << kinEnergy << " dedx0= " << res
|
||||
// << " de= " << eloss << G4endl;;
|
||||
G4double niel = 0.0;
|
||||
dynParticle.SetKineticEnergy(kinEnergy);
|
||||
currentModel->GetChargeSquareRatio(p, mat, kinEnergy);
|
||||
currentModel->CorrectionsAlongStep(couple,&dynParticle,eloss,niel,length);
|
||||
res = eloss/length;
|
||||
//G4cout << " de1= " << eloss << " res1= " << res
|
||||
// << " " << p->GetParticleName() <<G4endl;;
|
||||
}
|
||||
}
|
||||
|
||||
if(verbose>0) {
|
||||
G4cout << "G4EmCalculator::GetDEDX: E(MeV)= " << kinEnergy/MeV
|
||||
<< " DEDX(MeV/mm)= " << res*mm/MeV
|
||||
<< " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
|
||||
<< " " << p->GetParticleName()
|
||||
<< " in " << mat->GetName()
|
||||
<< " isIon= " << isIon
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
@@ -306,9 +310,8 @@ G4double G4EmCalculator::GetCrossSectionPerVolume(G4double kinEnergy,
|
||||
G4int idx = couple->GetIndex();
|
||||
FindLambdaTable(p, processName);
|
||||
if(currentLambda) {
|
||||
G4bool b;
|
||||
G4double e = kinEnergy*massRatio;
|
||||
res = (((*currentLambda)[idx])->GetValue(e,b))*chargeSquare;
|
||||
res = (((*currentLambda)[idx])->Value(e))*chargeSquare;
|
||||
if(verbose>0) {
|
||||
G4cout << "E(MeV)= " << kinEnergy/MeV
|
||||
<< " cross(cm-1)= " << res*cm
|
||||
@@ -435,11 +438,10 @@ G4double G4EmCalculator::ComputeDEDX(G4double kinEnergy,
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
// emulate boundary region for different parameterisations
|
||||
// emulate smoothing procedure
|
||||
G4double eth = currentModel->LowEnergyLimit();
|
||||
// G4cout << "massRatio= " << massRatio << " eth= " << eth << G4endl;
|
||||
if(eth > 0.05*MeV && eth < 10.*MeV && escaled > eth &&
|
||||
loweModel != currentModel && loweModel) {
|
||||
if(loweModel) {
|
||||
G4double res0 = 0.0;
|
||||
G4double res1 = 0.0;
|
||||
if(baseParticle) {
|
||||
@@ -461,34 +463,38 @@ G4double G4EmCalculator::ComputeDEDX(G4double kinEnergy,
|
||||
<< " res0= " << res0 << " res1= "
|
||||
<< res1 << " q2= " << chargeSquare << G4endl;
|
||||
*/
|
||||
res *= (1.0 + (res0/res1 - 1.0)*eth/escaled);
|
||||
res += (res0 - res1)*eth/escaled;
|
||||
}
|
||||
|
||||
if(isIon) {
|
||||
G4double ethscaled = eth/massRatio;
|
||||
if(kinEnergy > ethscaled) {
|
||||
G4double x1 = corr->ComputeIonCorrections(p,mat,kinEnergy);
|
||||
G4double x2 = corr->ComputeIonCorrections(p,mat,ethscaled);
|
||||
res += x1 - x2*ethscaled/kinEnergy;
|
||||
}
|
||||
// low energy correction for ions
|
||||
if(isIon) {
|
||||
G4double length = CLHEP::nm;
|
||||
const G4Region* r = 0;
|
||||
const G4MaterialCutsCouple* couple = FindCouple(mat, r);
|
||||
G4double eloss = res*length;
|
||||
G4double niel = 0.0;
|
||||
dynParticle.SetKineticEnergy(kinEnergy);
|
||||
currentModel->GetChargeSquareRatio(p, mat, kinEnergy);
|
||||
currentModel->CorrectionsAlongStep(couple,&dynParticle,eloss,niel,length);
|
||||
res = eloss/length;
|
||||
|
||||
if(verbose > 1) {
|
||||
G4cout << "After Corrections: DEDX(MeV/mm)= " << res*mm/MeV
|
||||
<< " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
|
||||
<< G4endl;
|
||||
}
|
||||
if(verbose > 1) {
|
||||
G4cout << "After Corrections: DEDX(MeV/mm)= " << res*mm/MeV
|
||||
<< " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(verbose > 0) {
|
||||
G4cout << "E(MeV)= " << kinEnergy/MeV
|
||||
<< " DEDX(MeV/mm)= " << res*mm/MeV
|
||||
<< " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
|
||||
<< " cut(MeV)= " << cut/MeV
|
||||
<< " " << p->GetParticleName()
|
||||
<< " in " << currentMaterialName
|
||||
<< " Zi^2= " << chargeSquare
|
||||
<< G4endl;
|
||||
}
|
||||
if(verbose > 0) {
|
||||
G4cout << "E(MeV)= " << kinEnergy/MeV
|
||||
<< " DEDX(MeV/mm)= " << res*mm/MeV
|
||||
<< " DEDX(MeV*cm^2/g)= " << res*gram/(MeV*cm2*mat->GetDensity())
|
||||
<< " cut(MeV)= " << cut/MeV
|
||||
<< " " << p->GetParticleName()
|
||||
<< " in " << currentMaterialName
|
||||
<< " Zi^2= " << chargeSquare
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
@@ -744,7 +750,11 @@ G4bool G4EmCalculator::UpdateParticle(const G4ParticleDefinition* p,
|
||||
G4double kinEnergy)
|
||||
{
|
||||
if(p != currentParticle) {
|
||||
|
||||
// new particle
|
||||
currentParticle = p;
|
||||
dynParticle.SetDefinition(const_cast<G4ParticleDefinition*>(p));
|
||||
dynParticle.SetKineticEnergy(kinEnergy);
|
||||
baseParticle = 0;
|
||||
currentParticleName = p->GetParticleName();
|
||||
massRatio = 1.0;
|
||||
@@ -752,35 +762,41 @@ G4bool G4EmCalculator::UpdateParticle(const G4ParticleDefinition* p,
|
||||
chargeSquare = 1.0;
|
||||
currentProcess = FindEnergyLossProcess(p);
|
||||
currentProcessName = "";
|
||||
if(currentProcess) currentProcessName = currentProcess->GetProcessName();
|
||||
isIon = false;
|
||||
|
||||
if(p->GetParticleType() == "nucleus" &&
|
||||
currentParticleName != "deuteron" && currentParticleName != "triton") {
|
||||
baseParticle = theGenericIon;
|
||||
massRatio = baseParticle->GetPDGMass()/p->GetPDGMass();
|
||||
isIon = true;
|
||||
// G4cout << p->GetParticleName()
|
||||
// << " in " << currentMaterial->GetName()
|
||||
// << " e= " << kinEnergy << G4endl;
|
||||
chargeSquare =
|
||||
ionEffCharge->EffectiveChargeSquareRatio(p, currentMaterial, kinEnergy);
|
||||
//G4cout << "q2= " << chargeSquare << G4endl;
|
||||
} else {
|
||||
isIon = false;
|
||||
if(currentProcess) {
|
||||
baseParticle = currentProcess->BaseParticle();
|
||||
// ionisation process exist
|
||||
if(currentProcess) {
|
||||
currentProcessName = currentProcess->GetProcessName();
|
||||
baseParticle = currentProcess->BaseParticle();
|
||||
|
||||
if(baseParticle) {
|
||||
massRatio = baseParticle->GetPDGMass()/p->GetPDGMass();
|
||||
G4double q = baseParticle->GetPDGCharge()/eplus;
|
||||
chargeSquare /= (q*q);
|
||||
}
|
||||
// base particle is used
|
||||
if(baseParticle) {
|
||||
massRatio = baseParticle->GetPDGMass()/p->GetPDGMass();
|
||||
G4double q = p->GetPDGCharge()/baseParticle->GetPDGCharge();
|
||||
chargeSquare = q*q;
|
||||
}
|
||||
|
||||
if(p->GetParticleType() == "nucleus"
|
||||
&& currentParticleName != "deuteron"
|
||||
&& currentParticleName != "triton"
|
||||
&& currentParticleName != "alpha+"
|
||||
&& currentParticleName != "helium"
|
||||
&& currentParticleName != "hydrogen"
|
||||
) {
|
||||
isIon = true;
|
||||
massRatio = theGenericIon->GetPDGMass()/p->GetPDGMass();
|
||||
baseParticle = theGenericIon;
|
||||
// G4cout << p->GetParticleName()
|
||||
// << " in " << currentMaterial->GetName()
|
||||
// << " e= " << kinEnergy << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Effective charge for ions
|
||||
if(isIon) {
|
||||
chargeSquare =
|
||||
ionEffCharge->EffectiveChargeSquareRatio(p, currentMaterial, kinEnergy)
|
||||
corr->EffectiveChargeSquareRatio(p, currentMaterial, kinEnergy)
|
||||
* corr->EffectiveChargeCorrection(p,currentMaterial,kinEnergy);
|
||||
if(currentProcess) {
|
||||
currentProcess->SetDynamicMassCharge(massRatio,chargeSquare);
|
||||
@@ -809,6 +825,15 @@ const G4ParticleDefinition* G4EmCalculator::FindParticle(const G4String& name)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
const G4ParticleDefinition* G4EmCalculator::FindIon(G4int Z, G4int A)
|
||||
{
|
||||
const G4ParticleDefinition* p =
|
||||
G4ParticleTable::GetParticleTable()->FindIon(Z,A,0,Z);
|
||||
return p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
const G4Material* G4EmCalculator::FindMaterial(const G4String& name)
|
||||
{
|
||||
if(name != currentMaterialName) {
|
||||
@@ -891,21 +916,24 @@ void G4EmCalculator::FindLambdaTable(const G4ParticleDefinition* p,
|
||||
|
||||
G4String partname = p->GetParticleName();
|
||||
const G4ParticleDefinition* part = p;
|
||||
if(isIon) part = theGenericIon;
|
||||
if(isIon) { part = theGenericIon; }
|
||||
|
||||
// energy loss process
|
||||
G4LossTableManager* lManager = G4LossTableManager::Instance();
|
||||
const std::vector<G4VEnergyLossProcess*> vel =
|
||||
lManager->GetEnergyLossProcessVector();
|
||||
lManager->GetEnergyLossProcessVector();
|
||||
G4int n = vel.size();
|
||||
for(G4int i=0; i<n; i++) {
|
||||
if((vel[i])->GetProcessName() == currentName &&
|
||||
(vel[i])->Particle() == part)
|
||||
{
|
||||
currentLambda = (vel[i])->LambdaTable();
|
||||
isApplicable = true;
|
||||
break;
|
||||
}
|
||||
{
|
||||
currentLambda = (vel[i])->LambdaTable();
|
||||
isApplicable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// discrete process
|
||||
if(!currentLambda) {
|
||||
const std::vector<G4VEmProcess*> vem = lManager->GetEmProcessVector();
|
||||
G4int n = vem.size();
|
||||
@@ -919,6 +947,8 @@ void G4EmCalculator::FindLambdaTable(const G4ParticleDefinition* p,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// msc process
|
||||
if(!currentLambda) {
|
||||
const std::vector<G4VMultipleScattering*> vmsc =
|
||||
lManager->GetMultipleScatteringVector();
|
||||
@@ -942,26 +972,26 @@ G4bool G4EmCalculator::FindEmModel(const G4ParticleDefinition* p,
|
||||
const G4String& processName,
|
||||
G4double kinEnergy)
|
||||
{
|
||||
G4bool res = false;
|
||||
isApplicable = false;
|
||||
if(!p) {
|
||||
G4cout << "G4EmCalculator::FindEmModel WARNING: no particle defined"
|
||||
<< G4endl;
|
||||
return res;
|
||||
return isApplicable;
|
||||
}
|
||||
G4String partname = p->GetParticleName();
|
||||
const G4ParticleDefinition* part = p;
|
||||
G4double scaledEnergy = kinEnergy*massRatio;
|
||||
if(isIon) part = theGenericIon;
|
||||
if(isIon) { part = theGenericIon; }
|
||||
|
||||
if(verbose > 1) {
|
||||
G4cout << "G4EmCalculator::FindEmModel for " << partname
|
||||
<< " (type= " << p->GetParticleType()
|
||||
<< ") and " << processName << " at e(MeV)= " << scaledEnergy;
|
||||
<< ") and " << processName << " at E(MeV)= " << scaledEnergy;
|
||||
if(p != part) G4cout << " GenericIon is the base particle";
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
// Search for the process
|
||||
// Search for energy loss process
|
||||
currentName = processName;
|
||||
currentModel = 0;
|
||||
loweModel = 0;
|
||||
@@ -970,32 +1000,32 @@ G4bool G4EmCalculator::FindEmModel(const G4ParticleDefinition* p,
|
||||
const std::vector<G4VEnergyLossProcess*> vel =
|
||||
lManager->GetEnergyLossProcessVector();
|
||||
G4int n = vel.size();
|
||||
G4VEnergyLossProcess* elproc = 0;
|
||||
for(G4int i=0; i<n; i++) {
|
||||
// G4cout << "i= " << i << " part= "
|
||||
// << (vel[i])->Particle()->GetParticleName()
|
||||
// << " proc= " << (vel[i])->GetProcessName() << G4endl;
|
||||
if((vel[i])->GetProcessName() == currentName &&
|
||||
(vel[i])->Particle() == part)
|
||||
{
|
||||
const G4ParticleDefinition* bp = (vel[i])->BaseParticle();
|
||||
// G4cout << "i= " << i << " bp= " << bp << G4endl;
|
||||
if(!bp) {
|
||||
currentModel = (vel[i])->SelectModelForMaterial(scaledEnergy, idx);
|
||||
loweModel = (vel[i])->SelectModelForMaterial(keV, idx);
|
||||
isApplicable = true;
|
||||
break;
|
||||
if((vel[i])->GetProcessName() == currentName) {
|
||||
if(baseParticle) {
|
||||
if((vel[i])->Particle() == baseParticle) {
|
||||
elproc = vel[i];
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
for(G4int j=0; j<n; j++) {
|
||||
if((vel[j])->Particle() == bp) {
|
||||
currentModel = (vel[j])->SelectModelForMaterial(scaledEnergy, idx);
|
||||
loweModel = (vel[j])->SelectModelForMaterial(keV, idx);
|
||||
isApplicable = true;
|
||||
break;
|
||||
}
|
||||
if((vel[i])->Particle() == part) {
|
||||
elproc = vel[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(elproc) {
|
||||
currentModel = elproc->SelectModelForMaterial(scaledEnergy, idx);
|
||||
G4double eth = currentModel->LowEnergyLimit();
|
||||
loweModel = elproc->SelectModelForMaterial(eth - CLHEP::eV, idx);
|
||||
}
|
||||
|
||||
// Search for discrete process
|
||||
if(!currentModel) {
|
||||
const std::vector<G4VEmProcess*> vem = lManager->GetEmProcessVector();
|
||||
G4int n = vem.size();
|
||||
@@ -1004,12 +1034,14 @@ G4bool G4EmCalculator::FindEmModel(const G4ParticleDefinition* p,
|
||||
(vem[i])->Particle() == part)
|
||||
{
|
||||
currentModel = (vem[i])->SelectModelForMaterial(kinEnergy, idx);
|
||||
loweModel = (vem[i])->SelectModelForMaterial(keV, idx);
|
||||
isApplicable = true;
|
||||
G4double eth = currentModel->LowEnergyLimit();
|
||||
loweModel = (vem[i])->SelectModelForMaterial(eth - CLHEP::eV, idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Search for msc process
|
||||
if(!currentModel) {
|
||||
const std::vector<G4VMultipleScattering*> vmsc =
|
||||
lManager->GetMultipleScatteringVector();
|
||||
@@ -1019,14 +1051,25 @@ G4bool G4EmCalculator::FindEmModel(const G4ParticleDefinition* p,
|
||||
(vmsc[i])->Particle() == part)
|
||||
{
|
||||
currentModel = (vmsc[i])->SelectModelForMaterial(kinEnergy, idx);
|
||||
loweModel = (vmsc[i])->SelectModelForMaterial(keV, idx);
|
||||
isApplicable = true;
|
||||
G4double eth = currentModel->LowEnergyLimit();
|
||||
loweModel = (vmsc[i])->SelectModelForMaterial(eth - CLHEP::eV, idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(currentModel) res = true;
|
||||
return res;
|
||||
if(currentModel) {
|
||||
if(loweModel == currentModel) { loweModel = 0; }
|
||||
isApplicable = true;
|
||||
if(verbose > 1) {
|
||||
G4cout << "Model <" << currentModel->GetName()
|
||||
<< "> Emin(MeV)= " << currentModel->LowEnergyLimit()/MeV;
|
||||
if(loweModel) {
|
||||
G4cout << " LowEnergy model <" << loweModel->GetName() << ">";
|
||||
}
|
||||
G4cout << G4endl;
|
||||
}
|
||||
}
|
||||
return isApplicable;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -1037,16 +1080,17 @@ G4VEnergyLossProcess* G4EmCalculator::FindEnergyLossProcess(
|
||||
G4VEnergyLossProcess* elp = 0;
|
||||
G4String partname = p->GetParticleName();
|
||||
const G4ParticleDefinition* part = p;
|
||||
|
||||
if(p->GetParticleType() == "nucleus" &&
|
||||
partname != "deuteron" &&
|
||||
partname != "triton") part = G4GenericIon::GenericIon();
|
||||
partname != "triton") { part = theGenericIon; }
|
||||
|
||||
G4LossTableManager* lManager = G4LossTableManager::Instance();
|
||||
const std::vector<G4VEnergyLossProcess*> vel =
|
||||
lManager->GetEnergyLossProcessVector();
|
||||
G4int n = vel.size();
|
||||
for(G4int i=0; i<n; i++) {
|
||||
if((vel[i])->Particle() == part) {
|
||||
if( (vel[i])->Particle() == part ) {
|
||||
elp = vel[i];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmConfigurator.cc,v 1.3 2008/11/21 12:30:29 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmConfigurator.cc,v 1.6 2009/11/22 19:48:30 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -66,7 +66,7 @@ enum PType {unknown=0, eloss, discrete, msc};
|
||||
|
||||
G4EmConfigurator::G4EmConfigurator()
|
||||
{
|
||||
index = 1;
|
||||
index = -10;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -116,7 +116,9 @@ void G4EmConfigurator::SetExtraEmModel(const G4String& particleName,
|
||||
AddExtraEmModel(particleName, mod, fm);
|
||||
G4String fname = "";
|
||||
if(fm) fname = fm->GetName();
|
||||
AddModelForRegion(particleName, processName, mod->GetName(), regionName,
|
||||
G4String mname = "";
|
||||
if(mod) mname = mod->GetName();
|
||||
AddModelForRegion(particleName, processName, mname, regionName,
|
||||
emin, emax, fname);
|
||||
}
|
||||
|
||||
@@ -153,7 +155,7 @@ void G4EmConfigurator::SetModelForRegion(const G4String& particleName,
|
||||
//G4cout << " G4EmConfigurator::SetModelForRegion" << G4endl;
|
||||
|
||||
// new set
|
||||
index--;
|
||||
--index;
|
||||
|
||||
G4ParticleTable::G4PTblDicIterator* theParticleIterator =
|
||||
G4ParticleTable::GetParticleTable()->GetIterator();
|
||||
@@ -202,7 +204,11 @@ void G4EmConfigurator::SetModelForRegion(const G4String& particleName,
|
||||
//G4cout << "Search model " << modelName << " in " << nm << G4endl;
|
||||
|
||||
for(G4int i=0; i<nm; i++) {
|
||||
if(modelName == modelList[i]->GetName() &&
|
||||
G4String mname = "";
|
||||
if(modelList[i]) mname = modelList[i]->GetName();
|
||||
G4String fname = "";
|
||||
if(flucModelList[i]) fname = flucModelList[i]->GetName();
|
||||
if(modelName == mname && flucModelName == fname &&
|
||||
(particleList[i] == "" || particleList[i] == particleName) ) {
|
||||
mod = modelList[i];
|
||||
fluc = flucModelList[i];
|
||||
@@ -213,13 +219,22 @@ void G4EmConfigurator::SetModelForRegion(const G4String& particleName,
|
||||
if("dummy" == modelName) mod = new G4DummyModel();
|
||||
|
||||
if(!mod) {
|
||||
G4cout << "### G4EmConfigurator WARNING: fails to find a model <"
|
||||
<< modelName << "> for process <"
|
||||
<< processName << "> and " << particleName
|
||||
<< G4endl;
|
||||
if(flucModelName != "")
|
||||
G4cout << " fluctuation model <"
|
||||
<< flucModelName << G4endl;
|
||||
|
||||
// set fluctuation model for ionisation processes
|
||||
if(fluc && ptype == eloss) {
|
||||
G4VEnergyLossProcess* p = static_cast<G4VEnergyLossProcess*>(proc);
|
||||
p->SetFluctModel(fluc);
|
||||
|
||||
} else {
|
||||
G4cout << "### G4EmConfigurator WARNING: fails to find a model <"
|
||||
<< modelName << "> for process <"
|
||||
<< processName << "> and " << particleName
|
||||
<< G4endl;
|
||||
if(flucModelName != "") {
|
||||
G4cout << " fluctuation model <"
|
||||
<< flucModelName << G4endl;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// search for region
|
||||
@@ -242,19 +257,21 @@ void G4EmConfigurator::SetModelForRegion(const G4String& particleName,
|
||||
mod->SetLowEnergyLimit(e1);
|
||||
mod->SetHighEnergyLimit(e2);
|
||||
|
||||
//G4cout << "e1= " << e1 << " e2= " << e2 << G4endl;
|
||||
//G4cout << "index= " << index << " e1= " << e1 << " e2= " << e2 << G4endl;
|
||||
|
||||
// added model
|
||||
if(ptype == eloss) {
|
||||
G4VEnergyLossProcess* p = reinterpret_cast<G4VEnergyLossProcess*>(proc);
|
||||
G4VEnergyLossProcess* p = static_cast<G4VEnergyLossProcess*>(proc);
|
||||
p->AddEmModel(index,mod,fluc,reg);
|
||||
//G4cout << "### Added eloss model order= " << index << " for "
|
||||
// << particleName << " and " << processName << " " << mod << G4endl;
|
||||
} else if(ptype == discrete) {
|
||||
G4VEmProcess* p = reinterpret_cast<G4VEmProcess*>(proc);
|
||||
G4VEmProcess* p = static_cast<G4VEmProcess*>(proc);
|
||||
p->AddEmModel(index,mod,reg);
|
||||
} else if(ptype == msc) {
|
||||
G4VMultipleScattering* p = reinterpret_cast<G4VMultipleScattering*>(proc);
|
||||
//G4cout << "### Added msc model order= " << index << " for "
|
||||
// << particleName << " and " << processName << " " << mod << G4endl;
|
||||
G4VMultipleScattering* p = static_cast<G4VMultipleScattering*>(proc);
|
||||
p->AddEmModel(index,mod,reg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmCorrections.cc,v 1.51 2008/12/18 13:01:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmCorrections.cc,v 1.54 2009/10/29 17:56:36 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -686,28 +686,21 @@ G4double G4EmCorrections::EffectiveChargeCorrection(const G4ParticleDefinition*
|
||||
}
|
||||
massFactor = proton_mass_c2/p->GetPDGMass();
|
||||
idx = -1;
|
||||
G4int dz = 1000;
|
||||
|
||||
for(G4int i=0; i<nIons; i++) {
|
||||
if(materialList[i] == mat) {
|
||||
G4int delz = currentZ - Zion[i];
|
||||
if(delz < 0) delz = -delz;
|
||||
if(delz < dz) {
|
||||
idx = i;
|
||||
dz = delz;
|
||||
if(0 == delz) break;
|
||||
}
|
||||
if(materialList[i] == mat && currentZ == Zion[i]) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// G4cout << " idx= " << idx << " dz= " << dz << G4endl;
|
||||
if(idx > 0) {
|
||||
// G4cout << " idx= " << idx << " dz= " << G4endl;
|
||||
if(idx >= 0) {
|
||||
if(!ionList[idx]) BuildCorrectionVector();
|
||||
if(ionList[idx]) curVector = stopData[idx];
|
||||
}
|
||||
} else { return factor; }
|
||||
}
|
||||
if(curVector) {
|
||||
G4bool b;
|
||||
factor = curVector->GetValue(ekin*massFactor,b);
|
||||
factor = curVector->Value(ekin*massFactor);
|
||||
if(verbose > 1) {
|
||||
G4cout << "E= " << ekin << " factor= " << factor << " massfactor= "
|
||||
<< massFactor << G4endl;
|
||||
@@ -770,13 +763,12 @@ void G4EmCorrections::BuildCorrectionVector()
|
||||
<< materialName[idx] << " Ion Z= " << Z << " A= " << A
|
||||
<< " massRatio= " << massRatio << G4endl;
|
||||
}
|
||||
G4bool b;
|
||||
|
||||
G4PhysicsLogVector* vv =
|
||||
new G4PhysicsLogVector(eCorrMin,eCorrMax,nbinCorr);
|
||||
vv->SetSpline(true);
|
||||
G4double e, eion, dedx, dedx1;
|
||||
G4double eth0 = v->GetLowEdgeEnergy(0);
|
||||
G4double eth0 = v->Energy(0);
|
||||
G4double escal = eth/massRatio;
|
||||
G4double qe =
|
||||
effCharge.EffectiveChargeSquareRatio(ion, curMaterial, escal);
|
||||
@@ -789,14 +781,14 @@ void G4EmCorrections::BuildCorrectionVector()
|
||||
//G4cout << "Escal(MeV)= "<<escal<<" dedxt0= " <<dedxt
|
||||
// << " dedxt1= " << dedx1t << G4endl;
|
||||
|
||||
for(G4int i=0; i<nbinCorr; i++) {
|
||||
e = vv->GetLowEdgeEnergy(i);
|
||||
for(G4int i=0; i<=nbinCorr; i++) {
|
||||
e = vv->Energy(i);
|
||||
escal = e/massRatio;
|
||||
eion = escal/A;
|
||||
if(eion <= eth0) {
|
||||
dedx = v->GetValue(eth0, b)*std::sqrt(eion/eth0);
|
||||
dedx = v->Value(eth0)*std::sqrt(eion/eth0);
|
||||
} else {
|
||||
dedx = v->GetValue(eion, b);
|
||||
dedx = v->Value(eion);
|
||||
}
|
||||
qe = effCharge.EffectiveChargeSquareRatio(curParticle,curMaterial,escal);
|
||||
if(e <= eth) {
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmElementSelector.cc,v 1.4 2008/08/21 18:53:32 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmElementSelector.cc,v 1.11 2009/09/29 11:31:37 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -57,17 +57,19 @@ G4EmElementSelector::G4EmElementSelector(G4VEmModel* mod,
|
||||
G4int bins,
|
||||
G4double emin,
|
||||
G4double emax,
|
||||
G4bool spline):
|
||||
G4bool /*spline*/):
|
||||
model(mod), material(mat), nbins(bins), cutEnergy(-1.0),
|
||||
lowEnergy(emin), highEnergy(emax)
|
||||
{
|
||||
G4int n = material->GetNumberOfElements();
|
||||
nElmMinusOne = n - 1;
|
||||
theElementVector = material->GetElementVector();
|
||||
element = (*theElementVector)[0];
|
||||
if(nElmMinusOne > 0) {
|
||||
for(G4int i=0; i<nElmMinusOne; i++) {
|
||||
xSections.reserve(n);
|
||||
for(G4int i=0; i<n; ++i) {
|
||||
G4PhysicsLogVector* v = new G4PhysicsLogVector(lowEnergy,highEnergy,nbins);
|
||||
v->SetSpline(spline);
|
||||
//v->SetSpline(spline);
|
||||
xSections.push_back(v);
|
||||
}
|
||||
}
|
||||
@@ -79,7 +81,7 @@ G4EmElementSelector::G4EmElementSelector(G4VEmModel* mod,
|
||||
G4EmElementSelector::~G4EmElementSelector()
|
||||
{
|
||||
if(nElmMinusOne > 0) {
|
||||
for(G4int i=0; i<nElmMinusOne; i++) {
|
||||
for(G4int i=0; i<=nElmMinusOne; ++i) {
|
||||
delete xSections[i];
|
||||
}
|
||||
}
|
||||
@@ -100,29 +102,44 @@ void G4EmElementSelector::Initialise(const G4ParticleDefinition* part,
|
||||
const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume();
|
||||
|
||||
G4int i;
|
||||
G4int n = nElmMinusOne + 1;
|
||||
G4double* xsec = new G4double[n];
|
||||
|
||||
// loop over bins
|
||||
for(G4int j=0; j<nbins; j++) {
|
||||
G4double e = (xSections[0])->GetLowEdgeEnergy(j);
|
||||
for(G4int j=0; j<=nbins; ++j) {
|
||||
G4double e = (xSections[0])->Energy(j);
|
||||
model->SetupForMaterial(part, material, e);
|
||||
cross = 0.0;
|
||||
//G4cout << "j= " << j << " e(MeV)= " << e/MeV << G4endl;
|
||||
for (i=0; i<n; i++) {
|
||||
for (i=0; i<=nElmMinusOne; ++i) {
|
||||
cross += theAtomNumDensityVector[i]*
|
||||
model->ComputeCrossSectionPerAtom(part, (*theElementVector)[i], e,
|
||||
cutEnergy, e);
|
||||
xsec[i] = cross;
|
||||
}
|
||||
if(DBL_MIN >= cross) cross = 1.0;
|
||||
// normalise cross section sum
|
||||
for (i=0; i<nElmMinusOne; i++) {
|
||||
xSections[i]->PutValue(j, xsec[i]/cross);
|
||||
//G4cout << "i= " << i << " xs= " << xsec[i]/cross << G4endl;
|
||||
xSections[i]->PutValue(j, cross);
|
||||
}
|
||||
}
|
||||
|
||||
// xSections start from null, so use probabilities from the next bin
|
||||
if(DBL_MIN >= (*xSections[nElmMinusOne])[0]) {
|
||||
for (i=0; i<=nElmMinusOne; ++i) {
|
||||
xSections[i]->PutValue(0, (*xSections[i])[1]);
|
||||
}
|
||||
}
|
||||
// xSections ends with null, so use probabilities from the previous bin
|
||||
if(DBL_MIN >= (*xSections[nElmMinusOne])[nbins]) {
|
||||
for (i=0; i<=nElmMinusOne; ++i) {
|
||||
xSections[i]->PutValue(nbins, (*xSections[i])[nbins-1]);
|
||||
}
|
||||
}
|
||||
// perform normalization
|
||||
for(G4int j=0; j<=nbins; ++j) {
|
||||
cross = (*xSections[nElmMinusOne])[j];
|
||||
// only for positive X-section
|
||||
if(cross > DBL_MIN) {
|
||||
for (i=0; i<nElmMinusOne; ++i) {
|
||||
G4double x = (*xSections[i])[j]/cross;
|
||||
xSections[i]->PutValue(j, x);
|
||||
}
|
||||
}
|
||||
}
|
||||
delete [] xsec;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -138,9 +155,10 @@ void G4EmElementSelector::Dump(const G4ParticleDefinition* part)
|
||||
G4cout << *(xSections[i]) << G4endl;
|
||||
}
|
||||
}
|
||||
G4cout << "Last Element in element vector"
|
||||
G4cout << "Last Element in element vector "
|
||||
<< (*theElementVector)[nElmMinusOne]->GetName()
|
||||
<< G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmModelManager.cc,v 1.46 2008/10/13 14:56:56 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmModelManager.cc,v 1.58 2009/10/29 18:07:08 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -60,6 +60,8 @@
|
||||
// 13-05-06 Add GetModel by index method (VI)
|
||||
// 15-03-07 Add maxCutInRange (V.Ivanchenko)
|
||||
// 12-04-07 Add verbosity at destruction (V.Ivanchenko)
|
||||
// 08-04-08 Fixed and simplified initialisation of G4RegionModel (VI)
|
||||
// 03-08-09 Create internal vectors only it is needed (VI)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -83,7 +85,7 @@ G4RegionModels::G4RegionModels(G4int nMod, std::vector<G4int>& indx,
|
||||
nModelsForRegion = nMod;
|
||||
theListOfModelIndexes = new G4int [nModelsForRegion];
|
||||
lowKineticEnergy = new G4double [nModelsForRegion+1];
|
||||
for (G4int i=0; i<nModelsForRegion; i++) {
|
||||
for (G4int i=0; i<nModelsForRegion; ++i) {
|
||||
theListOfModelIndexes[i] = indx[i];
|
||||
lowKineticEnergy[i] = lowE[i];
|
||||
}
|
||||
@@ -112,33 +114,32 @@ G4RegionModels::~G4RegionModels()
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4DataVector.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4EmModelManager::G4EmModelManager():
|
||||
nEmModels(0),
|
||||
nRegions(0),
|
||||
nCouples(0),
|
||||
idxOfRegionModels(0),
|
||||
setOfRegionModels(0),
|
||||
minSubRange(0.1),
|
||||
particle(0),
|
||||
verboseLevel(0)
|
||||
{
|
||||
models.clear();
|
||||
flucModels.clear();
|
||||
regions.clear();
|
||||
orderOfModels.clear();
|
||||
maxCutInRange = 12.*cm;
|
||||
maxSubCutInRange = 0.7*mm;
|
||||
theGamma = G4Gamma::Gamma();
|
||||
thePositron = G4Positron::Positron();
|
||||
models.reserve(4);
|
||||
flucModels.reserve(4);
|
||||
regions.reserve(4);
|
||||
orderOfModels.reserve(4);
|
||||
isUsed.reserve(4);
|
||||
severalModels = true;
|
||||
currRegionModel = 0;
|
||||
currModel = 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4EmModelManager::~G4EmModelManager()
|
||||
{
|
||||
verboseLevel = 0; // no verbosity at destruction
|
||||
Clear();
|
||||
}
|
||||
|
||||
@@ -149,18 +150,13 @@ void G4EmModelManager::Clear()
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager::Clear()" << G4endl;
|
||||
}
|
||||
|
||||
theCuts.clear();
|
||||
theSubCuts.clear();
|
||||
if(idxOfRegionModels) delete [] idxOfRegionModels;
|
||||
if(setOfRegionModels && nRegions) {
|
||||
for(G4int i=0; i<nRegions; i++) {
|
||||
delete (setOfRegionModels[i]);
|
||||
size_t n = setOfRegionModels.size();
|
||||
if(n > 0) {
|
||||
for(size_t i=0; i<n; ++i) {
|
||||
delete setOfRegionModels[i];
|
||||
setOfRegionModels[i] = 0;
|
||||
}
|
||||
delete [] setOfRegionModels;
|
||||
}
|
||||
idxOfRegionModels = 0;
|
||||
setOfRegionModels = 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -177,6 +173,7 @@ void G4EmModelManager::AddEmModel(G4int num, G4VEmModel* p,
|
||||
flucModels.push_back(fm);
|
||||
regions.push_back(r);
|
||||
orderOfModels.push_back(num);
|
||||
isUsed.push_back(0);
|
||||
p->DefineForRegion(r);
|
||||
nEmModels++;
|
||||
}
|
||||
@@ -186,8 +183,8 @@ void G4EmModelManager::AddEmModel(G4int num, G4VEmModel* p,
|
||||
void G4EmModelManager::UpdateEmModel(const G4String& nam,
|
||||
G4double emin, G4double emax)
|
||||
{
|
||||
if (nEmModels) {
|
||||
for(G4int i=0; i<nEmModels; i++) {
|
||||
if (nEmModels > 0) {
|
||||
for(G4int i=0; i<nEmModels; ++i) {
|
||||
if(nam == models[i]->GetName()) {
|
||||
models[i]->SetLowEnergyLimit(emin);
|
||||
models[i]->SetHighEnergyLimit(emax);
|
||||
@@ -218,26 +215,26 @@ G4VEmModel* G4EmModelManager::GetModel(G4int i, G4bool ver)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
const G4ParticleDefinition* sp,
|
||||
G4double theMinSubRange,
|
||||
G4int val)
|
||||
const G4DataVector*
|
||||
G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
const G4ParticleDefinition* secondaryParticle,
|
||||
G4double minSubRange,
|
||||
G4int val)
|
||||
{
|
||||
verboseLevel = val;
|
||||
G4String partname = p->GetParticleName();
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager::Initialise() for "
|
||||
<< p->GetParticleName()
|
||||
<< G4endl;
|
||||
<< partname << G4endl;
|
||||
}
|
||||
// Are models defined?
|
||||
if(!nEmModels) {
|
||||
G4Exception("G4EmModelManager::Initialise without any model defined");
|
||||
if(nEmModels < 1) {
|
||||
G4Exception("G4EmModelManager::Initialise: no model defined for " + partname);
|
||||
}
|
||||
particle = p;
|
||||
secondaryParticle = sp;
|
||||
minSubRange = theMinSubRange;
|
||||
|
||||
Clear();
|
||||
particle = p;
|
||||
Clear(); // needed if run is not first
|
||||
|
||||
G4RegionStore* regionStore = G4RegionStore::GetInstance();
|
||||
const G4Region* world =
|
||||
regionStore->GetRegion("DefaultRegionForTheWorld", false);
|
||||
@@ -248,7 +245,7 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
setr.push_back(world);
|
||||
G4bool isWorld = false;
|
||||
|
||||
for (G4int ii=0; ii<nEmModels; ii++) {
|
||||
for (G4int ii=0; ii<nEmModels; ++ii) {
|
||||
const G4Region* r = regions[ii];
|
||||
if ( r == 0 || r == world) {
|
||||
isWorld = true;
|
||||
@@ -256,7 +253,7 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
} else {
|
||||
G4bool newRegion = true;
|
||||
if (nRegions>1) {
|
||||
for (G4int j=1; j<nRegions; j++) {
|
||||
for (G4int j=1; j<nRegions; ++j) {
|
||||
if ( r == setr[j] ) newRegion = false;
|
||||
}
|
||||
}
|
||||
@@ -266,212 +263,208 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
}
|
||||
}
|
||||
}
|
||||
// Are models defined?
|
||||
if(!isWorld) {
|
||||
G4Exception("G4EmModelManager::Initialise: no models defined for " +
|
||||
partname + " in the World volume");
|
||||
}
|
||||
|
||||
G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
G4int numOfCouples = theCoupleTable->GetTableSize();
|
||||
idxOfRegionModels = new G4int[numOfCouples+1];
|
||||
idxOfRegionModels[numOfCouples] = 0;
|
||||
setOfRegionModels = new G4RegionModels*[nRegions];
|
||||
size_t numOfCouples = theCoupleTable->GetTableSize();
|
||||
|
||||
// prepare vectors, shortcut for the case of only 1 model
|
||||
if(nRegions > 1 && nEmModels > 1) {
|
||||
if(numOfCouples > idxOfRegionModels.size()) idxOfRegionModels.resize(numOfCouples);
|
||||
}
|
||||
size_t nr = 1;
|
||||
if(nEmModels > 1) nr = nRegions;
|
||||
if(nr > setOfRegionModels.size()) setOfRegionModels.resize(nr);
|
||||
|
||||
std::vector<G4int> modelAtRegion(nEmModels);
|
||||
std::vector<G4int> modelOrd(nEmModels);
|
||||
G4DataVector eLow(nEmModels);
|
||||
G4DataVector eLow(nEmModels+1);
|
||||
G4DataVector eHigh(nEmModels);
|
||||
G4int nmax = nEmModels;
|
||||
|
||||
// Order models for regions
|
||||
for (G4int reg=0; reg<nRegions; reg++) {
|
||||
for (G4int reg=0; reg<nRegions; ++reg) {
|
||||
const G4Region* region = setr[reg];
|
||||
G4int n = 0;
|
||||
|
||||
if(isWorld || 0 < reg) {
|
||||
for (G4int ii=0; ii<nEmModels; ++ii) {
|
||||
|
||||
for (G4int ii=0; ii<nEmModels; ii++) {
|
||||
G4VEmModel* model = models[ii];
|
||||
if ( region == regions[ii] ) {
|
||||
|
||||
G4VEmModel* model = models[ii];
|
||||
if ( region == regions[ii] ) {
|
||||
G4double tmin = model->LowEnergyLimit();
|
||||
G4double tmax = model->HighEnergyLimit();
|
||||
G4int ord = orderOfModels[ii];
|
||||
G4bool push = true;
|
||||
G4bool insert = false;
|
||||
G4int idx = n;
|
||||
|
||||
G4double tmin = model->LowEnergyLimit();
|
||||
G4double tmax = model->HighEnergyLimit();
|
||||
G4int ord = orderOfModels[ii];
|
||||
G4bool push = true;
|
||||
G4bool insert = false;
|
||||
G4int idx = n;
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "Model #" << ii
|
||||
<< " <" << model->GetName() << "> for region <";
|
||||
if (region) G4cout << region->GetName();
|
||||
G4cout << "> "
|
||||
<< " tmin(MeV)= " << tmin/MeV
|
||||
<< "; tmax(MeV)= " << tmax/MeV
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "Model #" << ii
|
||||
<< " <" << model->GetName() << "> for region <";
|
||||
if (region) G4cout << region->GetName();
|
||||
G4cout << "> "
|
||||
<< " tmin(MeV)= " << tmin/MeV
|
||||
<< "; tmax(MeV)= " << tmax/MeV
|
||||
<< "; order= " << ord
|
||||
<< G4endl;
|
||||
}
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
if (n == 0) n++;
|
||||
else {
|
||||
tmin = std::min(tmin, eHigh[n-1]);
|
||||
if(tmin >= tmax) push = false;
|
||||
else {
|
||||
if(n > 0) {
|
||||
|
||||
// high energy model
|
||||
if(tmin == eHigh[n-1] && tmax > eHigh[n-1]) n++;
|
||||
else if (tmax > eHigh[n-1]) {
|
||||
|
||||
// compare order of models
|
||||
for(G4int k = n-1; k>=0; k--) {
|
||||
|
||||
if (ord >= modelOrd[k]) {
|
||||
tmin = std::max(tmin, eHigh[k]);
|
||||
if(k < n-1) n = k + 2;
|
||||
break;
|
||||
} else if (tmin > eLow[k]) {
|
||||
eHigh[k] = tmin;
|
||||
n = k + 2;
|
||||
break;
|
||||
} else if (tmin == eLow[k]) {
|
||||
n = k + 1;
|
||||
break;
|
||||
}
|
||||
// extend energy range to previous models
|
||||
tmin = std::min(tmin, eHigh[n-1]);
|
||||
tmax = std::max(tmax, eLow[0]);
|
||||
//G4cout << "tmin= " << tmin << " tmax= "
|
||||
// << tmax << " ord= " << ord <<G4endl;
|
||||
// empty energy range
|
||||
if( tmax - tmin <= eV) push = false;
|
||||
// low-energy model
|
||||
else if (tmax == eLow[0]) {
|
||||
push = false;
|
||||
insert = true;
|
||||
idx = 0;
|
||||
// resolve intersections
|
||||
} else if(tmin < eHigh[n-1]) {
|
||||
// compare order
|
||||
for(G4int k=0; k<n; ++k) {
|
||||
// new model has lower application
|
||||
if(ord >= modelOrd[k]) {
|
||||
if(tmin < eHigh[k] && tmin >= eLow[k]) tmin = eHigh[k];
|
||||
if(tmax <= eHigh[k] && tmax > eLow[k]) tmax = eLow[k];
|
||||
if(tmax > eHigh[k] && tmin < eLow[k]) {
|
||||
if(tmax - eHigh[k] > eLow[k] - tmin) tmin = eHigh[k];
|
||||
else tmax = eLow[k];
|
||||
}
|
||||
if(tmin < eLow[0]) n = 1;
|
||||
idx = n - 1;
|
||||
|
||||
// low energy model
|
||||
} else {
|
||||
|
||||
tmax = std::max(tmax, eLow[0]);
|
||||
insert = true;
|
||||
push = false;
|
||||
if( tmax - tmin <= eV) {
|
||||
push = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//G4cout << "tmin= " << tmin << " tmax= "
|
||||
// << tmax << " push= " << push << " idx= " << idx <<G4endl;
|
||||
if(push) {
|
||||
if (tmax == eLow[0]) {
|
||||
push = false;
|
||||
insert = true;
|
||||
idx = 0;
|
||||
if(tmax <= eLow[0]) tmax = eLow[0];
|
||||
else {
|
||||
|
||||
for(G4int k=0; k<n; k++) {
|
||||
|
||||
if (ord >= modelOrd[k]) {
|
||||
if(k == 0) {
|
||||
if(tmin < eLow[0]) tmax = eLow[0];
|
||||
else insert = false;
|
||||
break;
|
||||
} else {
|
||||
insert = false;
|
||||
break;
|
||||
}
|
||||
} else if(tmax < eHigh[k]) {
|
||||
idx = k;
|
||||
if(k > 0) tmin = eLow[k];
|
||||
eLow[k] = tmax;
|
||||
break;
|
||||
} else if(tmax == eHigh[k]) {
|
||||
insert = false;
|
||||
push = true;
|
||||
idx = k;
|
||||
if(k > 0) tmin = eLow[k];
|
||||
else tmin = std::min(tmin,eLow[0]);
|
||||
break;
|
||||
} else {
|
||||
// continue resolve intersections
|
||||
} else if(tmin < eHigh[n-1]) {
|
||||
// last energy interval
|
||||
if(tmin > eLow[n-1] && tmax >= eHigh[n-1]) {
|
||||
eHigh[n-1] = tmin;
|
||||
// first energy interval
|
||||
} else if(tmin <= eLow[0] && tmax < eHigh[0]) {
|
||||
eLow[0] = tmax;
|
||||
push = false;
|
||||
insert = true;
|
||||
idx = 0;
|
||||
} else {
|
||||
// find energy interval to replace
|
||||
for(G4int k=0; k<n; ++k) {
|
||||
if(tmin <= eLow[k] && tmax >= eHigh[k]) {
|
||||
push = false;
|
||||
modelAtRegion[k] = ii;
|
||||
modelOrd[k] = ord;
|
||||
if(k == 0) eLow[idx] = std::min(tmin,eLow[0]);
|
||||
}
|
||||
isUsed[ii] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(insert && idx < n) n++;
|
||||
else insert = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(n > nmax) {
|
||||
nmax = n;
|
||||
modelAtRegion.resize(nmax);
|
||||
modelOrd.resize(nmax);
|
||||
eLow.resize(nmax);
|
||||
eHigh.resize(nmax);
|
||||
}
|
||||
if(insert) {
|
||||
for(G4int k=n-2; k>=idx; k--) {
|
||||
modelAtRegion[k+1] = modelAtRegion[k];
|
||||
modelOrd[k+1] = modelOrd[k];
|
||||
eLow[k+1] = eLow[k];
|
||||
eHigh[k+1] = eHigh[k];
|
||||
}
|
||||
}
|
||||
if (push || insert) {
|
||||
modelAtRegion[idx] = ii;
|
||||
modelOrd[idx] = ord;
|
||||
eLow[idx] = tmin;
|
||||
eHigh[idx] = tmax;
|
||||
}
|
||||
if(insert) {
|
||||
for(G4int k=n-1; k>=idx; --k) {
|
||||
modelAtRegion[k+1] = modelAtRegion[k];
|
||||
modelOrd[k+1] = modelOrd[k];
|
||||
eLow[k+1] = eLow[k];
|
||||
eHigh[k+1] = eHigh[k];
|
||||
}
|
||||
}
|
||||
//G4cout << "push= " << push << " insert= " << insert
|
||||
//<< " idx= " << idx <<G4endl;
|
||||
if (push || insert) {
|
||||
++n;
|
||||
modelAtRegion[idx] = ii;
|
||||
modelOrd[idx] = ord;
|
||||
eLow[idx] = tmin;
|
||||
eHigh[idx] = tmax;
|
||||
isUsed[ii] = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
n = 1;
|
||||
models.push_back(0);
|
||||
modelAtRegion.push_back(nEmModels);
|
||||
eLow.push_back(0.0);
|
||||
eHigh.push_back(DBL_MAX);
|
||||
}
|
||||
eLow[0] = 0.0;
|
||||
if(n >= nmax) eLow.resize(nmax+1);
|
||||
eLow[n] = eHigh[n-1];
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "New G4RegionModels set with " << n << " models for region <";
|
||||
if (region) G4cout << region->GetName();
|
||||
G4cout << "> Elow(MeV)= ";
|
||||
for(G4int ii=0; ii<=n; ii++) {G4cout << eLow[ii]/MeV << " ";}
|
||||
for(G4int ii=0; ii<=n; ++ii) {G4cout << eLow[ii]/MeV << " ";}
|
||||
G4cout << G4endl;
|
||||
}
|
||||
G4RegionModels* rm = new G4RegionModels(n, modelAtRegion, eLow, region);
|
||||
setOfRegionModels[reg] = rm;
|
||||
if(1 == nEmModels) break;
|
||||
}
|
||||
|
||||
// Access to materials and build cuts
|
||||
currRegionModel = setOfRegionModels[0];
|
||||
|
||||
for(G4int i=0; i<numOfCouples; i++) {
|
||||
// Access to materials and build cuts
|
||||
size_t idx = 1;
|
||||
if(secondaryParticle) {
|
||||
if( secondaryParticle == G4Gamma::Gamma() ) idx = 0;
|
||||
else if( secondaryParticle == G4Positron::Positron()) idx = 2;
|
||||
}
|
||||
|
||||
if(numOfCouples > theCuts.size()) {theCuts.resize(numOfCouples);}
|
||||
if(minSubRange < 1.0 && numOfCouples > theSubCuts.size()) {
|
||||
theSubCuts.resize(numOfCouples);
|
||||
}
|
||||
for(size_t i=0; i<numOfCouples; ++i) {
|
||||
|
||||
const G4MaterialCutsCouple* couple =
|
||||
theCoupleTable->GetMaterialCutsCouple(i);
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
const G4ProductionCuts* pcuts = couple->GetProductionCuts();
|
||||
|
||||
G4int reg = nRegions;
|
||||
do {reg--;} while (reg>0 && pcuts != (setr[reg]->GetProductionCuts()));
|
||||
idxOfRegionModels[i] = reg;
|
||||
|
||||
G4int reg = 0;
|
||||
if(nRegions > 1 && nEmModels > 1) {
|
||||
reg = nRegions;
|
||||
do {--reg;} while (reg>0 && pcuts != (setr[reg]->GetProductionCuts()));
|
||||
idxOfRegionModels[i] = reg;
|
||||
}
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager::Initialise() for "
|
||||
<< material->GetName()
|
||||
<< " indexOfCouple= " << i
|
||||
<< " indexOfRegion= " << reg
|
||||
<< G4endl;
|
||||
<< material->GetName()
|
||||
<< " indexOfCouple= " << i
|
||||
<< " indexOfRegion= " << reg
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
G4double cut = DBL_MAX;
|
||||
G4double cut = (*theCoupleTable->GetEnergyCutsVector(idx))[i];
|
||||
G4double subcut = DBL_MAX;
|
||||
if(secondaryParticle) {
|
||||
size_t idx = 1;
|
||||
if( secondaryParticle == theGamma ) idx = 0;
|
||||
cut = (*theCoupleTable->GetEnergyCutsVector(idx))[i];
|
||||
if( secondaryParticle == thePositron && 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) {
|
||||
if( cut < DBL_MAX && minSubRange < 1.0) {
|
||||
subcut = minSubRange*cut;
|
||||
G4double rcut = std::min(minSubRange*pcuts->GetProductionCut(idx),
|
||||
maxSubCutInRange);
|
||||
G4double tcutmax =
|
||||
theCoupleTable->ConvertRangeToEnergy(secondaryParticle,
|
||||
material,maxSubCutInRange);
|
||||
theCoupleTable->ConvertRangeToEnergy(secondaryParticle,material,rcut);
|
||||
if(tcutmax < subcut) subcut = tcutmax;
|
||||
}
|
||||
}
|
||||
|
||||
G4int nm = setOfRegionModels[reg]->NumberOfModels();
|
||||
for(G4int j=0; j<nm; j++) {
|
||||
for(G4int j=0; j<nm; ++j) {
|
||||
|
||||
G4VEmModel* model = models[setOfRegionModels[reg]->ModelIndex(j)];
|
||||
|
||||
@@ -488,15 +481,22 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
theCuts.push_back(cut);
|
||||
theSubCuts.push_back(subcut);
|
||||
theCuts[i] = cut;
|
||||
if(minSubRange < 1.0) theSubCuts[i] = subcut;
|
||||
}
|
||||
|
||||
for(G4int jj=0; jj<nEmModels; jj++) {
|
||||
models[jj]->Initialise(particle, theCuts);
|
||||
if(flucModels[jj]) flucModels[jj]->InitialiseMe(particle);
|
||||
// initialize models
|
||||
G4int nn = 0;
|
||||
severalModels = true;
|
||||
for(G4int jj=0; jj<nEmModels; ++jj) {
|
||||
if(1 == isUsed[jj]) {
|
||||
++nn;
|
||||
currModel = models[jj];
|
||||
currModel->Initialise(particle, theCuts);
|
||||
if(flucModels[jj]) flucModels[jj]->InitialiseMe(particle);
|
||||
}
|
||||
}
|
||||
|
||||
if(1 == nn) severalModels = false;
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager for " << particle->GetParticleName()
|
||||
@@ -513,143 +513,68 @@ void G4EmModelManager::FillDEDXVector(G4PhysicsVector* aVector,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
G4EmTableType tType)
|
||||
{
|
||||
|
||||
G4double e;
|
||||
|
||||
size_t i = couple->GetIndex();
|
||||
G4double cut = theCuts[i];
|
||||
G4double subcut = 0.0;
|
||||
G4double emin = 0.0;
|
||||
|
||||
if(fTotal == tType) cut = DBL_MAX;
|
||||
else if(fSubRestricted == tType) subcut = theSubCuts[i];
|
||||
else if(fSubRestricted == tType) {
|
||||
emin = cut;
|
||||
if(theSubCuts.size() > 0) emin = theSubCuts[i];
|
||||
}
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager::FillDEDXVector() for "
|
||||
<< couple->GetMaterial()->GetName()
|
||||
<< " cut(MeV)= " << cut
|
||||
<< " subcut(MeV)= " << subcut
|
||||
<< " emin(MeV)= " << emin
|
||||
<< " Type " << tType
|
||||
<< " for " << particle->GetParticleName()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
G4int reg = idxOfRegionModels[i];
|
||||
G4int reg = 0;
|
||||
if(nRegions > 1 && nEmModels > 1) reg = idxOfRegionModels[i];
|
||||
const G4RegionModels* regModels = setOfRegionModels[reg];
|
||||
G4int nmod = regModels->NumberOfModels();
|
||||
|
||||
// vectors to provide continues dE/dx
|
||||
G4DataVector factor(nmod);
|
||||
G4DataVector eLow(nmod+1);
|
||||
G4DataVector dedxLow(nmod);
|
||||
G4DataVector dedxHigh(nmod);
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "There are " << nmod << " models for "
|
||||
<< couple->GetMaterial()->GetName()
|
||||
<< " at the region #" << reg
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
// calculate factors to provide continuity of energy loss
|
||||
|
||||
|
||||
factor[0] = 1.0;
|
||||
G4int j;
|
||||
|
||||
G4int totBinsLoss = aVector->GetVectorLength();
|
||||
|
||||
dedxLow[0] = 0.0;
|
||||
eLow[0] = 0.0;
|
||||
|
||||
e = regModels->LowEdgeEnergy(1);
|
||||
eLow[1] = e;
|
||||
G4VEmModel* model = models[regModels->ModelIndex(0)];
|
||||
dedxHigh[0] = 0.0;
|
||||
if(model && cut > subcut) {
|
||||
dedxHigh[0] = model->ComputeDEDX(couple,particle,e,cut);
|
||||
if(subcut > 0.0) {
|
||||
dedxHigh[0] -= model->ComputeDEDX(couple,particle,e,subcut);
|
||||
}
|
||||
}
|
||||
if(nmod > 1) {
|
||||
for(j=1; j<nmod; j++) {
|
||||
|
||||
e = regModels->LowEdgeEnergy(j);
|
||||
eLow[j] = e;
|
||||
G4int idx = regModels->ModelIndex(j);
|
||||
|
||||
dedxLow[j] = models[idx]->ComputeDEDX(couple,particle,e,cut);
|
||||
if(subcut > 0.0) {
|
||||
dedxLow[j] -= models[idx]->ComputeDEDX(couple,particle,e,subcut);
|
||||
}
|
||||
if(subcut == cut) dedxLow[j] = 0.0;
|
||||
|
||||
e = regModels->LowEdgeEnergy(j+1);
|
||||
eLow[j+1] = e;
|
||||
dedxHigh[j] = models[idx]->ComputeDEDX(couple,particle,e,cut);
|
||||
if(subcut > 0.0) {
|
||||
dedxHigh[j] -= models[idx]->ComputeDEDX(couple,particle,e,subcut);
|
||||
}
|
||||
if(subcut == cut) dedxHigh[j] = 0.0;
|
||||
}
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << " model #0"
|
||||
<< " dedx(" << eLow[0] << ")= " << dedxLow[0]
|
||||
<< " dedx(" << eLow[1] << ")= " << dedxHigh[0]
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
for(j=1; j<nmod; j++) {
|
||||
if(dedxLow[j] > 0.0) {
|
||||
factor[j] = (dedxHigh[j-1]/dedxLow[j] - 1.0)*eLow[j];
|
||||
} else factor[j] = 0.0;
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << " model #" << j
|
||||
<< " dedx(" << eLow[j] << ")= " << dedxLow[j]
|
||||
<< " dedx(" << eLow[j+1] << ")= " << dedxHigh[j]
|
||||
<< " factor= " << factor[j]/eLow[j]
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
if(2 < verboseLevel) {
|
||||
G4cout << "Loop over " << totBinsLoss << " bins start " << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate energy losses vector
|
||||
for(j=0; j<totBinsLoss; j++) {
|
||||
|
||||
G4double e = aVector->GetLowEdgeEnergy(j);
|
||||
G4double fac = 1.0;
|
||||
//G4cout << "nmod= " << nmod << G4endl;
|
||||
size_t totBinsLoss = aVector->GetVectorLength();
|
||||
for(size_t j=0; j<totBinsLoss; ++j) {
|
||||
|
||||
// Choose a model of energy losses
|
||||
G4double e = aVector->Energy(j);
|
||||
G4double del = 0.0;
|
||||
|
||||
// Choose a model of energy losses
|
||||
G4int k = 0;
|
||||
if (nmod > 1 && e > eLow[1]) {
|
||||
do {
|
||||
k++;
|
||||
fac *= (1.0 + factor[k]/e);
|
||||
} while (k+1 < nmod && e > eLow[k+1]);
|
||||
}
|
||||
|
||||
model = models[regModels->ModelIndex(k)];
|
||||
G4double dedx = 0.0;
|
||||
G4double dedx0 = 0.0;
|
||||
if(model && cut > subcut) {
|
||||
dedx = model->ComputeDEDX(couple,particle,e,cut);
|
||||
dedx0 = dedx;
|
||||
if(subcut > 0.0) dedx -= model->ComputeDEDX(couple,particle,e,subcut);
|
||||
dedx *= fac;
|
||||
if (nmod > 1) {
|
||||
k = nmod;
|
||||
do {--k;} while (k>0 && e <= regModels->LowEdgeEnergy(k));
|
||||
//G4cout << "k= " << k << G4endl;
|
||||
if(k > 0) {
|
||||
G4double elow = regModels->LowEdgeEnergy(k);
|
||||
G4double dedx1 = ComputeDEDX(models[regModels->ModelIndex(k-1)],
|
||||
couple,elow,cut,emin);
|
||||
G4double dedx2 = ComputeDEDX(models[regModels->ModelIndex(k)],
|
||||
couple,elow,cut,emin);
|
||||
del = (dedx1 - dedx2)*elow/e;
|
||||
//G4cout << "elow= " << elow
|
||||
// << " dedx1= " << dedx1 << " dedx2= " << dedx2 << G4endl;
|
||||
}
|
||||
}
|
||||
G4double dedx = ComputeDEDX(models[regModels->ModelIndex(k)],
|
||||
couple,e,cut,emin) + del;
|
||||
|
||||
if(dedx < 0.0) dedx = 0.0;
|
||||
if(2 < verboseLevel) {
|
||||
G4cout << "Material= " << couple->GetMaterial()->GetName()
|
||||
<< " E(MeV)= " << e/MeV
|
||||
<< " dEdx(MeV/mm)= " << dedx*mm/MeV
|
||||
<< " dEdx0(MeV/mm)= " << dedx0*mm/MeV
|
||||
<< " fac= " << fac
|
||||
<< G4endl;
|
||||
G4cout << "Material= " << couple->GetMaterial()->GetName()
|
||||
<< " E(MeV)= " << e/MeV
|
||||
<< " dEdx(MeV/mm)= " << dedx*mm/MeV
|
||||
<< " del= " << del*mm/MeV<< " k= " << k
|
||||
<< " modelIdx= " << regModels->ModelIndex(k)
|
||||
<< G4endl;
|
||||
}
|
||||
aVector->PutValue(j, dedx);
|
||||
}
|
||||
@@ -662,126 +587,62 @@ void G4EmModelManager::FillLambdaVector(G4PhysicsVector* aVector,
|
||||
G4bool startFromNull,
|
||||
G4EmTableType tType)
|
||||
{
|
||||
G4double e;
|
||||
|
||||
size_t i = couple->GetIndex();
|
||||
G4double cut = theCuts[i];
|
||||
G4double tmax = DBL_MAX;
|
||||
if (fSubRestricted == tType) {
|
||||
tmax = cut;
|
||||
cut = theSubCuts[i];
|
||||
if(theSubCuts.size() > 0) cut = theSubCuts[i];
|
||||
}
|
||||
|
||||
G4int reg = 0;
|
||||
if(nRegions > 1 && nEmModels > 1) reg = idxOfRegionModels[i];
|
||||
const G4RegionModels* regModels = setOfRegionModels[reg];
|
||||
G4int nmod = regModels->NumberOfModels();
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4EmModelManager::FillLambdaVector() for particle "
|
||||
G4cout << "G4EmModelManager::FillLambdaVector() for "
|
||||
<< particle->GetParticleName()
|
||||
<< " in " << couple->GetMaterial()->GetName()
|
||||
<< " Ecut(MeV)= " << cut
|
||||
<< " Emax(MeV)= " << tmax
|
||||
<< " Type " << tType
|
||||
<< " Ecut(MeV)= " << cut
|
||||
<< " Emax(MeV)= " << tmax
|
||||
<< " Type " << tType
|
||||
<< " nmod= " << nmod
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
G4int reg = idxOfRegionModels[i];
|
||||
const G4RegionModels* regModels = setOfRegionModels[reg];
|
||||
G4int nmod = regModels->NumberOfModels();
|
||||
|
||||
// vectors to provide continues dE/dx
|
||||
G4DataVector factor(nmod);
|
||||
G4DataVector eLow(nmod+1);
|
||||
G4DataVector sigmaLow(nmod);
|
||||
G4DataVector sigmaHigh(nmod);
|
||||
|
||||
if(2 < verboseLevel) {
|
||||
G4cout << "There are " << nmod << " models for "
|
||||
<< couple->GetMaterial()->GetName() << G4endl;
|
||||
}
|
||||
|
||||
// calculate factors to provide continuity of energy loss
|
||||
factor[0] = 1.0;
|
||||
G4int j;
|
||||
G4int totBinsLambda = aVector->GetVectorLength();
|
||||
|
||||
sigmaLow[0] = 0.0;
|
||||
eLow[0] = 0.0;
|
||||
|
||||
e = regModels->LowEdgeEnergy(1);
|
||||
eLow[1] = e;
|
||||
G4VEmModel* model = models[regModels->ModelIndex(0)];
|
||||
sigmaHigh[0] = 0.0;
|
||||
if(model) sigmaHigh[0] = model->CrossSection(couple,particle,e,cut,tmax);
|
||||
|
||||
if(2 < verboseLevel) {
|
||||
G4cout << "### For material " << couple->GetMaterial()->GetName()
|
||||
<< " " << nmod
|
||||
<< " models"
|
||||
<< " Ecut(MeV)= " << cut/MeV
|
||||
<< " Emax(MeV)= " << e/MeV
|
||||
<< " nbins= " << totBinsLambda
|
||||
<< G4endl;
|
||||
G4cout << " model #0 eUp= " << e
|
||||
<< " sigmaUp= " << sigmaHigh[0] << G4endl;
|
||||
}
|
||||
|
||||
|
||||
if(nmod > 1) {
|
||||
|
||||
for(j=1; j<nmod; j++) {
|
||||
|
||||
e = regModels->LowEdgeEnergy(j);
|
||||
eLow[j] = e;
|
||||
G4int idx = regModels->ModelIndex(j);
|
||||
|
||||
sigmaLow[j] = models[idx]->CrossSection(couple,particle,e,cut,tmax);
|
||||
e = regModels->LowEdgeEnergy(j+1);
|
||||
eLow[j+1] = e;
|
||||
sigmaHigh[j] = models[idx]->CrossSection(couple,particle,e,cut,tmax);
|
||||
}
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << " model #0"
|
||||
<< " sigma(" << eLow[0] << ")= " << sigmaLow[0]
|
||||
<< " sigma(" << eLow[1] << ")= " << sigmaHigh[0]
|
||||
<< G4endl;
|
||||
}
|
||||
for(j=1; j<nmod; j++) {
|
||||
if(sigmaLow[j] > 0.0) {
|
||||
factor[j] = (sigmaHigh[j-1]/sigmaLow[j] - 1.0)*eLow[j];
|
||||
} else factor[j] = 0.0;
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << " model #" << j
|
||||
<< " sigma(" << eLow[j] << ")= " << sigmaLow[j]
|
||||
<< " sigma(" << eLow[j+1] << ")= " << sigmaHigh[j]
|
||||
<< " factor= " << factor[j]/eLow[j]
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate lambda vector
|
||||
for(j=0; j<totBinsLambda; j++) {
|
||||
size_t totBinsLambda = aVector->GetVectorLength();
|
||||
for(size_t j=0; j<totBinsLambda; ++j) {
|
||||
|
||||
e = aVector->GetLowEdgeEnergy(j);
|
||||
G4double e = aVector->Energy(j);
|
||||
|
||||
// Choose a model of energy losses
|
||||
G4double del = 0.0;
|
||||
|
||||
// Choose a model
|
||||
G4int k = 0;
|
||||
G4double fac = 1.0;
|
||||
if (nmod > 1 && e > eLow[1]) {
|
||||
do {
|
||||
k++;
|
||||
fac *= (1.0 + factor[k]/e);
|
||||
} while ( k+1 < nmod && e > eLow[k+1] );
|
||||
G4VEmModel* mod = models[regModels->ModelIndex(0)];
|
||||
if (nmod > 1) {
|
||||
k = nmod;
|
||||
do {--k;} while (k>0 && e <= regModels->LowEdgeEnergy(k));
|
||||
if(k > 0) {
|
||||
G4double elow = regModels->LowEdgeEnergy(k);
|
||||
G4VEmModel* m = models[regModels->ModelIndex(k-1)];
|
||||
G4double xs1 = m->CrossSection(couple,particle,elow,cut,tmax);
|
||||
mod = models[regModels->ModelIndex(k)];
|
||||
G4double xs2 = mod->CrossSection(couple,particle,elow,cut,tmax);
|
||||
del = (xs1 - xs2)*elow/e;
|
||||
}
|
||||
}
|
||||
|
||||
model = models[regModels->ModelIndex(k)];
|
||||
G4double cross = 0.0;
|
||||
if(model) cross = model->CrossSection(couple,particle,e,cut,tmax)*fac;
|
||||
G4double cross = mod->CrossSection(couple,particle,e,cut,tmax) + del;
|
||||
|
||||
if(j==0 && startFromNull) cross = 0.0;
|
||||
|
||||
if(2 < verboseLevel) {
|
||||
G4cout << "FillLambdaVector: " << j << ". e(MeV)= " << e/MeV
|
||||
<< " cross(1/mm)= " << cross*mm
|
||||
<< " fac= " << fac << " k= " << k
|
||||
<< " model= " << regModels->ModelIndex(k)
|
||||
<< " del= " << del*mm << " k= " << k
|
||||
<< " modelIdx= " << regModels->ModelIndex(k)
|
||||
<< G4endl;
|
||||
}
|
||||
if(cross < 0.0) cross = 0.0;
|
||||
@@ -795,16 +656,14 @@ void G4EmModelManager::FillLambdaVector(G4PhysicsVector* aVector,
|
||||
void G4EmModelManager::DumpModelList(G4int verb)
|
||||
{
|
||||
if(verb == 0) return;
|
||||
for(G4int i=0; i<nRegions; i++) {
|
||||
for(G4int i=0; i<nRegions; ++i) {
|
||||
G4RegionModels* r = setOfRegionModels[i];
|
||||
const G4Region* reg = r->Region();
|
||||
if(verb > 1 || nRegions > 1) {
|
||||
}
|
||||
G4int n = r->NumberOfModels();
|
||||
if(verb > 1 || n > 0) {
|
||||
if(n > 0) {
|
||||
G4cout << " ===== EM models for the G4Region " << reg->GetName()
|
||||
<< " ======" << G4endl;;
|
||||
for(G4int j=0; j<n; j++) {
|
||||
for(G4int j=0; j<n; ++j) {
|
||||
const G4VEmModel* m = models[r->ModelIndex(j)];
|
||||
G4cout << std::setw(20);
|
||||
G4cout << m->GetName() << " : Emin= "
|
||||
@@ -814,6 +673,7 @@ void G4EmModelManager::DumpModelList(G4int verb)
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
if(1 == nEmModels) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmProcessOptions.cc,v 1.24 2008/04/17 10:33:27 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmProcessOptions.cc,v 1.27 2009/10/29 19:25:28 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -58,6 +58,7 @@
|
||||
#include "G4VEnergyLossProcess.hh"
|
||||
#include "G4VMultipleScattering.hh"
|
||||
#include "G4Region.hh"
|
||||
#include "G4RegionStore.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -391,21 +392,40 @@ void G4EmProcessOptions::SetLambdaFactor(G4double val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EmProcessOptions::ActivateDeexcitation(G4bool val, const G4Region* r)
|
||||
void G4EmProcessOptions::ActivateDeexcitation(const G4String& pname,
|
||||
G4bool val,
|
||||
const G4String& reg)
|
||||
{
|
||||
G4RegionStore* regionStore = G4RegionStore::GetInstance();
|
||||
const G4Region* r = 0;
|
||||
if(reg == "" || reg == "World") {
|
||||
r = regionStore->GetRegion("DefaultRegionForTheWorld", false);
|
||||
} else {
|
||||
r = regionStore->GetRegion(reg, false);
|
||||
}
|
||||
if(!r) {
|
||||
G4cout << "G4EmProcessOptions::ActivateDeexcitation ERROR: G4Region <"
|
||||
<< reg << "> not found, the command ignored" << G4endl;
|
||||
return;
|
||||
}
|
||||
|
||||
const std::vector<G4VEnergyLossProcess*>& v =
|
||||
theManager->GetEnergyLossProcessVector();
|
||||
std::vector<G4VEnergyLossProcess*>::const_iterator itr;
|
||||
for(itr = v.begin(); itr != v.end(); itr++) {
|
||||
G4VEnergyLossProcess* p = *itr;
|
||||
if(p) p->ActivateDeexcitation(val,r);
|
||||
if(p) {
|
||||
if(pname == p->GetProcessName()) p->ActivateDeexcitation(val,r);
|
||||
}
|
||||
}
|
||||
const std::vector<G4VEmProcess*>& w =
|
||||
theManager->GetEmProcessVector();
|
||||
std::vector<G4VEmProcess*>::const_iterator itp;
|
||||
for(itp = w.begin(); itp != w.end(); itp++) {
|
||||
G4VEmProcess* q = *itp;
|
||||
if(q) q->ActivateDeexcitation(val,r);
|
||||
if(q) {
|
||||
if(pname == q->GetProcessName()) q->ActivateDeexcitation(val,r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,6 +515,13 @@ void G4EmProcessOptions::SetPolarAngleLimit(G4double val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EmProcessOptions::SetFactorForAngleLimit(G4double val)
|
||||
{
|
||||
theManager->SetFactorForAngleLimit(val);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4EmProcessOptions::SetLPMFlag(G4bool val)
|
||||
{
|
||||
theManager->SetLPMFlag(val);
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmSaturation.cc,v 1.9 2008/11/12 15:37:33 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EmSaturation.cc,v 1.10 2009/09/25 09:16:40 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -45,14 +45,12 @@
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "G4EmSaturation.hh"
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Neutron.hh"
|
||||
#include "G4Proton.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialCutsCouple.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Proton.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -65,7 +63,8 @@ G4EmSaturation::G4EmSaturation()
|
||||
curRatio = 1.0;
|
||||
curChargeSq = 1.0;
|
||||
nMaterials = 0;
|
||||
Initialise();
|
||||
electron = 0;
|
||||
Initialise();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -89,8 +88,9 @@ G4double G4EmSaturation::VisibleEnergyDeposition(
|
||||
|
||||
if(bfactor > 0.0) {
|
||||
|
||||
// atomic relaxations
|
||||
if(p == gamma) {
|
||||
G4int pdgCode = p->GetPDGEncoding();
|
||||
// atomic relaxations for gamma incident
|
||||
if(22 == pdgCode) {
|
||||
evis /= (1.0 + bfactor*edep/manager->GetRange(electron,edep,couple));
|
||||
|
||||
// energy loss
|
||||
@@ -100,7 +100,9 @@ G4double G4EmSaturation::VisibleEnergyDeposition(
|
||||
G4double nloss = niel;
|
||||
if(nloss < 0.0) nloss = 0.0;
|
||||
G4double eloss = edep - nloss;
|
||||
if(p == neutron || eloss < 0.0 || length <= 0.0) {
|
||||
|
||||
// neutrons
|
||||
if(2112 == pdgCode || eloss < 0.0 || length <= 0.0) {
|
||||
nloss = edep;
|
||||
eloss = 0.0;
|
||||
}
|
||||
@@ -110,6 +112,7 @@ G4double G4EmSaturation::VisibleEnergyDeposition(
|
||||
|
||||
// non-ionizing energy loss
|
||||
if(nloss > 0.0) {
|
||||
if(!proton) {proton = G4Proton::Proton();}
|
||||
G4double escaled = nloss*curRatio;
|
||||
G4double s = manager->GetRange(proton,escaled,couple)/curChargeSq;
|
||||
nloss /= (1.0 + bfactor*nloss/s);
|
||||
@@ -145,6 +148,14 @@ G4double G4EmSaturation::FindG4BirksCoefficient(const G4Material* mat)
|
||||
|
||||
G4double G4EmSaturation::FindBirksCoefficient(const G4Material* mat)
|
||||
{
|
||||
// electron should exist in any case
|
||||
if(!manager) {
|
||||
manager = G4LossTableManager::Instance();
|
||||
nist = G4NistManager::Instance();
|
||||
electron= G4Electron::Electron();
|
||||
proton = 0;
|
||||
}
|
||||
|
||||
if(mat == curMaterial) return curBirks;
|
||||
|
||||
curMaterial = mat;
|
||||
@@ -162,15 +173,6 @@ G4double G4EmSaturation::FindBirksCoefficient(const G4Material* mat)
|
||||
}
|
||||
}
|
||||
|
||||
if(!manager) {
|
||||
manager = G4LossTableManager::Instance();
|
||||
nist = G4NistManager::Instance();
|
||||
gamma = G4Gamma::Gamma();
|
||||
electron= G4Electron::Electron();
|
||||
proton = G4Proton::Proton();
|
||||
neutron = G4Neutron::Neutron();
|
||||
}
|
||||
|
||||
G4String name = mat->GetName();
|
||||
curBirks = mat->GetIonisation()->GetBirksConstant();
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EnergyLossMessenger.cc,v 1.35 2008/10/20 13:27:45 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4EnergyLossMessenger.cc,v 1.38 2009/10/29 19:25:28 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -177,16 +177,31 @@ G4EnergyLossMessenger::G4EnergyLossMessenger()
|
||||
aplCmd->SetDefaultValue(false);
|
||||
aplCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
deexCmd = new G4UIcommand("/process/em/deexcitation",this);
|
||||
deexCmd->SetGuidance("Set deexcitation flag per process and G4Region.");
|
||||
deexCmd->SetGuidance(" procName : process name");
|
||||
deexCmd->SetGuidance(" flag : flag");
|
||||
deexCmd->SetGuidance(" regName : G4Region name");
|
||||
|
||||
G4UIparameter* pName = new G4UIparameter("pName",'s',false);
|
||||
deexCmd->SetParameter(pName);
|
||||
|
||||
G4UIparameter* flag = new G4UIparameter("flag",'s',false);
|
||||
deexCmd->SetParameter(flag);
|
||||
|
||||
G4UIparameter* regName = new G4UIparameter("regName",'s',false);
|
||||
deexCmd->SetParameter(regName);
|
||||
|
||||
dedxCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsDEDX",this);
|
||||
dedxCmd->SetGuidance("Set number of bins for DEDX tables");
|
||||
dedxCmd->SetParameterName("binsDEDX",true);
|
||||
dedxCmd->SetDefaultValue(120);
|
||||
dedxCmd->SetDefaultValue(77);
|
||||
dedxCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
lamCmd = new G4UIcmdWithAnInteger("/process/eLoss/binsLambda",this);
|
||||
lamCmd->SetGuidance("Set number of bins for Lambda tables");
|
||||
lamCmd->SetParameterName("binsL",true);
|
||||
lamCmd->SetDefaultValue(120);
|
||||
lamCmd->SetDefaultValue(77);
|
||||
lamCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
verCmd = new G4UIcmdWithAnInteger("/process/eLoss/verbose",this);
|
||||
@@ -226,7 +241,7 @@ G4EnergyLossMessenger::G4EnergyLossMessenger()
|
||||
frCmd->SetGuidance("Set RangeFactor parameter for msc processes");
|
||||
frCmd->SetParameterName("Fr",true);
|
||||
frCmd->SetRange("Fr>0");
|
||||
frCmd->SetDefaultValue(0.02);
|
||||
frCmd->SetDefaultValue(0.04);
|
||||
frCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
fgCmd = new G4UIcmdWithADouble("/process/msc/GeomFactor",this);
|
||||
@@ -236,13 +251,20 @@ G4EnergyLossMessenger::G4EnergyLossMessenger()
|
||||
fgCmd->SetDefaultValue(3.5);
|
||||
fgCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
mscfCmd = new G4UIcmdWithADouble("/process/msc/FactorForAngleLimit",this);
|
||||
mscfCmd->SetGuidance("Set factor for computation of a limit for -t (invariant trasfer)");
|
||||
mscfCmd->SetParameterName("Fact",true);
|
||||
mscfCmd->SetRange("Fact>0");
|
||||
mscfCmd->SetDefaultValue(1.);
|
||||
mscfCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
skinCmd = new G4UIcmdWithADouble("/process/msc/Skin",this);
|
||||
skinCmd->SetGuidance("Set skin parameter for msc processes");
|
||||
skinCmd->SetParameterName("skin",true);
|
||||
skinCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
angCmd = new G4UIcmdWithADoubleAndUnit("/process/msc/ThetaLimit",this);
|
||||
angCmd->SetGuidance("Set the limit on the polar angle");
|
||||
angCmd->SetGuidance("Set the limit on the polar angle for msc and single scattering");
|
||||
angCmd->SetParameterName("theta",true);
|
||||
angCmd->SetUnitCategory("Angle");
|
||||
angCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
@@ -258,6 +280,7 @@ G4EnergyLossMessenger::~G4EnergyLossMessenger()
|
||||
delete SubSecCmd;
|
||||
delete MinSubSecCmd;
|
||||
delete StepFuncCmd;
|
||||
delete deexCmd;
|
||||
delete eLossDirectory;
|
||||
delete mscDirectory;
|
||||
delete emDirectory;
|
||||
@@ -280,6 +303,7 @@ G4EnergyLossMessenger::~G4EnergyLossMessenger()
|
||||
delete labCmd;
|
||||
delete skinCmd;
|
||||
delete angCmd;
|
||||
delete mscfCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -319,6 +343,15 @@ void G4EnergyLossMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
opt->SetStepFunction(v1,v2);
|
||||
}
|
||||
|
||||
if (command == deexCmd) {
|
||||
G4String s1 (""), s2(""), s3("");
|
||||
G4bool b = false;
|
||||
std::istringstream is(newValue);
|
||||
is >> s1 >> s2 >> s3;
|
||||
if(s2 == "true") b = true;
|
||||
opt->ActivateDeexcitation(s1,b,s3);
|
||||
}
|
||||
|
||||
if (command == mscCmd) {
|
||||
if(newValue == "Minimal")
|
||||
opt->SetMscStepLimitation(fMinimal);
|
||||
@@ -406,6 +439,10 @@ void G4EnergyLossMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
opt->SetMscGeomFactor(fgCmd->GetNewDoubleValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
if (command == mscfCmd) {
|
||||
opt->SetFactorForAngleLimit(mscfCmd->GetNewDoubleValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
}
|
||||
if (command == angCmd) {
|
||||
opt->SetPolarAngleLimit(angCmd->GetNewDoubleValue(newValue));
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LossTableBuilder.cc,v 1.27 2008/07/22 15:55:15 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4LossTableBuilder.cc,v 1.32 2009/08/11 17:24:53 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -46,6 +46,7 @@
|
||||
// 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)
|
||||
// 24-06-09 Removed hidden bin in G4PhysicsVector (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -84,26 +85,23 @@ G4LossTableBuilder::BuildDEDXTable(G4PhysicsTable* dedxTable,
|
||||
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);
|
||||
G4PhysicsLogVector* pv0 = static_cast<G4PhysicsLogVector*>((*(list[0]))[0]);
|
||||
size_t npoints = pv0->GetVectorLength();
|
||||
for (size_t i=0; i<n_vectors; i++) {
|
||||
|
||||
pv = new G4PhysicsLogVector(elow, ehigh, nbins);
|
||||
G4PhysicsLogVector* pv = new G4PhysicsLogVector(*pv0);
|
||||
// pv = new G4PhysicsLogVector(elow, ehigh, npoints-1);
|
||||
pv->SetSpline(splineFlag);
|
||||
for (size_t j=0; j<nbins; j++) {
|
||||
for (size_t j=0; j<npoints; j++) {
|
||||
G4double dedx = 0.0;
|
||||
G4double energy = pv->GetLowEdgeEnergy(j);
|
||||
|
||||
for (size_t k=0; k<n_processes; k++) {
|
||||
dedx += ((*(list[k]))[i])->GetValue(energy, b);
|
||||
G4PhysicsVector* pv1 = (*(list[k]))[i];
|
||||
dedx += (*pv1)[j];
|
||||
}
|
||||
pv->PutValue(j, dedx);
|
||||
G4PhysicsTableHelper::SetPhysicsVector(dedxTable, i, pv);
|
||||
}
|
||||
if(splineFlag) pv->FillSecondDerivatives();
|
||||
G4PhysicsTableHelper::SetPhysicsVector(dedxTable, i, pv);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,33 +115,46 @@ void G4LossTableBuilder::BuildRangeTable(const G4PhysicsTable* dedxTable,
|
||||
size_t n_vectors = dedxTable->length();
|
||||
if(!n_vectors) return;
|
||||
|
||||
G4bool b;
|
||||
size_t n = 100;
|
||||
G4double del = 1.0/(G4double)n;
|
||||
|
||||
for (size_t i=0; i<n_vectors; i++) {
|
||||
|
||||
if (rangeTable->GetFlag(i) || !isIonisation) {
|
||||
G4PhysicsVector* pv = (*dedxTable)[i];
|
||||
size_t nbins = pv->GetVectorLength();
|
||||
size_t bin0 = 0;
|
||||
G4double elow = pv->GetLowEdgeEnergy(0);
|
||||
G4double ehigh = pv->GetLowEdgeEnergy(nbins);
|
||||
G4double dedx1 = pv->GetValue(elow, b);
|
||||
G4PhysicsLogVector* pv =
|
||||
static_cast<G4PhysicsLogVector*>((*dedxTable)[i]);
|
||||
size_t npoints = pv->GetVectorLength();
|
||||
size_t bin0 = 0;
|
||||
G4double elow = pv->Energy(0);
|
||||
G4double ehigh = pv->Energy(npoints-1);
|
||||
G4double dedx1 = pv->Value(elow);
|
||||
|
||||
//G4cout << "nbins= " << nbins << " dedx1= " << dedx1 << G4endl;
|
||||
|
||||
// protection for specific cases dedx=0
|
||||
if(dedx1 == 0.0) {
|
||||
for (size_t k=1; k<nbins; k++) {
|
||||
for (size_t k=1; k<npoints; k++) {
|
||||
bin0++;
|
||||
elow = pv->GetLowEdgeEnergy(k);
|
||||
dedx1 = pv->GetValue(elow, b);
|
||||
elow = pv->Energy(k);
|
||||
dedx1 = (*pv)[k];
|
||||
if(dedx1 > 0.0) break;
|
||||
}
|
||||
nbins -= bin0;
|
||||
npoints -= bin0;
|
||||
}
|
||||
|
||||
// G4cout<<"New Range vector" << G4endl;
|
||||
// G4cout<<"nbins= "<<npoints-1<<" elow= "<<elow<<" ehigh= "<<ehigh<<G4endl;
|
||||
// initialisation of a new vector
|
||||
G4PhysicsLogVector* v = new G4PhysicsLogVector(elow, ehigh, nbins);
|
||||
if(npoints < 2) npoints = 2;
|
||||
G4PhysicsLogVector* v;
|
||||
if(0 == bin0) { v = new G4PhysicsLogVector(*pv); }
|
||||
else { v = new G4PhysicsLogVector(elow, ehigh, npoints-1); }
|
||||
// dedx is exect zero
|
||||
if(2 == npoints) {
|
||||
v->PutValue(0,1000.);
|
||||
v->PutValue(1,2000.);
|
||||
G4PhysicsTableHelper::SetPhysicsVector(rangeTable, i, v);
|
||||
return;
|
||||
}
|
||||
v->SetSpline(splineFlag);
|
||||
|
||||
// assumed dedx proportional to beta
|
||||
@@ -151,21 +162,23 @@ void G4LossTableBuilder::BuildRangeTable(const G4PhysicsTable* dedxTable,
|
||||
v->PutValue(0,range);
|
||||
G4double energy1 = elow;
|
||||
|
||||
for (size_t j=1; j<nbins; j++) {
|
||||
for (size_t j=1; j<npoints; j++) {
|
||||
|
||||
G4double energy2 = pv->GetLowEdgeEnergy(j+bin0);
|
||||
G4double energy2 = pv->Energy(j+bin0);
|
||||
G4double de = (energy2 - energy1) * del;
|
||||
G4double energy = energy2 + de*0.5;
|
||||
G4double sum = 0.0;
|
||||
for (size_t k=0; k<n; k++) {
|
||||
energy -= de;
|
||||
dedx1 = pv->GetValue(energy, b);
|
||||
if(dedx1 > 0.0) range += de/dedx1;
|
||||
dedx1 = pv->Value(energy);
|
||||
if(dedx1 > 0.0) sum += de/dedx1;
|
||||
}
|
||||
|
||||
range += sum;
|
||||
// G4cout << "Range i= " <<i << " j= " << j << G4endl;
|
||||
v->PutValue(j,range);
|
||||
energy1 = energy2;
|
||||
}
|
||||
if(splineFlag) v->FillSecondDerivatives();
|
||||
G4PhysicsTableHelper::SetPhysicsVector(rangeTable, i, v);
|
||||
}
|
||||
}
|
||||
@@ -180,27 +193,24 @@ void G4LossTableBuilder::BuildInverseRangeTable(const G4PhysicsTable* rangeTable
|
||||
{
|
||||
size_t n_vectors = rangeTable->length();
|
||||
if(!n_vectors) return;
|
||||
G4bool b;
|
||||
|
||||
for (size_t i=0; i<n_vectors; i++) {
|
||||
|
||||
if (invRangeTable->GetFlag(i) || !isIonisation) {
|
||||
G4PhysicsVector* pv = (*rangeTable)[i];
|
||||
size_t nbins = pv->GetVectorLength();
|
||||
G4double elow = pv->GetLowEdgeEnergy(0);
|
||||
G4double ehigh = pv->GetLowEdgeEnergy(nbins-1);
|
||||
G4double rlow = pv->GetValue(elow, b);
|
||||
G4double rhigh = pv->GetValue(ehigh, b);
|
||||
size_t npoints = pv->GetVectorLength();
|
||||
G4double rlow = (*pv)[0];
|
||||
G4double rhigh = (*pv)[npoints-1];
|
||||
|
||||
G4LPhysicsFreeVector* v = new G4LPhysicsFreeVector(nbins,rlow,rhigh);
|
||||
G4LPhysicsFreeVector* v = new G4LPhysicsFreeVector(npoints,rlow,rhigh);
|
||||
v->SetSpline(splineFlag);
|
||||
|
||||
for (size_t j=0; j<nbins; j++) {
|
||||
G4double e = pv->GetLowEdgeEnergy(j);
|
||||
G4double r = pv->GetValue(e, b);
|
||||
for (size_t j=0; j<npoints; j++) {
|
||||
G4double e = pv->Energy(j);
|
||||
G4double r = (*pv)[j];
|
||||
v->PutValues(j,r,e);
|
||||
}
|
||||
v->PutValues(nbins,rhigh+rlow,ehigh);
|
||||
if(splineFlag) v->FillSecondDerivatives();
|
||||
|
||||
G4PhysicsTableHelper::SetPhysicsVector(invRangeTable, i, v);
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LossTableManager.cc,v 1.95 2008/11/13 18:23:39 schaelic Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4LossTableManager.cc,v 1.97 2009/10/29 19:25:28 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -92,6 +92,7 @@
|
||||
#include "G4PhysicsTableHelper.hh"
|
||||
#include "G4EmCorrections.hh"
|
||||
#include "G4EmSaturation.hh"
|
||||
#include "G4EmConfigurator.hh"
|
||||
#include "G4EmTableType.hh"
|
||||
#include "G4LossTableBuilder.hh"
|
||||
|
||||
@@ -163,6 +164,7 @@ G4LossTableManager::G4LossTableManager()
|
||||
tableBuilder = new G4LossTableBuilder();
|
||||
emCorrections= new G4EmCorrections();
|
||||
emSaturation = new G4EmSaturation();
|
||||
emConfigurator = new G4EmConfigurator();
|
||||
integral = true;
|
||||
integralActive = false;
|
||||
buildCSDARange = false;
|
||||
@@ -173,6 +175,7 @@ G4LossTableManager::G4LossTableManager()
|
||||
flagLPM = true;
|
||||
splineFlag = true;
|
||||
bremsTh = DBL_MAX;
|
||||
factorForAngleLimit = 1.0;
|
||||
verbose = 1;
|
||||
tableBuilder->SetSplineFlag(splineFlag);
|
||||
}
|
||||
@@ -917,6 +920,20 @@ G4double G4LossTableManager::BremsstrahlungTh() const
|
||||
return bremsTh;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4LossTableManager::SetFactorForAngleLimit(G4double val)
|
||||
{
|
||||
if(val > 0.0) factorForAngleLimit = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4LossTableManager::FactorForAngleLimit() const
|
||||
{
|
||||
return factorForAngleLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4EmCorrections* G4LossTableManager::EmCorrections()
|
||||
@@ -931,4 +948,11 @@ G4EmSaturation* G4LossTableManager::EmSaturation()
|
||||
return emSaturation;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4EmConfigurator* G4LossTableManager::EmConfigurator()
|
||||
{
|
||||
return emConfigurator;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmFluctuationModel.cc,v 1.3 2008/07/15 16:56:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VEmFluctuationModel.cc,v 1.4 2009/02/19 11:25:50 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -64,4 +64,11 @@ G4VEmFluctuationModel::~G4VEmFluctuationModel()
|
||||
G4LossTableManager::Instance()->DeRegister(this);
|
||||
}
|
||||
|
||||
void G4VEmFluctuationModel::InitialiseMe(const G4ParticleDefinition*)
|
||||
{}
|
||||
|
||||
void G4VEmFluctuationModel::SetParticleAndCharge(const G4ParticleDefinition*,
|
||||
G4double)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmModel.cc,v 1.20 2008/11/13 23:13:18 schaelic Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VEmModel.cc,v 1.30 2009/09/23 14:42:47 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -40,6 +40,7 @@
|
||||
// Modifications:
|
||||
// 25.10.2005 Set default highLimit=100.TeV (V.Ivanchenko)
|
||||
// 06.02.2006 add method ComputeMeanFreePath() (mma)
|
||||
// 16.02.2009 Move implementations of virtual methods to source (VI)
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
@@ -52,14 +53,19 @@
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4ParticleChangeForLoss.hh"
|
||||
#include "G4ParticleChangeForGamma.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VEmModel::G4VEmModel(const G4String& nam):
|
||||
fluc(0), name(nam), lowLimit(0.1*keV), highLimit(100.0*TeV),
|
||||
eMinActive(0.0),eMaxActive(DBL_MAX),
|
||||
polarAngleLimit(0.0),secondaryThreshold(DBL_MAX),theLPMflag(false),
|
||||
pParticleChange(0),nuclearStopping(false),nsec(5)
|
||||
pParticleChange(0),nuclearStopping(false),
|
||||
currentCouple(0),currentElement(0),
|
||||
nsec(5),flagDeexcitation(false)
|
||||
{
|
||||
xsec.resize(nsec);
|
||||
nSelectors = 0;
|
||||
@@ -81,6 +87,88 @@ G4VEmModel::~G4VEmModel()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ParticleChangeForLoss* G4VEmModel::GetParticleChangeForLoss()
|
||||
{
|
||||
G4ParticleChangeForLoss* p = 0;
|
||||
if (pParticleChange) {
|
||||
p = static_cast<G4ParticleChangeForLoss*>(pParticleChange);
|
||||
} else {
|
||||
p = new G4ParticleChangeForLoss();
|
||||
pParticleChange = p;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ParticleChangeForGamma* G4VEmModel::GetParticleChangeForGamma()
|
||||
{
|
||||
G4ParticleChangeForGamma* p = 0;
|
||||
if (pParticleChange) {
|
||||
p = static_cast<G4ParticleChangeForGamma*>(pParticleChange);
|
||||
} else {
|
||||
p = new G4ParticleChangeForGamma();
|
||||
pParticleChange = p;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::InitialiseElementSelectors(const G4ParticleDefinition* p,
|
||||
const G4DataVector& cuts)
|
||||
{
|
||||
// initialise before run
|
||||
flagDeexcitation = false;
|
||||
|
||||
G4int nbins = G4int(std::log10(highLimit/lowLimit) + 0.5);
|
||||
if(nbins < 3) nbins = 3;
|
||||
G4bool spline = G4LossTableManager::Instance()->SplineFlag();
|
||||
|
||||
G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
G4int numOfCouples = theCoupleTable->GetTableSize();
|
||||
|
||||
// prepare vector
|
||||
if(numOfCouples > nSelectors) elmSelectors.reserve(numOfCouples);
|
||||
|
||||
// initialise vector
|
||||
for(G4int i=0; i<numOfCouples; i++) {
|
||||
currentCouple = theCoupleTable->GetMaterialCutsCouple(i);
|
||||
const G4Material* material = currentCouple->GetMaterial();
|
||||
G4int idx = currentCouple->GetIndex();
|
||||
|
||||
// selector already exist check if should be deleted
|
||||
G4bool create = true;
|
||||
if(i < nSelectors) {
|
||||
if(elmSelectors[i]) {
|
||||
if(material == elmSelectors[i]->GetMaterial()) create = false;
|
||||
else delete elmSelectors[i];
|
||||
}
|
||||
} else {
|
||||
nSelectors++;
|
||||
elmSelectors.push_back(0);
|
||||
}
|
||||
if(create) {
|
||||
elmSelectors[i] = new G4EmElementSelector(this,material,nbins,
|
||||
lowLimit,highLimit,spline);
|
||||
}
|
||||
elmSelectors[i]->Initialise(p, cuts[idx]);
|
||||
//elmSelectors[i]->Dump(p);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double,G4double)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::CrossSectionPerVolume(const G4Material* material,
|
||||
const G4ParticleDefinition* p,
|
||||
G4double ekin,
|
||||
@@ -106,59 +194,69 @@ G4double G4VEmModel::CrossSectionPerVolume(const G4Material* material,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::ComputeMeanFreePath(const G4ParticleDefinition* p,
|
||||
G4double ekin,
|
||||
const G4Material* material,
|
||||
G4double emin,
|
||||
G4double emax)
|
||||
G4double G4VEmModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
|
||||
G4double, G4double, G4double,
|
||||
G4double, G4double)
|
||||
{
|
||||
G4double mfp = DBL_MAX;
|
||||
G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax);
|
||||
if (cross > DBL_MIN) mfp = 1./cross;
|
||||
return mfp;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::InitialiseElementSelectors(const G4ParticleDefinition* p,
|
||||
const G4DataVector& cuts)
|
||||
void G4VEmModel::DefineForRegion(const G4Region*)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple*)
|
||||
{
|
||||
G4int nbins = G4int(std::log10(highLimit/lowLimit) + 0.5);
|
||||
if(nbins < 3) nbins = 3;
|
||||
G4bool spline = G4LossTableManager::Instance()->SplineFlag();
|
||||
|
||||
G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
G4int numOfCouples = theCoupleTable->GetTableSize();
|
||||
|
||||
// prepare vector
|
||||
if(numOfCouples > nSelectors) {
|
||||
elmSelectors.resize(numOfCouples);
|
||||
nSelectors = numOfCouples;
|
||||
}
|
||||
|
||||
// initialise vector
|
||||
for(G4int i=0; i<numOfCouples; i++) {
|
||||
const G4MaterialCutsCouple* couple =
|
||||
theCoupleTable->GetMaterialCutsCouple(i);
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
G4int idx = couple->GetIndex();
|
||||
|
||||
// selector already exist check if should be deleted
|
||||
G4bool create = true;
|
||||
if(elmSelectors[i]) {
|
||||
if(material == elmSelectors[i]->GetMaterial()) create = false;
|
||||
else delete elmSelectors[i];
|
||||
}
|
||||
if(create) {
|
||||
elmSelectors[i] = new G4EmElementSelector(this,material,nbins,
|
||||
lowLimit,highLimit,spline);
|
||||
}
|
||||
elmSelectors[i]->Initialise(p, cuts[idx]);
|
||||
//elmSelectors[i]->Dump(p);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
|
||||
const G4Material*, G4double)
|
||||
{
|
||||
G4double q = p->GetPDGCharge()/CLHEP::eplus;
|
||||
return q*q;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p,
|
||||
const G4Material*, G4double)
|
||||
{
|
||||
return p->GetPDGCharge();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double&,G4double&,G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::SampleDeexcitationAlongStep(const G4Material*,
|
||||
const G4Track&,
|
||||
G4double& )
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
|
||||
G4double kineticEnergy)
|
||||
{
|
||||
return kineticEnergy;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*,
|
||||
const G4Material*, G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmProcess.cc,v 1.60 2008/10/17 14:46:16 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VEmProcess.cc,v 1.79 2009/11/10 20:30:55 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -51,6 +51,7 @@
|
||||
// 12-09-06 add SetModel() (mma)
|
||||
// 12-04-07 remove double call to Clear model manager (V.Ivanchenko)
|
||||
// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
|
||||
// 24-06-09 Removed hidden bin in G4PhysicsVector (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -77,6 +78,7 @@
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4PhysicsTableHelper.hh"
|
||||
#include "G4EmConfigurator.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -90,8 +92,10 @@ G4VEmProcess::G4VEmProcess(const G4String& name, G4ProcessType type):
|
||||
integral(false),
|
||||
applyCuts(false),
|
||||
startFromNull(true),
|
||||
nRegions(0),
|
||||
selectedModel(0),
|
||||
useDeexcitation(false),
|
||||
nDERegions(0),
|
||||
idxDERegions(0),
|
||||
currentModel(0),
|
||||
particle(0),
|
||||
currentCouple(0)
|
||||
{
|
||||
@@ -99,8 +103,8 @@ G4VEmProcess::G4VEmProcess(const G4String& name, G4ProcessType type):
|
||||
|
||||
// Size of tables assuming spline
|
||||
minKinEnergy = 0.1*keV;
|
||||
maxKinEnergy = 100.0*TeV;
|
||||
nLambdaBins = 84;
|
||||
maxKinEnergy = 10.0*TeV;
|
||||
nLambdaBins = 77;
|
||||
|
||||
// default lambda factor
|
||||
lambdaFactor = 0.8;
|
||||
@@ -138,6 +142,66 @@ G4VEmProcess::~G4VEmProcess()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEmProcess::Clear()
|
||||
{
|
||||
delete [] theEnergyOfCrossSectionMax;
|
||||
delete [] theCrossSectionMax;
|
||||
delete [] idxDERegions;
|
||||
theEnergyOfCrossSectionMax = 0;
|
||||
theCrossSectionMax = 0;
|
||||
idxDERegions = 0;
|
||||
currentCouple = 0;
|
||||
preStepLambda = 0.0;
|
||||
mfpKinEnergy = DBL_MAX;
|
||||
deRegions.clear();
|
||||
nDERegions = 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEmProcess::AddEmModel(G4int order, G4VEmModel* p,
|
||||
const G4Region* region)
|
||||
{
|
||||
G4VEmFluctuationModel* fm = 0;
|
||||
modelManager->AddEmModel(order, p, fm, region);
|
||||
if(p) p->SetParticleChange(pParticleChange);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEmProcess::SetModel(G4VEmModel* p, G4int index)
|
||||
{
|
||||
G4int n = emModels.size();
|
||||
if(index >= n) { for(G4int i=n; i<=index; ++i) {emModels.push_back(0);} }
|
||||
emModels[index] = p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4VEmModel* G4VEmProcess::Model(G4int index)
|
||||
{
|
||||
G4VEmModel* p = 0;
|
||||
if(index >= 0 && index < G4int(emModels.size())) { p = emModels[index]; }
|
||||
return p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEmProcess::UpdateEmModel(const G4String& nam,
|
||||
G4double emin, G4double emax)
|
||||
{
|
||||
modelManager->UpdateEmModel(nam, emin, emax);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4VEmModel* G4VEmProcess::GetModelByIndex(G4int idx, G4bool ver)
|
||||
{
|
||||
return modelManager->GetModel(idx, ver);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
|
||||
{
|
||||
if(!particle) particle = ∂
|
||||
@@ -149,41 +213,75 @@ void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
(G4LossTableManager::Instance())->EmConfigurator()->AddModels();
|
||||
|
||||
if(particle == &part) {
|
||||
Clear();
|
||||
InitialiseProcess(particle);
|
||||
|
||||
// initialisation of models
|
||||
G4int nmod = modelManager->NumberOfModels();
|
||||
for(G4int i=0; i<nmod; ++i) {
|
||||
G4VEmModel* mod = modelManager->GetModel(i);
|
||||
mod->SetPolarAngleLimit(polarAngleLimit);
|
||||
if(mod->HighEnergyLimit() > maxKinEnergy) {
|
||||
mod->SetHighEnergyLimit(maxKinEnergy);
|
||||
}
|
||||
}
|
||||
|
||||
theCuts = modelManager->Initialise(particle,secondaryParticle,2.,verboseLevel);
|
||||
const G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
theCutsGamma = theCoupleTable->GetEnergyCutsVector(idxG4GammaCut);
|
||||
theCutsElectron = theCoupleTable->GetEnergyCutsVector(idxG4ElectronCut);
|
||||
theCutsPositron = theCoupleTable->GetEnergyCutsVector(idxG4PositronCut);
|
||||
if(buildLambdaTable)
|
||||
|
||||
// prepare tables
|
||||
if(buildLambdaTable){
|
||||
theLambdaTable = G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sub Cutoff and Deexcitation
|
||||
if (nDERegions>0) {
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
const G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
size_t numOfCouples = theCoupleTable->GetTableSize();
|
||||
|
||||
void G4VEmProcess::Clear()
|
||||
{
|
||||
if(theEnergyOfCrossSectionMax) delete [] theEnergyOfCrossSectionMax;
|
||||
if(theCrossSectionMax) delete [] theCrossSectionMax;
|
||||
theEnergyOfCrossSectionMax = 0;
|
||||
theCrossSectionMax = 0;
|
||||
currentCouple = 0;
|
||||
preStepLambda = 0.0;
|
||||
mfpKinEnergy = DBL_MAX;
|
||||
idxDERegions = new G4bool[numOfCouples];
|
||||
|
||||
for (size_t j=0; j<numOfCouples; ++j) {
|
||||
|
||||
const G4MaterialCutsCouple* couple =
|
||||
theCoupleTable->GetMaterialCutsCouple(j);
|
||||
const G4ProductionCuts* pcuts = couple->GetProductionCuts();
|
||||
G4bool reg = false;
|
||||
for(G4int i=0; i<nDERegions; ++i) {
|
||||
if(deRegions[i]) {
|
||||
if(pcuts == deRegions[i]->GetProductionCuts()) reg = true;
|
||||
}
|
||||
}
|
||||
idxDERegions[j] = reg;
|
||||
}
|
||||
}
|
||||
if (1 < verboseLevel && nDERegions>0) {
|
||||
G4cout << " Deexcitation is activated for regions: " << G4endl;
|
||||
for (G4int i=0; i<nDERegions; ++i) {
|
||||
const G4Region* r = deRegions[i];
|
||||
G4cout << " " << r->GetName() << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEmProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
|
||||
{
|
||||
G4String partname = part.GetParticleName();
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4VEmProcess::BuildPhysicsTable() for "
|
||||
<< GetProcessName()
|
||||
<< " and particle " << part.GetParticleName()
|
||||
<< " and particle " << partname
|
||||
<< " buildLambdaTable= " << buildLambdaTable
|
||||
<< G4endl;
|
||||
}
|
||||
@@ -192,12 +290,18 @@ void G4VEmProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
|
||||
BuildLambdaTable();
|
||||
FindLambdaMax();
|
||||
}
|
||||
if(0 < verboseLevel) PrintInfoDefinition();
|
||||
|
||||
// reduce printout for nuclear stopping
|
||||
G4bool gproc = true;
|
||||
if(GetProcessName() == "nuclearStopping" &&
|
||||
partname != "GenericIon" && partname != "alpha") { gproc = false; }
|
||||
|
||||
if(gproc && 0 < verboseLevel) { PrintInfoDefinition(); }
|
||||
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4VEmProcess::BuildPhysicsTable() done for "
|
||||
<< GetProcessName()
|
||||
<< " and particle " << part.GetParticleName()
|
||||
<< " and particle " << partname
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
@@ -217,14 +321,30 @@ void G4VEmProcess::BuildLambdaTable()
|
||||
const G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
size_t numOfCouples = theCoupleTable->GetTableSize();
|
||||
for(size_t i=0; i<numOfCouples; i++) {
|
||||
|
||||
G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag();
|
||||
|
||||
G4PhysicsLogVector* aVector = 0;
|
||||
G4PhysicsLogVector* bVector = 0;
|
||||
|
||||
for(size_t i=0; i<numOfCouples; ++i) {
|
||||
|
||||
if (theLambdaTable->GetFlag(i)) {
|
||||
|
||||
// create physics vector and fill it
|
||||
const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
|
||||
G4PhysicsVector* aVector = LambdaPhysicsVector(couple);
|
||||
const G4MaterialCutsCouple* couple =
|
||||
theCoupleTable->GetMaterialCutsCouple(i);
|
||||
if(!bVector) {
|
||||
aVector =
|
||||
static_cast<G4PhysicsLogVector*>(LambdaPhysicsVector(couple));
|
||||
bVector = aVector;
|
||||
} else {
|
||||
aVector = new G4PhysicsLogVector(*bVector);
|
||||
}
|
||||
// G4PhysicsVector* aVector = LambdaPhysicsVector(couple);
|
||||
aVector->SetSpline(splineFlag);
|
||||
modelManager->FillLambdaVector(aVector, couple, startFromNull);
|
||||
if(splineFlag) aVector->FillSecondDerivatives();
|
||||
G4PhysicsTableHelper::SetPhysicsVector(theLambdaTable, i, aVector);
|
||||
}
|
||||
}
|
||||
@@ -241,6 +361,35 @@ void G4VEmProcess::BuildLambdaTable()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEmProcess::PrintInfoDefinition()
|
||||
{
|
||||
if(verboseLevel > 0) {
|
||||
G4cout << G4endl << GetProcessName() << ": for "
|
||||
<< particle->GetParticleName();
|
||||
if(integral) G4cout << ", integral: 1 ";
|
||||
if(applyCuts) G4cout << ", applyCuts: 1 ";
|
||||
G4cout << " SubType= " << GetProcessSubType() << G4endl;
|
||||
if(buildLambdaTable) {
|
||||
G4cout << " Lambda tables from "
|
||||
<< G4BestUnit(minKinEnergy,"Energy")
|
||||
<< " to "
|
||||
<< G4BestUnit(maxKinEnergy,"Energy")
|
||||
<< " in " << nLambdaBins << " bins, spline: "
|
||||
<< (G4LossTableManager::Instance())->SplineFlag()
|
||||
<< G4endl;
|
||||
}
|
||||
PrintInfo();
|
||||
modelManager->DumpModelList(verboseLevel);
|
||||
}
|
||||
|
||||
if(verboseLevel > 2 && buildLambdaTable) {
|
||||
G4cout << " LambdaTable address= " << theLambdaTable << G4endl;
|
||||
if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4VEmProcess::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
@@ -251,6 +400,7 @@ G4double G4VEmProcess::PostStepGetPhysicalInteractionLength(
|
||||
G4double x = DBL_MAX;
|
||||
if(previousStepSize <= DBL_MIN) theNumberOfInteractionLengthLeft = -1.0;
|
||||
InitialiseStep(track);
|
||||
if(!currentModel->IsActive(preStepKinEnergy)) return x;
|
||||
|
||||
if(preStepKinEnergy < mfpKinEnergy) {
|
||||
if (integral) ComputeIntegralLambda(preStepKinEnergy);
|
||||
@@ -303,16 +453,6 @@ G4double G4VEmProcess::PostStepGetPhysicalInteractionLength(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,
|
||||
G4double,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
*condition = NotForced;
|
||||
return G4VEmProcess::MeanFreePath(track);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
|
||||
const G4Step&)
|
||||
{
|
||||
@@ -341,8 +481,11 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
|
||||
}
|
||||
}
|
||||
|
||||
G4VEmModel* currentModel = SelectModel(finalT);
|
||||
|
||||
SelectModel(finalT, currentCoupleIndex);
|
||||
if(!currentModel->IsActive(finalT)) return &fParticleChange;
|
||||
if(useDeexcitation) {
|
||||
currentModel->SetDeexcitationFlag(idxDERegions[currentCoupleIndex]);
|
||||
}
|
||||
/*
|
||||
if(0 < verboseLevel) {
|
||||
G4cout << "G4VEmProcess::PostStepDoIt: Sample secondary; E= "
|
||||
@@ -359,7 +502,7 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
|
||||
currentModel->SampleSecondaries(&secParticles,
|
||||
currentCouple,
|
||||
track.GetDynamicParticle(),
|
||||
(*theCuts)[currentMaterialIndex]);
|
||||
(*theCuts)[currentCoupleIndex]);
|
||||
|
||||
// save secondaries
|
||||
G4int num = secParticles.size();
|
||||
@@ -368,21 +511,21 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
|
||||
fParticleChange.SetNumberOfSecondaries(num);
|
||||
G4double edep = fParticleChange.GetLocalEnergyDeposit();
|
||||
|
||||
for (G4int i=0; i<num; i++) {
|
||||
for (G4int i=0; i<num; ++i) {
|
||||
G4DynamicParticle* dp = secParticles[i];
|
||||
const G4ParticleDefinition* p = dp->GetDefinition();
|
||||
G4double e = dp->GetKineticEnergy();
|
||||
G4bool good = true;
|
||||
if(applyCuts) {
|
||||
if (p == theGamma) {
|
||||
if (e < (*theCutsGamma)[currentMaterialIndex]) good = false;
|
||||
if (e < (*theCutsGamma)[currentCoupleIndex]) good = false;
|
||||
|
||||
} else if (p == theElectron) {
|
||||
if (e < (*theCutsElectron)[currentMaterialIndex]) good = false;
|
||||
if (e < (*theCutsElectron)[currentCoupleIndex]) good = false;
|
||||
|
||||
} else if (p == thePositron) {
|
||||
if (electron_mass_c2 < (*theCutsGamma)[currentMaterialIndex] &&
|
||||
e < (*theCutsPositron)[currentMaterialIndex]) {
|
||||
if (electron_mass_c2 < (*theCutsGamma)[currentCoupleIndex] &&
|
||||
e < (*theCutsPositron)[currentCoupleIndex]) {
|
||||
good = false;
|
||||
e += 2.0*electron_mass_c2;
|
||||
}
|
||||
@@ -403,56 +546,6 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEmProcess::PrintInfoDefinition()
|
||||
{
|
||||
if(verboseLevel > 0) {
|
||||
G4cout << G4endl << GetProcessName() << ": for "
|
||||
<< particle->GetParticleName();
|
||||
if(integral) G4cout << ", integral: 1 ";
|
||||
if(applyCuts) G4cout << ", applyCuts: 1 ";
|
||||
G4cout << " SubType= " << GetProcessSubType() << G4endl;
|
||||
if(buildLambdaTable) {
|
||||
G4cout << " Lambda tables from "
|
||||
<< G4BestUnit(minKinEnergy,"Energy")
|
||||
<< " to "
|
||||
<< G4BestUnit(maxKinEnergy,"Energy")
|
||||
<< " in " << nLambdaBins << " bins, spline: "
|
||||
<< (G4LossTableManager::Instance())->SplineFlag()
|
||||
<< G4endl;
|
||||
}
|
||||
PrintInfo();
|
||||
modelManager->DumpModelList(verboseLevel);
|
||||
}
|
||||
|
||||
if(verboseLevel > 2 && buildLambdaTable) {
|
||||
G4cout << " LambdaTable address= " << theLambdaTable << G4endl;
|
||||
if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
// Cross section per atom is calculated
|
||||
DefineMaterial(couple);
|
||||
G4double cross = 0.0;
|
||||
G4bool b;
|
||||
if(theLambdaTable) {
|
||||
cross = (((*theLambdaTable)[currentMaterialIndex])->
|
||||
GetValue(kineticEnergy, b));
|
||||
} else {
|
||||
G4VEmModel* model = SelectModel(kineticEnergy);
|
||||
cross =
|
||||
model->CrossSectionPerVolume(currentMaterial,particle,kineticEnergy);
|
||||
}
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4bool G4VEmProcess::StorePhysicsTable(const G4ParticleDefinition* part,
|
||||
const G4String& directory,
|
||||
G4bool ascii)
|
||||
@@ -484,7 +577,7 @@ G4bool G4VEmProcess::StorePhysicsTable(const G4ParticleDefinition* part,
|
||||
|
||||
G4bool G4VEmProcess::RetrievePhysicsTable(const G4ParticleDefinition* part,
|
||||
const G4String& directory,
|
||||
G4bool ascii)
|
||||
G4bool ascii)
|
||||
{
|
||||
if(1 < verboseLevel) {
|
||||
G4cout << "G4VEmProcess::RetrievePhysicsTable() for "
|
||||
@@ -503,13 +596,18 @@ G4bool G4VEmProcess::RetrievePhysicsTable(const G4ParticleDefinition* part,
|
||||
filename,ascii);
|
||||
if ( yes ) {
|
||||
if (0 < verboseLevel) {
|
||||
G4cout << "Lambda table for " << particleName << " is Retrieved from <"
|
||||
G4cout << "Lambda table for " << particleName
|
||||
<< " is Retrieved from <"
|
||||
<< filename << ">"
|
||||
<< G4endl;
|
||||
}
|
||||
if((G4LossTableManager::Instance())->SplineFlag()) {
|
||||
size_t n = theLambdaTable->length();
|
||||
for(size_t i=0; i<n; i++) {(* theLambdaTable)[i]->SetSpline(true);}
|
||||
for(size_t i=0; i<n; ++i) {
|
||||
if((* theLambdaTable)[i]) {
|
||||
(* theLambdaTable)[i]->SetSpline(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (1 < verboseLevel) {
|
||||
@@ -524,6 +622,63 @@ G4bool G4VEmProcess::RetrievePhysicsTable(const G4ParticleDefinition* part,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEmProcess::ActivateDeexcitation(G4bool val, const G4Region* r)
|
||||
{
|
||||
G4RegionStore* regionStore = G4RegionStore::GetInstance();
|
||||
const G4Region* reg = r;
|
||||
if (!reg) {reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);}
|
||||
|
||||
// the region is in the list
|
||||
if (nDERegions) {
|
||||
for (G4int i=0; i<nDERegions; ++i) {
|
||||
if (reg == deRegions[i]) {
|
||||
if(!val) deRegions[i] = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// new region
|
||||
if(val) {
|
||||
useDeexcitation = true;
|
||||
deRegions.push_back(reg);
|
||||
nDERegions++;
|
||||
} else {
|
||||
useDeexcitation = false;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
// Cross section per atom is calculated
|
||||
DefineMaterial(couple);
|
||||
G4double cross = 0.0;
|
||||
if(theLambdaTable) {
|
||||
cross = (((*theLambdaTable)[currentCoupleIndex])->Value(kineticEnergy));
|
||||
} else {
|
||||
SelectModel(kineticEnergy, currentCoupleIndex);
|
||||
cross = currentModel->CrossSectionPerVolume(currentMaterial,
|
||||
particle,kineticEnergy);
|
||||
}
|
||||
|
||||
return cross;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,
|
||||
G4double,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
*condition = NotForced;
|
||||
return G4VEmProcess::MeanFreePath(track);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VEmProcess::FindLambdaMax()
|
||||
{
|
||||
if(1 < verboseLevel) {
|
||||
@@ -536,22 +691,23 @@ void G4VEmProcess::FindLambdaMax()
|
||||
G4double e, s, emax, smax;
|
||||
theEnergyOfCrossSectionMax = new G4double [n];
|
||||
theCrossSectionMax = new G4double [n];
|
||||
G4bool b;
|
||||
|
||||
for (size_t i=0; i<n; i++) {
|
||||
for (size_t i=0; i<n; ++i) {
|
||||
pv = (*theLambdaTable)[i];
|
||||
emax = DBL_MAX;
|
||||
smax = 0.0;
|
||||
if(pv) {
|
||||
size_t nb = pv->GetVectorLength();
|
||||
emax = pv->GetLowEdgeEnergy(nb);
|
||||
emax = DBL_MAX;
|
||||
smax = 0.0;
|
||||
for (size_t j=0; j<nb; j++) {
|
||||
e = pv->GetLowEdgeEnergy(j);
|
||||
s = pv->GetValue(e,b);
|
||||
if(s > smax) {
|
||||
smax = s;
|
||||
emax = e;
|
||||
if(nb > 0) {
|
||||
for (size_t j=0; j<nb; ++j) {
|
||||
e = pv->Energy(j);
|
||||
s = (*pv)(j);
|
||||
if(s > smax) {
|
||||
smax = s;
|
||||
emax = e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VMscModel.cc,v 1.4 2008/03/10 18:39:45 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VMscModel.cc,v 1.13 2009/07/20 17:32:47 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -48,18 +48,22 @@
|
||||
//
|
||||
|
||||
#include "G4VMscModel.hh"
|
||||
#include "G4ParticleChangeForMSC.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VMscModel::G4VMscModel(const G4String& nam):
|
||||
G4VEmModel(nam),
|
||||
facrange(0.02),
|
||||
safetyHelper(0),
|
||||
facrange(0.04),
|
||||
facgeom(2.5),
|
||||
facsafety(0.25),
|
||||
facsafety(0.3),
|
||||
skin(3.0),
|
||||
dtrl(0.05),
|
||||
lambdalimit(mm),
|
||||
geommax(1.e50*mm),
|
||||
steppingAlgorithm(fUseSafety),
|
||||
samplez(false),
|
||||
latDisplasment(true)
|
||||
@@ -71,3 +75,103 @@ G4VMscModel::~G4VMscModel()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ParticleChangeForMSC* G4VMscModel::GetParticleChangeForMSC()
|
||||
{
|
||||
G4ParticleChangeForMSC* p = 0;
|
||||
if (pParticleChange) {
|
||||
p = static_cast<G4ParticleChangeForMSC*>(pParticleChange);
|
||||
} else {
|
||||
p = new G4ParticleChangeForMSC();
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VMscModel::InitialiseSafetyHelper()
|
||||
{
|
||||
if(!safetyHelper) {
|
||||
safetyHelper = G4TransportationManager::GetTransportationManager()
|
||||
->GetSafetyHelper();
|
||||
safetyHelper->InitialiseHelper();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VMscModel::ComputeDisplacement(G4ParticleChangeForMSC* fParticleChange,
|
||||
const G4ThreeVector& dir,
|
||||
G4double displacement,
|
||||
G4double postsafety)
|
||||
{
|
||||
const G4ThreeVector* pos = fParticleChange->GetProposedPosition();
|
||||
G4double r = displacement;
|
||||
if(r > postsafety) {
|
||||
G4double newsafety = safetyHelper->ComputeSafety(*pos);
|
||||
if(r > newsafety) r = newsafety;
|
||||
}
|
||||
if(r > 0.) {
|
||||
|
||||
// compute new endpoint of the Step
|
||||
G4ThreeVector newPosition = *pos + r*dir;
|
||||
|
||||
// definitely not on boundary
|
||||
if(displacement == r) {
|
||||
safetyHelper->ReLocateWithinVolume(newPosition);
|
||||
|
||||
} else {
|
||||
// check safety after displacement
|
||||
G4double postsafety = safetyHelper->ComputeSafety(newPosition);
|
||||
|
||||
// displacement to boundary
|
||||
if(postsafety <= 0.0) {
|
||||
safetyHelper->Locate(newPosition,
|
||||
*fParticleChange->GetProposedMomentumDirection());
|
||||
|
||||
// not on the boundary
|
||||
} else {
|
||||
safetyHelper->ReLocateWithinVolume(newPosition);
|
||||
}
|
||||
}
|
||||
fParticleChange->ProposePosition(newPosition);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VMscModel::SampleScattering(const G4DynamicParticle*, G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VMscModel::ComputeTruePathLengthLimit(const G4Track&,
|
||||
G4PhysicsTable*,
|
||||
G4double)
|
||||
{
|
||||
return DBL_MAX;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VMscModel::ComputeGeomPathLength(G4double truePathLength)
|
||||
{
|
||||
return truePathLength;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VMscModel::ComputeTrueStepLength(G4double geomPathLength)
|
||||
{
|
||||
return geomPathLength;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VMscModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
||||
const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double, G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VMultipleScattering.cc,v 1.60 2008/11/20 20:32:40 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VMultipleScattering.cc,v 1.77 2009/10/29 18:07:08 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -55,6 +55,7 @@
|
||||
// 12-04-07 Add verbosity at destruction (V.Ivanchenko)
|
||||
// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
|
||||
// 11-03-08 Set skin value does not effect step limit type (V.Ivanchenko)
|
||||
// 24-06-09 Removed hidden bin in G4PhysicsVector (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -82,6 +83,7 @@
|
||||
#include "G4PhysicsTableHelper.hh"
|
||||
#include "G4GenericIon.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4EmConfigurator.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -93,9 +95,10 @@ G4VMultipleScattering::G4VMultipleScattering(const G4String& name,
|
||||
firstParticle(0),
|
||||
stepLimit(fUseSafety),
|
||||
skin(3.0),
|
||||
facrange(0.02),
|
||||
facrange(0.04),
|
||||
facgeom(2.5),
|
||||
latDisplasment(true),
|
||||
isIon(false),
|
||||
currentParticle(0),
|
||||
currentCouple(0)
|
||||
{
|
||||
@@ -104,8 +107,8 @@ G4VMultipleScattering::G4VMultipleScattering(const G4String& name,
|
||||
|
||||
// Size of tables assuming spline
|
||||
minKinEnergy = 0.1*keV;
|
||||
maxKinEnergy = 100.0*TeV;
|
||||
nBins = 84;
|
||||
maxKinEnergy = 10.0*TeV;
|
||||
nBins = 77;
|
||||
|
||||
// default limit on polar angle
|
||||
polarAngleLimit = 0.0;
|
||||
@@ -135,6 +138,41 @@ G4VMultipleScattering::~G4VMultipleScattering()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VMultipleScattering::AddEmModel(G4int order, G4VEmModel* p,
|
||||
const G4Region* region)
|
||||
{
|
||||
G4VEmFluctuationModel* fm = 0;
|
||||
modelManager->AddEmModel(order, p, fm, region);
|
||||
if(p) p->SetParticleChange(pParticleChange);
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VMultipleScattering::SetModel(G4VMscModel* p, G4int index)
|
||||
{
|
||||
G4int n = mscModels.size();
|
||||
if(index >= n) { for(G4int i=n; i<=index; ++i) {mscModels.push_back(0);} }
|
||||
mscModels[index] = p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4VMscModel* G4VMultipleScattering::Model(G4int index)
|
||||
{
|
||||
G4VMscModel* p = 0;
|
||||
if(index >= 0 && index < G4int(mscModels.size())) { p = mscModels[index]; }
|
||||
return p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4VEmModel*
|
||||
G4VMultipleScattering::GetModelByIndex(G4int idx, G4bool ver) const
|
||||
{
|
||||
return modelManager->GetModel(idx, ver);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4VMultipleScattering::BuildPhysicsTable(const G4ParticleDefinition& part)
|
||||
{
|
||||
G4String num = part.GetParticleName();
|
||||
@@ -151,14 +189,27 @@ void G4VMultipleScattering::BuildPhysicsTable(const G4ParticleDefinition& part)
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
size_t numOfCouples = theCoupleTable->GetTableSize();
|
||||
|
||||
for (size_t i=0; i<numOfCouples; i++) {
|
||||
G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag();
|
||||
|
||||
G4PhysicsLogVector* aVector = 0;
|
||||
G4PhysicsLogVector* bVector = 0;
|
||||
|
||||
for (size_t i=0; i<numOfCouples; ++i) {
|
||||
|
||||
if (theLambdaTable->GetFlag(i)) {
|
||||
// create physics vector and fill it
|
||||
const G4MaterialCutsCouple* couple =
|
||||
theCoupleTable->GetMaterialCutsCouple(i);
|
||||
G4PhysicsVector* aVector = PhysicsVector(couple);
|
||||
if(!bVector) {
|
||||
aVector = static_cast<G4PhysicsLogVector*>(PhysicsVector(couple));
|
||||
bVector = aVector;
|
||||
} else {
|
||||
aVector = new G4PhysicsLogVector(*bVector);
|
||||
}
|
||||
//G4PhysicsVector* aVector = PhysicsVector(couple);
|
||||
aVector->SetSpline(splineFlag);
|
||||
modelManager->FillLambdaVector(aVector, couple, false);
|
||||
if(splineFlag) aVector->FillSecondDerivatives();
|
||||
G4PhysicsTableHelper::SetPhysicsVector(theLambdaTable, i, aVector);
|
||||
}
|
||||
}
|
||||
@@ -193,10 +244,18 @@ void G4VMultipleScattering::PreparePhysicsTable(const G4ParticleDefinition& part
|
||||
if(part.GetParticleType() == "nucleus" &&
|
||||
part.GetParticleSubType() == "generic") {
|
||||
firstParticle = G4GenericIon::GenericIon();
|
||||
isIon = true;
|
||||
} else {
|
||||
firstParticle = ∂
|
||||
if(part.GetParticleType() == "nucleus" ||
|
||||
part.GetPDGMass() > GeV) {isIon = true;}
|
||||
}
|
||||
|
||||
// limitations for ions
|
||||
if(isIon) {
|
||||
SetStepLimitType(fMinimal);
|
||||
SetLateralDisplasmentFlag(false);
|
||||
SetBuildLambdaTable(false);
|
||||
}
|
||||
currentParticle = ∂
|
||||
}
|
||||
|
||||
@@ -208,18 +267,40 @@ void G4VMultipleScattering::PreparePhysicsTable(const G4ParticleDefinition& part
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
(G4LossTableManager::Instance())->EmConfigurator()->AddModels();
|
||||
|
||||
if(firstParticle == &part) {
|
||||
|
||||
InitialiseProcess(firstParticle);
|
||||
if(buildLambdaTable)
|
||||
|
||||
// initialisation of models
|
||||
G4int nmod = modelManager->NumberOfModels();
|
||||
for(G4int i=0; i<nmod; ++i) {
|
||||
G4VMscModel* msc = static_cast<G4VMscModel*>(modelManager->GetModel(i));
|
||||
if(isIon) {
|
||||
msc->SetStepLimitType(fMinimal);
|
||||
msc->SetLateralDisplasmentFlag(false);
|
||||
msc->SetRangeFactor(0.2);
|
||||
} else {
|
||||
msc->SetStepLimitType(StepLimitType());
|
||||
msc->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
|
||||
msc->SetSkin(Skin());
|
||||
msc->SetRangeFactor(RangeFactor());
|
||||
msc->SetGeomFactor(GeomFactor());
|
||||
}
|
||||
msc->SetPolarAngleLimit(polarAngleLimit);
|
||||
if(msc->HighEnergyLimit() > maxKinEnergy) {
|
||||
msc->SetHighEnergyLimit(maxKinEnergy);
|
||||
}
|
||||
}
|
||||
|
||||
modelManager->Initialise(firstParticle, G4Electron::Electron(),
|
||||
10.0, verboseLevel);
|
||||
|
||||
// prepare tables
|
||||
if(buildLambdaTable) {
|
||||
theLambdaTable = G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTable);
|
||||
const G4DataVector* theCuts =
|
||||
modelManager->Initialise(firstParticle,
|
||||
G4Electron::Electron(),
|
||||
10.0, verboseLevel);
|
||||
|
||||
if(2 < verboseLevel) G4cout << theCuts << G4endl;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,28 +337,26 @@ G4double G4VMultipleScattering::AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double,
|
||||
G4double currentMinimalStep,
|
||||
G4double& currentSafety,
|
||||
G4double&,
|
||||
G4GPILSelection* selection)
|
||||
{
|
||||
// get Step limit proposed by the process
|
||||
valueGPILSelectionMSC = NotCandidateForSelection;
|
||||
G4double steplength = GetMscContinuousStepLimit(track,
|
||||
track.GetKineticEnergy(),
|
||||
currentMinimalStep,
|
||||
currentSafety);
|
||||
// G4cout << "StepLimit= " << steplength << G4endl;
|
||||
// set return value for G4GPILSelection
|
||||
*selection = valueGPILSelectionMSC;
|
||||
return steplength;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4VMultipleScattering::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track&, G4double, G4ForceCondition* condition)
|
||||
{
|
||||
*condition = Forced;
|
||||
return DBL_MAX;
|
||||
*selection = NotCandidateForSelection;
|
||||
G4double x = currentMinimalStep;
|
||||
DefineMaterial(track.GetMaterialCutsCouple());
|
||||
G4double ekin = track.GetKineticEnergy();
|
||||
if(isIon) { ekin *= proton_mass_c2/track.GetDefinition()->GetPDGMass(); }
|
||||
currentModel = static_cast<G4VMscModel*>(SelectModel(ekin));
|
||||
if(x > 0.0 && ekin > 0.0 && currentModel->IsActive(ekin)) {
|
||||
G4double tPathLength =
|
||||
currentModel->ComputeTruePathLengthLimit(track, theLambdaTable, x);
|
||||
if (tPathLength < x) *selection = CandidateForSelection;
|
||||
x = currentModel->ComputeGeomPathLength(tPathLength);
|
||||
// G4cout << "tPathLength= " << tPathLength
|
||||
// << " stepLimit= " << x
|
||||
// << " currentMinimalStep= " << currentMinimalStep<< G4endl;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -288,8 +367,9 @@ G4double G4VMultipleScattering::GetContinuousStepLimit(
|
||||
G4double currentMinimalStep,
|
||||
G4double& currentSafety)
|
||||
{
|
||||
return GetMscContinuousStepLimit(track,previousStepSize,currentMinimalStep,
|
||||
currentSafety);
|
||||
G4GPILSelection* selection = 0;
|
||||
return AlongStepGetPhysicalInteractionLength(track,previousStepSize,currentMinimalStep,
|
||||
currentSafety, selection);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -303,27 +383,6 @@ G4double G4VMultipleScattering::GetMeanFreePath(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4VParticleChange* G4VMultipleScattering::AlongStepDoIt(const G4Track&,
|
||||
const G4Step& step)
|
||||
{
|
||||
fParticleChange.ProposeTrueStepLength(
|
||||
currentModel->ComputeTrueStepLength(step.GetStepLength()));
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4VParticleChange* G4VMultipleScattering::PostStepDoIt(const G4Track& track,
|
||||
const G4Step& step)
|
||||
{
|
||||
fParticleChange.Initialize(track);
|
||||
currentModel->SampleScattering(track.GetDynamicParticle(),
|
||||
step.GetPostStepPoint()->GetSafety());
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4PhysicsVector* G4VMultipleScattering::PhysicsVector(const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
G4int nbins = 3;
|
||||
@@ -363,12 +422,12 @@ G4bool G4VMultipleScattering::StorePhysicsTable(const G4ParticleDefinition* part
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4VMultipleScattering::RetrievePhysicsTable(const G4ParticleDefinition* part,
|
||||
const G4String& directory,
|
||||
G4bool ascii)
|
||||
G4bool
|
||||
G4VMultipleScattering::RetrievePhysicsTable(const G4ParticleDefinition* part,
|
||||
const G4String& directory,
|
||||
G4bool ascii)
|
||||
{
|
||||
if(0 < verboseLevel) {
|
||||
// G4cout << "========================================================" << G4endl;
|
||||
G4cout << "G4VMultipleScattering::RetrievePhysicsTable() for "
|
||||
<< part->GetParticleName() << " and process "
|
||||
<< GetProcessName() << G4endl;
|
||||
@@ -380,20 +439,27 @@ G4bool G4VMultipleScattering::RetrievePhysicsTable(const G4ParticleDefinition* p
|
||||
const G4String particleName = part->GetParticleName();
|
||||
|
||||
G4String filename = GetPhysicsTableFileName(part,directory,"Lambda",ascii);
|
||||
yes = G4PhysicsTableHelper::RetrievePhysicsTable(theLambdaTable,filename,ascii);
|
||||
yes =
|
||||
G4PhysicsTableHelper::RetrievePhysicsTable(theLambdaTable,filename,ascii);
|
||||
if ( yes ) {
|
||||
if (0 < verboseLevel) {
|
||||
G4cout << "Lambda table for " << part->GetParticleName() << " is retrieved from <"
|
||||
G4cout << "Lambda table for " << part->GetParticleName()
|
||||
<< " is retrieved from <"
|
||||
<< filename << ">"
|
||||
<< G4endl;
|
||||
}
|
||||
if((G4LossTableManager::Instance())->SplineFlag()) {
|
||||
size_t n = theLambdaTable->length();
|
||||
for(size_t i=0; i<n; i++) {(* theLambdaTable)[i]->SetSpline(true);}
|
||||
for(size_t i=0; i<n; ++i) {
|
||||
if((* theLambdaTable)[i]) {
|
||||
(* theLambdaTable)[i]->SetSpline(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (1 < verboseLevel) {
|
||||
G4cout << "Lambda table for " << part->GetParticleName() << " in file <"
|
||||
G4cout << "Lambda table for " << part->GetParticleName()
|
||||
<< " in file <"
|
||||
<< filename << "> is not exist"
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ionEffectiveCharge.cc,v 1.24 2008/12/18 13:01:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4ionEffectiveCharge.cc,v 1.25 2009/10/29 16:57:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -104,10 +104,13 @@ G4double G4ionEffectiveCharge::EffectiveCharge(const G4ParticleDefinition* p,
|
||||
// Vol.1, Pergamon Press, 1985
|
||||
// Fast ions or hadrons
|
||||
G4double reducedEnergy = kineticEnergy * proton_mass_c2/mass ;
|
||||
|
||||
//G4cout << "e= " << reducedEnergy << " Zi= " << Zi << " " << material->GetName() << G4endl;
|
||||
|
||||
if( reducedEnergy > Zi*energyHighLimit || Zi < 1.5 || !material) return charge;
|
||||
|
||||
G4double z = material->GetIonisation()->GetZeffective();
|
||||
// reducedEnergy = std::max(reducedEnergy,energyLowLimit);
|
||||
reducedEnergy = std::max(reducedEnergy,energyLowLimit);
|
||||
|
||||
// Helium ion case
|
||||
if( Zi < 2.5 ) {
|
||||
|
||||
Reference in New Issue
Block a user