43 #include "CLHEP/Utility/memory.h"
48 using namespace CLHEP;
59 trackA(tA), moleculeB(mB)
79 if (
this == &rhs)
return *
this;
93 fMolecularReactionTable(
108 #if defined (DEBUG_MEM)
109 MemStat mem_first, mem_second, mem_diff;
112 #if defined (DEBUG_MEM)
117 #if defined (DEBUG_MEM)
119 mem_diff = mem_second-mem_first;
120 G4cout <<
"\t || MEM || G4DNAMoleculeEncounterStepper::Prepare || "
121 "After computing G4ITManager<G4Molecule>::Instance()->"
122 "UpdatePositionMap, diff is : " << mem_diff <<
G4endl;
137 return std::numeric_limits<T>::has_infinity
138 && value == std::numeric_limits<T>::infinity();
156 <<
"_______________________________________________________________________"
158 G4cout <<
"G4DNAMoleculeEncounterStepper::CalculateStep" <<
G4endl;
159 G4cout <<
"Check done for molecule : " << moleculeA->
GetName()
170 if (!reactivesVector)
178 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will return infinity "
179 "for the reaction because the molecule "
181 <<
" does not have any reactants given in the reaction table."
189 G4int nbReactives = reactivesVector->size();
191 if (nbReactives == 0)
200 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will return infinity "
201 "for the reaction because the molecule "
203 <<
" does not have any reactants given in the reaction table."
204 <<
"This message can also result from a wrong implementation of the reaction table."
227 for (
G4int i = 0; i < nbReactives; i++)
229 const G4Molecule* moleculeB = (*reactivesVector)[i];
242 if (resultsNearest == 0)
continue;
244 G4double r2 = resultsNearest->GetDistanceSqr();
245 Utils utils(trackA, moleculeB);
299 -> FindNearestInRange(moleculeA, moleculeB,range));
346 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will finally return :"
351 G4cout <<
"Selected reactants for trackA: " << moleculeA->
GetName()
354 vector<G4Track*>::iterator it;
388 for (results->Rewind(); !results->End(); results->Next())
391 G4IT* reactiveB = results->GetItem<
G4IT>();
406 <<
"The reactant B found using the ITManager does not have a valid "
407 "track attached to it. If this is done on purpose, please do "
408 "not record this molecule in the ITManager."
410 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
412 exceptionDescription);
420 <<
"The track status of one of the nearby reactants is not fAlive"
422 exceptionDescription <<
"The incomming trackID "
423 <<
"(trackA entering in G4DNAMoleculeEncounterStepper and "
424 <<
"for which you are looking reactant for) is : "
427 exceptionDescription <<
"And the trackID of the reactant (trackB) is: "
430 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
432 exceptionDescription);
436 if (trackB == &utils.
trackA)
441 <<
"A track is reacting with itself (which is impossible) ie trackA == trackB"
443 exceptionDescription <<
"Molecule A (and B) is of type : "
447 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
449 exceptionDescription);
459 <<
"The interacting tracks are not synchronized in time" <<
G4endl;
461 <<
"trackB->GetGlobalTime() != trackA.GetGlobalTime()" <<
G4endl;
465 <<
"\t trackA->GetGlobalTime() = "
468 exceptionDescription <<
"trackB : trackID : " << trackB->
GetTrackID()
470 <<
"\t trackB->GetGlobalTime() = "
473 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
475 exceptionDescription);
481 G4double r2 = results->GetDistanceSqr();
482 G4cout <<
"\t ************************************************** " <<
G4endl;
483 G4cout <<
"\t Reaction between "
486 <<
"Interaction Range = "
488 G4cout <<
"\t Real distance between reactants = "
490 G4cout <<
"\t Distance between reactants calculated by nearest neighbor algorithm = "
const G4ITReactionTable * fpReactionTable
void CheckAndRecordResults(const Utils &, G4KDTreeResultHandle &)
std::ostringstream G4ExceptionDescription
G4VDNAReactionModel * fReactionModel
G4TrackVectorHandle fReactants
G4bool fHasAlreadyReachedNullTime
virtual void Initialise(const G4Molecule *, const G4Track &)
This macro is defined in AddClone_def.
G4DNAMoleculeEncounterStepper & operator=(const G4DNAMoleculeEncounterStepper &)
G4DNAMoleculeEncounterStepper()
const G4ThreeVector & GetPosition() const
G4TrackStatus GetTrackStatus() const
G4DNAMolecularReactionTable sorts out the G4DNAMolecularReactionData for bimolecular reaction...
ReturnType & reference_cast(OriginalType &source)
G4double GetDiffusionCoefficient() const
Returns the diffusion coefficient D.
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
virtual ~G4DNAMoleculeEncounterStepper()
virtual G4double CalculateStep(const G4Track &, const G4double &)
G4double fSampledMinTimeStep
const G4String & GetName() const
Returns the name of the molecule.
G4GLOB_DLL std::ostream G4cout
static G4ThreadLocal G4double fUserMinTimeStep
Utils(const G4Track &tA, const G4Molecule *mB)
const std::vector< const G4Molecule * > * CanReactWith(const G4Molecule *) const
Given a molecule's type, it returns with which a reaction is allowed.
const G4Molecule * moleculeA
G4double GetGlobalTime() const
G4Molecule * GetMolecule(const G4Track &track)
void InitializeForNewTrack()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual void UpdatePositionMap()
static G4ITFinder * Instance()
const G4DNAMolecularReactionTable *& fMolecularReactionTable
Given a molecule G4DNAMoleculeEncounterStepper will calculate for its possible reactants what will be...
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 G4Molecule * moleculeB
Before stepping all tracks G4Scheduler calls all the G4VITModel which may contain a G4VITTimeStepper ...