Import Geant4 7.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 11:11:55 +02:00
parent e083ffb441
commit 516dbf1a58
5914 changed files with 202605 additions and 71141 deletions
@@ -1,163 +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: G4BetheBlochModel.hh,v 1.10 2004/02/15 17:08:49 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4BetheBlochModel
//
// Author: Vladimir Ivanchenko on base of Laszlo Urban code
//
// Creation date: 03.01.2002
//
// Modifications:
//
// 23-12-02 V.Ivanchenko change interface in order to moveto cut per region
// 24-01-03 Make models region aware (V.Ivanchenko)
// 13-02-03 Add name (V.Ivanchenko)
// 12-11-03 Fix for GenericIons (V.Ivanchenko)
//
// Class Description:
//
// Implementation of Bethe-Bloch model of energy loss and
// delta-electron production by heavy charged particles
// -------------------------------------------------------------------
//
#ifndef G4BetheBlochModel_h
#define G4BetheBlochModel_h 1
#include "G4VEmModel.hh"
class G4BetheBlochModel : public G4VEmModel
{
public:
G4BetheBlochModel(const G4ParticleDefinition* p = 0, const G4String& nam = "BetheBloch");
~G4BetheBlochModel();
void Initialise(const G4ParticleDefinition*, const G4DataVector&);
G4double HighEnergyLimit(const G4ParticleDefinition* p);
G4double LowEnergyLimit(const G4ParticleDefinition* p);
void SetHighEnergyLimit(G4double e) {highKinEnergy = e;};
void SetLowEnergyLimit(G4double e) {lowKinEnergy = e;};
G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
G4bool IsInCharge(const G4ParticleDefinition*);
G4double ComputeDEDX(const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy);
G4double CrossSection(const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy,
G4double maxEnergy);
G4DynamicParticle* SampleSecondary(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
std::vector<G4DynamicParticle*>* SampleSecondaries(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
G4double MaxSecondaryEnergy(const G4DynamicParticle*);
protected:
G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double kinEnergy);
private:
void SetParticle(const G4ParticleDefinition* p);
// hide assignment operator
G4BetheBlochModel & operator=(const G4BetheBlochModel &right);
G4BetheBlochModel(const G4BetheBlochModel&);
const G4ParticleDefinition* particle;
G4double mass;
G4double spin;
G4double chargeSquare;
G4double ratio;
G4double highKinEnergy;
G4double lowKinEnergy;
G4double twoln10;
G4double bg2lim;
G4double taulim;
G4bool isIon;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4BetheBlochModel::MaxSecondaryEnergy(
const G4ParticleDefinition* pd,
G4double kinEnergy)
{
if(isIon) SetParticle(pd);
G4double tau = kinEnergy/mass;
G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
(1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
return tmax;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4BetheBlochModel::MaxSecondaryEnergy(const G4DynamicParticle* dp)
{
if(isIon) {
mass = dp->GetMass();
ratio = electron_mass_c2/mass;
}
G4double tau = dp->GetKineticEnergy()/mass;
G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
(1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
return tmax;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -1,124 +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: G4BohrFluctuations.hh,v 1.6 2004/05/11 15:35:06 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4BohrFluctuations
//
// Author: Vladimir Ivanchenko
//
// Creation date: 02.04.2003
//
// Modifications:
//
// 16-10-03 Changed interface to Initialisation (V.Ivanchenko)
//
// Class Description:
//
// Implementation of Gaussion energy loss Fluctuations
// -------------------------------------------------------------------
//
#ifndef G4BohrFluctuations_h
#define G4BohrFluctuations_h 1
#include "G4VEmFluctuationModel.hh"
#include "G4Material.hh"
#include "G4DynamicParticle.hh"
class G4BohrFluctuations : public G4VEmFluctuationModel
{
public:
G4BohrFluctuations(const G4String& nam = "BohrFluc");
~G4BohrFluctuations();
G4double SampleFluctuations(const G4Material*,
const G4DynamicParticle*,
G4double&,
G4double&,
G4double&);
G4double Dispersion( const G4Material*,
const G4DynamicParticle*,
G4double&,
G4double&);
void InitialiseMe(const G4ParticleDefinition*);
protected:
private:
// hide assignment operator
G4BohrFluctuations & operator=(const G4BohrFluctuations &right);
G4BohrFluctuations(const G4BohrFluctuations&);
const G4ParticleDefinition* particle;
G4double particleMass;
G4double chargeSquare;
G4double minNumberInteractionsBohr;
G4double minFraction;
G4double xmin;
G4double minLoss;
// cash
G4double kineticEnergy;
G4double beta2;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4BohrFluctuations::Dispersion(
const G4Material* material,
const G4DynamicParticle* dp,
G4double& tmax,
G4double& length)
{
if(!particle) InitialiseMe(dp->GetDefinition());
G4double electronDensity = material->GetElectronDensity();
kineticEnergy = dp->GetKineticEnergy();
G4double gam = kineticEnergy/particleMass + 1.0;
beta2 = 1.0 - 1.0/(gam*gam);
G4double siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
* electronDensity * chargeSquare;
return siga;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -1,182 +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: G4BraggModel.hh,v 1.11 2004/02/15 17:08:49 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4BraggModel
//
// Author: Vladimir Ivanchenko
//
// Creation date: 03.01.2002
//
// Modifications:
// 23-12-02 V.Ivanchenko change interface in order to moveto cut per region
// 24-01-03 Make models region aware (V.Ivanchenko)
// 13-02-03 Add name (V.Ivanchenko)
// 12-11-03 Fix for GenericIons (V.Ivanchenko)
//
//
// Class Description:
//
// Implementation of energy loss and delta-electron production
// by heavy slow charged particles using eveluated data
// -------------------------------------------------------------------
//
#ifndef G4BraggModel_h
#define G4BraggModel_h 1
#include "G4VEmModel.hh"
class G4BraggModel : public G4VEmModel
{
public:
G4BraggModel(const G4ParticleDefinition* p = 0, const G4String& nam = "Bragg");
~G4BraggModel();
void Initialise(const G4ParticleDefinition*, const G4DataVector&);
G4double HighEnergyLimit(const G4ParticleDefinition*);
G4double LowEnergyLimit(const G4ParticleDefinition*);
void SetHighEnergyLimit(G4double e) {highKinEnergy = e;};
void SetLowEnergyLimit(G4double e) {lowKinEnergy = e;};
G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
G4bool IsInCharge(const G4ParticleDefinition*);
G4double ComputeDEDX(const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy);
G4double CrossSection(const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy,
G4double maxEnergy);
G4DynamicParticle* SampleSecondary(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
std::vector<G4DynamicParticle*>* SampleSecondaries(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
G4double MaxSecondaryEnergy(const G4DynamicParticle*);
protected:
G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double kinEnergy);
private:
void SetParticle(const G4ParticleDefinition* p);
// hide assignment operator
G4BraggModel & operator=(const G4BraggModel &right);
G4BraggModel(const G4BraggModel&);
G4bool HasMaterial(const G4Material* material);
G4double StoppingPower(const G4Material* material,
G4double kineticEnergy);
G4double ElectronicStoppingPower(G4double z,
G4double kineticEnergy) const;
void SetMoleculaNumber(G4int number) {iMolecula = number;};
G4double DEDX(const G4Material* material, G4double kineticEnergy);
G4bool MolecIsInZiegler1988(const G4Material* material);
G4double ChemicalFactor(G4double kineticEnergy, G4double eloss125) const;
void SetExpStopPower125(G4double value) {expStopPower125 = value;};
const G4ParticleDefinition* particle;
G4double mass;
G4double spin;
G4double chargeSquare;
G4double massRate;
G4double ratio;
G4double highKinEnergy;
G4double lowKinEnergy;
G4double protonMassAMU;
G4double theZieglerFactor;
G4double expStopPower125; // Experimental Stopping power at 125keV
G4int iMolecula; // index in the molecula's table
G4bool isIon;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4BraggModel::MaxSecondaryEnergy(
const G4ParticleDefinition* pd,
G4double kinEnergy)
{
if(isIon) SetParticle(pd);
G4double tau = kinEnergy/mass;
G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
(1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
return tmax;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4BraggModel::MaxSecondaryEnergy(const G4DynamicParticle* dp)
{
if(isIon) {
mass = dp->GetMass();
ratio = electron_mass_c2/mass;
}
G4double tau = dp->GetKineticEnergy()/mass;
G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /
(1. + 2.0*(tau + 1.)*ratio + ratio*ratio);
return tmax;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -0,0 +1,215 @@
//
// ********************************************************************
// * 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: G4EmCalculator.hh,v 1.8 2004/11/17 10:04:45 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4EmCalculator
//
// Author: Vladimir Ivanchenko
//
// Creation date: 27.06.2004
//
// Modifications:
// 17.11.2004 Change signature of methods, add new methods (V.Ivanchenko)
//
//
// Class Description:
//
// Provide access to dE/dx and cross sections
// -------------------------------------------------------------------
//
#ifndef G4EmCalculator_h
#define G4EmCalculator_h 1
#include <vector>
#include "globals.hh"
#include "G4DataVector.hh"
class G4LossTableManager;
class G4Material;
class G4MaterialCutsCouple;
class G4ParticleDefinition;
class G4PhysicsTable;
class G4VEmModel;
class G4VEnergyLossProcess;
class G4ionEffectiveCharge;
class G4Region;
class G4Element;
class G4EmCalculator
{
public:
G4EmCalculator();
~G4EmCalculator();
// Methods to access precalculated dE/dx and cross sections
// Materials should exist in the list of the G4MaterialCutsCouple
G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition*, const G4Material*,
const G4Region* r = 0);
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 GetKinEnergy(G4double range, const G4ParticleDefinition*, const G4Material*,
const G4Region* r = 0);
G4double GetKinEnergy(G4double range, const G4String& part, const G4String& mat,
const G4String& s = "world");
G4double GetCrossSectionPerVolume(
G4double kinEnergy, const G4ParticleDefinition*,
const G4String& processName, const G4Material*,
const G4Region* r = 0);
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*,
const G4Region* r = 0);
G4double GetMeanFreePath(G4double kinEnergy, const G4String& part, const G4String& proc,
const G4String& mat, const G4String& s = "world");
void PrintDEDXTable(const G4ParticleDefinition*);
void PrintRangeTable(const G4ParticleDefinition*);
void PrintInverseRangeTable(const G4ParticleDefinition*);
// Methods to calculate dE/dx and cross sections "on fly"
// Existing tables and G4MaterialCutsCouples are not used
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition*,
const G4String& processName, const G4Material*,
G4double cut = DBL_MAX);
G4double ComputeDEDX(G4double kinEnergy, const G4String& part, const G4String& proc,
const G4String& mat, G4double cut = DBL_MAX);
G4double ComputeCrossSectionPerVolume(
G4double kinEnergy, const G4ParticleDefinition*,
const G4String& processName, const G4Material*,
G4double cut = 0.0);
G4double ComputeCrossSectionPerVolume(
G4double kinEnergy, const G4String& part, const G4String& proc,
const G4String& mat, G4double cut = 0.0);
G4double ComputeCrossSectionPerAtom(
G4double kinEnergy, const G4ParticleDefinition*,
const G4String& processName, G4double Z, G4double A,
G4double cut = 0.0);
G4double ComputeCrossSectionPerAtom(
G4double kinEnergy, const G4String& part,
const G4String& processName, const G4Element*,
G4double cut = 0.0);
G4double ComputeMeanFreePath(
G4double kinEnergy, const G4ParticleDefinition*,
const G4String& processName, const G4Material*,
G4double cut = 0.0);
G4double ComputeMeanFreePath(
G4double kinEnergy, const G4String&, const G4String&,
const G4String& processName, G4double cut = 0.0);
const G4ParticleDefinition* FindParticle(const G4String&);
const G4Material* FindMaterial(const G4String&);
const G4Region* FindRegion(const G4String&);
const G4MaterialCutsCouple* FindCouple(const G4Material*, const G4Region* r = 0);
void SetVerbose(G4int val);
private:
G4bool UpdateParticle(const G4ParticleDefinition*, G4double kinEnergy);
G4bool UpdateCouple(const G4Material*, G4double cut);
void FindLambdaTable(const G4ParticleDefinition*, const G4String& processName);
G4bool FindEmModel(const G4ParticleDefinition*,
const G4String& processName,
G4double kinEnergy);
const G4VEnergyLossProcess* FindEnergyLossProcess(const G4ParticleDefinition*);
G4EmCalculator & operator=(const G4EmCalculator &right);
G4EmCalculator(const G4EmCalculator&);
std::vector<const G4Material*> localMaterials;
std::vector<const G4MaterialCutsCouple*> localCouples;
G4LossTableManager* manager;
G4DataVector localCuts;
G4int nLocalMaterials;
G4int verbose;
// cash
G4int currentCoupleIndex;
const G4MaterialCutsCouple* currentCouple;
const G4Material* currentMaterial;
const G4ParticleDefinition* currentParticle;
const G4ParticleDefinition* baseParticle;
const G4PhysicsTable* currentLambda;
G4VEmModel* currentModel;
G4ionEffectiveCharge* ionEffCharge;
G4String currentName;
G4double currentCut;
G4double chargeSquare;
G4double massRatio;
G4bool isIon;
G4bool isApplicable;
G4String currentParticleName;
G4String currentMaterialName;
};
//....oooOO0OOooo.......oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -21,7 +21,7 @@
// ********************************************************************
//
// $Id: G4EmModelManager.hh,v 1.13 2003/11/03 19:37:59 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// -------------------------------------------------------------------
//
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4EmMultiModel.hh,v 1.1 2004/05/03 13:13:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
// $Id: G4EmMultiModel.hh,v 1.2 2004/10/25 13:34:48 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// -------------------------------------------------------------------
//
@@ -63,7 +63,7 @@ public:
G4EmMultiModel(const G4String& nam = "MultiModel");
~G4EmMultiModel();
virtual ~G4EmMultiModel();
void Initialise(const G4ParticleDefinition*, const G4DataVector&);
@@ -21,7 +21,7 @@
// ********************************************************************
//
// $Id: G4EmProcessOptions.hh,v 1.2 2004/05/17 09:46:55 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// -------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4EnergyLossMessenger.hh,v 1.8 2003/10/13 10:49:17 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// Class Description:
@@ -22,7 +22,7 @@
//
//
// $Id: G4EnergyLossTables.hh,v 1.18 2003/07/23 11:36:25 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// $Id:
//
@@ -1,107 +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: G4IonFluctuations.hh,v 1.6 2003/10/16 13:06:40 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4IonFluctuations
//
// Author: Vladimir Ivanchenko
//
// Creation date: 02.04.2003
//
// Modifications:
//
// 16-10-03 Changed interface to Initialisation (V.Ivanchenko)
//
// Class Description:
//
// Implementation of ion energy loss fluctuations
// -------------------------------------------------------------------
//
#ifndef G4IonFluctuations_h
#define G4IonFluctuations_h 1
#include "G4VEmFluctuationModel.hh"
class G4IonFluctuations : public G4VEmFluctuationModel
{
public:
G4IonFluctuations(const G4String& nam = "IonFluc");
~G4IonFluctuations();
G4double SampleFluctuations(const G4Material*,
const G4DynamicParticle*,
G4double&,
G4double&,
G4double&);
G4double Dispersion( const G4Material*,
const G4DynamicParticle*,
G4double&,
G4double&);
void InitialiseMe(const G4ParticleDefinition*);
private:
G4double CoeffitientA(G4double&);
G4double CoeffitientB(const G4Material*, G4double&);
G4double RelativisticFactor(const G4Material*, G4double&);
// hide assignment operator
G4IonFluctuations & operator=(const G4IonFluctuations &right);
G4IonFluctuations(const G4IonFluctuations&);
const G4ParticleDefinition* particle;
G4double particleMass;
G4double charge;
G4double chargeSquare;
G4double chargeSqRatio;
// data members to speed up the fluctuation calculation
G4double minNumberInteractionsBohr;
G4double theBohrBeta2;
G4double minFraction;
G4double xmin;
G4double minLoss;
// cash
G4double kineticEnergy;
G4double beta2;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4LossTableBuilder.hh,v 1.3 2003/07/21 12:52:06 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4LossTableBuilder.hh,v 1.4 2004/11/10 08:54:59 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// -------------------------------------------------------------------
@@ -36,6 +36,7 @@
// Creation date: 03.01.2002
//
// Modifications:
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
//
//
// Class Description:
@@ -53,7 +54,7 @@
#include "G4PhysicsTable.hh"
class G4LossTableBuilder
class G4LossTableBuilder
{
public:
@@ -62,12 +63,12 @@ public:
~G4LossTableBuilder() {};
G4PhysicsTable* BuildDEDXTable(const std::vector<G4PhysicsTable*>&);
void BuildDEDXTable(G4PhysicsTable* dedxTable, const std::vector<G4PhysicsTable*>&);
G4PhysicsTable* BuildRangeTable(const G4PhysicsTable* dedxTable);
void BuildRangeTable(const G4PhysicsTable* dedxTable, G4PhysicsTable* rangeTable);
G4PhysicsTable* BuildInverseRangeTable(const G4PhysicsTable* dedxTable,
const G4PhysicsTable* rangeTable);
void BuildInverseRangeTable(const G4PhysicsTable* rangeTable,
G4PhysicsTable* invRangeTable);
private:
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4LossTableManager.hh,v 1.24 2004/05/12 12:25:26 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
// $Id: G4LossTableManager.hh,v 1.26 2004/11/10 08:54:59 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// -------------------------------------------------------------------
@@ -49,6 +49,7 @@
// 17-10-03 Add SetParameters method (V.Ivanchenko)
// 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)
//
// Class Description:
//
@@ -130,11 +131,13 @@ public:
void DeRegister(G4VEmProcess* p);
void EnergyLossProcessIsInitialised(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess* p);
void RegisterIon(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess* p);
void BuildPhysicsTable(const G4ParticleDefinition* aParticle);
void RegisterExtraParticle(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess* p);
void RetrievePhysicsTables(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess* em);
void BuildPhysicsTable(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess* p);
void SetLossFluctuations(G4bool val);
@@ -168,7 +171,7 @@ public:
G4EnergyLossMessenger* GetMessenger();
G4bool IsRecalcNeeded(const G4ParticleDefinition* aParticle);
G4bool BuildPreciseRange() const;
const std::vector<G4VEnergyLossProcess*>& GetEnergyLossProcessVector();
@@ -180,14 +183,16 @@ private:
G4LossTableManager();
void Initialise();
G4VEnergyLossProcess* BuildTables(const G4ParticleDefinition* aParticle);
void CopyTables(const G4ParticleDefinition* aParticle, G4VEnergyLossProcess*);
void ParticleHaveNoLoss(const G4ParticleDefinition* aParticle);
void SetParameters(G4VEnergyLossProcess*);
void CopyDEDXTables();
private:
static G4LossTableManager* theInstance;
@@ -214,7 +219,6 @@ private:
G4bool all_tables_are_built;
G4bool first_entry;
G4bool electron_table_are_built;
G4bool lossFluctuationFlag;
G4bool subCutoffFlag;
G4bool rndmStepFlag;
@@ -234,7 +238,7 @@ private:
G4double maxKinEnergy;
G4double maxKinEnergyForMuons;
G4VEnergyLossProcess* eIonisation;
//G4VEnergyLossProcess* eIonisation;
G4LossTableBuilder* tableBuilder;
G4EnergyLossMessenger* theMessenger;
const G4ParticleDefinition* firstParticle;
@@ -1,189 +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: G4MscModel.hh,v 1.11 2004/04/29 18:40:52 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
//
// GEANT4 Class header file
//
//
// File name: G4MscModel
//
// Author: Laszlo Urban
//
// Creation date: 01.03.2001
//
// Modifications:
//
// 27-03-03 Move model part from G4MultipleScattering (V.Ivanchenko)
// 27-03-03 Rename (V.Ivanchenko)
//
// 05-08-03 angle distribution has been modified (L.Urban)
// 26-11-03 new data member currentRange (L.Urban)
// 01-03-04 changes in data members + signature changed in SampleCosineTheta
// 11-03-04 changes in data members (L.Urban)
// 23-04-04 changes in data members and in signature of SampleCosineTheta
// (L.Urban)
//
// Class Description:
//
// Implementation of the model of multiple scattering based on
// H.W.Lewis Phys Rev 78 (1950) 526 and L.Urban model
// -------------------------------------------------------------------
//
#ifndef G4MscModel_h
#define G4MscModel_h 1
#include "G4VEmModel.hh"
class G4MscModel : public G4VEmModel
{
public:
G4MscModel(G4double&, G4double&, G4double&, G4double&, G4bool&,
const G4String& nam = "MscUni");
~G4MscModel();
void Initialise(const G4ParticleDefinition*, const G4DataVector&);
G4double HighEnergyLimit(const G4ParticleDefinition*) {return highKinEnergy;};
G4double LowEnergyLimit(const G4ParticleDefinition*) {return lowKinEnergy;};
void SetHighEnergyLimit(G4double e) {highKinEnergy = e;};
void SetLowEnergyLimit(G4double e) {lowKinEnergy = e;};
G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*) {return 0.0;};
G4bool IsInCharge(const G4ParticleDefinition*);
G4double ComputeDEDX(const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double,
G4double) {return 0.0;};
G4double CrossSection(const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy,
G4double maxEnergy);
G4DynamicParticle* SampleSecondary(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double,
G4double) {return 0;};
std::vector<G4DynamicParticle*>* SampleSecondaries(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double,
G4double) {return 0;};
G4double GeomPathLength(G4PhysicsTable* theLambdaTable,
const G4MaterialCutsCouple* couple,
const G4ParticleDefinition* particle,
G4double& kineticEnergy,
G4double lambda,
G4double range,
G4double truePathLength);
G4double TrueStepLength(G4double geomStepLength);
G4double SampleCosineTheta(G4double trueStepLength,G4double KineticEnergy);
G4double SampleDisplacement();
G4double MaxSecondaryEnergy(const G4DynamicParticle*) {return 0.0;};
void SetDynamicParticle(const G4DynamicParticle*);
protected:
G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double) {return 0.0;};
private:
G4double ComputeTransportCrossSection(
const G4ParticleDefinition* particle,
G4double KineticEnergy,
G4double AtomicNumber,
G4double AtomicWeight);
// hide assignment operator
G4MscModel & operator=(const G4MscModel &right);
G4MscModel(const G4MscModel&);
const G4ParticleDefinition* particle;
G4double mass;
G4double charge;
G4double massRate;
G4double highKinEnergy;
G4double lowKinEnergy;
G4double taubig;
G4double tausmall;
G4double taulim;
G4double currentTau;
G4double dtrl;
G4double NuclCorrPar;
G4double FactPar;
G4double facxsi;
G4double sigmafactor;
G4double b;
G4double xsi;
G4double lambda0;
G4double tPathLength;
G4double par1,par2,par3 ;
G4bool samplez;
G4double stepmin ;
G4double currentKinEnergy;
G4double currentRange ;
G4double currentRadLength;
};
inline void G4MscModel::SetDynamicParticle(const G4DynamicParticle* dp)
{
particle = dp->GetDefinition();
mass = dp->GetMass();
charge = dp->GetCharge()/eplus;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -1,143 +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: G4MultipleScattering.hh,v 1.17 2003/08/08 11:31:24 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
//------------- G4MultipleScattering physics process --------------------------
// by Laszlo Urban, March 2001
//
// 07-08-01 new methods Store/Retrieve PhysicsTable
// 23-08-01 new angle and z distribution,energy dependence reduced,
// Store,Retrieve methods commented out temporarily, L.Urban
// 11-09-01 G4MultipleScatteringx put as default: G4MultipleScattering
// Store,Retrieve methods reactived (mma)
// 13-09-01 Unused TrueToGeomTransformation method deleted,
// class description (L.Urban)
// 19-09-01 come back to previous process name msc
// 17-04-02 NEW angle distribution + boundary algorithm modified, L.Urban
// 22-04-02 boundary algorithm modified -> important improvement in timing !!!!
// (L.Urban)
// 24-05-02 changes in data members, L.Urban
// 30-10-02 changes in data members, L.Urban
// 20-01-03 Migrade to cut per region (V.Ivanchenko)
// 05-02-03 changes in data members, L.Urban
// 28-03-03 Move to model design (V.Ivanchenko)
// 18-04-03 Change name (V.Ivanchenko)
// 16-06-03: ShortLived are not applicable any more (V.Ivanchenko)
//
//------------------------------------------------------------------------------
//
// $Id: G4MultipleScattering.hh,v 1.17 2003/08/08 11:31:24 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// class description
//
// The class simulates the multiple scattering for any kind
// of charged particle.
//
// class description - end
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4MultipleScattering_h
#define G4MultipleScattering_h 1
#include "G4VMultipleScattering.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4MultipleScattering : public G4VMultipleScattering
{
public: // with description
G4MultipleScattering(const G4String& processName="msc");
~G4MultipleScattering();
G4bool IsApplicable (const G4ParticleDefinition& p)
{return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());};
// returns true for charged particles, false otherwise
void InitialiseProcess(const G4ParticleDefinition&);
// This function initialise models
G4double TruePathLengthLimit(const G4Track& track,
G4double& lambda,
G4double currentMinimalStep);
void PrintInfoDefinition();
// Print few lines of informations about the process: validity range,
void Setsamplez(G4bool value) {samplez = value;};
// geom. step length distribution should be sampled or not
void Setdtrl(G4double value) {dtrl = value;};
// to reduce the energy/step dependence
void Setfacxsi(G4double value) {facxsi = value;}
void SetFacrange(G4double val) {facrange=val;
nsmallstep = G4int(log((cf+facrange-1.)/facrange)/log(cf))+1;}
// Steplimit after boundary crossing = facrange*range
// estimated nb of steps at boundary nsmallstep = 1/facrange
void SetNuclCorrPar(G4double val) {NuclCorrPar = val;};
void SetFactPar(G4double val) {FactPar = val;};
// corrs to transport cross section for high energy
private:
// hide assignment operator as private
G4MultipleScattering & operator = (const G4MultipleScattering &right);
G4MultipleScattering ( const G4MultipleScattering &);
private: // data members
G4double lowKineticEnergy;
G4double highKineticEnergy;
G4int totBins;
G4double facrange;
G4double tlimit;
G4double tlimitmin;
G4double dtrl;
G4double NuclCorrPar;
G4double FactPar;
G4double facxsi;
G4double cf;
G4int stepnolastmsc;
G4int nsmallstep;
G4bool samplez;
G4bool boundary;
};
#endif
@@ -1,237 +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: G4MultipleScattering52.hh,v 1.2 2003/09/25 04:29:07 kurasige Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//------------- G4MultipleScattering52 physics process --------------------------
// by Laszlo Urban, March 2001
//
// 07-08-01 new methods Store/Retrieve PhysicsTable
// 23-08-01 new angle and z distribution,energy dependence reduced,
// Store,Retrieve methods commented out temporarily, L.Urban
// 11-09-01 G4MultipleScatteringx put as default: G4MultipleScattering
// Store,Retrieve methods reactived (mma)
// 13-09-01 Unused TrueToGeomTransformation method deleted,
// class description (L.Urban)
// 19-09-01 come back to previous process name msc
// 17-04-02 NEW angle distribution + boundary algorithm modified, L.Urban
// 22-04-02 boundary algorithm modified -> important improvement in timing !!!!
// (L.Urban)
// 24-04-02 some minor changes in boundary algorithm, L.Urban
// 24-05-02 changes in data members, L.Urban
// 30-10-02 changes in data members, L.Urban
// 05-02-03 changes in data members, L.Urban
// 18-04-03 Change signature of GetTransportMeanFreePath (V.Ivanchenko)
// 08-08-03 This class is frozen at the release 5.2 (V.Ivanchenko)
//------------------------------------------------------------------------------
// class description
//
// The class simulates the multiple scattering for any kind
// of charged particle.
//
// class description - end
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4MultipleScattering52_h
#define G4MultipleScattering52_h 1
#include "G4VContinuousDiscreteProcess.hh"
#include "G4EnergyLossTables.hh"
#include "G4GPILSelection.hh"
#include "G4PhysicsLogVector.hh"
#include "G4VPhysicalVolume.hh"
#include "G4ParticleChangeForMSC.hh"
#include "G4UnitsTable.hh"
#include "G4MaterialCutsCouple.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4MultipleScattering52 : public G4VContinuousDiscreteProcess
{
public: // with description
G4MultipleScattering52(const G4String& processName="msc");
~G4MultipleScattering52();
G4bool IsApplicable ( const G4ParticleDefinition& );
// returns true for charged particles, false otherwise
void BuildPhysicsTable(const G4ParticleDefinition& aParticleType);
// This function overloads the corresponding virtual function
// of the base class G4VContinuousDiscreteProcess.
// It is invoked by the G4ParticleWithCuts()::SetCut() method.
// It prepares the table of the transport mean free paths
// for every material.
void PrintInfoDefinition();
// Print few lines of informations about the process: validity range,
// origine ..etc..
// Invoked by BuildPhysicsTable().
G4bool StorePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// store TransportMeanFreePath tables into an external file
// specified by 'directory' (must exist before invokation)
G4bool RetrievePhysicsTable(G4ParticleDefinition* ,
const G4String& directory, G4bool);
// retrieve TransportMeanFreePath tables from an external file
// specified by 'directory'
G4double AlongStepGetPhysicalInteractionLength(const G4Track&,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety,
G4GPILSelection* selection);
// The function overloads the corresponding function of the base
// class.It limits the step near to boundaries only
// and invokes the method GetContinuousStepLimit at every step.
G4double GetContinuousStepLimit(const G4Track& aTrack,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety);
// It performs the true step length --> geometrical step length
// transformation. It is invoked by the
// AlongStepGetPhysicalInteractionLength method.
G4double GetMeanFreePath(const G4Track& aTrack,
G4double previousStepSize,
G4ForceCondition* condition);
// It sets the force condition to true only
// in order to have the PostStepDoIt called at every step.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
G4double GetTransportMeanFreePath(
G4double KineticEnergy,const G4MaterialCutsCouple* couple);
// Just a utility method to get the values of the transport
// mean free path . (It is not used inside the class.)
G4VParticleChange* AlongStepDoIt(const G4Track& aTrack,const G4Step& aStep);
// The geometrical step length --> true path length transformation
// is performed here (the inverse of the transformation done
// by GetContinuousStepLimit).
G4VParticleChange* PostStepDoIt(const G4Track& aTrack,const G4Step& aStep);
// It computes the final state of the particle: samples the
// scattering angle and computes the lateral displacement.
// The final state is returned as a ParticleChange object.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
void Setsamplez(G4bool value) {samplez = value;};
// geom. step length distribution should be sampled or not
void Setdtrl(G4double value) {dtrl = value;};
// to reduce the energy/step dependence
void SetBoundary(G4bool value) {boundary = value;};
void Setfacxsi(G4double value) {facxsi = value;
G4cout << " facxsi=" << facxsi << G4endl;};
void SetFacrange(G4double val) {facrange=val;
nsmallstep = G4int(log((cf+facrange-1.)/
facrange)/log(cf))+1 ;
G4cout << " fr=" << facrange
<< " nsmall=" << nsmallstep << G4endl ;};
// Steplimit after boundary crossing = facrange*range
// estimated nb of steps at boundary nsmallstep = 1/facrange
void SetLateralDisplacementFlag(G4bool flag) {fLatDisplFlag = flag;};
// lateral displacement to be/not to be computed
void SetNuclCorrPar(G4double val) {NuclCorrPar = val;};
void SetFactPar(G4double val) {FactPar = val;};
protected: // with description
virtual G4double ComputeTransportCrossSection(
const G4ParticleDefinition& aParticleType,
G4double KineticEnergy,
G4double AtomicNumber,
G4double AtomicWeight);
// It computes the transport cross section.
// The transport mean free path is 1/(transport cross section).
private:
// hide assignment operator as private
G4MultipleScattering52 & operator = (const G4MultipleScattering52 &right);
G4MultipleScattering52 ( const G4MultipleScattering52 &);
private: // data members
G4PhysicsTable* theTransportMeanFreePathTable;
G4double taubig,tausmall,taulim;
G4double LowestKineticEnergy;
G4double HighestKineticEnergy;
G4int TotBin;
G4int materialIndex;
G4double tLast;
G4double zLast;
// model parameters
G4bool boundary; // spec. handling near boundaries
G4double facrange,tlimit,tlimitmin,cf;
G4int stepno,stepnolastmsc,nsmallstep ;
G4double laststep ;
G4GPILSelection valueGPILSelectionMSC;
G4double zmean; // z(geom.step length)
G4bool samplez ; // distribution
G4double range,T0,T1,lambda0,lambda1, // used to reduce the energy
Tlow,alam,blam,dtrl,lambdam, // (or step length) dependence
clam,zm,cthm;
// with/without lateral displacement
G4bool fLatDisplFlag;
// nuclear size effect correction
G4double NuclCorrPar;
G4double FactPar;
G4ParticleChangeForMSC fParticleChange;
G4double alfa1,alfa2,alfa3,b,xsi,c0,facxsi ; // angle distr. parameters
// facxsi : some tuning
// possibility in the tail
};
#include "G4MultipleScattering52.icc"
#endif
@@ -1,97 +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: G4MultipleScattering52.icc,v 1.1 2003/08/08 11:31:24 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//------------ G4MultipleScattering52 physics process ---------------------------
// by Laszlo Urban, March 2001
//
// Modified:
//
// 18-05-01 V.Ivanchenko Clean up against Linux ANSI compilation
// 23-08-01 new angle and z distribution,energy dependence reduced,
// Store,Retrieve methods commented out temporarily, L.Urban
// 27-08-01 bugfix in AlongStepDoIt, L.Urban
// 28-08-01 GetContinuousStepLimit and AlongStepDoIt moved to .cc file (mma)
// 11-09-01 G4MultipleScatteringx put as default: G4MultipleScattering (mma)
// 15-01-03 Migrade to cut per region (V.Ivanchenko)
// 18-04-03 Change signature of GetTransportMeanFreePath (V.Ivanchenko)
// 16-06-03: ShortLived are not applicable any more (V.Ivanchenko)
// 08-08-03 This class is frozen at the release 5.2 (V.Ivanchenko)
//
//------------------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4bool G4MultipleScattering52::IsApplicable(const G4ParticleDefinition& particle)
{
return(particle.GetPDGCharge() != 0. && !particle.IsShortLived());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4MultipleScattering52::AlongStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety,
G4GPILSelection* selection)
{
// get Step limit proposed by the process
G4double steplength = GetContinuousStepLimit(track,previousStepSize,
currentMinimumStep,currentSafety);
// set return value for G4GPILSelection
*selection = valueGPILSelectionMSC;
return steplength;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline G4double G4MultipleScattering52::GetMeanFreePath(
const G4Track&,
G4double,
G4ForceCondition* condition)
// it does not limit the Step size , but it sets condition to
// Forced , because the PostStepDoIt always has to be called
{
*condition = Forced;
return DBL_MAX;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4double G4MultipleScattering52::GetTransportMeanFreePath(G4double KineticEnergy,
const G4MaterialCutsCouple* couple)
{
G4bool isOut;
return (*theTransportMeanFreePathTable)
(couple->GetIndex())->GetValue(KineticEnergy,isOut);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -1,124 +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: G4SCProcessorStand.hh,v 1.7 2003/07/21 12:52:06 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4SCProcessorStand
//
// 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)
// 27-01-03 Make models region aware (V.Ivanchenko)
// 13-02-03 Add name (V.Ivanchenko)
//
// Class Description:
//
// Class for simualtion of subCutoff
// -------------------------------------------------------------------
//
#ifndef G4SCProcessorStand_h
#define G4SCProcessorStand_h 1
#include "G4VSubCutoffProcessor.hh"
#include "G4PhysicsTable.hh"
#include "G4DataVector.hh"
class G4Navigator;
class G4MaterialCutsCouple;
class G4SCProcessorStand : public G4VSubCutoffProcessor
{
public:
G4SCProcessorStand(const G4String& nam = "ProcSTD");
~G4SCProcessorStand();
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*);
virtual G4PhysicsTable* LambdaSubTable();
protected:
private:
// hide assignment operator
G4SCProcessorStand & operator=(const G4SCProcessorStand &right);
G4SCProcessorStand(const G4SCProcessorStand&);
G4PhysicsTable* theLambdaSubTable;
const G4ParticleDefinition* particle;
const G4ParticleDefinition* secondaryParticle;
const G4ParticleDefinition* thePositron;
G4Navigator* navigator;
const G4DataVector* theCuts;
const G4DataVector* theSubCuts;
// cash
G4double initialMass;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4SCProcessorStand::SetLambdaSubTable(G4PhysicsTable* table)
{
if(theLambdaSubTable) theLambdaSubTable->clearAndDestroy();
theLambdaSubTable = table;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4SCProcessorStand::LambdaSubTable()
{
return theLambdaSubTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -21,7 +21,7 @@
// ********************************************************************
//
// $Id: G4VEmFluctuationModel.hh,v 1.7 2003/10/16 13:06:40 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// -------------------------------------------------------------------
//
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VEmModel.hh,v 1.19 2004/04/29 18:40:52 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
// $Id: G4VEmModel.hh,v 1.22 2004/11/17 10:11:25 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// -------------------------------------------------------------------
//
@@ -44,6 +44,7 @@
// calculation (V.Ivanchenko)
// 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)
//
//
// Class Description:
@@ -60,6 +61,7 @@
#include "G4DynamicParticle.hh"
#include "G4ParticleDefinition.hh"
#include "G4MaterialCutsCouple.hh"
#include "G4Material.hh"
#include "G4DataVector.hh"
class G4PhysicsTable;
@@ -100,6 +102,11 @@ public:
G4double cutEnergy,
G4double maxEnergy) = 0;
virtual G4double ComputeCrossSectionPerAtom(
const G4ParticleDefinition*,
G4double&, G4double&, G4double&, G4double)
{return 0.0;};
virtual G4DynamicParticle* SampleSecondary(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VEmProcess.hh,v 1.4 2004/05/17 09:46:56 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
// $Id: G4VEmProcess.hh,v 1.15 2004/11/10 08:54:59 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// -------------------------------------------------------------------
//
@@ -35,11 +35,16 @@
// Creation date: 01.10.2003
//
// Modifications:
//
// 30-06-04 make destructor virtual (V.Ivanchenko)
// 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)
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
//
// Class Description:
//
// It is the unified Rest and/or Discrete process
// It is the unified Discrete process
// -------------------------------------------------------------------
//
@@ -47,7 +52,7 @@
#ifndef G4VEmProcess_h
#define G4VEmProcess_h 1
#include "G4VRestDiscreteProcess.hh"
#include "G4VDiscreteProcess.hh"
#include "globals.hh"
#include "G4Material.hh"
#include "G4MaterialCutsCouple.hh"
@@ -55,10 +60,10 @@
#include "G4EmModelManager.hh"
#include "G4UnitsTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleChangeForLoss.hh"
class G4Step;
class G4VEmModel;
class G4VEmFluctuationModel;
class G4DataVector;
class G4VParticleChange;
class G4PhysicsTable;
@@ -66,50 +71,36 @@ class G4PhysicsVector;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G4VEmProcess : public G4VRestDiscreteProcess
class G4VEmProcess : public G4VDiscreteProcess
{
public:
G4VEmProcess(const G4String& name,
G4ProcessType type = fElectromagnetic);
~G4VEmProcess();
virtual ~G4VEmProcess();
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
virtual G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
G4double GetMeanLifeTime(const G4Track& aTrack,
G4ForceCondition* condition);
// It is invoked by the ProcessManager of the Positron if this
// e+ has a kinetic energy null. Then it return 0 to force the
// call of AtRestDoIt.
// This function overloads a virtual function of the base class.
virtual G4VParticleChange* AtRestDoIt(const G4Track& aTrack,
const G4Step& aStep);
// It computes the final state of the process:
// e+ (at rest) e- (at rest) ---> gamma gamma,
// returned as a ParticleChange object.
// This function overloads a virtual function of the base class.
// It is invoked by the ProcessManager of the Particle.
virtual void SecondariesPostStep(G4VEmModel*,
virtual std::vector<G4DynamicParticle*>* SecondariesPostStep(
G4VEmModel*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double& tcut,
G4double& kinEnergy) = 0;
const G4DynamicParticle*) = 0;
virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
// True for all charged particles
virtual void PreparePhysicsTable(const G4ParticleDefinition&);
// Initialise for build of tables
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
// Build physics table during initialisation
virtual void PrintInfoDefinition();
// Print out of the class parameters
G4PhysicsTable* BuildLambdaTable();
void SetLambdaBinning(G4int nbins);
G4int LambdaBinning() const;
// Binning for lambda table
void SetMinKinEnergy(G4double e);
@@ -120,74 +111,81 @@ public:
G4double MaxKinEnergy() const;
// Max kinetic energy for tables
G4bool StorePhysicsTable(G4ParticleDefinition*,
const G4String& directory,
G4bool ascii = false);
G4bool StorePhysicsTable(const G4ParticleDefinition*,
const G4String& directory,
G4bool ascii = false);
// Store PhysicsTable in a file.
// Return false in case of failure at I/O
G4bool RetrievePhysicsTable(G4ParticleDefinition*,
const G4String& directory,
G4bool ascii);
G4bool RetrievePhysicsTable(const G4ParticleDefinition*,
const G4String& directory,
G4bool ascii);
// Retrieve Physics from a file.
// (return true if the Physics Table can be build by using file)
// (return false if the process has no functionality or in case of failure)
// File name should is constructed as processName+particleName and the
// should be placed under the directory specifed by the argument.
void AddEmModel(G4int, G4VEmModel*, G4VEmFluctuationModel* fluc = 0,
const G4Region* region = 0);
// Add EM model coupled with fluctuation model for the region
void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
// Add EM model coupled for the region
void UpdateEmModel(const G4String&, G4double, G4double);
// Define new energy range for the model identified by the name
virtual G4double RecalculateLambda(G4double kinEnergy,
const G4MaterialCutsCouple* couple);
G4double GetLambda(G4double& kinEnergy, const G4MaterialCutsCouple* couple);
// It returns the Lambda of the process
const G4PhysicsTable* LambdaTable() const;
G4double MicroscopicCrossSection(G4double kineticEnergy,
const G4MaterialCutsCouple* couple);
// It returns the cross section of the process for energy/ material
void SetIntegral(G4bool val) {integral = val;};
G4bool IsIntegral() const {return integral;}
G4double MeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
G4double MeanFreePath( const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
const G4ParticleDefinition* Particle() const;
const G4ParticleDefinition* SecondaryParticle() const;
void ActivateFluorescence(G4bool, const G4Region* r = 0);
void ActivateAugerElectronProduction(G4bool, const G4Region* r = 0);
virtual void ActivateFluorescence(G4bool, const G4Region* r = 0);
virtual void ActivateAugerElectronProduction(G4bool, const G4Region* r = 0);
void SetLambdaFactor(G4double val);
G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idxRegion) const;
void SetIntegral(G4bool val);
G4bool IsIntegral() const;
protected:
virtual void InitialiseProcess(const G4ParticleDefinition*) = 0;
void SetParticle(const G4ParticleDefinition* p);
void SetSecondaryParticle(const G4ParticleDefinition* p);
virtual G4double GetMeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
virtual G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*);
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*,
const G4Material*, G4double cut) = 0;
virtual G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*) = 0;
G4VEmModel* SelectModel(G4double& kinEnergy);
size_t CurrentMaterialCutsCoupleIndex() const {return currentMaterialIndex;};
void ResetNumberOfInteractionLengthLeft();
// reset (determine the value of)NumberOfInteractionLengthLeft
void ResetNumberOfInteractionLengthLeft();
G4double GetGammaEnergyCut();
G4double GetElectronEnergyCut();
void SetBuildTableFlag(G4bool val);
private:
void Initialise();
void Clear();
void DefineMaterial(const G4MaterialCutsCouple* couple);
@@ -195,6 +193,10 @@ private:
void ComputeLambda(G4double kinEnergy);
void BuildLambdaTable();
void FindLambdaMax();
// hide assignment operator
G4VEmProcess(G4VEmProcess &);
@@ -202,38 +204,46 @@ private:
// =====================================================================
protected:
G4ParticleChangeForLoss fParticleChange;
private:
G4EmModelManager* modelManager;
G4EmModelManager* modelManager;
// tables and vectors
G4PhysicsTable* theLambdaTable;
G4double* theEnergyOfCrossSectionMax;
G4double* theCrossSectionMax;
G4PhysicsTable* theLambdaTable;
G4double* theEnergyOfCrossSectionMax;
G4double* theCrossSectionMax;
const G4ParticleDefinition* particle;
const G4ParticleDefinition* baseParticle;
const G4ParticleDefinition* secondaryParticle;
const G4DataVector* theCuts;
const G4ParticleDefinition* particle;
const G4ParticleDefinition* secondaryParticle;
const std::vector<G4double>* theCutsGamma;
const std::vector<G4double>* theCutsElectron;
const std::vector<G4double>* theCutsPositron;
G4int nLambdaBins;
G4double minKinEnergy;
G4double maxKinEnergy;
G4double lambdaFactor;
// cash
const G4Material* currentMaterial;
const G4MaterialCutsCouple* currentCouple;
size_t currentMaterialIndex;
const G4Material* currentMaterial;
const G4MaterialCutsCouple* currentCouple;
size_t currentMaterialIndex;
G4int nLambdaBins;
G4double mfpKinEnergy;
G4double preStepKinEnergy;
G4double preStepLambda;
G4double preStepMFP;
G4double minKinEnergy;
G4double maxKinEnergy;
G4double lambdaFactor;
G4double preStepLambda;
G4double preStepMFP;
G4double preStepKinEnergy;
G4double mfpKinEnergy;
G4bool integral;
G4bool meanFreePath;
G4bool integral;
G4bool meanFreePath;
G4bool aboveCSmax;
G4bool buildLambdaTable;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -245,8 +255,7 @@ inline void G4VEmProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
currentCouple = couple;
currentMaterial = couple->GetMaterial();
currentMaterialIndex = couple->GetIndex();
if(integral && (!meanFreePath || preStepKinEnergy < mfpKinEnergy))
ResetNumberOfInteractionLengthLeft();
if(!meanFreePath) ResetNumberOfInteractionLengthLeft();
}
}
@@ -258,11 +267,20 @@ inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,
DefineMaterial(couple);
G4double x = 0.0;
if(theLambdaTable) x = GetLambda(kineticEnergy);
else x = RecalculateLambda(kineticEnergy, couple);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEmProcess::RecalculateLambda(
G4double, const G4MaterialCutsCouple*)
{
return 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEmProcess::GetLambda(G4double e)
{
G4bool b;
@@ -274,24 +292,35 @@ inline G4double G4VEmProcess::GetLambda(G4double e)
inline void G4VEmProcess::ComputeLambda(G4double e)
{
meanFreePath = false;
mfpKinEnergy = 0.0;
G4double emax = theEnergyOfCrossSectionMax[currentMaterialIndex];
if (e <= emax) preStepLambda = GetLambda(e);
else {
e *= lambdaFactor;
if(e > emax) {
mfpKinEnergy = e;
preStepLambda = GetLambda(e);
} else preStepLambda = theCrossSectionMax[currentMaterialIndex];
aboveCSmax = false;
mfpKinEnergy = theEnergyOfCrossSectionMax[currentMaterialIndex];
if (e <= mfpKinEnergy) {
preStepLambda = GetLambda(e);
} else {
aboveCSmax = true;
G4double e1 = e*lambdaFactor;
if(e1 > mfpKinEnergy) {
preStepLambda = GetLambda(e);
G4double preStepLambda1 = GetLambda(e1);
if(preStepLambda1 > preStepLambda) {
mfpKinEnergy = e1;
preStepLambda = preStepLambda1;
}
} else {
preStepLambda = theCrossSectionMax[currentMaterialIndex];
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEmProcess::GetMeanFreePath(const G4Track& track, G4double,
G4ForceCondition*)
inline G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,
G4double,
G4ForceCondition* condition)
{
*condition = NotForced;
preStepKinEnergy = track.GetKineticEnergy();
if(aboveCSmax && preStepKinEnergy < mfpKinEnergy) ResetNumberOfInteractionLengthLeft();
DefineMaterial(track.GetMaterialCutsCouple());
if (meanFreePath) {
if (integral) ComputeLambda(preStepKinEnergy);
@@ -299,20 +328,12 @@ inline G4double G4VEmProcess::GetMeanFreePath(const G4Track& track, G4double,
if(0.0 < preStepLambda) preStepMFP = 1.0/preStepLambda;
else preStepMFP = DBL_MAX;
}
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<<" mfp= "<<preStepMFP<<G4endl;
//G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<< " eCSmax= " <<mfpKinEnergy<< " mfp= "<<preStepMFP<<G4endl;
return preStepMFP;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEmProcess::ResetNumberOfInteractionLengthLeft()
{
meanFreePath = true;
G4VProcess::ResetNumberOfInteractionLengthLeft();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy)
{
return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
@@ -320,6 +341,23 @@ inline G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VEmModel* G4VEmProcess::SelectModelForMaterial(
G4double kinEnergy, size_t& idxRegion) const
{
return modelManager->SelectModel(kinEnergy, idxRegion);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEmProcess::ResetNumberOfInteractionLengthLeft()
{
meanFreePath = true;
aboveCSmax = false;
G4VProcess::ResetNumberOfInteractionLengthLeft();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline const G4ParticleDefinition* G4VEmProcess::Particle() const
{
return particle;
@@ -334,20 +372,26 @@ inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEmProcess::GetMeanLifeTime(const G4Track&,
G4ForceCondition*)
inline G4double G4VEmProcess::GetGammaEnergyCut()
{
return 0.0;
return (*theCutsGamma)[currentMaterialIndex];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VParticleChange* G4VEmProcess::AtRestDoIt(const G4Track&,
const G4Step&)
inline G4double G4VEmProcess::GetElectronEnergyCut()
{
return 0;
return (*theCutsElectron)[currentMaterialIndex];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEmProcess::SetBuildTableFlag(G4bool val)
{
buildLambdaTable = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: G4VEnergyLoss.hh,v 1.17 2003/03/25 13:36:57 maire Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// ------------------------------------------------------------
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VEnergyLossProcess.hh,v 1.21 2004/05/17 09:46:56 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
// $Id: G4VEnergyLossProcess.hh,v 1.34 2004/12/01 18:01:01 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
// -------------------------------------------------------------------
//
@@ -50,6 +50,13 @@
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
// 14-01-04 Activate precise range calculation (V.Ivanchenko)
// 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)
// 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.Ivantchenko)
//
// Class Description:
//
@@ -93,9 +100,7 @@ public:
G4VEnergyLossProcess(const G4String& name = "EnergyLoss",
G4ProcessType type = fElectromagnetic);
~G4VEnergyLossProcess();
void Initialise();
virtual ~G4VEnergyLossProcess();
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
@@ -115,26 +120,24 @@ public:
G4double& kinEnergy) = 0;
virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
// True for all charged particles
// True for all charged particles
virtual void PreparePhysicsTable(const G4ParticleDefinition&);
// Initialise for build of tables
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
// Build physics table during initialisation
virtual void PrintInfoDefinition();
// Print out of the class parameters
G4PhysicsTable* BuildDEDXTable();
G4PhysicsTable* BuildDEDXTableForPreciseRange();
G4PhysicsTable* BuildLambdaTable();
G4PhysicsTable* BuildLambdaSubTable();
// Build tables
void SetParticle(const G4ParticleDefinition* p);
void SetBaseParticle(const G4ParticleDefinition* p);
void SetSecondaryParticle(const G4ParticleDefinition* p);
const G4ParticleDefinition* Particle() const;
const G4ParticleDefinition* BaseParticle() const;
@@ -161,15 +164,15 @@ public:
void SetMaxKinEnergyForPreciseRange(G4double e);
// Max kinetic energy for tables
G4bool StorePhysicsTable(G4ParticleDefinition*,
const G4String& directory,
G4bool ascii = false);
G4bool StorePhysicsTable(const G4ParticleDefinition*,
const G4String& directory,
G4bool ascii = false);
// Store PhysicsTable in a file.
// Return false in case of failure at I/O
G4bool RetrievePhysicsTable(G4ParticleDefinition*,
const G4String& directory,
G4bool ascii);
G4bool RetrievePhysicsTable(const G4ParticleDefinition*,
const G4String& directory,
G4bool ascii);
// Retrieve Physics from a file.
// (return true if the Physics Table can be build by using file)
// (return false if the process has no functionality or in case of failure)
@@ -195,6 +198,9 @@ public:
void SetDEDXTable(G4PhysicsTable* p);
G4PhysicsTable* DEDXTable() const;
void SetDEDXunRestrictedTable(G4PhysicsTable* p);
G4PhysicsTable* DEDXunRestrictedTable() const;
void SetPreciseRangeTable(G4PhysicsTable* pRange);
G4PhysicsTable* PreciseRangeTable() const;
@@ -212,16 +218,12 @@ 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);
// It returns the MeanFreePath of the process
G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple,
const G4DynamicParticle* dp,
@@ -229,29 +231,25 @@ public:
G4double MicroscopicCrossSection(G4double kineticEnergy,
const G4MaterialCutsCouple* couple);
// It returns the MeanFreePath of the process for a (energy, material)
void SetLinearLossLimit(G4double val);
void SetLossFluctuations(G4bool val);
void SetIntegral(G4bool val);
G4bool IsIntegral() const;
void SetRandomStep(G4bool val);
// Redefine parameteters for stepping control
//
void SetLinearLossLimit(G4double val);
void SetMinSubRange(G4double val);
void SetStepLimits(G4double v1, G4double v2);
void SetStepFunction(G4double v1, G4double v2);
void SetLambdaFactor(G4double val);
G4bool TablesAreBuilt() const;
G4int NumberOfSubCutoffRegions() const;
// Helper functions
G4double MeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
@@ -264,8 +262,26 @@ public:
void ResetNumberOfInteractionLengthLeft();
// reset (determine the value of)NumberOfInteractionLengthLeft
G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idx) const;
void SetIonisation(G4bool val);
G4bool IsIonisationProcess() const;
protected:
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*,
const G4Material*, G4double cut) = 0;
virtual G4double MaxSecondaryEnergy(const G4DynamicParticle* dp) = 0;
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*,
const G4ParticleDefinition*) = 0;
void SetParticle(const G4ParticleDefinition* p);
void SetSecondaryParticle(const G4ParticleDefinition* p);
virtual G4double GetMeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
@@ -275,9 +291,6 @@ protected:
G4double currentMinimumStep,
G4double& currentSafety);
virtual
const G4ParticleDefinition* DefineBaseParticle(const G4ParticleDefinition*);
virtual
G4PhysicsVector* DEDXPhysicsVector(const G4MaterialCutsCouple*);
@@ -290,44 +303,36 @@ protected:
virtual
G4PhysicsVector* SubLambdaPhysicsVector(const G4MaterialCutsCouple*);
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*,
const G4Material*, G4double cut) = 0;
virtual G4double MaxSecondaryEnergy(const G4DynamicParticle* dp) = 0;
G4VEmModel* SelectModel(G4double kinEnergy);
G4VSubCutoffProcessor* SubCutoffProcessor(size_t index);
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:
// Clear tables
void Clear();
void DefineMaterial(const G4MaterialCutsCouple* couple);
G4double GetDEDXForLoss(G4double kineticEnergy);
G4double GetRangeForLoss(G4double kineticEnergy);
G4double GetPreciseRange(G4double kineticEnergy);
G4double GetLambda(G4double scaledKinEnergy);
void ComputeLambda(G4double scaledKinEnergy);
// Returnd values for scaled energy and base particles mass
//
G4double GetDEDXForScaledEnergy(G4double scaledKinEnergy);
G4double GetScaledRangeForScaledEnergy(G4double scaledKinEnergy);
G4double GetLimitScaledRangeForScaledEnergy(G4double scaledKinEnergy);
G4double GetLambdaForScaledEnergy(G4double scaledKinEnergy);
G4double ScaledKinEnergyForLoss(G4double range);
void ComputeLambdaForScaledEnergy(G4double scaledKinEnergy);
// hide assignment operator
@@ -351,6 +356,7 @@ private:
// tables and vectors
G4PhysicsTable* theDEDXTable;
G4PhysicsTable* theRangeTableForLoss;
G4PhysicsTable* theDEDXunRestrictedTable;
G4PhysicsTable* thePreciseRangeTable;
G4PhysicsTable* theSecondaryRangeTable;
G4PhysicsTable* theInverseRangeTable;
@@ -403,10 +409,11 @@ private:
G4bool lossFluctuationFlag;
G4bool rndmStepFlag;
G4bool hasRestProcess;
G4bool tablesAreBuilt;
G4bool integral;
G4bool meanFreePath;
G4bool aboveCSmax;
G4bool isIonisation;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -420,8 +427,7 @@ inline void G4VEnergyLossProcess::DefineMaterial(const G4MaterialCutsCouple* cou
currentMaterialIndex = couple->GetIndex();
minStepLimit = std::min(finalRange,
currentCouple->GetProductionCuts()->GetProductionCut(idxG4ElectronCut));
if(integral && (!meanFreePath || preStepScaledEnergy < mfpKinEnergy))
ResetNumberOfInteractionLengthLeft();
if(!meanFreePath) ResetNumberOfInteractionLengthLeft();
}
}
@@ -431,17 +437,16 @@ inline G4double G4VEnergyLossProcess::GetDEDX(G4double& kineticEnergy,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
return GetDEDXForLoss(kineticEnergy);
return GetDEDXForScaledEnergy(kineticEnergy*massRatio);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetDEDXForLoss(G4double e)
inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
{
G4bool b;
e *= massRatio;
G4double x = ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
if(e < minKinEnergy) x *= sqrt(e/minKinEnergy);
if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
return x;
}
@@ -452,28 +457,29 @@ inline G4double G4VEnergyLossProcess::GetRange(G4double& kineticEnergy,
{
DefineMaterial(couple);
G4double x = DBL_MAX;
if(thePreciseRangeTable) x = GetPreciseRange(kineticEnergy);
else if(theRangeTableForLoss) x = GetRangeForLoss(kineticEnergy);
return x;
if(thePreciseRangeTable)
x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio);
else if(theRangeTableForLoss)
x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio);
return x*reduceFactor;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetPreciseRange(G4double e)
inline G4double G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(G4double e)
{
G4bool b;
G4double x;
e *= massRatio;
if (e < maxKinEnergyForRange) {
x = ((*thePreciseRangeTable)[currentMaterialIndex])->GetValue(e, b);
if(e < minKinEnergy) x *= sqrt(e/minKinEnergy);
if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
} else {
x = theRangeAtMaxEnergy[currentMaterialIndex] +
(e - maxKinEnergyForRange)/theDEDXAtMaxEnergy[currentMaterialIndex];
}
return x*reduceFactor;
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -483,19 +489,18 @@ inline G4double G4VEnergyLossProcess::GetRangeForLoss(G4double& kineticEnergy,
{
DefineMaterial(couple);
G4double x = DBL_MAX;
if(theRangeTableForLoss) x = GetRangeForLoss(kineticEnergy);
return x;
if(theRangeTableForLoss) x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio);
return x*reduceFactor;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetRangeForLoss(G4double e)
inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)
{
G4bool b;
e *= massRatio;
G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b);
if(e < minKinEnergy) x *= sqrt(e/minKinEnergy);
return x*reduceFactor;
if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -547,13 +552,13 @@ inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,
{
DefineMaterial(couple);
G4double x = 0.0;
if(theLambdaTable) x = GetLambda(kineticEnergy*massRatio);
if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetLambda(G4double e)
inline G4double G4VEnergyLossProcess::GetLambdaForScaledEnergy(G4double e)
{
G4bool b;
return chargeSqRatio*(((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));
@@ -561,36 +566,47 @@ inline G4double G4VEnergyLossProcess::GetLambda(G4double e)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::ComputeLambda(G4double e)
inline void G4VEnergyLossProcess::ComputeLambdaForScaledEnergy(G4double e)
{
meanFreePath = false;
mfpKinEnergy = 0.0;
G4double emax = theEnergyOfCrossSectionMax[currentMaterialIndex];
if (e <= emax) preStepLambda = GetLambda(e);
else {
e *= lambdaFactor;
if(e > emax) {
mfpKinEnergy = e;
preStepLambda = GetLambda(e);
} else preStepLambda = theCrossSectionMax[currentMaterialIndex];
aboveCSmax = false;
mfpKinEnergy = theEnergyOfCrossSectionMax[currentMaterialIndex];
if (e <= mfpKinEnergy) {
preStepLambda = GetLambdaForScaledEnergy(e);
} else {
aboveCSmax = true;
G4double e1 = e*lambdaFactor;
if(e1 > mfpKinEnergy) {
preStepLambda = GetLambdaForScaledEnergy(e);
G4double preStepLambda1 = GetLambdaForScaledEnergy(e1);
if(preStepLambda1 > preStepLambda) {
mfpKinEnergy = e1;
preStepLambda = preStepLambda1;
}
} else {
preStepLambda = chargeSqRatio*theCrossSectionMax[currentMaterialIndex];
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetMeanFreePath(const G4Track& track,
G4double, G4ForceCondition*)
G4double,
G4ForceCondition* condition)
{
*condition = NotForced;
preStepKinEnergy = track.GetKineticEnergy();
preStepScaledEnergy = preStepKinEnergy*massRatio;
if(aboveCSmax && preStepScaledEnergy < mfpKinEnergy) ResetNumberOfInteractionLengthLeft();
DefineMaterial(track.GetMaterialCutsCouple());
if (meanFreePath) {
if (integral) ComputeLambda(preStepScaledEnergy);
else preStepLambda = GetLambda(preStepScaledEnergy);
if (integral) ComputeLambdaForScaledEnergy(preStepScaledEnergy);
else preStepLambda = GetLambdaForScaledEnergy(preStepScaledEnergy);
if(0.0 < preStepLambda) preStepMFP = 1.0/preStepLambda;
else preStepMFP = DBL_MAX;
}
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<<" mfp= "<<preStepMFP<<G4endl;
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<< " eCSmax= " <<mfpKinEnergy<< " mfp= "<<preStepMFP<<G4endl;
return preStepMFP;
}
@@ -601,18 +617,18 @@ inline G4double G4VEnergyLossProcess::GetContinuousStepLimit(const G4Track&,
{
G4double x = DBL_MAX;
if(theRangeTableForLoss) {
fRange = GetRange(preStepKinEnergy, currentCouple);
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);
//if(x >fRange || x<minStepLimit) G4cout << "!!! StepLimit problem!!!" << G4endl;
//if(rndmStepFlag) x = minStepLimit + G4UniformRand()*(x-minStepLimit);
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<<" range= "<<fRange
// <<" cMinSt="<<currentMinStep <<" minStepLimit= " << minStepLimit<< G4endl;
}
}
//G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<<" stepLimit= "<<x<<G4endl;
return x;
}
@@ -621,6 +637,7 @@ inline G4double G4VEnergyLossProcess::GetContinuousStepLimit(const G4Track&,
inline void G4VEnergyLossProcess::ResetNumberOfInteractionLengthLeft()
{
meanFreePath = true;
aboveCSmax = false;
G4VProcess::ResetNumberOfInteractionLengthLeft();
}
@@ -634,6 +651,14 @@ inline G4VEmModel* G4VEnergyLossProcess::SelectModel(G4double kinEnergy)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial(
G4double kinEnergy, size_t& idx) const
{
return modelManager->SelectModel(kinEnergy, idx);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const
{
return particle;
@@ -663,43 +688,50 @@ inline G4VSubCutoffProcessor* G4VEnergyLossProcess::SubCutoffProcessor(size_t in
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
{
return theDEDXTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
{
return theDEDXunRestrictedTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::PreciseRangeTable() const
{
return thePreciseRangeTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const
inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const
{
return theRangeTableForLoss;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const
inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const
{
return theInverseRangeTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()
inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()
{
return theLambdaTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()
inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()
{
return theSubLambdaTable;
}
@@ -712,7 +744,7 @@ inline G4bool G4VEnergyLossProcess::IsIntegral() const
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const
{
return currentMaterialIndex;
@@ -720,7 +752,7 @@ inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetMassRatio(G4double val)
inline void G4VEnergyLossProcess::SetMassRatio(G4double val)
{
massRatio = val;
}
@@ -740,7 +772,7 @@ inline void G4VEnergyLossProcess::SetChargeSquare(G4double val)
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetChargeSquareRatio(G4double val)
{
chargeSqRatio = val;
@@ -748,7 +780,7 @@ inline void G4VEnergyLossProcess::SetChargeSquareRatio(G4double val)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetCurrentRange() const
inline G4double G4VEnergyLossProcess::GetCurrentRange() const
{
return fRange;
}
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VMultipleScattering.hh,v 1.19 2004/05/25 11:30:08 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
// $Id: G4VMultipleScattering.hh,v 1.25 2004/11/10 08:54:59 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// -------------------------------------------------------------------
//
@@ -46,6 +46,9 @@
//
// 26-11-03 bugfix in AlongStepDoIt (L.Urban)
// 25-05-04 add protection against case when range is less than steplimit (V.Ivanchenko)
// 30-06-04 make destructor virtual (V.Ivanchenko)
// 27-08-04 Add InitialiseForRun method (V.Ivanchneko)
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
// -------------------------------------------------------------------
//
@@ -79,11 +82,14 @@ public:
G4VMultipleScattering(const G4String& name = "msc",
G4ProcessType type = fElectromagnetic);
~G4VMultipleScattering();
virtual ~G4VMultipleScattering();
virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
// True for all charged particles
virtual void PreparePhysicsTable(const G4ParticleDefinition&);
// Initialise for build of tables
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
// Build physics table during initialisation
@@ -116,15 +122,15 @@ public:
G4double MaxKinEnergy() const;
// Print out of the class parameters
G4bool StorePhysicsTable(G4ParticleDefinition*,
const G4String& directory,
G4bool ascii = false);
G4bool StorePhysicsTable(const G4ParticleDefinition*,
const G4String& directory,
G4bool ascii = false);
// Store PhysicsTable in a file.
// Return false in case of failure at I/O
G4bool RetrievePhysicsTable(G4ParticleDefinition*,
const G4String& directory,
G4bool ascii);
G4bool RetrievePhysicsTable(const G4ParticleDefinition*,
const G4String& directory,
G4bool ascii);
// Retrieve Physics from a file.
// (return true if the Physics Table can be build by using file)
// (return false if the process has no functionality or in case of failure)
@@ -149,14 +155,21 @@ public:
void SetBuildLambdaTable(G4bool val);
const G4PhysicsTable* LambdaTable() const;
virtual G4double TruePathLengthLimit(const G4Track& track,
G4double& lambda,
G4double currentMinimalStep) = 0;
G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idxRegion) const;
// Define particle definition
const G4ParticleDefinition* Particle() const;
void SetParticle(const G4ParticleDefinition*);
protected:
virtual void InitialiseProcess(const G4ParticleDefinition&) = 0;
virtual void InitialiseProcess(const G4ParticleDefinition*) = 0;
G4double GetMeanFreePath(const G4Track& track,
G4double,
@@ -205,6 +218,7 @@ private:
G4PhysicsTable* theLambdaTable;
// cash
const G4ParticleDefinition* firstParticle;
const G4ParticleDefinition* currentParticle;
const G4MaterialCutsCouple* currentCouple;
size_t currentMaterialIndex;
@@ -331,7 +345,7 @@ inline G4VParticleChange* G4VMultipleScattering::AlongStepDoIt(
trueStepLength = truePathLength;
else
trueStepLength = currentModel->TrueStepLength(geomStepLength);
fParticleChange.SetTrueStepLength(trueStepLength);
fParticleChange.ProposeTrueStepLength(trueStepLength);
return &fParticleChange;
}
@@ -344,6 +358,14 @@ inline void G4VMultipleScattering::SelectModel(G4double& kinEnergy)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
G4double kinEnergy, size_t& idxRegion) const
{
return modelManager->SelectModel(kinEnergy, idxRegion);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VMultipleScattering::SetBinning(G4int nbins)
{
nBins = nbins;
@@ -421,4 +443,11 @@ inline void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline const G4ParticleDefinition* G4VMultipleScattering::Particle() const
{
return currentParticle;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -21,7 +21,7 @@
// ********************************************************************
//
// $Id: G4VSubCutoffProcessor.hh,v 1.6 2003/07/21 12:52:06 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// -------------------------------------------------------------------
//
@@ -20,101 +20,87 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4UniversalFluctuation.hh,v 1.12 2004/05/11 15:35:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
// $Id: G4ionEffectiveCharge.hh,v 1.4 2004/10/25 13:34:48 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4UniversalFluctuation
// File name: G4ionEffectiveCharge
//
// Author: Vladimir Ivanchenko
//
// Creation date: 03.01.2002
// Creation date: 03.07.2004
//
// Modifications:
//
// 09-12-02 remove warnings (V.Ivanchenko)
// 28-12-02 add method Dispersion (V.Ivanchenko)
// 07-02-03 change signature (V.Ivanchenko)
// 13-02-03 Add name (V.Ivanchenko)
// 16-10-03 Changed interface to Initialisation (V.Ivanchenko)
//
// Class Description:
//
// Implementation of energy loss fluctuations
// This class manages the simulation of effective charge of ions
// in the assumption of equilibrium between ion shelss and media.
// J.F.Ziegler and J.M.Manoyan, The stopping of ions in compaunds,
// Nucl. Inst. & Meth. in Phys. Res. B35 (1988) 215-228.
//
// -------------------------------------------------------------------
//
#ifndef G4UniversalFluctuation_h
#define G4UniversalFluctuation_h 1
#ifndef G4ionEffectiveCharge_h
#define G4ionEffectiveCharge_h 1
#include "globals.hh"
#include "G4VEmFluctuationModel.hh"
class G4Material;
class G4ParticleDefinition;
class G4UniversalFluctuation : public G4VEmFluctuationModel
class G4ionEffectiveCharge
{
public:
G4UniversalFluctuation(const G4String& nam = "UniFluc");
G4ionEffectiveCharge();
~G4UniversalFluctuation();
virtual ~G4ionEffectiveCharge();
G4double SampleFluctuations(const G4Material*,
const G4DynamicParticle*,
G4double&,
G4double&,
G4double&);
G4double EffectiveChargeSquareRatio(
const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
G4double Dispersion( const G4Material*,
const G4DynamicParticle*,
G4double&,
G4double&);
void InitialiseMe(const G4ParticleDefinition*);
protected:
G4double EffectiveCharge(const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy);
private:
// hide assignment operator
G4UniversalFluctuation & operator=(const G4UniversalFluctuation &right);
G4UniversalFluctuation(const G4UniversalFluctuation&);
G4ionEffectiveCharge & operator=(const G4ionEffectiveCharge &right);
G4ionEffectiveCharge(const G4ionEffectiveCharge&);
const G4ParticleDefinition* particle;
const G4Material* lastMaterial;
G4double particleMass;
G4double chargeSquare;
// data members to speed up the fluctuation calculation
G4double ipotFluct;
G4double electronDensity;
// G4double zeff;
G4double f1Fluct;
G4double f2Fluct;
G4double e1Fluct;
G4double e2Fluct;
G4double rateFluct;
G4double e1LogFluct;
G4double e2LogFluct;
G4double ipotLogFluct;
G4double minNumberInteractionsBohr;
G4double theBohrBeta2;
G4double minLoss;
G4double sumalim;
G4double alim;
G4double nmaxCont1;
G4double nmaxCont2;
G4double chargeCorrection;
G4double energyHighLimit;
G4double energyLowLimit;
G4double energyBohr;
G4double massFactor;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ionEffectiveCharge::EffectiveChargeSquareRatio(
const G4ParticleDefinition* p,
const G4Material* material,
G4double kineticEnergy)
{
G4double charge = EffectiveCharge(p,material,kineticEnergy)
*chargeCorrection/eplus;
return charge*charge;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif