57 : fpReactant1(nullptr)
58 , fpReactant2(nullptr)
59 , fObservedReactionRate(0.)
64 , fEffectiveReactionRadius(0.)
74 : fpReactant1(pReactant1)
75 , fpReactant2(pReactant2)
76 , fObservedReactionRate(reactionRate)
81 , fEffectiveReactionRadius(0.)
86 ComputeEffectiveRadius();
92 : fpReactant1(nullptr)
93 , fpReactant2(nullptr)
94 , fObservedReactionRate(reactionRate)
99 , fEffectiveReactionRadius(0.)
106 ComputeEffectiveRadius();
114void G4DNAMolecularReactionData::ComputeEffectiveRadius()
322 double inv_temp = 1. / temp_K;
325 P[0] + P[1] * inv_temp + P[2] * pow(inv_temp, 2)
326 + P[3] * pow(inv_temp, 3) + P[4] * pow(inv_temp, 4))
327 * (1e-3 * CLHEP::m3 / (CLHEP::mole * CLHEP::s));
332 return P[0] *
G4Exp(P[1] / temp_K)*
333 (1e-3 * CLHEP::m3 / (CLHEP::mole * CLHEP::s));
338 double rateCste_init)
342 return Df * rateCste_init / D0;
400 if (pReactant1 != pReactant2)
434 ReactivesMV::iterator itReactives;
436 std::map<Reactant*, std::map<Reactant*, G4bool>> alreadyPrint;
438 G4cout <<
"Number of chemical species involved in reactions = "
452 const vector<Reactant*>* reactivesVector =
CanReactWith(moleculeA);
458 for (
G4int iReact = 0; iReact < nbReactants; iReact++)
460 auto moleculeB = (
Reactant*)(*reactivesVector)[iReact];
466 if (!alreadyPrint[moleculeA][moleculeB])
468 outputReaction[n] = moleculeA->
GetName() +
" + " + moleculeB->GetName();
476 for (
G4int j = 1; j < nbProducts; j++)
483 outputReaction[n] +=
" -> No product";
494 if (pReactionModel) interactionRange =
497 if (interactionRange != -1)
500 interactionRange / nanometer);
507 alreadyPrint[moleculeB][moleculeA] =
TRUE;
519 G4int maxlengthOutputReaction = -1;
520 G4int maxlengthOutputReactionRate = -1;
522 for (
G4int i = 0; i < n; i++)
524 if (maxlengthOutputReaction < (
G4int)outputReaction[i].length())
526 maxlengthOutputReaction = outputReaction[i].length();
528 if (maxlengthOutputReactionRate < (
G4int)outputReactionRate[i].length())
530 maxlengthOutputReactionRate = outputReactionRate[i].length();
534 maxlengthOutputReaction += 2;
535 maxlengthOutputReactionRate += 2;
537 if (maxlengthOutputReaction < 10) maxlengthOutputReaction = 10;
538 if (maxlengthOutputReactionRate < 30) maxlengthOutputReactionRate = 30;
542 if (pReactionModel) title =
new G4String[3];
545 title[0] =
"Reaction";
546 title[1] =
"Reaction Rate [dm3/(mol*s)]";
548 if (pReactionModel) title[2] =
549 "Interaction Range for chosen reaction model [nm]";
551 G4cout << setfill(
' ') << setw(maxlengthOutputReaction) << left << title[0]
552 << setw(maxlengthOutputReactionRate) << left << title[1];
554 if (pReactionModel)
G4cout << setw(2) << left << title[2];
559 if (pReactionModel)
G4cout.width(
560 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
561 + (
G4int)title[2].length());
562 else G4cout.width(maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
566 for (
G4int i = 0; i < n; i++)
568 G4cout << setw(maxlengthOutputReaction) << left << outputReaction[i]
569 << setw(maxlengthOutputReactionRate) << left
570 << outputReactionRate[i];
572 if (pReactionModel)
G4cout << setw(2) << left << outputRange[i];
577 if (pReactionModel)
G4cout.width(
578 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
579 + (
G4int)title[2].length());
581 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
587 delete[] outputReaction;
588 delete[] outputReactionRate;
589 delete[] outputRange;
601 G4String errMsg =
"No reaction table was implemented";
602 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
611 "No reaction table was implemented for this molecule Definition : " + pReactant1
613 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
617 ReactionDataMap::mapped_type::const_iterator it2 = it1->second.find(pReactant2);
619 if (it2 == it1->second.end())
622 G4String errMsg =
"No reaction table was implemented for this molecule : "
627 return (it2->second);
641 dataList.emplace_back(pData.get());
654 G4String errMsg =
"No reaction table was implemented";
655 G4Exception(
"G4MolecularInteractionTable::CanReactWith",
"",
667 G4String errMsg =
"No reaction table was implemented for this molecule : "
670 G4cout <<
"--- G4MolecularInteractionTable::GetReactionData ---" <<
G4endl;
679 G4cout <<
" G4MolecularInteractionTable::CanReactWith :" <<
G4endl;
681 G4cout <<
" the number of reactants is : " << itReactivesMap->second.size() <<
G4endl;
683 auto itProductsVector = itReactivesMap->second.cbegin();
685 for (; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
690 return &(itReactivesMap->second);
700 G4String errMsg =
"No reaction table was implemented";
701 G4Exception(
"G4MolecularInteractionTable::CanInteractWith",
"",
705 ReactionDataMap::const_iterator itReactivesMap =
fReactionData.find(molecule);
714 G4cout <<
" G4MolecularInteractionTable::CanReactWith :" <<
G4endl;
716 G4cout <<
" the number of reactants is : " << itReactivesMap->second.size() <<
G4endl;
718 SpecificDataList::const_iterator itProductsVector = itReactivesMap->second.begin();
720 for (; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
725 return &(itReactivesMap->second);
735 G4String errMsg =
"No reaction table was implemented";
736 G4Exception(
"G4MolecularInteractionTable::CanInteractWith",
"",
743 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
748 return &(it->second);
774 std::vector<double> P = { A0, E_R };
784 std::placeholders::_1,
816 if (pData->GetReactionID() == reactionID)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4GLOB_DLL std::ostream G4cout
G4double fEffectiveReactionRadius
Reactant * GetProduct(G4int i) const
void SetProbability(G4double prob)
G4double GetActivationRateConstant() const
G4double GetProbability() const
void SetReactionType(G4int type)
void SetReactionRadius(G4double radius)
G4int GetReactionType() const
Reactant * GetReactant1() const
G4double GetDiffusionRateConstant() const
void SetPolynomialParameterization(const std::vector< double > &P)
void SetReactionID(int ID)
std::pair< Reactant *, Reactant * > ReactantPair
void ScaleForNewTemperature(double temp_K)
static double ArrehniusParam(double temp_K, std::vector< double > P)
void SetEffectiveReactionRadius(G4double radius)
G4double GetEffectiveReactionRadius() const
G4double GetOnsagerRadius() const
int GetReactionID() const
void SetArrehniusParameterization(double A0, double E_R)
std::vector< Reactant * > ReactionProducts
void SetReactants(Reactant *reactive1, Reactant *reactive2)
ReactantPair GetReactants()
const ReactionProducts * GetProducts() const
Reactant * GetReactant2() const
void SetReactant2(Reactant *reactive)
void SetObservedReactionRateConstant(G4double rate)
G4double fObservedReactionRate
static double PolynomialParam(double temp_K, std::vector< double > P)
void AddProduct(Reactant *molecule)
void SetScaledParameterization(double temperature_K, double rateCste)
static double ScaledParameterization(double temp_K, double temp_init, double rateCste_init)
G4double GetObservedReactionRateConstant() const
G4double GetReactionRadius() const
G4DNAMolecularReactionData()
void SetReactant1(Reactant *reactive)
~G4DNAMolecularReactionData()
G4int GetNbProducts() const
ReactionProducts fProducts
std::map< Reactant *, Data * > SpecificDataList
static G4DNAMolecularReactionTable * GetReactionTable()
std::vector< Reactant * > ReactantList
DataList GetVectorOfReactionData()
Data * GetReactionData(Reactant *, Reactant *) const
static G4DNAMolecularReactionTable * Instance()
const ReactantList * CanReactWith(Reactant *) const
std::map< Reactant *, SpecificDataList > ReactionDataMap
Data * GetReaction(int reactionID) const
const SpecificDataList * GetReativesNData(const G4MolecularConfiguration *) const
void PrintTable(G4VDNAReactionModel *=0)
static void DeleteInstance()
size_t GetNReactions() const
std::vector< std::unique_ptr< Data > > fVectorOfReactionData
const ReactionDataMap & GetAllReactionData()
static G4DNAMolecularReactionTable * fpInstance
void SetReaction(G4double observedReactionRate, Reactant *reactive1, Reactant *reactive2)
ReactionDataMap fReactionData
void ScaleReactionRateForNewTemperature(double temp_K)
G4DNAMolecularReactionTable()
ReactionDataMV fReactionDataMV
std::vector< Data * > DataList
virtual ~G4DNAMolecularReactionTable()
const G4String & GetName() const
G4double GetVanDerVaalsRadius() const
static double DiffCoeffWater(double temperature_K)
G4double GetDiffusionCoefficient() const
static G4MoleculeTable * GetMoleculeTable()
G4MolecularConfiguration * GetConfiguration(const G4String &, bool mustExist=true)
static G4MoleculeTable * Instance()
static G4String ConvertToString(G4bool boolVal)
virtual void InitialiseToPrint(const G4MolecularConfiguration *)=0
const G4DNAMolecularReactionTable * GetReactionTable()
void SetReactionTable(const G4DNAMolecularReactionTable *)
virtual G4double GetReactionRadius(const G4MolecularConfiguration *, const G4MolecularConfiguration *)=0