43# define State(theXInfo) (GetState<G4DNAScavengerProcessState>()->theXInfo)
50 , fpScavengerMaterial(nullptr)
70 for(
auto& iter2 : iter.second)
107 <<
"G4DNASecondOrderReaction was already initialised. ";
108 exceptionDescription <<
"You cannot set a reaction after initialisation.";
109 G4Exception(
"G4DNASecondOrderReaction::SetReaction",
111 exceptionDescription);
117 G4cout <<
"G4DNAScavengerProcess::SetReaction : " << molConf->
GetName()
118 <<
" materialConf : " << materialConf->GetName() <<
G4endl;
120 fConfMap[molConf][materialConf] = pData;
142 auto MaterialMap = it->second;
145 std::map<
G4double , std::pair<MolType, G4double>>
149 for(
const auto& mat_it : MaterialMap)
151 auto matConf = mat_it.first;
161 G4cout <<
" Material of " << matConf->GetName() <<
" : " << numMol
165 auto data = mat_it.second;
166 auto reactionRate = data->GetObservedReactionRateConstant();
169 auto reactionData = std::make_pair(mat_it.first, propensity);
174 alpha0 += propensity;
175 ReactionDataMap[alpha0] = reactionData;
179 if(
State(fIsInGoodMaterial))
182 State(fIsInGoodMaterial) =
false;
186 auto rSelectedIter = ReactionDataMap.upper_bound(r1 * alpha0);
190 State(fIsInGoodMaterial) =
true;
193 if(
State(fPreviousTimeAtPreStepPoint) != -1)
204 if((previousTimeStep <= 0.0) ||
205 (
fpState->theNumberOfInteractionLengthLeft <= 0.0))
209 else if(previousTimeStep > 0.0)
214 fpState->currentInteractionLength = 1 / (rSelectedIter->second.second);
218 value =
fpState->theNumberOfInteractionLengthLeft *
219 (
fpState->currentInteractionLength);
224 G4cout <<
"G4DNAScavengerProcess::PostStepGetPhysicalInteractionLength:: "
225 << molConf->GetName() <<
G4endl;
226 G4cout <<
"theNumberOfInteractionLengthLeft : "
228 G4cout <<
"currentInteractionLength : " <<
fpState->currentInteractionLength
233 <<
" name : " << molConf->GetName()
258 State(fPreviousTimeAtPreStepPoint) = -1;
261 std::vector<G4Track*> products;
266 G4cout <<
">>> Beginning of G4DNAScavengerProcess verbose" <<
G4endl;
269 G4cout <<
">>> Time Step : "
272 G4cout <<
">>> Global Time : "
275 G4cout <<
">>> Global Time Track : "
281 G4cout <<
">>> End of G4DNAScavengerProcess verbose <<<" <<
G4endl;
288 auto nbSecondaries = data->GetNbProducts();
290 for(
G4int j = 0; j < nbSecondaries; ++j)
292 auto pProduct =
new G4Molecule(data->GetProduct(j));
294 pProduct->BuildTrack(reactionTime, track.
GetPosition());
295 pProductTrack->SetTrackStatus(
fAlive);
298 products.push_back(pProductTrack);
311 if(nbSecondaries > 0)
313 for(
G4int i = 0; i < nbSecondaries; ++i)
324 << products.at(i)->GetTrackID() <<
")";
350 State(fPreviousTimeAtPreStepPoint) = -1;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4IT * GetIT(const G4Track *track)
G4Molecule * GetMolecule(const G4Track &track)
G4GLOB_DLL std::ostream G4cout
Reactant * GetReactant1() const
Reactant * GetReactant2() const
G4double GetNumberMoleculePerVolumeUnitForMaterialConf(MolType) const
void ReduceNumberMoleculePerVolumeUnitForMaterialConf(MolType, G4double)
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
void StartTracking(G4Track *) override
std::map< MolType, std::map< MolType, Data * > > fConfMap
const G4DNABoundingBox * fpBoundingBox
const G4MolecularConfiguration * fpMolecularConfiguration
~G4DNAScavengerProcess() override
G4DNAScavengerProcess(const G4String &aName, const G4DNABoundingBox &box, G4ProcessType type=fUserDefined)
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4DNAScavengerMaterial * fpScavengerMaterial
void BuildPhysicsTable(const G4ParticleDefinition &) override
void SetReaction(MolType, Data *pData)
G4ParticleChange fParticleChange
void Push(G4Track *track) override
static G4ITFinder * Instance()
virtual void Push(G4Track *)
static G4ITTrackHolder * Instance()
virtual const G4String & GetName() const =0
const G4String & GetName() const
const G4MolecularConfiguration * GetMolecularConfiguration() const
const G4String & GetName() const
void Initialize(const G4Track &) override
static G4Scheduler * Instance()
G4VScavengerMaterial * GetScavengerMaterial() const
const G4ThreeVector & GetPosition() const
G4double GetGlobalTime() const
virtual void StartTracking(G4Track *)
void SetInstantiateProcessState(G4bool flag)
virtual void SubtractNumberOfInteractionLengthLeft(G4double previousStepSize)
G4shared_ptr< G4ProcessState > fpState
virtual void ResetNumberOfInteractionLengthLeft()
void ProposeTrackStatus(G4TrackStatus status)
G4bool enableAlongStepDoIt
void SetProcessSubType(G4int)
virtual void StartTracking(G4Track *)
G4bool enablePostStepDoIt
G4VParticleChange * pParticleChange
static G4VScheduler * Instance()
G4double fPreviousTimeAtPreStepPoint
G4DNAScavengerProcessState()