119{
122 auto pMotherMoleculeDefinition = pMotherMolecule->GetDefinition();
123
124 if (pMotherMoleculeDefinition->GetDecayTable() != nullptr)
125 {
126 const auto pDissociationChannels = pMotherMolecule->GetDissociationChannels();
127
128 if (pDissociationChannels == nullptr)
129 {
131 pMotherMolecule->PrintState();
132 exceptionDescription << "No decay channel was found for the molecule : "
133 << pMotherMolecule->GetName() <<
G4endl;
135 "G4DNAMolecularDissociation::NoDecayChannel",
137 exceptionDescription);
139 }
140
141 auto decayVectorSize = pDissociationChannels->size();
143
145 size_t i = 0;
146 do
147 {
148 pDecayChannel = (*pDissociationChannels)[i];
149 if (RdmValue < pDecayChannel->GetProbability())
150 {
151 break;
152 }
154 i++;
155 } while (i < decayVectorSize);
156
159
160 if (decayEnergy > 0.)
161 {
163 }
164
165 if (nbProducts != 0)
166 {
167 std::vector<G4ThreeVector> productsDisplacement(nbProducts);
169
170 auto it = fDisplacementMap.find(pMotherMoleculeDefinition);
171
172 if (it != fDisplacementMap.end())
173 {
174 auto pDisplacer = it->second.get();
175 productsDisplacement = pDisplacer->GetProductsDisplacement(pDecayChannel);
176 motherMoleculeDisplacement =
177 pDisplacer->GetMotherMoleculeDisplacement(pDecayChannel);
178 }
179 else
180 {
182 errMsg << "No G4MolecularDecayProcess::theDecayDisplacementMap["
183 << pMotherMolecule->GetName() + "]";
185 "DNAMolecularDecay001",
187 errMsg);
188 }
189
191
192#ifdef G4VERBOSE
193 if (fVerbose != 0)
194 {
195 G4cout <<
"Decay Process : " << pMotherMolecule->GetName()
196 <<
" (trackID :" << track.
GetTrackID() <<
") "
198 }
199#endif
200
202
203 for (
G4int j = 0; j < nbProducts; j++)
204 {
206
207 G4ThreeVector displacement = motherMoleculeDisplacement + productsDisplacement[j];
208 double mag_displacement = displacement.
mag();
209 G4ThreeVector displacement_direction = displacement / (mag_displacement + 1e-30);
210
212
213
215 displacement_direction,
216 mag_displacement,
217 prNewSafety);
218
219
220 mag_displacement = std::min(prNewSafety * 0.8, mag_displacement);
221
223 + displacement_direction * mag_displacement;
224
225
226 if(fpBrownianAction != nullptr)
227 {
228 fpBrownianAction->
Transport(product_pos);
229 }
230
231
233
235
236
237
240 {
243 GetMotherLogical();
244 if (Motherlogic != nullptr
245 && Motherlogic->GetMaterial() != WaterMaterial)
246 {
248 ED << "The decayed product is outside of the volume : "
250 << " with material : "<< Motherlogic->GetMaterial()
252 G4Exception(
"G4DNAMolecularDissociation::DecayIt()",
253 "OUTSIDE_OF_MOTHER_VOLUME",
255 }
256 }
257
258 auto pSecondary = pProduct->BuildTrack(track.
GetGlobalTime(), product_pos);
259
260 pSecondary->SetTrackStatus(
fAlive);
261#ifdef G4VERBOSE
262 if (fVerbose != 0)
263 {
264 G4cout <<
"Product : " << pProduct->GetName() <<
G4endl;
265 }
266#endif
267
269 }
270#ifdef G4VERBOSE
271 if (fVerbose != 0)
272 {
274 }
275#endif
276 }
277
278 else if ((fVerbose != 0) && (decayEnergy != 0.0))
279 {
282 }
283
284
285
286
287
288
289
290
291
292
293
294
295 }
296
298
300}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4Molecule * GetMolecule(const G4Track &track)
static G4ITTransportationManager * GetTransportationManager()
G4ITNavigator * GetNavigatorForTracking() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Product * GetProduct(int) const
G4int GetNbProducts() const
const G4String & GetName() const
G4double GetProbability() const
G4double GetEnergy() const
void Initialize(const G4Track &) override
virtual G4VSolid * GetSolid(G4int depth=0) const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
const G4ThreeVector & GetPosition() const
G4double GetGlobalTime() const
const G4VTouchable * GetTouchable() const
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetNumberOfSecondaries(G4int totSecondaries)
const G4String & GetName() const
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual void Transport(G4ThreeVector &, G4Track *pTrack=nullptr)=0