43# define State(theXInfo) (GetState<G4DNAScavengerProcessState>()->theXInfo)
50 , fpScavengerMaterial(nullptr)
71 for(
auto& iter2 : iter.second)
108 <<
"G4DNASecondOrderReaction was already initialised. ";
109 exceptionDescription <<
"You cannot set a reaction after initialisation.";
110 G4Exception(
"G4DNASecondOrderReaction::SetReaction",
112 exceptionDescription);
118 G4cout <<
"G4DNAScavengerProcess::SetReaction : " << molConf->
GetName()
119 <<
" materialConf : " << materialConf->GetName() <<
G4endl;
121 fConfMap[molConf][materialConf] = pData;
143 auto MaterialMap = it->second;
150 for(
const auto& mat_it : MaterialMap)
152 auto matConf = mat_it.first;
162 G4cout <<
" Material of " << matConf->GetName() <<
" : " << numMol
166 auto data = mat_it.second;
167 auto reactionRate = data->GetObservedReactionRateConstant();
170 auto reactionData = std::make_pair(mat_it.first, propensity);
175 alpha0 += propensity;
176 ReactionDataMap[alpha0] = reactionData;
180 if(
State(fIsInGoodMaterial))
183 State(fIsInGoodMaterial) =
false;
187 auto rSelectedIter = ReactionDataMap.upper_bound(r1 * alpha0);
191 State(fIsInGoodMaterial) =
true;
194 if(
State(fPreviousTimeAtPreStepPoint) != -1)
205 if((previousTimeStep <= 0.0) ||
206 (
fpState->theNumberOfInteractionLengthLeft <= 0.0))
210 else if(previousTimeStep > 0.0)
215 fpState->currentInteractionLength = 1 / (rSelectedIter->second.second);
219 value =
fpState->theNumberOfInteractionLengthLeft *
220 (
fpState->currentInteractionLength);
225 G4cout <<
"G4DNAScavengerProcess::PostStepGetPhysicalInteractionLength:: "
226 << molConf->GetName() <<
G4endl;
227 G4cout <<
"theNumberOfInteractionLengthLeft : "
229 G4cout <<
"currentInteractionLength : " <<
fpState->currentInteractionLength
234 <<
" name : " << molConf->GetName()
257 G4cout <<
"fpMolecularConfiguration : "
259 <<
" molConf : " << molConf->GetName() <<
G4endl;
263 std::vector<G4Track*> products;
268 G4cout <<
">>> Beginning of G4DNAScavengerProcess verbose" <<
G4endl;
271 G4cout <<
">>> Time Step : "
274 G4cout <<
">>> Global Time : "
277 G4cout <<
">>> Global Time Track : "
283 G4cout <<
">>> End of G4DNAScavengerProcess verbose <<<" <<
G4endl;
290 auto nbSecondaries = data->GetNbProducts();
292 for(
G4int j = 0; j < nbSecondaries; ++j)
294 auto pProduct =
new G4Molecule(data->GetProduct(j));
296 pProduct->BuildTrack(reactionTime, track.
GetPosition());
297 pProductTrack->SetTrackStatus(
fAlive);
300 products.push_back(pProductTrack);
313 if(nbSecondaries > 0)
315 for(
G4int i = 0; i < nbSecondaries; ++i)
326 << products.at(i)->GetTrackID() <<
")";
352 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
G4DNAScavengerProcess(const G4String &aName, const G4DNABoundingBox &box, G4ProcessType type=fDecay)
const G4DNABoundingBox * fpBoundingBox
const G4MolecularConfiguration * fpMolecularConfiguration
~G4DNAScavengerProcess() override
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4DNAScavengerMaterial * fpScavengerMaterial
void BuildPhysicsTable(const G4ParticleDefinition &) override
void SetReaction(MolType, Data *pData)
G4ParticleChange fParticleChange
virtual void Push(G4Track *track)
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
virtual void Initialize(const G4Track &)
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()