#include <G4DNAMoleculeEncounterStepper.hh>
Inheritance diagram for G4DNAMoleculeEncounterStepper:
Public Member Functions | |
G4DNAMoleculeEncounterStepper () | |
virtual | ~G4DNAMoleculeEncounterStepper () |
G4DNAMoleculeEncounterStepper (const G4DNAMoleculeEncounterStepper &) | |
virtual void | Prepare () |
virtual G4double | CalculateStep (const G4Track &, const G4double &) |
void | SetReactionModel (G4VDNAReactionModel *) |
G4VDNAReactionModel * | GetReactionModel () |
void | SetVerbose (int) |
This model includes dynamical time steps as explained in "Computer-Aided Stochastic Modeling of the Radiolysis of Liquid Water", V. Michalik, M. Begusová, E. A. Bigildeev, Radiation Research, Vol. 149, No. 3 (Mar., 1998), pp. 224-236
Definition at line 61 of file G4DNAMoleculeEncounterStepper.hh.
G4DNAMoleculeEncounterStepper::G4DNAMoleculeEncounterStepper | ( | ) |
Definition at line 47 of file G4DNAMoleculeEncounterStepper.cc.
00047 : 00048 G4VITTimeStepper(), 00049 fMolecularReactionTable(reference_cast<const G4DNAMolecularReactionTable*>(fpReactionTable)), 00050 fReactionModel(0) 00051 { 00052 fVerbose = 0; 00053 fHasAlreadyReachedNullTime = false; 00054 }
G4DNAMoleculeEncounterStepper::~G4DNAMoleculeEncounterStepper | ( | ) | [virtual] |
G4DNAMoleculeEncounterStepper::G4DNAMoleculeEncounterStepper | ( | const G4DNAMoleculeEncounterStepper & | ) |
Definition at line 69 of file G4DNAMoleculeEncounterStepper.cc.
References fMolecularReactionTable, and fVerbose.
00069 : 00070 G4VITTimeStepper(right), 00071 fMolecularReactionTable(reference_cast<const G4DNAMolecularReactionTable*>(fpReactionTable)) 00072 { 00073 fVerbose = right.fVerbose ; 00074 fMolecularReactionTable = right.fMolecularReactionTable; 00075 fReactionModel = 0; 00076 fHasAlreadyReachedNullTime = false; 00077 }
G4double G4DNAMoleculeEncounterStepper::CalculateStep | ( | const G4Track & | , | |
const G4double & | ||||
) | [virtual] |
Implements G4VITTimeStepper.
Definition at line 87 of file G4DNAMoleculeEncounterStepper.cc.
References DBL_MAX, G4VITTimeStepper::fReactants, G4VITTimeStepper::fSampledMinTimeStep, G4VITTimeStepper::fUserMinTimeStep, G4BestUnit, G4cout, G4endl, GetMolecule(), G4Molecule::GetName(), and G4Track::GetTrackID().
00088 { 00089 // DEBUG 00090 // G4cout << "G4MoleculeEncounterStepper::CalculateStep, time :" << G4ITTrackHolder::Instance()->GetGlobalTime() << G4endl; 00091 00092 G4Molecule* moleculeA = GetMolecule(trackA); 00093 00094 00095 #ifdef G4VERBOSE 00096 if(fVerbose) 00097 { 00098 G4cout << "_______________________________________________________________________" << G4endl; 00099 G4cout << "G4DNAMoleculeEncounterStepper::CalculateStep" << G4endl; 00100 G4cout << "Incident molecule : " << moleculeA->GetName() 00101 << " (" << trackA.GetTrackID() << ") " 00102 << G4endl; 00103 } 00104 #endif 00105 00106 //__________________________________________________________________ 00107 // Retrieve general informations for making reactions 00108 const vector<const G4Molecule*>* reactivesVector = 00109 fMolecularReactionTable -> CanReactWith(moleculeA); 00110 00111 if(!reactivesVector) 00112 { 00113 #ifdef G4VERBOSE 00114 // DEBUG 00115 if(fVerbose > 1) 00116 { 00117 G4cout << "!!!!!!!!!!!!!!!!!!!!"<<G4endl; 00118 G4cout << "!!! WARNING" << G4endl; 00119 G4cout << "G4MoleculeEncounterStepper::CalculateStep will return infinity for the reaction because the molecule " 00120 << moleculeA->GetName() 00121 << " does not have any reactants given in the reaction table." 00122 << G4endl; 00123 G4cout << "!!!!!!!!!!!!!!!!!!!!"<<G4endl; 00124 } 00125 #endif 00126 return DBL_MAX; 00127 } 00128 00129 G4int nbReactives = reactivesVector->size(); 00130 00131 if(nbReactives == 0) 00132 { 00133 #ifdef G4VERBOSE 00134 // DEBUG 00135 if(fVerbose) 00136 { 00137 G4cout << "!!!!!!!!!!!!!!!!!!!!"<<G4endl; 00138 G4cout << "!!! WARNING" << G4endl; 00139 G4cout << "G4MoleculeEncounterStepper::CalculateStep will return infinity for the reaction because the molecule " 00140 << moleculeA->GetName() 00141 << " does not have any reactants given in the reaction table." 00142 << "This message can also result from a wrong implementation of the reaction table." 00143 << G4endl; 00144 G4cout << "!!!!!!!!!!!!!!!!!!!!"<<G4endl; 00145 } 00146 #endif 00147 return DBL_MAX; 00148 } 00149 // DEBUG 00150 // else 00151 // { 00152 // G4cout << "nb reactants : " << nbReactives << " pour mol "<< moleculeA -> GetName () << G4endl; 00153 // for(int k=0 ; k < nbReactives ; k++) 00154 // { 00155 // G4cout << (*reactivesVector)[k]->GetName() << G4endl; 00156 // } 00157 // } 00158 00159 fUserMinTimeStep = userMinTimeStep ; 00160 if(fReactants) fReactants = 0 ; 00161 fReactants = new vector<G4Track*>(); 00162 00163 fSampledMinTimeStep = DBL_MAX; 00164 fHasAlreadyReachedNullTime = false; 00165 00166 fReactionModel -> Initialise(moleculeA, trackA) ; 00167 00168 //__________________________________________________________________ 00169 // Start looping on possible reactants 00170 for (G4int i=0 ; i<nbReactives ; i++) 00171 { 00172 const G4Molecule* moleculeB = (*reactivesVector)[i]; 00173 00174 //______________________________________________________________ 00175 // Retrieve reaction range 00176 G4double R = -1 ; // reaction Range 00177 R = fReactionModel -> GetReactionRadius(i); 00178 00179 //______________________________________________________________ 00180 // Use KdTree algorithm to find closest reactants 00181 G4KDTreeResultHandle results (G4ITManager<G4Molecule>::Instance() 00182 -> FindNearest(moleculeA, moleculeB)); 00183 00184 RetrieveResults(trackA,moleculeA,moleculeB,R,results, true); 00185 } 00186 00187 #ifdef G4VERBOSE 00188 // DEBUG 00189 if(fVerbose) 00190 { 00191 G4cout << "G4MoleculeEncounterStepper::CalculateStep will finally return :" 00192 << G4BestUnit(fSampledMinTimeStep, "Time")<< G4endl; 00193 00194 if(fVerbose > 1) 00195 { 00196 G4cout << "TrackA: " << moleculeA->GetName() << " (" << trackA.GetTrackID() << ") can react with: "; 00197 00198 vector<G4Track*>::iterator it; 00199 for(it = fReactants->begin() ; it != fReactants->end() ; it++) 00200 { 00201 G4Track* trackB = *it; 00202 G4cout << GetMolecule(trackB)->GetName() << " (" 00203 << trackB->GetTrackID() << ") \t "; 00204 } 00205 G4cout << G4endl; 00206 } 00207 } 00208 #endif 00209 return fSampledMinTimeStep ; 00210 }
G4VDNAReactionModel * G4DNAMoleculeEncounterStepper::GetReactionModel | ( | ) | [inline] |
void G4DNAMoleculeEncounterStepper::Prepare | ( | ) | [virtual] |
Reimplemented from G4VITTimeStepper.
Definition at line 79 of file G4DNAMoleculeEncounterStepper.cc.
References G4ITManager< T >::Instance(), and G4VITTimeStepper::Prepare().
00080 { 00081 // DEBUG 00082 // G4cout << "G4DNAMoleculeEncounterStepper::PrepareForAllProcessors" << G4endl; 00083 G4VITTimeStepper::Prepare(); 00084 G4ITManager<G4Molecule>::Instance()->UpdatePositionMap(); 00085 }
void G4DNAMoleculeEncounterStepper::SetReactionModel | ( | G4VDNAReactionModel * | ) | [inline] |
void G4DNAMoleculeEncounterStepper::SetVerbose | ( | int | ) | [inline] |