Import Geant4 8.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:44:26 +02:00
parent 8a51e0bc40
commit 216a75eeb1
8717 changed files with 360418 additions and 141343 deletions
@@ -0,0 +1,80 @@
//
// ********************************************************************
// * 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: G4DummyModel.hh,v 1.2 2006/06/29 19:54:19 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4DummyModel
//
// Author: Vladimir Ivanchenko
//
// Creation date: 07.03.2006
//
// Modifications:
//
// Class Description:
//
// EM model doing nothing
// -------------------------------------------------------------------
//
#ifndef G4DummyModel_h
#define G4DummyModel_h 1
#include "globals.hh"
#include "G4VEmModel.hh"
class G4DummyModel : public G4VEmModel
{
public:
G4DummyModel(const G4String& nam = "DummyModel");
virtual ~G4DummyModel();
void Initialise(const G4ParticleDefinition*, const G4DataVector&);
std::vector<G4DynamicParticle*>* SampleSecondaries(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double tmax);
private:
// hide assignment operator
G4DummyModel & operator=(const G4DummyModel &right);
G4DummyModel(const G4DummyModel&);
};
#endif
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4EmCalculator.hh,v 1.9 2005/02/26 22:01:20 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4EmCalculator.hh,v 1.16 2006/06/29 19:54:21 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// -------------------------------------------------------------------
@@ -37,7 +40,9 @@
//
// Modifications:
// 17.11.2004 Change signature of methods, add new methods (V.Ivanchenko)
//
// 11.01.2006 Add GetCSDARange (V.Ivanchenko)
// 26.01.2006 Rename GetRange -> GetRangeFromRestricteDEDX (V.Ivanchenko)
// 22.03.2006 Add ComputeElectronicDEDX and ComputeTotalDEDX (V.Ivanchenko)
//
// Class Description:
//
@@ -82,10 +87,26 @@ public:
G4double GetDEDX(G4double kinEnergy, const G4String& part, const G4String& mat,
const G4String& s = "world");
G4double GetRange(G4double kinEnergy, const G4ParticleDefinition*, const G4Material*,
const G4Region* r = 0);
G4double GetRange(G4double kinEnergy, const G4String& part, const G4String& mat,
const G4String& s = "world");
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4ParticleDefinition*,
const G4Material*,
const G4Region* r = 0);
G4double GetRangeFromRestricteDEDX(G4double kinEnergy, const G4String& part,
const G4String& mat,
const G4String& s = "world");
G4double GetCSDARange(G4double kinEnergy, const G4ParticleDefinition*,
const G4Material*,
const G4Region* r = 0);
G4double GetCSDARange(G4double kinEnergy, const G4String& part,
const G4String& mat,
const G4String& s = "world");
G4double GetRange(G4double kinEnergy, const G4ParticleDefinition*,
const G4Material*,
const G4Region* r = 0);
G4double GetRange(G4double kinEnergy, const G4String& part,
const G4String& mat,
const G4String& s = "world");
G4double GetKinEnergy(G4double range, const G4ParticleDefinition*, const G4Material*,
const G4Region* r = 0);
@@ -99,13 +120,6 @@ public:
G4double GetCrossSectionPerVolume(
G4double kinEnergy, const G4String& part, const G4String& proc,
const G4String& mat, const G4String& s = "world");
G4double GetCrossSectionPerAtom(
G4double kinEnergy, const G4ParticleDefinition*,
const G4String& processName, const G4Material*,
const G4Region* r = 0);
G4double GetCrossSectionPerAtom(
G4double kinEnergy, const G4String& part, const G4String& proc,
const G4String& mat, const G4String& s = "world");
G4double GetMeanFreePath(G4double kinEnergy, const G4ParticleDefinition*,
const G4String& processName, const G4Material*,
@@ -128,9 +142,19 @@ public:
G4double ComputeDEDX(G4double kinEnergy, const G4String& part, const G4String& proc,
const G4String& mat, G4double cut = DBL_MAX);
G4double ComputeElectronicDEDX(G4double kinEnergy, const G4ParticleDefinition*,
const G4Material* mat, G4double cut = DBL_MAX);
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 ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition*,
const G4Material*, G4double cut = DBL_MAX);
G4double ComputeTotalDEDX(G4double kinEnergy, const G4String& part,
const G4String& mat, G4double cut = DBL_MAX);
G4double ComputeCrossSectionPerVolume(
G4double kinEnergy, const G4ParticleDefinition*,
const G4String& processName, const G4Material*,
@@ -178,7 +202,7 @@ private:
const G4String& processName,
G4double kinEnergy);
const G4VEnergyLossProcess* FindEnergyLossProcess(const G4ParticleDefinition*);
G4VEnergyLossProcess* FindEnergyLossProcess(const G4ParticleDefinition*);
G4EmCalculator & operator=(const G4EmCalculator &right);
G4EmCalculator(const G4EmCalculator&);
@@ -201,18 +225,22 @@ private:
const G4ParticleDefinition* baseParticle;
const G4PhysicsTable* currentLambda;
G4VEmModel* currentModel;
G4VEnergyLossProcess* currentProcess;
const G4ParticleDefinition* theGenericIon;
G4ionEffectiveCharge* ionEffCharge;
G4String currentName;
G4double currentCut;
G4double chargeSquare;
G4double massRatio;
G4double mass;
G4bool isIon;
G4bool isApplicable;
G4String currentParticleName;
G4String currentMaterialName;
G4String currentProcessName;
};
//....oooOO0OOooo.......oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4EmCorrections.hh,v 1.3 2005/02/26 22:01:20 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4EmCorrections.hh,v 1.8 2006/06/29 19:54:23 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//
@@ -35,11 +38,12 @@
// Creation date: 13.01.2005
//
// Modifications:
//
// 28.04.2006 General cleanup, add finite size corrections (V.Ivanchenko)
// 13.05.2006 Add corrections for ion stopping (V.Ivanhcenko)
//
// Class Description:
//
// This class provides calculation of EM corrections to ionisation
// This class provides calculation of EM corrections to ionisation
//
// -------------------------------------------------------------------
@@ -51,11 +55,14 @@
#include "globals.hh"
#include "G4AtomicShells.hh"
#include "G4ionEffectiveCharge.hh"
#include "G4Material.hh"
#include "G4ParticleDefinition.hh"
class G4Material;
class G4ParticleDefinition;
class G4NistManager;
class G4VEmModel;
class G4PhysicsVector;
class G4EmCorrections
class G4EmCorrections
{
public:
@@ -70,66 +77,87 @@ public:
G4double Bethe(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double kineticEnergy);
G4double SpinCorrection(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double kineticEnergy);
G4double KShellCorrection(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double kineticEnergy);
G4double LShellCorrection(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double kineticEnergy);
G4double ShellCorrection(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double kineticEnergy);
G4double ShellCorrectionSTD(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double kineticEnergy);
G4double DensityCorrection(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double kineticEnergy);
G4double BarkasCorrection(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double kineticEnergy);
G4double BlochCorrection(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double kineticEnergy);
G4double MottCorrection(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double kineticEnergy);
G4double FiniteSizeCorrection(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double NuclearDEDX(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy,
G4bool fluct = true);
G4double kineticEnergy,
G4bool fluct = true);
void AddStoppingData(G4int Z, G4int A, const G4String& materialName,
G4PhysicsVector& dVector);
G4double EffectiveChargeCorrection(const G4ParticleDefinition*,
const G4Material*,
G4double);
G4ionEffectiveCharge* GetIonEffectiveCharge(G4VEmModel* m = 0);
G4int GetNumberOfStoppingVectors();
private:
void Initialise();
G4double KShell(G4double theta, G4double eta);
G4PhysicsVector* InitialiseMaterial(const G4Material* mat);
G4double LShell(G4double theta, G4double eta);
void SetupKinematics(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4int Index(G4double x, G4double* y, G4int n);
G4double KShell(G4double theta, G4double eta);
G4double Value(G4double xv, G4double x1, G4double x2, G4double y1, G4double y2);
G4double LShell(G4double theta, G4double eta);
G4int Index(G4double x, G4double* y, G4int n);
G4double Value(G4double xv, G4double x1, G4double x2, G4double y1, G4double y2);
G4double Value2(G4double xv, G4double yv, G4double x1, G4double x2,
G4double y1, G4double y2,
G4double z11, G4double z21, G4double z12, G4double z22);
G4double z11, G4double z21, G4double z12, G4double z22);
G4double NuclearStoppingPower(G4double e, G4double z1, G4double z2,
G4double NuclearStoppingPower(G4double e, G4double z1, G4double z2,
G4double m1, G4double m2);
// hide assignment operator
@@ -138,12 +166,14 @@ private:
G4double engBarkas[47];
G4double corBarkas[47];
G4double e[104];
G4double ed[104];
G4double a[104];
G4double theZieglerFactor;
G4double alpha2;
G4bool lossFlucFlag;
G4int verbose;
G4int nK;
G4int nL;
G4int nEtaK;
@@ -174,32 +204,105 @@ private:
G4double MSH[93];
G4double TAU[93];
const G4ParticleDefinition* particle;
const G4ParticleDefinition* curParticle;
const G4Material* material;
const G4Material* curMaterial;
const G4ElementVector* theElementVector;
const G4double* atomDensity;
G4int numberOfElements;
G4double kinEnergy;
G4double mass;
G4double massFactor;
G4double tau;
G4double gamma;
G4double bg2;
G4double beta2;
G4double beta;
G4double ba2;
G4double tmax;
G4double tmax0;
G4double charge;
G4double q2;
G4AtomicShells shells;
G4ionEffectiveCharge effCharge;
G4ionEffectiveCharge effCharge;
G4NistManager* nist;
G4VEmModel* ionModel;
// Ion stopping data
G4int nIons;
G4int idx;
std::vector<G4int> Zion;
std::vector<G4int> Aion;
std::vector<G4String> materialName;
std::vector<const G4Material*> materialList;
std::vector<G4PhysicsVector*> stopData;
G4PhysicsVector* curVector;
};
inline G4int G4EmCorrections::Index(G4double x, G4double* y, G4int n)
inline G4int G4EmCorrections::Index(G4double x, G4double* y, G4int n)
{
G4int idx = n-1;
do {idx--;} while (idx>0 && x<y[idx]);
return idx;
G4int iddd = n-1;
do {iddd--;} while (iddd>0 && x<y[iddd]);
return iddd;
}
inline G4double G4EmCorrections::Value(G4double xv, G4double x1, G4double x2,
G4double y1, G4double y2)
inline G4double G4EmCorrections::Value(G4double xv, G4double x1, G4double x2,
G4double y1, G4double y2)
{
return y1 + (y2 - y1)*(xv - x1)/(x2 - x1);
}
inline G4double G4EmCorrections::Value2(G4double xv, G4double yv, G4double x1, G4double x2,
inline G4double G4EmCorrections::Value2(G4double xv, G4double yv,
G4double x1, G4double x2,
G4double y1, G4double y2,
G4double z11, G4double z21, G4double z12, G4double z22)
G4double z11, G4double z21,
G4double z12, G4double z22)
{
return (z11*(x2-xv)*(y2-yv) + z22*(xv-x1)*(yv-y1) +
0.5*(z12*((x2-xv)*(yv-y1)+(xv-x1)*(y2-yv))+z21*((xv-x1)*(y2-yv)+(yv-y1)*(x2-xv))))
return (z11*(x2-xv)*(y2-yv) + z22*(xv-x1)*(yv-y1) +
0.5*(z12*((x2-xv)*(yv-y1)+(xv-x1)*(y2-yv))+
z21*((xv-x1)*(y2-yv)+(yv-y1)*(x2-xv))))
/ ((x2-x1)*(y2-y1));
}
inline void G4EmCorrections::SetupKinematics(const G4ParticleDefinition* p,
const G4Material* mat,
G4double kineticEnergy)
{
if(kineticEnergy != kinEnergy || p != particle) {
particle = p;
kinEnergy = kineticEnergy;
mass = p->GetPDGMass();
tau = kineticEnergy / mass;
gamma = 1.0 + tau;
bg2 = tau * (tau+2.0);
beta2 = bg2/(gamma*gamma);
beta = std::sqrt(beta2);
ba2 = beta2/alpha2;
G4double ratio = electron_mass_c2/mass;
tmax = 2.0*electron_mass_c2*bg2 /(1. + 2.0*gamma*ratio + ratio*ratio);
tmax0 = tmax;
charge = p->GetPDGCharge()/eplus;
if(charge < 1.5) q2 = charge*charge;
else {
q2 = effCharge.EffectiveChargeSquareRatio(p,mat,kinEnergy);
charge = std::sqrt(q2);
}
if(mass > 120.*MeV)
tmax = std::min(tmax,51200.*electron_mass_c2*std::pow(proton_mass_c2/mass,0.666667));
}
if(mat != material) {
material = mat;
theElementVector = material->GetElementVector();
atomDensity = material->GetAtomicNumDensityVector();
numberOfElements = material->GetNumberOfElements();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -1,33 +1,35 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4EmModelManager.hh,v 1.14 2005/04/11 10:40:47 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4EmModelManager.hh,v 1.19 2006/06/29 19:54:25 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4EmModelManager
//
// Author: Vladimir Ivanchenko
@@ -46,6 +48,9 @@
// 21-07-03 Add UpdateEmModel method (V.Ivanchenko)
// 03-11-03 Substitute STL vector for G4RegionModels (V.Ivanchenko)
// 11-04-05 Remove access to fluctuation models (V.Ivanchenko)
// 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko)
// 20-01-06 Introduce G4EmTableType and reducing number of methods (VI)
// 13-05-06 Add GetModel by index method (VI)
//
// Class Description:
//
@@ -66,6 +71,7 @@
#include "globals.hh"
#include "G4DataVector.hh"
#include "G4EmTableType.hh"
class G4RegionModels
{
@@ -121,7 +127,7 @@ public:
G4EmModelManager();
~G4EmModelManager();
~G4EmModelManager();
void Clear();
@@ -134,18 +140,18 @@ public:
const G4DataVector* SubCutoff() const;
void FillDEDXVector(G4PhysicsVector*, const G4MaterialCutsCouple*);
void FillDEDXVector(G4PhysicsVector*, const G4MaterialCutsCouple*,
G4EmTableType t = fRestricted);
void FillDEDXVectorForPreciseRange(G4PhysicsVector*, const G4MaterialCutsCouple*);
void FillLambdaVector(G4PhysicsVector*, const G4MaterialCutsCouple*,
G4bool startFromNull = true);
void FillSubLambdaVector(G4PhysicsVector*, const G4MaterialCutsCouple*,
G4bool startFromNull = true);
void FillLambdaVector(G4PhysicsVector*, const G4MaterialCutsCouple*,
G4bool startFromNull = true, G4EmTableType t = fRestricted);
G4VEmModel* SelectModel(G4double& energy, size_t& index);
G4VEmModel* GetModel(G4int);
G4int NumberOfModels() const;
void AddEmModel(G4int, G4VEmModel*, G4VEmFluctuationModel*, const G4Region*);
void UpdateEmModel(const G4String&, G4double, G4double);
@@ -192,9 +198,11 @@ private:
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VEmModel* G4EmModelManager::SelectModel(G4double& kinEnergy, size_t& index)
inline G4VEmModel* G4EmModelManager::SelectModel(G4double& kinEnergy,
size_t& index)
{
currentIdx = (setOfRegionModels[idxOfRegionModels[index]])->SelectIndex(kinEnergy);
currentIdx =
(setOfRegionModels[idxOfRegionModels[index]])->SelectIndex(kinEnergy);
return models[currentIdx];
}
@@ -214,5 +222,12 @@ inline const G4DataVector* G4EmModelManager::SubCutoff() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4int G4EmModelManager::NumberOfModels() const
{
return nEmModels;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4EmMultiModel.hh,v 1.4 2005/04/15 11:40:46 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4EmMultiModel.hh,v 1.5 2006/06/29 19:54:27 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4EmProcessOptions.hh,v 1.4 2005/10/27 14:04:35 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4EmProcessOptions.hh,v 1.9 2006/06/29 19:54:29 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// -------------------------------------------------------------------
@@ -36,6 +39,8 @@
// Creation date: 27.02.2004
//
// Modifications:
// 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko)
// 22-05-06 Add SetBremsstrahlungTh (V.Ivanchenko)
//
//
// Class Description:
@@ -75,23 +80,23 @@ public:
void SetMaxEnergy(G4double val);
void SetMaxEnergyForPreciseRange(G4double val);
void SetMaxEnergyForCSDARange(G4double val);
void SetMaxEnergyForMuons(G4double val);
void SetDEDXBinning(G4int val);
void SetDEDXBinningForPreciseRange(G4int val);
void SetDEDXBinningForCSDARange(G4int val);
void SetLambdaBinning(G4int val);
void SetStepLimits(G4double v1, G4double v2);
void SetStepFunction(G4double v1, G4double v2);
void SetRandomStep(G4bool val);
void SetApplyCuts(G4bool val);
void SetBuildPreciseRange(G4bool val);
void SetBuildCSDARange(G4bool val);
void SetVerbose(G4int val, const G4String& name = "all");
@@ -101,6 +106,10 @@ public:
void SetMscStepLimitation(G4bool algorithm, G4double factor = -1.);
void SetLPMFlag(G4bool val);
void SetBremsstrahlungTh(G4double val);
private:
G4EmProcessOptions & operator=(const G4EmProcessOptions &right);
@@ -0,0 +1,54 @@
//
// ********************************************************************
// * 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: G4EmTableType.hh,v 1.2 2006/06/29 19:54:31 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//---------------------------------------------------------------
//
// G4EmTableType.hh
//
// Class Description:
// This is an enumerator to define type of dEdx and Rnge tables
//
// Author: Vladimir Ivanchenko
//
// Creation date: 19.01.2006
//
//---------------------------------------------------------------
#ifndef G4EmTableType_h
#define G4EmTableType_h 1
enum G4EmTableType
{
fTotal = 0,
fRestricted,
fSubRestricted
};
#endif
@@ -1,29 +1,49 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4EnergyLossMessenger.hh,v 1.8 2003/10/13 10:49:17 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4EnergyLossMessenger.hh,v 1.13 2006/06/29 19:54:33 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
// File name: G4EnergyLossMessenger
//
// Author: Michel Maire
//
// Creation date: 22-06-2000
//
// Modifications:
// 10-01-06 SetStepLimits -> SetStepFunction (V.Ivantchenko)
// 10-05-06 Add command MscStepLimit (V.Ivantchenko)
//
// -------------------------------------------------------------------
//
//
// Class Description:
// This is a messenger class to interface to exchange information
@@ -59,26 +79,28 @@ class G4UIcmdWithADoubleAndUnit;
class G4EnergyLossMessenger: public G4UImessenger
{
public: // with description
public: // with description
G4EnergyLossMessenger();
virtual ~G4EnergyLossMessenger();
G4EnergyLossMessenger();
~G4EnergyLossMessenger();
void SetNewValue(G4UIcommand*, G4String);
void SetNewValue(G4UIcommand*, G4String);
private:
private:
G4UIdirectory* eLossDirectory;
G4UIcmdWithABool* RndmStepCmd;
G4UIcmdWithABool* EnlossFlucCmd;
G4UIcmdWithABool* SubSecCmd;
G4UIcmdWithADoubleAndUnit* MinSubSecCmd;
G4UIcommand* StepFuncCmd;
G4UIcmdWithADoubleAndUnit* MinEnCmd;
G4UIcmdWithADoubleAndUnit* MaxEnCmd;
G4UIcmdWithABool* IntegCmd;
G4UIcmdWithABool* rangeCmd;
G4UIcmdWithAnInteger* verCmd;
G4UIdirectory* eLossDirectory;
G4UIcmdWithABool* RndmStepCmd;
G4UIcmdWithABool* EnlossFlucCmd;
G4UIcmdWithABool* SubSecCmd;
G4UIcmdWithADoubleAndUnit* MinSubSecCmd;
G4UIcommand* StepFuncCmd;
G4UIcommand* mscCmd;
G4UIcmdWithADoubleAndUnit* MinEnCmd;
G4UIcmdWithADoubleAndUnit* MaxEnCmd;
G4UIcmdWithABool* IntegCmd;
G4UIcmdWithABool* rangeCmd;
G4UIcmdWithABool* lpmCmd;
G4UIcmdWithAnInteger* verCmd;
};
#endif
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4EnergyLossTables.hh,v 1.18 2003/07/23 11:36:25 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4EnergyLossTables.hh,v 1.19 2006/06/29 19:54:35 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// $Id:
//
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4LossTableBuilder.hh,v 1.4 2004/11/10 08:54:59 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4LossTableBuilder.hh,v 1.7 2006/06/29 19:54:37 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// -------------------------------------------------------------------
@@ -59,16 +62,18 @@ class G4LossTableBuilder
public:
G4LossTableBuilder() {};
G4LossTableBuilder();
~G4LossTableBuilder() {};
virtual ~G4LossTableBuilder();
void BuildDEDXTable(G4PhysicsTable* dedxTable, const std::vector<G4PhysicsTable*>&);
void BuildRangeTable(const G4PhysicsTable* dedxTable, G4PhysicsTable* rangeTable);
void BuildRangeTable(const G4PhysicsTable* dedxTable, G4PhysicsTable* rangeTable,
G4bool isIonisation = false);
void BuildInverseRangeTable(const G4PhysicsTable* rangeTable,
G4PhysicsTable* invRangeTable);
G4PhysicsTable* invRangeTable,
G4bool isIonisation = false);
private:
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4LossTableManager.hh,v 1.28 2005/10/27 14:04:35 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4LossTableManager.hh,v 1.41 2006/06/29 19:54:39 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// -------------------------------------------------------------------
@@ -50,6 +53,11 @@
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
// 14-01-04 Activate precise range calculation (V.Ivanchenko)
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
// 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko)
// 20-01-06 Introduce GetSubDEDX method (VI)
// 26-01-06 Rename GetRange -> GetRangeFromRestricteDEDX (V.Ivanchenko)
// 10-05-06 Add methods SetMscStepLimitation, FacRange and MscFlag (VI)
// 22-05-06 Add methods Set/Get bremsTh (VI)
//
// Class Description:
//
@@ -70,7 +78,6 @@
#include <map>
#include <vector>
#include "globals.hh"
#include "G4LossTableBuilder.hh"
#include "G4VEnergyLossProcess.hh"
#include "G4EnergyLossTables.hh"
@@ -81,6 +88,7 @@ class G4ParticleDefinition;
class G4VMultipleScattering;
class G4VEmProcess;
class G4EmCorrections;
class G4LossTableBuilder;
class G4LossTableManager
{
@@ -99,12 +107,22 @@ public:
G4double kineticEnergy,
const G4MaterialCutsCouple *couple);
G4double GetSubDEDX(
const G4ParticleDefinition *aParticle,
G4double kineticEnergy,
const G4MaterialCutsCouple *couple);
G4double GetRange(
const G4ParticleDefinition *aParticle,
G4double kineticEnergy,
const G4MaterialCutsCouple *couple);
G4double GetTrancatedRange(
G4double GetCSDARange(
const G4ParticleDefinition *aParticle,
G4double kineticEnergy,
const G4MaterialCutsCouple *couple);
G4double GetRangeFromRestricteDEDX(
const G4ParticleDefinition *aParticle,
G4double kineticEnergy,
const G4MaterialCutsCouple *couple);
@@ -132,13 +150,17 @@ public:
void DeRegister(G4VEmProcess* p);
void EnergyLossProcessIsInitialised(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess* p);
void EnergyLossProcessIsInitialised(const G4ParticleDefinition* aParticle,
G4VEnergyLossProcess* p);
void RegisterIon(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess* p);
void RegisterIon(const G4ParticleDefinition* aParticle,
G4VEnergyLossProcess* p);
void RegisterExtraParticle(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess* p);
void RegisterExtraParticle(const G4ParticleDefinition* aParticle,
G4VEnergyLossProcess* p);
void BuildPhysicsTable(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess* p);
void BuildPhysicsTable(const G4ParticleDefinition* aParticle,
G4VEnergyLossProcess* p);
void SetLossFluctuations(G4bool val);
@@ -154,25 +176,39 @@ public:
void SetMaxEnergy(G4double val);
void SetMaxEnergyForPreciseRange(G4double val);
void SetMaxEnergyForCSDARange(G4double val);
void SetMaxEnergyForMuons(G4double val);
void SetDEDXBinning(G4int val);
void SetDEDXBinningForPreciseRange(G4int val);
void SetDEDXBinningForCSDARange(G4int val);
void SetLambdaBinning(G4int val);
void SetStepLimits(G4double v1, G4double v2);
void SetStepFunction(G4double v1, G4double v2);
void SetBuildPreciseRange(G4bool val);
void SetBuildCSDARange(G4bool val);
void SetLPMFlag(G4bool val);
void SetBremsstrahlungTh(G4double val);
void SetVerbose(G4int val);
G4EnergyLossMessenger* GetMessenger();
G4bool BuildPreciseRange() const;
G4bool BuildCSDARange() const;
G4bool LPMFlag() const;
void SetMscStepLimitation(G4bool algorithm, G4double factor = -1.);
G4bool MscFlag() const;
G4double FacRange() const;
G4double BremsstrahlungTh() const;
const std::vector<G4VEnergyLossProcess*>& GetEnergyLossProcessVector();
@@ -188,7 +224,8 @@ private:
G4VEnergyLossProcess* BuildTables(const G4ParticleDefinition* aParticle);
void CopyTables(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess*);
void CopyTables(const G4ParticleDefinition* aParticle,
G4VEnergyLossProcess*);
void ParticleHaveNoLoss(const G4ParticleDefinition* aParticle);
@@ -207,6 +244,7 @@ private:
std::vector<PD> part_vector;
std::vector<PD> base_part_vector;
std::vector<G4bool> tables_are_built;
std::vector<G4bool> isActive;
std::vector<G4PhysicsTable*> dedx_vector;
std::vector<G4PhysicsTable*> range_vector;
std::vector<G4PhysicsTable*> inv_range_vector;
@@ -214,9 +252,9 @@ private:
std::vector<G4VEmProcess*> emp_vector;
// cash
G4VEnergyLossProcess* currentLoss;
PD currentParticle;
PD theElectron;
G4VEnergyLossProcess* currentLoss;
PD currentParticle;
PD theElectron;
G4int n_loss;
@@ -228,11 +266,14 @@ private:
G4bool integral;
G4bool integralActive;
G4bool all_tables_are_stored;
G4bool buildPreciseRange;
G4bool buildCSDARange;
G4bool minEnergyActive;
G4bool maxEnergyActive;
G4bool maxEnergyForMuonsActive;
G4bool stepFunctionActive;
G4bool flagLPM;
G4bool flagMSC;
G4bool mscActive;
G4double minSubRange;
G4double maxRangeVariation;
@@ -240,6 +281,8 @@ private:
G4double minKinEnergy;
G4double maxKinEnergy;
G4double maxKinEnergyForMuons;
G4double facRange;
G4double bremsTh;
G4LossTableBuilder* tableBuilder;
G4EnergyLossMessenger* theMessenger;
@@ -269,13 +312,57 @@ inline G4double G4LossTableManager::GetDEDX(
}
G4double x;
if(currentLoss) x = currentLoss->GetDEDX(kineticEnergy, couple);
else x = G4EnergyLossTables::GetDEDX(currentParticle,kineticEnergy,couple,false);
else x = G4EnergyLossTables::GetDEDX(
currentParticle,kineticEnergy,couple,false);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
inline G4double G4LossTableManager::GetTrancatedRange(
inline G4double G4LossTableManager::GetSubDEDX(
const G4ParticleDefinition *aParticle,
G4double kineticEnergy,
const G4MaterialCutsCouple *couple)
{
if(aParticle != currentParticle) {
currentParticle = aParticle;
std::map<PD, G4VEnergyLossProcess*,std::less<PD> >::const_iterator pos;
if ((pos = loss_map.find(aParticle)) != loss_map.end()) {
currentLoss = (*pos).second;
} else {
currentLoss = 0;
// ParticleHaveNoLoss(aParticle);
}
}
G4double x = 0.0;
if(currentLoss) x = currentLoss->GetDEDXForSubsec(kineticEnergy, couple);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
inline G4double G4LossTableManager::GetCSDARange(
const G4ParticleDefinition *aParticle,
G4double kineticEnergy,
const G4MaterialCutsCouple *couple)
{
if(aParticle != currentParticle) {
currentParticle = aParticle;
std::map<PD, G4VEnergyLossProcess*, std::less<PD> >::const_iterator pos;
if ((pos = loss_map.find(currentParticle)) != loss_map.end()) {
currentLoss = (*pos).second;
} else {
currentLoss = 0;
}
}
G4double x = DBL_MAX;
if(currentLoss) x = currentLoss->GetCSDARange(kineticEnergy, couple);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
inline G4double G4LossTableManager::GetRangeFromRestricteDEDX(
const G4ParticleDefinition *aParticle,
G4double kineticEnergy,
const G4MaterialCutsCouple *couple)
@@ -344,8 +431,8 @@ inline G4double G4LossTableManager::GetEnergy(
}
G4double x;
if(currentLoss) x = currentLoss->GetKineticEnergy(range, couple);
else x = G4EnergyLossTables::GetPreciseEnergyFromRange(currentParticle,
range,couple,false);
else x = G4EnergyLossTables::GetPreciseEnergyFromRange(
currentParticle,range,couple,false);
return x;
}
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4VEmFluctuationModel.hh,v 1.9 2005/07/25 18:13:35 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VEmFluctuationModel.hh,v 1.10 2006/06/29 19:54:41 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4VEmModel.hh,v 1.35 2005/07/25 18:13:35 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VEmModel.hh,v 1.42 2006/06/29 19:54:43 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//
@@ -45,12 +48,16 @@
// 01-03-04 L.Urban signature changed in SampleCosineTheta
// 23-04-04 L.urban signature of SampleCosineTheta changed back
// 17-11-04 Add method CrossSectionPerAtom (V.Ivanchenko)
// 14-03-05 Reduce number of pure virtual methods and make inline part separate (V.Ivanchenko)
// 24-03-05 Remove IsInCharge and add G4VParticleChange in the constructor (V.Ivanchenko)
// 14-03-05 Reduce number of pure virtual methods and make inline part
// separate (V.Ivanchenko)
// 24-03-05 Remove IsInCharge and add G4VParticleChange in the constructor (VI)
// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
// 15-04-05 optimize internal interface for msc (V.Ivanchenko)
// 08-05-05 A -> N (V.Ivanchenko)
// 25-07-05 Move constructor and destructor to the body (V.Ivanchenko)
// 02-02-06 ComputeCrossSectionPerAtom: default value A=0. (mma)
// 06-02-06 add method ComputeMeanFreePath() (mma)
// 07-03-06 Optimize msc methods (V.Ivanchenko)
//
// Class Description:
//
@@ -76,6 +83,7 @@
class G4PhysicsTable;
class G4Region;
class G4VParticleChange;
class G4Track;
class G4VEmModel
{
@@ -118,36 +126,46 @@ public:
G4double maxEnergy = DBL_MAX);
virtual G4double ComputeDEDXPerVolume(
const G4Material*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy = DBL_MAX);
const G4Material*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy = DBL_MAX);
virtual G4double CrossSectionPerVolume(
const G4Material*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy = 0.0,
G4double maxEnergy = DBL_MAX);
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition*,
G4double kinEnergy,
G4double Z,
G4double A,
G4double A = 0.,
G4double cutEnergy = 0.0,
G4double maxEnergy = DBL_MAX);
virtual G4double ComputeMeanFreePath(
const G4ParticleDefinition*,
G4double kineticEnergy,
const G4Material*,
G4double cutEnergy = 0.0,
G4double maxEnergy = DBL_MAX);
virtual G4double CrossSectionPerVolume(
const G4Material*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy = 0.0,
G4double maxEnergy = DBL_MAX);
// Methods for msc simulation
virtual G4double GeomPathLength(G4PhysicsTable* theLambdaTable,
const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double& kinEnergy,
G4double lambda,
G4double range,
G4double truePathLength);
virtual G4double TrueStepLength(G4double geomStepLength);
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*);
@@ -203,29 +221,37 @@ protected:
G4VParticleChange* pParticleChange;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VEmModel::HighEnergyLimit()
{
return highLimit;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VEmModel::LowEnergyLimit()
{
return lowLimit;
}
//....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::SetParticleChange(G4VParticleChange* p,
G4VEmFluctuationModel* f = 0)
{
@@ -233,17 +259,24 @@ inline void G4VEmModel::SetParticleChange(G4VParticleChange* 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::ComputeDEDXPerVolume(
const G4Material*,
const G4ParticleDefinition*,
@@ -253,6 +286,8 @@ inline G4double G4VEmModel::ComputeDEDXPerVolume(
return 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c,
const G4ParticleDefinition* p,
G4double kinEnergy,
@@ -261,34 +296,42 @@ inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c,
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);
return CrossSectionPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy,maxEnergy);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VEmModel::ComputeCrossSectionPerAtom(
const G4ParticleDefinition*,
G4double, G4double, G4double, G4double, G4double)
const G4ParticleDefinition*,
G4double, G4double, G4double,
G4double, G4double)
{
return 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline const G4Element* G4VEmModel::SelectRandomAtom(
const G4Material* material,
const G4ParticleDefinition* pd,
G4double kinEnergy,
G4double tcut,
G4double tmax)
const G4Material* material,
const G4ParticleDefinition* pd,
G4double kinEnergy,
G4double tcut,
G4double tmax)
{
const G4ElementVector* theElementVector = material->GetElementVector();
const G4Element* elm = (*theElementVector)[0];
G4int nelm = material->GetNumberOfElements() - 1;
if(nelm > 0) {
G4double x = G4UniformRand()*CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax);
if (nelm > 0) {
G4double x = G4UniformRand()*
CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax);
G4int i = -1;
do {i++;} while (x > xsec[i] && i < nelm);
elm = (*theElementVector)[i];
@@ -296,43 +339,62 @@ inline const G4Element* G4VEmModel::SelectRandomAtom(
return elm;
}
inline G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynParticle)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VEmModel::MaxSecondaryKinEnergy(
const G4DynamicParticle* dynParticle)
{
return MaxSecondaryEnergy(dynParticle->GetDefinition(), dynParticle->GetKineticEnergy());
return MaxSecondaryEnergy(dynParticle->GetDefinition(),
dynParticle->GetKineticEnergy());
}
//....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
inline G4double G4VEmModel::GeomPathLength(G4PhysicsTable*,
const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double&,
G4double,
G4double,
G4double truePathLength)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VEmModel::ComputeTruePathLengthLimit(
const G4Track&,
G4PhysicsTable*,
G4double)
{
return DBL_MAX;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VEmModel::ComputeGeomPathLength(G4double truePathLength)
{
return truePathLength;
}
inline G4double G4VEmModel::TrueStepLength(G4double geomStepLength)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4VEmModel::ComputeTrueStepLength(G4double geomPathLength)
{
return geomStepLength;
return geomPathLength;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline void G4VEmModel::DefineForRegion(const G4Region*)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4VEmProcess.hh,v 1.29 2005/10/25 11:38:15 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VEmProcess.hh,v 1.33 2006/06/29 19:54:45 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//
@@ -39,11 +42,14 @@
// 09-08-04 optimise integral option (V.Ivanchenko)
// 11-08-04 add protected methods to access cuts (V.Ivanchenko)
// 09-09-04 Bug fix for the integral mode with 2 peaks (V.Ivanchneko)
// 16-09-04 Add flag for LambdaTable and method RecalculateLambda (V.Ivanchneko)
// 16-09-04 Add flag for LambdaTable and method RecalculateLambda (VI)
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
// 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
// 18-04-05 Use G4ParticleChangeForGamma (V.Ivantchenko)
// 09-05-05 Fix problem in logic when path boundary between materials (V.Ivantchenko)
// 09-05-05 Fix problem in logic when path boundary between materials (VI)
// 11-01-06 add A to parameters of ComputeCrossSectionPerAtom (VI)
// 01-02-06 put default value A=0. to keep compatibility with v5.2 (mma)
// 13-05-06 Add method to access model by index (V.Ivanchenko)
//
// Class Description:
//
@@ -167,7 +173,8 @@ public:
const G4MaterialCutsCouple* couple);
// It returns the cross section of the process for energy/ material
G4double ComputeCrossSectionPerAtom(G4double kineticEnergy, G4double Z);
G4double ComputeCrossSectionPerAtom(G4double kineticEnergy,
G4double Z, G4double A=0.);
// It returns the cross section of the process per atom
G4double MeanFreePath( const G4Track& track,
@@ -179,12 +186,16 @@ public:
void ActivateDeexcitation(G4bool, const G4Region* r = 0);
G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idxRegion) const;
G4VEmModel* SelectModelForMaterial(G4double kinEnergy,
size_t& idxRegion) const;
void SetIntegral(G4bool val);
G4bool IsIntegral() const;
void SetApplyCuts(G4bool val);
// Access to models
G4VEmModel* GetModelByIndex(G4int idx = 0);
protected:
@@ -453,4 +464,11 @@ inline void G4VEmProcess::SetLambdaFactor(G4double val)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VEmModel* G4VEmProcess::GetModelByIndex(G4int idx)
{
return modelManager->GetModel(idx);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4VEnergyLoss.hh,v 1.17 2003/03/25 13:36:57 maire Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VEnergyLoss.hh,v 1.18 2006/06/29 19:54:47 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// ------------------------------------------------------------
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4VEnergyLossProcess.hh,v 1.43 2005/10/27 14:04:35 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VEnergyLossProcess.hh,v 1.56 2006/06/29 19:54:49 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//
@@ -52,13 +55,21 @@
// 10-03-04 Fix problem of step limit calculation (V.Ivanchenko)
// 30-06-04 make destructor virtual (V.Ivanchenko)
// 05-07-04 fix problem of GenericIons seen at small cuts (V.Ivanchenko)
// 03-08-04 Add DEDX table to all processes for control on integral range(V.Ivanchenko)
// 03-08-04 Add DEDX table to all processes for control on integral range(VI)
// 06-08-04 Clear up names of member functions (V.Ivanchenko)
// 27-08-04 Add NeedBuildTables method (V.Ivanchneko)
// 09-09-04 Bug fix for the integral mode with 2 peaks (V.Ivanchneko)
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko)
// 08-04-05 Major optimisation of internal interfaces (V.Ivanchenko)
// 11-04-05 Use MaxSecondaryEnergy from a model (V.Ivanchenko)
// 10-01-05 Remove SetStepLimits (V.Ivanchenko)
// 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko)
// 13-01-06 Remove AddSubCutSecondaries and cleanup (V.Ivantchenko)
// 20-01-06 Introduce G4EmTableType and reducing number of methods (VI)
// 26-01-06 Add public method GetCSDARange (V.Ivanchenko)
// 22-03-06 Add SetDynamicMassCharge (V.Ivanchenko)
// 23-03-06 Use isIonisation flag (V.Ivanchenko)
// 13-05-06 Add method to access model by index (V.Ivanchenko)
//
// Class Description:
//
@@ -82,14 +93,15 @@
#include "G4EmModelManager.hh"
#include "G4UnitsTable.hh"
#include "G4ParticleChangeForLoss.hh"
#include "G4EmTableType.hh"
#include "G4PhysicsTable.hh"
#include "G4PhysicsVector.hh"
class G4Step;
class G4ParticleDefinition;
class G4VEmModel;
class G4VEmFluctuationModel;
class G4DataVector;
class G4PhysicsTable;
class G4PhysicsVector;
class G4Region;
class G4Navigator;
@@ -163,10 +175,9 @@ public:
G4double SampleRange();
G4PhysicsTable* BuildDEDXTable();
G4PhysicsTable* BuildDEDXTableForPreciseRange();
G4PhysicsTable* BuildLambdaTable();
G4PhysicsTable* BuildLambdaSubTable();
G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted);
G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted);
void SetBaseParticle(const G4ParticleDefinition* p);
@@ -176,12 +187,10 @@ public:
// Binning for dEdx, range, and inverse range tables
void SetDEDXBinning(G4int nbins);
void SetLambdaBinning(G4int nbins);
// Binning for dEdx, range, and inverse range tables
void SetDEDXBinningForPreciseRange(G4int nbins);
// Binning for lambda table
void SetLambdaBinning(G4int nbins);
void SetDEDXBinningForCSDARange(G4int nbins);
// Min kinetic energy for tables
void SetMinKinEnergy(G4double e);
@@ -192,7 +201,7 @@ public:
G4double MaxKinEnergy() const;
// Max kinetic energy for tables
void SetMaxKinEnergyForPreciseRange(G4double e);
void SetMaxKinEnergyForCSDARange(G4double e);
// Store PhysicsTable in a file.
// Return false in case of failure at I/O
@@ -225,11 +234,14 @@ public:
void SetDEDXTable(G4PhysicsTable* p);
G4PhysicsTable* DEDXTable() const;
void SetDEDXTableForSubsec(G4PhysicsTable* p);
G4PhysicsTable* DEDXTableForSubsec() const;
void SetDEDXunRestrictedTable(G4PhysicsTable* p);
G4PhysicsTable* DEDXunRestrictedTable() const;
void SetPreciseRangeTable(G4PhysicsTable* pRange);
G4PhysicsTable* PreciseRangeTable() const;
void SetCSDARangeTable(G4PhysicsTable* pRange);
G4PhysicsTable* CSDARangeTable() const;
void SetRangeTableForLoss(G4PhysicsTable* p);
G4PhysicsTable* RangeTableForLoss() const;
@@ -245,12 +257,14 @@ public:
void SetSubLambdaTable(G4PhysicsTable* p);
G4PhysicsTable* SubLambdaTable();
// Return values for particle
G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple* couple);
G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple* couple);
G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple* couple);
G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple* couple);
G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple* couple);
// Return values for given G4MaterialCutsCouple
G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*);
G4double GetDEDXForSubsec(G4double& kineticEnergy, const G4MaterialCutsCouple*);
G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*);
G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple*);
G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple*);
G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple,
const G4DynamicParticle* dp,
@@ -270,7 +284,6 @@ public:
//
void SetLinearLossLimit(G4double val);
void SetMinSubRange(G4double val);
void SetStepLimits(G4double v1, G4double v2);
void SetStepFunction(G4double v1, G4double v2);
void SetLambdaFactor(G4double val);
@@ -293,17 +306,22 @@ public:
G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idx) const;
// Set/Get flag "isIonisation"
void SetIonisation(G4bool val);
G4bool IsIonisationProcess() const;
void AddCollaborativeProcess(G4VEnergyLossProcess*);
void AddSubCutoffSecondaries(std::vector<G4Track*>&, const G4Step&,
G4double& eloss, G4double& escaled);
void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&,
G4double& eloss, G4VEmModel* model);
G4double& cut, G4VEmModel* model);
// Set scaling parameters
void SetDynamicMassCharge(G4double massratio, G4double charge2ratio);
// Access to models
G4VEmModel* GetModelByIndex(G4int idx = 0);
G4int NumberOfModels();
protected:
@@ -311,25 +329,10 @@ protected:
void SetSecondaryParticle(const G4ParticleDefinition* p);
G4PhysicsVector* DEDXPhysicsVector(const G4MaterialCutsCouple*);
G4PhysicsVector* DEDXPhysicsVectorForPreciseRange(const G4MaterialCutsCouple*);
G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*);
G4PhysicsVector* SubLambdaPhysicsVector(const G4MaterialCutsCouple*);
G4VEmModel* SelectModel(G4double kinEnergy);
size_t CurrentMaterialCutsCoupleIndex() const;
// Set scaling parameters
//
void SetMassRatio(G4double val);
void SetReduceFactor(G4double val);
void SetChargeSquare(G4double val);
void SetChargeSquareRatio(G4double val);
G4double GetCurrentRange() const;
private:
@@ -338,10 +341,12 @@ private:
void Clear();
void DefineMaterial(const G4MaterialCutsCouple* couple);
G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*, G4double cut);
// Returnd values for scaled energy and base particles mass
//
G4double GetDEDXForScaledEnergy(G4double scaledKinEnergy);
G4double GetSubDEDXForScaledEnergy(G4double scaledKinEnergy);
G4double GetScaledRangeForScaledEnergy(G4double scaledKinEnergy);
G4double GetLimitScaledRangeForScaledEnergy(G4double scaledKinEnergy);
G4double GetLambdaForScaledEnergy(G4double scaledKinEnergy);
@@ -371,9 +376,10 @@ private:
// tables and vectors
G4PhysicsTable* theDEDXTable;
G4PhysicsTable* theRangeTableForLoss;
G4PhysicsTable* theDEDXSubTable;
G4PhysicsTable* theDEDXunRestrictedTable;
G4PhysicsTable* thePreciseRangeTable;
G4PhysicsTable* theRangeTableForLoss;
G4PhysicsTable* theCSDARangeTable;
G4PhysicsTable* theSecondaryRangeTable;
G4PhysicsTable* theInverseRangeTable;
G4PhysicsTable* theLambdaTable;
@@ -393,21 +399,21 @@ private:
const G4ParticleDefinition* secondaryParticle;
const G4ParticleDefinition* thePositron;
G4PhysicsVector* vstrag;
// cash
const G4Material* currentMaterial;
const G4MaterialCutsCouple* currentCouple;
size_t currentMaterialIndex;
G4double minStepLimit;
G4int nDEDXBins;
G4int nDEDXBinsForRange;
G4int nLambdaBins;
G4int nBins;
G4int nBinsCSDA;
G4int nWarnings;
G4double lowestKinEnergy;
G4double minKinEnergy;
G4double maxKinEnergy;
G4double maxKinEnergyForRange;
G4double maxKinEnergyCSDA;
G4double massRatio;
G4double reduceFactor;
@@ -440,14 +446,13 @@ private:
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
inline void G4VEnergyLossProcess::DefineMaterial(
const G4MaterialCutsCouple* couple)
{
if(couple != currentCouple) {
currentCouple = couple;
currentMaterial = couple->GetMaterial();
currentMaterialIndex = couple->GetIndex();
minStepLimit = std::min(finalRange,
currentCouple->GetProductionCuts()->GetProductionCut(idxG4ElectronCut));
if(!meanFreePath) ResetNumberOfInteractionLengthLeft();
}
}
@@ -463,10 +468,31 @@ inline G4double G4VEnergyLossProcess::GetDEDX(G4double& kineticEnergy,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetDEDXForSubsec(G4double& kineticEnergy,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
return GetSubDEDXForScaledEnergy(kineticEnergy*massRatio);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
{
G4bool b;
G4double x = ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
G4double x =
((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)
{
G4bool b;
G4double x =
((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
return x;
}
@@ -476,42 +502,61 @@ inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
inline G4double G4VEnergyLossProcess::GetRange(G4double& kineticEnergy,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
G4double x = DBL_MAX;
if(thePreciseRangeTable)
x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio);
else if(theRangeTableForLoss)
x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio);
return x*reduceFactor;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(G4double e)
{
G4bool b;
G4double x;
if (e < maxKinEnergyForRange) {
x = ((*thePreciseRangeTable)[currentMaterialIndex])->GetValue(e, b);
if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
} else {
x = theRangeAtMaxEnergy[currentMaterialIndex] +
(e - maxKinEnergyForRange)/theDEDXAtMaxEnergy[currentMaterialIndex];
G4double x = fRange;
if(kineticEnergy != preStepKinEnergy || couple != currentCouple) {
DefineMaterial(couple);
if(theCSDARangeTable)
x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)
* reduceFactor;
else if(theRangeTableForLoss)
x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
}
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetRangeForLoss(G4double& kineticEnergy,
const G4MaterialCutsCouple* couple)
inline G4double G4VEnergyLossProcess::GetCSDARange(
G4double& kineticEnergy, const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
G4double x = DBL_MAX;
if(theRangeTableForLoss) x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio);
return x*reduceFactor;
if(theCSDARangeTable)
x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)
* reduceFactor;
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(
G4double e)
{
G4bool b;
G4double x;
if (e < maxKinEnergyCSDA) {
x = ((*theCSDARangeTable)[currentMaterialIndex])->GetValue(e, b);
if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
} else {
x = theRangeAtMaxEnergy[currentMaterialIndex] +
(e - maxKinEnergyCSDA)/theDEDXAtMaxEnergy[currentMaterialIndex];
}
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetRangeForLoss(
G4double& kineticEnergy,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
G4double x = DBL_MAX;
if(theRangeTableForLoss)
x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
// G4cout << "Range from " << GetProcessName() << " e= " << kineticEnergy << " r= " << x << G4endl;
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -526,8 +571,9 @@ inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetKineticEnergy(G4double& range,
const G4MaterialCutsCouple* couple)
inline G4double G4VEnergyLossProcess::GetKineticEnergy(
G4double& range,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
G4double r = range/reduceFactor;
@@ -586,7 +632,8 @@ inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,
inline G4double G4VEnergyLossProcess::GetLambdaForScaledEnergy(G4double e)
{
G4bool b;
return chargeSqRatio*(((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));
return
chargeSqRatio*(((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -616,44 +663,46 @@ inline void G4VEnergyLossProcess::ComputeLambdaForScaledEnergy(G4double e)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetMeanFreePath(const G4Track& track,
G4double,
G4ForceCondition* condition)
inline G4double G4VEnergyLossProcess::GetMeanFreePath(
const G4Track& track, G4double, G4ForceCondition* condition)
{
*condition = NotForced;
preStepKinEnergy = track.GetKineticEnergy();
preStepScaledEnergy = preStepKinEnergy*massRatio;
if(aboveCSmax && preStepScaledEnergy < mfpKinEnergy) ResetNumberOfInteractionLengthLeft();
if(aboveCSmax && preStepScaledEnergy < mfpKinEnergy)
ResetNumberOfInteractionLengthLeft();
DefineMaterial(track.GetMaterialCutsCouple());
if (meanFreePath) {
if (integral) ComputeLambdaForScaledEnergy(preStepScaledEnergy);
else preStepLambda = GetLambdaForScaledEnergy(preStepScaledEnergy);
else preStepLambda = GetLambdaForScaledEnergy(preStepScaledEnergy);
if(0.0 < preStepLambda) preStepMFP = 1.0/preStepLambda;
else preStepMFP = DBL_MAX;
}
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<< " eCSmax= " <<mfpKinEnergy<< " mfp= "<<preStepMFP<<G4endl;
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<< " eCSmax= "
//<<mfpKinEnergy<< " mfp= "<<preStepMFP<<G4endl;
return preStepMFP;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetContinuousStepLimit(const G4Track&,
G4double, G4double currentMinStep, G4double&)
G4double, G4double currentMinStep, G4double&)
{
G4double x = DBL_MAX;
if(theRangeTableForLoss) {
if(isIonisation) {
fRange = GetScaledRangeForScaledEnergy(preStepScaledEnergy)*reduceFactor;
x = fRange;
G4double y = x*dRoverRange;
if(x > minStepLimit && y < currentMinStep ) {
x = y + minStepLimit*(1.0 - dRoverRange)*(2.0 - minStepLimit/fRange);
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<<" range= "<<fRange
// <<" cMinSt="<<currentMinStep <<" minStepLimit= " << minStepLimit<< G4endl;
if(x > finalRange && y < currentMinStep ) {
x = y + finalRange*(1.0 - dRoverRange)*(2.0 - finalRange/fRange);
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy
// <<" range= "<<fRange <<" cMinSt="<<currentMinStep<< G4endl;
} else if (rndmStepFlag) x = SampleRange();
}
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<<" stepLimit= "<<x<<G4endl;
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy
// <<" stepLimit= "<<x<<G4endl;
return x;
}
@@ -661,6 +710,11 @@ inline G4double G4VEnergyLossProcess::GetContinuousStepLimit(const G4Track&,
inline G4double G4VEnergyLossProcess::SampleRange()
{
G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass();
G4bool b;
G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b));
G4double x = fRange + G4RandGauss::shoot(0.0,s);
if(x > 0.0) fRange = x;
return fRange;
}
@@ -675,9 +729,8 @@ inline void G4VEnergyLossProcess::ResetNumberOfInteractionLengthLeft()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::MinPrimaryEnergy(const G4ParticleDefinition*,
const G4Material*,
G4double cut)
inline G4double G4VEnergyLossProcess::MinPrimaryEnergy(
const G4ParticleDefinition*, const G4Material*, G4double cut)
{
return cut;
}
@@ -692,7 +745,7 @@ inline G4VEmModel* G4VEnergyLossProcess::SelectModel(G4double kinEnergy)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial(
G4double kinEnergy, size_t& idx) const
G4double kinEnergy, size_t& idx) const
{
return modelManager->SelectModel(kinEnergy, idx);
}
@@ -713,7 +766,8 @@ inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const
inline const G4ParticleDefinition*
G4VEnergyLossProcess::SecondaryParticle() const
{
return secondaryParticle;
}
@@ -736,6 +790,13 @@ inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const
{
return theDEDXSubTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
{
return theDEDXunRestrictedTable;
@@ -743,9 +804,9 @@ inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::PreciseRangeTable() const
inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const
{
return thePreciseRangeTable;
return theCSDARangeTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -791,31 +852,14 @@ inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetMassRatio(G4double val)
{
massRatio = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetReduceFactor(G4double val)
inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,
G4double charge2ratio)
{
reduceFactor = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetChargeSquare(G4double val)
{
chargeSquare = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetChargeSquareRatio(G4double val)
{
chargeSqRatio = val;
massRatio = massratio;
chargeSqRatio = charge2ratio;
chargeSquare = charge2ratio*eplus*eplus;
reduceFactor = 1.0/(chargeSqRatio*massRatio);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -827,20 +871,25 @@ inline G4double G4VEnergyLossProcess::GetCurrentRange() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::AddCollaborativeProcess(G4VEnergyLossProcess* p)
inline void G4VEnergyLossProcess::AddCollaborativeProcess(
G4VEnergyLossProcess* p)
{
scProcesses.push_back(p);
useSubCutoff = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::AddSubCutoffSecondaries(std::vector<G4Track*>& tracks,
const G4Step& step, G4double& eloss, G4double& escaled)
inline G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx)
{
if(idxSCoffRegions[currentMaterialIndex])
SampleSubCutSecondaries(tracks, step, eloss, SelectModel(escaled));
}
return modelManager->GetModel(idx);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4int G4VEnergyLossProcess::NumberOfModels()
{
return modelManager->NumberOfModels();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4VMultipleScattering.hh,v 1.29 2005/10/27 11:33:26 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VMultipleScattering.hh,v 1.39 2006/06/29 19:54:51 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//
@@ -53,6 +56,11 @@
// 15-04-05 remove boundary flag (V.Ivanchenko)
// 07-10-05 error in a protection in GetContinuousStepLimit corrected (L.Urban)
// 27-10-05 introduce virtual function MscStepLimitation() (V.Ivanchenko)
// 26-01-06 Rename GetRange -> GetRangeFromRestricteDEDX (V.Ivanchenko)
// 17-02-06 Save table of transport cross sections not mfp (V.Ivanchenko)
// 07-03-06 Move step limit calculation to model (V.Ivanchenko)
// 13-05-06 Add method to access model by index (V.Ivanchenko)
//
// -------------------------------------------------------------------
//
@@ -94,10 +102,6 @@ public:
virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
// True for all charged particles
virtual G4double TruePathLengthLimit(const G4Track& track,
G4double& lambda,
G4double currentMinimalStep) = 0;
virtual void PrintInfo() = 0;
protected:
@@ -123,9 +127,9 @@ public:
// Generic methods common to all models
//------------------------------------------------------------------------
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
virtual G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
virtual G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
// The function overloads the corresponding function of the base
// class.It limits the step near to boundaries only
@@ -172,7 +176,7 @@ public:
void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
// This method does not used for tracking, it is intended only for tests
G4double ContinuousStepLimit(const G4Track& track,
virtual G4double ContinuousStepLimit(const G4Track& track,
G4double previousStepSize,
G4double currentMinimalStep,
G4double& currentSafety);
@@ -183,7 +187,7 @@ public:
void SetBuildLambdaTable(G4bool val);
const G4PhysicsTable* LambdaTable() const;
G4PhysicsTable* LambdaTable() const;
G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idxRegion) const;
@@ -191,6 +195,9 @@ public:
const G4ParticleDefinition* Particle() const;
void SetParticle(const G4ParticleDefinition*);
// Access to models
G4VEmModel* GetModelByIndex(G4int idx = 0);
protected:
// This method is used for tracking, it returns mean free path value
@@ -201,24 +208,22 @@ protected:
G4double GetLambda(const G4ParticleDefinition* p, G4double& kineticEnergy);
// This method is used for tracking, it returns step limit
G4double GetContinuousStepLimit(const G4Track& track,
virtual G4double GetContinuousStepLimit(const G4Track& track,
G4double previousStepSize,
G4double currentMinimalStep,
G4double& currentSafety);
void SelectModel(G4double& kinEnergy);
G4VEmModel* SelectModel(G4double kinEnergy);
// Select concrete model
size_t CurrentMaterialCutsCoupleIndex() const {return currentMaterialIndex;};
// Return current index
G4double CurrentRange() const {return currentRange;};
private:
const G4MaterialCutsCouple* CurrentMaterialCutsCouple() const;
// Return current G4MaterialCutsCouple
void DefineMaterial(const G4MaterialCutsCouple* couple);
// define current material
private:
// hide assignment operator
G4VMultipleScattering(G4VMultipleScattering &);
@@ -226,14 +231,18 @@ private:
// =====================================================================
protected:
G4GPILSelection valueGPILSelectionMSC;
G4ParticleChangeForMSC fParticleChange;
private:
G4EmModelManager* modelManager;
G4VEmModel* currentModel;
// tables and vectors
G4PhysicsTable* theLambdaTable;
// cash
// cache
const G4ParticleDefinition* firstParticle;
const G4ParticleDefinition* currentParticle;
const G4MaterialCutsCouple* currentCouple;
@@ -244,13 +253,6 @@ private:
G4double minKinEnergy;
G4double maxKinEnergy;
G4double trueStepLength;
G4double truePathLength;
G4double geomPathLength;
G4double lambda0;
G4double currentRange;
G4GPILSelection valueGPILSelectionMSC;
G4bool latDisplasment;
G4bool buildLambdaTable;
};
@@ -289,6 +291,7 @@ inline G4double G4VMultipleScattering::AlongStepGetPhysicalInteractionLength(
valueGPILSelectionMSC = NotCandidateForSelection;
G4double steplength = GetContinuousStepLimit(track,previousStepSize,
currentMinimalStep,currentSafety);
// G4cout << "StepLimit= " << steplength << G4endl;
// set return value for G4GPILSelection
*selection = valueGPILSelectionMSC;
return steplength;
@@ -303,27 +306,14 @@ inline G4double G4VMultipleScattering::GetContinuousStepLimit(
G4double&)
{
DefineMaterial(track.GetMaterialCutsCouple());
G4double e = track.GetKineticEnergy();
SelectModel(e);
const G4ParticleDefinition* p = track.GetDefinition();
lambda0 = GetLambda(p, e);
currentRange = G4LossTableManager::Instance()->GetTrancatedRange(p,e,currentCouple);
// the next line was in error
// if(currentRange < currentMinimalStep) currentRange = currentMinimalStep;
// the condition/protection correctly should be
if(currentRange < currentMinimalStep) currentMinimalStep = currentRange;
truePathLength = TruePathLengthLimit(track,lambda0,currentMinimalStep);
//G4cout << "StepLimit: tpl= " << truePathLength << " lambda0= "
// << lambda0 << " range= " << currentRange
// << " currentMinStep= " << currentMinimalStep << G4endl;
if (truePathLength < currentMinimalStep) valueGPILSelectionMSC = CandidateForSelection;
geomPathLength = currentModel->GeomPathLength(theLambdaTable,currentCouple,
p,e,lambda0,currentRange,truePathLength);
if(geomPathLength > lambda0) geomPathLength = lambda0;
return geomPathLength;
currentModel = SelectModel(track.GetKineticEnergy());
G4double tPathLength =
currentModel->ComputeTruePathLengthLimit(track, theLambdaTable, currentMinimalStep);
if (tPathLength < currentMinimalStep) valueGPILSelectionMSC = CandidateForSelection;
// G4cout << "tPathLength= " << tPathLength << " currentMinimalStep= " << currentMinimalStep<< G4endl;
return currentModel->ComputeGeomPathLength(tPathLength);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VMultipleScattering::ContinuousStepLimit(
@@ -344,10 +334,11 @@ inline G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p,
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;
}
@@ -357,12 +348,8 @@ inline G4VParticleChange* G4VMultipleScattering::AlongStepDoIt(
const G4Track&,
const G4Step& step)
{
G4double geomStepLength = step.GetStepLength();
if((geomStepLength == geomPathLength) && (truePathLength <= currentRange))
trueStepLength = truePathLength;
else
trueStepLength = currentModel->TrueStepLength(geomStepLength);
fParticleChange.ProposeTrueStepLength(trueStepLength);
fParticleChange.ProposeTrueStepLength(
currentModel->ComputeTrueStepLength(step.GetStepLength()));
return &fParticleChange;
}
@@ -379,9 +366,9 @@ inline G4VParticleChange* G4VMultipleScattering::PostStepDoIt(const G4Track& tra
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VMultipleScattering::SelectModel(G4double& kinEnergy)
inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy)
{
currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex);
return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -464,11 +451,22 @@ inline const G4ParticleDefinition* G4VMultipleScattering::Particle() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline const G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
{
return theLambdaTable;
}
inline
const G4MaterialCutsCouple* G4VMultipleScattering::CurrentMaterialCutsCouple() const
{
return currentCouple;
}
inline G4VEmModel* G4VMultipleScattering::GetModelByIndex(G4int idx)
{
return modelManager->GetModel(idx);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -1,103 +0,0 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VSubCutoffProcessor.hh,v 1.6 2003/07/21 12:52:06 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4VSubCutoffProcessor
//
// Author: Vladimir Ivanchenko
//
// Creation date: 03.01.2002
//
// Modifications:
//
// 26-12-02 Secondary production moved to derived classes (V.Ivanchenko)
// 29-12-02 Change interface (V.Ivanchenko)
// 13-02-03 Add name (V.Ivanchenko)
//
// Class Description:
//
// Abstract class for interface to simualtion of subCutoff
// -------------------------------------------------------------------
//
#ifndef G4VSubCutoffProcessor_h
#define G4VSubCutoffProcessor_h 1
#include "globals.hh"
#include <vector>
class G4Step;
class G4Track;
class G4ParticleDefinition;
class G4VEmModel;
class G4DataVector;
class G4PhysicsTable;
class G4VSubCutoffProcessor
{
public:
G4VSubCutoffProcessor(const G4String& nam): name(nam) {};
virtual ~G4VSubCutoffProcessor() {};
virtual std::vector<G4Track*>* SampleSecondaries(const G4Step&,
G4double& tmax,
G4double& meanLoss,
G4VEmModel*) = 0;
virtual void Initialise(const G4ParticleDefinition*,
const G4ParticleDefinition*,
const G4DataVector*,
const G4DataVector*) = 0;
virtual void SetLambdaSubTable(G4PhysicsTable*) = 0;
virtual G4PhysicsTable* LambdaSubTable() = 0;
G4String GetName() const {return name;};
protected:
private:
// hide assignment operator
G4VSubCutoffProcessor & operator=(const G4VSubCutoffProcessor &right);
G4VSubCutoffProcessor(const G4VSubCutoffProcessor&);
const G4String name;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * 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. *
// * 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 intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * 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: G4ionEffectiveCharge.hh,v 1.6 2005/02/26 22:01:20 vnivanch Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4ionEffectiveCharge.hh,v 1.7 2006/06/29 19:54:53 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// -------------------------------------------------------------------
//