Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# CMakeLists.txt
# Module : G4emdna
# Package: Geant4.src.G4processes.G4electromagnetic.G4emdna
#
# CMakeLists.txt for building a single granular library.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
if(GEANT4_BUILD_GRANULAR_LIBS)
include(Geant4MacroLibraryTargets)
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
endif()
@@ -60,26 +60,25 @@ public:
G4DNABornAngle(const G4String& name = "");
virtual ~G4DNABornAngle();
~G4DNABornAngle() override;
virtual G4ThreeVector& SampleDirection(const G4DynamicParticle* dp,
G4double kinEnergyFinal,
G4int Z,
const G4Material* mat = 0);
G4ThreeVector& SampleDirection(const G4DynamicParticle* dp,
G4double kinEnergyFinal,
G4int Z,
const G4Material* mat = nullptr) override;
virtual G4ThreeVector& SampleDirectionForShell(
const G4DynamicParticle* dp,
G4ThreeVector& SampleDirectionForShell(const G4DynamicParticle* dp,
G4double kinEnergyFinal,
G4int Z, G4int shellIdx,
const G4Material* mat = 0);
const G4Material* mat = nullptr) override;
void PrintGeneratorInformation() const;
private:
void PrintGeneratorInformation() const override;
// hide assignment operator
G4DNABornAngle & operator=(const G4DNABornAngle &right);
G4DNABornAngle(const G4DNABornAngle&);
G4DNABornAngle & operator=(const G4DNABornAngle &right) = delete;
G4DNABornAngle(const G4DNABornAngle&) = delete;
private:
const G4ParticleDefinition* fElectron;
};
@@ -0,0 +1,135 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Created on 2016/04/08
//
// Authors: D. Sakata, S. Incerti
//
// This class perform electric excitation for electron transportation,
// based on Dirac B-Spline R-Matrix Model and scaled experimental data.
// See following reference paper
// Phys.Rev.A77,062711(2008) and Phys.Rev.A78,042713(2008)
#ifndef G4DNADiracRMatrixExcitationModel_h
#define G4DNADiracRMatrixExcitationModel_h 1
#include "G4VEmModel.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4ProductionCutsTable.hh"
#include "G4VAtomDeexcitation.hh"
#include "G4LogLogInterpolation.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4NistManager.hh"
#include "G4DNACrossSectionDataSet.hh"
class G4DNADiracRMatrixExcitationModel: public G4VEmModel
{
public:
G4DNADiracRMatrixExcitationModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "DNADiracRMatrixExcitationModel");
virtual ~G4DNADiracRMatrixExcitationModel();
virtual void Initialise(const G4ParticleDefinition*,
const G4DataVector& = *(new G4DataVector()));
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax);
virtual G4double GetExtendedTotalCrossSection (const G4Material* material,
const G4ParticleDefinition*,
G4double kineticEnergy);
virtual G4double GetExtendedPartialCrossSection(const G4Material* material,
G4int level,
const G4ParticleDefinition*,
G4double kineticEnergy);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
inline void SelectStationary(G4bool input);
protected:
G4ParticleChangeForGamma* fParticleChangeForGamma;
private:
const G4double paramFuncTCS_5dto6s1[3]={-3e-50 , 9.46358e-16, 1.4237 }; // y = [0]+[1]/pow(x-[2],2)
const G4double paramFuncTCS_5dto6s2[3]={-3e-50 , 4.24498e-15, -0.674543}; // y = [0]+[1]/pow(x-[2],2)
const G4double paramFuncTCS_6sto6p1[3]={ 1.50018e-26, 2.459e-15 ,-40.8088 }; // y = [0]+[1]*log(x-[2])/(x-[2])
const G4double paramFuncTCS_6sto6p2[3]={ 1.26684e-25, 3.97221e-15,-55.6954 }; // y = [0]+[1]*log(x-[2])/(x-[2])
const G4int ShellEnumAu [4]={19 , 20 ,21 , 21 };
// 5d3/2 ,6s1/2 ,6s1/2 //from EADL
const G4double BindingEnergyAu [4]={12.16 ,10.46 , 8.3 , 8.3 };
// [eV] 5d3/2 ,6s1/2 ,6s1/2 //from EADL
const G4double ExcitationEnergyAu[4]={ 2.66 , 1.14 , 4.63 , 5.11};
// [eV] 5dto6s1,6sto6p1,6sto6p2
G4double fLowEnergyLimit;
G4double fExperimentalEnergyLimit;
G4double fHighEnergyLimit;
G4bool isInitialised;
G4bool statCode;
G4int verboseLevel;
G4String fTableFile;
G4DNACrossSectionDataSet* fTableData;
const std::vector<G4double>* fpMaterialDensity;
const G4ParticleDefinition* fParticleDefinition;
G4VAtomDeexcitation* fAtomDeexcitation;
G4int RandomSelect(const G4Material* material,
const G4ParticleDefinition*,
G4double kineticEnergy);
G4DNADiracRMatrixExcitationModel & operator
=(const G4DNADiracRMatrixExcitationModel &right);
G4DNADiracRMatrixExcitationModel(const G4DNADiracRMatrixExcitationModel&);
};
inline void G4DNADiracRMatrixExcitationModel::SelectStationary(G4bool input)
{
statCode = input;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -23,7 +23,15 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4DNAELSEPAElasticModel.hh 97497 2016-06-03 11:41:57Z matkara $
// Created on 2016/01/18
//
// Authors: D. Sakata, S. Incerti
//
// Based on a recent release of the ELSEPA code
// developed and provided kindly by F. Salvat et al.
// See
// Computer Physics Communications, 165(2), 157-190. (2005)
// http://dx.doi.org/10.1016/j.cpc.2004.09.006
//
#ifndef G4DNAELSEPAElasticModel_h
@@ -43,16 +51,16 @@ class G4DNAELSEPAElasticModel : public G4VEmModel
public:
G4DNAELSEPAElasticModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "DNAELSEPAElasticModel");
G4DNAELSEPAElasticModel(const G4ParticleDefinition* particle = 0,
const G4String& nam = "DNAELSEPAElasticModel");
virtual ~G4DNAELSEPAElasticModel();
virtual void Initialise(const G4ParticleDefinition*,
const G4DataVector&);
virtual void Initialise(
const G4ParticleDefinition* particle, const G4DataVector&);
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4ParticleDefinition* p,
const G4ParticleDefinition* particle,
G4double ekin,
G4double emin,
G4double emax);
@@ -63,48 +71,36 @@ public:
G4double tmin,
G4double maxEnergy);
void SetKillBelowThreshold(G4double threshold);
inline G4double GetKillBelowThreshold()
{
G4ExceptionDescription errMsg;
errMsg << "The method G4DNAELSEPAElasticModel::"
"GetKillBelowThreshold is deprecated";
G4Exception("G4DNAELSEPAElasticModel::GetKillBelowThreshold",
"deprecated",
JustWarning,
errMsg);
return 0.;
}
private:
// Cross section
typedef std::map<double, std::vector<double> > VecMap;
VecMap eVecm;
typedef std::map<double, std::map<double, double> > TriDimensionMap;
TriDimensionMap eDiffCrossSectionData;
std::vector<double> eTdummyVec;
// Water density table
const std::vector<G4double>* fpMolWaterDensity;
// Cross section
G4DNACrossSectionDataSet* fpData;
void SetMaximumEnergy (G4double input)
{highEnergyLimit = input; SetHighEnergyLimit(input);};
void SetKillBelowThreshold (G4double threshold);
G4double GetKillBelowThreshold() {return killBelowEnergy;}
protected:
G4ParticleChangeForGamma* fParticleChangeForGamma;
private:
G4int verboseLevel;
G4bool isInitialised;
G4int kScreeningFactor;
const std::vector<G4double>* fpMolDensity;
std::vector <G4double> kIntersectionEnergySR;
G4double killBelowEnergy;
G4double lowEnergyLimit;
G4double highEnergyLimit;
// Final state
G4bool isInitialised;
G4int verboseLevel;
//G4double DifferentialCrossSection(G4ParticleDefinition* aParticle,
// G4double k, G4double theta);
typedef std::map<G4int,G4String, std::less<G4String> >MapZFile;
typedef std::map<G4int,G4DNACrossSectionDataSet*,std::less<G4String>>MapZData;
MapZData tableZData;
G4double Theta(//G4ParticleDefinition * aParticleDefinition,
G4double Theta(G4int Z, G4ParticleDefinition * aParticleDefinition,
G4double k,
G4double integrDiff);
@@ -120,6 +116,12 @@ private:
G4double xs1,
G4double xs2);
G4double LogLinInterpolate(G4double e1,
G4double e2,
G4double e,
G4double xs1,
G4double xs2);
G4double LogLogInterpolate(G4double e1,
G4double e2,
G4double e,
@@ -139,12 +141,20 @@ private:
G4double t,
G4double e);
G4double RandomizeCosTheta(G4double k);
G4double RandomizeCosTheta(G4int Z, G4double k);
//
typedef std::map<G4int,std::map<G4double,std::map<G4double,G4double>>>
TriDimensionMapZ;
TriDimensionMapZ fAngleDataZ;
std::map <G4int, std::vector<G4double> > eEdummyVecZ;
typedef std::map <G4int, std::map<G4double, std::vector<G4double>>> VecMapZ;
VecMapZ eCumZ;
G4DNAELSEPAElasticModel & operator=(const G4DNAELSEPAElasticModel &right);
G4DNAELSEPAElasticModel(const G4DNAELSEPAElasticModel&);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// 20/2/2019
// Author : HoangTRAN
#ifndef G4DNAIndependentReactionTimeModel_hh
#define G4DNAIndependentReactionTimeModel_hh 1
#include "G4String.hh"
#include "G4VITStepModel.hh"
class G4DNAMolecularReactionTable;
class G4VDNAReactionModel;
class G4VReactionTypeManager;
class G4DNAIndependentReactionTimeModel
: public G4VITStepModel
{
public:
explicit G4DNAIndependentReactionTimeModel(const G4String& name = "DNAIndependentReactionTimeModel");
G4DNAIndependentReactionTimeModel(const G4String& name,
std::unique_ptr<G4VITTimeStepComputer> pTimeStepper,
std::unique_ptr<G4VITReactionProcess> pReactionProcess);
G4DNAIndependentReactionTimeModel(const G4DNAIndependentReactionTimeModel&) = delete;
~G4DNAIndependentReactionTimeModel() override;
void PrintInfo() override;
void Initialize() override;
void SetReactionModel(G4VDNAReactionModel*);
G4VDNAReactionModel* GetReactionModel();
void SetReactionTypeManager(G4VReactionTypeManager* pReactionProcessManager);
protected:
const G4DNAMolecularReactionTable*& fMolecularReactionTable;
std::unique_ptr<G4VDNAReactionModel> fpReactionModel;
std::unique_ptr<G4VReactionTypeManager> fReactionTypeManager;
};
#endif
@@ -0,0 +1,112 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// 20/2/2019
// Author: HoangTRAN
#ifndef G4DNAIndependentReactionTimeStepper_hh
#define G4DNAIndependentReactionTimeStepper_hh 1
#include "G4VITTimeStepComputer.hh"
#include "G4KDTreeResult.hh"
#include "G4IRTUtils.hh"
#include "G4VReactionType.hh"
#include "G4SystemOfUnits.hh"
#include "G4PhysicalConstants.hh"
#include <memory>
#include <set>
class G4VReactionTypeManager;
class G4VDNAReactionModel;
class G4DNAMolecularReactionTable;
class G4MolecularConfiguration;
class G4DNAReactionTypeManager;
class G4Molecule;
class G4ITReactionSet;
class G4ITReactionChange;
class G4VITReactionProcess;
class G4ITTrackHolder;
class G4DNAIndependentReactionTimeStepper : public G4VITTimeStepComputer
{
public:
G4DNAIndependentReactionTimeStepper();
~G4DNAIndependentReactionTimeStepper() override = default;
G4DNAIndependentReactionTimeStepper(const G4DNAIndependentReactionTimeStepper&) = delete;
G4DNAIndependentReactionTimeStepper& operator=(const G4DNAIndependentReactionTimeStepper&) = delete;
void Prepare() override;
G4double CalculateStep(const G4Track&, const G4double&) override;
G4double CalculateMinTimeStep(G4double, G4double) override;
void SetReactionModel(G4VDNAReactionModel*);
G4VDNAReactionModel* GetReactionModel();
std::unique_ptr<G4ITReactionChange>
FindReaction(G4ITReactionSet* pReactionSet,
const G4double& currentStepTime = 0,
const G4double& previousStepTime = 0,
const G4bool& reachedUserStepTimeLimit = false);
void SetReactionProcess(G4VITReactionProcess* pReactionProcess);
void SetReactionTypeManager(G4VReactionTypeManager* typeManager);
void SetVerbose(G4int);
private:
void InitializeForNewTrack();
ReactionType GetReactionType(const G4Track& trackA, const G4Track& trackB);
class Utils;
void CheckAndRecordResults(const Utils& utils);
G4double GetTimeToEncounter(const G4Track& trackA,
const G4Track& trackB);
G4bool fHasAlreadyReachedNullTime;
const G4DNAMolecularReactionTable*& fMolecularReactionTable;
G4VDNAReactionModel* fReactionModel;
G4ITTrackHolder* fpTrackContainer;
G4ITReactionSet* fReactionSet;
G4int fVerbose;
G4double fRCutOff;
G4DNAReactionTypeManager* fReactionTypeManager;
G4VITReactionProcess* fpReactionProcess;
std::map<G4int,G4ThreeVector> fSampledPositions;
class Utils
{
public:
Utils(const G4Track& tA, const G4Track& tB);
~Utils() = default;
const G4Track& fTrackA;
const G4Track& fTrackB;
const G4Molecule* fpMoleculeA;
const G4Molecule* fpMoleculeB;
};
};
#endif
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#ifndef G4DNAMakeReaction_hh
#define G4DNAMakeReaction_hh 1
#include "G4VITReactionProcess.hh"
class G4DNAMolecularReactionTable;
class G4VDNAReactionModel;
class G4ITReactionSet;
class G4VITTimeStepComputer;
class G4DNAMakeReaction : public G4VITReactionProcess
{
public:
G4DNAMakeReaction();
explicit G4DNAMakeReaction(G4VDNAReactionModel*);
~G4DNAMakeReaction() override = default;
G4DNAMakeReaction(const G4DNAMakeReaction& other) = delete;
G4DNAMakeReaction& operator=(const G4DNAMakeReaction& other) = delete;
G4bool TestReactibility(const G4Track&,
const G4Track&,
G4double currentStepTime,
G4bool userStepTimeLimit) override;
std::vector<std::unique_ptr<G4ITReactionChange>> FindReaction(G4ITReactionSet*,
const G4double, const G4double, const G4bool) override;
std::unique_ptr<G4ITReactionChange> MakeReaction(const G4Track&, const G4Track&) override;
void SetReactionModel(G4VDNAReactionModel*);
void UpdatePositionForReaction(G4Track&, G4Track&);
void SetTimeStepComputer(G4VITTimeStepComputer*);
protected:
const G4DNAMolecularReactionTable*& fMolReactionTable;
G4VDNAReactionModel* fpReactionModel;
G4VITTimeStepComputer* fpTimeStepper;
G4double fTimeStep;
};
#endif
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// 20/2/2019
// Author : HoangTRAN
#ifndef G4DNAPartiallyDiffusionControlled_h
#define G4DNAPartiallyDiffusionControlled_h 1
#include "G4DNAReactionTypeManager.hh"
#include "G4VReactionType.hh"
class G4MolecularConfiguration;
class G4DNAPartiallyDiffusionControlled
: public G4VReactionType
{
public:
G4DNAPartiallyDiffusionControlled();
~G4DNAPartiallyDiffusionControlled() override;
G4DNAPartiallyDiffusionControlled(const G4DNAPartiallyDiffusionControlled& other) = delete;
G4DNAPartiallyDiffusionControlled& operator=(const G4DNAPartiallyDiffusionControlled& other) = delete;
G4double GetTimeToEncounter(const G4Track& trackA,
const G4Track& trackB) override;
G4bool GeminateRecombinationProbability(const G4MolecularConfiguration*,
const G4MolecularConfiguration*) override;
private:
G4double GetDiffusionCoefficient(const G4MolecularConfiguration*,
const G4MolecularConfiguration*);
};
#endif
@@ -0,0 +1,103 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Created on 2016/04/08
//
// Authors: D. Sakata, S. Incerti
//
// This class perform transmission term of volume plasmon excitation,
// based on Quinn Model, see Phys. Rev. vol 126, number 4 (1962)
#ifndef G4DNAQuinnPlasmonExcitationModel_h
#define G4DNAQuinnPlasmonExcitationModel_h 1
#include "G4VEmModel.hh"
#include "G4Electron.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4ProductionCutsTable.hh"
class G4DNAQuinnPlasmonExcitationModel: public G4VEmModel
{
public:
G4DNAQuinnPlasmonExcitationModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "DNAQuinnPlasmonExcitationModel");
virtual ~G4DNAQuinnPlasmonExcitationModel();
virtual void Initialise(const G4ParticleDefinition*,
const G4DataVector& = *(new G4DataVector()));
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax);
virtual G4double GetCrossSection(const G4Material* material,
const G4ParticleDefinition*,
G4double kineticEnergy);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
inline void SelectStationary(G4bool input);
protected:
G4ParticleChangeForGamma* fParticleChangeForGamma;
private:
G4bool statCode;
G4double fLowEnergyLimit;
G4double fHighEnergyLimit;
G4bool isInitialised;
G4int verboseLevel;
G4int nValenceElectron[100];
const std::vector<G4double>* fpMaterialDensity;
G4int GetNValenceElectron(G4int z);
G4DNAQuinnPlasmonExcitationModel & operator=(const G4DNAQuinnPlasmonExcitationModel &right);
G4DNAQuinnPlasmonExcitationModel(const G4DNAQuinnPlasmonExcitationModel&);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4DNAQuinnPlasmonExcitationModel::SelectStationary(G4bool input)
{
statCode = input;
}
#endif
@@ -0,0 +1,154 @@
//
// ********************************************************************
// * 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: G4DNARelativisticIonisationModel.hh 90057 2015-05-11 22:25:50Z matkara $
//
#ifndef G4DNARelativisticIonisationModel_h
#define G4DNARelativisticIonisationModel_h 1
#include "G4VEmModel.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4ProductionCutsTable.hh"
#include "G4VAtomDeexcitation.hh"
#include "G4PhysicsFreeVector.hh"
#include "G4LogLogInterpolation.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4NistManager.hh"
#include "G4DNACrossSectionDataSet.hh"
//#include "G4DNAWaterExcitationStructure.hh"
class G4DNARelativisticIonisationModel: public G4VEmModel
{
public:
G4DNARelativisticIonisationModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "DNARelativisticIonisationModel");
virtual ~G4DNARelativisticIonisationModel();
virtual void Initialise(const G4ParticleDefinition*,
const G4DataVector& = *(new G4DataVector()));
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax);
virtual G4double GetTotalCrossSection (const G4Material* material,
const G4ParticleDefinition*,
G4double kineticEnergy);
virtual G4double GetPartialCrossSection(const G4Material* material,
G4int level,
const G4ParticleDefinition*,
G4double kineticEnergy);
virtual G4double GetDifferentialCrossSection(const G4Material* material,
const G4ParticleDefinition* particle,
G4double kineticEnergy,
G4double secondaryEnergy,
G4int level);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
virtual void LoadAtomicStates(G4int z, const char *path);
inline void SelectStationary (G4bool input){statCode = input;};
inline void SelectFasterComputation(G4bool input){fasterCode = input;};
protected:
G4ParticleChangeForGamma* fParticleChangeForGamma;
private:
std::vector <G4int > iState [99];
std::vector <G4int > iShell [99];
std::vector <G4int > iSubShell [99];
std::vector <G4double> Nelectrons[99];
std::vector <G4double> Ebinding [99];
std::vector <G4double> Ekinetic [99];
std::map <G4int, std::vector<G4double> > eVecEZ;
typedef std::map <G4int, std::map<G4double, std::vector<G4double> > >
DeauxDimensionVecMapZ;
DeauxDimensionVecMapZ eVecEjeEZ;
typedef std::map <G4int, std::map<G4int,std::map<G4double,
std::vector<G4double> > > > TriDimensionVecMapZ;
TriDimensionVecMapZ eProbaShellMapZ;
typedef std::map <G4int, std::map<G4int, std::map<G4double,
std::map<G4double, G4double> > > > QuadDimensionMapZ;
QuadDimensionMapZ eDiffCrossSectionDataZ;
QuadDimensionMapZ eEjectedEnergyDataZ;
G4DNARelativisticIonisationModel & operator
=(const G4DNARelativisticIonisationModel &right);
G4DNARelativisticIonisationModel(const G4DNARelativisticIonisationModel&);
G4double fLowEnergyLimit;
G4double fHighEnergyLimit;
G4bool isInitialised;
G4bool statCode;
G4bool fasterCode;
G4int verboseLevel;
const std::vector<G4double>* fMaterialDensity;
const G4ParticleDefinition* fParticleDefinition;
G4VAtomDeexcitation* fAtomDeexcitation;
G4int RandomSelect(const G4Material* material,
const G4ParticleDefinition*,
G4double kineticEnergy);
G4double GetEjectedElectronEnergy (
const G4Material* material,
const G4ParticleDefinition* ,
G4double energy,
G4int shell );
G4ThreeVector GetEjectedElectronDirection(
const G4ParticleDefinition* ,
G4double energy,G4double secondaryenergy);
G4double Interpolate (G4double e1 ,G4double e2 ,G4double e ,
G4double xs1, G4double xs2);
G4double QuadInterpolator(G4double e11,G4double e12,G4double e21,G4double e22,
G4double x11,G4double x12,G4double x21,G4double x22,
G4double t1 ,G4double t2 ,G4double t ,G4double e);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -60,26 +60,25 @@ public:
G4DNARuddAngle(const G4String& name = "");
virtual ~G4DNARuddAngle();
~G4DNARuddAngle() override;
virtual G4ThreeVector& SampleDirection(const G4DynamicParticle* dp,
G4double kinEnergyFinal,
G4int Z,
const G4Material* mat = 0);
G4ThreeVector& SampleDirection(const G4DynamicParticle* dp,
G4double kinEnergyFinal,
G4int Z,
const G4Material* mat = nullptr) override;
virtual G4ThreeVector& SampleDirectionForShell(
const G4DynamicParticle* dp,
G4ThreeVector& SampleDirectionForShell(const G4DynamicParticle* dp,
G4double kinEnergyFinal,
G4int Z, G4int shellIdx,
const G4Material* mat = 0);
const G4Material* mat = nullptr) override;
void PrintGeneratorInformation() const;
private:
void PrintGeneratorInformation() const override;
// hide assignment operator
G4DNARuddAngle & operator=(const G4DNARuddAngle &right);
G4DNARuddAngle(const G4DNARuddAngle&);
G4DNARuddAngle & operator=(const G4DNARuddAngle &right) = delete;
G4DNARuddAngle(const G4DNARuddAngle&) = delete;
private:
const G4ParticleDefinition* fElectron;
};
@@ -0,0 +1,58 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// 20/2/2019
// Author : HoangTRAN
#ifndef G4DNATotallyDiffusionControlled_h
#define G4DNATotallyDiffusionControlled_h 1
#include "G4DNAReactionTypeManager.hh"
#include "G4VReactionType.hh"
class G4MolecularConfiguration;
class G4DNAMolecularReactionTable;
class G4VDNAReactionModel;
class G4DNATotallyDiffusionControlled
: public G4VReactionType
{
public:
G4DNATotallyDiffusionControlled();
~G4DNATotallyDiffusionControlled() override;
G4DNATotallyDiffusionControlled(const G4DNATotallyDiffusionControlled& other) = delete;
G4DNATotallyDiffusionControlled& operator=(const G4DNATotallyDiffusionControlled& other) = delete;
G4double GetTimeToEncounter(const G4Track& trackA,
const G4Track& trackB) override;
G4bool GeminateRecombinationProbability(const G4MolecularConfiguration* pConfMolA,
const G4MolecularConfiguration* pConfMolB) override;
private:
G4double GetDiffusionCoefficient(const G4MolecularConfiguration* pMA,
const G4MolecularConfiguration* pMB);
};
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// Author: Hoang TRAN : 21/2/2019
#ifndef G4DiffusionControlledReactionModel_hh
#define G4DiffusionControlledReactionModel_hh 1
#include "G4VDNAReactionModel.hh"
#include <vector>
class G4DNAMolecularReactionData;
class G4VReactionTypeManager;
class G4DNAReactionTypeManager;
class G4DiffusionControlledReactionModel : public G4VDNAReactionModel
{
public :
G4DiffusionControlledReactionModel();
~G4DiffusionControlledReactionModel() override;
G4DiffusionControlledReactionModel(const G4DiffusionControlledReactionModel&) = delete;
G4DiffusionControlledReactionModel& operator=(const G4DiffusionControlledReactionModel&) = delete;
void Initialise(const G4MolecularConfiguration*, const G4Track&) override;
void InitialiseToPrint(const G4MolecularConfiguration*) override;
G4double GetReactionRadius(const G4MolecularConfiguration*,
const G4MolecularConfiguration*) override;
G4double GetReactionRadius(G4int) override;
G4bool FindReaction(const G4Track&,
const G4Track&,
G4double /*reactionRadius*/,
G4double& /*separationDistance*/,
G4bool /*alongStepInteraction*/) override
{return true;}
void SetReactionTypeManager(G4VReactionTypeManager* typeManager);
private :
const std::vector<const G4DNAMolecularReactionData*>* fpReactionData ;
G4DNAReactionTypeManager* fReactionTypeManager;
};
#endif
@@ -1,166 +1,154 @@
#------------------------------------------------------------------------------
# sources.cmake
# Module : G4emlowenergy
# Package: Geant4.src.G4processes.G4electromagnetic.G4emlowenergy
#
# Sources description for a library.
# Lists the sources and headers of the code explicitly.
# Lists include paths needed.
# Lists the internal granular and global dependencies of the library.
# Source specific properties should be added at the end.
#
# Generated on : 24/9/2010
#
#
#------------------------------------------------------------------------------
# - G4emdna-models module build definition
#
# Define the Geant4 Module.
#
GEANT4_DEFINE_MODULE(NAME G4emdna-models
HEADERS
G4DNABornAngle.hh
G4DNABornExcitationModel.hh
G4DNABornExcitationModel1.hh
G4DNABornExcitationModel2.hh
G4DNABornIonisationModel.hh
G4DNABornIonisationModel1.hh
G4DNABornIonisationModel2.hh
G4DNAChampionElasticModel.hh
G4DNACPA100ElasticModel.hh
G4DNACPA100ExcitationModel.hh
G4DNACPA100IonisationModel.hh
G4DNASmoluchowskiDiffusion.hh
G4DNASmoluchowskiReactionModel.hh
G4DNADingfelderChargeDecreaseModel.hh
G4DNADingfelderChargeIncreaseModel.hh
G4DNAEmfietzoglouExcitationModel.hh
G4DNAEmfietzoglouIonisationModel.hh
G4DNAELSEPAElasticModel.hh
G4DNAIonElasticModel.hh
G4DNAIRT.hh
G4DNAIRTMoleculeEncounterStepper.hh
G4DNAMeltonAttachmentModel.hh
G4DNAMillerGreenExcitationModel.hh
G4DNAMolecularIRTModel.hh
G4DNAMolecularReaction.hh
G4DNAMolecularStepByStepModel.hh
G4DNAMoleculeEncounterStepper.hh
G4DNARuddAngle.hh
G4DNARuddIonisationExtendedModel.hh
G4DNARuddIonisationModel.hh
G4DNASancheExcitationModel.hh
G4DNAOneStepThermalizationModel.hh
G4DNAOneStepThermalizationModel.hpp
G4DNAPTBIonisationModel.hh
G4DNAPTBElasticModel.hh
G4DNAPTBExcitationModel.hh
G4DNAPTBAugerModel.hh
G4DNAScreenedRutherfordElasticModel.hh
G4DNATransformElectronModel.hh
G4DNAUeharaScreenedRutherfordElasticModel.hh
G4DNAVacuumModel.hh
G4LEPTSAttachmentModel.hh
G4LEPTSDissociationModel.hh
G4LEPTSElasticModel.hh
G4LEPTSIonisationModel.hh
G4LEPTSPositroniumModel.hh
G4LEPTSRotExcitationModel.hh
G4LEPTSVibExcitationModel.hh
G4VLEPTSModel.hh
G4LEPTSDiffXS.hh
G4LEPTSDistribution.hh
G4LEPTSElossDistr.hh
G4LEPTSExcitationModel.hh
G4VDNAModel.hh
G4DNAModelInterface.hh
G4DNADummyModel.hh
SOURCES
G4DNABornAngle.cc
G4DNABornExcitationModel1.cc
G4DNABornExcitationModel2.cc
G4DNABornIonisationModel1.cc
G4DNABornIonisationModel2.cc
G4DNAChampionElasticModel.cc
G4DNACPA100ElasticModel.cc
G4DNACPA100ExcitationModel.cc
G4DNACPA100IonisationModel.cc
G4DNASmoluchowskiDiffusion.cc
G4DNASmoluchowskiReactionModel.cc
G4DNADingfelderChargeDecreaseModel.cc
G4DNADingfelderChargeIncreaseModel.cc
G4DNAELSEPAElasticModel.cc
G4DNAEmfietzoglouExcitationModel.cc
G4DNAEmfietzoglouIonisationModel.cc
G4DNAIonElasticModel.cc
G4DNAIRT.cc
G4DNAIRTMoleculeEncounterStepper.cc
G4DNAMeltonAttachmentModel.cc
G4DNAMillerGreenExcitationModel.cc
G4DNAMolecularIRTModel.cc
G4DNAMolecularReaction.cc
G4DNAMolecularStepByStepModel.cc
G4DNAMoleculeEncounterStepper.cc
G4DNARuddAngle.cc
G4DNARuddIonisationExtendedModel.cc
G4DNARuddIonisationModel.cc
G4DNASancheExcitationModel.cc
G4DNAOneStepThermalizationModel.cc
G4DNAPTBIonisationModel.cc
G4DNAPTBElasticModel.cc
G4DNAPTBExcitationModel.cc
G4DNAPTBAugerModel.cc
G4DNAScreenedRutherfordElasticModel.cc
G4DNATransformElectronModel.cc
G4DNAUeharaScreenedRutherfordElasticModel.cc
G4DNAVacuumModel.cc
G4LEPTSElossDistr.cc
G4LEPTSAttachmentModel.cc
G4LEPTSDissociationModel.cc
G4LEPTSElasticModel.cc
G4LEPTSDistribution.cc
G4LEPTSIonisationModel.cc
G4LEPTSPositroniumModel.cc
G4LEPTSRotExcitationModel.cc
G4LEPTSVibExcitationModel.cc
G4VLEPTSModel.cc
G4LEPTSExcitationModel.cc
G4LEPTSDiffXS.cc
G4VDNAModel.cc
G4DNAModelInterface.cc
G4DNADummyModel.cc
GRANULAR_DEPENDENCIES
G4baryons
G4bosons
G4cuts
G4emlowenergy
G4emstandard
G4emutils
G4geometrymng
G4globman
G4hepnumerics
G4intercoms
G4ions
G4leptons
G4materials
G4mesons
G4partman
G4procman
G4track
G4emdna-man
G4emdna-molman
G4emdna-moltypes
G4emdna-utils
GLOBAL_DEPENDENCIES
G4geometry
G4global
G4intercoms
G4materials
G4particles
G4track
LINK_LIBRARIES
)
# List any source specific properties here
geant4_add_module(G4emdna-models
PUBLIC_HEADERS
G4DNABornAngle.hh
G4DNABornExcitationModel.hh
G4DNABornExcitationModel1.hh
G4DNABornExcitationModel2.hh
G4DNABornIonisationModel.hh
G4DNABornIonisationModel1.hh
G4DNABornIonisationModel2.hh
G4DNAChampionElasticModel.hh
G4DNACPA100ElasticModel.hh
G4DNACPA100ExcitationModel.hh
G4DNACPA100IonisationModel.hh
G4DNASmoluchowskiDiffusion.hh
G4DNASmoluchowskiReactionModel.hh
G4DNADingfelderChargeDecreaseModel.hh
G4DNADingfelderChargeIncreaseModel.hh
G4DNAEmfietzoglouExcitationModel.hh
G4DNAEmfietzoglouIonisationModel.hh
G4DNAELSEPAElasticModel.hh
G4DNAIonElasticModel.hh
G4DNAIRT.hh
G4DNAIRTMoleculeEncounterStepper.hh
G4DNAMeltonAttachmentModel.hh
G4DNAMillerGreenExcitationModel.hh
G4DNAMolecularIRTModel.hh
G4DNAMolecularReaction.hh
G4DNAMolecularStepByStepModel.hh
G4DNAMoleculeEncounterStepper.hh
G4DNARuddAngle.hh
G4DNARuddIonisationExtendedModel.hh
G4DNARuddIonisationModel.hh
G4DNASancheExcitationModel.hh
G4DNAOneStepThermalizationModel.hh
G4DNAOneStepThermalizationModel.hpp
G4DNAPTBIonisationModel.hh
G4DNAPTBElasticModel.hh
G4DNAPTBExcitationModel.hh
G4DNAPTBAugerModel.hh
G4DNAScreenedRutherfordElasticModel.hh
G4DNATransformElectronModel.hh
G4DNAUeharaScreenedRutherfordElasticModel.hh
G4DNAVacuumModel.hh
G4LEPTSAttachmentModel.hh
G4LEPTSDissociationModel.hh
G4LEPTSElasticModel.hh
G4LEPTSIonisationModel.hh
G4LEPTSPositroniumModel.hh
G4LEPTSRotExcitationModel.hh
G4LEPTSVibExcitationModel.hh
G4VLEPTSModel.hh
G4LEPTSDiffXS.hh
G4LEPTSDistribution.hh
G4LEPTSElossDistr.hh
G4LEPTSExcitationModel.hh
G4VDNAModel.hh
G4DNAModelInterface.hh
G4DNADummyModel.hh
G4DNADiracRMatrixExcitationModel.hh
G4DNAQuinnPlasmonExcitationModel.hh
G4DNARelativisticIonisationModel.hh
G4DiffusionControlledReactionModel.hh
G4DNAIndependentReactionTimeModel.hh
G4DNAIndependentReactionTimeStepper.hh
G4DNAMakeReaction.hh
G4DNAPartiallyDiffusionControlled.hh
G4DNATotallyDiffusionControlled.hh
SOURCES
G4DNABornAngle.cc
G4DNABornExcitationModel1.cc
G4DNABornExcitationModel2.cc
G4DNABornIonisationModel1.cc
G4DNABornIonisationModel2.cc
G4DNAChampionElasticModel.cc
G4DNACPA100ElasticModel.cc
G4DNACPA100ExcitationModel.cc
G4DNACPA100IonisationModel.cc
G4DNASmoluchowskiDiffusion.cc
G4DNASmoluchowskiReactionModel.cc
G4DNADingfelderChargeDecreaseModel.cc
G4DNADingfelderChargeIncreaseModel.cc
G4DNAELSEPAElasticModel.cc
G4DNAEmfietzoglouExcitationModel.cc
G4DNAEmfietzoglouIonisationModel.cc
G4DNAIonElasticModel.cc
G4DNAIRT.cc
G4DNAIRTMoleculeEncounterStepper.cc
G4DNAMeltonAttachmentModel.cc
G4DNAMillerGreenExcitationModel.cc
G4DNAMolecularIRTModel.cc
G4DNAMolecularReaction.cc
G4DNAMolecularStepByStepModel.cc
G4DNAMoleculeEncounterStepper.cc
G4DNARuddAngle.cc
G4DNARuddIonisationExtendedModel.cc
G4DNARuddIonisationModel.cc
G4DNASancheExcitationModel.cc
G4DNAOneStepThermalizationModel.cc
G4DNAPTBIonisationModel.cc
G4DNAPTBElasticModel.cc
G4DNAPTBExcitationModel.cc
G4DNAPTBAugerModel.cc
G4DNAScreenedRutherfordElasticModel.cc
G4DNATransformElectronModel.cc
G4DNAUeharaScreenedRutherfordElasticModel.cc
G4DNAVacuumModel.cc
G4LEPTSElossDistr.cc
G4LEPTSAttachmentModel.cc
G4LEPTSDissociationModel.cc
G4LEPTSElasticModel.cc
G4LEPTSDistribution.cc
G4LEPTSIonisationModel.cc
G4LEPTSPositroniumModel.cc
G4LEPTSRotExcitationModel.cc
G4LEPTSVibExcitationModel.cc
G4VLEPTSModel.cc
G4LEPTSExcitationModel.cc
G4LEPTSDiffXS.cc
G4VDNAModel.cc
G4DNAModelInterface.cc
G4DNADummyModel.cc
G4DNADiracRMatrixExcitationModel.cc
G4DNAQuinnPlasmonExcitationModel.cc
G4DNARelativisticIonisationModel.cc
G4DiffusionControlledReactionModel.cc
G4DNAIndependentReactionTimeModel.cc
G4DNAIndependentReactionTimeStepper.cc
G4DNAMakeReaction.cc
G4DNAPartiallyDiffusionControlled.cc
G4DNATotallyDiffusionControlled.cc)
geant4_module_link_libraries(G4emdna-models
PUBLIC
G4baryons
G4bosons
G4cuts
G4emdna-man
G4emdna-molman
G4emdna-utils
G4emlowenergy
G4emutils
G4globman
G4heprandom
G4leptons
G4materials
G4navigation
G4partman
G4track
PRIVATE
G4emdna-moltypes
G4emstandard)
@@ -0,0 +1,320 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Created on 2016/05/02
//
// Authors: D Sakata, S. Incerti
//
// This class perform electric excitation for electron transportation in gold,
// based on Dirac B-Spline R-Matrix method with scaled experimental data
// for low energy.
// See following reference paper
// Phys.Rev.A77,062711(2008) and Phys.Rev.A78,042713(2008)
#include "G4DNADiracRMatrixExcitationModel.hh"
#include "G4SystemOfUnits.hh"
#include "G4UAtomicDeexcitation.hh"
#include "G4LossTableManager.hh"
#include "G4Gamma.hh"
#include "G4RandomDirection.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4DNADiracRMatrixExcitationModel::G4DNADiracRMatrixExcitationModel
(const G4ParticleDefinition*,const G4String& nam) :
G4VEmModel(nam), isInitialised(false), fTableData(0)
{
fpMaterialDensity = 0;
fHighEnergyLimit = 0;
fExperimentalEnergyLimit= 0;
fLowEnergyLimit = 0;
fParticleDefinition = 0;
verboseLevel = 0;
if (verboseLevel > 0)
{
G4cout << "Dirac R-matrix excitation model is constructed " << G4endl;
}
fParticleChangeForGamma = 0;
statCode = false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4DNADiracRMatrixExcitationModel::~G4DNADiracRMatrixExcitationModel()
{
if (fTableData) delete fTableData;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4DNADiracRMatrixExcitationModel::Initialise
(const G4ParticleDefinition* particle,const G4DataVector& /*cuts*/)
{
if (verboseLevel > 3)
{
G4cout <<
"Calling G4DNADiracRMatrixExcitationModel::Initialise()"
<< G4endl;
}
fParticleDefinition = particle;
if(particle->GetParticleName() == "e-")
{
fTableFile = "dna/sigma_excitation_e_diracrmatrix_Z79";
fLowEnergyLimit = 10 * eV;
fExperimentalEnergyLimit = 577.* eV;
fHighEnergyLimit = 1.0 * GeV;
}
else
{
G4Exception("G4DNADiracRMatrixExcitationModel::Initialise","em0001",
FatalException,"Not defined for other particles than electrons.");
return;
}
G4double scaleFactor = 1. * cm * cm;
fTableData = new G4DNACrossSectionDataSet
(new G4LogLogInterpolation,eV,scaleFactor );
fTableData->LoadData(fTableFile);
if( verboseLevel>0 )
{
G4cout << "Dirac R-matrix excitation model is initialized " << G4endl
<< "Energy range: "
<< LowEnergyLimit() / eV << " eV - "<< HighEnergyLimit() / keV << " keV "
<< " for "<< particle->GetParticleName()
<< G4endl;
}
if (isInitialised){return;}
fParticleChangeForGamma = GetParticleChangeForGamma();
isInitialised = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4DNADiracRMatrixExcitationModel::CrossSectionPerVolume
(const G4Material* material,
const G4ParticleDefinition* particleDefinition,
G4double ekin,
G4double,
G4double)
{
if (verboseLevel > 3)
{
G4cout <<
"Calling CrossSectionPerVolume() of G4DNADiracRMatrixExcitationModel"
<< G4endl;
}
G4double atomicNDensity = material->GetAtomicNumDensityVector()[0];
// Protection: for single element
if(material->GetNumberOfElements()>1) return 0.;
G4double z = material->GetZ();
// Protection: for Gold
if(z!=79){return 0.;}
G4double sigma=0.;
if(atomicNDensity!= 0.0)
{
if (ekin >= fLowEnergyLimit && ekin < fExperimentalEnergyLimit)
{
sigma = fTableData->FindValue(ekin);
}
else if ((fExperimentalEnergyLimit <= ekin) && (ekin < fHighEnergyLimit))
{
sigma = GetExtendedTotalCrossSection(material,particleDefinition,ekin);
}
if (verboseLevel > 2)
{
G4cout<<"__________________________________" << G4endl;
G4cout<<"=== G4DNADiracRMatrixExcitationModel - XS INFO START"<<G4endl;
G4cout<<"=== Kinetic energy (eV)=" << ekin/eV << " particle : "
<<particleDefinition->GetParticleName() << G4endl;
G4cout<<"=== Cross section per atom for Z="<<z<<" is (cm^2)"
<<sigma/cm/cm << G4endl;
G4cout<<"=== Cross section per atom for Z="<<z<<" is (cm^-1)="
<<sigma*atomicNDensity/(1./cm) << G4endl;
G4cout<<"=== G4DNADiracRMatrixExcitationModel - XS INFO END"<<G4endl;
}
}
return sigma*atomicNDensity;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4DNADiracRMatrixExcitationModel::SampleSecondaries
(std::vector<G4DynamicParticle*>* /*fvect*/,
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* aDynamicParticle,
G4double,G4double)
{
if (verboseLevel > 3)
{
G4cout <<
"Calling SampleSecondaries() of G4DNADiracRMatrixExcitationModel"
<< G4endl;
}
G4ParticleDefinition* particle = aDynamicParticle->GetDefinition();
G4double k = aDynamicParticle->GetKineticEnergy();
G4int level = RandomSelect(couple->GetMaterial(),particle,
k);
G4double excitationEnergy = ExcitationEnergyAu[level]*eV;
G4double newEnergy = k - excitationEnergy;
if (newEnergy > 0)
{
//Energy Loss
fParticleChangeForGamma->ProposeMomentumDirection
(aDynamicParticle->GetMomentumDirection());
fParticleChangeForGamma->ProposeLocalEnergyDeposit(excitationEnergy);
if(!statCode) fParticleChangeForGamma->SetProposedKineticEnergy(newEnergy);
else fParticleChangeForGamma->SetProposedKineticEnergy(k);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4DNADiracRMatrixExcitationModel::GetExtendedTotalCrossSection
(const G4Material* material,
const G4ParticleDefinition* particle,
G4double kineticEnergy)
{
G4double value=0;
size_t N=fTableData->NumberOfComponents();
for(int i=0;i<(int)N;i++){
value = value+GetExtendedPartialCrossSection(material,i,particle,
kineticEnergy);
}
return value;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4DNADiracRMatrixExcitationModel::GetExtendedPartialCrossSection
(const G4Material*,
G4int level,
const G4ParticleDefinition* particle,
G4double kineticEnergy)
{
G4double value=0;
if(particle->GetParticleName()=="e-"){
if(level==0){
// y = [0]+[1]/pow(x-2,2)
value = paramFuncTCS_5dto6s1[0]+paramFuncTCS_5dto6s1[1]
/std::pow(kineticEnergy/eV-paramFuncTCS_5dto6s1[2],2);
}
else if(level==1){
// y = [0]+[1]/pow(x-2,2)
value = paramFuncTCS_5dto6s2[0]+paramFuncTCS_5dto6s2[1]
/std::pow(kineticEnergy/eV-paramFuncTCS_5dto6s2[2],2);
}
else if(level==2){
// y = [0]+[1]*log(x-2)/(x-[2])
value = paramFuncTCS_6sto6p1[0]+paramFuncTCS_6sto6p1[1]
*G4Log(kineticEnergy/eV-paramFuncTCS_6sto6p1[2])
/(kineticEnergy/eV-paramFuncTCS_6sto6p1[2]);
}
else if(level==3){
// y = [0]+[1]*log(x-2)/(x-[2])
value = paramFuncTCS_6sto6p2[0]+paramFuncTCS_6sto6p2[1]
*G4Log(kineticEnergy/eV-paramFuncTCS_6sto6p2[2])
/(kineticEnergy/eV-paramFuncTCS_6sto6p2[2]);
}
}
return value*cm*cm;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int G4DNADiracRMatrixExcitationModel::RandomSelect
(const G4Material* material,
const G4ParticleDefinition* particle,
G4double kineticEnergy)
{
G4double value = 0.;
G4double* valuesBuffer = new G4double[fTableData->NumberOfComponents()];
const size_t n(fTableData->NumberOfComponents());
size_t i(n);
while (i > 0)
{
i--;
if
((fLowEnergyLimit<=kineticEnergy)&&(kineticEnergy<fExperimentalEnergyLimit))
{
valuesBuffer[i] = fTableData->GetComponent(i)->FindValue(kineticEnergy);
}
else if
((fExperimentalEnergyLimit<=kineticEnergy)&&(kineticEnergy<fHighEnergyLimit))
{
valuesBuffer[i]
= GetExtendedPartialCrossSection(material,i,particle,kineticEnergy);
}
value += valuesBuffer[i];
}
value *= G4UniformRand();
i = n;
while (i > 0)
{
i--;
if (valuesBuffer[i] > value)
{
delete[] valuesBuffer;
return i;
}
value -= valuesBuffer[i];
}
if (valuesBuffer) delete[] valuesBuffer;
return 9999;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,134 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "globals.hh"
#include "G4DNAMakeReaction.hh"
#include <G4DNAMolecularReactionTable.hh>
#include "G4DNAIndependentReactionTimeModel.hh"
#include "G4DNAIndependentReactionTimeStepper.hh"
#include "G4DiffusionControlledReactionModel.hh"
#include "G4Molecule.hh"
#include "G4ReferenceCast.hh"
#include "G4VDNAReactionModel.hh"
#include "G4DNAReactionTypeManager.hh"
#include "G4ChemicalMoleculeFinder.hh"
G4DNAIndependentReactionTimeModel::G4DNAIndependentReactionTimeModel(const G4String& name)
: G4DNAIndependentReactionTimeModel(name,
std::unique_ptr<G4DNAIndependentReactionTimeStepper>
(new G4DNAIndependentReactionTimeStepper()),
std::unique_ptr<G4DNAMakeReaction>
(new G4DNAMakeReaction()))
{}
G4DNAIndependentReactionTimeModel::G4DNAIndependentReactionTimeModel(const G4String& name,
std::unique_ptr<G4VITTimeStepComputer> pTimeStepper,
std::unique_ptr<G4VITReactionProcess> pReactionProcess)
: G4VITStepModel(std::move(pTimeStepper),
std::move(pReactionProcess),
name)
, fMolecularReactionTable(reference_cast<const G4DNAMolecularReactionTable*>(fpReactionTable))
{
fType1 = G4Molecule::ITType();
fType2 = G4Molecule::ITType();
}
G4DNAIndependentReactionTimeModel::~G4DNAIndependentReactionTimeModel() = default;
void G4DNAIndependentReactionTimeModel::Initialize()
{
if(fpReactionTable == nullptr)
{
SetReactionTable(G4DNAMolecularReactionTable::GetReactionTable());
}
if(!fpReactionModel)
{
fpReactionModel.reset(new G4DiffusionControlledReactionModel());
}
fpReactionModel->SetReactionTable((const G4DNAMolecularReactionTable*) fpReactionTable);
((G4DiffusionControlledReactionModel*) fpReactionModel.get())->SetReactionTypeManager(fReactionTypeManager.get());
((G4DNAMakeReaction*) fpReactionProcess.get())->SetReactionModel(fpReactionModel.get());
((G4DNAMakeReaction*) fpReactionProcess.get())->SetTimeStepComputer(fpTimeStepper.get());
((G4DNAIndependentReactionTimeStepper*) fpTimeStepper.get())->SetReactionModel(fpReactionModel.get());
((G4DNAIndependentReactionTimeStepper*) fpTimeStepper.get())->SetReactionTypeManager(fReactionTypeManager.get());
((G4DNAIndependentReactionTimeStepper*) fpTimeStepper.get())->SetReactionProcess((fpReactionProcess).get());
G4ChemicalMoleculeFinder::Instance()->Clear();
G4VITStepModel::Initialize();
}
void G4DNAIndependentReactionTimeModel::PrintInfo()
{
#ifdef G4VERBOSE
if(G4Threading::IsMultithreadedApplication())
{
if(G4Threading::G4GetThreadId() == 0)
{
G4VITStepModel::PrintInfo();
G4cout<<G4endl;
G4cout << fName << " will be used ==========================" << G4endl;
G4cout<<G4endl;
G4cout << "==============================="
"========================================"<<G4endl;
G4cout<<G4endl;
}
}
else
{
G4VITStepModel::PrintInfo();
G4cout<<G4endl;
G4cout << fName << " will be used ==========================" << G4endl;
G4cout<<G4endl;
G4cout << "==============================="
"========================================"<<G4endl;
G4cout<<G4endl;
}
#endif
}
void G4DNAIndependentReactionTimeModel::SetReactionModel(G4VDNAReactionModel* pReactionModel)
{
fpReactionModel.reset(pReactionModel);
}
G4VDNAReactionModel* G4DNAIndependentReactionTimeModel::GetReactionModel()
{
return fpReactionModel.get();
}
void G4DNAIndependentReactionTimeModel::SetReactionTypeManager(G4VReactionTypeManager* pReactionProcessManager)
{
fReactionTypeManager.reset(pReactionProcessManager);
}
@@ -0,0 +1,489 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
// 20/2/2019
// Author: HoangTRAN
#include "G4DNAIndependentReactionTimeStepper.hh"
#include "G4VDNAReactionModel.hh"
#include "G4DNAMolecularReactionTable.hh"
#include "G4memory.hh"
#include "G4UnitsTable.hh"
#include "G4Molecule.hh"
#include "G4ChemicalMoleculeFinder.hh"
#include "G4MolecularConfiguration.hh"
#include "G4DNAChemistryManager.hh"
#include "G4DNAReactionTypeManager.hh"
#include "G4DNAMakeReaction.hh"
#include "G4ITReaction.hh"
#include "G4ITReactionChange.hh"
#include "G4Scheduler.hh"
#include "G4ITTrackHolder.hh"
#include "G4IRTUtils.hh"
using namespace std;
using namespace CLHEP;
G4DNAIndependentReactionTimeStepper::Utils::Utils(const G4Track& trackA,
const G4Track& trackB)
: fTrackA(trackA)
, fTrackB(trackB)
{
fpMoleculeA = GetMolecule(trackA);
fpMoleculeB = GetMolecule(trackA);
}
G4DNAIndependentReactionTimeStepper::G4DNAIndependentReactionTimeStepper()
: G4VITTimeStepComputer()
, fHasAlreadyReachedNullTime(false)
, fMolecularReactionTable(reference_cast<const G4DNAMolecularReactionTable*>(fpReactionTable))
, fReactionModel(nullptr)
, fpTrackContainer(G4ITTrackHolder::Instance())
, fReactionSet(G4ITReactionSet::Instance())
, fVerbose(0)
, fRCutOff(G4IRTUtils::GetRCutOff())
, fReactionTypeManager(nullptr)
, fpReactionProcess(nullptr)
{
fReactionSet->SortByTime();
}
void G4DNAIndependentReactionTimeStepper::Prepare()
{
G4VITTimeStepComputer::Prepare();
fSampledPositions.clear();
BuildChemicalMoleculeFinder()
}
void G4DNAIndependentReactionTimeStepper::InitializeForNewTrack()
{
if (fReactants != nullptr)
{
fReactants.reset();
}
fSampledMinTimeStep = DBL_MAX;
fHasAlreadyReachedNullTime = false;
}
template<typename T>
inline G4bool IsInf(T value)
{
return std::numeric_limits<T>::has_infinity
&& value == std::numeric_limits<T>::infinity();
}
G4double
G4DNAIndependentReactionTimeStepper::CalculateStep(const G4Track& trackA,
const G4double& userMinTimeStep)
{
auto pMoleculeA = GetMolecule(trackA);
InitializeForNewTrack();
fUserMinTimeStep = userMinTimeStep;
#ifdef G4VERBOSE
if (fVerbose)
{
G4cout
<< "_______________________________________________________________________"
<< G4endl;
G4cout << "G4DNAIndependentReactionTimeStepper::CalculateStep" << G4endl;
G4cout << "Check done for molecule : " << pMoleculeA->GetName()
<< " (" << trackA.GetTrackID() << ") "
<< G4endl;
}
#endif
auto pMolConfA = pMoleculeA->GetMolecularConfiguration();
const auto pReactantList = fMolecularReactionTable->CanReactWith(pMolConfA);
if (!pReactantList)
{
#ifdef G4VERBOSE
if (fVerbose > 1)
{
G4cout << "!!!!!!!!!!!!!!!!!!!!" << G4endl;
G4cout << "!!! WARNING" << G4endl;
G4cout << "G4DNAIndependentReactionTimeStepper::CalculateStep will return infinity "
"for the reaction because the molecule "
<< pMoleculeA->GetName()
<< " does not have any reactants given in the reaction table."
<< G4endl;
G4cout << "!!!!!!!!!!!!!!!!!!!!" << G4endl;
}
#endif
return DBL_MAX;
}
G4int nbReactives = pReactantList->size();
if (nbReactives == 0)
{
#ifdef G4VERBOSE
// DEBUG
if (fVerbose)
{
G4cout << "!!!!!!!!!!!!!!!!!!!!" << G4endl;
G4cout << "!!! WARNING" << G4endl;
G4cout << "G4DNAIndependentReactionTimeStepper::CalculateStep will return infinity "
"for the reaction because the molecule "
<< pMoleculeA->GetName()
<< " does not have any reactants given in the reaction table."
<< "This message can also result from a wrong implementation of the reaction table."
<< G4endl;
G4cout << "!!!!!!!!!!!!!!!!!!!!" << G4endl;
}
#endif
return DBL_MAX;
}
fReactants.reset(new vector<G4Track*>());
fReactionModel->Initialise(pMolConfA, trackA);
for (G4int i = 0; i < nbReactives; i++)
{
auto pMoleculeB = (*pReactantList)[i];
G4int key = pMoleculeB->GetMoleculeID();
//fRCutOff = G4IRTUtils::GetRCutOff(1 * ps);
fRCutOff = G4IRTUtils::GetRCutOff();
//______________________________________________________________
// Retrieve reaction range
const G4double Reff = fReactionModel->GetReactionRadius(i);
std::vector<std::pair<G4TrackList::iterator,G4double>> resultIndices;
resultIndices.clear();
G4ChemicalMoleculeFinder::Instance()->
FindNearestInRange(trackA,
key,
fRCutOff,
resultIndices);
if(resultIndices.empty())
{
continue;
}
for(auto& it : resultIndices)
{
G4Track* pTrackB = *(std::get<0>(it));
if(pTrackB == &trackA)
{
continue;
}
if(pTrackB == nullptr)
{
G4ExceptionDescription exceptionDescription;
exceptionDescription << "No trackB no valid";
G4Exception("G4DNAIndependentReactionTimeModel"
"::BuildReactionMap()", "NO_TRACK02",
FatalException, exceptionDescription);
}
Utils utils(trackA, *pTrackB);
auto pMolB = GetMolecule(pTrackB);
auto pMolConfB = pMolB->GetMolecularConfiguration();
G4double distance = (trackA.GetPosition() - pTrackB->GetPosition()).mag();
if(distance * distance < Reff * Reff)
{
auto processTable = *(fReactionTypeManager->GetReactionTypeTable());
auto typeOfReaction = (G4int)GetReactionType(trackA, *pTrackB);
if(processTable[typeOfReaction]->
GeminateRecombinationProbability(pMolConfA, pMolConfB))
{
if (!fHasAlreadyReachedNullTime)
{
fReactants->clear();
fHasAlreadyReachedNullTime = true;
}
fSampledMinTimeStep = 0.;
CheckAndRecordResults(utils);
}
}
else
{
G4double tempMinET = GetTimeToEncounter(trackA, *pTrackB);
if(tempMinET < 0 ||
tempMinET > G4Scheduler::Instance()->GetEndTime())
{
continue;
}
if (tempMinET >= fSampledMinTimeStep)
{
continue;
}
fSampledMinTimeStep = tempMinET;
fReactants->clear();
CheckAndRecordResults(utils);
}
}
}
#ifdef G4VERBOSE
if (fVerbose)
{
G4cout << "G4DNAIndependentReactionTimeStepper::CalculateStep will finally return :"
<< G4BestUnit(fSampledMinTimeStep, "Time") << G4endl;
if (fVerbose > 1)
{
G4cout << "Selected reactants for trackA: " << pMoleculeA->GetName()
<< " (" << trackA.GetTrackID() << ") are: ";
vector<G4Track*>::iterator it;
for (it = fReactants->begin(); it != fReactants->end(); it++)
{
G4Track* trackB = *it;
G4cout << GetMolecule(trackB)->GetName() << " ("
<< trackB->GetTrackID() << ") \t ";
}
G4cout << G4endl;
}
}
#endif
for (const auto& it : *fReactants)
{
auto pTrackB = it;
fSampledPositions[pTrackB->GetTrackID()] = pTrackB->GetPosition();
}
return fSampledMinTimeStep;
}
void G4DNAIndependentReactionTimeStepper::CheckAndRecordResults(const Utils& utils)
{
if (utils.fTrackB.GetTrackStatus() != fAlive)
{
return;
}
if (&utils.fTrackB == &utils.fTrackA)
{
G4ExceptionDescription exceptionDescription;
exceptionDescription<< "A track is reacting with itself"
" (which is impossible) ie fpTrackA == trackB"<< G4endl;
exceptionDescription << "Molecule A is of type : "
<< utils.fpMoleculeA->GetName() << " with trackID : "
<< utils.fTrackA.GetTrackID()<<" and B : "
<< utils.fpMoleculeB->GetName() << " with trackID : "
<< utils.fTrackB.GetTrackID() << G4endl;
G4Exception("G4DNAIndependentReactionTimeStepper::RetrieveResults",
"G4DNAIndependentReactionTimeStepper003", FatalErrorInArgument,
exceptionDescription);
}
if (fabs(utils.fTrackB.GetGlobalTime() - utils.fTrackA.GetGlobalTime())
> utils.fTrackA.GetGlobalTime() * (1. - 1. / 100))
{
// DEBUG
G4ExceptionDescription exceptionDescription;
exceptionDescription
<< "The interacting tracks are not synchronized in time" << G4endl;
exceptionDescription
<< "trackB->GetGlobalTime() != fpTrackA.GetGlobalTime()" << G4endl;
exceptionDescription << "fpTrackA : trackID : " << utils.fTrackA.GetTrackID()
<< "\t Name :" << utils.fpMoleculeA->GetName()
<< "\t fpTrackA->GetGlobalTime() = "
<< G4BestUnit(utils.fTrackA.GetGlobalTime(), "Time") << G4endl;
exceptionDescription << "trackB : trackID : " << utils.fTrackB.GetTrackID()
<< "\t Name :" << utils.fpMoleculeB->GetName()
<< "\t trackB->GetGlobalTime() = "
<< G4BestUnit(utils.fTrackB.GetGlobalTime(), "Time") << G4endl;
G4Exception("G4DNAIndependentReactionTimeStepper::RetrieveResults",
"G4DNAIndependentReactionTimeStepper004", FatalErrorInArgument,
exceptionDescription);
}
fReactants->push_back(const_cast<G4Track*>(&utils.fTrackB));
}
std::unique_ptr<G4ITReactionChange>
G4DNAIndependentReactionTimeStepper::FindReaction(G4ITReactionSet* pReactionSet,
const G4double& currentStepTime,
const G4double& /*previousStepTime*/,
const G4bool& /*reachedUserStepTimeLimit*/)
{
if (pReactionSet == nullptr)
{
return nullptr;
}
G4ITReactionPerTime& reactionPerTime = pReactionSet->GetReactionsPerTime();
if(reactionPerTime.empty())
{
return nullptr;
}
for (auto reaction_i = reactionPerTime.begin();
reaction_i != reactionPerTime.end();
reaction_i = reactionPerTime.begin())
{
G4Track* pTrackA = (*reaction_i)->GetReactants().first;
if (pTrackA->GetTrackStatus() == fStopAndKill)
{
continue;
}
G4Track* pTrackB = (*reaction_i)->GetReactant(pTrackA);
if (pTrackB->GetTrackStatus() == fStopAndKill)
{
continue;
}
if (pTrackB == pTrackA)
{
G4ExceptionDescription exceptionDescription;
exceptionDescription
<< "The IT reaction process sent back a reaction between trackA and trackB. ";
exceptionDescription << "The problem is trackA == trackB";
G4Exception("G4ITModelProcessor::FindReaction",
"ITModelProcessor005",
FatalErrorInArgument,
exceptionDescription);
}
pReactionSet->SelectThisReaction(*reaction_i);
if(fpReactionProcess != nullptr && fpReactionProcess->TestReactibility(*pTrackA,
*pTrackB,
currentStepTime,
false))
{
pTrackA->SetPosition(fSampledPositions[pTrackA->GetTrackID()]);
pTrackB->SetPosition(fSampledPositions[pTrackB->GetTrackID()]);
auto pReactionChange = fpReactionProcess->MakeReaction(*pTrackA, *pTrackB);
if (pReactionChange == nullptr)
{
return nullptr;
}
return pReactionChange;
}
}
return nullptr;
}
void G4DNAIndependentReactionTimeStepper::SetReactionModel(G4VDNAReactionModel* pReactionModel)
{
fReactionModel = pReactionModel;
}
G4VDNAReactionModel* G4DNAIndependentReactionTimeStepper::GetReactionModel()
{
return fReactionModel;
}
void G4DNAIndependentReactionTimeStepper::SetVerbose(G4int flag)
{
fVerbose = flag;
}
ReactionType G4DNAIndependentReactionTimeStepper::GetReactionType(const G4Track& trackA,
const G4Track& trackB)
{
auto pMoleculeA = GetMolecule(trackA)->GetMolecularConfiguration();
auto pMoleculeB = GetMolecule(trackB)->GetMolecularConfiguration();
auto pData = fMolecularReactionTable->GetReactionData(pMoleculeA,pMoleculeB);
G4int reactionID = pData->GetReactionID();
return fReactionTypeManager->GetReactionTypeByID(reactionID);
}
G4double G4DNAIndependentReactionTimeStepper::GetTimeToEncounter(const G4Track& trackA,
const G4Track& trackB)
{
if(fReactionTypeManager == nullptr)
{
G4ExceptionDescription exceptionDescription;
exceptionDescription << "fpProManager is not "
"initialized ";
G4Exception("G4DNAIndependentReactionTimeModel::"
"GetIndependentReactionTime()",
"G4DNAIndependentReactionTimeModel002",
FatalErrorInArgument,exceptionDescription);
}
auto processTable = *(fReactionTypeManager->GetReactionTypeTable());
ReactionType reactionType = GetReactionType(trackA,trackB);
#ifdef DEBUG
G4cout<<"A: "<<GetMolecule(trackA)->GetName()<<"("<<trackA.GetTrackID()<<")"<<" + B : "
<<GetMolecule(trackB)->GetName()<<"("<<trackB.GetTrackID()<<")"<<G4endl;
#endif
return processTable[(G4int)reactionType]->GetTimeToEncounter(trackA,trackB);
}
void G4DNAIndependentReactionTimeStepper::SetReactionTypeManager(G4VReactionTypeManager* typeManager)
{
fReactionTypeManager = ((G4DNAReactionTypeManager*)typeManager);
}
void G4DNAIndependentReactionTimeStepper::SetReactionProcess(G4VITReactionProcess* pReactionProcess)
{
fpReactionProcess = pReactionProcess;
}
G4double G4DNAIndependentReactionTimeStepper::CalculateMinTimeStep(G4double /*currentGlobalTime*/, G4double definedMinTimeStep)
{
G4double fTSTimeStep = DBL_MAX;
for (auto pTrack : *fpTrackContainer->GetMainList())
{
if (pTrack == nullptr)
{
G4ExceptionDescription exceptionDescription;
exceptionDescription << "No track found.";
G4Exception("G4Scheduler::CalculateMinStep", "ITScheduler006",
FatalErrorInArgument, exceptionDescription);
continue;
}
G4TrackStatus trackStatus = pTrack->GetTrackStatus();
if (trackStatus == fStopAndKill || trackStatus == fStopButAlive)
{
continue;
}
G4double sampledMinTimeStep = CalculateStep(*pTrack, definedMinTimeStep);
G4TrackVectorHandle reactants = GetReactants();
if (sampledMinTimeStep < fTSTimeStep)
{
fTSTimeStep = sampledMinTimeStep;
fReactionSet->CleanAllReaction();
if (reactants)
{
fReactionSet->AddReactions(fTSTimeStep,
const_cast<G4Track*>(pTrack),
reactants);
ResetReactants();
}
}
else if (fTSTimeStep == sampledMinTimeStep && G4bool(reactants))
{
fReactionSet->AddReactions(fTSTimeStep,
const_cast<G4Track*>(pTrack),
reactants);
ResetReactants();
}
else if (reactants)
{
ResetReactants();
}
}
return fTSTimeStep;
}
@@ -0,0 +1,200 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "G4DNAMakeReaction.hh"
#include "G4DNAMolecularReactionTable.hh"
#include "G4VDNAReactionModel.hh"
#include "G4Molecule.hh"
#include "G4MoleculeFinder.hh"
#include "G4ITReactionChange.hh"
#include "Randomize.hh"
#include "G4SystemOfUnits.hh"
#include "G4ITReaction.hh"
#include "G4DNAIndependentReactionTimeStepper.hh"
#include "G4Scheduler.hh"
#include "G4UnitsTable.hh"
G4DNAMakeReaction::G4DNAMakeReaction()
: G4VITReactionProcess()
, fMolReactionTable(reference_cast<const G4DNAMolecularReactionTable*>(fpReactionTable))
, fpReactionModel(nullptr)
, fpTimeStepper(nullptr)
, fTimeStep(0)
{
}
G4DNAMakeReaction::G4DNAMakeReaction(G4VDNAReactionModel* pReactionModel)
: G4DNAMakeReaction()
{
fpReactionModel = pReactionModel;
}
void G4DNAMakeReaction::SetTimeStepComputer(G4VITTimeStepComputer* pStepper)
{
fpTimeStepper = pStepper;
}
G4bool G4DNAMakeReaction::TestReactibility(const G4Track& /*trackA*/,
const G4Track& /*trackB*/,
G4double currentStepTime,
G4bool /*userStepTimeLimit*/) /*const*/
{
fTimeStep = currentStepTime;
return true;
}
std::unique_ptr<G4ITReactionChange>
G4DNAMakeReaction::MakeReaction(const G4Track &trackA,
const G4Track &trackB)
{
G4Track& tA = const_cast<G4Track&>(trackA);
G4Track& tB = const_cast<G4Track&>(trackB);
UpdatePositionForReaction( tA , tB );//TODO: should change it
std::unique_ptr<G4ITReactionChange> pChanges(new G4ITReactionChange());
pChanges->Initialize(trackA, trackB);
const auto pMoleculeA = GetMolecule(trackA)->GetMolecularConfiguration();
const auto pMoleculeB = GetMolecule(trackB)->GetMolecularConfiguration();
const auto pReactionData = fMolReactionTable->GetReactionData(pMoleculeA, pMoleculeB);
const G4int nbProducts = pReactionData->GetNbProducts();
if (nbProducts)
{
const G4double D1 = pMoleculeA->GetDiffusionCoefficient();
const G4double D2 = pMoleculeB->GetDiffusionCoefficient();
const G4double sqrD1 = D1 == 0. ? 0. : std::sqrt(D1);
const G4double sqrD2 = D2 == 0. ? 0. : std::sqrt(D2);
const G4double inv_numerator = 1./(sqrD1 + sqrD2);
const G4ThreeVector reactionSite = sqrD2 * inv_numerator * tA.GetPosition()
+ sqrD1 * inv_numerator * tB.GetPosition();
G4double u = G4UniformRand();
auto randP = (1-u) * tA.GetPosition() + u * tB.GetPosition();
for (G4int j = 0; j < nbProducts; ++j)
{
auto pProduct = new G4Molecule(pReactionData->GetProduct(j));
auto pProductTrack = pProduct->BuildTrack(trackA.GetGlobalTime(), (reactionSite + randP)/2);
pProductTrack->SetTrackStatus(fAlive);
G4ITTrackHolder::Instance()->Push(pProductTrack);
pChanges->AddSecondary(pProductTrack);
}
}
pChanges->KillParents(true);
return pChanges;
}
void G4DNAMakeReaction::SetReactionModel(G4VDNAReactionModel* pReactionModel)
{
fpReactionModel = pReactionModel;
}
void G4DNAMakeReaction::UpdatePositionForReaction(G4Track& trackA,
G4Track& trackB)
{
const auto pMoleculeA = GetMolecule(trackA)->GetMolecularConfiguration();
const auto pMoleculeB = GetMolecule(trackB)->GetMolecularConfiguration();
G4double D1 = pMoleculeA->GetDiffusionCoefficient();
G4double D2 = pMoleculeB->GetDiffusionCoefficient();
G4double reactionRadius = fpReactionModel->GetReactionRadius( pMoleculeA, pMoleculeB );
G4ThreeVector p1 = trackA.GetPosition();
G4ThreeVector p2 = trackB.GetPosition();
G4ThreeVector S1 = p1 - p2;
G4double distance = S1.mag();
if(D1 == 0)
{
trackB.SetPosition(p1);
return;
}
else if(D2 == 0)
{
trackA.SetPosition(p2);
return;
}
if(distance == 0)
{
G4ExceptionDescription exceptionDescription;
exceptionDescription << "Two particles are overlap: "
<<GetMolecule(trackA)->GetName()
<<" and "<<GetMolecule(trackB)->GetName()
<<" at "<<trackA.GetPosition();
G4Exception("G4DNAMakeReaction::PrepareForReaction()",
"G4DNAMakeReaction003",
FatalErrorInArgument,exceptionDescription);
}
S1.setMag(reactionRadius);
const G4double dt = fTimeStep;//irt - actualize molecule time
if(dt > 0)// irt > 0
{
G4double s12 = 2.0 * D1 * dt;
G4double s22 = 2.0 * D2 * dt;
G4double sigma = s12 + ( s12 * s12 ) / s22;
G4double alpha = reactionRadius * distance / (2 * (D1 + D2) * dt );
G4ThreeVector S2 = (p1 + ( s12 / s22 ) * p2) +
G4ThreeVector(G4RandGauss::shoot(0.0, sigma),
G4RandGauss::shoot(0.0, sigma),
G4RandGauss::shoot(0.0, sigma));
S1.setPhi(rad * G4UniformRand() * 2.0 * CLHEP::pi);
S1.setTheta(rad * std::acos( 1.0 + (1. / alpha) *
std::log(1.0 - G4UniformRand() *
(1.-std::exp(-2.0 * alpha)))));
const G4ThreeVector R1 = (D1 * S1 + D2 * S2) / (D1 + D2);
const G4ThreeVector R2 = D2 * (S2 - S1) / (D1 + D2);
trackA.SetPosition(R1);
trackB.SetPosition(R2);
}
}
std::vector<std::unique_ptr<G4ITReactionChange>>
G4DNAMakeReaction::FindReaction(G4ITReactionSet* pReactionSet,
const G4double currentStepTime,
const G4double /*globalTime*/,
const G4bool /*reachedUserStepTimeLimit*/)
{
std::vector<std::unique_ptr<G4ITReactionChange>> ReactionInfo;
ReactionInfo.clear();
auto pReactionChange = dynamic_cast<G4DNAIndependentReactionTimeStepper*>(fpTimeStepper)->
FindReaction(pReactionSet,currentStepTime);
if (pReactionChange != nullptr)
{
ReactionInfo.push_back(std::move(pReactionChange));
}
return ReactionInfo;
}
@@ -0,0 +1,168 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "G4DNAPartiallyDiffusionControlled.hh"
#include "G4IRTUtils.hh"
#include "G4DNAMolecularReactionTable.hh"
#include "G4VDNAReactionModel.hh"
#include "G4SystemOfUnits.hh"
#include "G4PhysicalConstants.hh"
#include "G4MolecularConfiguration.hh"
#include "Randomize.hh"
#include "G4Molecule.hh"
#include "G4ITReactionChange.hh"
#include "G4VReactionType.hh"
#include "G4Electron_aq.hh"
#include "G4ErrorFunction.hh"
G4DNAPartiallyDiffusionControlled::G4DNAPartiallyDiffusionControlled()
: G4VReactionType()
{}
G4DNAPartiallyDiffusionControlled::~G4DNAPartiallyDiffusionControlled() = default;
G4bool
G4DNAPartiallyDiffusionControlled::GeminateRecombinationProbability(const G4MolecularConfiguration* mA,
const G4MolecularConfiguration* mB)
{
auto reactionData = G4DNAMolecularReactionTable::Instance()
->GetReactionData(mA, mB);
G4double D = GetDiffusionCoefficient(mA, mB);
G4double R = mA->GetVanDerVaalsRadius() + mB->GetVanDerVaalsRadius();
const G4double Rs = 0.3 * nm;
G4double kobs = reactionData->GetObservedReactionRateConstant() / Avogadro;
if(mA->GetCharge() * mB->GetCharge() == 0)
{
G4double kdif = 4 * CLHEP::pi * D * R * Avogadro;
G4double kact = G4IRTUtils::GetKact(kobs, kdif);
return G4UniformRand() < Rs / ( Rs + ( kdif / kact ) * ( R + Rs ));
}
else
{
G4double rc = 0.71 * nm * mA->GetCharge() *
mB->GetCharge();
G4double sigmaEff = G4IRTUtils::EffectiveDistance(rc, R);
G4double kdif = 4 * CLHEP::pi * D * sigmaEff;
G4double kact = G4IRTUtils::GetKact(kobs, kdif);
G4double a = std::exp( -rc / R );
G4double b = std::exp( -rc / ( R + Rs ) );
G4double Preact = ( a - b ) / ( a - b - ( kdif / kact ) * ( 1 - a ) );
return G4UniformRand() < Preact;
}
}
G4double
G4DNAPartiallyDiffusionControlled::GetDiffusionCoefficient(const G4MolecularConfiguration* mA,
const G4MolecularConfiguration* mB)
{
G4double D;
if(mA == mB)
{
D = (mA->GetDiffusionCoefficient());
}
else
{
D = (mA->GetDiffusionCoefficient() +
mB->GetDiffusionCoefficient());
}
return D;
}
G4double G4DNAPartiallyDiffusionControlled::GetTimeToEncounter(const G4Track& trackA,
const G4Track& trackB)
{
auto pMolConfA = GetMolecule(trackA)->GetMolecularConfiguration();
auto pMolConfB = GetMolecule(trackB)->GetMolecularConfiguration();
G4double D = GetDiffusionCoefficient(pMolConfA, pMolConfB);
auto reactionData = G4DNAMolecularReactionTable::Instance()
->GetReactionData(pMolConfA, pMolConfB);
G4double Reff;
G4double kobs = reactionData->GetObservedReactionRateConstant();
G4double distance = (trackA.GetPosition() - trackB.GetPosition()).mag();
G4double SmoluchowskiRadius;
G4double RVal = pMolConfA->GetVanDerVaalsRadius() + pMolConfB->GetVanDerVaalsRadius();
if((pMolConfA->GetCharge() != 0) &&
(pMolConfB->GetCharge() != 0))
{
G4double rc = 0.71 * nm * pMolConfA->GetCharge() *
pMolConfB->GetCharge();
distance = G4IRTUtils::EffectiveDistance( rc, distance );
Reff = G4IRTUtils::EffectiveDistance( rc, RVal );
SmoluchowskiRadius = Reff;
}
else
{
SmoluchowskiRadius = RVal;
}
G4double Winf = SmoluchowskiRadius / distance;
G4double U1 = G4UniformRand();
G4double U2 = G4UniformRand();
G4double U = G4UniformRand();
G4double X = 0;
G4double irt_1 = -1.0 * ps;
G4double irt_2;
G4double kdif = 4 * CLHEP::pi * D * SmoluchowskiRadius * Avogadro;
G4double kact = G4IRTUtils::GetKact(kobs, kdif);
if ( U < Winf )
{
G4double d = ( distance - SmoluchowskiRadius ) /
G4ErrorFunction::erfcInv( U / Winf );
irt_1 = ( 1.0 / ( 4 * D ) ) * d * d;
}
if( irt_1 < 0)
{
return irt_1;
}
else
{
G4double rateFactor = kact / ( kact + kdif );
if( U1 > rateFactor )
{
return -1.0 * ps;
}
G4double Y = std::abs(G4RandGauss::shoot(0.0,std::sqrt(2)));
if( Y > 0)
{
X = - ( G4Log( U2 ) ) / Y;
}
G4double f = X * SmoluchowskiRadius * kdif / ( kact + kdif );
irt_2 = ( f * f ) / D ;
}
return irt_1 + irt_2;
}
@@ -0,0 +1,366 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Created on 2016/04/08
//
// Authors: D. Sakata, S. Incerti
//
// This class perform transmission term of volume plasmon excitation,
// based on Quinn Model, see Phys. Rev. vol 126, number 4 (1962)
#include "G4DNAQuinnPlasmonExcitationModel.hh"
#include "G4SystemOfUnits.hh"
#include "G4RandomDirection.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4DNAQuinnPlasmonExcitationModel::G4DNAQuinnPlasmonExcitationModel
(const G4ParticleDefinition*,
const G4String& nam):
G4VEmModel(nam), isInitialised(false)
{
fpMaterialDensity = 0;
fLowEnergyLimit = 10 * eV;
fHighEnergyLimit = 1.0 * GeV;
for(G4int i=0;i<100;i++) nValenceElectron[i]=0;
verboseLevel = 0;
if (verboseLevel > 0)
{
G4cout << "Quinn plasmon excitation model is constructed " << G4endl;
}
fParticleChangeForGamma = 0;
statCode = false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4DNAQuinnPlasmonExcitationModel::~G4DNAQuinnPlasmonExcitationModel()
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4DNAQuinnPlasmonExcitationModel::Initialise
(const G4ParticleDefinition* particle,
const G4DataVector& /*cuts*/)
{
for(G4int i=0;i<100;i++) nValenceElectron[i]=0;
if (verboseLevel > 3)
{
G4cout <<
"Calling G4DNAQuinnPlasmonExcitationModel::Initialise()"
<< G4endl;
}
if(particle == G4Electron::ElectronDefinition())
{
fLowEnergyLimit = 10 * eV;
fHighEnergyLimit = 1.0 * GeV;
}
else
{
G4Exception("G4DNAQuinnPlasmonExcitationModel::Initialise","em0001",
FatalException,"Not defined for other particles than electrons.");
return;
}
// Get Number of valence electrons
G4ProductionCutsTable* theCoupleTable =
G4ProductionCutsTable::GetProductionCutsTable();
G4int numOfCouples = theCoupleTable->GetTableSize();
for(G4int i=0;i<numOfCouples;i++){
const G4MaterialCutsCouple* couple =
theCoupleTable->GetMaterialCutsCouple(i);
const G4Material* material = couple->GetMaterial();
const G4ElementVector* theElementVector =material->GetElementVector();
G4int nelm = material->GetNumberOfElements();
if (nelm==1){// Protection: only for single element
G4int z = G4lrint((*theElementVector)[0]->GetZ());
if(z<=100){nValenceElectron[z] = GetNValenceElectron(z);}
}
//for(G4int j=0;j<nelm;j++){
// G4int z=G4lrint((*theElementVector)[j]->GetZ());
// if(z<=100){nValenceElectron[z] = GetNValenceElectron(z);}
//}
}
if( verboseLevel>0 )
{
G4cout << "Quinn plasmon excitation model is initialized " << G4endl
<< "Energy range: "
<< LowEnergyLimit() / eV << " eV - "
<< HighEnergyLimit() / keV << " keV for "
<< particle->GetParticleName()
<< G4endl;
}
if (isInitialised){return;}
fParticleChangeForGamma = GetParticleChangeForGamma();
isInitialised = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4DNAQuinnPlasmonExcitationModel::CrossSectionPerVolume
(const G4Material* material,
const G4ParticleDefinition* particleDefinition,
G4double ekin,
G4double,
G4double)
{
if (verboseLevel > 3)
{
G4cout <<
"Calling CrossSectionPerVolume() of G4DNAQuinnPlasmonExcitationModel"
<< G4endl;
}
// Protection: only for single element
if(material->GetNumberOfElements()>1) return 0.;
G4double z = material->GetZ();
// Protection: only for Gold
if (z!=79){return 0.;}
G4double sigma = 0;
G4double atomicNDensity = material->GetAtomicNumDensityVector()[0];
if(atomicNDensity!= 0.0)
{
if (ekin >= fLowEnergyLimit && ekin < fHighEnergyLimit)
{
sigma = GetCrossSection(material,particleDefinition,ekin);
}
if (verboseLevel > 2)
{
G4cout<<"__________________________________" << G4endl;
G4cout<<"=== G4DNAQuinnPlasmonExcitationModel - XS INFO START"<<G4endl;
G4cout<<"=== Kinetic energy (eV)=" << ekin/eV << " particle : "
<<particleDefinition->GetParticleName() << G4endl;
G4cout<<"=== Cross section per atom for Z="<<z<<" is (cm^2)"
<<sigma/cm/cm << G4endl;
G4cout<<"=== Cross section per atom for Z="<<z<<" is (cm^-1)="
<<sigma*atomicNDensity/(1./cm) << G4endl;
G4cout<<"=== G4DNAQuinnPlasmonExcitationModel - XS INFO END" << G4endl;
}
}
return sigma*atomicNDensity;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4DNAQuinnPlasmonExcitationModel::SampleSecondaries
(std::vector<G4DynamicParticle*>* /*fvect*/,
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* aDynamicParticle,
G4double,G4double)
{
if (verboseLevel > 3)
{
G4cout <<
"Calling SampleSecondaries() of G4DNAQuinnPlasmonExcitationModel"
<< G4endl;
}
const G4Material *material = couple->GetMaterial();
G4ParticleDefinition* particle = aDynamicParticle->GetDefinition();
G4double k = aDynamicParticle->GetKineticEnergy();
if(particle == G4Electron::ElectronDefinition())
{
G4double e = 1.;
G4int z = material->GetZ();
G4int Nve = 0;
//TODO: have to be change to realistic!!
if(z<100) Nve = nValenceElectron[z];
G4double A = material->GetA()/g/mole;
G4double Dens = material->GetDensity()/g*cm*cm*cm;
G4double veDens = Dens*CLHEP::Avogadro*Nve/A;
G4double omega_p = std::sqrt(veDens*std::pow(e,2)/
(CLHEP::epsilon0/(1./cm)*CLHEP::electron_mass_c2
/(CLHEP::c_squared/cm/cm)));
G4double excitationEnergy = CLHEP::hbar_Planck*omega_p;
G4double newEnergy = k - excitationEnergy;
if (newEnergy > 0)
{
fParticleChangeForGamma->
ProposeMomentumDirection(aDynamicParticle->GetMomentumDirection());
fParticleChangeForGamma->ProposeLocalEnergyDeposit(excitationEnergy);
if(!statCode)
{
fParticleChangeForGamma->SetProposedKineticEnergy(newEnergy);
}
else
{
fParticleChangeForGamma->SetProposedKineticEnergy(k);
}
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4DNAQuinnPlasmonExcitationModel::GetCrossSection
(const G4Material* material,
const G4ParticleDefinition* particle,
G4double kineticEnergy)
{
G4double value=0;
if(particle == G4Electron::ElectronDefinition())
{
G4double e = 1.;
G4int z = material->GetZ();
G4int Nve = 0;
if(z<100) Nve = nValenceElectron[z];
G4double A = material->GetA()/g/mole;
G4double Dens = material->GetDensity()/g*cm*cm*cm;
G4double veDens = Dens*CLHEP::Avogadro*Nve/A;
G4double omega_p = std::sqrt(veDens*std::pow(e,2)
/(CLHEP::epsilon0/(1./cm)*CLHEP::electron_mass_c2/
(CLHEP::c_squared/cm/cm)));
G4double fEnergy = std::pow(CLHEP::h_Planck,2)/(8*CLHEP::electron_mass_c2)*
std::pow(3*veDens/CLHEP::pi,2./3.)/e
*(CLHEP::c_squared/cm/cm);
G4double p0 = sqrt(2*CLHEP::electron_mass_c2
/(CLHEP::c_squared/cm/cm)*fEnergy);
G4double p = sqrt(2*CLHEP::electron_mass_c2
/(CLHEP::c_squared/cm/cm)*kineticEnergy);
G4double mfp = 2*CLHEP::Bohr_radius/cm*kineticEnergy
/(CLHEP::hbar_Planck*omega_p)/
(G4Log((std::pow(std::pow(p0,2)
+2*CLHEP::electron_mass_c2/
(CLHEP::c_squared/cm/cm)*omega_p
*CLHEP::hbar_Planck,1./2.)-p0)
/(p-std::pow(std::pow(p,2)-2*CLHEP::electron_mass_c2/
(CLHEP::c_squared/cm/cm)*omega_p
*CLHEP::hbar_Planck,1./2.))));
G4double excitationEnergy = CLHEP::hbar_Planck*omega_p;
if((0<mfp)&&(0<veDens)&&(excitationEnergy<kineticEnergy)){
value = 1./(veDens*mfp);
}
}
return value*cm*cm;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int G4DNAQuinnPlasmonExcitationModel::GetNValenceElectron(G4int z)
{
G4int Nve=0;
// Current limitation to gold
if (z!=79){return 0.;}
if (verboseLevel > 3)
{
G4cout <<
"Calling GetNValenceElectron() of G4DNAQuinnPlasmonExcitationModel"
<< G4endl;
}
const char *datadir=0;
if(!datadir)
{
datadir = getenv("G4LEDATA");
if(!datadir)
{
G4Exception("G4DNAQuinnPlasmonExcitationModel::GetNValenceElectron()"
,"em0002",FatalException,
"Enviroment variable G4LEDATA not defined");
return 0;
}
}
std::ostringstream targetfile;
targetfile.str("");
targetfile.clear(stringstream::goodbit);
targetfile << datadir <<"/dna/atomicstate_Z"<< z <<".dat";
std::ifstream fin(targetfile.str().c_str());
if(!fin)
{
G4cout<< " Error : "<< targetfile.str() <<" is not found "<<endl;
G4Exception("G4DNAQuinnPlasmonExcitationModel::GetNValenceElectron()"
,"em0003",FatalException,
"There is no target file");
return 0;
}
string buff0,buff1,buff2,buff3,buff4,buff5,buff6;
fin >> buff0 >>buff1>>buff2>>buff3>>buff4>>buff5>>buff6;
while(true){
fin >> buff0 >>buff1>>buff2>>buff3>>buff4>>buff5>>buff6;
if(!fin.eof())
{
Nve = stoi(buff3);
}
else
{
break;
}
}
return Nve;
}
@@ -0,0 +1,760 @@
//
// ********************************************************************
// * 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: G4DNARelativisticIonisationModel.cc $
//
// Created on 2016/05/12
//
// Authors: D Sakata, S. Incerti
//
// This class perform ionisation for electron transportation in gold,
// based on Relativistic Binary Encounter Bethe-Vriens(RBEBV) model.
// See following reference paper,
// M. Guerra et al, J. Phys. B: At. Mol. Opt. Phys. 48, 185202 (2015)
// =======================================================================
// Limitation of secondaries by GEANT4 atomic de-excitation:
// The cross section and energy of secondary production is based on
// EADL database. If there are no tabele for several orbitals, this class
// will not provide secondaries for the orbitals.
// For gold(Au), this class provide secondaries for inner 18 orbitals
// but don't provide for outer 3 orbitals due to EADL databese limitation.
// =======================================================================
#include "G4DNARelativisticIonisationModel.hh"
#include "G4SystemOfUnits.hh"
#include "G4AtomicShell.hh"
#include "G4UAtomicDeexcitation.hh"
#include "G4LossTableManager.hh"
#include "G4Gamma.hh"
#include "G4RandomDirection.hh"
#include "G4DNAMolecularMaterial.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4DNARelativisticIonisationModel::G4DNARelativisticIonisationModel(
const G4ParticleDefinition*,
const G4String& nam) :
G4VEmModel(nam), isInitialised(false),statCode(false),fasterCode(true)
{
fHighEnergyLimit = 0;
fLowEnergyLimit = 0;
verboseLevel = 0;
SetDeexcitationFlag(true);
fAtomDeexcitation = 0;
fMaterialDensity = 0;
fParticleDefinition = 0;
fParticleChangeForGamma = 0;
if (verboseLevel > 0)
{
G4cout << "Relativistic Ionisation Model is constructed " << G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4DNARelativisticIonisationModel::~G4DNARelativisticIonisationModel()
{
// Cross section
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4DNARelativisticIonisationModel::Initialise(const G4ParticleDefinition* particle,
const G4DataVector& /*cuts*/)
{
if (verboseLevel > 3)
{
G4cout <<
"Calling G4DNARelativisticIonisationModel::Initialise()"
<< G4endl;
}
if(fParticleDefinition != 0 && fParticleDefinition != particle)
{
G4Exception("G4DNARelativisticIonisationModel::Initialise","em0001",
FatalException,"Model already initialized for another particle type.");
}
fParticleDefinition = particle;
G4ParticleDefinition *electronDef = G4Electron::ElectronDefinition();
if(particle == electronDef)
{
fLowEnergyLimit = 10 * eV;
fHighEnergyLimit = 1.0 * GeV;
std::ostringstream eFullFileNameZ;
char *path = getenv("G4LEDATA");
if (!path)
{
G4Exception("G4DNARelativisticIonisationModel::Initialise","em0006",
FatalException,"G4LEDATA environment variable not set.");
return;
}
G4ProductionCutsTable *coupletable
= G4ProductionCutsTable::GetProductionCutsTable();
G4int Ncouple = coupletable ->GetTableSize();
for(G4int i=0;i<Ncouple;i++)
{
const G4MaterialCutsCouple* couple
= coupletable->GetMaterialCutsCouple(i);
const G4Material * material = couple ->GetMaterial();
{
// Protection: only for single element
if(material->GetNumberOfElements()>1) continue;
G4int Z = material->GetZ();
// Protection: only for GOLD
if(Z!=79) continue;
iState [Z].clear();
iShell [Z].clear();
iSubShell [Z].clear();
Nelectrons[Z].clear();
Ebinding [Z].clear();
Ekinetic [Z].clear();
LoadAtomicStates(Z,path);
/////////////Load cumulated DCS////////////////
eVecEZ.clear();
eVecEjeEZ.clear();
eProbaShellMapZ.clear();
eDiffCrossSectionDataZ.clear();
eFullFileNameZ.str("");
eFullFileNameZ.clear(stringstream::goodbit);
eFullFileNameZ
<< path
<< "/dna/sigmadiff_cumulated_ionisation_e_RBEBV_Z"
<< Z << ".dat";
std::ifstream eDiffCrossSectionZ(eFullFileNameZ.str().c_str());
if (!eDiffCrossSectionZ)
G4Exception("G4DNARelativisticIonisationModel::Initialise","em0003",
FatalException,
"Missing data file for cumulated DCS");
eVecEZ[Z].push_back(0.);
while(!eDiffCrossSectionZ.eof())
{
G4double tDummy;
G4double eDummy;
eDiffCrossSectionZ>>tDummy>>eDummy;
if (tDummy != eVecEZ[Z].back())
{
eVecEZ[Z].push_back(tDummy);
eVecEjeEZ[Z][tDummy].push_back(0.);
}
for(G4int istate=0;istate<(G4int)iState[Z].size();istate++)
{
eDiffCrossSectionZ>>
eDiffCrossSectionDataZ[Z][istate][tDummy][eDummy];
eEjectedEnergyDataZ[Z][istate][tDummy]
[eDiffCrossSectionDataZ[Z][istate][tDummy][eDummy]]
= eDummy;
eProbaShellMapZ[Z][istate][tDummy].push_back(
eDiffCrossSectionDataZ[Z][istate][tDummy][eDummy]);
}
if (eDummy != eVecEjeEZ[Z][tDummy].back()){
eVecEjeEZ[Z][tDummy].push_back(eDummy);
}
}
}
}
}
else
{
G4cout<<
"Error : No particle Definition is found in G4DNARelativisticIonisationModel"
<<G4endl;
return;
}
if( verboseLevel>0 )
{
G4cout << "Relativistic Ionisation model is initialized " << G4endl
<< "Energy range: "
<< LowEnergyLimit() / eV << " eV - "
<< HighEnergyLimit() / keV << " keV for "
<< particle->GetParticleName()
<< G4endl;
}
// Initialise gold density pointer
fMaterialDensity = G4DNAMolecularMaterial::Instance()
->GetNumMolPerVolTableFor(G4Material::GetMaterial("G4_Au"));
fAtomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
fParticleChangeForGamma = GetParticleChangeForGamma();
if (isInitialised){return;}
isInitialised = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4DNARelativisticIonisationModel::CrossSectionPerVolume(
const G4Material* material,
const G4ParticleDefinition* particleDefinition,
G4double ekin,
G4double,
G4double)
{
if (verboseLevel > 3)
{
G4cout <<
"Calling CrossSectionPerVolume() of G4DNARelativisticIonisationModel"
<< G4endl;
}
if(particleDefinition != fParticleDefinition) return 0;
// Calculate total cross section for model
G4double sigma=0;
if(material->GetNumberOfElements()>1) return 0.; // Protection for Molecules
G4double atomicNDensity = material->GetAtomicNumDensityVector()[0];
G4double z = material->GetZ();
if(atomicNDensity!= 0.0)
{
if (ekin >= fLowEnergyLimit && ekin < fHighEnergyLimit)
{
sigma = GetTotalCrossSection(material,particleDefinition,ekin);
}
if (verboseLevel > 2)
{
G4cout << "__________________________________" << G4endl;
G4cout << "=== G4DNARelativisticIonisationModel - XS INFO START" <<G4endl;
G4cout << "=== Kinetic energy (eV)=" << ekin/eV << " particle : "
<< particleDefinition->GetParticleName() << G4endl;
G4cout << "=== Cross section per atom for Z="<<z<<" is (cm^2)"
<< sigma/cm/cm << G4endl;
G4cout << "=== Cross section per atom for Z="<<z<<" is (cm^-1)="
<< sigma*atomicNDensity/(1./cm) << G4endl;
G4cout << "=== G4DNARelativisticIonisationModel - XS INFO END" << G4endl;
}
}
return sigma*atomicNDensity;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4DNARelativisticIonisationModel::SampleSecondaries(
std::vector<G4DynamicParticle*>* fvect,
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* particle,
G4double,G4double)
{
if (verboseLevel > 3)
{
G4cout <<
"Calling SampleSecondaries() of G4DNARelativisticIonisationModel"
<< G4endl;
}
G4ParticleDefinition* particleDef = particle->GetDefinition();
G4double k = particle->GetKineticEnergy();
G4double ejectedE = 0.*eV;
if(fLowEnergyLimit <= k && k<fHighEnergyLimit)
{
G4ThreeVector primaryDir = particle ->GetMomentumDirection();
G4double particleMass = particleDef->GetPDGMass();
G4double totalEnergy = k+particleMass;
G4double pSquare = k*(totalEnergy+particleMass);
G4double totalMomentum = std::sqrt(pSquare);
const G4Material *material = couple->GetMaterial();
G4int z = material->GetZ();
G4int level = RandomSelect(material,particleDef,k);
if(k<Ebinding[z].at(level)) return;
G4int NumSecParticlesInit =0;
G4int NumSecParticlesFinal=0;
if(fAtomDeexcitation){
G4AtomicShellEnumerator as = G4AtomicShellEnumerator(level);
const G4AtomicShell *shell = fAtomDeexcitation->GetAtomicShell(z,as);
NumSecParticlesInit = fvect->size();
fAtomDeexcitation->GenerateParticles(fvect,shell,z,0,0);
NumSecParticlesFinal = fvect->size();
}
ejectedE
= GetEjectedElectronEnergy (material,particleDef,k,level);
G4ThreeVector ejectedDir
= GetEjectedElectronDirection(particleDef,k,ejectedE);
ejectedDir.rotateUz(primaryDir);
G4double scatteredE = k - Ebinding[z].at(level) - ejectedE;
if(particleDef == G4Electron::ElectronDefinition()){
G4double secondaryTotMomentum
= std::sqrt(ejectedE*(ejectedE+2*CLHEP::electron_mass_c2));
G4double finalMomentumX
= totalMomentum*primaryDir.x()- secondaryTotMomentum*ejectedDir.x();
G4double finalMomentumY
= totalMomentum*primaryDir.y()- secondaryTotMomentum*ejectedDir.y();
G4double finalMomentumZ
= totalMomentum*primaryDir.z()- secondaryTotMomentum*ejectedDir.z();
G4ThreeVector scatteredDir(finalMomentumX,finalMomentumY,finalMomentumZ);
fParticleChangeForGamma->ProposeMomentumDirection(scatteredDir.unit());
}
else
{
fParticleChangeForGamma->ProposeMomentumDirection(primaryDir);
}
//G4double deexSecEnergy=0.;
G4double restEproduction = Ebinding[z].at(level);
for(G4int iparticle=NumSecParticlesInit;
iparticle<NumSecParticlesFinal;iparticle++)
{
//deexSecEnergy = deexSecEnergy + (*fvect)[iparticle]->GetKineticEnergy();
G4double Edeex = (*fvect)[iparticle]->GetKineticEnergy();
if(restEproduction>=Edeex){
restEproduction -= Edeex;
}
else{
delete (*fvect)[iparticle];
(*fvect)[iparticle]=0;
}
}
if(restEproduction < 0.0){
G4Exception("G4DNARelativisticIonisationModel::SampleSecondaries()",
"em0008",FatalException,"Negative local energy deposit");
}
if(!statCode)
{
if(scatteredE>0){
fParticleChangeForGamma->SetProposedKineticEnergy (scatteredE);
fParticleChangeForGamma->ProposeLocalEnergyDeposit(restEproduction);
//fParticleChangeForGamma
//->ProposeLocalEnergyDeposit(k-scatteredE-ejectedE-deexSecEnergy);
}
}
else
{
fParticleChangeForGamma->SetProposedKineticEnergy (k);
fParticleChangeForGamma->ProposeLocalEnergyDeposit(k-scatteredE);
}
if(ejectedE>0){
G4DynamicParticle* ejectedelectron
= new G4DynamicParticle(G4Electron::Electron(),ejectedDir,ejectedE);
fvect->push_back(ejectedelectron);
}
}
}
void G4DNARelativisticIonisationModel::LoadAtomicStates(
G4int z,const char* path)
{
if (verboseLevel > 3)
{
G4cout <<
"Calling LoadAtomicStates() of G4DNARelativisticIonisationModel"
<< G4endl;
}
const char *datadir = path;
if(!datadir)
{
datadir = getenv("G4LEDATA");
if(!datadir)
{
G4Exception("G4DNARelativisticIonisationModel::LoadAtomicStates()",
"em0002",FatalException,"Enviroment variable G4LEDATA not defined");
return;
}
}
std::ostringstream targetfile;
targetfile << datadir <<"/dna/atomicstate_Z"<< z <<".dat";
std::ifstream fin(targetfile.str().c_str());
if(!fin)
{
G4cout<< " Error : "<< targetfile.str() <<" is not found "<<G4endl;
G4Exception("G4DNARelativisticIonisationModel::LoadAtomicStates()","em0002",
FatalException,"There is no target file");
return;
}
G4String buff0,buff1,buff2,buff3,buff4,buff5,buff6;
fin >> buff0 >>buff1>>buff2>>buff3>>buff4>>buff5>>buff6;
G4int iline=0;
while(true){
fin >> buff0 >>buff1>>buff2>>buff3>>buff4>>buff5>>buff6;
if(!fin.eof())
{
iState [z].push_back(stoi(buff0));
iShell [z].push_back(stoi(buff1));
iSubShell [z].push_back(stoi(buff2));
Nelectrons[z].push_back(stoi(buff3));
Ebinding [z].push_back(stod(buff4));
if(stod(buff5)==0.)
{// if there is no kinetic energy in the file, kinetic energy
// for Bhor atomic model will be calculated: !!! I's not realistic!!!
G4double radius = std::pow(iShell[z].at(iline),2)
*std::pow(CLHEP::hbar_Planck,2)*(4*CLHEP::pi*CLHEP::epsilon0)
/CLHEP::electron_mass_c2;
G4double momentum = iShell[z].at(iline)*CLHEP::hbar_Planck/radius;
Ekinetic[z].push_back(std::pow(momentum,2)/(2*CLHEP::electron_mass_c2));
}
else
{
Ekinetic [z].push_back(stod(buff5));
}
iline++;
}
else
{
break;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4DNARelativisticIonisationModel::GetTotalCrossSection(
const G4Material* material,
const G4ParticleDefinition* particle,
G4double kineticEnergy)
{
G4double value=0;
G4int z = material->GetZ();
if(z!=79){ return 0.;}
else {
size_t N=iState[z].size();
for(G4int i=0;i<(G4int)N;i++){
value = value+GetPartialCrossSection(material,i,particle,kineticEnergy);
}
return value;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4DNARelativisticIonisationModel::GetPartialCrossSection(
const G4Material* material,
G4int level,
const G4ParticleDefinition* particle,
G4double kineticEnergy)
{
G4double value = 0;
G4double constRy =13.6057E-6;//MeV
G4ParticleDefinition *electronDef = G4Electron::ElectronDefinition();
G4int z = material->GetZ();
if(particle==electronDef){
G4double t = kineticEnergy /Ebinding[z].at(level);
G4double tdash = kineticEnergy /CLHEP::electron_mass_c2;
G4double udash = Ekinetic[z].at(level)/CLHEP::electron_mass_c2;
G4double bdash = Ebinding[z].at(level)/CLHEP::electron_mass_c2;
G4double beta_t2 = 1.-1./std::pow(1.+tdash,2);
G4double beta_u2 = 1.-1./std::pow(1.+udash,2);
G4double beta_b2 = 1.-1./std::pow(1.+bdash,2);
G4double alpha = std::sqrt(2*constRy/CLHEP::electron_mass_c2);
G4double phi = std::cos(std::sqrt(std::pow(alpha,2)
/(beta_t2+beta_b2))*G4Log(beta_t2/beta_b2));
G4double constS = 4*CLHEP::pi*std::pow(CLHEP::Bohr_radius,2)
*Nelectrons[z].at(level)*std::pow(alpha,4);
if(Ebinding[z].at(level)<=kineticEnergy)
{
value =constS/((beta_t2+(beta_u2+beta_b2)/iShell[z].at(level))*2.*bdash)
*(1./2.*(G4Log(beta_t2/(1.-beta_t2))-beta_t2-G4Log(2.*bdash))
*(1.-1./std::pow(t,2.))
+1.-1./t-G4Log(t)/(t+1.)*(1.+2.*tdash)/(std::pow(1.+tdash/2.,2.))
*phi+std::pow(bdash,2)/(std::pow(1+tdash/2.,2))*(t-1)/2.);
}
}
return value;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4DNARelativisticIonisationModel::GetDifferentialCrossSection(
const G4Material* material,
const G4ParticleDefinition* particle,
G4double kineticEnergy,
G4double secondaryEnergy,
G4int level)
{
G4double value=0.;
G4double constRy =13.6057E-6;//MeV
G4int z = material->GetZ();
G4ParticleDefinition *electronDef = G4Electron::ElectronDefinition();
if(particle==electronDef){
G4double w = secondaryEnergy /Ebinding[z].at(level);
G4double t = kineticEnergy /Ebinding[z].at(level);
G4double tdash = kineticEnergy /CLHEP::electron_mass_c2;
G4double udash = Ekinetic[z].at(level)/CLHEP::electron_mass_c2;
G4double bdash = Ebinding[z].at(level)/CLHEP::electron_mass_c2;
G4double beta_t2 = 1.-1./std::pow(1.+tdash,2);
G4double beta_u2 = 1.-1./std::pow(1.+udash,2);
G4double beta_b2 = 1.-1./std::pow(1.+bdash,2);
G4double alpha = std::sqrt(2*constRy/CLHEP::electron_mass_c2);
G4double phi = std::cos(std::sqrt(std::pow(alpha,2)/(beta_t2+beta_b2))
*G4Log(beta_t2/beta_b2));
G4double constS = 4*CLHEP::pi*std::pow(CLHEP::Bohr_radius,2)
*Nelectrons[z].at(level)*std::pow(alpha,4);
if(secondaryEnergy<=((kineticEnergy-Ebinding[z].at(level))/2.))
{
value = constS/((beta_t2+(beta_u2+beta_b2)/iShell[z].at(level))*2.*bdash)
*(-phi/(t+1.)*(1./std::pow(w+1.,1.)+1./std::pow(t-w,1.))
*(1.+2*tdash)/std::pow(1.+tdash/2.,2.)
+1./std::pow(w+1.,2.)+1./std::pow(t-w,2.)
+std::pow(bdash,2)/std::pow(1+tdash/2.,2)
+(1./std::pow(w+1.,3.)+1./std::pow(t-w,3.))
*(G4Log(beta_t2/(1.-beta_t2))-beta_t2-G4Log(2*bdash)));
}
}
return value;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int G4DNARelativisticIonisationModel::RandomSelect(
const G4Material* material,
const G4ParticleDefinition* particle,
G4double kineticEnergy)
{
G4double value = 0.;
G4int z = material->GetZ();
G4double* valuesBuffer = new G4double[iShell[z].size()];
const size_t n(iShell[z].size());
size_t i(n);
while (i > 0)
{
i--;
if((fLowEnergyLimit<=kineticEnergy)&&(kineticEnergy<fHighEnergyLimit))
{
valuesBuffer[i]=GetPartialCrossSection(material,i,particle,kineticEnergy);
}
value += valuesBuffer[i];
}
value *= G4UniformRand();
i = n;
while (i > 0)
{
i--;
if (valuesBuffer[i] > value)
{
delete[] valuesBuffer;
return i;
}
value -= valuesBuffer[i];
}
if (valuesBuffer) delete[] valuesBuffer;
return 9999;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4DNARelativisticIonisationModel::GetEjectedElectronEnergy(
const G4Material* material,
const G4ParticleDefinition* particle,
G4double energy, G4int ishell)
{
G4double secondaryEnergy=0;
G4ParticleDefinition *electronDef = G4Electron::ElectronDefinition();
G4int z = material->GetZ();
if(!fasterCode){ // for 2D rejection method
if(particle==electronDef){
G4double maximumsecondaryEnergy = (energy-Ebinding[z].at(ishell))/2.;
if(maximumsecondaryEnergy<0.) return 0.;
G4double maximumCrossSection=-999.;
maximumCrossSection
= GetDifferentialCrossSection(material,particle,energy,0.,ishell);
do{
secondaryEnergy = G4UniformRand()* maximumsecondaryEnergy;
}while(G4UniformRand()*maximumCrossSection >
GetDifferentialCrossSection(
material,particle,energy,secondaryEnergy,ishell));
}
}
else { // for cumulative method using cumulated DCS file
G4double valueE1 =0.;
G4double valueE2 =0.;
G4double valueXS21=0.;
G4double valueXS22=0.;
G4double valueXS11=0.;
G4double valueXS12=0.;
G4double ejeE21 =0.;
G4double ejeE22 =0.;
G4double ejeE11 =0.;
G4double ejeE12 =0.;
G4double random = G4UniformRand();
if (particle == G4Electron::ElectronDefinition())
{
if((eVecEZ[z].at(0)<=energy)&&(energy<eVecEZ[z].back()))
{
std::vector<G4double>::iterator k2
= std::upper_bound(eVecEZ[z].begin(),eVecEZ[z].end(), energy);
std::vector<G4double>::iterator k1 = k2-1;
if ( random < eProbaShellMapZ[z][ishell][(*k1)].back()
&& random < eProbaShellMapZ[z][ishell][(*k2)].back() )
{
std::vector<G4double>::iterator xs12 =
std::upper_bound(eProbaShellMapZ[z][ishell][(*k1)].begin(),
eProbaShellMapZ[z][ishell][(*k1)].end(), random);
std::vector<G4double>::iterator xs11 = xs12-1;
std::vector<G4double>::iterator xs22 =
std::upper_bound(eProbaShellMapZ[z][ishell][(*k2)].begin(),
eProbaShellMapZ[z][ishell][(*k2)].end(), random);
std::vector<G4double>::iterator xs21 = xs22-1;
valueE1 =*k1;
valueE2 =*k2;
valueXS21 =*xs21;
valueXS22 =*xs22;
valueXS12 =*xs12;
valueXS11 =*xs11;
ejeE11 = eEjectedEnergyDataZ[z][ishell][valueE1][valueXS11];
ejeE12 = eEjectedEnergyDataZ[z][ishell][valueE1][valueXS12];
ejeE21 = eEjectedEnergyDataZ[z][ishell][valueE2][valueXS21];
ejeE22 = eEjectedEnergyDataZ[z][ishell][valueE2][valueXS22];
secondaryEnergy = QuadInterpolator( valueXS11, valueXS12,
valueXS21, valueXS22,
ejeE11 , ejeE12 ,
ejeE21 , ejeE22 ,
valueE1, valueE2,
energy, random );
}
}
}
}
if(secondaryEnergy<0) secondaryEnergy=0;
return secondaryEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ThreeVector G4DNARelativisticIonisationModel::GetEjectedElectronDirection(
const G4ParticleDefinition* ,
G4double energy,G4double secondaryenergy)
{
G4double phi = 2*CLHEP::pi*G4UniformRand();
G4double sintheta = std::sqrt((1.-secondaryenergy/energy)
/ (1.+secondaryenergy/(2*CLHEP::electron_mass_c2)));
G4double dirX = sintheta*std::cos(phi);
G4double dirY = sintheta*std::sin(phi);
G4double dirZ = std::sqrt(1.-sintheta*sintheta);
G4ThreeVector vec(dirX,dirY,dirZ);
return vec;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4DNARelativisticIonisationModel::Interpolate( G4double e1,
G4double e2,
G4double e,
G4double xs1,
G4double xs2)
{
G4double value = 0.;
if((xs1!=0)&&(e1!=0)){
// Log-log interpolation by default
G4double a = (std::log10(xs2)-std::log10(xs1))
/ (std::log10(e2)-std::log10(e1));
G4double b = std::log10(xs2) - a*std::log10(e2);
G4double sigma = a*std::log10(e) + b;
value = (std::pow(10.,sigma));
}
else{
// Lin-Lin interpolation
G4double d1 = xs1;
G4double d2 = xs2;
value = (d1 + (d2 - d1)*(e - e1)/ (e2 - e1));
}
return value;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4DNARelativisticIonisationModel::QuadInterpolator(
G4double e11, G4double e12,
G4double e21, G4double e22,
G4double xs11, G4double xs12,
G4double xs21, G4double xs22,
G4double t1, G4double t2,
G4double t, G4double e)
{
G4double interpolatedvalue1 = Interpolate(e11, e12, e, xs11, xs12);
G4double interpolatedvalue2 = Interpolate(e21, e22, e, xs21, xs22);
G4double value
= Interpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
return value;
}
@@ -0,0 +1,129 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// 20/2/2019
// Author : HoangTRAN
#include "G4DNATotallyDiffusionControlled.hh"
#include "G4IRTUtils.hh"
#include "G4DNAMolecularReactionTable.hh"
#include "G4VDNAReactionModel.hh"
#include "G4OctreeFinder.hh"
#include "G4SystemOfUnits.hh"
#include "G4PhysicalConstants.hh"
#include "G4MolecularConfiguration.hh"
#include "Randomize.hh"
#include "G4Molecule.hh"
#include "G4Electron_aq.hh"
#include "G4Hydrogen.hh"
#include "G4ErrorFunction.hh"
G4DNATotallyDiffusionControlled::G4DNATotallyDiffusionControlled()
: G4VReactionType()
{}
G4DNATotallyDiffusionControlled::~G4DNATotallyDiffusionControlled() = default;
G4double G4DNATotallyDiffusionControlled::GetTimeToEncounter(const G4Track& trackA,
const G4Track& trackB)
{
auto pMolConfA = GetMolecule(trackA)->GetMolecularConfiguration();
auto pMolConfB = GetMolecule(trackB)->GetMolecularConfiguration();
G4double D = GetDiffusionCoefficient(pMolConfA, pMolConfB);
auto reactionData = G4DNAMolecularReactionTable::Instance()
->GetReactionData(pMolConfA, pMolConfB);
G4double kobs = reactionData->GetObservedReactionRateConstant();
G4double distance = (trackA.GetPosition() - trackB.GetPosition()).mag();
G4double Reff = kobs / ( 4 * CLHEP::pi * D * Avogadro );
if( distance < Reff )
{
G4ExceptionDescription exceptionDescription;
exceptionDescription << "distance = "<< distance
<< " is uncorrected with "
<<" Reff = "<<Reff
<<" for : "<<pMolConfA->GetName()
<<" and "<<pMolConfB->GetName();
G4Exception("G4DNATotallyDiffusionControlled"
"::GetTimeToEncounter()", "G4DNATotallyDiffusionControlled02",
FatalException, exceptionDescription);
}
G4double Winf = Reff / distance;
G4double U = G4UniformRand();
G4double irt = -1.0 * ps;
if ( U < Winf )
{
G4double d = ( distance - Reff ) /
G4ErrorFunction::erfcInv( U / Winf );
irt = ( 1.0 / ( 4 * D ) ) * d * d;
}
return irt;
}
G4bool G4DNATotallyDiffusionControlled::
GeminateRecombinationProbability(const G4MolecularConfiguration* pMolA,
const G4MolecularConfiguration* pMolB)
{
if(pMolA->GetDefinition() == G4Electron_aq::Definition() ||
pMolA->GetDefinition() == G4Hydrogen::Definition())
{
G4bool spinA;
G4bool spinB;
spinA = G4UniformRand() < 0.5;
if(spinA &&
(pMolB->GetDefinition() == G4Electron_aq::Definition() ||
pMolB->GetDefinition() == G4Hydrogen::Definition()))
{
spinB = G4UniformRand() < 0.5;
if( !spinB )
{
return true;
}
}
return false;
}
return true;
}
G4double
G4DNATotallyDiffusionControlled::GetDiffusionCoefficient(const G4MolecularConfiguration* mA,
const G4MolecularConfiguration* mB)
{
G4double D;
if(mA == mB)
{
D = (mA->GetDiffusionCoefficient());
}
else
{
D = (mA->GetDiffusionCoefficient() +
mB->GetDiffusionCoefficient());//
}
return D;
}
@@ -0,0 +1,109 @@
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// Author: Hoang TRAN
#include "G4DiffusionControlledReactionModel.hh"
#include "G4Track.hh"
#include "G4DNAMolecularReactionTable.hh"
#include "G4PhysicalConstants.hh"
#include "G4Exp.hh"
#include "G4IRTUtils.hh"
#include "G4SystemOfUnits.hh"
#include "G4DNAReactionTypeManager.hh"
#include "G4Electron_aq.hh"
G4DiffusionControlledReactionModel::G4DiffusionControlledReactionModel()
: G4VDNAReactionModel()
, fpReactionData(nullptr)
, fReactionTypeManager(nullptr)
{
}
G4DiffusionControlledReactionModel::~G4DiffusionControlledReactionModel() = default;
void G4DiffusionControlledReactionModel::Initialise(const G4MolecularConfiguration* pMolecule,
const G4Track&)
{
fpReactionData = fpReactionTable->GetReactionData(pMolecule);
}
void G4DiffusionControlledReactionModel::InitialiseToPrint(const G4MolecularConfiguration* pMolecule)
{
fpReactionData = fpReactionTable->GetReactionData(pMolecule);
}
G4double G4DiffusionControlledReactionModel::GetReactionRadius(const G4MolecularConfiguration* pMol1,
const G4MolecularConfiguration* pMol2)
{
auto reactionData = fpReactionTable->GetReactionData(pMol1, pMol2);
if(reactionData == nullptr)
{
G4ExceptionDescription exceptionDescription;
exceptionDescription << "No reactionData"
<<" for : "<<pMol1->GetName()
<<" and "<<pMol2->GetName();
G4Exception("G4DiffusionControlledReactionModel"
"::GetReactionRadius()", "G4DiffusionControlledReactionModel00",
FatalException, exceptionDescription);
}
G4double kobs = reactionData->GetObservedReactionRateConstant();
G4double D;
if(pMol1 == pMol2)
{
D = (pMol1->GetDiffusionCoefficient());
}
else
{
D = (pMol1->GetDiffusionCoefficient() +
pMol2->GetDiffusionCoefficient());//
}
if ( D == 0 )
{
G4ExceptionDescription exceptionDescription;
exceptionDescription << "D = "<< D
<< " is uncorrected"
<<" for : "<<pMol1->GetName()
<<" and "<<pMol2->GetName();
G4Exception("G4DiffusionControlledReactionModel"
"::GetReactionRadius()", "G4DiffusionControlledReactionModel01",
FatalException, exceptionDescription);
}
G4double Reff = kobs / ( 4 * CLHEP::pi * D * Avogadro );
return Reff;
}
G4double G4DiffusionControlledReactionModel::GetReactionRadius(G4int i)
{
auto pMol1 = (*fpReactionData)[i]->GetReactant1();
auto pMol2 = (*fpReactionData)[i]->GetReactant2();
return GetReactionRadius(pMol1,pMol2);
}
void G4DiffusionControlledReactionModel::SetReactionTypeManager(G4VReactionTypeManager* typeManager)
{
fReactionTypeManager = ((G4DNAReactionTypeManager*)typeManager);
}