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;
401 if (pReactant1 != pReactant2)
435 ReactivesMV::iterator itReactives;
437 std::map<Reactant*, std::map<Reactant*, G4bool>> alreadyPrint;
439 G4cout <<
"Number of chemical species involved in reactions = "
453 const vector<Reactant*>* reactivesVector =
CanReactWith(moleculeA);
459 for (
G4int iReact = 0; iReact < nbReactants; iReact++)
461 auto moleculeB = (
Reactant*)(*reactivesVector)[iReact];
467 if (!alreadyPrint[moleculeA][moleculeB])
469 outputReaction[n] = moleculeA->
GetName() +
" + " + moleculeB->GetName();
477 for (
G4int j = 1; j < nbProducts; j++)
484 outputReaction[n] +=
" -> No product";
495 if (pReactionModel) interactionRange =
498 if (interactionRange != -1)
501 interactionRange / nanometer);
508 alreadyPrint[moleculeB][moleculeA] =
TRUE;
520 G4int maxlengthOutputReaction = -1;
521 G4int maxlengthOutputReactionRate = -1;
523 for (
G4int i = 0; i < n; ++i)
525 if (maxlengthOutputReaction < (
G4int)outputReaction[i].length())
527 maxlengthOutputReaction = (
G4int)outputReaction[i].length();
529 if (maxlengthOutputReactionRate < (
G4int)outputReactionRate[i].length())
531 maxlengthOutputReactionRate = (
G4int)outputReactionRate[i].length();
535 maxlengthOutputReaction += 2;
536 maxlengthOutputReactionRate += 2;
538 if (maxlengthOutputReaction < 10) maxlengthOutputReaction = 10;
539 if (maxlengthOutputReactionRate < 30) maxlengthOutputReactionRate = 30;
543 if (pReactionModel) title =
new G4String[3];
546 title[0] =
"Reaction";
547 title[1] =
"Reaction Rate [dm3/(mol*s)]";
549 if (pReactionModel) title[2] =
550 "Interaction Range for chosen reaction model [nm]";
552 G4cout << setfill(
' ') << setw(maxlengthOutputReaction) << left << title[0]
553 << setw(maxlengthOutputReactionRate) << left << title[1];
555 if (pReactionModel)
G4cout << setw(2) << left << title[2];
560 if (pReactionModel)
G4cout.width(
561 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
562 + (
G4int)title[2].length());
563 else G4cout.width(maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
567 for (
G4int i = 0; i < n; i++)
569 G4cout << setw(maxlengthOutputReaction) << left << outputReaction[i]
570 << setw(maxlengthOutputReactionRate) << left
571 << outputReactionRate[i];
573 if (pReactionModel)
G4cout << setw(2) << left << outputRange[i];
578 if (pReactionModel)
G4cout.width(
579 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
580 + (
G4int)title[2].length());
582 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
588 delete[] outputReaction;
589 delete[] outputReactionRate;
590 delete[] outputRange;
607 G4String errMsg =
"No reaction table was implemented";
608 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
617 "No reaction table was implemented for this molecule Definition : " + pReactant1
619 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
623 ReactionDataMap::mapped_type::const_iterator 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",
"",
711 ReactionDataMap::const_iterator itReactivesMap =
fReactionData.find(molecule);
720 G4cout <<
" G4MolecularInteractionTable::CanReactWith :" <<
G4endl;
722 G4cout <<
" the number of reactants is : " << itReactivesMap->second.size() <<
G4endl;
724 SpecificDataList::const_iterator 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 : "
754 return &(it->second);
780 std::vector<double> P = { A0, E_R };
790 std::placeholders::_1,
822 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
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()
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