80{
84
85#ifdef G4VERBOSE
86 if (fVerbose > 1) {
87 G4cout <<
"________________________________________________________________"
88 "_______"
90 G4cout <<
"G4DNAIndependentReactionTimeStepper::CalculateStep" <<
G4endl;
91 G4cout <<
"Check done for molecule : " << pMoleculeA->GetName() <<
" (" << trackA.
GetTrackID()
93 }
94#endif
95
96 auto pMolConfA = pMoleculeA->GetMolecularConfiguration();
97
98 const auto pReactantList = fMolecularReactionTable->CanReactWith(pMolConfA);
99
100 if (pReactantList == nullptr) {
101 if (fVerbose > 1) {
103 msg << "G4DNAIndependentReactionTimeStepper::CalculateStep will return infinity "
104 "for the reaction because the molecule "
105 << pMoleculeA->GetName() << " does not have any reactants given in the reaction table."
107 G4Exception(
"G4DNAIndependentReactionTimeStepper::CalculateStep",
108 "G4DNAIndependentReactionTimeStepper03",
JustWarning, msg);
109 }
111 }
112
113 auto nbReactives = (
G4int)pReactantList->size();
114
115 if (nbReactives == 0) {
116 if (fVerbose > 1) {
118 msg << "G4DNAIndependentReactionTimeStepper::CalculateStep will "
119 "return infinity "
120 "for the reaction because the molecule "
121 << pMoleculeA->GetName() << " does not have any reactants given in the reaction table."
122 << "This message can also result from a wrong implementation of "
123 "the reaction table."
125 G4Exception(
"G4DNAIndependentReactionTimeStepper::CalculateStep",
126 "G4DNAIndependentReactionTimeStepper04",
JustWarning, msg);
127 }
129 }
130 fReactionModel->Initialise(pMolConfA, trackA);
131 for (
G4int i = 0; i < nbReactives; ++i) {
132 auto pMoleculeB = (*pReactantList)[i];
133 G4int key = pMoleculeB->GetMoleculeID();
135
136
137 const G4double Reff = fReactionModel->GetReactionRadius(i);
138 std::vector<std::pair<G4TrackList::iterator, G4double>> resultIndices;
139 resultIndices.clear();
141
142 if (resultIndices.empty()) {
143 continue;
144 }
145 for (auto& it : resultIndices) {
146 G4Track* pTrackB = *(std::get<0>(it));
147
148 if (pTrackB == &trackA) {
149 continue;
150 }
151 if (pTrackB == nullptr) {
153 exceptionDescription << "No trackB no valid";
155 "G4DNAIndependentReactionTimeStepper"
156 "::CalculateStep()",
157 "G4DNAIndependentReactionTimeStepper007",
FatalException, exceptionDescription);
158 }
159 if (fCheckedTracks.find(pTrackB->
GetTrackID()) != fCheckedTracks.end()) {
160 continue;
161 }
162
163 Utils utils(trackA, *pTrackB);
165 auto pMolConfB = pMolB->GetMolecularConfiguration();
167 if (distance * distance < Reff * Reff) {
168 auto reactionData = fMolecularReactionTable->GetReactionData(pMolConfA, pMolConfB);
172 }
173 }
174 }
175 else {
176 G4double tempMinET = GetTimeToEncounter(trackA, *pTrackB);
178 continue;
179 }
181
182
183
184
185
186
187
188
189 }
191 }
192 }
194}
G4Molecule * GetMolecule(const G4Track &track)
G4GLOB_DLL std::ostream G4cout
static G4double GetRCutOff()
static G4OctreeFinder * Instance()
void FindNearestInRange(const G4Track &track, const int &key, G4double R, std::vector< std::pair< typename CONTAINER::iterator, G4double > > &result, G4bool isSort=false) const
static G4Scheduler * Instance()
const G4ThreeVector & GetPosition() const
G4double fSampledMinTimeStep