57 : fpReactant1(nullptr)
58 , fpReactant2(nullptr)
59 , fObservedReactionRate(0.)
64 , fEffectiveReactionRadius(0.)
74 : fpReactant1(pReactant1)
75 , fpReactant2(pReactant2)
76 , fObservedReactionRate(reactionRate)
81 , fEffectiveReactionRadius(0.)
92 : fpReactant1(nullptr)
93 , fpReactant2(nullptr)
94 , fObservedReactionRate(reactionRate)
99 , fEffectiveReactionRadius(0.)
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;
399 if (pReactant1 != pReactant2)
428 if ((pReactionModel !=
nullptr) && ((pReactionModel->
GetReactionTable()) ==
nullptr))
433 ReactivesMV::iterator itReactives;
435 std::map<Reactant*, std::map<Reactant*, G4bool>> alreadyPrint;
437 G4cout <<
"Number of chemical species involved in reactions = "
442 auto outputReaction =
new G4String[nbPrintable];
443 auto outputReactionRate =
new G4String[nbPrintable];
444 auto outputRange =
new G4String[nbPrintable];
450 auto moleculeA = (
Reactant*)itReactives->first;
451 const vector<Reactant*>* reactivesVector =
CanReactWith(moleculeA);
457 for (
G4int iReact = 0; iReact < nbReactants; iReact++)
459 auto moleculeB = (
Reactant*)(*reactivesVector)[iReact];
465 if (!alreadyPrint[moleculeA][moleculeB])
467 outputReaction[n] = moleculeA->GetName() +
" + " + moleculeB->GetName();
475 for (
G4int j = 1; j < nbProducts; j++)
482 outputReaction[n] +=
" -> No product";
493 if (pReactionModel !=
nullptr) interactionRange =
496 if (interactionRange != -1)
499 interactionRange / nanometer);
506 alreadyPrint[moleculeB][moleculeA] =
TRUE;
518 G4int maxlengthOutputReaction = -1;
519 G4int maxlengthOutputReactionRate = -1;
521 for (
G4int i = 0; i < n; ++i)
523 if (maxlengthOutputReaction < (
G4int)outputReaction[i].length())
525 maxlengthOutputReaction = (
G4int)outputReaction[i].length();
527 if (maxlengthOutputReactionRate < (
G4int)outputReactionRate[i].length())
529 maxlengthOutputReactionRate = (
G4int)outputReactionRate[i].length();
533 maxlengthOutputReaction += 2;
534 maxlengthOutputReactionRate += 2;
536 if (maxlengthOutputReaction < 10) maxlengthOutputReaction = 10;
537 if (maxlengthOutputReactionRate < 30) maxlengthOutputReactionRate = 30;
541 if (pReactionModel !=
nullptr) title =
new G4String[3];
544 title[0] =
"Reaction";
545 title[1] =
"Reaction Rate [dm3/(mol*s)]";
547 if (pReactionModel !=
nullptr) title[2] =
548 "Interaction Range for chosen reaction model [nm]";
550 G4cout << setfill(
' ') << setw(maxlengthOutputReaction) << left << title[0]
551 << setw(maxlengthOutputReactionRate) << left << title[1];
553 if (pReactionModel !=
nullptr)
G4cout << setw(2) << left << title[2];
558 if (pReactionModel !=
nullptr)
G4cout.width(
559 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
560 + (
G4int)title[2].length());
561 else G4cout.width(maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
565 for (
G4int i = 0; i < n; i++)
567 G4cout << setw(maxlengthOutputReaction) << left << outputReaction[i]
568 << setw(maxlengthOutputReactionRate) << left
569 << outputReactionRate[i];
571 if (pReactionModel !=
nullptr)
G4cout << setw(2) << left << outputRange[i];
576 if (pReactionModel !=
nullptr)
G4cout.width(
577 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
578 + (
G4int)title[2].length());
580 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
586 delete[] outputReaction;
587 delete[] outputReactionRate;
588 delete[] outputRange;
605 G4String errMsg =
"No reaction table was implemented";
606 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
615 "No reaction table was implemented for this molecule Definition : " + pReactant1
617 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
623 auto it2 = it1->second.find(pReactant2);
625 if (it2 == it1->second.end())
628 G4String errMsg =
"No reaction table was implemented for this molecule : "
633 return (it2->second);
647 dataList.emplace_back(pData.get());
660 G4String errMsg =
"No reaction table was implemented";
661 G4Exception(
"G4MolecularInteractionTable::CanReactWith",
"",
673 G4String errMsg =
"No reaction table was implemented for this molecule : "
676 G4cout <<
"--- G4MolecularInteractionTable::GetReactionData ---" <<
G4endl;
685 G4cout <<
" G4MolecularInteractionTable::CanReactWith :" <<
G4endl;
687 G4cout <<
" the number of reactants is : " << itReactivesMap->second.size() <<
G4endl;
689 auto itProductsVector = itReactivesMap->second.cbegin();
691 for (; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
696 return &(itReactivesMap->second);
706 G4String errMsg =
"No reaction table was implemented";
707 G4Exception(
"G4MolecularInteractionTable::CanInteractWith",
"",
720 G4cout <<
" G4MolecularInteractionTable::CanReactWith :" <<
G4endl;
722 G4cout <<
" the number of reactants is : " << itReactivesMap->second.size() <<
G4endl;
724 auto itProductsVector = itReactivesMap->second.begin();
726 for (; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
731 return &(itReactivesMap->second);
741 G4String errMsg =
"No reaction table was implemented";
742 G4Exception(
"G4MolecularInteractionTable::CanInteractWith",
"",
749 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
756 return &(it->second);
782 std::vector<double> P = { A0, E_R };
792 std::placeholders::_1,
824 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 ComputeEffectiveRadius()
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
G4VDNAMolecularGeometry * GetGeometry() const
static void DeleteInstance()
~G4DNAMolecularReactionTable() override
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 PrintTable(G4VDNAReactionModel *=nullptr)
void ScaleReactionRateForNewTemperature(double temp_K)
G4DNAMolecularReactionTable()
ReactionDataMV fReactionDataMV
std::vector< Data * > DataList
G4VDNAMolecularGeometry * fGeometry
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