Import Geant4 10.4.0.beta source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile 66892 2013-01-17 10:57:59Z gunter $
|
||||
# $Id: GNUmakefile 103042 2017-03-10 11:50:07Z gcosmo $
|
||||
# --------------------------------------------------------------------
|
||||
# GNUmakefile for electromagnetic sub-library. John Allison, 25/6/98.
|
||||
# --------------------------------------------------------------------
|
||||
@@ -33,7 +33,8 @@ CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/materials/include \
|
||||
-I$(G4BASE)/processes/electromagnetic/dna/molecules/management/include \
|
||||
-I$(G4BASE)/processes/electromagnetic/dna/molecules/types/include \
|
||||
-I$(G4BASE)/processes/electromagnetic/dna/management/include
|
||||
-I$(G4BASE)/processes/electromagnetic/dna/management/include \
|
||||
-I$(G4BASE)/analysis/management/include
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// 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 G4LOGLOGINTERPOLATION_HH
|
||||
#define G4LOGLOGINTERPOLATION_HH 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VDataSetAlgorithm.hh"
|
||||
#include "G4DataVector.hh"
|
||||
|
||||
class G4DNACPA100LogLogInterpolation : public G4VDataSetAlgorithm {
|
||||
|
||||
public:
|
||||
|
||||
G4DNACPA100LogLogInterpolation();
|
||||
|
||||
~G4DNACPA100LogLogInterpolation();
|
||||
|
||||
G4double Calculate(G4double point, G4int bin,
|
||||
const G4DataVector& energies,
|
||||
const G4DataVector& data) const;
|
||||
|
||||
G4double Calculate(G4double point, G4int bin,
|
||||
const G4DataVector& energies,
|
||||
const G4DataVector& data,
|
||||
const G4DataVector& log_energies,
|
||||
const G4DataVector& log_data) const;
|
||||
|
||||
virtual G4VDataSetAlgorithm* Clone() const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
// Hide copy constructor and assignment operator
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// 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 G4DNACPA100WaterExcitationStructure_hh
|
||||
#define G4DNACPA100WaterExcitationStructure_hh 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
|
||||
|
||||
class G4DNACPA100WaterExcitationStructure
|
||||
{
|
||||
public:
|
||||
|
||||
G4DNACPA100WaterExcitationStructure();
|
||||
|
||||
virtual ~G4DNACPA100WaterExcitationStructure();
|
||||
|
||||
G4double ExcitationEnergy(G4int level);
|
||||
|
||||
G4int NumberOfLevels() { return nLevels; }
|
||||
|
||||
// Copy constructor and assignment operator to be added here
|
||||
|
||||
private:
|
||||
|
||||
// Number of excitation levels of the water molecule
|
||||
G4int nLevels;
|
||||
|
||||
std::vector<G4double> energyConstant;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// 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 G4DNACPA100WaterIonisationStructure_hh
|
||||
#define G4DNACPA100WaterIonisationStructure_hh 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
|
||||
|
||||
class G4DNACPA100WaterIonisationStructure
|
||||
{
|
||||
public:
|
||||
|
||||
G4DNACPA100WaterIonisationStructure();
|
||||
|
||||
virtual ~G4DNACPA100WaterIonisationStructure();
|
||||
|
||||
G4double IonisationEnergy(G4int level);
|
||||
|
||||
G4double UEnergy(G4int level);
|
||||
|
||||
G4int NumberOfLevels() { return nLevels; }
|
||||
|
||||
// Copy constructor and assignment operator to be added here
|
||||
|
||||
private:
|
||||
|
||||
// Number of Ionisation levels of the water molecule
|
||||
G4int nLevels;
|
||||
|
||||
std::vector<G4double> energyConstant;
|
||||
std::vector<G4double> UConstant;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DNAChemistryManager.hh 100802 2016-11-02 14:55:27Z gcosmo $
|
||||
// $Id: G4DNAChemistryManager.hh 103042 2017-03-10 11:50:07Z gcosmo $
|
||||
//
|
||||
|
||||
// Author: Mathieu Karamitros
|
||||
@@ -64,6 +64,7 @@ class G4UIcmdWithABool;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4ITGun;
|
||||
class G4VPhysChemIO;
|
||||
|
||||
enum ElectronicModification
|
||||
{
|
||||
@@ -85,7 +86,8 @@ enum ElectronicModification
|
||||
* creation of water molecules and solvated electrons.
|
||||
*/
|
||||
|
||||
class G4DNAChemistryManager : public G4UImessenger, public G4VStateDependent
|
||||
class G4DNAChemistryManager: public G4UImessenger,
|
||||
public G4VStateDependent
|
||||
{
|
||||
protected:
|
||||
virtual ~G4DNAChemistryManager();
|
||||
@@ -119,7 +121,7 @@ public:
|
||||
void Initialize();
|
||||
inline void SetChemistryList(G4VUserChemistryList*);
|
||||
inline void Deregister(G4VUserChemistryList*);
|
||||
void SetGlobalTemperature(double temp_K);
|
||||
void SetGlobalTemperature(G4double temp_K);
|
||||
|
||||
inline void ForceMasterReinitialization();
|
||||
inline void TagThreadForReinitialization();
|
||||
@@ -152,10 +154,10 @@ public:
|
||||
//============================================================================
|
||||
/**
|
||||
* Method used by DNA physics model to create a water molecule.
|
||||
* The ElectronicModification is a flag telling wheter the molecule
|
||||
* The ElectronicModification is a flag telling whether the molecule
|
||||
* is ionized or excited, the electronic level is calculated by the
|
||||
* model and the IncomingTrack is the track responsible for the creation
|
||||
* of this molecule, for instance an electron.
|
||||
* of this molecule (electron, proton...).
|
||||
*/
|
||||
void CreateWaterMolecule(ElectronicModification,
|
||||
G4int /*electronicLevel*/,
|
||||
@@ -179,9 +181,9 @@ public:
|
||||
*/
|
||||
|
||||
void PushMolecule(G4Molecule*& molecule,
|
||||
double time,
|
||||
G4double time,
|
||||
const G4ThreeVector& position,
|
||||
int parentID);
|
||||
G4int parentID);
|
||||
|
||||
/**
|
||||
* WARNING : In case chemistry is not activated, PushMoleculeAtParentTimeAndPlace
|
||||
@@ -200,7 +202,7 @@ public:
|
||||
fVerbose = verbose;
|
||||
}
|
||||
|
||||
inline void SetBuildPhysicsTable(bool flag)
|
||||
inline void SetBuildPhysicsTable(G4bool flag)
|
||||
{fBuildPhysicsTable = flag;}
|
||||
|
||||
G4bool IsCounterResetWhenRunEnds() const
|
||||
@@ -213,6 +215,8 @@ public:
|
||||
fResetCounterWhenRunEnds = resetCounterWhenRunEnds;
|
||||
}
|
||||
|
||||
void SetPhysChemIO(G4VPhysChemIO* physChemIO);
|
||||
|
||||
protected:
|
||||
G4DNAWaterExcitationStructure* GetExcitationLevel();
|
||||
G4DNAWaterIonisationStructure* GetIonisationLevel();
|
||||
@@ -227,17 +231,22 @@ private:
|
||||
G4UIcmdWithABool* fpActivateChem;
|
||||
G4UIcmdWithoutParameter* fpRunChem;
|
||||
G4UIcmdWithoutParameter* fpSkipReactionsFromChemList;
|
||||
//G4UIcmdWithADoubleAndUnit* fpGridSize;
|
||||
//G4UIcmdWithADoubleAndUnit* fpGridSize; // not used in release
|
||||
G4UIcmdWithADoubleAndUnit* fpScaleForNewTemperature;
|
||||
G4UIcmdWithoutParameter* fpInitChem;
|
||||
|
||||
|
||||
static G4DNAChemistryManager* fgInstance;
|
||||
// static bool fActiveChemistry;
|
||||
bool fActiveChemistry;
|
||||
G4bool fFileInitialized;
|
||||
G4bool fWriteFile;
|
||||
static G4ThreadLocal std::ofstream* fpgOutput_tl;
|
||||
static G4ThreadLocal G4bool* fpgThreadInitialized_tl;
|
||||
G4bool fActiveChemistry;
|
||||
|
||||
struct ThreadLocalData{
|
||||
ThreadLocalData();
|
||||
~ThreadLocalData();
|
||||
G4VPhysChemIO* fpPhysChemIO;
|
||||
G4bool fThreadInitialized_tl;
|
||||
};
|
||||
|
||||
static G4ThreadLocal ThreadLocalData* fpThreadData;
|
||||
|
||||
G4bool fMasterInitialized;
|
||||
G4bool fForceThreadReinitialization;
|
||||
|
||||
@@ -255,6 +264,8 @@ private:
|
||||
G4bool fResetCounterWhenRunEnds;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
inline void G4DNAChemistryManager::ForceRebuildingPhysicsTable()
|
||||
{
|
||||
fPhysicsTableBuilt = false;
|
||||
@@ -279,13 +290,12 @@ inline void G4DNAChemistryManager::ForceMasterReinitialization()
|
||||
|
||||
inline void G4DNAChemistryManager::ForceThreadReinitialization()
|
||||
{
|
||||
// TODO
|
||||
fForceThreadReinitialization = true;
|
||||
}
|
||||
|
||||
inline void G4DNAChemistryManager::TagThreadForReinitialization()
|
||||
{
|
||||
if (fpgThreadInitialized_tl) delete fpgThreadInitialized_tl;
|
||||
fpThreadData->fThreadInitialized_tl = false;
|
||||
}
|
||||
|
||||
#endif // G4DNACHEMISTRYMANAGER_HH
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DNAMolecularMaterial.hh 101354 2016-11-15 08:27:51Z gcosmo $
|
||||
// $Id: G4DNAMolecularMaterial.hh 103042 2017-03-10 11:50:07Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros
|
||||
//
|
||||
@@ -40,7 +40,7 @@
|
||||
// reference papers on chemistry:
|
||||
//
|
||||
// J. Comput. Phys. 274 (2014) 841-882
|
||||
// Prog. Nucl. Sci. Tec. 2 (2011) 503-508
|
||||
// Prog. Nucl. Sci. Tec. 2 (2011) 503-508
|
||||
|
||||
#ifndef G4DNAMolecularMaterial_HH
|
||||
#define G4DNAMolecularMaterial_HH
|
||||
@@ -54,18 +54,46 @@
|
||||
class G4Material;
|
||||
class G4MolecularConfiguration;
|
||||
|
||||
/**
|
||||
* \struct CompareMaterial
|
||||
* \brief Materials can be described as a derivation of existing "parent"
|
||||
* materials in order to alter few of their features, such as density.
|
||||
* \p CompareMaterial compare materials taking into account
|
||||
* their possible "affiliation".
|
||||
*/
|
||||
struct CompareMaterial
|
||||
{
|
||||
// If the materials derives from a base material,
|
||||
// it should be able to find the derived material using the base material.
|
||||
bool operator()(const G4Material* mat1, const G4Material* mat2) const;
|
||||
};
|
||||
|
||||
typedef std::map<const G4Material*, double, CompareMaterial> ComponentMap;
|
||||
|
||||
// G4DNAMolecularMaterial is initialized when G4ApplicationState == G4State_Idle
|
||||
/**
|
||||
* \class G4DNAMolecularMaterial
|
||||
* \brief G4DNAMolecularMaterial builds tables of molecular densities for chosen
|
||||
* molecular materials. The class handles homogeneous, composite and
|
||||
* derived materials. A material of interest is labeled as molecular if built
|
||||
* using the number of atoms rather than the mass fractions.
|
||||
*
|
||||
* \details
|
||||
* - Initialization:
|
||||
* G4DNAMolecularMaterial is initialized when
|
||||
* G4ApplicationState == G4State_Idle.
|
||||
* It should be initialized on the master thread and used in read-only mode
|
||||
* during stepping. The singleton is thread-shared.
|
||||
*
|
||||
* - For Developers:
|
||||
* Use GetNumMolPerVolTableFor(molecule) in the concrete implementation of
|
||||
* G4VEmModel::Initialise or G4VProcess::PreparePhysicsTable
|
||||
* at run initialization to retrieve a read-only, thread-safe, table.
|
||||
* The table is then built on the master thread at initialization time and
|
||||
* shared between all threads and models.
|
||||
*
|
||||
* \note A G4material is labeled as molecular if built using the number of atoms
|
||||
*
|
||||
*/
|
||||
|
||||
class G4DNAMolecularMaterial : public G4VStateDependent
|
||||
class G4DNAMolecularMaterial: public G4VStateDependent
|
||||
{
|
||||
public:
|
||||
static G4DNAMolecularMaterial* Instance();
|
||||
@@ -77,7 +105,39 @@ public:
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* \fn const std::vector<double>* \
|
||||
* GetDensityTableFor(const G4Material* searchedMaterial) const
|
||||
* \brief Retrieve a table of volumetric mass densities (mass per unit volume)
|
||||
* in the G4 unit system for chosen material.
|
||||
*
|
||||
* @param[in] searchedMaterial
|
||||
* The material which you'd like to retrieve the volumic mass
|
||||
* @pre The \p searchedMaterial used in parameter must be built as a
|
||||
* molecular material, using the number of atoms rather than the density
|
||||
* fractions.
|
||||
* \return
|
||||
* Pointer to a table of molecular densities for the \p searchedMaterial
|
||||
* indexed on the (parent) material index.
|
||||
*
|
||||
*/
|
||||
const std::vector<double>* GetDensityTableFor(const G4Material*) const;
|
||||
|
||||
/**
|
||||
* \fn const std::vector<double>* \
|
||||
* GetNumMolPerVolTableFor(const G4Material* searchedMaterial) const
|
||||
* \brief Retrieve a table of molecular densities (number of molecules per
|
||||
* unit volume) in the G4 unit system for chosen material.
|
||||
*
|
||||
* @param[in] searchedMaterial
|
||||
* The material which you'd like to retrieve the molecular density
|
||||
* @pre The \p searchedMaterial used in parameter must be built as a
|
||||
* molecular material, using the number of atoms rather than the density
|
||||
* fractions.
|
||||
* \return
|
||||
* Pointer to a table of molecular densities for the \p searchedMaterial
|
||||
* indexed on the (parent) material index.
|
||||
*/
|
||||
const std::vector<double>* GetNumMolPerVolTableFor(const G4Material*) const;
|
||||
|
||||
inline const std::vector<ComponentMap>* GetMassFractionTable() const{
|
||||
@@ -90,13 +150,75 @@ public:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
G4MolecularConfiguration* GetMolecularConfiguration(const G4Material*) const;
|
||||
|
||||
/**
|
||||
* \fn void SetMolecularConfiguration(const G4Material* material, \
|
||||
* G4MolecularConfiguration* molConf)
|
||||
* \brief Associate a molecular configuration to a G4material.
|
||||
*
|
||||
* @param[in] material
|
||||
* Pointer to a G4 material. The material
|
||||
* does not need to be defined as a molecular material.
|
||||
* @param[in] molConf
|
||||
* The molecular configuration corresponding to
|
||||
* the G4 \p material.
|
||||
*/
|
||||
void SetMolecularConfiguration(const G4Material*,
|
||||
G4MolecularConfiguration*);
|
||||
|
||||
/**
|
||||
* \fn void SetMolecularConfiguration(const G4Material* material, \
|
||||
* const G4String& molConf)
|
||||
* \brief Associate a molecular configuration to a G4material.
|
||||
*
|
||||
* @param[in] material
|
||||
* Pointer to a G4 material. The material
|
||||
* does not need to be defined as a molecular material.
|
||||
* @param[in] molConf
|
||||
* User ID of the molecular configuration corresponding to
|
||||
* the G4 \p material.
|
||||
*/
|
||||
void SetMolecularConfiguration(const G4Material*,
|
||||
const G4String&);
|
||||
|
||||
/**
|
||||
* \fn void SetMolecularConfiguration(const G4Material* material, \
|
||||
* const G4String& molConf)
|
||||
* \brief Associate a molecular configuration to a G4material.
|
||||
*
|
||||
* @param[in] material
|
||||
* Name of the G4 material. The material
|
||||
* does not need to be defined as a molecular material.
|
||||
* @param[in] molConf
|
||||
* User ID of the molecular configuration corresponding to
|
||||
* the G4 \p material.
|
||||
*/
|
||||
void SetMolecularConfiguration(const G4String& materialName,
|
||||
const G4String& molUserIF);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* \brief Deprecated
|
||||
* \deprecated Will return a G4 fatal exception.
|
||||
* Use instead GetNumMolPerVolTableFor(molecule) at run
|
||||
* initialization to retrieve a read-only, thread-safe, table.
|
||||
* \note A G4material is labeled as molecular if built using
|
||||
* the number of atoms.
|
||||
*/
|
||||
G4double GetNumMoleculePerVolumeUnitForMaterial(const G4Material *mat);
|
||||
|
||||
/**
|
||||
* \brief Deprecated
|
||||
* \deprecated Will return a G4 fatal exception.
|
||||
* Use instead GetNumMolPerVolTableFor(molecule) at run
|
||||
* initialization to retrieve a read-only, thread-safe, table.
|
||||
* \note A G4material is labeled as molecular if built using
|
||||
* the number of atoms.
|
||||
*/
|
||||
G4double GetNumMolPerVolForComponentInComposite(const G4Material *composite,
|
||||
const G4Material *component,
|
||||
G4double massFraction);
|
||||
|
||||
protected:
|
||||
static G4DNAMolecularMaterial* fInstance;
|
||||
@@ -119,6 +241,7 @@ protected:
|
||||
void PrintNotAMolecularMaterial(const char* methodName,
|
||||
const G4Material* lookForMaterial) const;
|
||||
|
||||
// Tables built for all molecular materials at initialization
|
||||
std::vector<ComponentMap>* fpCompFractionTable;
|
||||
std::vector<ComponentMap>* fpCompDensityTable;
|
||||
std::vector<ComponentMap>* fpCompNumMolPerVolTable;
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
///
|
||||
// ********************************************************************
|
||||
// * 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 G4DNAPTBIonisationStructure_HH
|
||||
#define G4DNAPTBIonisationStructure_HH 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
|
||||
class G4DNAPTBIonisationStructure
|
||||
{
|
||||
public:
|
||||
|
||||
G4DNAPTBIonisationStructure();
|
||||
|
||||
virtual ~G4DNAPTBIonisationStructure();
|
||||
|
||||
G4double IonisationEnergy(G4int level, const G4String &materialName);
|
||||
|
||||
G4int NumberOfLevels(const G4String& materialName);
|
||||
|
||||
// Copy constructor and assignment operator to be added here
|
||||
|
||||
private:
|
||||
|
||||
// Number of Ionisation levels of the water molecule
|
||||
std::map<G4String, G4int> nLevels;
|
||||
|
||||
std::map<G4String, std::vector<G4double> > energyConstant;
|
||||
|
||||
G4String ReplaceMaterial(const G4String &materialName);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* G4PhysChemIO.hh
|
||||
*
|
||||
* Created on: 3 févr. 2017
|
||||
* Author: matkara
|
||||
*/
|
||||
#ifndef G4PHYSCHEMIO_HH_
|
||||
#define G4PHYSCHEMIO_HH_
|
||||
|
||||
#include "G4VPhysChemIO.hh"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
namespace G4PhysChemIO{
|
||||
|
||||
class FormattedText: public G4VPhysChemIO
|
||||
{
|
||||
public:
|
||||
FormattedText();
|
||||
virtual ~FormattedText();
|
||||
|
||||
virtual void InitializeMaster(){}
|
||||
virtual void InitializeThread(){}
|
||||
virtual void InitializeFile();
|
||||
|
||||
virtual void NewRun(){}
|
||||
virtual void NewEvent(){}
|
||||
|
||||
/**
|
||||
* When DNA physics model create a water molecule, you'll get a notification
|
||||
* through this method.
|
||||
* The ElectronicModification is a flag telling whether the molecule
|
||||
* is ionized or excited, the electronic level is calculated by the
|
||||
* model and the IncomingTrack is the track responsible for the creation
|
||||
* of this molecule (electron, proton...)
|
||||
*/
|
||||
virtual void CreateWaterMolecule(G4int electronicModif,
|
||||
G4int /*electronicLevel*/,
|
||||
G4double energy,
|
||||
const G4Track* /*theIncomingTrack*/);
|
||||
|
||||
/**
|
||||
* Same idea as the previous method but for solvated electron.
|
||||
* This method should be used by the physics model of the ElectronSolvatation
|
||||
* process.
|
||||
*/
|
||||
virtual void CreateSolvatedElectron(const G4Track* /*theIncomingTrack*/,
|
||||
G4ThreeVector* finalPosition = 0);
|
||||
|
||||
//============================================================================
|
||||
// FILE OPERATIONS
|
||||
//============================================================================
|
||||
|
||||
/**
|
||||
* Tells the chemistry manager to write into a file
|
||||
* the position and electronic state of the water molecule
|
||||
* and the position thermalized or not of the solvated electron
|
||||
*/
|
||||
virtual void WriteInto(const G4String&,
|
||||
std::ios_base::openmode mode = std::ios_base::out);
|
||||
virtual void AddEmptyLineInOuputFile();
|
||||
|
||||
/**
|
||||
* Close the file specified with WriteInto
|
||||
*/
|
||||
virtual void CloseFile();
|
||||
|
||||
protected:
|
||||
G4int fRunID; // unused
|
||||
G4int fEventID; // unused
|
||||
G4bool fFileInitialized;
|
||||
std::ofstream fOfstream;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class G4Analysis: public G4VPhysChemIO
|
||||
{
|
||||
public:
|
||||
G4Analysis(G4VAnalysisManager*);
|
||||
virtual ~G4Analysis();
|
||||
|
||||
virtual void InitializeMaster(){}
|
||||
virtual void InitializeThread(){}
|
||||
virtual void InitializeFile();
|
||||
|
||||
virtual void NewRun(){}
|
||||
virtual void NewEvent(){}
|
||||
|
||||
/**
|
||||
* Method used by DNA physics model to create a water molecule.
|
||||
* The ElectronicModification is a flag telling wheter the molecule
|
||||
* is ionized or excited, the electronic level is calculated by the
|
||||
* model and the IncomingTrack is the track responsible for the creation
|
||||
* of this molecule, for instance an electron.
|
||||
*/
|
||||
virtual void CreateWaterMolecule(G4int electronicModif,
|
||||
G4int /*electronicLevel*/,
|
||||
G4double energy,
|
||||
const G4Track* /*theIncomingTrack*/);
|
||||
|
||||
/**
|
||||
* Same idea as the previous method but for solvated electron.
|
||||
* This method should be used by the physics model of the ElectronSolvatation
|
||||
* process.
|
||||
*/
|
||||
virtual void CreateSolvatedElectron(const G4Track* /*theIncomingTrack*/,
|
||||
G4ThreeVector* finalPosition = 0);
|
||||
|
||||
//============================================================================
|
||||
// FILE OPERATIONS
|
||||
//============================================================================
|
||||
|
||||
/**
|
||||
* Tells the chemMan to write into a file
|
||||
* the position and electronic state of the water molecule
|
||||
* and the position thermalized or not of the solvated electron
|
||||
*/
|
||||
virtual void WriteInto(const G4String&, std::ios_base::openmode mode =
|
||||
std::ios_base::out);
|
||||
virtual void AddEmptyLineInOuputFile(){}
|
||||
|
||||
/**
|
||||
* Close the file specified with WriteInto
|
||||
*/
|
||||
virtual void CloseFile();
|
||||
|
||||
protected:
|
||||
G4VAnalysisManager* fpAnalysisManager;
|
||||
int fNtupleID;
|
||||
G4bool fFileInitialized;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // G4PHYSCHEMIO_HH_
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* G4VPhysChemIO.hh
|
||||
*
|
||||
* Created on: 3 févr. 2017
|
||||
* Author: matkara
|
||||
*/
|
||||
|
||||
#ifndef G4VPHYSCHEMIO_HH_
|
||||
#define G4VPHYSCHEMIO_HH_
|
||||
|
||||
#include <fstream>
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
class G4Track;
|
||||
class G4VAnalysisManager;
|
||||
|
||||
class G4VPhysChemIO
|
||||
{
|
||||
public:
|
||||
G4VPhysChemIO();
|
||||
virtual ~G4VPhysChemIO();
|
||||
|
||||
virtual void InitializeMaster(){}
|
||||
virtual void InitializeThread(){}
|
||||
virtual void InitializeFile() = 0;
|
||||
|
||||
virtual void NewRun() = 0;
|
||||
virtual void NewEvent() = 0;
|
||||
|
||||
/**
|
||||
* When DNA physics model create a water molecule, you'll get a notification
|
||||
* through this method.
|
||||
* The ElectronicModification is a flag telling whether the molecule
|
||||
* is ionized or excited, the electronic level is calculated by the
|
||||
* model and the IncomingTrack is the track responsible for the creation
|
||||
* of this molecule (electron, proton...)
|
||||
*/
|
||||
virtual void CreateWaterMolecule(G4int electronicModif,
|
||||
G4int /*electronicLevel*/,
|
||||
G4double energy,
|
||||
const G4Track* /*theIncomingTrack*/) = 0;
|
||||
|
||||
/**
|
||||
* Same idea as the previous method but for solvated electron.
|
||||
* This method should be used by the physics model of the ElectronSolvatation
|
||||
* process.
|
||||
*/
|
||||
virtual void CreateSolvatedElectron(const G4Track* /*theIncomingTrack*/,
|
||||
G4ThreeVector* finalPosition = 0) = 0;
|
||||
|
||||
//============================================================================
|
||||
// FILE OPERATIONS
|
||||
//============================================================================
|
||||
|
||||
/**
|
||||
* Tells the chemistry manager to write into a file
|
||||
* the position and electronic state of the water molecule
|
||||
* and the position thermalized or not of the solvated electron
|
||||
*/
|
||||
virtual void WriteInto(const G4String&, std::ios_base::openmode mode =
|
||||
std::ios_base::out) = 0;
|
||||
virtual void AddEmptyLineInOuputFile(){};
|
||||
|
||||
/**
|
||||
* Close the file specified with WriteInto
|
||||
*/
|
||||
virtual void CloseFile() = 0;
|
||||
};
|
||||
|
||||
#endif // G4PHYSCHEMIO_HH_
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: sources.cmake 101790 2016-11-28 15:33:44Z gcosmo $
|
||||
# $Id: sources.cmake 103042 2017-03-10 11:50:07Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@@ -42,6 +42,8 @@ include_directories(${CMAKE_SOURCE_DIR}/source/processes/electromagnetic/dna/mol
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/electromagnetic/dna/molecules/types/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/track/include)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/analysis/management/include) # for physchemIO
|
||||
|
||||
#
|
||||
# Define the Geant4 Module.
|
||||
#
|
||||
@@ -49,6 +51,9 @@ include(Geant4MacroDefineModule)
|
||||
GEANT4_DEFINE_MODULE(NAME G4emdna-utils
|
||||
HEADERS
|
||||
G4DNAChemistryManager.hh
|
||||
G4DNACPA100LogLogInterpolation.hh
|
||||
G4DNACPA100WaterExcitationStructure.hh
|
||||
G4DNACPA100WaterIonisationStructure.hh
|
||||
G4DNACrossSectionDataSet.hh
|
||||
G4DNADamage.hh
|
||||
G4DNAGenericIonsManager.hh
|
||||
@@ -57,6 +62,7 @@ GEANT4_DEFINE_MODULE(NAME G4emdna-utils
|
||||
G4DNAMolecularReactionTable.hh
|
||||
G4DNAEmfietzoglouWaterExcitationStructure.hh
|
||||
G4DNAEmfietzoglouWaterIonisationStructure.hh
|
||||
G4DNAPTBIonisationStructure.hh
|
||||
G4DNARevertProbability.hh
|
||||
G4DNAWaterExcitationStructure.hh
|
||||
G4DNAWaterIonisationStructure.hh
|
||||
@@ -65,8 +71,14 @@ GEANT4_DEFINE_MODULE(NAME G4emdna-utils
|
||||
G4ReactionTableMessenger.hh
|
||||
G4VDNAReactionModel.hh
|
||||
G4VUserChemistryList.hh
|
||||
# physchemIO
|
||||
G4VPhysChemIO.hh
|
||||
G4PhysChemIO.hh
|
||||
SOURCES
|
||||
G4DNAChemistryManager.cc
|
||||
G4DNACPA100LogLogInterpolation.cc
|
||||
G4DNACPA100WaterExcitationStructure.cc
|
||||
G4DNACPA100WaterIonisationStructure.cc
|
||||
G4DNACrossSectionDataSet.cc
|
||||
G4DNADamage.cc
|
||||
G4DNAGenericIonsManager.cc
|
||||
@@ -75,6 +87,7 @@ GEANT4_DEFINE_MODULE(NAME G4emdna-utils
|
||||
G4DNAMolecularReactionTable.cc
|
||||
G4DNAEmfietzoglouWaterExcitationStructure.cc
|
||||
G4DNAEmfietzoglouWaterIonisationStructure.cc
|
||||
G4DNAPTBIonisationStructure.cc
|
||||
G4DNAWaterExcitationStructure.cc
|
||||
G4DNAWaterIonisationStructure.cc
|
||||
G4MoleculeGun.cc
|
||||
@@ -82,6 +95,9 @@ GEANT4_DEFINE_MODULE(NAME G4emdna-utils
|
||||
G4ReactionTableMessenger.cc
|
||||
G4VDNAReactionModel.cc
|
||||
G4VUserChemistryList.cc
|
||||
# physchemIO
|
||||
G4VPhysChemIO.cc
|
||||
G4PhysChemIO.cc
|
||||
GRANULAR_DEPENDENCIES
|
||||
G4baryons
|
||||
G4bosons
|
||||
@@ -104,6 +120,7 @@ GEANT4_DEFINE_MODULE(NAME G4emdna-utils
|
||||
# G4emdna-molman
|
||||
# G4emdna-moltypes
|
||||
GLOBAL_DEPENDENCIES
|
||||
G4analysis
|
||||
G4geometry
|
||||
G4global
|
||||
G4intercoms
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
#include "G4DNACPA100LogLogInterpolation.hh"
|
||||
|
||||
// Constructor
|
||||
|
||||
G4DNACPA100LogLogInterpolation::G4DNACPA100LogLogInterpolation()
|
||||
{ }
|
||||
|
||||
// Destructor
|
||||
|
||||
G4DNACPA100LogLogInterpolation::~G4DNACPA100LogLogInterpolation()
|
||||
{ }
|
||||
|
||||
G4VDataSetAlgorithm* G4DNACPA100LogLogInterpolation::Clone() const
|
||||
{ return new G4DNACPA100LogLogInterpolation; }
|
||||
|
||||
|
||||
G4double G4DNACPA100LogLogInterpolation::Calculate(G4double x, G4int bin,
|
||||
const G4DataVector& points,
|
||||
const G4DataVector& data) const
|
||||
{
|
||||
//G4cout << "G4DNACPA100LogLogInterpolation is performed (2 arguments) " << G4endl;
|
||||
G4int nBins = data.size() - 1;
|
||||
//G4double oldresult = 0.;
|
||||
G4double value = 0.;
|
||||
if (x < points[0])
|
||||
{
|
||||
value = 0.;
|
||||
}
|
||||
else if (bin < nBins)
|
||||
{
|
||||
G4double e1 = points[bin];
|
||||
G4double e2 = points[bin+1];
|
||||
G4double d1 = data[bin];
|
||||
G4double d2 = data[bin+1];
|
||||
// Check of e1, e2, d1 and d2 values to avoid floating-point errors when estimating the interpolated value below -- S.I., Jun. 2008
|
||||
if ((d1 > 0.) && (d2 > 0.) && (e1 > 0.) && (e2 > 0.))
|
||||
{
|
||||
// Streamline the Log-Log Interpolation formula in order to reduce the required number of log10() function calls
|
||||
// Variable oldresult contains the result of old implementation of Log-Log interpolation -- M.G.P. Jun. 2001
|
||||
// oldresult = (std::log10(d1)*std::log10(e2/x) + std::log10(d2)*std::log10(x/e1)) / std::log10(e2/e1);
|
||||
// oldresult = std::pow(10.,oldresult);
|
||||
// Variable value contains the result of new implementation, after streamlining the math operation -- N.A.K. Oct. 2008
|
||||
value = std::log10(d1)+(std::log10(d2/d1)/std::log10(e2/e1)*std::log10(x/e1));
|
||||
value = std::pow(10.,value);
|
||||
// Test of the new implementation result (value variable) against the old one (oldresult) -- N.A.K. Dec. 2008
|
||||
// G4double diffResult = value - oldresult;
|
||||
// G4double relativeDiff = 1e-11;
|
||||
// Comparison of the two values based on a max allowable relative difference
|
||||
// if ( std::fabs(diffResult) > relativeDiff*std::fabs(oldresult) )
|
||||
// {
|
||||
// Abort comparison when at least one of two results is infinite
|
||||
// if ((!std::isinf(oldresult)) && (!std::isinf(value)))
|
||||
// {
|
||||
// G4cout << "G4DNACPA100LogLogInterpolation> Old Interpolated Value is:" << oldresult << G4endl;
|
||||
// G4cout << "G4DNACPA100LogLogInterpolation> New Interpolated Value is:" << value << G4endl << G4endl;
|
||||
// G4cerr << "G4DNACPA100LogLogInterpolation> Error in Interpolation:" << G4endl;
|
||||
// G4cerr << "The difference between new and old interpolated value is:" << diffResult << G4endl << G4endl;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
else value = 0.;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = data[nBins];
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
// Nicolas A. Karakatsanis: New implementation of log-log interpolation after directly loading
|
||||
// logarithmic values from G4EMLOW dataset
|
||||
|
||||
G4double G4DNACPA100LogLogInterpolation::Calculate(G4double x, G4int bin,
|
||||
const G4DataVector& points,
|
||||
const G4DataVector& data,
|
||||
const G4DataVector& log_points,
|
||||
const G4DataVector& log_data) const
|
||||
{
|
||||
G4int nBins = data.size() - 1;
|
||||
G4double value = 0.;
|
||||
G4double log_x = std::log10(x);
|
||||
if (x < points[0])
|
||||
{
|
||||
value = 0.;
|
||||
}
|
||||
else if (bin < nBins)
|
||||
{
|
||||
G4double log_e1 = log_points[bin];
|
||||
//G4double log_e2 = log_points[bin+1];
|
||||
G4double log_d1 = log_data[bin];
|
||||
G4double log_d2 = log_data[bin+1];
|
||||
|
||||
//G4cout << "x = " << x << " , logx = " << log_x << " , bin = " << bin << G4endl;
|
||||
//G4cout << "e1 = " << points[bin] << " d1 = " << data[bin] << G4endl;
|
||||
//G4cout << "e2 = " << points[bin+1] << " d2 = " << data[bin+1] << G4endl;
|
||||
//G4cout << "loge1 = " << log_e1 << " logd1 = " << log_d1 << G4endl;
|
||||
//G4cout << "loge2 = " << log_e2 << " logd2 = " << log_d2 << G4endl;
|
||||
//G4cout << "interpol " << log_d1 + (log_d2 - log_d1)*(log_x - log_e1)/(log_e2 - log_e1) << " " << G4endl;
|
||||
|
||||
|
||||
// Values e1, e2, d1 and d2 are the log values of the corresponding
|
||||
// original energy and data values. Simple linear interpolation performed
|
||||
// on loagarithmic data should be equivalent to log-log interpolation
|
||||
|
||||
// CPA100 specific
|
||||
//value = log_d1 + (log_d2 - log_d1)*(log_x - log_e1)/(log_e2 - log_e1);
|
||||
// value = log_d1;
|
||||
|
||||
value = log_d2; // UPPER VALUE INTERPOLATION
|
||||
if (log_x == log_e1) value = log_d1; // IN CASE OF EQUALITY
|
||||
|
||||
// Delogarithmize to obtain interpolated value
|
||||
value = std::pow(10.,value);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = data[nBins];
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
#include "G4DNACPA100WaterExcitationStructure.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4DNACPA100WaterExcitationStructure::G4DNACPA100WaterExcitationStructure(): nLevels(5)
|
||||
{
|
||||
|
||||
// The following values are extracted from the thesis of S. Edel,
|
||||
// Paul Sabatier University, Toulouse, France, July 7, 2006
|
||||
// Page 36
|
||||
|
||||
energyConstant.push_back(8.17*eV);
|
||||
energyConstant.push_back(10.13*eV);
|
||||
energyConstant.push_back(11.31*eV);
|
||||
energyConstant.push_back(12.91*eV);
|
||||
energyConstant.push_back(14.50*eV);
|
||||
|
||||
nLevels = energyConstant.size();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4DNACPA100WaterExcitationStructure::~G4DNACPA100WaterExcitationStructure()
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4DNACPA100WaterExcitationStructure::ExcitationEnergy(G4int level)
|
||||
{
|
||||
G4double excitation = 0.;
|
||||
|
||||
if (level >=0 && level < nLevels) excitation = energyConstant[level];
|
||||
|
||||
return excitation;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
#include "G4DNACPA100WaterIonisationStructure.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
G4DNACPA100WaterIonisationStructure::G4DNACPA100WaterIonisationStructure(): nLevels(5)
|
||||
{
|
||||
energyConstant.push_back(10.79*eV);
|
||||
energyConstant.push_back(13.39*eV);
|
||||
energyConstant.push_back(16.05*eV);
|
||||
energyConstant.push_back(32.30*eV);
|
||||
energyConstant.push_back(539.0*eV);
|
||||
|
||||
UConstant.push_back(61.91*eV);
|
||||
UConstant.push_back(59.52*eV);
|
||||
UConstant.push_back(48.36*eV);
|
||||
UConstant.push_back(70.71*eV);
|
||||
UConstant.push_back(796.2*eV);
|
||||
|
||||
nLevels = energyConstant.size();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4DNACPA100WaterIonisationStructure::~G4DNACPA100WaterIonisationStructure()
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4DNACPA100WaterIonisationStructure::IonisationEnergy(G4int level)
|
||||
{
|
||||
G4double ionisation = 0.;
|
||||
|
||||
if (level >=0 && level < nLevels) ionisation = energyConstant[level];
|
||||
|
||||
return ionisation;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4DNACPA100WaterIonisationStructure::UEnergy(G4int level)
|
||||
{
|
||||
G4double ionisation = 0.;
|
||||
|
||||
if (level >=0 && level < nLevels) ionisation = UConstant[level];
|
||||
|
||||
return ionisation;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DNAChemistryManager.cc 100802 2016-11-02 14:55:27Z gcosmo $
|
||||
// $Id: G4DNAChemistryManager.cc 103042 2017-03-10 11:50:07Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros (kara@cenbg.in2p3.fr)
|
||||
//
|
||||
@@ -58,38 +58,57 @@
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4MoleculeFinder.hh"
|
||||
#include "G4MoleculeTable.hh"
|
||||
#include "G4PhysChemIO.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4DNAChemistryManager* G4DNAChemistryManager::fgInstance;
|
||||
G4ThreadLocal std::ofstream* G4DNAChemistryManager::fpgOutput_tl = 0;
|
||||
G4ThreadLocal G4bool* G4DNAChemistryManager::fpgThreadInitialized_tl = 0;
|
||||
|
||||
G4ThreadLocal G4DNAChemistryManager::ThreadLocalData*
|
||||
G4DNAChemistryManager::fpThreadData = 0;
|
||||
|
||||
G4Mutex chemManExistence;
|
||||
//bool G4DNAChemistryManager::fActiveChemistry = false;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4DNAChemistryManager::ThreadLocalData::ThreadLocalData()
|
||||
{
|
||||
fpPhysChemIO = nullptr;
|
||||
fThreadInitialized_tl = false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4DNAChemistryManager::ThreadLocalData::~ThreadLocalData()
|
||||
{
|
||||
if(fpPhysChemIO) delete fpPhysChemIO;
|
||||
fThreadInitialized_tl = false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::SetPhysChemIO(G4VPhysChemIO* physChemIO)
|
||||
{
|
||||
if(fpThreadData->fpPhysChemIO)
|
||||
delete fpThreadData->fpPhysChemIO;
|
||||
fpThreadData->fpPhysChemIO = physChemIO;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4DNAChemistryManager::G4DNAChemistryManager() :
|
||||
G4UImessenger(), G4VStateDependent()
|
||||
{
|
||||
//==============================================================================
|
||||
/* M.K: 24/11/2014
|
||||
* To work properly, the chemistry manager should be created and initialized on
|
||||
* the master thread only. If the static flag fActiveChemistry is on but the
|
||||
* chemistry manager singleton
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* The chemistry manager is shared between threads
|
||||
* It is initialized both on the master thread and on the worker threads
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
// if (/*fActiveChemistry &&*/ G4Threading::IsWorkerThread()
|
||||
// && G4Threading::IsMultithreadedApplication())
|
||||
// {
|
||||
// G4Exception("G4DNAChemistryManager::G4DNAChemistryManager",
|
||||
// "G4DNAChemistryManager_MASTER_CREATION", FatalException,
|
||||
// "The chemistry manager should be created and initialized on the "
|
||||
// "master thread only");
|
||||
// }
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
fpExcitationLevel = 0;
|
||||
fpIonisationLevel = 0;
|
||||
fWriteFile = false;
|
||||
fpUserChemistryList = 0;
|
||||
fMasterInitialized = false;
|
||||
fpChemDNADirectory = new G4UIdirectory("/chem/");
|
||||
@@ -106,17 +125,18 @@ G4DNAChemistryManager::G4DNAChemistryManager() :
|
||||
fGeometryClosed = false;
|
||||
fPhysicsTableBuilt = false;
|
||||
fForceThreadReinitialization = false;
|
||||
fFileInitialized = false;
|
||||
fVerbose = 0;
|
||||
fActiveChemistry = false;
|
||||
fSkipReactions = false;
|
||||
fResetCounterWhenRunEnds = true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4DNAChemistryManager*
|
||||
G4DNAChemistryManager::Instance()
|
||||
{
|
||||
if (fgInstance == 0)
|
||||
if(fgInstance == 0)
|
||||
{
|
||||
G4AutoLock lock(&chemManExistence);
|
||||
if (fgInstance == 0) // MT : double check at initialisation
|
||||
@@ -125,15 +145,23 @@ G4DNAChemistryManager::Instance()
|
||||
}
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
if(fpThreadData==0) fpThreadData = new ThreadLocalData();
|
||||
// make sure thread local data is initialized for all threads
|
||||
|
||||
return fgInstance;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4DNAChemistryManager*
|
||||
G4DNAChemistryManager::GetInstanceIfExists()
|
||||
{
|
||||
return fgInstance;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4DNAChemistryManager::~G4DNAChemistryManager()
|
||||
{
|
||||
// G4cout << "Deleting G4DNAChemistryManager" << G4endl;
|
||||
@@ -146,6 +174,8 @@ G4DNAChemistryManager::~G4DNAChemistryManager()
|
||||
*/
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::Clear()
|
||||
{
|
||||
if (fpIonisationLevel)
|
||||
@@ -206,6 +236,8 @@ void G4DNAChemistryManager::Clear()
|
||||
G4VMoleculeCounter::DeleteInstance();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::DeleteInstance()
|
||||
{
|
||||
//G4cout << "G4DNAChemistryManager::DeleteInstance" << G4endl;
|
||||
@@ -226,6 +258,8 @@ void G4DNAChemistryManager::DeleteInstance()
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4DNAChemistryManager::Notify(G4ApplicationState requestedState)
|
||||
{
|
||||
if (requestedState == G4State_Quit)
|
||||
@@ -236,7 +270,15 @@ G4bool G4DNAChemistryManager::Notify(G4ApplicationState requestedState)
|
||||
//DeleteInstance();
|
||||
Clear();
|
||||
}
|
||||
|
||||
// else if(requestedState == G4State_EventProc)
|
||||
// Note: From here we can know that a new event is started
|
||||
// But the run and event IDs remain unknown
|
||||
// {
|
||||
// if(fpThreadData->fpPhysChemIO)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
else if(requestedState == G4State_GeomClosed)
|
||||
{
|
||||
fGeometryClosed = true;
|
||||
@@ -250,6 +292,8 @@ G4bool G4DNAChemistryManager::Notify(G4ApplicationState requestedState)
|
||||
return true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::SetNewValue(G4UIcommand* command, G4String value)
|
||||
{
|
||||
if (command == fpActivateChem)
|
||||
@@ -271,7 +315,8 @@ void G4DNAChemistryManager::SetNewValue(G4UIcommand* command, G4String value)
|
||||
}
|
||||
else if(command == fpScaleForNewTemperature)
|
||||
{
|
||||
SetGlobalTemperature(fpScaleForNewTemperature->ConvertToDimensionedDouble(value));
|
||||
SetGlobalTemperature(fpScaleForNewTemperature->
|
||||
ConvertToDimensionedDouble(value));
|
||||
}
|
||||
else if(command == fpInitChem)
|
||||
{
|
||||
@@ -280,6 +325,8 @@ void G4DNAChemistryManager::SetNewValue(G4UIcommand* command, G4String value)
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4String G4DNAChemistryManager::GetCurrentValue(G4UIcommand* command)
|
||||
{
|
||||
if (command == fpActivateChem)
|
||||
@@ -290,6 +337,8 @@ G4String G4DNAChemistryManager::GetCurrentValue(G4UIcommand* command)
|
||||
return "";
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::Run()
|
||||
{
|
||||
if (fActiveChemistry)
|
||||
@@ -304,7 +353,7 @@ void G4DNAChemistryManager::Run()
|
||||
description);
|
||||
}
|
||||
|
||||
if (fpgThreadInitialized_tl == 0)
|
||||
if (fpThreadData->fThreadInitialized_tl == 0)
|
||||
{
|
||||
G4ExceptionDescription description;
|
||||
description << "Thread local components were not initialized.";
|
||||
@@ -322,12 +371,16 @@ void G4DNAChemistryManager::Run()
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::Gun(G4ITGun* gun, bool physicsTableToBuild)
|
||||
{
|
||||
fBuildPhysicsTable = physicsTableToBuild;
|
||||
G4Scheduler::Instance()->SetGun(gun);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::Initialize()
|
||||
{
|
||||
//===========================================================================
|
||||
@@ -340,7 +393,7 @@ void G4DNAChemistryManager::Initialize()
|
||||
//==========================================================================
|
||||
if(G4Threading::IsWorkerThread())
|
||||
{
|
||||
InitializeThread(); // Will create and initialize G4ITScheduler
|
||||
InitializeThread(); // Will create and initialize G4Scheduler
|
||||
return;
|
||||
}
|
||||
//==========================================================================
|
||||
@@ -364,6 +417,8 @@ void G4DNAChemistryManager::Initialize()
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::InitializeMaster()
|
||||
{
|
||||
if (fMasterInitialized == false)
|
||||
@@ -375,7 +430,6 @@ void G4DNAChemistryManager::InitializeMaster()
|
||||
|
||||
G4Scheduler::Instance();
|
||||
// creates a concrete object of the scheduler
|
||||
// and track container
|
||||
|
||||
if (fpUserChemistryList)
|
||||
{
|
||||
@@ -404,9 +458,12 @@ void G4DNAChemistryManager::InitializeMaster()
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::InitializeThread()
|
||||
{
|
||||
if (fpgThreadInitialized_tl == 0 || fForceThreadReinitialization == true)
|
||||
if (fpThreadData->fThreadInitialized_tl == false
|
||||
|| fForceThreadReinitialization == true)
|
||||
{
|
||||
if (fpUserChemistryList)
|
||||
{
|
||||
@@ -447,7 +504,7 @@ void G4DNAChemistryManager::InitializeThread()
|
||||
G4DNAMolecularReactionTable::GetReactionTable());
|
||||
G4Scheduler::Instance()->Initialize();
|
||||
|
||||
fpgThreadInitialized_tl = new G4bool(true);
|
||||
fpThreadData->fThreadInitialized_tl = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -463,55 +520,51 @@ void G4DNAChemistryManager::InitializeThread()
|
||||
InitializeFile();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::InitializeFile()
|
||||
{
|
||||
if (fpgOutput_tl == 0 || fWriteFile == false || fFileInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(fVerbose)
|
||||
{
|
||||
G4cout << "G4DNAChemistryManager::InitializeFile() is called"
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
*fpgOutput_tl << std::setprecision(6) << std::scientific;
|
||||
*fpgOutput_tl << setw(11) << left << "#Parent ID" << setw(10) << "Molecule"
|
||||
<< setw(14) << "Elec Modif" << setw(13) << "Energy (eV)"
|
||||
<< setw(22) << "X pos of parent [nm]" << setw(22)
|
||||
<< "Y pos of parent [nm]" << setw(22) << "Z pos of parent [nm]"
|
||||
<< setw(14) << "X pos [nm]" << setw(14) << "Y pos [nm]"
|
||||
<< setw(14) << "Z pos [nm]" << G4endl<< setw(21) << "#"
|
||||
<< setw(13) << "1)io/ex=0/1"
|
||||
<< G4endl
|
||||
<< setw(21) << "#"
|
||||
<< setw(13) << "2)level=0...5"
|
||||
<< G4endl;
|
||||
|
||||
fFileInitialized = true;
|
||||
|
||||
if(fpThreadData->fpPhysChemIO){
|
||||
fpThreadData->fpPhysChemIO->InitializeFile();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4DNAChemistryManager::IsActivated()
|
||||
{
|
||||
return Instance()->fActiveChemistry;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::Activated(G4bool flag)
|
||||
{
|
||||
Instance()->fActiveChemistry = flag;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4DNAChemistryManager::IsChemistryActivated()
|
||||
{
|
||||
return fActiveChemistry;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::SetChemistryActivation(G4bool flag)
|
||||
{
|
||||
fActiveChemistry = flag;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::WriteInto(const G4String& output,
|
||||
ios_base::openmode mode)
|
||||
{
|
||||
@@ -521,34 +574,35 @@ void G4DNAChemistryManager::WriteInto(const G4String& output,
|
||||
<< output.data() << G4endl;
|
||||
}
|
||||
|
||||
fpgOutput_tl = new std::ofstream();
|
||||
fpgOutput_tl->open(output.data(), mode);
|
||||
fWriteFile = true;
|
||||
fFileInitialized = false;
|
||||
if(fpThreadData->fpPhysChemIO){
|
||||
fpThreadData->fpPhysChemIO->WriteInto(output, mode);
|
||||
}
|
||||
else{
|
||||
fpThreadData->fpPhysChemIO = new G4PhysChemIO::FormattedText();
|
||||
fpThreadData->fpPhysChemIO->WriteInto(output, mode);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::AddEmptyLineInOuputFile()
|
||||
{
|
||||
if (fWriteFile)
|
||||
{
|
||||
*fpgOutput_tl << G4endl;
|
||||
if(fpThreadData->fpPhysChemIO){
|
||||
fpThreadData->fpPhysChemIO->AddEmptyLineInOuputFile();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::CloseFile()
|
||||
{
|
||||
if (fpgOutput_tl == 0) return;
|
||||
|
||||
if (fpgOutput_tl->is_open())
|
||||
{
|
||||
if (fVerbose)
|
||||
{
|
||||
G4cout << "G4DNAChemistryManager: Close File" << G4endl;
|
||||
}
|
||||
fpgOutput_tl->close();
|
||||
if(fpThreadData->fpPhysChemIO){
|
||||
fpThreadData->fpPhysChemIO->CloseFile();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4DNAWaterExcitationStructure*
|
||||
G4DNAChemistryManager::GetExcitationLevel()
|
||||
{
|
||||
@@ -559,6 +613,8 @@ G4DNAChemistryManager::GetExcitationLevel()
|
||||
return fpExcitationLevel;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4DNAWaterIonisationStructure*
|
||||
G4DNAChemistryManager::GetIonisationLevel()
|
||||
{
|
||||
@@ -569,14 +625,14 @@ G4DNAChemistryManager::GetIonisationLevel()
|
||||
return fpIonisationLevel;
|
||||
}
|
||||
|
||||
void G4DNAChemistryManager::CreateWaterMolecule(ElectronicModification modification,
|
||||
G4int electronicLevel,
|
||||
const G4Track* theIncomingTrack)
|
||||
{
|
||||
if (fWriteFile)
|
||||
{
|
||||
if(!fFileInitialized) InitializeFile();
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void
|
||||
G4DNAChemistryManager::CreateWaterMolecule(ElectronicModification modification,
|
||||
G4int electronicLevel,
|
||||
const G4Track* theIncomingTrack)
|
||||
{
|
||||
if(fpThreadData->fpPhysChemIO){
|
||||
G4double energy = -1.;
|
||||
|
||||
switch (modification)
|
||||
@@ -591,19 +647,11 @@ void G4DNAChemistryManager::CreateWaterMolecule(ElectronicModification modificat
|
||||
energy = GetIonisationLevel()->IonisationEnergy(electronicLevel);
|
||||
break;
|
||||
}
|
||||
|
||||
*fpgOutput_tl << setw(11) << left << theIncomingTrack->GetTrackID()
|
||||
<< setw(10) << "H2O" << left << modification << internal
|
||||
<< ":" << right << electronicLevel << left << setw(11) << ""
|
||||
<< std::setprecision(2) << std::fixed << setw(13)
|
||||
<< energy / eV << std::setprecision(6) << std::scientific
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().x()) / nanometer
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().y()) / nanometer
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().z()) / nanometer
|
||||
<< G4endl;
|
||||
|
||||
fpThreadData->fpPhysChemIO->CreateWaterMolecule(modification,
|
||||
4-electronicLevel,
|
||||
energy,
|
||||
theIncomingTrack);
|
||||
}
|
||||
|
||||
if(fActiveChemistry)
|
||||
@@ -631,37 +679,18 @@ void G4DNAChemistryManager::CreateWaterMolecule(ElectronicModification modificat
|
||||
H2OTrack -> SetKineticEnergy(0.);
|
||||
G4VITTrackHolder::Instance()->Push(H2OTrack);
|
||||
}
|
||||
// else
|
||||
// abort();
|
||||
}
|
||||
|
||||
void G4DNAChemistryManager::CreateSolvatedElectron(const G4Track* theIncomingTrack,
|
||||
G4ThreeVector* finalPosition)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void
|
||||
G4DNAChemistryManager::CreateSolvatedElectron(const G4Track* theIncomingTrack,
|
||||
G4ThreeVector* finalPosition)
|
||||
// finalPosition is a pointer because this argument is optional
|
||||
{
|
||||
if (fWriteFile)
|
||||
{
|
||||
if(!fFileInitialized) InitializeFile();
|
||||
|
||||
*fpgOutput_tl << setw(11) << theIncomingTrack->GetTrackID() << setw(10)
|
||||
<< "e_aq" << setw(14) << -1 << std::setprecision(2)
|
||||
<< std::fixed << setw(13)
|
||||
<< theIncomingTrack->GetKineticEnergy() / eV
|
||||
<< std::setprecision(6) << std::scientific << setw(22)
|
||||
<< (theIncomingTrack->GetPosition().x()) / nanometer
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().y()) / nanometer
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().z()) / nanometer;
|
||||
|
||||
if (finalPosition != 0)
|
||||
{
|
||||
*fpgOutput_tl << setw(14) << (finalPosition->x()) / nanometer << setw(14)
|
||||
<< (finalPosition->y()) / nanometer << setw(14)
|
||||
<< (finalPosition->z()) / nanometer;
|
||||
}
|
||||
|
||||
*fpgOutput_tl << G4endl;
|
||||
if(fpThreadData->fpPhysChemIO){
|
||||
fpThreadData->fpPhysChemIO->CreateSolvatedElectron(theIncomingTrack,
|
||||
finalPosition);
|
||||
}
|
||||
|
||||
if(fActiveChemistry)
|
||||
@@ -682,24 +711,15 @@ void G4DNAChemistryManager::CreateSolvatedElectron(const G4Track* theIncomingTra
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::PushMolecule(G4Molecule*& molecule,
|
||||
double time,
|
||||
const G4ThreeVector& position,
|
||||
int parentID)
|
||||
{
|
||||
if (fWriteFile)
|
||||
{
|
||||
if(!fFileInitialized) InitializeFile();
|
||||
|
||||
*fpgOutput_tl << setw(11) << parentID << setw(10) << molecule->GetName()
|
||||
<< setw(14) << -1 << std::setprecision(2) << std::fixed
|
||||
<< setw(13) << -1 << std::setprecision(6) << std::scientific
|
||||
<< setw(22) << (position.x()) / nanometer << setw(22)
|
||||
<< (position.y()) / nanometer << setw(22)
|
||||
<< (position.z()) / nanometer;
|
||||
*fpgOutput_tl << G4endl;
|
||||
}
|
||||
|
||||
// TODO: PhysChemIO - method unused in the released code
|
||||
|
||||
if(fActiveChemistry)
|
||||
{
|
||||
G4Track* track = molecule->BuildTrack(time,position);
|
||||
@@ -714,25 +734,14 @@ void G4DNAChemistryManager::PushMolecule(G4Molecule*& molecule,
|
||||
}
|
||||
}
|
||||
|
||||
void G4DNAChemistryManager::PushMoleculeAtParentTimeAndPlace(G4Molecule*& molecule,
|
||||
const G4Track* theIncomingTrack)
|
||||
{
|
||||
if (fWriteFile)
|
||||
{
|
||||
if(!fFileInitialized) InitializeFile();
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
*fpgOutput_tl << setw(11) << theIncomingTrack->GetTrackID() << setw(10)
|
||||
<< molecule->GetName() << setw(14) << -1
|
||||
<< std::setprecision(2) << std::fixed << setw(13)
|
||||
<< theIncomingTrack->GetKineticEnergy() / eV
|
||||
<< std::setprecision(6) << std::scientific << setw(22)
|
||||
<< (theIncomingTrack->GetPosition().x()) / nanometer
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().y()) / nanometer
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().z()) / nanometer;
|
||||
*fpgOutput_tl << G4endl;
|
||||
}
|
||||
|
||||
void G4DNAChemistryManager::
|
||||
PushMoleculeAtParentTimeAndPlace(G4Molecule*& molecule,
|
||||
const G4Track* theIncomingTrack)
|
||||
{
|
||||
// TODO: PhysChemIO - method unused in the released code
|
||||
|
||||
if(fActiveChemistry)
|
||||
{
|
||||
@@ -749,9 +758,12 @@ void G4DNAChemistryManager::PushMoleculeAtParentTimeAndPlace(G4Molecule*& molecu
|
||||
}
|
||||
}
|
||||
|
||||
void G4DNAChemistryManager::SetGlobalTemperature(double temp_K)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4DNAChemistryManager::SetGlobalTemperature(G4double temp_K)
|
||||
{
|
||||
G4MolecularConfiguration::SetGlobalTemperature(temp_K);
|
||||
G4DNAMolecularReactionTable::Instance()->ScaleReactionRateForNewTemperature(temp_K);
|
||||
G4DNAMolecularReactionTable::Instance()->
|
||||
ScaleReactionRateForNewTemperature(temp_K);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
|
||||
// $Id: G4DNACrossSectionDataSet.cc 70171 2013-05-24 13:34:18Z gcosmo $
|
||||
// $Id: G4DNACrossSectionDataSet.cc 104122 2017-05-11 13:50:22Z gcosmo $
|
||||
//
|
||||
// Author: Riccardo Capra <capra@ge.infn.it>
|
||||
// Code review by MGP October 2007: removed inheritance from concrete class
|
||||
@@ -160,31 +160,23 @@ G4bool G4DNACrossSectionDataSet::LoadData(const G4String & argFileName)
|
||||
comment=false;
|
||||
space=true;
|
||||
break;
|
||||
|
||||
|
||||
case '#':
|
||||
comment=true;
|
||||
break;
|
||||
|
||||
case '\t':
|
||||
c=' ';
|
||||
case ' ':
|
||||
if (space)
|
||||
break;
|
||||
space = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (comment)
|
||||
break;
|
||||
|
||||
if (c==' ')
|
||||
space=true;
|
||||
else
|
||||
{
|
||||
if (space && (!first))
|
||||
(*stream) << ' ';
|
||||
|
||||
first=false;
|
||||
(*stream) << c;
|
||||
space=false;
|
||||
}
|
||||
if (comment) { break; }
|
||||
if (space && (!first)) { (*stream) << ' '; }
|
||||
|
||||
first=false;
|
||||
(*stream) << c;
|
||||
space=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -318,31 +310,23 @@ G4bool G4DNACrossSectionDataSet::LoadNonLogData(const G4String & argFileName)
|
||||
comment=false;
|
||||
space=true;
|
||||
break;
|
||||
|
||||
|
||||
case '#':
|
||||
comment=true;
|
||||
break;
|
||||
|
||||
case '\t':
|
||||
c=' ';
|
||||
case ' ':
|
||||
if (space)
|
||||
break;
|
||||
space = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (comment)
|
||||
break;
|
||||
|
||||
if (c==' ')
|
||||
space=true;
|
||||
else
|
||||
{
|
||||
if (space && (!first))
|
||||
(*stream) << ' ';
|
||||
|
||||
first=false;
|
||||
(*stream) << c;
|
||||
space=false;
|
||||
}
|
||||
if (comment) { break; }
|
||||
if (space && (!first)) { (*stream) << ' '; }
|
||||
|
||||
first=false;
|
||||
(*stream) << c;
|
||||
space=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DNAMolecularMaterial.cc 101354 2016-11-15 08:27:51Z gcosmo $
|
||||
// $Id: G4DNAMolecularMaterial.cc 103042 2017-03-10 11:50:07Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros
|
||||
//
|
||||
|
||||
#include "G4DNAMolecularMaterial.hh"
|
||||
#include "G4Material.hh"
|
||||
#include <utility>
|
||||
@@ -323,6 +324,7 @@ G4DNAMolecularMaterial::RecordMolecularMaterial(G4Material* parentMaterial,
|
||||
}
|
||||
else{
|
||||
matComponent[molecularMaterial] = it->second + fraction;
|
||||
// handle "base material"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,30 +334,27 @@ void G4DNAMolecularMaterial::SearchMolecularMaterial(G4Material* parentMaterial,
|
||||
G4Material* material,
|
||||
double currentFraction)
|
||||
{
|
||||
if (material->GetMassOfMolecule() != 0.0){
|
||||
if (material->GetMassOfMolecule() != 0.0){ // is a molecular material
|
||||
RecordMolecularMaterial(parentMaterial, material, currentFraction);
|
||||
return;
|
||||
}
|
||||
|
||||
G4Material* compMat(0);
|
||||
G4double fraction = -1;
|
||||
G4Material* compMat(nullptr);
|
||||
G4double fraction = -1.;
|
||||
std::map<G4Material*, G4double> matComponent = material->GetMatComponents();
|
||||
std::map<G4Material*, G4double>::iterator it = matComponent.begin();
|
||||
|
||||
for (; it != matComponent.end(); it++){
|
||||
compMat = it->first;
|
||||
fraction = it->second;
|
||||
if (compMat->GetMassOfMolecule() == 0.0){
|
||||
if (compMat->GetMassOfMolecule() == 0.0){ // is not a molecular material
|
||||
SearchMolecularMaterial(parentMaterial, compMat,
|
||||
currentFraction * fraction);
|
||||
}
|
||||
else{
|
||||
else{ // is a molecular material
|
||||
RecordMolecularMaterial(parentMaterial, compMat,
|
||||
currentFraction * fraction);
|
||||
}
|
||||
|
||||
//compMat = 0;
|
||||
//fraction = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,7 +437,7 @@ const std::vector<double>* G4DNAMolecularMaterial::GetNumMolPerVolTableFor(
|
||||
const G4Material* lookForMaterial) const
|
||||
{
|
||||
if(lookForMaterial==0) return nullptr;
|
||||
|
||||
|
||||
if (!fpCompNumMolPerVolTable){
|
||||
if (fIsInitialized){
|
||||
G4ExceptionDescription exceptionDescription;
|
||||
@@ -581,7 +580,7 @@ G4DNAMolecularMaterial::SetMolecularConfiguration(const G4String& materialName,
|
||||
const G4String& molUserID)
|
||||
{
|
||||
G4Material* material = G4Material::GetMaterial(materialName);
|
||||
|
||||
|
||||
if(material == 0){
|
||||
G4cout<< "Material " << materialName
|
||||
<< " was not found and therefore won't be linked to "
|
||||
@@ -590,3 +589,33 @@ G4DNAMolecularMaterial::SetMolecularConfiguration(const G4String& materialName,
|
||||
}
|
||||
SetMolecularConfiguration(material, molUserID);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4double
|
||||
G4DNAMolecularMaterial::
|
||||
GetNumMoleculePerVolumeUnitForMaterial(const G4Material*)
|
||||
{
|
||||
G4Exception("G4DNAMolecularMaterial::GetNumMolPerVolForComponentInComposite",
|
||||
"DEPRECATED",
|
||||
FatalException,"Use standard method: GetNumMolPerVolTableFor"
|
||||
" at the run initialization to retrieve a read-only table used"
|
||||
" during stepping. The method is thread-safe.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4double
|
||||
G4DNAMolecularMaterial::
|
||||
GetNumMolPerVolForComponentInComposite(const G4Material*,
|
||||
const G4Material*,
|
||||
G4double)
|
||||
{
|
||||
G4Exception("G4DNAMolecularMaterial::GetNumMolPerVolForComponentInComposite",
|
||||
"DEPRECATED",
|
||||
FatalException,"Use standard method: GetNumMolPerVolTableFor"
|
||||
" at the run initialization to retrieve a read-only table used"
|
||||
" during stepping. The method is thread-safe.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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)
|
||||
|
||||
#include "G4DNAPTBIonisationStructure.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
G4DNAPTBIonisationStructure::G4DNAPTBIonisationStructure()
|
||||
{
|
||||
energyConstant["G4_WATER"].push_back(10.79*eV);
|
||||
energyConstant["G4_WATER"].push_back(13.39*eV);
|
||||
energyConstant["G4_WATER"].push_back(16.05*eV);
|
||||
energyConstant["G4_WATER"].push_back(32.30*eV);
|
||||
energyConstant["G4_WATER"].push_back(539.0*eV);
|
||||
|
||||
energyConstant["THF"].push_back(9.74*eV);
|
||||
energyConstant["THF"].push_back(12.31*eV);
|
||||
energyConstant["THF"].push_back(12.99*eV);
|
||||
energyConstant["THF"].push_back(13.57*eV);
|
||||
energyConstant["THF"].push_back(13.60*eV);
|
||||
energyConstant["THF"].push_back(15.11*eV);
|
||||
energyConstant["THF"].push_back(15.97*eV);
|
||||
energyConstant["THF"].push_back(16.28*eV);
|
||||
energyConstant["THF"].push_back(18.19*eV);
|
||||
energyConstant["THF"].push_back(18.69*eV);
|
||||
energyConstant["THF"].push_back(22.14*eV);
|
||||
energyConstant["THF"].push_back(22.25*eV);
|
||||
energyConstant["THF"].push_back(27.21*eV);
|
||||
energyConstant["THF"].push_back(28.97*eV);
|
||||
energyConstant["THF"].push_back(36.97*eV);
|
||||
energyConstant["THF"].push_back(305.07*eV);
|
||||
energyConstant["THF"].push_back(305.08*eV);
|
||||
energyConstant["THF"].push_back(306.17*eV);
|
||||
energyConstant["THF"].push_back(306.17*eV);
|
||||
energyConstant["THF"].push_back(557.94*eV);
|
||||
|
||||
energyConstant["PY"].push_back(9.73*eV);
|
||||
energyConstant["PY"].push_back(10.96*eV);
|
||||
energyConstant["PY"].push_back(11.54*eV);
|
||||
energyConstant["PY"].push_back(12.58*eV);
|
||||
energyConstant["PY"].push_back(15.96*eV);
|
||||
energyConstant["PY"].push_back(16.27*eV);
|
||||
energyConstant["PY"].push_back(16.53*eV);
|
||||
energyConstant["PY"].push_back(17.98*eV);
|
||||
energyConstant["PY"].push_back(19.37*eV);
|
||||
energyConstant["PY"].push_back(20.52*eV);
|
||||
energyConstant["PY"].push_back(24.55*eV);
|
||||
energyConstant["PY"].push_back(24.64*eV);
|
||||
energyConstant["PY"].push_back(29.75*eV);
|
||||
energyConstant["PY"].push_back(33.02*eV);
|
||||
energyConstant["PY"].push_back(36.57*eV);
|
||||
energyConstant["PY"].push_back(305.92*eV);
|
||||
energyConstant["PY"].push_back(307.09*eV);
|
||||
energyConstant["PY"].push_back(307.09*eV);
|
||||
energyConstant["PY"].push_back(307.52*eV);
|
||||
energyConstant["PY"].push_back(423.44*eV);
|
||||
energyConstant["PY"].push_back(423.44*eV);
|
||||
|
||||
energyConstant["PU"].push_back(9.58*eV);
|
||||
energyConstant["PU"].push_back(10.57*eV);
|
||||
energyConstant["PU"].push_back(10.97*eV);
|
||||
energyConstant["PU"].push_back(12.22*eV);
|
||||
energyConstant["PU"].push_back(12.92*eV);
|
||||
energyConstant["PU"].push_back(13.44*eV);
|
||||
energyConstant["PU"].push_back(15.05*eV);
|
||||
energyConstant["PU"].push_back(16.56*eV);
|
||||
energyConstant["PU"].push_back(17.18*eV);
|
||||
energyConstant["PU"].push_back(17.88*eV);
|
||||
energyConstant["PU"].push_back(17.90*eV);
|
||||
energyConstant["PU"].push_back(19.11*eV);
|
||||
energyConstant["PU"].push_back(20.09*eV);
|
||||
energyConstant["PU"].push_back(21.70*eV);
|
||||
energyConstant["PU"].push_back(23.52*eV);
|
||||
energyConstant["PU"].push_back(24.35*eV);
|
||||
energyConstant["PU"].push_back(25.41*eV);
|
||||
energyConstant["PU"].push_back(29.34*eV);
|
||||
energyConstant["PU"].push_back(32.44*eV);
|
||||
energyConstant["PU"].push_back(33.67*eV);
|
||||
energyConstant["PU"].push_back(36.26*eV);
|
||||
energyConstant["PU"].push_back(38.22*eV);
|
||||
energyConstant["PU"].push_back(306.53*eV);
|
||||
energyConstant["PU"].push_back(307.19*eV);
|
||||
energyConstant["PU"].push_back(307.64*eV);
|
||||
energyConstant["PU"].push_back(308.14*eV);
|
||||
energyConstant["PU"].push_back(308.17*eV);
|
||||
energyConstant["PU"].push_back(423.31*eV);
|
||||
energyConstant["PU"].push_back(423.43*eV);
|
||||
energyConstant["PU"].push_back(423.64*eV);
|
||||
energyConstant["PU"].push_back(423.98*eV);
|
||||
|
||||
energyConstant["TMP"].push_back(10.81*eV);
|
||||
energyConstant["TMP"].push_back(10.81*eV);
|
||||
energyConstant["TMP"].push_back(12.90*eV);
|
||||
energyConstant["TMP"].push_back(13.32*eV);
|
||||
energyConstant["TMP"].push_back(13.32*eV);
|
||||
energyConstant["TMP"].push_back(13.59*eV);
|
||||
energyConstant["TMP"].push_back(14.33*eV);
|
||||
energyConstant["TMP"].push_back(14.33*eV);
|
||||
energyConstant["TMP"].push_back(15.90*eV);
|
||||
energyConstant["TMP"].push_back(17.09*eV);
|
||||
energyConstant["TMP"].push_back(17.09*eV);
|
||||
energyConstant["TMP"].push_back(17.13*eV);
|
||||
energyConstant["TMP"].push_back(17.85*eV);
|
||||
energyConstant["TMP"].push_back(17.85*eV);
|
||||
energyConstant["TMP"].push_back(18.44*eV);
|
||||
energyConstant["TMP"].push_back(19.37*eV);
|
||||
energyConstant["TMP"].push_back(19.37*eV);
|
||||
energyConstant["TMP"].push_back(21.40*eV);
|
||||
energyConstant["TMP"].push_back(26.20*eV);
|
||||
energyConstant["TMP"].push_back(26.20*eV);
|
||||
energyConstant["TMP"].push_back(27.43*eV);
|
||||
energyConstant["TMP"].push_back(35.23*eV);
|
||||
energyConstant["TMP"].push_back(37.67*eV);
|
||||
energyConstant["TMP"].push_back(37.67*eV);
|
||||
energyConstant["TMP"].push_back(39.64*eV);
|
||||
energyConstant["TMP"].push_back(152.42*eV);
|
||||
energyConstant["TMP"].push_back(152.42*eV);
|
||||
energyConstant["TMP"].push_back(152.44*eV);
|
||||
energyConstant["TMP"].push_back(209.59*eV);
|
||||
energyConstant["TMP"].push_back(306.92*eV);
|
||||
energyConstant["TMP"].push_back(306.92*eV);
|
||||
energyConstant["TMP"].push_back(306.92*eV);
|
||||
energyConstant["TMP"].push_back(557.34*eV);
|
||||
energyConstant["TMP"].push_back(559.40*eV);
|
||||
energyConstant["TMP"].push_back(559.40*eV);
|
||||
energyConstant["TMP"].push_back(559.41*eV);
|
||||
energyConstant["TMP"].push_back(2178.05*eV);
|
||||
|
||||
std::map<G4String, std::vector<G4double> >::iterator it;
|
||||
for(it=energyConstant.begin();it!=energyConstant.end();it++)
|
||||
{
|
||||
nLevels[it->first] = (it->second).size();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
G4DNAPTBIonisationStructure::~G4DNAPTBIonisationStructure()
|
||||
{ }
|
||||
|
||||
|
||||
G4double G4DNAPTBIonisationStructure::IonisationEnergy(G4int level, const G4String& materialName)
|
||||
{
|
||||
G4String matNameModif = ReplaceMaterial(materialName);
|
||||
|
||||
// check if the material exist in the map
|
||||
if(energyConstant.find(matNameModif)==energyConstant.end())
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Material name was not found in energyConstantMap. Problematic material is: "<<matNameModif;
|
||||
G4Exception("G4DNAPTBIonisationStructure::IonisationEnergy","em0002",
|
||||
FatalException, oss.str().c_str());
|
||||
}
|
||||
|
||||
G4double ionisation = 0.;
|
||||
|
||||
if (level >=0 && level < nLevels[matNameModif]) ionisation = energyConstant[matNameModif][level];
|
||||
|
||||
return ionisation;
|
||||
}
|
||||
|
||||
G4int G4DNAPTBIonisationStructure::NumberOfLevels(const G4String& materialName)
|
||||
{
|
||||
G4String matNameModif = ReplaceMaterial(materialName);
|
||||
|
||||
// check if the material exist in the map
|
||||
if(nLevels.find(matNameModif)==nLevels.end())
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << "Material name was not found in energyConstantMap. Problematic material is: "<<matNameModif;
|
||||
G4Exception("G4DNAPTBIonisationStructure::NumberOfLevels","em0002",
|
||||
FatalException, oss.str().c_str());
|
||||
}
|
||||
|
||||
return nLevels[matNameModif];
|
||||
}
|
||||
|
||||
G4String G4DNAPTBIonisationStructure::ReplaceMaterial(const G4String& materialName)
|
||||
{
|
||||
G4String materialNameModified (materialName);
|
||||
|
||||
if(materialName=="backbone_THF") materialNameModified = "THF";
|
||||
else if(materialName=="backbone_TMP") materialNameModified = "TMP";
|
||||
else if(materialName=="adenine_PU") materialNameModified = "PU";
|
||||
else if(materialName=="guanine_PU") materialNameModified = "PU";
|
||||
else if(materialName=="thymine_PY") materialNameModified = "PY";
|
||||
else if(materialName=="cytosine_PY") materialNameModified = "PY";
|
||||
|
||||
return materialNameModified;
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
/*
|
||||
* G4PhysChemIO.cc
|
||||
*
|
||||
* Created on: 3 févr. 2017
|
||||
* Author: matkara
|
||||
*/
|
||||
|
||||
#include "G4PhysChemIO.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4VAnalysisManager.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace G4PhysChemIO{
|
||||
|
||||
FormattedText::FormattedText(){
|
||||
fRunID = -1;
|
||||
fEventID = -1;
|
||||
fFileInitialized = false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
FormattedText::~FormattedText(){
|
||||
CloseFile();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void FormattedText::InitializeFile()
|
||||
{
|
||||
if(fFileInitialized) return;
|
||||
|
||||
fOfstream << std::setprecision(6) << std::scientific;
|
||||
fOfstream << setw(11) << left << "#Parent ID" << setw(10) << "Molecule"
|
||||
<< setw(14) << "Elec Modif" << setw(13) << "Energy (eV)"
|
||||
<< setw(22) << "X pos of parent [nm]" << setw(22)
|
||||
<< "Y pos of parent [nm]" << setw(22) << "Z pos of parent [nm]"
|
||||
<< setw(14) << "X pos [nm]" << setw(14) << "Y pos [nm]"
|
||||
<< setw(14) << "Z pos [nm]" << G4endl<< setw(21) << "#"
|
||||
<< setw(13) << "1)io/ex=0/1"
|
||||
<< G4endl
|
||||
<< setw(21) << "#"
|
||||
<< setw(13) << "2)level=0...5"
|
||||
<< G4endl;
|
||||
|
||||
fFileInitialized = true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void FormattedText::WriteInto(const G4String& output,
|
||||
ios_base::openmode mode)
|
||||
{
|
||||
fOfstream.open(output.data(), mode);
|
||||
fFileInitialized = false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void FormattedText::AddEmptyLineInOuputFile()
|
||||
{
|
||||
if(fFileInitialized) fOfstream << G4endl;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void FormattedText::CloseFile()
|
||||
{
|
||||
if (fFileInitialized == false) return;
|
||||
|
||||
if (fOfstream.is_open())
|
||||
{
|
||||
fOfstream.close();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void FormattedText::CreateWaterMolecule(G4int modification,
|
||||
G4int electronicLevel,
|
||||
G4double energy,
|
||||
const G4Track* theIncomingTrack)
|
||||
{
|
||||
if(!fFileInitialized) InitializeFile();
|
||||
|
||||
fOfstream << setw(11) << left << theIncomingTrack->GetTrackID()
|
||||
<< setw(10) << "H2O" << left << modification << internal
|
||||
<< ":" << right << electronicLevel << left << setw(11) << ""
|
||||
<< std::setprecision(2) << std::fixed << setw(13)
|
||||
<< energy / eV << std::setprecision(6) << std::scientific
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().x()) / nanometer
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().y()) / nanometer
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().z()) / nanometer
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void FormattedText::CreateSolvatedElectron(const G4Track* theIncomingTrack,
|
||||
G4ThreeVector* finalPosition)
|
||||
{
|
||||
if(!fFileInitialized) InitializeFile();
|
||||
|
||||
fOfstream << setw(11) << theIncomingTrack->GetTrackID() << setw(10)
|
||||
<< "e_aq" << setw(14) << -1 << std::setprecision(2)
|
||||
<< std::fixed << setw(13)
|
||||
<< theIncomingTrack->GetKineticEnergy() / eV
|
||||
<< std::setprecision(6) << std::scientific << setw(22)
|
||||
<< (theIncomingTrack->GetPosition().x()) / nanometer
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().y()) / nanometer
|
||||
<< setw(22)
|
||||
<< (theIncomingTrack->GetPosition().z()) / nanometer;
|
||||
|
||||
if (finalPosition != 0)
|
||||
{
|
||||
fOfstream << setw(14) << (finalPosition->x()) / nanometer << setw(14)
|
||||
<< (finalPosition->y()) / nanometer << setw(14)
|
||||
<< (finalPosition->z()) / nanometer;
|
||||
}
|
||||
|
||||
fOfstream << G4endl;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// Using G4analysis
|
||||
//
|
||||
|
||||
G4Analysis::G4Analysis(G4VAnalysisManager* analysisManager):
|
||||
fpAnalysisManager(analysisManager)
|
||||
{
|
||||
fFileInitialized = false;
|
||||
fNtupleID = -1;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4Analysis::~G4Analysis()
|
||||
{
|
||||
fpAnalysisManager = 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4Analysis::InitializeFile()
|
||||
{
|
||||
if (fFileInitialized) return;
|
||||
|
||||
fNtupleID = fpAnalysisManager->CreateNtuple("PhysChem","PhysChem");
|
||||
fpAnalysisManager->CreateNtupleIColumn(fNtupleID, "ParentID");
|
||||
fpAnalysisManager->CreateNtupleSColumn(fNtupleID, "Molecule");
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// valid for H2O only
|
||||
fpAnalysisManager->CreateNtupleIColumn(fNtupleID, "ElectronicModif");
|
||||
// ionization = 0 / excitation = 1 / diss att = 2
|
||||
fpAnalysisManager->CreateNtupleIColumn(fNtupleID, "level");
|
||||
// valid for ion and exc only
|
||||
fpAnalysisManager->CreateNtupleDColumn(fNtupleID, "Energy_eV");
|
||||
// valid for ion and exc only
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
fpAnalysisManager->CreateNtupleDColumn(fNtupleID, "x_parent_nm");
|
||||
fpAnalysisManager->CreateNtupleDColumn(fNtupleID, "y_parent_nm");
|
||||
fpAnalysisManager->CreateNtupleDColumn(fNtupleID, "z_parent_nm");
|
||||
fpAnalysisManager->CreateNtupleDColumn(fNtupleID, "x_nm");
|
||||
fpAnalysisManager->CreateNtupleDColumn(fNtupleID, "y_nm");
|
||||
fpAnalysisManager->CreateNtupleDColumn(fNtupleID, "z_nm");
|
||||
fpAnalysisManager->FinishNtuple(fNtupleID);
|
||||
|
||||
fFileInitialized = true;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4Analysis::WriteInto(const G4String& output,
|
||||
ios_base::openmode)
|
||||
{
|
||||
fpAnalysisManager->OpenFile(output);
|
||||
fFileInitialized = false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4Analysis::CloseFile()
|
||||
{
|
||||
// fpAnalysisManager->Write();
|
||||
// fpAnalysisManager->CloseFile();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4Analysis::CreateWaterMolecule(G4int modification,
|
||||
G4int electronicLevel,
|
||||
G4double energy,
|
||||
const G4Track* theIncomingTrack)
|
||||
{
|
||||
if(!fFileInitialized) InitializeFile();
|
||||
|
||||
// parent ID
|
||||
fpAnalysisManager->FillNtupleIColumn(fNtupleID, 0,
|
||||
theIncomingTrack->GetTrackID());
|
||||
|
||||
// molecule type
|
||||
fpAnalysisManager->FillNtupleSColumn(fNtupleID, 1, "H2O");
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// valid for H2O only
|
||||
|
||||
// electronic modif
|
||||
fpAnalysisManager->FillNtupleIColumn(fNtupleID, 2, modification);
|
||||
// ionization = 0 / excitation = 1 / diss att = 2
|
||||
fpAnalysisManager->FillNtupleIColumn(fNtupleID, 3, electronicLevel);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID, 4, energy / eV);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const G4ThreeVector& parentPos = theIncomingTrack->GetPosition();
|
||||
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,5,(parentPos.x())/nanometer);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,6,(parentPos.y())/nanometer);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,7,(parentPos.z())/nanometer);
|
||||
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,8,(parentPos.x())/nanometer);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,9,(parentPos.y())/nanometer);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,10,(parentPos.z())/nanometer);
|
||||
fpAnalysisManager->AddNtupleRow(fNtupleID);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void G4Analysis::CreateSolvatedElectron(const G4Track* electronTrack,
|
||||
G4ThreeVector* finalPosition)
|
||||
{
|
||||
if(!fFileInitialized) InitializeFile();
|
||||
|
||||
// parent ID
|
||||
fpAnalysisManager->FillNtupleIColumn(fNtupleID, 0,
|
||||
electronTrack->GetTrackID());
|
||||
|
||||
// molecule type
|
||||
fpAnalysisManager->FillNtupleSColumn(fNtupleID, 1, "e_aq");
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// valid for H2O only
|
||||
|
||||
// electronic modif
|
||||
fpAnalysisManager->FillNtupleIColumn(fNtupleID, 2, -1); // electronic modif
|
||||
fpAnalysisManager->FillNtupleIColumn(fNtupleID, 3, -1); // electronic level
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID, 4,
|
||||
electronTrack->GetKineticEnergy() / eV);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const G4ThreeVector& parentPos = electronTrack->GetPosition();
|
||||
const double i_nm = 1./nanometer;
|
||||
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,5, parentPos.x() *i_nm);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,6, parentPos.y() *i_nm);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,7, parentPos.z() *i_nm);
|
||||
|
||||
if (finalPosition != 0)
|
||||
{
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,8, finalPosition->x()*i_nm);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,9, finalPosition->y()*i_nm);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,10, finalPosition->z()*i_nm);
|
||||
}
|
||||
else
|
||||
{
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,8, parentPos.x() *i_nm);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,9, parentPos.y() *i_nm);
|
||||
fpAnalysisManager->FillNtupleDColumn(fNtupleID,10, parentPos.z() *i_nm);
|
||||
}
|
||||
|
||||
fpAnalysisManager->AddNtupleRow(fNtupleID);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* G4VPhysChemIO.cc
|
||||
*
|
||||
* Created on: 3 févr. 2017
|
||||
* Author: matkara
|
||||
*/
|
||||
|
||||
#include "G4VPhysChemIO.hh"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4VPhysChemIO::G4VPhysChemIO()
|
||||
{
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4VPhysChemIO::~G4VPhysChemIO()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user