70std::unique_ptr<G4ITReactionChange>
74 auto & tA =
const_cast<G4Track&
>(trackA);
75 auto & tB =
const_cast<G4Track&
>(trackB);
79 pChanges->Initialize(trackA, trackB);
84 const auto pReactionData =
fMolReactionTable->GetReactionData(pMoleculeA, pMoleculeB);
85 const G4int nbProducts = pReactionData->GetNbProducts();
88 const G4double D1 = pMoleculeA->GetDiffusionCoefficient();
89 const G4double D2 = pMoleculeB->GetDiffusionCoefficient();
90 const G4double sqrD1 = D1 == 0. ? 0. : std::sqrt(D1);
91 const G4double sqrD2 = D2 == 0. ? 0. : std::sqrt(D2);
92 const G4double inv_numerator = 1./(sqrD1 + sqrD2);
93 const G4ThreeVector reactionSite = sqrD2 * inv_numerator * tA.GetPosition()
94 + sqrD1 * inv_numerator * tB.GetPosition();
97 auto randP = (1-u) * tA.GetPosition() + u * tB.GetPosition();
99 for (
G4int j = 0; j < nbProducts; ++j)
101 auto pProduct =
new G4Molecule(pReactionData->GetProduct(j));
102 auto pProductTrack = pProduct->BuildTrack(trackA.
GetGlobalTime(), (reactionSite + randP)/2);
103 pProductTrack->SetTrackStatus(
fAlive);
105 pChanges->AddSecondary(pProductTrack);
108 pChanges->KillParents(
true);
122 G4double D1 = pMoleculeA->GetDiffusionCoefficient();
123 G4double D2 = pMoleculeB->GetDiffusionCoefficient();
146 exceptionDescription <<
"Two particles are overlap: "
150 G4Exception(
"G4DNAMakeReaction::PrepareForReaction()",
151 "G4DNAMakeReaction003",
154 S1.
setMag(reactionRadius);
162 G4double sigma = s12 + ( s12 * s12 ) / s22;
163 G4double alpha = reactionRadius * distance / (2 * (D1 + D2) * dt );
167 G4RandGauss::shoot(0.0, sigma),
168 G4RandGauss::shoot(0.0, sigma));
172 S1.
setTheta(rad * std::acos( 1.0 + (1. / alpha) *
174 (1.-std::exp(-2.0 * alpha)))));
184std::vector<std::unique_ptr<G4ITReactionChange>>
190 std::vector<std::unique_ptr<G4ITReactionChange>> ReactionInfo;
191 ReactionInfo.clear();
193 if(stepper ==
nullptr){
198 auto pReactionChange = stepper->
200 if (pReactionChange !=
nullptr)
202 ReactionInfo.push_back(std::move(pReactionChange));
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4Molecule * GetMolecule(const G4Track &track)
ReturnType & reference_cast(OriginalType &source)
CLHEP::Hep3Vector G4ThreeVector
std::unique_ptr< G4ITReactionChange > MakeReaction(const G4Track &, const G4Track &) override
G4VITTimeStepComputer * fpTimeStepper
std::vector< std::unique_ptr< G4ITReactionChange > > FindReaction(G4ITReactionSet *, const G4double, const G4double, const G4bool) override
G4VDNAReactionModel * fpReactionModel
void SetReactionModel(G4VDNAReactionModel *)
void SetTimeStepComputer(G4VITTimeStepComputer *)
void UpdatePositionForReaction(G4Track &, G4Track &)
G4bool TestReactibility(const G4Track &, const G4Track &, G4double currentStepTime, G4bool userStepTimeLimit) override
const G4DNAMolecularReactionTable *& fMolReactionTable
G4ITReactionPerTime & GetReactionsPerTime()
void Push(G4Track *) override
static G4ITTrackHolder * Instance()
const G4MolecularConfiguration * GetMolecularConfiguration() const
const G4String & GetName() const override
void SetPosition(const G4ThreeVector &aValue)
const G4ThreeVector & GetPosition() const
G4double GetGlobalTime() const
const G4ITReactionTable * fpReactionTable