55 ios(_ios), f(_ios.flags())
78 fReducedReactionRadius(0.),
95 if (*reactive1 == *reactive2)
263 if (reactive1 != reactive2)
276 reactionRate, reactive1, reactive2);
292 ReactivesMV::iterator itReactives;
294 map<G4Molecule*, map<G4Molecule*, G4bool> > alreadyPrint;
296 G4cout <<
"Number of chemical species involved in reactions = "
310 const vector<const G4Molecule*>* reactivesVector =
CanReactWith(moleculeA);
316 for (
G4int iReact = 0; iReact < nbReactants; iReact++)
326 if (!alreadyPrint[moleculeA][moleculeB])
328 outputReaction[
n] = moleculeA->
GetName() +
" + " + moleculeB->GetName();
336 for (
G4int j = 1; j < nbProducts; j++)
343 outputReaction[
n] +=
" -> No product";
354 if (pReactionModel) interactionRange =
357 if (interactionRange != -1)
367 alreadyPrint[moleculeB][moleculeA] =
TRUE;
379 G4int maxlengthOutputReaction = -1;
380 G4int maxlengthOutputReactionRate = -1;
382 for (
G4int i = 0; i <
n; i++)
384 if (maxlengthOutputReaction < (
G4int) outputReaction[i].length())
386 maxlengthOutputReaction = outputReaction[i].length();
388 if (maxlengthOutputReactionRate < (
G4int) outputReactionRate[i].length())
390 maxlengthOutputReactionRate = outputReactionRate[i].length();
394 maxlengthOutputReaction += 2;
395 maxlengthOutputReactionRate += 2;
397 if (maxlengthOutputReaction < 10) maxlengthOutputReaction = 10;
398 if (maxlengthOutputReactionRate < 30) maxlengthOutputReactionRate = 30;
402 if (pReactionModel) title =
new G4String[3];
405 title[0] =
"Reaction";
406 title[1] =
"Reaction Rate [dm3/(mol*s)]";
408 if (pReactionModel) title[2] =
409 "Interaction Range for chosen reaction model [nm]";
411 G4cout << setfill(
' ') << setw(maxlengthOutputReaction) <<
left << title[0]
412 << setw(maxlengthOutputReactionRate) <<
left << title[1];
414 if (pReactionModel)
G4cout << setw(2) <<
left << title[2];
419 if (pReactionModel)
G4cout.width(
420 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
421 + (
G4int) title[2].length());
422 else G4cout.width(maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
426 for (
G4int i = 0; i <
n; i++)
428 G4cout << setw(maxlengthOutputReaction) <<
left << outputReaction[i]
429 << setw(maxlengthOutputReactionRate) <<
left
430 << outputReactionRate[i];
432 if (pReactionModel)
G4cout << setw(2) <<
left << outputRange[i];
437 if (pReactionModel)
G4cout.width(
438 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate + 2
439 + (
G4int) title[2].length());
441 maxlengthOutputReaction + 2 + maxlengthOutputReactionRate);
447 delete[] outputReaction;
448 delete[] outputReactionRate;
449 delete[] outputRange;
460 G4String errMsg =
"No reaction table was implemented";
461 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
466 ReactionDataMap::const_iterator it1 =
fReactionData.find(reactive1);
471 "No reaction table was implemented for this molecule Definition : " + reactive1
475 G4Exception(
"G4MolecularInteractionTable::GetReactionData",
"",
480 std::map<const G4Molecule*, const G4DNAMolecularReactionData*, compMoleculeP>::const_iterator it2 =
481 it1->second.find(reactive2);
483 if (it2 == it1->second.end())
486 G4String errMsg =
"No reaction table was implemented for this molecule : "
487 + reactive2 -> GetName();
491 return (it2->second);
494 const std::vector<const G4Molecule*>*
499 G4String errMsg =
"No reaction table was implemented";
500 G4Exception(
"G4MolecularInteractionTable::CanReactWith",
"",
505 ReactivesMV::const_iterator itReactivesMap =
fReactivesMV.find(aMolecule);
512 G4String errMsg =
"No reaction table was implemented for this molecule : "
515 G4cout <<
"--- G4MolecularInteractionTable::GetReactionData ---" <<
G4endl;
525 G4cout<<
" G4MolecularInteractionTable::CanReactWith :"<<
G4endl;
527 G4cout<<
" the number of reactants is : " << itReactivesMap->second.size()<<
G4endl;
529 std::vector<const G4Molecule*>::const_iterator itProductsVector =
530 itReactivesMap->second.begin();
532 for(; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
537 return &(itReactivesMap->second);
550 G4String errMsg =
"No reaction table was implemented";
551 G4Exception(
"G4MolecularInteractionTable::CanInteractWith",
"",
556 ReactionDataMap::const_iterator itReactivesMap =
fReactionData.find(molecule);
561 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
562 + molecule -> GetName();
569 G4cout<<
" G4MolecularInteractionTable::CanReactWith :"<<
G4endl;
571 G4cout<<
" the number of reactants is : " << itReactivesMap->second.size()<<
G4endl;
576 itReactivesMap->second.begin();
578 for(; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
583 return &(itReactivesMap->second);
589 const std::vector<const G4DNAMolecularReactionData*>*
594 G4String errMsg =
"No reaction table was implemented";
595 G4Exception(
"G4MolecularInteractionTable::CanInteractWith",
"",
604 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
605 + molecule -> GetName();
610 return &(it->second);
G4VDNAReactionModel is an interface used by the G4DNAMolecularReaction process.
static void DeleteInstance()
virtual ~G4DNAMolecularReactionTable()
void AddProduct(const G4Molecule *molecule)
Free interface to define reaction information.
void SetReactive1(const G4Molecule *reactive)
static const double nanometer
G4DNAMolecularReactionTable sorts out the G4DNAMolecularReactionData for bimolecular reaction...
const G4Molecule * fReactive2
void SetReactive(const G4Molecule *reactive1, const G4Molecule *reactive2)
G4double fReducedReactionRadius
static G4String ConvertToString(G4bool boolVal)
G4double GetDiffusionCoefficient() const
Returns the diffusion coefficient D.
ReactionDataMV fReactionDataMV
~G4DNAMolecularReactionData()
static G4DNAMolecularReactionTable * GetReactionTable()
const G4String & GetName() const
Returns the name of the molecule.
const G4Molecule * GetProduct(G4int i) const
G4GLOB_DLL std::ostream G4cout
void SetReactionTable(const G4DNAMolecularReactionTable *)
void SetReactive2(const G4Molecule *reactive)
const G4Molecule * GetReactive2() const
virtual void InitialiseToPrint(const G4Molecule *)=0
const G4Molecule * fReactive1
static G4MoleculeTable * Instance()
void PrintTable(G4VDNAReactionModel *=0)
IosFlagSaver(std::ostream &_ios)
static G4DNAMolecularReactionTable * fInstance
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4int GetNbProducts() const
G4DNAMolecularReactionData contains the information relative to a given reaction (eg : °OH + °OH -> H...
G4DNAMolecularReactionData()
void SetReaction(G4double observedReactionRate, const G4Molecule *reactive1, const G4Molecule *reactive2)
Define a reaction : First argument : reaction rate Second argument : reactant 1 Third argument : reac...
G4Molecule * GetMoleculeModel(const G4String &, bool mustExist=true)
std::vector< const G4Molecule * > * fProducts
const G4DNAMolecularReactionData * GetReactionData(const G4Molecule *, const G4Molecule *) const
G4DNAMolecularReactionTable()
virtual G4double GetReactionRadius(const G4Molecule *, const G4Molecule *)=0
Class Description The dynamic molecule holds all the data that change for a molecule It has a pointer...
const G4DNAMolecularReactionTable * GetReactionTable()
ReactionDataMap fReactionData
const std::vector< const G4Molecule * > * CanReactWith(const G4Molecule *aMolecule) const
Given a molecule's type, it returns with which a reaction is allowed.
const G4Molecule * GetReactive1() const
const std::map< const G4Molecule *, const G4DNAMolecularReactionData *, compMoleculeP > * GetReativesNData(const G4Molecule *aMolecule) const
G4double GetReactionRate() const