54 fReactive1(),fReactive2(),
55 fReactionRate(0.),fReducedReactionRadius(0.),
69 if(*reactive1 == *reactive2)
150 for(it2 = it1->second.begin();it2 != it1->second.end();it2++)
152 const G4DNAMolecularReactionData* reactionData = it2->second;
155 const G4Molecule* reactive1 = reactionData->
GetReactive1();
156 const G4Molecule* reactive2 = reactionData->
GetReactive2();
180 if(reactive1 != reactive2)
203 pReactionModel -> SetReactionTable(
this);
206 ReactivesMV::iterator itReactives;
208 map<G4Molecule*,map<G4Molecule*, G4bool> > alreadyPrint;
222 const vector<const G4Molecule*>* reactivesVector =
CanReactWith(moleculeA);
225 pReactionModel -> InitialiseToPrint(moleculeA);
229 for(
G4int iReact = 0 ; iReact < nbReactants ; iReact++)
238 if(!alreadyPrint[moleculeA][moleculeB])
243 moleculeB->GetName();
251 for(
G4int j = 1 ; j < nbProducts ; j++)
258 outputReaction[
n]+=
" -> No product";
271 if(interactionRange!=-1)
280 alreadyPrint[moleculeB][moleculeA] =
TRUE;
292 G4int maxlengthOutputReaction = -1;
293 G4int maxlengthOutputReactionRate = -1;
295 for(
G4int i = 0 ; i <
n ; i++)
297 if(maxlengthOutputReaction < (
G4int) outputReaction[i].length())
299 maxlengthOutputReaction = outputReaction[i].length();
301 if(maxlengthOutputReactionRate < (
G4int)outputReactionRate[i].length())
303 maxlengthOutputReactionRate = outputReactionRate[i].length();
307 maxlengthOutputReaction+=2;
308 maxlengthOutputReactionRate+=2;
310 if(maxlengthOutputReaction<10) maxlengthOutputReaction = 10;
311 if(maxlengthOutputReactionRate<30) maxlengthOutputReactionRate = 30;
315 title[0] =
"Reaction";
316 title[1] =
"Reaction Rate [dm3/(mol*s)]";
317 title[2] =
"Interaction Range for chosen reaction model";
320 << setw(maxlengthOutputReaction) <<
left << title[0]
321 << setw(maxlengthOutputReactionRate) <<
left << title[1]
322 << setw(2) <<
left << title[2]
326 G4cout.width(maxlengthOutputReaction+2+maxlengthOutputReactionRate+2+(
G4int)title[2].length());
330 for(
G4int i = 0 ; i <
n ; i ++)
332 G4cout<< setw(maxlengthOutputReaction)<<
left << outputReaction[i]
333 << setw(maxlengthOutputReactionRate) <<
left << outputReactionRate[i]
334 << setw(2) <<
left <<outputRange[i]
338 G4cout.width(maxlengthOutputReaction+2+maxlengthOutputReactionRate+2+(
G4int)title[2].length());
343 delete [] outputReaction;
344 delete [] outputReactionRate;
345 delete [] outputRange;
356 G4String errMsg =
"No reaction table was implemented";
361 ReactionDataMap::const_iterator it1 =
fReactionData.find(reactive1);
366 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
367 + reactive1 -> GetName();
373 compMoleculeP>::const_iterator it2 = it1->second.find(reactive2);
375 if(it2 == it1->second.end())
378 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
379 + reactive2 -> GetName();
383 return (it2->second);
386 const std::vector<const G4Molecule*>*
391 G4String errMsg =
"No reaction table was implemented";
396 ReactivesMV::const_iterator itReactivesMap =
fReactivesMV.find(aMolecule) ;
401 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
402 + aMolecule -> GetName();
410 G4cout<<
" G4MolecularInteractionTable::CanReactWith :"<<
G4endl;
412 G4cout<<
" the number of reactants is : " << itReactivesMap->second.size()<<
G4endl;
414 std::vector<const G4Molecule*>::const_iterator itProductsVector =
415 itReactivesMap->second.begin();
417 for( ; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
422 return &(itReactivesMap->second);
428 const std::map<const G4Molecule*, const G4DNAMolecularReactionData*, compMoleculeP>*
434 G4String errMsg =
"No reaction table was implemented";
439 ReactionDataMap::const_iterator itReactivesMap =
fReactionData.find(molecule) ;
444 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
445 + molecule -> GetName();
452 G4cout<<
" G4MolecularInteractionTable::CanReactWith :"<<
G4endl;
454 G4cout<<
" the number of reactants is : " << itReactivesMap->second.size()<<
G4endl;
459 itReactivesMap->second.begin();
461 for( ; itProductsVector != itReactivesMap->second.end(); itProductsVector++)
466 return &(itReactivesMap->second);
472 const std::vector<const G4DNAMolecularReactionData*>*
477 G4String errMsg =
"No reaction table was implemented";
486 G4String errMsg =
"No reaction table was implemented for this molecule Definition : "
487 + molecule -> GetName();
492 return &(it->second);
std::vector< G4MoleculeHandle > * fProducts
static void DeleteInstance()
virtual ~G4DNAMolecularReactionTable()
void AddProduct(const G4Molecule *molecule)
G4MoleculeHandle GetMoleculeHandle(const G4Molecule *)
void SetReactive1(const G4Molecule *reactive)
void SetReactive(const G4Molecule *reactive1, const G4Molecule *reactive2)
G4double fReducedReactionRadius
static G4String ConvertToString(G4bool boolVal)
G4double GetDiffusionCoefficient() const
ReactionDataMV fReactionDataMV
~G4DNAMolecularReactionData()
static G4DNAMolecularReactionTable * GetReactionTable()
const G4String & GetName() const
const G4Molecule * GetProduct(G4int i) const
G4GLOB_DLL std::ostream G4cout
void SetReactive2(const G4Molecule *reactive)
const G4Molecule * GetReactive2() const
void PrintTable(G4VDNAReactionModel *=0)
static G4DNAMolecularReactionTable * fInstance
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4int GetNbProducts() const
G4DNAMolecularReactionData()
void SetReaction(G4double observedReactionRate, const G4Molecule *reactive1, const G4Molecule *reactive2)
subroutine title(NA, NB, NCA, NCB)
const G4DNAMolecularReactionData * GetReactionData(const G4Molecule *, const G4Molecule *) const
G4DNAMolecularReactionTable()
G4MoleculeHandle fReactive2
virtual G4double GetReactionRadius(const G4Molecule *, const G4Molecule *)=0
G4MoleculeHandle fReactive1
const G4DNAMolecularReactionTable * GetReactionTable()
ReactionDataMap fReactionData
const std::vector< const G4Molecule * > * CanReactWith(const G4Molecule *aMolecule) const
static G4MoleculeHandleManager * Instance()
const G4Molecule * GetReactive1() const
const std::map< const G4Molecule *, const G4DNAMolecularReactionData *, compMoleculeP > * GetReativesNData(const G4Molecule *aMolecule) const
G4double GetReactionRate() const