Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -42,6 +42,9 @@
|
||||
#include "G4Molecule.hh"
|
||||
#include "G4MoleculeFinder.hh"
|
||||
#include "G4ITReactionChange.hh"
|
||||
#include "G4ITReaction.hh"
|
||||
|
||||
#include "G4ITTrackHolder.hh"
|
||||
|
||||
G4DNAMolecularReaction::G4DNAMolecularReaction()
|
||||
: G4VITReactionProcess()
|
||||
@@ -108,6 +111,8 @@ std::unique_ptr<G4ITReactionChange> G4DNAMolecularReaction::MakeReaction(const G
|
||||
|
||||
pProductTrack->SetTrackStatus(fAlive);
|
||||
|
||||
G4ITTrackHolder::Instance()->Push(pProductTrack);
|
||||
|
||||
pChanges->AddSecondary(pProductTrack);
|
||||
G4MoleculeFinder::Instance()->Push(pProductTrack);
|
||||
}
|
||||
@@ -121,3 +126,73 @@ void G4DNAMolecularReaction::SetReactionModel(G4VDNAReactionModel* pReactionMode
|
||||
{
|
||||
fpReactionModel = pReactionModel;
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<G4ITReactionChange>> G4DNAMolecularReaction::FindReaction(
|
||||
G4ITReactionSet* pReactionSet,
|
||||
const double currentStepTime,
|
||||
const double /*fGlobalTime*/,
|
||||
const bool reachedUserStepTimeLimit)
|
||||
{
|
||||
std::vector<std::unique_ptr<G4ITReactionChange>> fReactionInfo;
|
||||
fReactionInfo.clear();
|
||||
|
||||
if (pReactionSet == nullptr)
|
||||
{
|
||||
return fReactionInfo;
|
||||
}
|
||||
|
||||
G4ITReactionPerTrackMap& reactionPerTrackMap = pReactionSet->GetReactionMap();
|
||||
for (auto tracks_i = reactionPerTrackMap.begin();
|
||||
tracks_i != reactionPerTrackMap.end();
|
||||
tracks_i = reactionPerTrackMap.begin())
|
||||
{
|
||||
G4Track* pTrackA = tracks_i->first;
|
||||
if (pTrackA->GetTrackStatus() == fStopAndKill)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
G4ITReactionPerTrackPtr reactionPerTrack = tracks_i->second;
|
||||
G4ITReactionList& reactionList = reactionPerTrack->GetReactionList();
|
||||
|
||||
assert(reactionList.begin() != reactionList.end());
|
||||
|
||||
for (auto it = reactionList.begin(); it != reactionList.end(); it = reactionList.begin())
|
||||
{
|
||||
G4ITReactionPtr reaction(*it);
|
||||
G4Track* pTrackB = reaction->GetReactant(pTrackA);
|
||||
if (pTrackB->GetTrackStatus() == fStopAndKill)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pTrackB == pTrackA)
|
||||
{
|
||||
G4ExceptionDescription exceptionDescription;
|
||||
exceptionDescription
|
||||
<< "The IT reaction process sent back a reaction between trackA and trackB. ";
|
||||
exceptionDescription << "The problem is trackA == trackB";
|
||||
G4Exception("G4ITModelProcessor::FindReaction",
|
||||
"ITModelProcessor005",
|
||||
FatalErrorInArgument,
|
||||
exceptionDescription);
|
||||
}
|
||||
|
||||
pReactionSet->SelectThisReaction(reaction);
|
||||
|
||||
if (TestReactibility(*pTrackA, *pTrackB, currentStepTime, reachedUserStepTimeLimit))
|
||||
{
|
||||
auto pReactionChange = MakeReaction(*pTrackA, *pTrackB);
|
||||
|
||||
if (pReactionChange)
|
||||
{
|
||||
fReactionInfo.push_back(std::move(pReactionChange));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pReactionSet->CleanAllReaction();
|
||||
return fReactionInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user