60 , fpMoleculeB(pMoleculeB)
85#if defined (DEBUG_MEM)
86 MemStat mem_first, mem_second, mem_diff;
89#if defined (DEBUG_MEM)
94#if defined (DEBUG_MEM)
96 mem_diff = mem_second - mem_first;
97 G4cout <<
"\t || MEM || G4DNAMoleculeEncounterStepper::Prepare || "
98 "After computing G4ITManager<G4Molecule>::Instance()->"
99 "UpdatePositionMap, diff is : " << mem_diff <<
G4endl;
116 return std::numeric_limits<T>::has_infinity
117 && value == std::numeric_limits<T>::infinity();
132 <<
"_______________________________________________________________________"
134 G4cout <<
"G4DNAMoleculeEncounterStepper::CalculateStep" <<
G4endl;
135 G4cout <<
"Check done for molecule : " << pMoleculeA->GetName()
143 auto pMolConfA = pMoleculeA->GetMolecularConfiguration();
155 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will return infinity "
156 "for the reaction because the molecule "
157 << pMoleculeA->GetName()
158 <<
" does not have any reactants given in the reaction table."
166 G4int nbReactives = pReactantList->size();
168 if (nbReactives == 0)
177 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will return infinity "
178 "for the reaction because the molecule "
179 << pMoleculeA->GetName()
180 <<
" does not have any reactants given in the reaction table."
181 <<
"This message can also result from a wrong implementation of the reaction table."
194 for (
G4int i = 0; i < nbReactives; i++)
196 auto pMoleculeB = (*pReactantList)[i];
206 pMoleculeB->GetMoleculeID()));
208 if (resultsNearest == 0)
continue;
210 G4double r2 = resultsNearest->GetDistanceSqr();
211 Utils utils(trackA, pMoleculeB);
229 pMoleculeB->GetMoleculeID(),
259 FindNearestInRange(pMoleculeA,
260 pMoleculeB->GetMoleculeID(),
291 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will finally return :"
296 G4cout <<
"Selected reactants for trackA: " << pMoleculeA->GetName()
299 vector<G4Track*>::iterator it;
332 for (results->Rewind(); !results->End(); results->Next())
334 G4IT* reactiveB = results->GetItem<
G4IT>();
347 <<
"The reactant B found using the MoleculeFinder does not have a valid "
348 "track attached to it. If this is done on purpose, please do "
349 "not record this molecule in the MoleculeFinder."
351 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
353 exceptionDescription);
366 <<
"A track is reacting with itself (which is impossible) ie fpTrackA == trackB"
368 exceptionDescription <<
"Molecule A (and B) is of type : "
372 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
374 exceptionDescription);
384 <<
"The interacting tracks are not synchronized in time" <<
G4endl;
386 <<
"trackB->GetGlobalTime() != fpTrackA.GetGlobalTime()" <<
G4endl;
390 <<
"\t fpTrackA->GetGlobalTime() = "
393 exceptionDescription <<
"trackB : trackID : " << trackB->
GetTrackID()
395 <<
"\t trackB->GetGlobalTime() = "
398 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
400 exceptionDescription);
407 G4double r2 = results->GetDistanceSqr();
408 G4cout <<
"\t ************************************************** " <<
G4endl;
409 G4cout <<
"\t Reaction between "
412 <<
"Interaction Range = "
414 G4cout <<
"\t Real distance between reactants = "
416 G4cout <<
"\t Distance between reactants calculated by nearest neighbor algorithm = "
447 if (pTrack ==
nullptr)
450 exceptionDescription <<
"No track found.";
451 G4Exception(
"G4Scheduler::CalculateMinStep",
"ITScheduler006",
465 if (sampledMinTimeStep < fTSTimeStep)
467 fTSTimeStep = sampledMinTimeStep;
477 else if (fTSTimeStep == sampledMinTimeStep &&
bool(reactants))
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4shared_ptr< std::vector< G4Track * > > G4TrackVectorHandle
G4Molecule * GetMolecule(const G4Track &track)
ReturnType & reference_cast(OriginalType &source)
G4GLOB_DLL std::ostream G4cout
const ReactantList * CanReactWith(Reactant *) const
Utils(const G4Track &tA, const G4MolecularConfiguration *mB)
const G4MolecularConfiguration * fpMoleculeB
const G4Molecule * fpMoleculeA
void CheckAndRecordResults(const Utils &, G4KDTreeResultHandle &)
void InitializeForNewTrack()
G4VDNAReactionModel * GetReactionModel()
G4bool fHasAlreadyReachedNullTime
G4ITTrackHolder * fpTrackContainer
G4ITReactionSet * fReactionSet
G4DNAMoleculeEncounterStepper()
virtual G4double CalculateStep(const G4Track &, const G4double &)
G4VDNAReactionModel * fReactionModel
void SetReactionModel(G4VDNAReactionModel *)
virtual ~G4DNAMoleculeEncounterStepper()
const G4DNAMolecularReactionTable *& fMolecularReactionTable
virtual G4double CalculateMinTimeStep(G4double, G4double)
virtual void UpdatePositionMap()
static G4ITFinder * Instance()
static G4ITReactionSet * Instance()
void AddReactions(G4double time, G4Track *trackA, G4TrackVectorHandle reactants)
G4TrackList * GetMainList(Key)
static G4ITTrackHolder * Instance()
const G4String & GetName() const
G4double GetDiffusionCoefficient() const
const G4String & GetName() const
G4double GetDiffusionCoefficient() const
G4TrackStatus GetTrackStatus() const
const G4ThreeVector & GetPosition() const
G4double GetGlobalTime() const
virtual void Initialise(const G4MolecularConfiguration *, const G4Track &)
virtual G4double GetReactionRadius(const G4MolecularConfiguration *, const G4MolecularConfiguration *)=0
G4TrackVectorHandle fReactants
G4TrackVectorHandle GetReactants()
virtual void ResetReactants()
const G4ITReactionTable * fpReactionTable
static G4ThreadLocal G4double fUserMinTimeStep
G4double fSampledMinTimeStep