49 using namespace CLHEP;
60 trackA(tA), moleculeB(mB)
80 if (
this == &rhs)
return *
this;
109 #if defined (DEBUG_MEM) 110 MemStat mem_first, mem_second, mem_diff;
113 #if defined (DEBUG_MEM) 118 #if defined (DEBUG_MEM) 120 mem_diff = mem_second-mem_first;
121 G4cout <<
"\t || MEM || G4DNAMoleculeEncounterStepper::Prepare || " 122 "After computing G4ITManager<G4Molecule>::Instance()->" 123 "UpdatePositionMap, diff is : " << mem_diff <<
G4endl;
138 return std::numeric_limits<T>::has_infinity
139 && value == std::numeric_limits<T>::infinity();
158 <<
"_______________________________________________________________________" 160 G4cout <<
"G4DNAMoleculeEncounterStepper::CalculateStep" <<
G4endl;
161 G4cout <<
"Check done for molecule : " << moleculeA->
GetName()
162 <<
" (" << trackA.GetTrackID() <<
") " 174 if (!reactivesVector)
182 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will return infinity " 183 "for the reaction because the molecule " 185 <<
" does not have any reactants given in the reaction table." 193 G4int nbReactives = reactivesVector->size();
195 if (nbReactives == 0)
204 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will return infinity " 205 "for the reaction because the molecule " 207 <<
" does not have any reactants given in the reaction table." 208 <<
"This message can also result from a wrong implementation of the reaction table." 231 for (
G4int i = 0; i < nbReactives; i++)
247 if (resultsNearest == 0)
continue;
249 G4double r2 = resultsNearest->GetDistanceSqr();
250 Utils utils(trackA, moleculeB);
303 FindNearestInRange(moleculeA,
352 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will finally return :" 357 G4cout <<
"Selected reactants for trackA: " << moleculeA->
GetName()
358 <<
" (" << trackA.GetTrackID() <<
") are: ";
360 vector<G4Track*>::iterator it;
363 G4Track* trackB = *it;
365 << trackB->GetTrackID() <<
") \t ";
394 for (results->Rewind(); !results->End(); results->Next())
397 G4IT* reactiveB = results->GetItem<
G4IT>();
406 G4Track *trackB = reactiveB->
GetTrack();
412 <<
"The reactant B found using the MoleculeFinder does not have a valid " 413 "track attached to it. If this is done on purpose, please do " 414 "not record this molecule in the MoleculeFinder." 416 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
418 exceptionDescription);
422 if (trackB->GetTrackStatus() != fAlive)
442 if (trackB == &utils.
trackA)
447 <<
"A track is reacting with itself (which is impossible) ie trackA == trackB" 449 exceptionDescription <<
"Molecule A (and B) is of type : " 453 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
455 exceptionDescription);
459 if (fabs(trackB->GetGlobalTime() - utils.
trackA.GetGlobalTime())
460 > utils.
trackA.GetGlobalTime() * (1 - 1 / 100))
465 <<
"The interacting tracks are not synchronized in time" <<
G4endl;
467 <<
"trackB->GetGlobalTime() != trackA.GetGlobalTime()" <<
G4endl;
469 exceptionDescription <<
"trackA : trackID : " << utils.
trackA.GetTrackID()
471 <<
"\t trackA->GetGlobalTime() = " 474 exceptionDescription <<
"trackB : trackID : " << trackB->GetTrackID()
476 <<
"\t trackB->GetGlobalTime() = " 477 <<
G4BestUnit(trackB->GetGlobalTime(),
"Time") << G4endl;
479 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
481 exceptionDescription);
487 G4double r2 = results->GetDistanceSqr();
488 G4cout <<
"\t ************************************************** " <<
G4endl;
489 G4cout <<
"\t Reaction between " 491 <<
" & " << utils.
moleculeB->
GetName() <<
" (" << trackB->GetTrackID() <<
"), " 492 <<
"Interaction Range = " 494 G4cout <<
"\t Real distance between reactants = " 495 <<
G4BestUnit((utils.
trackA.GetPosition() - trackB->GetPosition()).mag(),
"Length")<<G4endl;
496 G4cout <<
"\t Distance between reactants calculated by nearest neighbor algorithm = "
const G4ITReactionTable * fpReactionTable
void CheckAndRecordResults(const Utils &, G4KDTreeResultHandle &)
std::ostringstream G4ExceptionDescription
G4VDNAReactionModel * fReactionModel
const G4String & GetName() const
G4TrackVectorHandle fReactants
G4bool fHasAlreadyReachedNullTime
G4DNAMoleculeEncounterStepper & operator=(const G4DNAMoleculeEncounterStepper &)
G4DNAMoleculeEncounterStepper()
ReturnType & reference_cast(OriginalType &source)
static G4ITFinder * Instance()
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
virtual ~G4DNAMoleculeEncounterStepper()
virtual G4double CalculateStep(const G4Track &, const G4double &)
G4double fSampledMinTimeStep
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
static G4ThreadLocal G4double fUserMinTimeStep
virtual G4double GetReactionRadius(G4MolecularConfiguration *, G4MolecularConfiguration *)=0
G4MolecularConfiguration * GetMolecularConfiguration() const
virtual void UpdatePositionMap()
const G4Molecule * moleculeA
virtual void Initialise(G4MolecularConfiguration *, const G4Track &)
G4Molecule * GetMolecule(const G4Track &track)
void InitializeForNewTrack()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Utils(const G4Track &tA, G4MolecularConfiguration *mB)
const G4DNAMolecularReactionTable *& fMolecularReactionTable
G4double GetDiffusionCoefficient() const
G4MolecularConfiguration * moleculeB
G4double GetDiffusionCoefficient() const
G4int GetMoleculeID() const
const std::vector< G4MolecularConfiguration * > * CanReactWith(G4MolecularConfiguration *) const