53 fHasAlreadyReachedNullTime =
false;
58 if(
this == &rhs)
return *
this;
60 fVerbose = rhs.fVerbose;
61 fMolecularReactionTable = rhs.fMolecularReactionTable;
62 fHasAlreadyReachedNullTime =
false;
73 fVerbose = right.fVerbose ;
74 fMolecularReactionTable = right.fMolecularReactionTable;
76 fHasAlreadyReachedNullTime =
false;
98 G4cout <<
"_______________________________________________________________________" <<
G4endl;
99 G4cout <<
"G4DNAMoleculeEncounterStepper::CalculateStep" <<
G4endl;
108 const vector<const G4Molecule*>* reactivesVector =
109 fMolecularReactionTable -> CanReactWith(moleculeA);
119 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will return infinity for the reaction because the molecule "
121 <<
" does not have any reactants given in the reaction table."
129 G4int nbReactives = reactivesVector->size();
139 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will return infinity for the reaction because the molecule "
141 <<
" does not have any reactants given in the reaction table."
142 <<
"This message can also result from a wrong implementation of the reaction table."
164 fHasAlreadyReachedNullTime =
false;
166 fReactionModel -> Initialise(moleculeA, trackA) ;
170 for (
G4int i=0 ; i<nbReactives ; i++)
172 const G4Molecule* moleculeB = (*reactivesVector)[i];
177 R = fReactionModel -> GetReactionRadius(i);
182 -> FindNearest(moleculeA, moleculeB));
184 RetrieveResults(trackA,moleculeA,moleculeB,R,results,
true);
191 G4cout <<
"G4MoleculeEncounterStepper::CalculateStep will finally return :"
198 vector<G4Track*>::iterator it;
213 void G4DNAMoleculeEncounterStepper::RetrieveResults(
const G4Track& trackA,
const G4Molecule* moleculeA,
224 <<
" found to react with "
235 for(results->Rewind();
240 G4IT* reactiveB = (
G4IT*) results->GetItemData() ;
254 exceptionDescription <<
"The reactant B found using the ITManager does not have a valid track "
255 <<
" attached to it. If this is done on purpose, please do not record this "
256 <<
" molecule in the ITManager."
258 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
"MoleculeEncounterStepper001",
266 exceptionDescription <<
"The track status of one of the nearby reactants is not fAlive" <<
G4endl;
267 exceptionDescription <<
"The incomming trackID "
268 <<
"(trackA entering in G4DNAMoleculeEncounterStepper and "
269 <<
"for which you are looking reactant for) is : "
271 exceptionDescription <<
"And the trackID of the reactant (trackB) is: "
273 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
"MoleculeEncounterStepper002",
278 if(trackB == &trackA)
282 exceptionDescription <<
"A track is reacting with itself (which is impossible) ie trackA == trackB"
284 exceptionDescription <<
"Molecule A (and B) is of type : "
286 <<
" with trackID : "
289 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
"MoleculeEncounterStepper003",
298 exceptionDescription <<
"The interacting tracks are not synchronized in time"<<
G4endl;
299 exceptionDescription<<
"trackB->GetGlobalTime() != trackA.GetGlobalTime()"
302 exceptionDescription <<
"trackA : trackID : " << trackA.
GetTrackID()
303 <<
"\t Name :" << moleculeA->
GetName()
304 <<
"\t trackA->GetGlobalTime() = "
307 exceptionDescription <<
"trackB : trackID : " << trackB->
GetTrackID()
308 <<
"\t Name :" << moleculeB->
GetName()
309 <<
"\t trackB->GetGlobalTime() = "
312 G4Exception(
"G4DNAMoleculeEncounterStepper::RetrieveResults",
"MoleculeEncounterStepper004",
316 G4double r2 = results->GetDistanceSqr() ;
320 G4cout <<
"\t ************************************************** " <<
G4endl;
321 G4cout <<
"\t Reaction between "
324 <<
"Interaction Range = "
326 G4cout <<
"\t Real distance between reactants = "
328 G4cout <<
"\t Distance between reactants calculated by nearest neighbor algorithm = "
341 if(fHasAlreadyReachedNullTime ==
false)
344 fHasAlreadyReachedNullTime =
true;
351 -> FindNearestInRange(moleculeA, moleculeB,R));
352 RetrieveResults(trackA, moleculeA, moleculeB, R, results2,
false);
365 /(16 * (DA + DB + 2*sqrt(DA*DB)));
static G4ThreadLocal G4double fUserMinTimeStep
std::ostringstream G4ExceptionDescription
G4DNAMoleculeEncounterStepper()
const G4ThreeVector & GetPosition() const
G4TrackStatus GetTrackStatus() const
ReturnType & reference_cast(OriginalType &source)
G4double GetDiffusionCoefficient() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const G4ThreeVector const G4double const
G4TrackVectorHandle fReactants
virtual ~G4DNAMoleculeEncounterStepper()
virtual G4double CalculateStep(const G4Track &, const G4double &)
const G4String & GetName() const
G4GLOB_DLL std::ostream G4cout
static G4ITManager< T > * Instance()
G4double GetGlobalTime() const
G4Molecule * GetMolecule(const G4Track &track)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double fSampledMinTimeStep