Import Geant4 9.2.0 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DummyModel.hh,v 1.3 2007/05/22 17:31:57 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ElectronIonPair.hh,v 1.2 2008/10/17 14:46:16 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
#ifndef G4ElectronIonPair_h
|
||||
#define G4ElectronIonPair_h 1
|
||||
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class header file
|
||||
//
|
||||
//
|
||||
// File name: G4ElectronIonPair
|
||||
//
|
||||
// Author: Vladimir Ivanchenko
|
||||
//
|
||||
// Creation date: 08.07.2008
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
// Compution on number of electon-ion or electorn-hole pairs
|
||||
// at the step of a particle and sampling ionisation points
|
||||
// in space
|
||||
//
|
||||
// Based on ICRU Report 31, 1979
|
||||
// "Average Energy Required to Produce an Ion Pair"
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4TrackVector.hh"
|
||||
#include "G4VProcess.hh"
|
||||
#include <vector>
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class G4Material;
|
||||
|
||||
class G4ElectronIonPair
|
||||
{
|
||||
public:
|
||||
|
||||
G4ElectronIonPair();
|
||||
|
||||
virtual ~G4ElectronIonPair();
|
||||
|
||||
// compute mean number of ionisation points at a step
|
||||
G4double MeanNumberOfIonsAlongStep(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double edepTotal,
|
||||
G4double edepNIEL = 0.0);
|
||||
|
||||
inline G4double MeanNumberOfIonsAlongStep(const G4Step*);
|
||||
|
||||
// returns pointer to the new vector of positions of
|
||||
// ionisation points in the World coordinate system
|
||||
std::vector<G4ThreeVector>*
|
||||
SampleIonsAlongStep(const G4ThreeVector& prePosition,
|
||||
const G4ThreeVector& postPosition,
|
||||
G4double numberOfIonisations);
|
||||
|
||||
std::vector<G4ThreeVector>* SampleIonsAlongStep(const G4Step*);
|
||||
|
||||
// compute number of holes in the atom after PostStep interaction
|
||||
G4int ResidualeChargePostStep(const G4ParticleDefinition*,
|
||||
const G4TrackVector* secondary = 0,
|
||||
G4int processSubType = -1);
|
||||
|
||||
inline G4int ResidualeChargePostStep(const G4Step*);
|
||||
|
||||
// find mean energies per ionisation
|
||||
G4double FindG4MeanEnergyPerIonPair(const G4Material*);
|
||||
|
||||
// dump mean energies per ionisation used in run time
|
||||
void DumpMeanEnergyPerIonPair();
|
||||
|
||||
// dump G4 list
|
||||
void DumpG4MeanEnergyPerIonPair();
|
||||
|
||||
inline void SetVerbose(G4int);
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
G4ElectronIonPair & operator=(const G4ElectronIonPair &right);
|
||||
G4ElectronIonPair(const G4ElectronIonPair&);
|
||||
|
||||
G4double FindMeanEnergyPerIonPair(const G4Material*);
|
||||
|
||||
void Initialise();
|
||||
|
||||
const G4ParticleDefinition* gamma;
|
||||
|
||||
// cash
|
||||
const G4Material* curMaterial;
|
||||
G4double curMeanEnergy;
|
||||
|
||||
G4int verbose;
|
||||
G4int nMaterials;
|
||||
|
||||
// list of G4 NIST materials with mean energy per ion defined
|
||||
std::vector<G4double> g4MatData;
|
||||
std::vector<G4String> g4MatNames;
|
||||
|
||||
};
|
||||
|
||||
inline G4double
|
||||
G4ElectronIonPair::MeanNumberOfIonsAlongStep(const G4Step* step)
|
||||
{
|
||||
return MeanNumberOfIonsAlongStep(step->GetTrack()->GetDefinition(),
|
||||
step->GetPreStepPoint()->GetMaterial(),
|
||||
step->GetTotalEnergyDeposit(),
|
||||
step->GetNonIonizingEnergyDeposit());
|
||||
}
|
||||
|
||||
inline std::vector<G4ThreeVector>*
|
||||
G4ElectronIonPair::SampleIonsAlongStep(const G4Step* step)
|
||||
{
|
||||
return SampleIonsAlongStep(step->GetPreStepPoint()->GetPosition(),
|
||||
step->GetPostStepPoint()->GetPosition(),
|
||||
MeanNumberOfIonsAlongStep(step));
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4ElectronIonPair::ResidualeChargePostStep(const G4Step* step)
|
||||
{
|
||||
G4int subtype = -1;
|
||||
const G4VProcess* proc = step->GetPostStepPoint()->GetProcessDefinedStep();
|
||||
if(proc) subtype = proc->GetProcessSubType();
|
||||
return ResidualeChargePostStep(step->GetTrack()->GetDefinition(),
|
||||
step->GetSecondary(),
|
||||
subtype);
|
||||
}
|
||||
|
||||
inline void G4ElectronIonPair::SetVerbose(G4int val)
|
||||
{
|
||||
verbose = val;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmCalculator.hh,v 1.18 2007/03/15 12:34:46 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmConfigurator.hh,v 1.2 2008/11/21 12:30:29 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class header file
|
||||
//
|
||||
// File name: G4EmConfigurator
|
||||
//
|
||||
// Author: Vladimir Ivanchenko
|
||||
//
|
||||
// Creation date: 14.07.2008
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// This class provides configuration EM models for
|
||||
// particles/processes/regions
|
||||
//
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#ifndef G4EmConfigurator_h
|
||||
#define G4EmConfigurator_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4VEmFluctuationModel.hh"
|
||||
#include <vector>
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class G4EmConfigurator
|
||||
{
|
||||
public:
|
||||
|
||||
G4EmConfigurator();
|
||||
|
||||
~G4EmConfigurator();
|
||||
|
||||
// Add EM model to the list of extra models potentially to be
|
||||
// declared for the G4Region and energy interval
|
||||
//
|
||||
void AddExtraEmModel(const G4String& particleName,
|
||||
G4VEmModel*, G4VEmFluctuationModel* fm = 0);
|
||||
|
||||
// Declare EM model for particle type and process to
|
||||
// be active for the G4Region and energy interval
|
||||
// The model should be previously added to the configurator
|
||||
// or be "dummy"
|
||||
//
|
||||
void AddModelForRegion(const G4String& particleName,
|
||||
const G4String& processName,
|
||||
const G4String& modelName,
|
||||
const G4String& regionName = "",
|
||||
G4double emin = 0.0,
|
||||
G4double emax = DBL_MAX,
|
||||
const G4String& flucModelName = "");
|
||||
|
||||
// Set EM model for particle type and process to
|
||||
// be active for the G4Region and energy interval
|
||||
//
|
||||
void SetExtraEmModel(const G4String& particleName,
|
||||
const G4String& processName,
|
||||
G4VEmModel*,
|
||||
const G4String& regionName = "",
|
||||
G4double emin = 0.0,
|
||||
G4double emax = DBL_MAX,
|
||||
G4VEmFluctuationModel* fm = 0);
|
||||
|
||||
// Add all previously declared models to corresponding processes
|
||||
void AddModels();
|
||||
|
||||
private:
|
||||
|
||||
void SetModelForRegion(const G4String& particleName,
|
||||
const G4String& processName,
|
||||
const G4String& modelName,
|
||||
const G4String& regionName,
|
||||
const G4String& flucModelName,
|
||||
G4double emin,
|
||||
G4double emax);
|
||||
|
||||
// hide assignment operator
|
||||
G4EmConfigurator & operator=(const G4EmConfigurator &right);
|
||||
G4EmConfigurator(const G4EmConfigurator&);
|
||||
|
||||
std::vector<G4String> particles;
|
||||
std::vector<G4String> processes;
|
||||
std::vector<G4String> models;
|
||||
std::vector<G4String> regions;
|
||||
std::vector<G4String> flucModels;
|
||||
std::vector<G4double> lowEnergy;
|
||||
std::vector<G4double> highEnergy;
|
||||
|
||||
std::vector<G4String> particleList;
|
||||
std::vector<G4VEmModel*> modelList;
|
||||
std::vector<G4VEmFluctuationModel*> flucModelList;
|
||||
|
||||
G4int index;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmCorrections.hh,v 1.9 2007/05/18 18:39:54 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4EmCorrections.hh,v 1.24 2008/09/12 14:44:48 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -40,6 +40,8 @@
|
||||
// Modifications:
|
||||
// 28.04.2006 General cleanup, add finite size corrections (V.Ivanchenko)
|
||||
// 13.05.2006 Add corrections for ion stopping (V.Ivanhcenko)
|
||||
// 20.05.2008 Removed Finite Size correction (V.Ivanchenko)
|
||||
// 12.09.2008 Added inlined interfaces to effective charge (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -57,11 +59,12 @@
|
||||
#include "G4ionEffectiveCharge.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4NistManager.hh"
|
||||
|
||||
class G4VEmModel;
|
||||
class G4PhysicsVector;
|
||||
class G4IonTable;
|
||||
class G4NistManager;
|
||||
class G4MaterialCutsCouple;
|
||||
|
||||
class G4EmCorrections
|
||||
{
|
||||
@@ -72,78 +75,101 @@ public:
|
||||
|
||||
virtual ~G4EmCorrections();
|
||||
|
||||
G4double HighOrderCorrections(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double kineticEnergy);
|
||||
G4double HighOrderCorrections(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy);
|
||||
|
||||
G4double Bethe(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double IonHighOrderCorrections(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double ComputeIonCorrections(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double IonBarkasCorrection(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double Bethe(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double SpinCorrection(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double SpinCorrection(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double KShellCorrection(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double KShellCorrection(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double LShellCorrection(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double LShellCorrection(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double ShellCorrection(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double ShellCorrection(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double ShellCorrectionSTD(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double ShellCorrectionSTD(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double DensityCorrection(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double DensityCorrection(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double BarkasCorrection(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double BarkasCorrection(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double BlochCorrection(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double BlochCorrection(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double MottCorrection(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double MottCorrection(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double FiniteSizeCorrection(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double NuclearDEDX(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
G4double NuclearDEDX(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy,
|
||||
G4bool fluct = true);
|
||||
|
||||
void AddStoppingData(G4int Z, G4int A, const G4String& materialName,
|
||||
G4PhysicsVector& dVector);
|
||||
G4PhysicsVector* dVector);
|
||||
|
||||
void InitialiseForNewRun();
|
||||
|
||||
// effective charge correction using stopping power data
|
||||
G4double EffectiveChargeCorrection(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double);
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4ionEffectiveCharge* GetIonEffectiveCharge(G4VEmModel* m = 0);
|
||||
// effective charge of an ion
|
||||
inline G4double GetParticleCharge(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4int GetNumberOfStoppingVectors();
|
||||
inline
|
||||
G4double EffectiveChargeSquareRatio(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
// ionisation models for ions
|
||||
inline void SetIonisationModels(G4VEmModel* m1 = 0, G4VEmModel* m2 = 0);
|
||||
|
||||
inline G4int GetNumberOfStoppingVectors();
|
||||
|
||||
private:
|
||||
|
||||
void Initialise();
|
||||
|
||||
G4PhysicsVector* InitialiseMaterial(const G4Material* mat);
|
||||
void BuildCorrectionVector();
|
||||
|
||||
void SetupKinematics(const G4ParticleDefinition* p,
|
||||
const G4Material* material,
|
||||
void SetupKinematics(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
G4double KShell(G4double theta, G4double eta);
|
||||
@@ -204,6 +230,11 @@ private:
|
||||
G4double HN[31];
|
||||
G4double MSH[93];
|
||||
G4double TAU[93];
|
||||
G4double Z23[100];
|
||||
|
||||
std::vector<const G4Material*> currmat;
|
||||
std::vector<G4double> thcorr[100];
|
||||
size_t ncouples;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
const G4ParticleDefinition* curParticle;
|
||||
@@ -216,6 +247,8 @@ private:
|
||||
G4double kinEnergy;
|
||||
G4double mass;
|
||||
G4double massFactor;
|
||||
G4double formfact;
|
||||
G4double eth;
|
||||
G4double tau;
|
||||
G4double gamma;
|
||||
G4double bg2;
|
||||
@@ -223,24 +256,30 @@ private:
|
||||
G4double beta;
|
||||
G4double ba2;
|
||||
G4double tmax;
|
||||
G4double tmax0;
|
||||
G4double charge;
|
||||
G4double q2;
|
||||
G4double eCorrMin;
|
||||
G4double eCorrMax;
|
||||
G4int nbinCorr;
|
||||
|
||||
G4AtomicShells shells;
|
||||
G4ionEffectiveCharge effCharge;
|
||||
|
||||
G4NistManager* nist;
|
||||
const G4IonTable* ionTable;
|
||||
G4VEmModel* ionModel;
|
||||
G4VEmModel* ionLEModel;
|
||||
G4VEmModel* ionHEModel;
|
||||
|
||||
// Ion stopping data
|
||||
G4int nIons;
|
||||
G4int idx;
|
||||
G4int currentZ;
|
||||
std::vector<G4int> Zion;
|
||||
std::vector<G4int> Aion;
|
||||
std::vector<G4String> materialName;
|
||||
|
||||
std::vector<const G4ParticleDefinition*> ionList;
|
||||
|
||||
std::vector<const G4Material*> materialList;
|
||||
std::vector<G4PhysicsVector*> stopData;
|
||||
G4PhysicsVector* curVector;
|
||||
@@ -271,6 +310,34 @@ inline G4double G4EmCorrections::Value2(G4double xv, G4double yv,
|
||||
/ ((x2-x1)*(y2-y1));
|
||||
}
|
||||
|
||||
inline
|
||||
void G4EmCorrections::SetIonisationModels(G4VEmModel* m1, G4VEmModel* m2)
|
||||
{
|
||||
if(m1) ionLEModel = m1;
|
||||
if(m2) ionHEModel = m2;
|
||||
}
|
||||
|
||||
inline G4int G4EmCorrections::GetNumberOfStoppingVectors()
|
||||
{
|
||||
return nIons;
|
||||
}
|
||||
|
||||
inline G4double
|
||||
G4EmCorrections::GetParticleCharge(const G4ParticleDefinition* p,
|
||||
const G4Material* mat,
|
||||
G4double kineticEnergy)
|
||||
{
|
||||
return effCharge.EffectiveCharge(p,mat,kineticEnergy);
|
||||
}
|
||||
|
||||
inline G4double
|
||||
G4EmCorrections::EffectiveChargeSquareRatio(const G4ParticleDefinition* p,
|
||||
const G4Material* mat,
|
||||
G4double kineticEnergy)
|
||||
{
|
||||
return effCharge.EffectiveChargeSquareRatio(p,mat,kineticEnergy);
|
||||
}
|
||||
|
||||
inline void G4EmCorrections::SetupKinematics(const G4ParticleDefinition* p,
|
||||
const G4Material* mat,
|
||||
G4double kineticEnergy)
|
||||
@@ -287,15 +354,12 @@ inline void G4EmCorrections::SetupKinematics(const G4ParticleDefinition* p,
|
||||
ba2 = beta2/alpha2;
|
||||
G4double ratio = electron_mass_c2/mass;
|
||||
tmax = 2.0*electron_mass_c2*bg2 /(1. + 2.0*gamma*ratio + ratio*ratio);
|
||||
tmax0 = tmax;
|
||||
charge = p->GetPDGCharge()/eplus;
|
||||
if(charge < 1.5) q2 = charge*charge;
|
||||
if(charge < 1.5) {q2 = charge*charge;}
|
||||
else {
|
||||
q2 = effCharge.EffectiveChargeSquareRatio(p,mat,kinEnergy);
|
||||
charge = std::sqrt(q2);
|
||||
}
|
||||
if(mass > 120.*MeV)
|
||||
tmax = std::min(tmax,51200.*electron_mass_c2*std::pow(proton_mass_c2/mass,0.666667));
|
||||
}
|
||||
if(mat != material) {
|
||||
material = mat;
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmElementSelector.hh,v 1.2 2008/07/22 15:55:15 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class header file
|
||||
//
|
||||
//
|
||||
// File name: G4EmElementSelector
|
||||
//
|
||||
// Author: Vladimir Ivanchenko
|
||||
//
|
||||
// Creation date: 29.05.2008
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// Generic helper class for the random selection of an element
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#ifndef G4EmElementSelector_h
|
||||
#define G4EmElementSelector_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4Element.hh"
|
||||
#include "G4ElementVector.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "Randomize.hh"
|
||||
#include <vector>
|
||||
|
||||
class G4VEmModel;
|
||||
|
||||
class G4EmElementSelector
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
G4EmElementSelector(G4VEmModel*, const G4Material*, G4int bins,
|
||||
G4double emin, G4double emax,
|
||||
G4bool spline = true);
|
||||
|
||||
~G4EmElementSelector();
|
||||
|
||||
void Initialise(const G4ParticleDefinition*, G4double cut = 0.0);
|
||||
|
||||
void Dump(const G4ParticleDefinition* p = 0);
|
||||
|
||||
inline const G4Element* SelectRandomAtom(G4double kineticEnergy);
|
||||
|
||||
inline const G4Material* GetMaterial() const;
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
G4EmElementSelector & operator=(const G4EmElementSelector &right);
|
||||
G4EmElementSelector(const G4EmElementSelector&);
|
||||
|
||||
G4VEmModel* model;
|
||||
const G4Material* material;
|
||||
const G4ElementVector* theElementVector;
|
||||
|
||||
G4int nElmMinusOne;
|
||||
G4int nbins;
|
||||
|
||||
G4double cutEnergy;
|
||||
G4double lowEnergy;
|
||||
G4double highEnergy;
|
||||
|
||||
std::vector<G4PhysicsLogVector*> xSections;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
inline const G4Element* G4EmElementSelector::SelectRandomAtom(G4double e)
|
||||
{
|
||||
const G4Element* elm = (*theElementVector)[nElmMinusOne];
|
||||
if (nElmMinusOne > 0) {
|
||||
G4bool b;
|
||||
G4double x = G4UniformRand();
|
||||
for(G4int i=0; i<nElmMinusOne; i++) {
|
||||
if (x <= (xSections[i])->GetValue(e,b)) {
|
||||
elm = (*theElementVector)[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return elm;
|
||||
}
|
||||
|
||||
inline const G4Material* G4EmElementSelector::GetMaterial() const
|
||||
{
|
||||
return material;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmModelManager.hh,v 1.22 2007/11/09 11:35:54 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4EmModelManager.hh,v 1.25 2008/10/13 14:56:56 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -73,6 +73,8 @@
|
||||
#include "globals.hh"
|
||||
#include "G4DataVector.hh"
|
||||
#include "G4EmTableType.hh"
|
||||
#include "G4EmProcessSubType.hh"
|
||||
#include "G4Region.hh"
|
||||
|
||||
class G4RegionModels
|
||||
{
|
||||
@@ -83,7 +85,8 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
G4RegionModels(G4int nMod, std::vector<G4int>& list, G4DataVector& lowE);
|
||||
G4RegionModels(G4int nMod, std::vector<G4int>& indx,
|
||||
G4DataVector& lowE, const G4Region* reg);
|
||||
|
||||
~G4RegionModels();
|
||||
|
||||
@@ -104,6 +107,15 @@ private:
|
||||
return nModelsForRegion;
|
||||
};
|
||||
|
||||
G4double LowEdgeEnergy(G4int n) const {
|
||||
return lowKineticEnergy[n];
|
||||
};
|
||||
|
||||
const G4Region* Region() const {
|
||||
return theRegion;
|
||||
};
|
||||
|
||||
const G4Region* theRegion;
|
||||
G4int nModelsForRegion;
|
||||
G4int* theListOfModelIndexes;
|
||||
G4double* lowKineticEnergy;
|
||||
@@ -149,7 +161,7 @@ public:
|
||||
|
||||
G4VEmModel* SelectModel(G4double& energy, size_t& index);
|
||||
|
||||
G4VEmModel* GetModel(G4int);
|
||||
G4VEmModel* GetModel(G4int, G4bool ver = false);
|
||||
|
||||
G4int NumberOfModels() const;
|
||||
|
||||
@@ -157,6 +169,8 @@ public:
|
||||
|
||||
void UpdateEmModel(const G4String&, G4double, G4double);
|
||||
|
||||
void DumpModelList(G4int verb);
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
@@ -175,7 +189,6 @@ private:
|
||||
std::vector<G4VEmFluctuationModel*> flucModels;
|
||||
std::vector<const G4Region*> regions;
|
||||
std::vector<G4int> orderOfModels;
|
||||
G4DataVector upperEkin;
|
||||
|
||||
G4int nEmModels;
|
||||
G4int nRegions;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmMultiModel.hh,v 1.6 2007/05/22 17:31:57 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmProcessOptions.hh,v 1.12 2007/05/18 18:39:54 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4EmProcessOptions.hh,v 1.14 2008/04/17 10:33:26 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -120,8 +120,12 @@ public:
|
||||
|
||||
void SetLPMFlag(G4bool val);
|
||||
|
||||
void SetSplineFlag(G4bool val);
|
||||
|
||||
void SetBremsstrahlungTh(G4double val);
|
||||
|
||||
void SetPolarAngleLimit(G4double val);
|
||||
|
||||
private:
|
||||
|
||||
G4EmProcessOptions & operator=(const G4EmProcessOptions &right);
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EmProcessSubType.hh,v 1.9 2008/12/18 13:01:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4EmProcessSubType.hh
|
||||
//
|
||||
// Class Description:
|
||||
// This is an enumerator to define sub-type of electro-magnetic
|
||||
// processes
|
||||
//
|
||||
// Creation date: 23.09.2008
|
||||
// Modifications:
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4EmProcessSubType_h
|
||||
#define G4EmProcessSubType_h 1
|
||||
|
||||
enum G4EmProcessSubType
|
||||
{
|
||||
fCoulombScattering = 1,
|
||||
fIonisation = 2,
|
||||
fBremsstrahlung = 3,
|
||||
fPairProdByCharged = 4,
|
||||
fAnnihilation = 5,
|
||||
fAnnihilationToMuMu = 6,
|
||||
fAnnihilationToHadrons = 7,
|
||||
|
||||
fMultipleScattering = 10,
|
||||
|
||||
fRayleigh = 11,
|
||||
fPhotoElectricEffect = 12,
|
||||
fComptonScattering = 13,
|
||||
fGammaConversion = 14,
|
||||
fGammaConversionToMuMu = 15,
|
||||
|
||||
fCerenkov = 21,
|
||||
fScintillation = 22,
|
||||
fSynchrotronRadiation = 23,
|
||||
fTransitionRadiation = 24
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,152 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4EmSaturation.hh,v 1.6 2008/03/17 11:27:32 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
#ifndef G4EmSaturation_h
|
||||
#define G4EmSaturation_h 1
|
||||
|
||||
// -------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class header file
|
||||
//
|
||||
//
|
||||
// File name: G4EmSaturation
|
||||
//
|
||||
// Author: Vladimir Ivanchenko
|
||||
//
|
||||
// Creation date: 18.02.2008
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
// Compution on saturation effect, which reduce visible energy
|
||||
// deposition at the step. Default implementation takes into
|
||||
// account Birks effect. Birks coefficients for some materials
|
||||
// from G4 database on materials are provided
|
||||
//
|
||||
// -------------------------------------------------------------
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include <vector>
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class G4LossTableManager;
|
||||
class G4NistManager;
|
||||
class G4MaterialCutsCouple;
|
||||
class G4Material;
|
||||
|
||||
class G4EmSaturation
|
||||
{
|
||||
public:
|
||||
|
||||
G4EmSaturation();
|
||||
virtual ~G4EmSaturation();
|
||||
|
||||
G4double VisibleEnergyDeposition(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple*,
|
||||
G4double length,
|
||||
G4double edepTotal,
|
||||
G4double edepNIEL = 0.0);
|
||||
|
||||
inline G4double VisibleEnergyDeposition(const G4Step*);
|
||||
|
||||
// find and Birks coefficient
|
||||
G4double FindG4BirksCoefficient(const G4Material*);
|
||||
|
||||
inline void SetVerbose(G4int);
|
||||
|
||||
// dump coeffitients used in run time
|
||||
void DumpBirksCoefficients();
|
||||
|
||||
// dump G4 list
|
||||
void DumpG4BirksCoefficients();
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
G4EmSaturation & operator=(const G4EmSaturation &right);
|
||||
G4EmSaturation(const G4EmSaturation&);
|
||||
|
||||
G4double FindBirksCoefficient(const G4Material*);
|
||||
|
||||
void Initialise();
|
||||
|
||||
const G4ParticleDefinition* gamma;
|
||||
const G4ParticleDefinition* electron;
|
||||
const G4ParticleDefinition* neutron;
|
||||
const G4ParticleDefinition* proton;
|
||||
G4LossTableManager* manager;
|
||||
G4NistManager* nist;
|
||||
|
||||
// cash
|
||||
const G4Material* curMaterial;
|
||||
G4double curBirks;
|
||||
G4double curRatio;
|
||||
G4double curChargeSq;
|
||||
|
||||
G4int verbose;
|
||||
G4int nMaterials;
|
||||
G4int nG4Birks;
|
||||
|
||||
// list of materials used in run time
|
||||
std::vector<const G4Material*> matPointers;
|
||||
std::vector<G4String> matNames;
|
||||
std::vector<G4double> massFactors;
|
||||
std::vector<G4double> effCharges;
|
||||
|
||||
// list of G4 materials
|
||||
std::vector<G4double> g4MatData;
|
||||
std::vector<G4String> g4MatNames;
|
||||
|
||||
};
|
||||
|
||||
inline void G4EmSaturation::SetVerbose(G4int val)
|
||||
{
|
||||
verbose = val;
|
||||
}
|
||||
|
||||
inline G4double G4EmSaturation::VisibleEnergyDeposition(
|
||||
const G4Step* step)
|
||||
{
|
||||
G4Track* track = step->GetTrack();
|
||||
return VisibleEnergyDeposition(track->GetDefinition(),
|
||||
track->GetMaterialCutsCouple(),
|
||||
step->GetStepLength(),
|
||||
step->GetTotalEnergyDeposit(),
|
||||
step->GetNonIonizingEnergyDeposit());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EmTableType.hh,v 1.3 2007/01/15 17:27:40 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4EmTableType.hh,v 1.4 2008/10/13 14:56:56 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
@@ -50,8 +50,8 @@ enum G4EmTableType
|
||||
fTotal = 0,
|
||||
fRestricted,
|
||||
fSubRestricted,
|
||||
fIonisation,
|
||||
fSubIonisation
|
||||
fIsIonisation,
|
||||
fIsSubIonisation
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4EnergyLossMessenger.hh,v 1.18 2007/05/18 18:39:54 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4EnergyLossMessenger.hh,v 1.22 2008/10/20 13:27:45 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -44,6 +44,7 @@
|
||||
// 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
|
||||
// 16-03-07 modify /process/eLoss/minsubsec command (V.Ivanchenko)
|
||||
// 18-05-07 add /process/msc directory and commands (V.Ivanchenko)
|
||||
// 11-03-08 add /process/em directory and commands (V.Ivanchenko)
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -99,6 +100,7 @@ private:
|
||||
|
||||
G4UIdirectory* eLossDirectory;
|
||||
G4UIdirectory* mscDirectory;
|
||||
G4UIdirectory* emDirectory;
|
||||
G4UIcmdWithABool* RndmStepCmd;
|
||||
G4UIcmdWithABool* EnlossFlucCmd;
|
||||
G4UIcmdWithABool* SubSecCmd;
|
||||
@@ -111,7 +113,10 @@ private:
|
||||
G4UIcmdWithABool* rangeCmd;
|
||||
G4UIcmdWithABool* lpmCmd;
|
||||
G4UIcmdWithABool* latCmd;
|
||||
G4UIcmdWithABool* splCmd;
|
||||
G4UIcmdWithABool* aplCmd;
|
||||
G4UIcmdWithAnInteger* verCmd;
|
||||
G4UIcmdWithAnInteger* ver1Cmd;
|
||||
G4UIcmdWithAnInteger* dedxCmd;
|
||||
G4UIcmdWithAnInteger* lamCmd;
|
||||
G4UIcmdWithADouble* lllCmd;
|
||||
@@ -119,6 +124,7 @@ private:
|
||||
G4UIcmdWithADouble* skinCmd;
|
||||
G4UIcmdWithADouble* frCmd;
|
||||
G4UIcmdWithADouble* fgCmd;
|
||||
G4UIcmdWithADoubleAndUnit* angCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4EnergyLossTables.hh,v 1.19 2006/06/29 19:54:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// $Id:
|
||||
//
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LossTableBuilder.hh,v 1.7 2006/06/29 19:54:37 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4LossTableBuilder.hh,v 1.8 2008/07/22 15:55:15 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -39,8 +39,8 @@
|
||||
// Creation date: 03.01.2002
|
||||
//
|
||||
// Modifications:
|
||||
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
|
||||
//
|
||||
// 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko)
|
||||
// 17-07-08 Added splineFlag (V.Ivanchenko)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -56,7 +56,6 @@
|
||||
#include "globals.hh"
|
||||
#include "G4PhysicsTable.hh"
|
||||
|
||||
|
||||
class G4LossTableBuilder
|
||||
{
|
||||
|
||||
@@ -74,14 +73,23 @@ public:
|
||||
void BuildInverseRangeTable(const G4PhysicsTable* rangeTable,
|
||||
G4PhysicsTable* invRangeTable,
|
||||
G4bool isIonisation = false);
|
||||
|
||||
inline void SetSplineFlag(G4bool flag);
|
||||
|
||||
private:
|
||||
|
||||
G4LossTableBuilder & operator=(const G4LossTableBuilder &right);
|
||||
G4LossTableBuilder(const G4LossTableBuilder&);
|
||||
|
||||
G4bool splineFlag;
|
||||
|
||||
};
|
||||
|
||||
inline void G4LossTableBuilder::SetSplineFlag(G4bool flag)
|
||||
{
|
||||
splineFlag = flag;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo.......oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4LossTableManager.hh,v 1.48 2007/11/07 18:38:49 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4LossTableManager.hh,v 1.53 2008/07/15 16:56:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -76,7 +76,6 @@
|
||||
#ifndef G4LossTableManager_h
|
||||
#define G4LossTableManager_h 1
|
||||
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include "globals.hh"
|
||||
@@ -90,6 +89,7 @@ class G4ParticleDefinition;
|
||||
class G4VMultipleScattering;
|
||||
class G4VEmProcess;
|
||||
class G4EmCorrections;
|
||||
class G4EmSaturation;
|
||||
class G4LossTableBuilder;
|
||||
|
||||
class G4LossTableManager
|
||||
@@ -152,6 +152,14 @@ public:
|
||||
|
||||
void DeRegister(G4VEmProcess* p);
|
||||
|
||||
void Register(G4VEmModel* p);
|
||||
|
||||
void DeRegister(G4VEmModel* p);
|
||||
|
||||
void Register(G4VEmFluctuationModel* p);
|
||||
|
||||
void DeRegister(G4VEmFluctuationModel* p);
|
||||
|
||||
void EnergyLossProcessIsInitialised(const G4ParticleDefinition* aParticle,
|
||||
G4VEnergyLossProcess* p);
|
||||
|
||||
@@ -194,6 +202,8 @@ public:
|
||||
|
||||
void SetLPMFlag(G4bool val);
|
||||
|
||||
void SetSplineFlag(G4bool val);
|
||||
|
||||
void SetLinearLossLimit(G4double val);
|
||||
|
||||
void SetBremsstrahlungTh(G4double val);
|
||||
@@ -206,6 +216,8 @@ public:
|
||||
|
||||
G4bool LPMFlag() const;
|
||||
|
||||
G4bool SplineFlag() const;
|
||||
|
||||
G4double BremsstrahlungTh() const;
|
||||
|
||||
const std::vector<G4VEnergyLossProcess*>& GetEnergyLossProcessVector();
|
||||
@@ -216,7 +228,9 @@ public:
|
||||
|
||||
inline G4VEnergyLossProcess* GetEnergyLossProcess(const G4ParticleDefinition*);
|
||||
|
||||
inline G4EmCorrections* EmCorrections();
|
||||
G4EmCorrections* EmCorrections();
|
||||
|
||||
G4EmSaturation* EmSaturation();
|
||||
|
||||
private:
|
||||
|
||||
@@ -250,6 +264,8 @@ private:
|
||||
std::vector<G4PhysicsTable*> inv_range_vector;
|
||||
std::vector<G4VMultipleScattering*> msc_vector;
|
||||
std::vector<G4VEmProcess*> emp_vector;
|
||||
std::vector<G4VEmModel*> mod_vector;
|
||||
std::vector<G4VEmFluctuationModel*> fmod_vector;
|
||||
|
||||
// cash
|
||||
G4VEnergyLossProcess* currentLoss;
|
||||
@@ -273,6 +289,7 @@ private:
|
||||
G4bool maxEnergyForMuonsActive;
|
||||
G4bool stepFunctionActive;
|
||||
G4bool flagLPM;
|
||||
G4bool splineFlag;
|
||||
|
||||
G4double minSubRange;
|
||||
G4double maxRangeVariation;
|
||||
@@ -285,6 +302,8 @@ private:
|
||||
G4LossTableBuilder* tableBuilder;
|
||||
G4EnergyLossMessenger* theMessenger;
|
||||
G4EmCorrections* emCorrections;
|
||||
G4EmSaturation* emSaturation;
|
||||
|
||||
const G4ParticleDefinition* firstParticle;
|
||||
G4int verbose;
|
||||
|
||||
@@ -417,12 +436,5 @@ inline G4VEnergyLossProcess* G4LossTableManager::GetEnergyLossProcess(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4EmCorrections* G4LossTableManager::EmCorrections()
|
||||
{
|
||||
return emCorrections;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4MscStepLimitType.hh,v 1.2 2007/06/11 14:56:51 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmFluctuationModel.hh,v 1.10 2006/06/29 19:54:41 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4VEmFluctuationModel.hh,v 1.11 2008/09/12 14:47:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -94,6 +94,8 @@ public:
|
||||
|
||||
virtual void InitialiseMe(const G4ParticleDefinition*);
|
||||
|
||||
virtual void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Generic methods common to all models
|
||||
//------------------------------------------------------------------------
|
||||
@@ -115,6 +117,11 @@ private:
|
||||
inline void G4VEmFluctuationModel::InitialiseMe(const G4ParticleDefinition*)
|
||||
{}
|
||||
|
||||
inline
|
||||
void G4VEmFluctuationModel::SetParticleAndCharge(const G4ParticleDefinition*,
|
||||
G4double)
|
||||
{}
|
||||
|
||||
inline G4String G4VEmFluctuationModel::GetName() const
|
||||
{
|
||||
return name;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmModel.hh,v 1.48 2007/10/29 08:38:58 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4VEmModel.hh,v 1.59 2008/11/13 19:29:41 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -60,6 +60,10 @@
|
||||
// 07-03-06 Optimize msc methods (V.Ivanchenko)
|
||||
// 29-06-06 Add member currentElement and Get/Set methods (V.Ivanchenko)
|
||||
// 29-10-07 Added SampleScattering (V.Ivanchenko)
|
||||
// 15-07-08 Reorder class members and improve comments (VI)
|
||||
// 21-07-08 Added vector of G4ElementSelector and methods to use it (VI)
|
||||
// 12-09-08 Added methods GetParticleCharge, GetChargeSquareRatio,
|
||||
// CorrectionsAlongStep, ActivateNuclearStopping (VI)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -80,7 +84,9 @@
|
||||
#include "G4ElementVector.hh"
|
||||
#include "G4DataVector.hh"
|
||||
#include "G4VEmFluctuationModel.hh"
|
||||
#include "G4EmElementSelector.hh"
|
||||
#include "Randomize.hh"
|
||||
#include <vector>
|
||||
|
||||
class G4PhysicsTable;
|
||||
class G4Region;
|
||||
@@ -97,11 +103,11 @@ public:
|
||||
virtual ~G4VEmModel();
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Virtual methods to be implemented for the concrete model
|
||||
// Virtual methods to be implemented for any concrete model
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&) = 0;
|
||||
|
||||
virtual void Initialise(const G4ParticleDefinition*,
|
||||
const G4DataVector&) = 0;
|
||||
|
||||
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
||||
const G4MaterialCutsCouple*,
|
||||
@@ -113,47 +119,64 @@ public:
|
||||
// Methods with standard implementation; may be overwritten if needed
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple*);
|
||||
|
||||
// dEdx per unit length
|
||||
virtual G4double ComputeDEDX(const G4MaterialCutsCouple*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = DBL_MAX);
|
||||
|
||||
// main method to compute dEdx
|
||||
virtual G4double ComputeDEDXPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = DBL_MAX);
|
||||
|
||||
// cross section per volume
|
||||
virtual G4double CrossSection(const G4MaterialCutsCouple*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
virtual G4double ComputeDEDXPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = DBL_MAX);
|
||||
|
||||
|
||||
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
|
||||
G4double kinEnergy,
|
||||
G4double Z,
|
||||
G4double A = 0.,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
virtual G4double ComputeMeanFreePath(const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
const G4Material*,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
// main method to compute cross section per Volume
|
||||
virtual G4double CrossSectionPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
// main method to compute cross section depending on atom
|
||||
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
|
||||
G4double kinEnergy,
|
||||
G4double Z,
|
||||
G4double A = 0., /* amu */
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
// min cut in kinetic energy allowed by the model
|
||||
virtual G4double MinEnergyCut(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple*);
|
||||
|
||||
// Compute effective ion charge square
|
||||
virtual G4double GetChargeSquareRatio(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
// Compute ion charge
|
||||
virtual G4double GetParticleCharge(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
// add correction to energy loss and ompute non-ionizing energy loss
|
||||
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double& eloss,
|
||||
G4double& niel,
|
||||
G4double length);
|
||||
|
||||
protected:
|
||||
|
||||
// kinematically allowed max kinetic energy of a secondary
|
||||
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
@@ -176,37 +199,89 @@ public:
|
||||
|
||||
virtual void DefineForRegion(const G4Region*);
|
||||
|
||||
virtual void SetupForMaterial(const G4ParticleDefinition*,
|
||||
const G4Material*,
|
||||
G4double kineticEnergy);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Generic methods common to all models
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
void SetParticleChange(G4VParticleChange*, G4VEmFluctuationModel*);
|
||||
// should be called at initialisation to build element selectors
|
||||
void InitialiseElementSelectors(const G4ParticleDefinition*,
|
||||
const G4DataVector&);
|
||||
|
||||
G4VEmFluctuationModel* GetModelOfFluctuations();
|
||||
// compute mean free path via cross section per volume
|
||||
G4double ComputeMeanFreePath(const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
const G4Material*,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
G4double HighEnergyLimit();
|
||||
// generic cross section per element
|
||||
inline G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
|
||||
const G4Element*,
|
||||
G4double kinEnergy,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
G4double LowEnergyLimit();
|
||||
// atom can be selected effitiantly if element selectors are initialised
|
||||
inline const G4Element* SelectRandomAtom(const G4MaterialCutsCouple*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
void SetHighEnergyLimit(G4double);
|
||||
// this method can be used only in the case if generic method to compute
|
||||
// cross section per volume is used and not overwritten in derived class
|
||||
inline const G4Element* SelectRandomAtom(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
|
||||
void SetLowEnergyLimit(G4double);
|
||||
// select isotope in order to have precise mass of the nucleus
|
||||
inline G4int SelectIsotopeNumber(const G4Element*);
|
||||
|
||||
G4double MaxSecondaryKinEnergy(const G4DynamicParticle* dynParticle);
|
||||
//------------------------------------------------------------------------
|
||||
// Get/Set methods
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
const G4Element* SelectRandomAtom(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double kineticEnergy,
|
||||
G4double cutEnergy = 0.0,
|
||||
G4double maxEnergy = DBL_MAX);
|
||||
inline G4VEmFluctuationModel* GetModelOfFluctuations();
|
||||
|
||||
const G4String& GetName() const;
|
||||
inline G4double HighEnergyLimit() const;
|
||||
|
||||
inline G4double LowEnergyLimit() const;
|
||||
|
||||
inline G4double PolarAngleLimit() const;
|
||||
|
||||
inline G4double SecondaryThreshold() const;
|
||||
|
||||
inline G4bool LPMFlag() const;
|
||||
|
||||
inline void SetHighEnergyLimit(G4double);
|
||||
|
||||
inline void SetLowEnergyLimit(G4double);
|
||||
|
||||
inline void SetPolarAngleLimit(G4double);
|
||||
|
||||
inline void SetSecondaryThreshold(G4double);
|
||||
|
||||
inline void SetLPMFlag(G4bool val);
|
||||
|
||||
inline void ActivateNuclearStopping(G4bool);
|
||||
|
||||
inline G4double MaxSecondaryKinEnergy(const G4DynamicParticle* dynParticle);
|
||||
|
||||
inline const G4String& GetName() const;
|
||||
|
||||
inline void SetParticleChange(G4VParticleChange*, G4VEmFluctuationModel*);
|
||||
|
||||
protected:
|
||||
|
||||
const G4Element* GetCurrentElement() const;
|
||||
inline const G4Element* GetCurrentElement() const;
|
||||
|
||||
void SetCurrentElement(const G4Element*);
|
||||
inline void SetCurrentElement(const G4Element*);
|
||||
|
||||
private:
|
||||
|
||||
@@ -214,37 +289,75 @@ private:
|
||||
G4VEmModel & operator=(const G4VEmModel &right);
|
||||
G4VEmModel(const G4VEmModel&);
|
||||
|
||||
G4double lowLimit;
|
||||
G4double highLimit;
|
||||
G4double xsec[40];
|
||||
// ======== Parameters of the class fixed at construction =========
|
||||
|
||||
G4VEmFluctuationModel* fluc;
|
||||
|
||||
const G4String name;
|
||||
const G4Element* currentElement;
|
||||
|
||||
// ======== Parameters of the class fixed at initialisation =======
|
||||
|
||||
G4double lowLimit;
|
||||
G4double highLimit;
|
||||
G4double polarAngleLimit;
|
||||
G4double secondaryThreshold;
|
||||
G4bool theLPMflag;
|
||||
|
||||
G4int nSelectors;
|
||||
std::vector<G4EmElementSelector*> elmSelectors;
|
||||
|
||||
protected:
|
||||
|
||||
G4VParticleChange* pParticleChange;
|
||||
G4bool nuclearStopping;
|
||||
|
||||
// ======== Cashed values - may be state dependent ================
|
||||
|
||||
private:
|
||||
|
||||
const G4Element* currentElement;
|
||||
G4int nsec;
|
||||
std::vector<G4double> xsec;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::HighEnergyLimit()
|
||||
inline G4double G4VEmModel::HighEnergyLimit() const
|
||||
{
|
||||
return highLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::LowEnergyLimit()
|
||||
inline G4double G4VEmModel::LowEnergyLimit() const
|
||||
{
|
||||
return lowLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::PolarAngleLimit() const
|
||||
{
|
||||
return polarAngleLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::SecondaryThreshold() const
|
||||
{
|
||||
return secondaryThreshold;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4bool G4VEmModel::LPMFlag() const
|
||||
{
|
||||
return theLPMflag;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetHighEnergyLimit(G4double val)
|
||||
{
|
||||
highLimit = val;
|
||||
@@ -259,6 +372,48 @@ inline void G4VEmModel::SetLowEnergyLimit(G4double val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetPolarAngleLimit(G4double val)
|
||||
{
|
||||
polarAngleLimit = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetSecondaryThreshold(G4double val)
|
||||
{
|
||||
secondaryThreshold = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmModel::SetLPMFlag(G4bool val)
|
||||
{
|
||||
theLPMflag = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmModel::ActivateNuclearStopping(G4bool val)
|
||||
{
|
||||
nuclearStopping = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::ComputeCrossSectionPerAtom(
|
||||
const G4ParticleDefinition* part,
|
||||
const G4Element* elm,
|
||||
G4double kinEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
currentElement = elm;
|
||||
return ComputeCrossSectionPerAtom(part,kinEnergy,elm->GetZ(),elm->GetN(),
|
||||
cutEnergy,maxEnergy);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetParticleChange(G4VParticleChange* p,
|
||||
G4VEmFluctuationModel* f = 0)
|
||||
{
|
||||
@@ -284,11 +439,33 @@ inline G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::ComputeDEDXPerVolume(
|
||||
const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double,
|
||||
G4double)
|
||||
inline G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
|
||||
const G4Material*, G4double)
|
||||
{
|
||||
G4double q = p->GetPDGCharge()/CLHEP::eplus;
|
||||
return q*q;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p,
|
||||
const G4Material*, G4double)
|
||||
{
|
||||
return p->GetPDGCharge();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double&,G4double&,G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double,G4double)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
@@ -311,8 +488,8 @@ inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* c,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
return
|
||||
CrossSectionPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy,maxEnergy);
|
||||
return CrossSectionPerVolume(c->GetMaterial(),p,
|
||||
kinEnergy,cutEnergy,maxEnergy);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -327,20 +504,39 @@ inline G4double G4VEmModel::ComputeCrossSectionPerAtom(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline const G4Element* G4VEmModel::SelectRandomAtom(
|
||||
const G4Material* material,
|
||||
const G4ParticleDefinition* pd,
|
||||
G4double kinEnergy,
|
||||
G4double tcut,
|
||||
G4double tmax)
|
||||
inline
|
||||
const G4Element* G4VEmModel::SelectRandomAtom(const G4MaterialCutsCouple* couple,
|
||||
const G4ParticleDefinition* p,
|
||||
G4double kinEnergy,
|
||||
G4double cutEnergy,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
if(nSelectors > 0) {
|
||||
currentElement =
|
||||
elmSelectors[couple->GetIndex()]->SelectRandomAtom(kinEnergy);
|
||||
} else {
|
||||
currentElement = SelectRandomAtom(couple->GetMaterial(),p,kinEnergy,
|
||||
cutEnergy,maxEnergy);
|
||||
}
|
||||
return currentElement;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline
|
||||
const G4Element* G4VEmModel::SelectRandomAtom(const G4Material* material,
|
||||
const G4ParticleDefinition* pd,
|
||||
G4double kinEnergy,
|
||||
G4double tcut,
|
||||
G4double tmax)
|
||||
{
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
G4int nelm = material->GetNumberOfElements();
|
||||
currentElement = (*theElementVector)[nelm-1];
|
||||
if (nelm > 1) {
|
||||
G4int n = material->GetNumberOfElements() - 1;
|
||||
currentElement = (*theElementVector)[n];
|
||||
if (n > 0) {
|
||||
G4double x = G4UniformRand()*
|
||||
CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax);
|
||||
for(G4int i=0; i<nelm; i++) {
|
||||
G4VEmModel::CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax);
|
||||
for(G4int i=0; i<n; i++) {
|
||||
if (x <= xsec[i]) {
|
||||
currentElement = (*theElementVector)[i];
|
||||
break;
|
||||
@@ -352,6 +548,28 @@ inline const G4Element* G4VEmModel::SelectRandomAtom(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm)
|
||||
{
|
||||
G4int N = G4int(elm->GetN() + 0.5);
|
||||
G4int ni = elm->GetNumberOfIsotopes();
|
||||
if(ni > 0) {
|
||||
G4int idx = 0;
|
||||
if(ni > 1) {
|
||||
G4double* ab = currentElement->GetRelativeAbundanceVector();
|
||||
G4double x = G4UniformRand();
|
||||
for(; idx<ni; idx++) {
|
||||
x -= ab[idx];
|
||||
if (x <= 0.0) break;
|
||||
}
|
||||
if(idx >= ni) idx = ni - 1;
|
||||
}
|
||||
N = elm->GetIsotope(idx)->GetN();
|
||||
}
|
||||
return N;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline const G4Element* G4VEmModel::GetCurrentElement() const
|
||||
{
|
||||
return currentElement;
|
||||
@@ -366,11 +584,11 @@ inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4VEmModel::MaxSecondaryKinEnergy(
|
||||
const G4DynamicParticle* dynParticle)
|
||||
inline
|
||||
G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart)
|
||||
{
|
||||
return MaxSecondaryEnergy(dynParticle->GetDefinition(),
|
||||
dynParticle->GetKineticEnergy());
|
||||
return MaxSecondaryEnergy(dynPart->GetDefinition(),
|
||||
dynPart->GetKineticEnergy());
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -426,5 +644,11 @@ inline void G4VEmModel::DefineForRegion(const G4Region*)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*,
|
||||
const G4Material*, G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmProcess.hh,v 1.43 2007/10/29 08:38:58 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4VEmProcess.hh,v 1.47 2008/07/31 13:01:26 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -54,6 +54,7 @@
|
||||
// 25-09-07 More accurate handling zero xsect in
|
||||
// PostStepGetPhysicalInteractionLength (V.Ivanchenko)
|
||||
// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
|
||||
// 15-07-08 Reorder class members for further multi-thread development (VI)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -89,7 +90,7 @@ class G4VEmProcess : public G4VDiscreteProcess
|
||||
public:
|
||||
|
||||
G4VEmProcess(const G4String& name,
|
||||
G4ProcessType type = fElectromagnetic);
|
||||
G4ProcessType type = fElectromagnetic);
|
||||
|
||||
virtual ~G4VEmProcess();
|
||||
|
||||
@@ -122,70 +123,74 @@ public:
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
void PreparePhysicsTable(const G4ParticleDefinition&);
|
||||
// Initialise for build of tables
|
||||
void PreparePhysicsTable(const G4ParticleDefinition&);
|
||||
|
||||
void BuildPhysicsTable(const G4ParticleDefinition&);
|
||||
// Build physics table during initialisation
|
||||
void BuildPhysicsTable(const G4ParticleDefinition&);
|
||||
|
||||
// Store PhysicsTable in a file.
|
||||
// Return false in case of failure at I/O
|
||||
G4bool StorePhysicsTable(const G4ParticleDefinition*,
|
||||
const G4String& directory,
|
||||
G4bool ascii = false);
|
||||
// Store PhysicsTable in a file.
|
||||
// Return false in case of failure at I/O
|
||||
|
||||
// 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.
|
||||
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.
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Specific methods for Discrete EM post step simulation
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
inline G4double MicroscopicCrossSection(G4double kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
// It returns the cross section of the process for energy/ material
|
||||
|
||||
inline G4double ComputeCrossSectionPerAtom(G4double kineticEnergy,
|
||||
G4double Z, G4double A=0.,
|
||||
G4double cut=0.0);
|
||||
// It returns the cross section of the process per atom
|
||||
|
||||
inline G4double MeanFreePath(const G4Track& track);
|
||||
// It returns the cross section per volume for energy/ material
|
||||
G4double CrossSectionPerVolume(G4double kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
|
||||
// implementation of virtual method
|
||||
virtual G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
// It returns the cross section of the process per atom
|
||||
inline G4double ComputeCrossSectionPerAtom(G4double kineticEnergy,
|
||||
G4double Z, G4double A=0.,
|
||||
G4double cut=0.0);
|
||||
|
||||
inline G4double MeanFreePath(const G4Track& track);
|
||||
|
||||
inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy,
|
||||
size_t& idxRegion) const;
|
||||
|
||||
// It returns cross section per volume
|
||||
inline G4double GetLambda(G4double& kinEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
// It returns the Lambda of the process
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Specific methods to build and access Physics Tables
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// Binning for lambda table
|
||||
inline void SetLambdaBinning(G4int nbins);
|
||||
inline G4int LambdaBinning() const;
|
||||
// Binning for lambda table
|
||||
|
||||
// Min kinetic energy for tables
|
||||
inline void SetMinKinEnergy(G4double e);
|
||||
inline G4double MinKinEnergy() const;
|
||||
// Min kinetic energy for tables
|
||||
|
||||
// Max kinetic energy for tables
|
||||
inline void SetMaxKinEnergy(G4double e);
|
||||
inline G4double MaxKinEnergy() const;
|
||||
// Max kinetic energy for tables
|
||||
|
||||
inline void SetPolarAngleLimit(G4double a);
|
||||
inline G4double PolarAngleLimit() const;
|
||||
|
||||
inline const G4PhysicsTable* LambdaTable() const;
|
||||
|
||||
@@ -200,20 +205,20 @@ public:
|
||||
// Specific methods to set, access, modify models
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
inline void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
|
||||
// Add EM model coupled for the region
|
||||
inline void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
|
||||
|
||||
inline void SetModel(G4VEmModel*);
|
||||
// Assign a model to a process
|
||||
inline void SetModel(G4VEmModel*);
|
||||
|
||||
inline G4VEmModel* Model();
|
||||
// return the assigned model
|
||||
inline G4VEmModel* Model();
|
||||
|
||||
inline void UpdateEmModel(const G4String&, G4double, G4double);
|
||||
// Define new energy range for the model identified by the name
|
||||
inline void UpdateEmModel(const G4String&, G4double, G4double);
|
||||
|
||||
// Access to models
|
||||
inline G4VEmModel* GetModelByIndex(G4int idx = 0);
|
||||
inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Get/set parameters used for simulation of energy loss
|
||||
@@ -236,6 +241,8 @@ protected:
|
||||
|
||||
G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*);
|
||||
|
||||
inline G4ParticleChangeForGamma* GetParticleChange();
|
||||
|
||||
inline void SetParticle(const G4ParticleDefinition* p);
|
||||
|
||||
inline void SetSecondaryParticle(const G4ParticleDefinition* p);
|
||||
@@ -277,30 +284,23 @@ private:
|
||||
G4VEmProcess(G4VEmProcess &);
|
||||
G4VEmProcess & operator=(const G4VEmProcess &right);
|
||||
|
||||
// =====================================================================
|
||||
|
||||
protected:
|
||||
|
||||
G4ParticleChangeForGamma fParticleChange;
|
||||
|
||||
private:
|
||||
|
||||
std::vector<G4DynamicParticle*> secParticles;
|
||||
// ======== Parameters of the class fixed at construction =========
|
||||
|
||||
G4EmModelManager* modelManager;
|
||||
G4VEmModel* selectedModel;
|
||||
const G4ParticleDefinition* theGamma;
|
||||
const G4ParticleDefinition* theElectron;
|
||||
const G4ParticleDefinition* thePositron;
|
||||
const G4ParticleDefinition* secondaryParticle;
|
||||
|
||||
G4bool buildLambdaTable;
|
||||
|
||||
// ======== Parameters of the class fixed at initialisation =======
|
||||
|
||||
// tables and vectors
|
||||
G4PhysicsTable* theLambdaTable;
|
||||
G4double* theEnergyOfCrossSectionMax;
|
||||
G4double* theCrossSectionMax;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
const G4ParticleDefinition* secondaryParticle;
|
||||
const G4ParticleDefinition* theGamma;
|
||||
const G4ParticleDefinition* theElectron;
|
||||
const G4ParticleDefinition* thePositron;
|
||||
|
||||
const std::vector<G4double>* theCuts;
|
||||
const std::vector<G4double>* theCutsGamma;
|
||||
const std::vector<G4double>* theCutsElectron;
|
||||
@@ -311,6 +311,29 @@ private:
|
||||
G4double minKinEnergy;
|
||||
G4double maxKinEnergy;
|
||||
G4double lambdaFactor;
|
||||
G4double polarAngleLimit;
|
||||
|
||||
G4bool integral;
|
||||
G4bool applyCuts;
|
||||
G4bool startFromNull;
|
||||
|
||||
G4int nRegions;
|
||||
std::vector<G4Region*> regions;
|
||||
std::vector<G4bool> flagsDeexcitation;
|
||||
|
||||
// ======== Cashed values - may be state dependent ================
|
||||
|
||||
protected:
|
||||
|
||||
G4ParticleChangeForGamma fParticleChange;
|
||||
|
||||
private:
|
||||
|
||||
std::vector<G4DynamicParticle*> secParticles;
|
||||
|
||||
G4VEmModel* selectedModel;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
|
||||
// cash
|
||||
const G4Material* currentMaterial;
|
||||
@@ -321,15 +344,6 @@ private:
|
||||
G4double preStepKinEnergy;
|
||||
G4double preStepLambda;
|
||||
|
||||
G4bool integral;
|
||||
G4bool buildLambdaTable;
|
||||
G4bool applyCuts;
|
||||
G4bool startFromNull;
|
||||
|
||||
G4int nRegions;
|
||||
std::vector<G4Region*> regions;
|
||||
std::vector<G4bool> flagsDeexcitation;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -357,7 +371,7 @@ inline void G4VEmProcess::InitialiseStep(const G4Track& track)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
DefineMaterial(couple);
|
||||
return GetCurrentLambda(kineticEnergy);
|
||||
@@ -488,9 +502,16 @@ inline void G4VEmProcess::SetLambdaFactor(G4double val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VEmProcess::GetModelByIndex(G4int idx)
|
||||
inline G4VEmModel* G4VEmProcess::GetModelByIndex(G4int idx, G4bool ver)
|
||||
{
|
||||
return modelManager->GetModel(idx);
|
||||
return modelManager->GetModel(idx, ver);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4ParticleChangeForGamma* G4VEmProcess::GetParticleChange()
|
||||
{
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -592,6 +613,22 @@ inline G4double G4VEmProcess::MaxKinEnergy() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::SetPolarAngleLimit(G4double val)
|
||||
{
|
||||
if(val < 0.0) polarAngleLimit = 0.0;
|
||||
else if(val > pi) polarAngleLimit = pi;
|
||||
else polarAngleLimit = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEmProcess::PolarAngleLimit() const
|
||||
{
|
||||
return polarAngleLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEmProcess::ActivateDeexcitation(G4bool, const G4Region*)
|
||||
{}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VEnergyLoss.hh,v 1.18 2006/06/29 19:54:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEnergyLossProcess.hh,v 1.76 2007/11/07 18:38:49 vnivanch Exp $
|
||||
// $Id: G4VEnergyLossProcess.hh,v 1.83 2008/09/12 16:19:01 vnivanch Exp $
|
||||
// GEANT4 tag $Name:
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
@@ -78,6 +78,7 @@
|
||||
// 25-09-07 More accurate handling zero xsect in
|
||||
// PostStepGetPhysicalInteractionLength (V.Ivanchenko)
|
||||
// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
|
||||
// 15-07-08 Reorder class members for further multi-thread development (VI)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -140,19 +141,17 @@ protected:
|
||||
//------------------------------------------------------------------------
|
||||
// Methods with standard implementation; may be overwritten if needed
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
protected:
|
||||
|
||||
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*,
|
||||
const G4Material*, G4double cut);
|
||||
|
||||
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double& eloss,
|
||||
G4double& length);
|
||||
//------------------------------------------------------------------------
|
||||
// Virtual methods common to all EM ContinuousDiscrete processes
|
||||
// Further inheritance is not assumed
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Generic methods common to all ContinuousDiscrete processes
|
||||
//------------------------------------------------------------------------
|
||||
public:
|
||||
|
||||
void PrintInfoDefinition();
|
||||
@@ -161,6 +160,16 @@ public:
|
||||
|
||||
void BuildPhysicsTable(const G4ParticleDefinition&);
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(const G4Track&,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection);
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
|
||||
@@ -207,28 +216,10 @@ public:
|
||||
const G4DynamicParticle* dp,
|
||||
G4double length);
|
||||
|
||||
|
||||
virtual G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection
|
||||
);
|
||||
|
||||
virtual G4double PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition
|
||||
);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Specific methods to build and access Physics Tables
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
G4double MicroscopicCrossSection(G4double kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
|
||||
G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted);
|
||||
|
||||
G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted);
|
||||
@@ -298,8 +289,9 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// Add EM model coupled with fluctuation model for the region
|
||||
inline void AddEmModel(G4int, G4VEmModel*, G4VEmFluctuationModel* fluc = 0,
|
||||
const G4Region* region = 0);
|
||||
inline void AddEmModel(G4int, G4VEmModel*,
|
||||
G4VEmFluctuationModel* fluc = 0,
|
||||
const G4Region* region = 0);
|
||||
|
||||
// Assign a model to a process
|
||||
inline void SetEmModel(G4VEmModel*, G4int index=1);
|
||||
@@ -317,7 +309,7 @@ public:
|
||||
inline void UpdateEmModel(const G4String&, G4double, G4double);
|
||||
|
||||
// Access to models
|
||||
inline G4VEmModel* GetModelByIndex(G4int idx = 0);
|
||||
inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
|
||||
|
||||
inline G4int NumberOfModels();
|
||||
|
||||
@@ -351,18 +343,12 @@ public:
|
||||
virtual void ActivateDeexcitation(G4bool, const G4Region* region = 0);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Run time method for simulation of ionisation
|
||||
// Public interface to helper functions
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
inline G4double SampleRange();
|
||||
inline
|
||||
G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idx) const;
|
||||
|
||||
inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idx) const;
|
||||
|
||||
|
||||
// Set scaling parameters
|
||||
inline void SetDynamicMassCharge(G4double massratio, G4double charge2ratio);
|
||||
|
||||
// Helper functions
|
||||
inline G4double MeanFreePath(const G4Track& track);
|
||||
|
||||
inline G4double ContinuousStepLimit(const G4Track& track,
|
||||
@@ -370,18 +356,32 @@ public:
|
||||
G4double currentMinimumStep,
|
||||
G4double& currentSafety);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Run time method for simulation of ionisation
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
// sample range at the end of a step
|
||||
inline G4double SampleRange();
|
||||
|
||||
// Set scaling parameters for ions is needed to G4EmCalculator
|
||||
inline void SetDynamicMassCharge(G4double massratio, G4double charge2ratio);
|
||||
|
||||
// Access to cross section table
|
||||
G4double CrossSectionPerVolume(G4double kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple);
|
||||
|
||||
protected:
|
||||
|
||||
G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*,
|
||||
G4double cut);
|
||||
|
||||
inline virtual void InitialiseMassCharge(const G4Track&);
|
||||
inline G4ParticleChangeForLoss* GetParticleChange();
|
||||
|
||||
inline void SetParticle(const G4ParticleDefinition* p);
|
||||
|
||||
inline void SetSecondaryParticle(const G4ParticleDefinition* p);
|
||||
|
||||
inline G4VEmModel* SelectModel(G4double kinEnergy);
|
||||
inline void SelectModel(G4double kinEnergy);
|
||||
|
||||
inline size_t CurrentMaterialCutsCoupleIndex() const;
|
||||
|
||||
@@ -389,14 +389,27 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
// Clear tables
|
||||
//------------------------------------------------------------------------
|
||||
// Management of tables
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
void Clear();
|
||||
|
||||
inline void InitialiseStep(const G4Track&);
|
||||
G4bool StoreTable(const G4ParticleDefinition* p,
|
||||
G4PhysicsTable*, G4bool ascii,
|
||||
const G4String& directory,
|
||||
const G4String& tname);
|
||||
|
||||
G4bool RetrieveTable(const G4ParticleDefinition* p,
|
||||
G4PhysicsTable*, G4bool ascii,
|
||||
const G4String& directory,
|
||||
const G4String& tname,
|
||||
G4bool mandatory);
|
||||
|
||||
// define material and indexes
|
||||
inline void DefineMaterial(const G4MaterialCutsCouple* couple);
|
||||
|
||||
// Returnd values for scaled energy and base particles mass
|
||||
// Returnd values for scaled energy using mass of the base particle
|
||||
//
|
||||
inline G4double GetDEDXForScaledEnergy(G4double scaledKinEnergy);
|
||||
inline G4double GetSubDEDXForScaledEnergy(G4double scaledKinEnergy);
|
||||
@@ -413,22 +426,26 @@ private:
|
||||
G4VEnergyLossProcess(G4VEnergyLossProcess &);
|
||||
G4VEnergyLossProcess & operator=(const G4VEnergyLossProcess &right);
|
||||
|
||||
// =====================================================================
|
||||
// ======== Parameters of the class fixed at construction =========
|
||||
|
||||
protected:
|
||||
G4EmModelManager* modelManager;
|
||||
G4SafetyHelper* safetyHelper;
|
||||
|
||||
G4ParticleChangeForLoss fParticleChange;
|
||||
const G4ParticleDefinition* secondaryParticle;
|
||||
const G4ParticleDefinition* theElectron;
|
||||
const G4ParticleDefinition* thePositron;
|
||||
const G4ParticleDefinition* theGenericIon;
|
||||
|
||||
private:
|
||||
G4PhysicsVector* vstrag;
|
||||
|
||||
// ======== Parameters of the class fixed at initialisation =======
|
||||
|
||||
G4EmModelManager* modelManager;
|
||||
std::vector<G4VEmModel*> emModels;
|
||||
G4VEmFluctuationModel* fluctModel;
|
||||
std::vector<const G4Region*> scoffRegions;
|
||||
G4int nSCoffRegions;
|
||||
G4int* idxSCoffRegions;
|
||||
std::vector<G4DynamicParticle*> secParticles;
|
||||
std::vector<G4Track*> scTracks;
|
||||
|
||||
std::vector<G4VEnergyLossProcess*> scProcesses;
|
||||
G4int nProcesses;
|
||||
|
||||
@@ -452,54 +469,62 @@ private:
|
||||
const G4DataVector* theCuts;
|
||||
const G4DataVector* theSubCuts;
|
||||
|
||||
G4SafetyHelper* safetyHelper;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
const G4ParticleDefinition* baseParticle;
|
||||
const G4ParticleDefinition* secondaryParticle;
|
||||
const G4ParticleDefinition* theElectron;
|
||||
const G4ParticleDefinition* thePositron;
|
||||
|
||||
G4PhysicsVector* vstrag;
|
||||
|
||||
// cash
|
||||
const G4Material* currentMaterial;
|
||||
const G4MaterialCutsCouple* currentCouple;
|
||||
size_t currentMaterialIndex;
|
||||
|
||||
G4int nBins;
|
||||
G4int nBinsCSDA;
|
||||
G4int nWarnings;
|
||||
|
||||
G4double lowestKinEnergy;
|
||||
G4double minKinEnergy;
|
||||
G4double maxKinEnergy;
|
||||
G4double maxKinEnergyCSDA;
|
||||
|
||||
G4double linLossLimit;
|
||||
G4double minSubRange;
|
||||
G4double dRoverRange;
|
||||
G4double finalRange;
|
||||
G4double lambdaFactor;
|
||||
|
||||
G4bool lossFluctuationFlag;
|
||||
G4bool rndmStepFlag;
|
||||
G4bool tablesAreBuilt;
|
||||
G4bool integral;
|
||||
G4bool isIon;
|
||||
G4bool isIonisation;
|
||||
G4bool useSubCutoff;
|
||||
|
||||
protected:
|
||||
|
||||
G4ParticleChangeForLoss fParticleChange;
|
||||
|
||||
// ======== Cashed values - may be state dependent ================
|
||||
|
||||
private:
|
||||
|
||||
std::vector<G4DynamicParticle*> secParticles;
|
||||
std::vector<G4Track*> scTracks;
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
|
||||
G4VEmModel* currentModel;
|
||||
const G4Material* currentMaterial;
|
||||
const G4MaterialCutsCouple* currentCouple;
|
||||
size_t currentMaterialIndex;
|
||||
|
||||
G4int nWarnings;
|
||||
|
||||
G4double massRatio;
|
||||
G4double reduceFactor;
|
||||
G4double chargeSquare;
|
||||
G4double chargeSqRatio;
|
||||
|
||||
G4double preStepLambda;
|
||||
G4double fRange;
|
||||
G4double preStepKinEnergy;
|
||||
G4double preStepScaledEnergy;
|
||||
G4double linLossLimit;
|
||||
G4double minSubRange;
|
||||
G4double dRoverRange;
|
||||
G4double finalRange;
|
||||
G4double lambdaFactor;
|
||||
G4double mfpKinEnergy;
|
||||
|
||||
G4GPILSelection aGPILSelection;
|
||||
|
||||
G4bool lossFluctuationFlag;
|
||||
G4bool rndmStepFlag;
|
||||
G4bool tablesAreBuilt;
|
||||
G4bool integral;
|
||||
G4bool isIonisation;
|
||||
G4bool useSubCutoff;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -518,22 +543,6 @@ inline void G4VEnergyLossProcess::DefineMaterial(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEnergyLossProcess::InitialiseStep(const G4Track& track)
|
||||
{
|
||||
InitialiseMassCharge(track);
|
||||
preStepKinEnergy = track.GetKineticEnergy();
|
||||
preStepScaledEnergy = preStepKinEnergy*massRatio;
|
||||
DefineMaterial(track.GetMaterialCutsCouple());
|
||||
if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEnergyLossProcess::InitialiseMassCharge(const G4Track&)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEnergyLossProcess::GetDEDX(G4double& kineticEnergy,
|
||||
const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
@@ -788,9 +797,9 @@ inline G4double G4VEnergyLossProcess::MinPrimaryEnergy(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VEnergyLossProcess::SelectModel(G4double kinEnergy)
|
||||
inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy)
|
||||
{
|
||||
return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
|
||||
currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -803,6 +812,13 @@ inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4ParticleChangeForLoss* G4VEnergyLossProcess::GetParticleChange()
|
||||
{
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const
|
||||
{
|
||||
return particle;
|
||||
@@ -824,15 +840,6 @@ inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() con
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEnergyLossProcess::CorrectionsAlongStep(
|
||||
const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double&,
|
||||
G4double&)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
|
||||
{
|
||||
return theDEDXTable;
|
||||
@@ -921,15 +928,14 @@ inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,
|
||||
G4double charge2ratio)
|
||||
inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,
|
||||
G4double charge2ratio)
|
||||
{
|
||||
massRatio = massratio;
|
||||
chargeSqRatio = charge2ratio;
|
||||
chargeSquare = charge2ratio*eplus*eplus;
|
||||
if(chargeSqRatio > 0.0) reduceFactor = 1.0/(chargeSqRatio*massRatio);
|
||||
reduceFactor = 1.0/(chargeSqRatio*massRatio);
|
||||
}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VEnergyLossProcess::GetCurrentRange() const
|
||||
@@ -939,6 +945,7 @@ inline G4double G4VEnergyLossProcess::GetCurrentRange() const
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline
|
||||
void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p,
|
||||
G4VEmFluctuationModel* fluc,
|
||||
const G4Region* region)
|
||||
@@ -949,9 +956,10 @@ void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx)
|
||||
inline
|
||||
G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx, G4bool ver)
|
||||
{
|
||||
return modelManager->GetModel(idx);
|
||||
return modelManager->GetModel(idx, ver);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VMscModel.hh,v 1.4 2008/03/10 10:39:28 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class header file
|
||||
//
|
||||
//
|
||||
// File name: G4VMscModel
|
||||
//
|
||||
// Author: Vladimir Ivanchenko
|
||||
//
|
||||
// Creation date: 07.03.2008
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
// General interface to msc models
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#ifndef G4VMscModel_h
|
||||
#define G4VMscModel_h 1
|
||||
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4MscStepLimitType.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VMscModel : public G4VEmModel
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
G4VMscModel(const G4String& nam);
|
||||
|
||||
virtual ~G4VMscModel();
|
||||
|
||||
inline void SetStepLimitType(G4MscStepLimitType);
|
||||
|
||||
inline void SetLateralDisplasmentFlag(G4bool val);
|
||||
|
||||
inline void SetRangeFactor(G4double);
|
||||
|
||||
inline void SetGeomFactor(G4double);
|
||||
|
||||
inline void SetSkin(G4double);
|
||||
|
||||
private:
|
||||
|
||||
// hide assignment operator
|
||||
G4VMscModel & operator=(const G4VMscModel &right);
|
||||
G4VMscModel(const G4VMscModel&);
|
||||
|
||||
protected:
|
||||
|
||||
G4double facrange;
|
||||
G4double facgeom;
|
||||
G4double facsafety;
|
||||
G4double skin;
|
||||
G4double dtrl;
|
||||
G4double lambdalimit;
|
||||
|
||||
G4MscStepLimitType steppingAlgorithm;
|
||||
|
||||
G4bool samplez;
|
||||
G4bool latDisplasment;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VMscModel::SetLateralDisplasmentFlag(G4bool val)
|
||||
{
|
||||
latDisplasment = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VMscModel::SetSkin(G4double val)
|
||||
{
|
||||
skin = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VMscModel::SetRangeFactor(G4double val)
|
||||
{
|
||||
facrange = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VMscModel::SetGeomFactor(G4double val)
|
||||
{
|
||||
facgeom = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline void G4VMscModel::SetStepLimitType(G4MscStepLimitType val)
|
||||
{
|
||||
steppingAlgorithm = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VMultipleScattering.hh,v 1.48 2007/10/29 08:38:58 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4VMultipleScattering.hh,v 1.54 2008/07/31 13:01:26 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -62,6 +62,7 @@
|
||||
// 13-05-06 Add method to access model by index (V.Ivanchenko)
|
||||
// 12-02-07 Add get/set skin (V.Ivanchenko)
|
||||
// 27-10-07 Virtual functions moved to source (V.Ivanchenko)
|
||||
// 15-07-08 Reorder class members for further multi-thread development (VI)
|
||||
//
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
@@ -71,7 +72,6 @@
|
||||
#define G4VMultipleScattering_h 1
|
||||
|
||||
#include "G4VContinuousDiscreteProcess.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialCutsCouple.hh"
|
||||
@@ -94,7 +94,7 @@ class G4VMultipleScattering : public G4VContinuousDiscreteProcess
|
||||
public:
|
||||
|
||||
G4VMultipleScattering(const G4String& name = "msc",
|
||||
G4ProcessType type = fElectromagnetic);
|
||||
G4ProcessType type = fElectromagnetic);
|
||||
|
||||
virtual ~G4VMultipleScattering();
|
||||
|
||||
@@ -103,7 +103,6 @@ public:
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
|
||||
// True for all charged particles
|
||||
|
||||
virtual void PrintInfo() = 0;
|
||||
|
||||
@@ -111,9 +110,6 @@ protected:
|
||||
|
||||
virtual void InitialiseProcess(const G4ParticleDefinition*) = 0;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Methods with standard implementation; may be overwritten if needed
|
||||
//------------------------------------------------------------------------
|
||||
public:
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
@@ -137,7 +133,7 @@ public:
|
||||
// Return false in case of failure at I/O
|
||||
G4bool StorePhysicsTable(const G4ParticleDefinition*,
|
||||
const G4String& directory,
|
||||
G4bool ascii = false);
|
||||
G4bool ascii = false);
|
||||
|
||||
// Retrieve Physics from a file.
|
||||
// (return true if the Physics Table can be build by using file)
|
||||
@@ -146,7 +142,7 @@ public:
|
||||
// should be placed under the directory specifed by the argument.
|
||||
G4bool RetrievePhysicsTable(const G4ParticleDefinition*,
|
||||
const G4String& directory,
|
||||
G4bool ascii);
|
||||
G4bool ascii);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Specific methods for msc processes
|
||||
@@ -155,12 +151,12 @@ public:
|
||||
// The function overloads the corresponding function of the base
|
||||
// class.It limits the step near to boundaries only
|
||||
// and invokes the method GetMscContinuousStepLimit at every step.
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
virtual G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimalStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection);
|
||||
G4double previousStepSize,
|
||||
G4double currentMinimalStep,
|
||||
G4double& currentSafety,
|
||||
G4GPILSelection* selection);
|
||||
|
||||
// The function overloads the corresponding function of the base
|
||||
// class.
|
||||
@@ -187,7 +183,6 @@ public:
|
||||
|
||||
inline void SetMinKinEnergy(G4double e);
|
||||
inline G4double MinKinEnergy() const;
|
||||
// Print out of the class parameters
|
||||
|
||||
inline void SetMaxKinEnergy(G4double e);
|
||||
inline G4double MaxKinEnergy() const;
|
||||
@@ -213,26 +208,23 @@ public:
|
||||
size_t& idxRegion) const;
|
||||
|
||||
// Access to models
|
||||
inline G4VEmModel* GetModelByIndex(G4int idx = 0);
|
||||
inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Parameters for simulation of multiple scattering
|
||||
// Set parameters for simulation of multiple scattering
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
inline void SetLateralDisplasmentFlag(G4bool val);
|
||||
// lateral displacement to be/not to be computed
|
||||
|
||||
inline void SetSkin(G4double val);
|
||||
// skin parameter
|
||||
|
||||
inline void SetRangeFactor(G4double val);
|
||||
// FactorRange parameter
|
||||
|
||||
inline void SetGeomFactor(G4double val);
|
||||
// FactorRange parameter
|
||||
|
||||
inline void SetPolarAngleLimit(G4double val);
|
||||
|
||||
inline void SetStepLimitType(G4MscStepLimitType val);
|
||||
// FactorRange parameter
|
||||
|
||||
protected:
|
||||
|
||||
@@ -251,11 +243,12 @@ protected:
|
||||
G4double currentMinimalStep,
|
||||
G4double& currentSafety);
|
||||
|
||||
inline G4double GetLambda(const G4ParticleDefinition* p, G4double& kineticEnergy);
|
||||
inline G4double GetLambda(const G4ParticleDefinition* p,
|
||||
G4double& kineticEnergy);
|
||||
|
||||
// This method is used for tracking, it returns step limit
|
||||
inline G4double GetMscContinuousStepLimit(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4double scaledKinEnergy,
|
||||
G4double currentMinimalStep,
|
||||
G4double& currentSafety);
|
||||
|
||||
@@ -263,21 +256,24 @@ protected:
|
||||
// Select concrete model
|
||||
|
||||
inline const G4MaterialCutsCouple* CurrentMaterialCutsCouple() const;
|
||||
// Return current G4MaterialCutsCouple
|
||||
|
||||
inline void DefineMaterial(const G4MaterialCutsCouple* couple);
|
||||
// define current material
|
||||
inline void DefineMaterial(const G4MaterialCutsCouple* couple);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Parameters for simulation of multiple scattering
|
||||
// Access parameters of multiple scattering
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
inline G4ParticleChangeForMSC* GetParticleChange();
|
||||
|
||||
inline G4double Skin() const;
|
||||
|
||||
inline G4double RangeFactor() const;
|
||||
|
||||
inline G4double GeomFactor() const;
|
||||
|
||||
inline G4double PolarAngleLimit() const;
|
||||
|
||||
inline G4MscStepLimitType StepLimitType() const;
|
||||
|
||||
inline G4bool LateralDisplasmentFlag() const;
|
||||
@@ -289,26 +285,15 @@ private:
|
||||
G4VMultipleScattering(G4VMultipleScattering &);
|
||||
G4VMultipleScattering & operator=(const G4VMultipleScattering &right);
|
||||
|
||||
// =====================================================================
|
||||
|
||||
protected:
|
||||
|
||||
G4GPILSelection valueGPILSelectionMSC;
|
||||
G4ParticleChangeForMSC fParticleChange;
|
||||
|
||||
private:
|
||||
// ======== Parameters of the class fixed at construction =========
|
||||
|
||||
G4EmModelManager* modelManager;
|
||||
G4VEmModel* currentModel;
|
||||
G4bool buildLambdaTable;
|
||||
|
||||
// ======== Parameters of the class fixed at initialisation =======
|
||||
|
||||
G4PhysicsTable* theLambdaTable;
|
||||
|
||||
// cache
|
||||
const G4ParticleDefinition* firstParticle;
|
||||
const G4ParticleDefinition* currentParticle;
|
||||
const G4MaterialCutsCouple* currentCouple;
|
||||
size_t currentMaterialIndex;
|
||||
|
||||
G4int nBins;
|
||||
|
||||
G4MscStepLimitType stepLimit;
|
||||
|
||||
@@ -317,15 +302,35 @@ private:
|
||||
G4double skin;
|
||||
G4double facrange;
|
||||
G4double facgeom;
|
||||
G4double polarAngleLimit;
|
||||
|
||||
G4int nBins;
|
||||
|
||||
G4bool latDisplasment;
|
||||
G4bool buildLambdaTable;
|
||||
|
||||
// ======== Cashed values - may be state dependent ================
|
||||
|
||||
protected:
|
||||
|
||||
G4GPILSelection valueGPILSelectionMSC;
|
||||
G4ParticleChangeForMSC fParticleChange;
|
||||
|
||||
private:
|
||||
|
||||
G4VEmModel* currentModel;
|
||||
|
||||
// cache
|
||||
const G4ParticleDefinition* currentParticle;
|
||||
const G4MaterialCutsCouple* currentCouple;
|
||||
size_t currentMaterialIndex;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
|
||||
inline
|
||||
void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
|
||||
{
|
||||
if(couple != currentCouple) {
|
||||
currentCouple = couple;
|
||||
@@ -337,15 +342,14 @@ inline void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* co
|
||||
|
||||
inline G4double G4VMultipleScattering::GetMscContinuousStepLimit(
|
||||
const G4Track& track,
|
||||
G4double,
|
||||
G4double currentMinimalStep,
|
||||
G4double&)
|
||||
G4double scaledKinEnergy,
|
||||
G4double currentMinimalStep,
|
||||
G4double&)
|
||||
{
|
||||
G4double x = currentMinimalStep;
|
||||
G4double e = track.GetKineticEnergy();
|
||||
DefineMaterial(track.GetMaterialCutsCouple());
|
||||
currentModel = SelectModel(e);
|
||||
if(x > 0.0 && e > 0.0) {
|
||||
currentModel = SelectModel(scaledKinEnergy);
|
||||
if(x > 0.0 && scaledKinEnergy > 0.0) {
|
||||
G4double tPathLength =
|
||||
currentModel->ComputeTruePathLengthLimit(track, theLambdaTable, x);
|
||||
if (tPathLength < x) valueGPILSelectionMSC = CandidateForSelection;
|
||||
@@ -366,12 +370,14 @@ inline G4double G4VMultipleScattering::ContinuousStepLimit(
|
||||
G4double& currentSafety)
|
||||
{
|
||||
return GetMscContinuousStepLimit(track,previousStepSize,currentMinimalStep,
|
||||
currentSafety);
|
||||
currentSafety);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p, G4double& e)
|
||||
inline
|
||||
G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p,
|
||||
G4double& e)
|
||||
{
|
||||
G4double x;
|
||||
if(theLambdaTable) {
|
||||
@@ -395,7 +401,7 @@ inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
|
||||
G4double kinEnergy, size_t& idxRegion) const
|
||||
G4double kinEnergy, size_t& idxRegion) const
|
||||
{
|
||||
return modelManager->SelectModel(kinEnergy, idxRegion);
|
||||
}
|
||||
@@ -458,6 +464,13 @@ inline void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4ParticleChangeForMSC* G4VMultipleScattering::GetParticleChange()
|
||||
{
|
||||
return &fParticleChange;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VMultipleScattering::Skin() const
|
||||
{
|
||||
return skin;
|
||||
@@ -467,13 +480,8 @@ inline G4double G4VMultipleScattering::Skin() const
|
||||
|
||||
inline void G4VMultipleScattering::SetSkin(G4double val)
|
||||
{
|
||||
if(val <= 0.99999) {
|
||||
skin = 0.0;
|
||||
stepLimit = fUseSafety;
|
||||
} else {
|
||||
skin = val;
|
||||
stepLimit = fUseDistanceToBoundary;
|
||||
}
|
||||
if(val < 1.0) skin = 0.0;
|
||||
else skin = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -506,6 +514,22 @@ inline void G4VMultipleScattering::SetGeomFactor(G4double val)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4double G4VMultipleScattering::PolarAngleLimit() const
|
||||
{
|
||||
return polarAngleLimit;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VMultipleScattering::SetPolarAngleLimit(G4double val)
|
||||
{
|
||||
if(val < 0.0) polarAngleLimit = 0.0;
|
||||
else if(val > pi) polarAngleLimit = pi;
|
||||
else polarAngleLimit = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const
|
||||
{
|
||||
return stepLimit;
|
||||
@@ -516,19 +540,14 @@ inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const
|
||||
inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val)
|
||||
{
|
||||
stepLimit = val;
|
||||
if(val == fMinimal) {
|
||||
skin = 0;
|
||||
facrange = 0.2;
|
||||
} else if(val == fUseSafety) {
|
||||
skin = 0;
|
||||
}
|
||||
if(val == fMinimal) facrange = 0.2;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
|
||||
{
|
||||
buildLambdaTable = val;
|
||||
buildLambdaTable = val;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -560,14 +579,15 @@ inline void G4VMultipleScattering::AddEmModel(G4int order, G4VEmModel* p,
|
||||
{
|
||||
G4VEmFluctuationModel* fm = 0;
|
||||
modelManager->AddEmModel(order, p, fm, region);
|
||||
if(p)p->SetParticleChange(pParticleChange);
|
||||
if(p) p->SetParticleChange(pParticleChange);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
inline G4VEmModel* G4VMultipleScattering::GetModelByIndex(G4int idx)
|
||||
inline
|
||||
G4VEmModel* G4VMultipleScattering::GetModelByIndex(G4int idx, G4bool ver)
|
||||
{
|
||||
return modelManager->GetModel(idx);
|
||||
return modelManager->GetModel(idx, ver);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ionEffectiveCharge.hh,v 1.8 2006/08/15 16:21:39 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4ionEffectiveCharge.hh,v 1.12 2008/09/20 19:39:34 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -55,9 +55,10 @@
|
||||
#define G4ionEffectiveCharge_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
class G4Material;
|
||||
class G4ParticleDefinition;
|
||||
class G4NistManager;
|
||||
|
||||
class G4ionEffectiveCharge
|
||||
{
|
||||
@@ -83,7 +84,15 @@ private:
|
||||
G4ionEffectiveCharge & operator=(const G4ionEffectiveCharge &right);
|
||||
G4ionEffectiveCharge(const G4ionEffectiveCharge&);
|
||||
|
||||
G4NistManager* nist;
|
||||
|
||||
const G4ParticleDefinition* lastPart;
|
||||
const G4Material* lastMat;
|
||||
G4double lastKinEnergy;
|
||||
|
||||
G4double chargeCorrection;
|
||||
G4double effCharge;
|
||||
|
||||
G4double energyHighLimit;
|
||||
G4double energyLowLimit;
|
||||
G4double energyBohr;
|
||||
@@ -99,8 +108,11 @@ inline G4double G4ionEffectiveCharge::EffectiveChargeSquareRatio(
|
||||
const G4Material* material,
|
||||
G4double kineticEnergy)
|
||||
{
|
||||
G4double charge = EffectiveCharge(p,material,kineticEnergy)/eplus;
|
||||
charge *= chargeCorrection;
|
||||
G4double charge = effCharge;
|
||||
if( kineticEnergy != lastKinEnergy || material != lastMat || p != lastPart) {
|
||||
charge = EffectiveCharge(p,material,kineticEnergy);
|
||||
}
|
||||
charge *= chargeCorrection/CLHEP::eplus;
|
||||
|
||||
return charge*charge;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user