60 fObservedReactionRate(0.),
61 fEffectiveReactionRadius(0.),
81 if (reactant1 == reactant2)
185 double inv_temp = 1. / temp_K;
188 P[0] + P[1] * inv_temp + P[2] * pow(inv_temp, 2)
189 + P[3] * pow(inv_temp, 3) + P[4] * pow(inv_temp, 4))
195 return P[0]*
G4Exp(P[1]/temp_K)*
201 double rateCste_init)
205 return Df*rateCste_init/D0;
269 for(it2 = it1->second.begin(); it2 != it1->second.end(); it2++)
274 G4MolecularConfiguration* reactant1 =
276 G4MolecularConfiguration* reactant2 =
303 if (reactant1 != reactant2)
320 reactionRate, reactant1, reactant2);
338 ReactivesMV::iterator itReactives;
340 map<G4MolecularConfiguration*, map<G4MolecularConfiguration*, G4bool> > alreadyPrint;
342 G4cout <<
"Number of chemical species involved in reactions = "
356 const vector<G4MolecularConfiguration*>* reactivesVector =
CanReactWith(moleculeA);
362 for (
G4int iReact = 0; iReact < nbReactants; iReact++)
372 if (!alreadyPrint[moleculeA][moleculeB])
374 outputReaction[
n] = moleculeA->
GetName() +
" + " + moleculeB->GetName();
382 for (
G4int j = 1; j < nbProducts; j++)
389 outputReaction[
n] +=
" -> No product";
400 if (pReactionModel) interactionRange =
403 if (interactionRange != -1)
413 alreadyPrint[moleculeB][moleculeA] =
TRUE;
425 G4int maxlengthOutputReaction = -1;
426 G4int maxlengthOutputReactionRate = -1;
428 for (
G4int i = 0; i <
n; i++)
430 if (maxlengthOutputReaction < (
G4int) outputReaction[i].length())
432 maxlengthOutputReaction = outputReaction[i].length();
434 if (maxlengthOutputReactionRate < (
G4int) outputReactionRate[i].length())
436 maxlengthOutputReactionRate = outputReactionRate[i].length();
440 maxlengthOutputReaction += 2;
441 maxlengthOutputReactionRate += 2;
443 if (maxlengthOutputReaction < 10) maxlengthOutputReaction = 10;
444 if (maxlengthOutputReactionRate < 30) maxlengthOutputReactionRate = 30;
448 if (pReactionModel) title =
new G4String[3];
451 title[0] =
"Reaction";
452 title[1] =
"Reaction Rate [dm3/(mol*s)]";
454 if (pReactionModel) title[2] =
455 "Interaction Range for chosen reaction model [nm]";
457 G4cout << setfill(
' ') << setw(maxlengthOutputReaction) <<
left << title[0]
458 << setw(maxlengthOutputReactionRate) <<
left << title[1];
460 if (pReactionModel)
G4cout << setw(2) <<
left << title[2];
465 if (pReactionModel)
G4cout.width(
466 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
467 + (
G4int) title[2].length());
468 else G4cout.width(maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
472 for (
G4int i = 0; i <
n; i++)
474 G4cout << setw(maxlengthOutputReaction) <<
left << outputReaction[i]
475 << setw(maxlengthOutputReactionRate) <<
left
476 << outputReactionRate[i];
478 if (pReactionModel)
G4cout << setw(2) <<
left << outputRange[i];
483 if (pReactionModel)
G4cout.width(
484 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
485 + (
G4int) title[2].length());
487 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
493 delete[] outputReaction;
494 delete[] outputReactionRate;
495 delete[] outputRange;
507 G4String errMsg =
"No reaction table was implemented";
508 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
513 ReactionDataMap::const_iterator it1 =
fReactionData.find(reactant1);
518 "No reaction table was implemented for this molecule Definition : " + reactant1
522 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
529 it1->second.find(reactant2);
531 if (it2 == it1->second.end())
534 G4String errMsg =
"No reaction table was implemented for this molecule : "
535 + reactant2 -> GetName();
539 return (it2->second);
544 const std::vector<G4MolecularConfiguration*>*
549 G4String errMsg =
"No reaction table was implemented";
550 G4Exception(
"G4MolecularInteractionTable::CanReactWith",
"",
555 ReactivesMV::const_iterator itReactivesMap =
fReactantsMV.find(aMolecule);
562 G4String errMsg =
"No reaction table was implemented for this molecule : "
565 G4cout <<
"--- G4MolecularInteractionTable::GetReactionData ---" <<
G4endl;
575 G4cout<<
" G4MolecularInteractionTable::CanReactWith :"<<
G4endl;
577 G4cout<<
" the number of reactants is : " << itReactivesMap->second.size()<<
G4endl;
579 std::vector<G4MolecularConfiguration*>::const_iterator itProductsVector =
580 itReactivesMap->second.begin();
582 for(; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
587 return &(itReactivesMap->second);
594 const std::map<G4MolecularConfiguration*, const G4DNAMolecularReactionData*>*
599 G4String errMsg =
"No reaction table was implemented";
600 G4Exception(
"G4MolecularInteractionTable::CanInteractWith",
"",
605 ReactionDataMap::const_iterator itReactivesMap =
fReactionData.find(molecule);
619 G4cout<<
" G4MolecularInteractionTable::CanReactWith :"<<
G4endl;
621 G4cout<<
" the number of reactants is : " << itReactivesMap->second.size()<<
G4endl;
625 itReactivesMap->second.begin();
627 for(; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
632 return &(itReactivesMap->second);
640 const std::vector<const G4DNAMolecularReactionData*>*
645 G4String errMsg =
"No reaction table was implemented";
646 G4Exception(
"G4MolecularInteractionTable::CanInteractWith",
"",
655 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
656 + molecule -> GetName();
661 return &(it->second);
692 std::vector<double>
P = {A0, E_R};
706 std::placeholders::_1,
717 for(
size_t i = 0 ; i < end ; ++i)
720 ScaleForNewTemperature(temp_K);
static constexpr double m3
G4double GetDiffusionCoefficient() const
static void DeleteInstance()
virtual ~G4DNAMolecularReactionTable()
const G4String & GetName() const
const G4DNAMolecularReactionData * GetReaction(int reactionID) const
static G4DNAMolecularReactionTable * Instance()
const G4DNAMolecularReactionData * GetReactionData(G4MolecularConfiguration *, G4MolecularConfiguration *) const
static double PolynomialParam(double temp_K, std::vector< double > P)
void ScaleReactionRateForNewTemperature(double temp_K)
G4ReactionTableMessenger * fpMessenger
void ScaleForNewTemperature(double temp_K)
static G4String ConvertToString(G4bool boolVal)
static constexpr double nanometer
ReactionDataMV fReactionDataMV
void SetReactant1(G4MolecularConfiguration *reactive)
static constexpr double m3
~G4DNAMolecularReactionData()
G4double GetObservedReactionRateConstant() const
static G4DNAMolecularReactionTable * GetReactionTable()
const std::map< G4MolecularConfiguration *, const G4DNAMolecularReactionData * > * GetReativesNData(G4MolecularConfiguration *) const
void SetReaction(G4double observedReactionRate, G4MolecularConfiguration *reactive1, G4MolecularConfiguration *reactive2)
G4GLOB_DLL std::ostream G4cout
void SetReactionTable(const G4DNAMolecularReactionTable *)
virtual G4double GetReactionRadius(G4MolecularConfiguration *, G4MolecularConfiguration *)=0
static double DiffCoeffWater(double temperature_K)
static G4MoleculeTable * Instance()
void SetArrehniusParameterization(double A0, double E_R)
void PrintTable(G4VDNAReactionModel *=0)
G4MolecularConfiguration * fReactant1
void AddProduct(G4MolecularConfiguration *molecule)
static double ArrehniusParam(double temp_K, std::vector< double > P)
static constexpr double s
static G4DNAMolecularReactionTable * fInstance
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static double ScaledParameterization(double temp_K, double temp_init, double rateCste_init)
G4int GetNbProducts() const
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4DNAMolecularReactionData()
void SetObservedReactionRateConstant(G4double rate)
void SetReactants(G4MolecularConfiguration *reactive1, G4MolecularConfiguration *reactive2)
std::vector< G4MolecularConfiguration * > * fProducts
void SetReactant2(G4MolecularConfiguration *reactive)
G4DNAMolecularReactionTable()
static G4MoleculeTable * GetMoleculeTable()
G4MolecularConfiguration * GetReactant1() const
void SetPolynomialParameterization(const std::vector< double > &P)
void SetScaledParameterization(double temperature_K, double rateCste)
G4MolecularConfiguration * GetReactant2() const
G4MolecularConfiguration * fReactant2
static constexpr double pi
static constexpr double mole
G4double fObservedReactionRate
const G4DNAMolecularReactionTable * GetReactionTable()
ReactionDataMap fReactionData
std::vector< const G4DNAMolecularReactionData * > fVectorOfReactionData
static constexpr double mole
const std::vector< G4MolecularConfiguration * > * CanReactWith(G4MolecularConfiguration *) const
G4MolecularConfiguration * GetProduct(G4int i) const
virtual void InitialiseToPrint(G4MolecularConfiguration *)=0
G4double fEffectiveReactionRadius
G4MolecularConfiguration * GetConfiguration(const G4String &, bool mustExist=true)