Import Geant4 10.6.0.beta source tree
This commit is contained in:
@@ -44,8 +44,7 @@
|
||||
// J. Comput. Phys. 274 (2014) 841-882
|
||||
// Prog. Nucl. Sci. Tec. 2 (2011) 503-508
|
||||
|
||||
#ifndef G4DNACHEMISTRYMANAGER_HH
|
||||
#define G4DNACHEMISTRYMANAGER_HH
|
||||
#pragma once
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
@@ -62,14 +61,15 @@ class G4VUserChemistryList;
|
||||
class G4UIcmdWithABool;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4ITGun;
|
||||
class G4VPhysChemIO;
|
||||
|
||||
enum ElectronicModification
|
||||
{
|
||||
eIonizedMolecule,
|
||||
eExcitedMolecule,
|
||||
eDissociativeAttachment
|
||||
eIonizedMolecule,
|
||||
eExcitedMolecule,
|
||||
eDissociativeAttachment
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -84,217 +84,172 @@ enum ElectronicModification
|
||||
* The user can also ask to create a file containing a information about the
|
||||
* creation of water molecules and solvated electrons.
|
||||
*/
|
||||
|
||||
class G4DNAChemistryManager: public G4UImessenger,
|
||||
public G4VStateDependent
|
||||
{
|
||||
protected:
|
||||
virtual ~G4DNAChemistryManager();
|
||||
~G4DNAChemistryManager() override;
|
||||
|
||||
public:
|
||||
//============================================================================
|
||||
// STATIC METHODS
|
||||
//============================================================================
|
||||
static G4DNAChemistryManager* Instance();
|
||||
static G4DNAChemistryManager* GetInstanceIfExists();
|
||||
//============================================================================
|
||||
// STATIC METHODS
|
||||
//============================================================================
|
||||
static G4DNAChemistryManager* Instance();
|
||||
static G4DNAChemistryManager* GetInstanceIfExists();
|
||||
|
||||
/**
|
||||
* You should rather use DeleteInstance than the destructor of this class
|
||||
*/
|
||||
static void DeleteInstance();
|
||||
G4bool IsChemistryActivated();
|
||||
void SetChemistryActivation(G4bool);
|
||||
static G4bool IsActivated();
|
||||
static void Activated(G4bool flag = true);
|
||||
static void DeleteInstance();
|
||||
static G4bool IsActivated();
|
||||
|
||||
//============================================================================
|
||||
// VIRTUAL METHODS
|
||||
//============================================================================
|
||||
virtual G4bool Notify(G4ApplicationState requestedState);
|
||||
virtual void SetNewValue(G4UIcommand*, G4String);
|
||||
virtual G4String GetCurrentValue(G4UIcommand * command);
|
||||
//============================================================================
|
||||
// VIRTUAL METHODS
|
||||
//============================================================================
|
||||
// G4VStateDependent
|
||||
G4bool Notify(G4ApplicationState requestedState) override;
|
||||
// G4UImessenger
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
G4String GetCurrentValue(G4UIcommand* pCommand) override;
|
||||
|
||||
//============================================================================
|
||||
// INITIALIZATION AND FINALIZATION METHODS
|
||||
//============================================================================
|
||||
void Initialize();
|
||||
inline void SetChemistryList(G4VUserChemistryList*);
|
||||
inline void Deregister(G4VUserChemistryList*);
|
||||
void SetGlobalTemperature(G4double temp_K);
|
||||
//============================================================================
|
||||
// INITIALIZATION AND FINALIZATION METHODS
|
||||
//============================================================================
|
||||
G4bool IsChemistryActivated();
|
||||
void SetChemistryActivation(G4bool);
|
||||
|
||||
inline void ForceMasterReinitialization();
|
||||
inline void TagThreadForReinitialization();
|
||||
/** Chemistry list is managed outside the chemistry manager (eg. constructor). */
|
||||
void SetChemistryList(G4VUserChemistryList&);
|
||||
|
||||
void Run();
|
||||
void Clear();
|
||||
void Gun(G4ITGun*, bool physicsTableToBuild = true);
|
||||
inline void ForceThreadReinitialization();
|
||||
inline void ForceRebuildingPhysicsTable();
|
||||
/** Not a constructor or when used in standalone? Prefer this method. */
|
||||
void SetChemistryList(std::unique_ptr<G4VUserChemistryList>);
|
||||
|
||||
//============================================================================
|
||||
// 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
|
||||
*/
|
||||
void WriteInto(const G4String&, std::ios_base::openmode mode =
|
||||
std::ios_base::out);
|
||||
void AddEmptyLineInOuputFile();
|
||||
// [[deprecated]] : chemistry list should never be nullptr
|
||||
void SetChemistryList(G4VUserChemistryList*);
|
||||
|
||||
/**
|
||||
* Close the file specified with WriteInto
|
||||
*/
|
||||
void CloseFile();
|
||||
void Deregister(G4VUserChemistryList&);
|
||||
|
||||
//============================================================================
|
||||
// PUSH MOLECULES
|
||||
//============================================================================
|
||||
/**
|
||||
* Method used by DNA physics model to create a water 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 (electron, proton...).
|
||||
*/
|
||||
void CreateWaterMolecule(ElectronicModification,
|
||||
G4int /*electronicLevel*/,
|
||||
const G4Track* /*theIncomingTrack*/);
|
||||
void Initialize();
|
||||
void Run();
|
||||
void Clear();
|
||||
|
||||
/**
|
||||
* On the same idea as the previous method but for solvated electron.
|
||||
* This method should be used by the physics model of the ElectronSolvatation
|
||||
* process.
|
||||
*/
|
||||
void CreateSolvatedElectron(const G4Track* /*theIncomingTrack*/,
|
||||
G4ThreeVector* finalPosition = 0);
|
||||
/**
|
||||
* @brief Inject custom species to the simulation
|
||||
* @details This method should be called per thread, possibly from
|
||||
* ActionInitialisation::Build.
|
||||
* One can decide to set the same gun for all threads.
|
||||
* It is the user responsibility to handle the pointer deletion.
|
||||
*/
|
||||
void SetGun(G4ITGun* pChemSpeciesGun);
|
||||
|
||||
/**
|
||||
* WARNING : In case chemistry is not activated, PushMolecule will take care
|
||||
* of deleting the transfered molecule.
|
||||
* Before calling this method, it is also possible to check if the chemistry
|
||||
* is activated through IsChemistryActived().
|
||||
* This method will create the track corresponding to the transfered molecule
|
||||
* and will be in charge of loading the new track to the system.
|
||||
*/
|
||||
void SetPhysChemIO(std::unique_ptr<G4VPhysChemIO> pPhysChemIO);
|
||||
|
||||
void PushMolecule(G4Molecule*& molecule,
|
||||
G4double time,
|
||||
const G4ThreeVector& position,
|
||||
G4int parentID);
|
||||
void SetVerbose(G4int verbose);
|
||||
|
||||
/**
|
||||
* WARNING : In case chemistry is not activated, PushMoleculeAtParentTimeAndPlace
|
||||
* will take care of deleting the transfered molecule.
|
||||
* Before calling this method, it is also possible to check if the chemistry
|
||||
* is activated through IsChemistryActived().
|
||||
* This method will create the track corresponding to the transfered molecule
|
||||
* and will be in charge of loading the new track to the system.
|
||||
*/
|
||||
void PushMoleculeAtParentTimeAndPlace(G4Molecule*& molecule,
|
||||
const G4Track* /*theIncomingTrack*/);
|
||||
/**
|
||||
* If the chemistry module is used in standalone (ie. without running the physics
|
||||
* stage beforehand), the physics table still needs to be built.
|
||||
* It is therefore necessary to flag the chemistry module as being run
|
||||
* in standalone.
|
||||
*/
|
||||
void UseAsStandalone(G4bool flag);
|
||||
G4bool IsCounterResetWhenRunEnds() const;
|
||||
|
||||
void ResetCounterWhenRunEnds(G4bool resetCounterWhenRunEnds);
|
||||
|
||||
inline void SetVerbose(G4int verbose)
|
||||
{
|
||||
fVerbose = verbose;
|
||||
}
|
||||
void ForceMasterReinitialization();
|
||||
void TagThreadForReinitialization();
|
||||
void ForceThreadReinitialization();
|
||||
void ForceRebuildingPhysicsTable();
|
||||
|
||||
inline void SetBuildPhysicsTable(G4bool flag)
|
||||
{fBuildPhysicsTable = flag;}
|
||||
//============================================================================
|
||||
// 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
|
||||
*/
|
||||
void WriteInto(const G4String&, std::ios_base::openmode mode =
|
||||
std::ios_base::out);
|
||||
void AddEmptyLineInOutputFile();
|
||||
|
||||
G4bool IsCounterResetWhenRunEnds() const
|
||||
{
|
||||
return fResetCounterWhenRunEnds;
|
||||
}
|
||||
/**
|
||||
* Close the file specified with WriteInto
|
||||
*/
|
||||
void CloseFile();
|
||||
|
||||
void ResetCounterWhenRunEnds(G4bool resetCounterWhenRunEnds)
|
||||
{
|
||||
fResetCounterWhenRunEnds = resetCounterWhenRunEnds;
|
||||
}
|
||||
//============================================================================
|
||||
// PUSH MOLECULES
|
||||
//============================================================================
|
||||
/**
|
||||
* Method used by DNA physics model to create a water 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 (electron, proton...).
|
||||
*/
|
||||
void CreateWaterMolecule(ElectronicModification,
|
||||
G4int /*electronicLevel*/,
|
||||
const G4Track* /*pIncomingTrack*/);
|
||||
|
||||
/**
|
||||
* This method should be used by the physics model of the ElectronSolvatation
|
||||
* process.
|
||||
*/
|
||||
void CreateSolvatedElectron(const G4Track* /*pIncomingTrack*/,
|
||||
G4ThreeVector* pFinalPosition = nullptr);
|
||||
|
||||
void PushMolecule(std::unique_ptr<G4Molecule> pMolecule,
|
||||
G4double time,
|
||||
const G4ThreeVector& position,
|
||||
G4int parentID);
|
||||
|
||||
void SetPhysChemIO(G4VPhysChemIO* physChemIO);
|
||||
|
||||
protected:
|
||||
G4DNAWaterExcitationStructure* GetExcitationLevel();
|
||||
G4DNAWaterIonisationStructure* GetIonisationLevel();
|
||||
void InitializeFile();
|
||||
void InitializeMaster();
|
||||
void InitializeThread();
|
||||
void HandleStandaloneInitialization();
|
||||
void PushTrack(G4Track*);
|
||||
void SetGlobalTemperature(G4double temperatureKelvin);
|
||||
|
||||
G4DNAChemistryManager();
|
||||
G4DNAWaterExcitationStructure* GetExcitationLevel();
|
||||
G4DNAWaterIonisationStructure* GetIonisationLevel();
|
||||
void InitializeFile();
|
||||
void InitializeMaster();
|
||||
void InitializeThread();
|
||||
void InitializeThreadSharedData();
|
||||
|
||||
G4DNAChemistryManager();
|
||||
|
||||
private:
|
||||
G4UIdirectory* fpChemDNADirectory;
|
||||
G4UIcmdWithABool* fpActivateChem;
|
||||
G4UIcmdWithoutParameter* fpRunChem;
|
||||
G4UIcmdWithoutParameter* fpSkipReactionsFromChemList;
|
||||
//G4UIcmdWithADoubleAndUnit* fpGridSize; // not used in release
|
||||
G4UIcmdWithADoubleAndUnit* fpScaleForNewTemperature;
|
||||
G4UIcmdWithoutParameter* fpInitChem;
|
||||
|
||||
static G4DNAChemistryManager* fgInstance;
|
||||
G4bool fActiveChemistry;
|
||||
|
||||
struct ThreadLocalData{
|
||||
ThreadLocalData();
|
||||
~ThreadLocalData();
|
||||
G4VPhysChemIO* fpPhysChemIO;
|
||||
G4bool fThreadInitialized_tl;
|
||||
};
|
||||
|
||||
static G4ThreadLocal ThreadLocalData* fpThreadData;
|
||||
|
||||
G4bool fMasterInitialized;
|
||||
G4bool fForceThreadReinitialization;
|
||||
std::unique_ptr<G4UIdirectory> fpChemDNADirectory;
|
||||
std::unique_ptr<G4UIcmdWithABool> fpActivateChem;
|
||||
std::unique_ptr<G4UIcmdWithAnInteger> fpRunChem;
|
||||
std::unique_ptr<G4UIcmdWithoutParameter> fpSkipReactionsFromChemList;
|
||||
std::unique_ptr<G4UIcmdWithADoubleAndUnit> fpScaleForNewTemperature;
|
||||
std::unique_ptr<G4UIcmdWithoutParameter> fpInitChem;
|
||||
|
||||
G4DNAWaterExcitationStructure* fpExcitationLevel;
|
||||
G4DNAWaterIonisationStructure* fpIonisationLevel;
|
||||
static G4DNAChemistryManager* fgInstance;
|
||||
G4bool fActiveChemistry;
|
||||
|
||||
G4VUserChemistryList* fpUserChemistryList;
|
||||
G4bool fBuildPhysicsTable;
|
||||
G4bool fPhysicsTableBuilt;
|
||||
G4bool fSkipReactions;
|
||||
struct ThreadLocalData{
|
||||
ThreadLocalData();
|
||||
~ThreadLocalData();
|
||||
std::unique_ptr<G4VPhysChemIO> fpPhysChemIO;
|
||||
G4bool fThreadInitialized = false;
|
||||
};
|
||||
|
||||
G4bool fGeometryClosed;
|
||||
static G4ThreadLocal ThreadLocalData* fpThreadData;
|
||||
|
||||
G4int fVerbose;
|
||||
G4bool fResetCounterWhenRunEnds;
|
||||
G4bool fMasterInitialized;
|
||||
G4bool fForceThreadReinitialization;
|
||||
|
||||
std::unique_ptr<G4DNAWaterExcitationStructure> fpExcitationLevel;
|
||||
std::unique_ptr<G4DNAWaterIonisationStructure> fpIonisationLevel;
|
||||
|
||||
std::unique_ptr<G4VUserChemistryList> fpUserChemistryList;
|
||||
G4bool fOwnChemistryList;
|
||||
G4bool fUseInStandalone;
|
||||
G4bool fPhysicsTableBuilt;
|
||||
G4bool fSkipReactions;
|
||||
|
||||
G4bool fGeometryClosed;
|
||||
|
||||
G4int fVerbose;
|
||||
G4bool fResetCounterWhenRunEnds;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
inline void G4DNAChemistryManager::ForceRebuildingPhysicsTable()
|
||||
{
|
||||
fPhysicsTableBuilt = false;
|
||||
}
|
||||
|
||||
inline void G4DNAChemistryManager::SetChemistryList(G4VUserChemistryList* chemistryList)
|
||||
{
|
||||
fpUserChemistryList = chemistryList;
|
||||
Activated();
|
||||
}
|
||||
|
||||
inline void G4DNAChemistryManager::Deregister(G4VUserChemistryList* chemistryList)
|
||||
{
|
||||
if (fpUserChemistryList == chemistryList) fpUserChemistryList = 0;
|
||||
}
|
||||
|
||||
inline void G4DNAChemistryManager::ForceMasterReinitialization()
|
||||
{
|
||||
fMasterInitialized = false;
|
||||
InitializeMaster();
|
||||
}
|
||||
|
||||
inline void G4DNAChemistryManager::ForceThreadReinitialization()
|
||||
{
|
||||
fForceThreadReinitialization = true;
|
||||
}
|
||||
|
||||
inline void G4DNAChemistryManager::TagThreadForReinitialization()
|
||||
{
|
||||
fpThreadData->fThreadInitialized_tl = false;
|
||||
}
|
||||
|
||||
#endif // G4DNACHEMISTRYMANAGER_HH
|
||||
|
||||
+127
-190
@@ -43,18 +43,17 @@
|
||||
// J. Comput. Phys. 274 (2014) 841-882
|
||||
// Prog. Nucl. Sci. Tec. 2 (2011) 503-508
|
||||
|
||||
|
||||
#ifndef G4MolecularReactionTable_h
|
||||
#define G4MolecularReactionTable_h 1
|
||||
#pragma once
|
||||
|
||||
#include "G4ITReactionTable.hh"
|
||||
#include "G4MolecularConfiguration.hh"
|
||||
#include "G4ReferenceCast.hh"
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <functional>
|
||||
#include "G4ReferenceCast.hh"
|
||||
#include <memory>
|
||||
|
||||
class G4VDNAReactionModel ;
|
||||
class G4VDNAReactionModel;
|
||||
class G4DNAMolecularReactionTable;
|
||||
class G4ReactionTableMessenger;
|
||||
|
||||
@@ -62,226 +61,164 @@ class G4ReactionTableMessenger;
|
||||
* G4DNAMolecularReactionData contains the information
|
||||
* relative to a given reaction (eg : °OH + °OH -> H2O2)
|
||||
*/
|
||||
|
||||
class G4DNAMolecularReactionData
|
||||
{
|
||||
public :
|
||||
//----------------------------------------------------------------------------
|
||||
public:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
G4DNAMolecularReactionData(G4double reactionRate,
|
||||
G4MolecularConfiguration* reactive1,
|
||||
G4MolecularConfiguration* reactive2);
|
||||
|
||||
G4DNAMolecularReactionData(G4double reactionRate,
|
||||
const G4String& reactive1,
|
||||
const G4String& reactive2);
|
||||
~G4DNAMolecularReactionData();
|
||||
|
||||
G4DNAMolecularReactionData(G4double reactionRate,
|
||||
const G4MolecularConfiguration* reactive1,
|
||||
const G4MolecularConfiguration* reactive2);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
inline int GetReactionID() const { return fReactionID; }
|
||||
inline void SetReactionID(int ID) { fReactionID = ID; }
|
||||
G4DNAMolecularReactionData(G4double reactionRate,
|
||||
const G4String& reactive1,
|
||||
const G4String& reactive2);
|
||||
~G4DNAMolecularReactionData();
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
inline std::pair<G4MolecularConfiguration*, G4MolecularConfiguration*>
|
||||
GetReactants()
|
||||
{
|
||||
return std::make_pair(fReactant1, fReactant2);
|
||||
}
|
||||
using Reactant = const G4MolecularConfiguration;
|
||||
using ReactantPair = std::pair<Reactant*, Reactant*>;
|
||||
using ReactionProducts = std::vector<Reactant*>;
|
||||
|
||||
inline G4MolecularConfiguration* GetReactant1() const
|
||||
{
|
||||
return fReactant1;
|
||||
}
|
||||
inline G4MolecularConfiguration* GetReactant2() const
|
||||
{
|
||||
return fReactant2;
|
||||
}
|
||||
int GetReactionID() const;
|
||||
void SetReactionID(int ID);
|
||||
|
||||
inline void SetObservedReactionRateConstant(G4double rate)
|
||||
{
|
||||
fObservedReactionRate = rate;
|
||||
}
|
||||
ReactantPair GetReactants();
|
||||
|
||||
inline G4double GetObservedReactionRateConstant() const
|
||||
{
|
||||
return fObservedReactionRate;
|
||||
}
|
||||
Reactant* GetReactant1() const;
|
||||
Reactant* GetReactant2() const;
|
||||
|
||||
inline G4double GetEffectiveReactionRadius() const
|
||||
{
|
||||
return fEffectiveReactionRadius;
|
||||
}
|
||||
|
||||
inline void SetEffectiveReactionRadius(G4double radius)
|
||||
{
|
||||
fEffectiveReactionRadius = radius;
|
||||
}
|
||||
void SetObservedReactionRateConstant(G4double rate);
|
||||
G4double GetObservedReactionRateConstant() const;
|
||||
|
||||
//_____________________________________________________
|
||||
G4double GetEffectiveReactionRadius() const;
|
||||
void SetEffectiveReactionRadius(G4double radius);
|
||||
|
||||
void SetReactant1(G4MolecularConfiguration* reactive) ;
|
||||
void SetReactant2(G4MolecularConfiguration* reactive) ;
|
||||
|
||||
void SetReactants(G4MolecularConfiguration* reactive1,
|
||||
G4MolecularConfiguration* reactive2);
|
||||
void SetReactant1(Reactant* reactive);
|
||||
void SetReactant2(Reactant* reactive);
|
||||
|
||||
void AddProduct(G4MolecularConfiguration* molecule);
|
||||
void SetReactants(Reactant* reactive1,
|
||||
Reactant* reactive2);
|
||||
|
||||
void SetReactant1(const G4String& reactive) ;
|
||||
void SetReactant2(const G4String& reactive) ;
|
||||
void SetReactants(const G4String& reactive1, const G4String& reactive2);
|
||||
void AddProduct(const G4String& molecule);
|
||||
|
||||
inline G4int GetNbProducts() const
|
||||
{
|
||||
if(fProducts) return fProducts->size();
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline G4MolecularConfiguration* GetProduct(G4int i) const
|
||||
{
|
||||
if(fProducts) return (*fProducts)[i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline const std::vector<G4MolecularConfiguration*>* GetProducts() const
|
||||
{
|
||||
return fProducts;
|
||||
}
|
||||
void AddProduct(Reactant* molecule);
|
||||
|
||||
inline void RemoveProducts()
|
||||
{
|
||||
if(fProducts)
|
||||
{
|
||||
fProducts->clear();
|
||||
delete fProducts;
|
||||
}
|
||||
}
|
||||
void SetReactant1(const G4String& reactive);
|
||||
void SetReactant2(const G4String& reactive);
|
||||
void SetReactants(const G4String& reactive1, const G4String& reactive2);
|
||||
void AddProduct(const G4String& molecule);
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Temperature scaling
|
||||
typedef std::function<double(double)> RateParam;
|
||||
G4int GetNbProducts() const;
|
||||
Reactant* GetProduct(G4int i) const;
|
||||
|
||||
static double PolynomialParam(double temp_K, std::vector<double> P);
|
||||
static double ArrehniusParam(double temp_K, std::vector<double> P);
|
||||
static double ScaledParameterization(double temp_K,
|
||||
double temp_init,
|
||||
double rateCste_init);
|
||||
const ReactionProducts* GetProducts() const;
|
||||
void RemoveProducts();
|
||||
|
||||
void SetPolynomialParameterization(const std::vector<double>& P);
|
||||
//----------------------------------------------------------------------------
|
||||
// Temperature scaling
|
||||
typedef std::function<double(double)> RateParam;
|
||||
|
||||
void SetArrehniusParameterization(double A0, double E_R);
|
||||
void SetScaledParameterization(double temperature_K,
|
||||
double rateCste);
|
||||
static double PolynomialParam(double temp_K, std::vector<double> P);
|
||||
static double ArrehniusParam(double temp_K, std::vector<double> P);
|
||||
static double ScaledParameterization(double temp_K,
|
||||
double temp_init,
|
||||
double rateCste_init);
|
||||
|
||||
void ScaleForNewTemperature(double temp_K);
|
||||
void SetPolynomialParameterization(const std::vector<double>& P);
|
||||
|
||||
protected :
|
||||
G4DNAMolecularReactionData();
|
||||
G4MolecularConfiguration* fReactant1;
|
||||
G4MolecularConfiguration* fReactant2;
|
||||
G4double fObservedReactionRate;
|
||||
G4double fEffectiveReactionRadius;
|
||||
|
||||
std::vector<G4MolecularConfiguration*>* fProducts;
|
||||
// G4DNAReactionType fReactionType;
|
||||
RateParam fRateParam;
|
||||
int fReactionID;
|
||||
void SetArrehniusParameterization(double A0, double E_R);
|
||||
void SetScaledParameterization(double temperature_K,
|
||||
double rateCste);
|
||||
|
||||
void ScaleForNewTemperature(double temp_K);
|
||||
|
||||
private:
|
||||
void ComputeEffectiveRadius();
|
||||
|
||||
protected:
|
||||
G4DNAMolecularReactionData();
|
||||
Reactant* fpReactant1;
|
||||
Reactant* fpReactant2;
|
||||
G4double fObservedReactionRate;
|
||||
G4double fEffectiveReactionRadius;
|
||||
|
||||
ReactionProducts fProducts;
|
||||
RateParam fRateParam;
|
||||
int fReactionID;
|
||||
};
|
||||
|
||||
/**
|
||||
* G4DNAMolecularReactionTable sorts out the G4DNAMolecularReactionData
|
||||
* for bimolecular reaction
|
||||
*/
|
||||
|
||||
class G4DNAMolecularReactionTable : public G4ITReactionTable
|
||||
{
|
||||
protected:
|
||||
G4DNAMolecularReactionTable();
|
||||
static G4DNAMolecularReactionTable* fInstance;
|
||||
|
||||
public :
|
||||
static G4DNAMolecularReactionTable* GetReactionTable();
|
||||
static G4DNAMolecularReactionTable* Instance();
|
||||
static void DeleteInstance();
|
||||
virtual ~G4DNAMolecularReactionTable();
|
||||
|
||||
/**
|
||||
* Define a reaction :
|
||||
* First argument : reaction rate
|
||||
* Second argument : reactant 1
|
||||
* Third argument : reactant 2
|
||||
* Fourth argument : a std::vector holding the molecular products
|
||||
* if this last argument is NULL then it will be interpreted as
|
||||
* a reaction giving no products
|
||||
*/
|
||||
void SetReaction(G4double observedReactionRate,
|
||||
G4MolecularConfiguration* reactive1,
|
||||
G4MolecularConfiguration* reactive2);
|
||||
|
||||
void SetReaction(G4DNAMolecularReactionData*);
|
||||
|
||||
const G4DNAMolecularReactionData* GetReactionData(G4MolecularConfiguration*,
|
||||
G4MolecularConfiguration*) const;
|
||||
|
||||
const G4DNAMolecularReactionData* GetReactionData(const G4String&,
|
||||
const G4String&) const;
|
||||
G4DNAMolecularReactionTable();
|
||||
static G4DNAMolecularReactionTable* fpInstance;
|
||||
|
||||
const G4DNAMolecularReactionData* GetReaction(int reactionID) const;
|
||||
public:
|
||||
static G4DNAMolecularReactionTable* GetReactionTable();
|
||||
static G4DNAMolecularReactionTable* Instance();
|
||||
static void DeleteInstance();
|
||||
virtual ~G4DNAMolecularReactionTable();
|
||||
|
||||
size_t GetNReactions() const
|
||||
{ return fVectorOfReactionData.size(); }
|
||||
using Reactant = const G4MolecularConfiguration;
|
||||
using Data = const G4DNAMolecularReactionData;
|
||||
using ReactantList = std::vector<Reactant*>;
|
||||
using DataList = std::vector<Data*>;
|
||||
using SpecificDataList = std::map<Reactant*, Data*>;
|
||||
|
||||
//_________________________________________________________________
|
||||
/**
|
||||
* Given a molecule's type, it returns with which a reaction is allowed
|
||||
*/
|
||||
const std::vector<G4MolecularConfiguration*>*
|
||||
CanReactWith(G4MolecularConfiguration*) const ;
|
||||
using ReactionDataMap = std::map<Reactant*, SpecificDataList>;
|
||||
using ReactivesMV = std::map<Reactant*, ReactantList>;
|
||||
using ReactionDataMV = std::map<Reactant*, DataList>;
|
||||
|
||||
const std::map<G4MolecularConfiguration*, const G4DNAMolecularReactionData*>*
|
||||
GetReativesNData(G4MolecularConfiguration*) const;
|
||||
/**
|
||||
* Define a reaction :
|
||||
* First argument : reaction rate
|
||||
* Second argument : reactant 1
|
||||
* Third argument : reactant 2
|
||||
* Fourth argument : a std::vector holding the molecular products
|
||||
* if this last argument is NULL then it will be interpreted as
|
||||
* a reaction giving no products
|
||||
*/
|
||||
void SetReaction(G4double observedReactionRate,
|
||||
Reactant* reactive1,
|
||||
Reactant* reactive2);
|
||||
|
||||
const std::vector<const G4DNAMolecularReactionData*>*
|
||||
GetReactionData(G4MolecularConfiguration*) const;
|
||||
|
||||
inline const std::map<G4MolecularConfiguration*,
|
||||
std::map<G4MolecularConfiguration*,
|
||||
const G4DNAMolecularReactionData*> >&
|
||||
GetAllReactionData()
|
||||
{
|
||||
return fReactionData;
|
||||
}
|
||||
void SetReaction(G4DNAMolecularReactionData*);
|
||||
|
||||
inline const std::vector<const G4DNAMolecularReactionData*>&
|
||||
GetVectorOfReactionData()
|
||||
{
|
||||
return fVectorOfReactionData;
|
||||
}
|
||||
Data* GetReactionData(Reactant*, Reactant*) const;
|
||||
|
||||
void ScaleReactionRateForNewTemperature(double temp_K);
|
||||
Data* GetReactionData(const G4String&, const G4String&) const;
|
||||
|
||||
//_________________________________________________________________
|
||||
void PrintTable(G4VDNAReactionModel* = 0);
|
||||
|
||||
protected :
|
||||
G4bool fVerbose;
|
||||
|
||||
//_________________________________________________
|
||||
typedef std::map<G4MolecularConfiguration*,
|
||||
std::map<G4MolecularConfiguration*,
|
||||
const G4DNAMolecularReactionData*> > ReactionDataMap;
|
||||
typedef std::map<G4MolecularConfiguration*,
|
||||
std::vector<G4MolecularConfiguration*> > ReactivesMV;
|
||||
typedef std::map<G4MolecularConfiguration*,
|
||||
std::vector<const G4DNAMolecularReactionData*> > ReactionDataMV;
|
||||
|
||||
ReactionDataMap fReactionData;
|
||||
ReactivesMV fReactantsMV;
|
||||
ReactionDataMV fReactionDataMV;
|
||||
std::vector<const G4DNAMolecularReactionData*> fVectorOfReactionData;
|
||||
G4ReactionTableMessenger* fpMessenger;
|
||||
Data* GetReaction(int reactionID) const;
|
||||
|
||||
size_t GetNReactions() const;
|
||||
|
||||
//_________________________________________________________________
|
||||
/**
|
||||
* Given a molecule's type, it returns with which a reaction is allowed
|
||||
*/
|
||||
const ReactantList* CanReactWith(Reactant*) const;
|
||||
|
||||
const SpecificDataList* GetReativesNData(const G4MolecularConfiguration*) const;
|
||||
|
||||
const DataList* GetReactionData(const G4MolecularConfiguration*) const;
|
||||
|
||||
const ReactionDataMap& GetAllReactionData();
|
||||
|
||||
DataList GetVectorOfReactionData();
|
||||
|
||||
void ScaleReactionRateForNewTemperature(double temp_K);
|
||||
|
||||
//_________________________________________________________________
|
||||
void PrintTable(G4VDNAReactionModel* = 0);
|
||||
|
||||
protected:
|
||||
G4bool fVerbose;
|
||||
|
||||
ReactionDataMap fReactionData;
|
||||
ReactivesMV fReactantsMV;
|
||||
ReactionDataMV fReactionDataMV;
|
||||
std::vector<std::unique_ptr<Data>> fVectorOfReactionData;
|
||||
std::unique_ptr<G4ReactionTableMessenger> fpMessenger;
|
||||
};
|
||||
#endif /*G4MolecularReactionTable_HH*/
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
*/
|
||||
virtual void WriteInto(const G4String&,
|
||||
std::ios_base::openmode mode = std::ios_base::out);
|
||||
virtual void AddEmptyLineInOuputFile();
|
||||
virtual void AddEmptyLineInOutputFile();
|
||||
|
||||
/**
|
||||
* Close the file specified with WriteInto
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
*/
|
||||
virtual void WriteInto(const G4String&, std::ios_base::openmode mode =
|
||||
std::ios_base::out);
|
||||
virtual void AddEmptyLineInOuputFile(){}
|
||||
virtual void AddEmptyLineInOutputFile(){}
|
||||
|
||||
/**
|
||||
* Close the file specified with WriteInto
|
||||
|
||||
@@ -43,11 +43,9 @@
|
||||
// J. Comput. Phys. 274 (2014) 841-882
|
||||
// Prog. Nucl. Sci. Tec. 2 (2011) 503-508
|
||||
|
||||
#ifndef G4VReactionModel_hh
|
||||
#define G4VReactionModel_hh
|
||||
#pragma once
|
||||
|
||||
#include "globals.hh"
|
||||
#include "AddClone_def.hh"
|
||||
|
||||
class G4DNAMolecularReactionTable;
|
||||
class G4MolecularConfiguration;
|
||||
@@ -59,42 +57,27 @@ class G4Track;
|
||||
* It defines how the reaction radius should be calculated and whether two molecules
|
||||
* can indeed react.
|
||||
*/
|
||||
|
||||
class G4VDNAReactionModel
|
||||
{
|
||||
public :
|
||||
G4VDNAReactionModel();
|
||||
G4VDNAReactionModel(const G4VDNAReactionModel&);
|
||||
G4VDNAReactionModel(const G4VDNAReactionModel&) = delete;
|
||||
G4VDNAReactionModel& operator=(const G4VDNAReactionModel&) = delete;
|
||||
virtual ~G4VDNAReactionModel();
|
||||
|
||||
/** This macro is defined in AddClone_def **/
|
||||
G4IT_TO_BE_CLONED(G4VDNAReactionModel)
|
||||
|
||||
virtual void Initialise(G4MolecularConfiguration*, const G4Track&) {;}
|
||||
virtual void InitialiseToPrint(G4MolecularConfiguration*) = 0 ;
|
||||
virtual G4double GetReactionRadius(G4MolecularConfiguration*,
|
||||
G4MolecularConfiguration*) = 0;
|
||||
virtual G4double GetReactionRadius(const int) = 0;
|
||||
virtual void Initialise(const G4MolecularConfiguration*, const G4Track&) {;}
|
||||
virtual void InitialiseToPrint(const G4MolecularConfiguration*) = 0 ;
|
||||
virtual G4double GetReactionRadius(const G4MolecularConfiguration*,
|
||||
const G4MolecularConfiguration*) = 0;
|
||||
virtual G4double GetReactionRadius(int) = 0;
|
||||
virtual G4bool FindReaction(const G4Track&, const G4Track&,
|
||||
const G4double /*reactionRadius*/,
|
||||
G4double /*reactionRadius*/,
|
||||
G4double& /*separationDistance*/, // To be calculated
|
||||
const G4bool /*hasReachedUserTimeLimit*/) = 0;
|
||||
G4bool /*hasReachedUserTimeLimit*/) = 0;
|
||||
|
||||
inline void SetReactionTable(const G4DNAMolecularReactionTable*);
|
||||
inline const G4DNAMolecularReactionTable* GetReactionTable();
|
||||
void SetReactionTable(const G4DNAMolecularReactionTable*);
|
||||
const G4DNAMolecularReactionTable* GetReactionTable();
|
||||
|
||||
protected :
|
||||
G4VDNAReactionModel& operator=(const G4VDNAReactionModel&);
|
||||
const G4DNAMolecularReactionTable* fReactionTable ;
|
||||
const G4DNAMolecularReactionTable* fpReactionTable ;
|
||||
};
|
||||
|
||||
inline void G4VDNAReactionModel::SetReactionTable(const G4DNAMolecularReactionTable* table)
|
||||
{
|
||||
fReactionTable = table ;
|
||||
}
|
||||
|
||||
inline const G4DNAMolecularReactionTable* G4VDNAReactionModel::GetReactionTable()
|
||||
{
|
||||
return fReactionTable ;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
*/
|
||||
virtual void WriteInto(const G4String&, std::ios_base::openmode mode =
|
||||
std::ios_base::out) = 0;
|
||||
virtual void AddEmptyLineInOuputFile(){};
|
||||
virtual void AddEmptyLineInOutputFile(){};
|
||||
|
||||
/**
|
||||
* Close the file specified with WriteInto
|
||||
|
||||
Reference in New Issue
Block a user