Import Geant4 10.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2017-06-30 10:49:55 +02:00
parent 3a5407696b
commit 1a1316fea4
2180 changed files with 237880 additions and 59109 deletions
@@ -0,0 +1,179 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// CPA100 elastic model class for electrons
//
// Based on the work of M. Terrissol and M. C. Bordage
//
// Users are requested to cite the following papers:
// - M. Terrissol, A. Baudre, Radiat. Prot. Dosim. 31 (1990) 175-177
// - M.C. Bordage, J. Bordes, S. Edel, M. Terrissol, X. Franceries,
// M. Bardies, N. Lampe, S. Incerti, Phys. Med. 32 (2016) 1833-1840
//
// Authors of this class:
// M.C. Bordage, M. Terrissol, S. Edel, J. Bordes, S. Incerti
//
// 15.01.2014: creation
//
#ifndef G4DNACPA100ElasticModel_h
#define G4DNACPA100ElasticModel_h 1
#include <map>
#include "G4DNACrossSectionDataSet.hh"
#include "G4VEmModel.hh"
#include "G4Electron.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4LogLogInterpolation.hh"
//#include "G4DNACPA100LogLogInterpolation.hh"
#include "G4ProductionCutsTable.hh"
#include "G4NistManager.hh"
class G4DNACPA100ElasticModel : public G4VEmModel
{
public:
G4DNACPA100ElasticModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "DNACPA100ElasticModel");
virtual ~G4DNACPA100ElasticModel();
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&);
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
//---
// kept for backward compatibility
inline void SetKillBelowThreshold (G4double threshold);
G4double GetKillBelowThreshold () { return killBelowEnergy; }
//---
inline void SelectStationary(G4bool input);
protected:
G4ParticleChangeForGamma* fParticleChangeForGamma;
private:
G4bool statCode;
// Water density table
const std::vector<G4double>* fpMolWaterDensity;
G4double killBelowEnergy;
G4double lowEnergyLimit;
G4double highEnergyLimit;
G4bool isInitialised;
G4int verboseLevel;
// Cross section
typedef std::map<G4String,G4String,std::less<G4String> > MapFile;
MapFile tableFile;
typedef std::map<G4String,G4DNACrossSectionDataSet*,std::less<G4String> > MapData;
MapData tableData;
// Final state
//G4double DifferentialCrossSection(G4ParticleDefinition * aParticleDefinition, G4double k, G4double theta);
G4double Theta(G4ParticleDefinition * aParticleDefinition, G4double k, G4double integrDiff);
G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
G4double LogLogInterpolate(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);
typedef std::map<double, std::map<double, double> > TriDimensionMap;
TriDimensionMap eDiffCrossSectionData;
std::vector<double> eTdummyVec;
typedef std::map<double, std::vector<double> > VecMap;
VecMap eVecm;
G4double RandomizeCosTheta(G4double k);
//
G4DNACPA100ElasticModel & operator=(const G4DNACPA100ElasticModel &right);
G4DNACPA100ElasticModel(const G4DNACPA100ElasticModel&);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4DNACPA100ElasticModel::SelectStationary (G4bool input)
{
statCode = input;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//---
// kept for backward compatibility
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4DNACPA100ElasticModel::SetKillBelowThreshold (G4double /*threshold*/)
{
G4ExceptionDescription errMsg;
errMsg << "*** WARNING : "
<< "G4DNACPA100ElasticModel::SetKillBelowThreshold"
<< "is deprecated, the kill threshold won't be taken into account";
G4Exception ("*** WARNING : G4DNACPA100ElasticModel::SetKillBelowThreshold DEPRECATED","",JustWarning,"") ;
}
#endif
@@ -0,0 +1,131 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// CPA100 excitation model class for electrons
//
// Based on the work of M. Terrissol and M. C. Bordage
//
// Users are requested to cite the following papers:
// - M. Terrissol, A. Baudre, Radiat. Prot. Dosim. 31 (1990) 175-177
// - M.C. Bordage, J. Bordes, S. Edel, M. Terrissol, X. Franceries,
// M. Bardies, N. Lampe, S. Incerti, Phys. Med. 32 (2016) 1833-1840
//
// Authors of this class:
// M.C. Bordage, M. Terrissol, S. Edel, J. Bordes, S. Incerti
//
// 15.01.2014: creation
//
#ifndef G4DNACPA100ExcitationModel_h
#define G4DNACPA100ExcitationModel_h 1
#include "G4VEmModel.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4ProductionCutsTable.hh"
#include "G4DNACrossSectionDataSet.hh"
#include "G4LogLogInterpolation.hh"
//#include "G4DNACPA100LogLogInterpolation.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4DNACPA100WaterExcitationStructure.hh"
#include "G4NistManager.hh"
class G4DNACPA100ExcitationModel : public G4VEmModel
{
public:
G4DNACPA100ExcitationModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "DNACPA100ExcitationModel");
virtual ~G4DNACPA100ExcitationModel();
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 void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
inline void SelectStationary(G4bool input);
protected:
G4ParticleChangeForGamma* fParticleChangeForGamma;
private:
G4bool statCode;
// Water density table
const std::vector<G4double>* fpMolWaterDensity;
std::map<G4String,G4double,std::less<G4String> > lowEnergyLimit;
std::map<G4String,G4double,std::less<G4String> > highEnergyLimit;
G4bool isInitialised;
G4int verboseLevel;
// Cross section
typedef std::map<G4String,G4String,std::less<G4String> > MapFile;
MapFile tableFile;
typedef std::map<G4String,G4DNACrossSectionDataSet*,std::less<G4String> > MapData;
MapData tableData;
// Partial cross section
G4int RandomSelect(G4double energy,const G4String& particle );
// Final state
G4DNACPA100WaterExcitationStructure waterStructure;
//
G4DNACPA100ExcitationModel & operator=(const G4DNACPA100ExcitationModel &right);
G4DNACPA100ExcitationModel(const G4DNACPA100ExcitationModel&);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4DNACPA100ExcitationModel::SelectStationary (G4bool input)
{
statCode = input;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -0,0 +1,202 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// CPA100 ionisation model class for electrons
//
// Based on the work of M. Terrissol and M. C. Bordage
//
// Users are requested to cite the following papers:
// - M. Terrissol, A. Baudre, Radiat. Prot. Dosim. 31 (1990) 175-177
// - M.C. Bordage, J. Bordes, S. Edel, M. Terrissol, X. Franceries,
// M. Bardies, N. Lampe, S. Incerti, Phys. Med. 32 (2016) 1833-1840
//
// Authors of this class:
// M.C. Bordage, M. Terrissol, S. Edel, J. Bordes, S. Incerti
//
// 15.01.2014: creation
//
#ifndef G4DNACPA100IonisationModel_h
#define G4DNACPA100IonisationModel_h 1
#include "G4VEmModel.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4ProductionCutsTable.hh"
#include "G4DNACrossSectionDataSet.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4LogLogInterpolation.hh"
//#include "G4DNACPA100LogLogInterpolation.hh"
#include "G4DNACPA100WaterIonisationStructure.hh"
#include "G4VAtomDeexcitation.hh"
#include "G4NistManager.hh"
class G4DNACPA100IonisationModel : public G4VEmModel
{
public:
G4DNACPA100IonisationModel(const G4ParticleDefinition* p = 0,
const G4String& nam = "DNACPA100IonisationModel");
virtual ~G4DNACPA100IonisationModel();
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 void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
G4double DifferentialCrossSection(G4ParticleDefinition * aParticleDefinition, G4double k, G4double energyTransfer, G4int shell);
inline void SelectFasterComputation(G4bool input);
inline void SelectUseDcs(G4bool input);
inline void SelectStationary(G4bool input);
protected:
G4ParticleChangeForGamma* fParticleChangeForGamma;
private:
G4bool statCode;
G4bool fasterCode;
G4bool useDcs;
// Water density table
const std::vector<G4double>* fpMolWaterDensity;
// Deexcitation manager to produce fluo photons and e-
G4VAtomDeexcitation* fAtomDeexcitation;
std::map<G4String,G4double,std::less<G4String> > lowEnergyLimit;
std::map<G4String,G4double,std::less<G4String> > highEnergyLimit;
G4bool isInitialised;
G4int verboseLevel;
// Cross section
typedef std::map<G4String,G4String,std::less<G4String> > MapFile;
MapFile tableFile;
typedef std::map<G4String,G4DNACrossSectionDataSet*,std::less<G4String> > MapData;
MapData tableData;
// Final state
G4DNACPA100WaterIonisationStructure waterStructure;
G4double RandomizeEjectedElectronEnergy(G4ParticleDefinition * aParticleDefinition, G4double incomingParticleEnergy, G4int shell) ;
G4double RandomizeEjectedElectronEnergyFromCumulatedDcs(G4ParticleDefinition * aParticleDefinition, G4double incomingParticleEnergy, G4int shell) ;
G4double RandomizeEjectedElectronEnergyFromCompositionSampling(G4ParticleDefinition * aParticleDefinition, G4double incomingParticleEnergy, G4int shell) ;
G4double RandomTransferedEnergy(G4ParticleDefinition * aParticleDefinition, G4double incomingParticleEnergy, G4int shell) ;
void RandomizeEjectedElectronDirection(G4ParticleDefinition * aParticleDefinition, G4double incomingParticleEnergy, G4double
outgoingParticleEnergy, G4double & cosTheta, G4double & phi );
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);
typedef std::map<double, std::map<double, double> > TriDimensionMap;
TriDimensionMap eDiffCrossSectionData[6];
TriDimensionMap eNrjTransfData[6]; // for cumulated dcs
std::vector<double> eTdummyVec;
typedef std::map<double, std::vector<double> > VecMap;
VecMap eVecm;
VecMap eProbaShellMap[6]; // for cumulated dcs
// Partial cross section
G4int RandomSelect(G4double energy,const G4String& particle );
//
G4DNACPA100IonisationModel & operator=(const G4DNACPA100IonisationModel &right);
G4DNACPA100IonisationModel(const G4DNACPA100IonisationModel&);
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4DNACPA100IonisationModel::SelectFasterComputation (G4bool input)
{
fasterCode = input;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4DNACPA100IonisationModel::SelectUseDcs (G4bool input)
{
useDcs = input;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4DNACPA100IonisationModel::SelectStationary (G4bool input)
{
statCode = input;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// Contact authors: S. Meylan, C. Villagrasa
//
// email: sylvain.meylan@symalgo-tech.com, carmen.villagrasa@irsn.fr
#ifndef G4DNADUMMYMODEL_HH
#define G4DNADUMMYMODEL_HH
#include "G4VDNAModel.hh"
#include "G4VEmModel.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4ParticleChangeForGamma.hh"
class G4DNADummyModel : public G4VDNAModel
{
public:
G4DNADummyModel(const G4String& applyToMaterial,
const G4ParticleDefinition* p,
const G4String& nam,
G4VEmModel* emModel);
~G4DNADummyModel();
virtual void Initialise(const G4ParticleDefinition* particle, const G4DataVector& = *(new G4DataVector()), G4ParticleChangeForGamma* changeForGamme=nullptr);
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4String& materialName,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax);
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4String& materialName,
const G4DynamicParticle*,
G4ParticleChangeForGamma *particleChangeForGamma,
G4double tmin,
G4double tmax);
const G4VEmModel* GetEmModel() const {return fpEmModel;}
G4VEmModel* GetEmModel() {return fpEmModel;}
private:
G4VEmModel* fpEmModel;
const G4ParticleDefinition* fpParticleDef;
const std::vector<double>* fMaterialMolPerVol;
G4double GetNumMoleculePerVolumeUnitForMaterial(const G4Material *mat);
};
#endif // G4DNADUMMYMODEL_HH
@@ -0,0 +1,176 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// Contact authors: S. Meylan, C. Villagrasa
//
// email: sylvain.meylan@symalgo-tech.com, carmen.villagrasa@irsn.fr
#ifndef G4DNAMODELINTERFACE_HH
#define G4DNAMODELINTERFACE_HH
#include <map>
#include "G4DNACrossSectionDataSet.hh"
#include "G4VEmModel.hh"
#include "G4VDNAModel.hh"
#include "G4Electron.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4LogLogInterpolation.hh"
#include "G4ProductionCutsTable.hh"
#include "G4NistManager.hh"
#include "G4DNADummyModel.hh"
class G4DNAModelInterface : public G4VEmModel
{
public:
/*!
* \brief G4DNAModelManager
* Constructor
* \param nam
*/
G4DNAModelInterface(const G4String& nam);
/*!
* \brief ~G4DNAModelManager
* Destructor
*/
virtual ~G4DNAModelInterface();
/*!
* \brief Initialise
* Initialise method to call all the initialise methods of the registered models
* \param particle
* \param cuts
*/
virtual void Initialise(const G4ParticleDefinition* particle, const G4DataVector& cuts);
/*!
* \brief CrossSectionPerVolume
* Method called by the process and used to call the CrossSectionPerVolume method of the registered models.
* The method also calculates through G4DNAMolecularMaterial the number of molecule per volume unit for the current
* material or (component of a composite material).
* \param material
* \param p
* \param ekin
* \param emin
* \param emax
* \return the final cross section value times with the number of molecule per volume unit
*/
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax);
/*!
* \brief SampleSecondaries
* Used to call the SampleSecondaries method of the registered models. A sampling is done to select
* a component if the material is a composite one.
* \param fVect
* \param couple
* \param aDynamicElectron
* \param tmin
* \param tmax
*/
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*fVect,
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* aDynamicElectron,
G4double tmin,
G4double tmax);
/*!
* \brief RegisterModel
* Method used to associate a model with the interaction
* \param model
*/
void RegisterModel(G4VDNAModel* model);
void RegisterModel(G4VEmModel* model, const G4ParticleDefinition* particle);
/*!
* \brief GetSelectedMaterial
* To allow the user to retrieve the selected material in case of a composite material.
* \return the last selected material by SampleSecondaries.
*/
G4String GetSelectedMaterial(){return fSampledMat;}
private:
const G4String fName; ///< name of the interaction
G4ParticleChangeForGamma* fpParticleChangeForGamma; ///< pointer used to change the characteristics of the current particle
std::vector<G4VDNAModel*> fRegisteredModels; ///< vector containing all the registered models
std::map<const G4String, G4double> fMaterialCS; ///< map used to share information between CrossSectionPerVolume and SampleSecondaries
G4double fCSsumTot; ///< value which contains the sum of all the component cross sections in case of a composite material
G4String fSampledMat; ///< for the user to retrieve selected material/component
typedef std::map<const G4String ,std::map<const G4String , std::vector<G4VDNAModel*> > > MaterialParticleModelTable;
MaterialParticleModelTable fMaterialParticleModelTable; ///< map: [materialName][particleName] = vector of models
std::map<G4String, const std::vector<double>* > fMaterialMolPerVol;
/*!
* \brief BuildMaterialParticleModelTable
* Method used to build a map allowing the code to quickly retrieve the good model for a particle/material couple
* \param p
*/
void BuildMaterialParticleModelTable(const G4ParticleDefinition *p);
void BuildMaterialMolPerVolTable();
/*!
* \brief InsertModelInTable
* Used to put a model in the table after performing some checks.
* \param matName
* \param pName
*/
void InsertModelInTable(const G4String& matName, const G4String& pName);
/*!
* \brief GetDNAModel
* \param material
* \param particle
* \param ekin
* \return G4VDNAModel*
* Return the model corresponding to the material, particle and energy specified.
* This method will check the energy range of the models to find to good one for the current ekin.
*/
G4VDNAModel* GetDNAModel(const G4String& material, const G4String& particle, G4double ekin);
G4double GetNumMoleculePerVolumeUnitForMaterial(const G4Material *mat);
G4double GetNumMolPerVolUnitForComponentInComposite(const G4Material *component, const G4Material* composite);
// copy constructor and hide assignment operator
G4DNAModelInterface(const G4DNAModelInterface&); // prevent copy-construction
G4DNAModelInterface & operator=(const G4DNAModelInterface &right); // prevent assignement
};
#endif // G4DNAMODELINTERFACE_HH
@@ -0,0 +1,142 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: S. Meylan and C. Villagrasa (IRSN, France)
// Models come from
// M. Bug et al, Rad. Phys and Chem. 130, 459-479 (2017)
// $Id: G4DNAPTBAugerModel.cc,v 1.11
//
//
// -------------------------------------------------------------------
//
// Geant4 Header G4DNAPTBAugerModel
//
// -------------------------------------------------------------------
//
// Class description:
// Implementation of atomic deexcitation
//
// -------------------------------------------------------------------
#ifndef G4DNAPTBAugerModel_h
#define G4DNAPTBAugerModel_h 1
#include "G4VAtomDeexcitation.hh"
#include "G4AtomicShell.hh"
#include "globals.hh"
#include "G4DynamicParticle.hh"
#include <vector>
class G4AtomicTransitionManager;
class G4VhShellCrossSection;
class G4EmCorrections;
class G4Material;
/*!
* \brief The G4DNAPTBAugerModel class
* Implement the PTB Auger model
*/
class G4DNAPTBAugerModel
{
public:
/*!
* \brief G4DNAPTBAugerModel
* Constructor
* \param modelName
*/
G4DNAPTBAugerModel(const G4String &modelName);
/*!
* \brief ~G4DNAPTBAugerModel
* Destructor
*/
virtual ~G4DNAPTBAugerModel();
/*!
* \brief Initialise
* Set the verbose value
*/
virtual void Initialise();
/*!
* \brief SetCutForAugerElectrons
* Set the cut for the auger electrons production
* \param cut
*/
void SetCutForAugerElectrons(G4double cut);
/*!
* \brief ComputeAugerEffect
* Main method to be called by the ionisation model.
* \param fvect
* \param materialNameIni
* \param bindingEnergy
*/
void ComputeAugerEffect(std::vector<G4DynamicParticle *> *fvect, const G4String& materialNameIni, G4double bindingEnergy);
private:
const G4String modelName; ///< name of the auger model
G4int verboseLevel;
G4double minElectronEnergy;
/*!
* \brief GenerateAugerWithRandomDirection
* Generates the auger particle
* \param fvect
* \param kineticEnergy
*/
void GenerateAugerWithRandomDirection(std::vector<G4DynamicParticle*>* fvect, G4double kineticEnergy);
/*!
* \brief CalculAugerEnergyFor
* \param atomId
* \return the auger particle energy
*/
G4double CalculAugerEnergyFor(G4int atomId);
/*!
* \brief DetermineIonisedAtom
* \param atomId
* \param materialName
* \param bindingEnergy
* \return the id of the chosen ionised atom
*/
G4int DetermineIonisedAtom(G4int atomId, const G4String &materialName, G4double bindingEnergy);
// copy constructor and hide assignment operator
G4DNAPTBAugerModel(G4DNAPTBAugerModel &); // prevent copy-construction
G4DNAPTBAugerModel & operator=(const G4DNAPTBAugerModel &right); // prevent assignement
};
#endif
@@ -0,0 +1,228 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: S. Meylan and C. Villagrasa (IRSN, France)
// Models come from
// M. Bug et al, Rad. Phys and Chem. 130, 459-479 (2017)
//
#ifndef G4DNAPTBElasticModel_h
#define G4DNAPTBElasticModel_h 1
#include <map>
#include "G4DNACrossSectionDataSet.hh"
#include "G4VDNAModel.hh"
#include "G4Electron.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4LogLogInterpolation.hh"
#include "G4ProductionCutsTable.hh"
#include "G4NistManager.hh"
/*!
* \brief The G4DNAPTBElasticModel class
* This class implements the elastic model for the DNA materials and precursors.
*/
class G4DNAPTBElasticModel : public G4VDNAModel
{
public:
/*!
* \brief G4DNAPTBElasticModel
* Constructor
* \param applyToMaterial
* \param p
* \param nam
*/
G4DNAPTBElasticModel(const G4String &applyToMaterial = "all", const G4ParticleDefinition* p = 0,
const G4String& nam = "DNAPTBElasticModel");
/*!
* \brief ~G4DNAPTBElasticModel
* Destructor
*/
virtual ~G4DNAPTBElasticModel();
/*!
* \brief Initialise
* Mandatory method for every model class. The material/particle for which the model
* can be used have to be added here through the AddCrossSectionData method.
* Then the LoadCrossSectionData method must be called to trigger the load process.
* Scale factors to be applied to the cross section can be defined here.
*/
virtual void Initialise(const G4ParticleDefinition* particle, const G4DataVector&, G4ParticleChangeForGamma* fpChangeForGamme=nullptr);
/*!
* \brief CrossSectionPerVolume
* This method is mandatory for any model class. It finds and return the cross section value
* for the current material, particle and energy values.
* The number of molecule per volume is not used here but in the G4DNAModelInterface class.
* \param material
* \param materialName
* \param p
* \param ekin
* \param emin
* \param emax
* \return the cross section value
*/
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4String& materialName,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax);
/*!
* \brief SampleSecondaries
* Method called after CrossSectionPerVolume if the process is the one which is selected (according to the sampling on the calculated path length).
* Here, the characteristics of the incident and created (if any) particle(s) are set (energy, momentum ...).
* \param materialName
* \param particleChangeForGamma
* \param tmin
* \param tmax
*/
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4String& materialName,
const G4DynamicParticle*,
G4ParticleChangeForGamma *particleChangeForGamma,
G4double tmin,
G4double tmax);
protected:
private:
G4int verboseLevel; ///< verbose level
std::map<G4String, double > killBelowEnergyTable; ///< map to save the different energy kill limits for the materials
G4double fKillBelowEnergy; ///< energy kill limit
typedef std::map<G4String, std::map<G4String, std::map<double, std::map<double, double> > > > TriDimensionMap;
TriDimensionMap diffCrossSectionData; ///< A map: [materialName][particleName]=DiffCrossSectionTable
typedef std::map<G4String, std::map<G4String, std::map<double, std::vector<double> > > > VecMap;
VecMap eValuesVect; /*!< map with vectors containing all the output energy (E) of the differential file */
std::map<G4String, std::map<G4String, std::vector<double> > > tValuesVec; ///< map with vectors containing all the incident (T) energy of the differential file
/*!
* \brief ReadDiffCSFile
* Method to read the differential cross section files. This method is not standard yet so every model must implement its own.
* \param materialName
* \param particleName
* \param file
*/
void ReadDiffCSFile(const G4String &materialName, const G4String &particleName, const G4String &file, const G4double);
/*!
* \brief Theta
* To return an angular theta value from the differential file. This method uses interpolations to calculate
* the theta value.
* \param fParticleDefinition
* \param k
* \param integrDiff
* \param materialName
* \return a theta value
*/
G4double Theta(G4ParticleDefinition * fParticleDefinition, G4double k, G4double integrDiff, const G4String &materialName);
/*!
* \brief LinLinInterpolate
* \param e1
* \param e2
* \param e
* \param xs1
* \param xs2
* \return
*/
G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
/*!
* \brief LinLogInterpolate
* \param e1
* \param e2
* \param e
* \param xs1
* \param xs2
* \return
*/
G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
/*!
* \brief LogLogInterpolate
* \param e1
* \param e2
* \param e
* \param xs1
* \param xs2
* \return
*/
G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
/*!
* \brief QuadInterpolator
* \param e11
* \param e12
* \param e21
* \param e22
* \param x11
* \param x12
* \param x21
* \param x22
* \param t1
* \param t2
* \param t
* \param e
* \return
*/
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);
/*!
* \brief RandomizeCosTheta
* \param k
* \param materialName
* \return
*/
G4double RandomizeCosTheta(G4double k, const G4String &materialName);
// copy constructor and hide assignment operator
G4DNAPTBElasticModel(G4DNAPTBElasticModel &); // prevent copy-construction
G4DNAPTBElasticModel & operator=(const G4DNAPTBElasticModel &right); // prevent assignement
};
#endif
@@ -0,0 +1,128 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: S. Meylan and C. Villagrasa (IRSN, France)
// Models come from
// M. Bug et al, Rad. Phys and Chem. 130, 459-479 (2017)
//
#ifndef G4DNAPTBExcitationModel_h
#define G4DNAPTBExcitationModel_h 1
#include "G4VDNAModel.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4ProductionCutsTable.hh"
#include "G4DNACrossSectionDataSet.hh"
#include "G4LogLogInterpolation.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4NistManager.hh"
#include "G4DNAWaterExcitationStructure.hh"
/*!
* \brief The G4DNAPTBExcitationModel class
* This class implements the PTB excitation model.
*/
class G4DNAPTBExcitationModel : public G4VDNAModel
{
public:
/*!
* \brief G4DNAPTBExcitationModel
* Constructor
* \param applyToMaterial
* \param p
* \param nam
*/
G4DNAPTBExcitationModel(const G4String &applyToMaterial = "all", const G4ParticleDefinition* p = 0,
const G4String& nam = "DNAPTBExcitationModel");
/*!
* \brief ~G4DNAPTBExcitationModel
* Destructor
*/
virtual ~G4DNAPTBExcitationModel();
/*!
* \brief Initialise
* Set the materials for which the model can be used and defined the energy limits
*/
virtual void Initialise(const G4ParticleDefinition* particle, const G4DataVector& = *(new G4DataVector()), G4ParticleChangeForGamma* fpChangeForGamme=nullptr);
/*!
* \brief CrossSectionPerVolume
* Retrieve the cross section corresponding to the current material, particle and energy
* \param material
* \param materialName
* \param p
* \param ekin
* \param emin
* \param emax
* \return the cross section value
*/
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4String& materialName,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax);
/*!
* \brief SampleSecondaries
* If the model is selected for the ModelInterface then the SampleSecondaries method will be called.
* The method sets the incident particle characteristics after the ModelInterface.
* \param materialName
* \param particleChangeForGamma
* \param tmin
* \param tmax
*/
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4String& materialName,
const G4DynamicParticle*,
G4ParticleChangeForGamma *particleChangeForGamma,
G4double tmin,
G4double tmax);
protected:
private:
G4int verboseLevel; ///< verbose level
G4DNAWaterExcitationStructure waterStructure;
typedef std::map<G4String,G4double,std::less<G4String> > MapMeanEnergy;
MapMeanEnergy tableMeanEnergyPTB; ///< map: [materialName]=energyValue
// copy constructor and hide assignment operator
G4DNAPTBExcitationModel(const G4DNAPTBExcitationModel&); // prevent copy-construction
G4DNAPTBExcitationModel & operator=(const G4DNAPTBExcitationModel &right); // prevent assignement
};
#endif
@@ -0,0 +1,209 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: S. Meylan and C. Villagrasa (IRSN, France)
// Models come from
// M. Bug et al, Rad. Phys and Chem. 130, 459-479 (2017)
//
#ifndef G4DNAPTBIONISATIONMODEL_h
#define G4DNAPTBIONISATIONMODEL_h 1
#include "G4VDNAModel.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4ProductionCutsTable.hh"
#include "G4DNACrossSectionDataSet.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4DNAGenericIonsManager.hh"
#include "G4LogLogInterpolation.hh"
#include "G4DNAPTBIonisationStructure.hh"
#include "G4DNAPTBAugerModel.hh"
#include "G4NistManager.hh"
/*!
* \brief The G4DNAPTBIonisationModel class
* Implements the PTB ionisation model.
*/
class G4DNAPTBIonisationModel : public G4VDNAModel
{
public:
/*!
* \brief G4DNAPTBIonisationModel
* Constructor
* \param applyToMaterial
* \param p
* \param nam
* \param isAuger
*/
G4DNAPTBIonisationModel(const G4String &applyToMaterial = "all",
const G4ParticleDefinition* p = 0,
const G4String &nam = "DNAPTBIonisationModel",
const G4bool isAuger=true);
/*!
* \brief ~G4DNAPTBIonisationModel
* Destructor
*/
virtual ~G4DNAPTBIonisationModel();
/*!
* \brief Initialise
* Method called once at the beginning of the simulation. It is used to setup the list of the materials managed by the model
* and the energy limits. All the materials are setup but only a part of them can be activated by the user through the constructor.
*/
virtual void Initialise(const G4ParticleDefinition* particle, const G4DataVector& = *(new G4DataVector()), G4ParticleChangeForGamma* fpChangeForGamme=nullptr);
/*!
* \brief CrossSectionPerVolume
* Mandatory for every model the CrossSectionPerVolume method is in charge of returning the
* cross section value corresponding to the material, particle and energy current values.
* \param material
* \param materialName
* \param p
* \param ekin
* \param emin
* \param emax
* \return the cross section value
*/
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4String& materialName,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax);
/*!
* \brief SampleSecondaries
* If the model is selected for the ModelInterface then SampleSecondaries will be called.
* The method sets the characteristics of the particles implied with the physical process after the ModelInterface (energy, momentum...).
* This method is mandatory for every model.
* \param materialName
* \param particleChangeForGamma
* \param tmin
* \param tmax
*/
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4String& materialName,
const G4DynamicParticle*,
G4ParticleChangeForGamma *particleChangeForGamma,
G4double tmin,
G4double tmax);
protected:
private:
G4DNAPTBAugerModel* fDNAPTBAugerModel; ///< PTB Auger model instanciated in the constructor and deleted in the destructor of the class
G4int verboseLevel; ///< verbose level
G4DNAPTBIonisationStructure ptbStructure; /*!< ptbStructure class which contains the shell binding energies */
typedef std::map<G4String, std::map<G4String, std::map<double, std::map<double, std::map<double, double> > > > > TriDimensionMap;
TriDimensionMap diffCrossSectionData;
TriDimensionMap fEnergySecondaryData;
std::map<G4String, std::map<G4String, std::vector<double> > > fTMapWithVec;
typedef std::map<G4String, std::map<G4String, std::map<double, std::vector<double> > > > VecMap;
VecMap fEMapWithVector;
typedef std::map<G4String, std::map<G4String, std::map<double, std::map<double, std::vector<double> > > > > VecMapWithShell;
VecMapWithShell fProbaShellMap;
G4double RandomizeEjectedElectronEnergy(G4ParticleDefinition * aParticleDefinition, G4double incomingParticleEnergy, G4int shell, const G4String& materialName);
double DifferentialCrossSection(G4ParticleDefinition * aParticleDefinition, G4double k, G4double energyTransfer, G4int shell, const G4String &materialName);
/*!
* \brief RandomizeEjectedElectronEnergyFromCumulated
* Uses the cumulated tables to find the energy of the ejected particle (electron)
* \param particleDefinition
* \param k
* \param shell
* \param materialName
* \return the ejected electron energy
*/
G4double RandomizeEjectedElectronEnergyFromCumulated(G4ParticleDefinition *particleDefinition, G4double k, G4int shell, const G4String& materialName);
/*!
* \brief RandomizeEjectedElectronDirection
* Method to calculate the ejected electron direction
* \param aParticleDefinition
* \param incomingParticleEnergy
* \param outgoingParticleEnergy
* \param cosTheta
* \param phi
*/
void RandomizeEjectedElectronDirection(G4ParticleDefinition * aParticleDefinition, G4double incomingParticleEnergy, G4double
outgoingParticleEnergy, G4double & cosTheta, G4double & phi );
/*!
* \brief ReadDiffCSFile
* Method to read the differential cross section files.
* \param materialName
* \param particleName
* \param file
* \param scaleFactor
*/
void ReadDiffCSFile(const G4String &materialName, const G4String &particleName, const G4String &file, const G4double scaleFactor);
/*!
* \brief QuadInterpolator
* \param e11
* \param e12
* \param e21
* \param e22
* \param xs11
* \param xs12
* \param xs21
* \param xs22
* \param t1
* \param t2
* \param t
* \param e
* \return the interpolated value
*/
G4double 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);
/*!
* \brief LogLogInterpolate
* \param e1
* \param e2
* \param e
* \param xs1
* \param xs2
* \return the interpolate value
*/
G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2);
// copy constructor and hide assignment operator
G4DNAPTBIonisationModel(const G4DNAPTBIonisationModel&); // prevent copy-construction
G4DNAPTBIonisationModel & operator=(const G4DNAPTBIonisationModel &right); // prevent assignement
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -0,0 +1,119 @@
//
// ********************************************************************
// * 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$
//
#ifndef G4DNAVacuumModel_h
#define G4DNAVacuumModel_h 1
#include "G4VDNAModel.hh"
#include "G4ParticleChangeForGamma.hh"
#include "G4ProductionCutsTable.hh"
#include "G4DNACrossSectionDataSet.hh"
#include "G4LogLogInterpolation.hh"
#include "G4Electron.hh"
#include "G4Proton.hh"
#include "G4NistManager.hh"
/*!
* \brief The G4DNAVacuumModel class
* Implementation of the vacuum model allowing the user to use G4_Galactic as void in a
* Geant4-DNA simulation.
*/
class G4DNAVacuumModel : public G4VDNAModel
{
public:
/*!
* \brief G4DNAVacuumModel
* Constructor
* \param applyToMaterial
* \param p
* \param nam
*/
G4DNAVacuumModel(const G4String &applyToMaterial = "all", const G4ParticleDefinition* p = 0,
const G4String& nam = "DNAPTBVacuumModel");
/*!
* \brief ~G4DNAVacuumModel
* Destructor
*/
virtual ~G4DNAVacuumModel();
/*!
* \brief Initialise
* Registers the G4_Galactic material as "void material" for every particle
*/
virtual void Initialise(const G4ParticleDefinition*, const G4DataVector& = *(new G4DataVector()), G4ParticleChangeForGamma* fpChangeForGamme=nullptr);
/*!
* \brief CrossSectionPerVolume
* \param material
* \param materialName
* \param p
* \param ekin
* \param emin
* \param emax
* \return cross section value
*/
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4String& materialName,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax);
/*!
* \brief SampleSecondaries
* \param materialName
* \param particleChangeForGamma
* \param tmin
* \param tmax
*/
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4String& materialName,
const G4DynamicParticle*,
G4ParticleChangeForGamma *particleChangeForGamma,
G4double tmin,
G4double tmax);
protected:
private:
G4int verboseLevel; ///< verbose level
// copy constructor and hide assignment operator
G4DNAVacuumModel(const G4DNAVacuumModel&); // prevent copy-construction
G4DNAVacuumModel & operator=(const G4DNAVacuumModel &right); // prevent assignement
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -0,0 +1,306 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// Authors: S. Meylan and C. Villagrasa (IRSN, France)
// This class is used to support PTB models that come from
// M. Bug et al, Rad. Phys and Chem. 130, 459-479 (2017)
//
#ifndef G4VDNAModel_HH
#define G4VDNAModel_HH
#ifdef _MSC_VER
#pragma warning(disable : 4503)
#endif
#include "G4DNACrossSectionDataSet.hh"
#include "G4DNAMolecularMaterial.hh"
#include "G4LogLogInterpolation.hh"
#include "G4VEmModel.hh"
/*! \class G4VDNAModel
* \brief The G4VDNAModel class
*
* All the models using the DNA material management should inherit from that class.
* The goal is to allow the use of the material management system with little code interferences within the model classes.
*/
class G4VDNAModel
{
public:
/*!
* \brief G4VDNAModel
* Constructeur of the G4VDNAModel class.
* \param nam
* \param applyToMaterial
*/
G4VDNAModel(const G4String& nam, const G4String& applyToMaterial);
/*!
* \brief ~G4VDNAModel
*/
virtual ~G4VDNAModel();
/*!
* \brief Initialise
* Each model must implement an Initialize method.
* \param particle
* \param cuts
*/
virtual void Initialise(const G4ParticleDefinition* particle,
const G4DataVector& cuts,
G4ParticleChangeForGamma* fpChangeForGamme=nullptr) =0;
/*!
* \brief CrossSectionPerVolume
* Every model must implement its own CrossSectionPerVolume method.
* It is used by the process to determine the step path and must return a cross section times a number
* of molecules per volume unit.
* \param material
* \param materialName
* \param p
* \param ekin
* \param emin
* \param emax
* \return crossSection*numberOfMoleculesPerVolumeUnit
*/
virtual G4double CrossSectionPerVolume(const G4Material* material,
const G4String& materialName,
const G4ParticleDefinition* p,
G4double ekin,
G4double emin,
G4double emax) = 0;
/*!
* \brief SampleSecondaries
* Each model must implement SampleSecondaries to decide if a particle will be created after the ModelInterface or
* if any charateristic of the incident particle will change.
* \param materialName
* \param particleChangeForGamma
* \param tmin
* \param tmax
*/
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4String& materialName,
const G4DynamicParticle*,
G4ParticleChangeForGamma *particleChangeForGamma,
G4double tmin = 0,
G4double tmax = DBL_MAX) = 0;
/*!
* \brief IsMaterialDefine
* Check if the given material is defined in the simulation
* \param materialName
* \return true if the material is defined in the simulation
*/
G4bool IsMaterialDefine(const G4String &materialName);
/*!
* \brief IsMaterialExistingInModel
* Check if the given material is defined in the current model class
* \param materialName
* \return true if the material is defined in the model
*/
G4bool IsMaterialExistingInModel(const G4String &materialName);
/*!
* \brief IsParticleExistingInModelForMaterial
* To check two things:
* 1- is the material existing in model ?
* 2- if yes, is the particle defined for that material ?
* \param particleName
* \param materialName
* \return true if the particle/material couple is defined in the model
*/
G4bool IsParticleExistingInModelForMaterial(const G4String &particleName, const G4String &materialName);
/*!
* \brief GetName
* \return the name of the model
*/
G4String GetName(){return fName;}
/*!
* \brief GetHighEnergyLimit
* \param material
* \param particle
* \return fHighEnergyLimits[material][particle]
*/
G4double GetHighELimit(const G4String& material, const G4String& particle) {return fHighEnergyLimits[material][particle];}
/*!
* \brief GetLowEnergyLimit
* \param material
* \param particle
* \return fLowEnergyLimits[material][particle]
*/
G4double GetLowELimit(const G4String& material, const G4String& particle) {return fLowEnergyLimits[material][particle];}
/*!
* \brief SetHighEnergyLimit
* \param material
* \param particle
* \param lim
*/
void SetHighELimit(const G4String& material, const G4String& particle, G4double lim) {fHighEnergyLimits[material][particle]=lim;}
/*!
* \brief SetLowEnergyLimit
* \param material
* \param particle
* \param lim
*/
void SetLowELimit(const G4String& material, const G4String& particle, G4double lim) {fLowEnergyLimits[material][particle]=lim;}
protected:
// typedef used to ease the data container reading
//
typedef std::map<G4String, std::map<G4String,G4DNACrossSectionDataSet*,std::less<G4String> > > TableMapData;
typedef std::map<G4String,std::map<G4String, G4double> > RatioMapData;
typedef std::map<G4String, G4double>::const_iterator ItCompoMapData;
// Getters
//
/*!
* \brief GetTableData
* \return a pointer to a map with the following structure: [materialName][particleName]=G4DNACrossSectionDataSet*
*/
TableMapData* GetTableData(){return &fTableData;}
// Setters
// ... no setters
/*!
* \brief BuildApplyToMatVect
* Build the material name vector which is used to know the materials the user want to include in the model.
* \param materials
* \return a vector with all the material names
*/
std::vector<G4String> BuildApplyToMatVect(const G4String &materials);
/*!
* \brief ReadAndSaveCSFile
* Read and save a "simple" cross section file : use of G4DNACrossSectionDataSet->loadData()
* \param materialName
* \param particleName
* \param file
* \param scaleFactor
*/
void ReadAndSaveCSFile(const G4String &materialName, const G4String &particleName, const G4String &file, G4double scaleFactor);
/*!
* \brief RandomSelectShell
* Method to randomely select a shell from the data table uploaded.
* The size of the table (number of columns) is used to determine the total number of possible shells.
* \param k
* \param particle
* \param materialName
* \return the selected shell
*/
G4int RandomSelectShell(G4double k, const G4String &particle, const G4String &materialName);
/*!
* \brief AddCrossSectionData
* Method used during the initialization of the model class to add a new material. It adds a material to the model and fills vectors with informations.
* \param materialName
* \param particleName
* \param fileCS
* \param fileDiffCS
* \param scaleFactor
*/
void AddCrossSectionData(G4String materialName, G4String particleName, G4String fileCS, G4String fileDiffCS, G4double scaleFactor);
/*!
* \brief AddCrossSectionData
* Method used during the initialization of the model class to add a new material. It adds a material to the model and fills vectors with informations.
* Not every model needs differential cross sections.
* \param materialName
* \param particleName
* \param fileCS
* \param scaleFactor
*/
void AddCrossSectionData(G4String materialName, G4String particleName, G4String fileCS, G4double scaleFactor);
/*!
* \brief LoadCrossSectionData
* Method to loop on all the registered materials in the model and load the corresponding data.
*/
void LoadCrossSectionData(const G4String &particleName);
/*!
* \brief ReadDiffCSFile
* Virtual method that need to be implemented if one wish to use the differential cross sections.
* The read method for that kind of information is not standardized yet.
* \param materialName
* \param particleName
* \param path
* \param scaleFactor
*/
virtual void ReadDiffCSFile(const G4String& materialName,
const G4String& particleName,
const G4String& path,
const G4double scaleFactor);
/*!
* \brief EnableMaterialAndParticle
* \param materialName
* \param particleName
* Meant to fill fTableData with 0 for the specified material and particle, therefore allowing the ModelInterface class to proceed with the material and particle even if no data
* are registered here. The data should obviously be registered somewhere in the child class.
* This method is here to allow an easy use of the no-ModelInterface dna models within the ModelInterface system.
*/
void EnableForMaterialAndParticle(const G4String& materialName, const G4String& particleName);
private:
/*!
* \brief fStringOfMaterials
* The user can decide to specify by hand which are the materials the be activated among those implemented in the model.
* If the user does then only the specified materials contained in this string variable will be activated.
* The string is like: mat1/mat2/mat3/mat4
*/
const G4String fStringOfMaterials;
/*!
* \brief fTableData
* It contains the cross section data and can be used like: dataTable=fTableData[material][particle]
*/
TableMapData fTableData;
std::vector<G4String> fModelMaterials; ///< List the materials that can be activated (and will be by default) within the model.
std::vector<G4String> fModelParticles; ///< List the particles that can be activated within the model
std::vector<G4String> fModelCSFiles; ///< List the cross section data files
std::vector<G4String> fModelDiffCSFiles; ///< List the differential corss section data files
std::vector<G4double> fModelScaleFactors; ///< List the model scale factors (they could change with material)
std::map<G4String, std::map<G4String, G4double> > fLowEnergyLimits; ///< List the low energy limits
std::map<G4String, std::map<G4String, G4double> > fHighEnergyLimits; ///< List the high energy limits
G4String fName; ///< model name
};
#endif // G4VDNAModel_HH