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));
345 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will finally return :"
350 G4cout <<
"Selected reactants for trackA: " << moleculeA->
GetName()
353 vector<G4Track*>::iterator it;
387 for (results->Rewind(); !results->End(); results->Next())
390 G4IT* reactiveB = results->GetItem<
G4IT>();
405 <<
"The reactant B found using the ITManager does not have a valid "
406 "track attached to it. If this is done on purpose, please do "
407 "not record this molecule in the ITManager."
409 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
411 exceptionDescription);
419 <<
"The track status of one of the nearby reactants is not fAlive"
421 exceptionDescription <<
"The incomming trackID "
422 <<
"(trackA entering in G4DNAMoleculeEncounterStepper and "
423 <<
"for which you are looking reactant for) is : "
426 exceptionDescription <<
"And the trackID of the reactant (trackB) is: "
429 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
431 exceptionDescription);
435 if (trackB == &utils.
trackA)
440 <<
"A track is reacting with itself (which is impossible) ie trackA == trackB"
442 exceptionDescription <<
"Molecule A (and B) is of type : "
446 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
448 exceptionDescription);
458 <<
"The interacting tracks are not synchronized in time" <<
G4endl;
460 <<
"trackB->GetGlobalTime() != trackA.GetGlobalTime()" <<
G4endl;
464 <<
"\t trackA->GetGlobalTime() = "
467 exceptionDescription <<
"trackB : trackID : " << trackB->
GetTrackID()
469 <<
"\t trackB->GetGlobalTime() = "
472 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
474 exceptionDescription);
480 G4double r2 = results->GetDistanceSqr();
481 G4cout <<
"\t ************************************************** " <<
G4endl;
482 G4cout <<
"\t Reaction between "
485 <<
"Interaction Range = "
487 G4cout <<
"\t Real distance between reactants = "
489 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 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
const std::vector< const G4Molecule * > * CanReactWith(const G4Molecule *aMolecule) const
Given a molecule's type, it returns with which a reaction is allowed.
Before stepping all tracks G4Scheduler calls all the G4VITModel which may contain a G4VITTimeStepper ...