52 , fpReactionModel(nullptr)
64 double currentStepTime,
65 bool userStepTimeLimit)
74 if (currentStepTime == 0.)
76 userStepTimeLimit =
false;
80 separationDistance, userStepTimeLimit);
88 pChanges->Initialize(trackA, trackB);
99 const G4double D1 = pMoleculeA->GetDiffusionCoefficient();
100 const G4double D2 = pMoleculeB->GetDiffusionCoefficient();
101 const G4double sqrD1 = D1 == 0. ? 0. : std::sqrt(D1);
102 const G4double sqrD2 = D2 == 0. ? 0. : std::sqrt(D2);
103 const G4double inv_numerator = 1./(sqrD1 + sqrD2);
107 for (
G4int j = 0; j < nbProducts; ++j)
109 auto pProduct =
new G4Molecule(pReactionData->GetProduct(j));
110 auto pProductTrack = pProduct->BuildTrack(trackA.
GetGlobalTime(), reactionSite);
112 pProductTrack->SetTrackStatus(
fAlive);
116 pChanges->AddSecondary(pProductTrack);
121 pChanges->KillParents(
true);
132 const double currentStepTime,
134 const bool reachedUserStepTimeLimit)
136 std::vector<std::unique_ptr<G4ITReactionChange>> fReactionInfo;
137 fReactionInfo.clear();
139 if (pReactionSet ==
nullptr)
141 return fReactionInfo;
145 for (
auto tracks_i = reactionPerTrackMap.begin();
146 tracks_i != reactionPerTrackMap.end();
147 tracks_i = reactionPerTrackMap.begin())
149 G4Track* pTrackA = tracks_i->first;
158 assert(reactionList.begin() != reactionList.end());
160 for (
auto it = reactionList.begin(); it != reactionList.end(); it = reactionList.begin())
163 G4Track* pTrackB = reaction->GetReactant(pTrackA);
169 if (pTrackB == pTrackA)
173 <<
"The IT reaction process sent back a reaction between trackA and trackB. ";
174 exceptionDescription <<
"The problem is trackA == trackB";
176 "ITModelProcessor005",
178 exceptionDescription);
183 if (
TestReactibility(*pTrackA, *pTrackB, currentStepTime, reachedUserStepTimeLimit))
185 auto pReactionChange =
MakeReaction(*pTrackA, *pTrackB);
189 fReactionInfo.push_back(std::move(pReactionChange));
197 return fReactionInfo;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4shared_ptr< G4ITReactionPerTrack > G4ITReactionPerTrackPtr
std::list< G4ITReactionPtr > G4ITReactionList
G4shared_ptr< G4ITReaction > G4ITReactionPtr
std::map< G4Track *, G4ITReactionPerTrackPtr, compTrackPerID > G4ITReactionPerTrackMap
G4Molecule * GetMolecule(const G4Track &track)
ReturnType & reference_cast(OriginalType &source)
G4int GetNbProducts() const
Data * GetReactionData(Reactant *, Reactant *) const
void SetReactionModel(G4VDNAReactionModel *)
const G4DNAMolecularReactionTable *& fMolReactionTable
std::unique_ptr< G4ITReactionChange > MakeReaction(const G4Track &, const G4Track &) override
std::vector< std::unique_ptr< G4ITReactionChange > > FindReaction(G4ITReactionSet *, const double, const double, const bool) override
G4VDNAReactionModel * fpReactionModel
G4bool TestReactibility(const G4Track &, const G4Track &, double currentStepTime, bool userStepTimeLimit) override
virtual void Push(G4Track *track)
static G4ITFinder * Instance()
void SelectThisReaction(G4ITReactionPtr reaction)
G4ITReactionPerTrackMap & GetReactionMap()
virtual void Push(G4Track *)
static G4ITTrackHolder * Instance()
const G4MolecularConfiguration * GetMolecularConfiguration() const
G4TrackStatus GetTrackStatus() const
const G4ThreeVector & GetPosition() const
G4double GetGlobalTime() const
virtual G4bool FindReaction(const G4Track &, const G4Track &, G4double, G4double &, G4bool)=0
virtual G4double GetReactionRadius(const G4MolecularConfiguration *, const G4MolecularConfiguration *)=0