56 fImportanceAlgorithm(aImportanceAlgorithm),
60 G4cout <<
"### G4ImportanceProcess:: Creating " <<
G4endl;
61 if (TrackTerminator !=
nullptr)
69 if (fParticleChange ==
nullptr)
71 G4Exception(
"G4ImportanceProcess::G4ImportanceProcess()",
73 "Failed allocation of G4ParticleChange !");
79 fGhostPreStepPoint = fGhostStep->GetPreStepPoint();
80 fGhostPostStepPoint = fGhostStep->GetPostStepPoint();
90 G4cout <<
"G4ImportanceProcess:: importance process paraflag is: " << fParaflag <<
G4endl;
96 delete fPostStepAction;
97 delete fParticleChange;
108 G4cout <<
"G4ImportanceProcess:: SetParallelWorld name = " << parallelWorldName <<
G4endl;
112 fGhostWorldName = parallelWorldName;
113 fGhostWorld = fTransportationManager->GetParallelWorld(fGhostWorldName);
114 fGhostNavigator = fTransportationManager->GetNavigator(fGhostWorld);
131 if(fGhostNavigator !=
nullptr)
133 fNavigatorID = fTransportationManager->ActivateNavigator(fGhostNavigator);
139 "G4ImportanceProcess is used for tracking without having a parallel world assigned");
150 fOldGhostTouchable = fPathFinder->CreateTouchableHandle(fNavigatorID);
151 fGhostPreStepPoint->SetTouchableHandle(fOldGhostTouchable);
152 fNewGhostTouchable = fOldGhostTouchable;
153 fGhostPostStepPoint->SetTouchableHandle(fNewGhostTouchable);
177 return fParticleChange;
182 fOldGhostTouchable = fGhostPostStepPoint->GetTouchableHandle();
193 fNewGhostTouchable = fPathFinder->CreateTouchableHandle(fNavigatorID);
198 fNewGhostTouchable = fOldGhostTouchable;
201 fGhostPreStepPoint->SetTouchableHandle(fOldGhostTouchable);
202 fGhostPostStepPoint->SetTouchableHandle(fNewGhostTouchable);
209 G4cout <<
"WARNING - G4ImportanceProcess::PostStepDoIt()"
210 <<
" StopAndKill track. on boundary" <<
G4endl;
214 fGhostPreStepPoint->GetTouchable()->GetReplicaNumber());
215 G4GeometryCell postkey(*(fGhostPostStepPoint->GetPhysicalVolume()),
216 fGhostPostStepPoint->GetTouchable()->GetReplicaNumber());
219 fImportanceAlgorithm.Calculate(fIStore.GetImportance(prekey),
220 fIStore.GetImportance(postkey),
222 fPostStepAction->DoIt(aTrack, fParticleChange, nw);
232 G4cout <<
"WARNING - G4ImportanceProcess::PostStepDoIt()"
233 <<
" StopAndKill track. on boundary non-parallel"
246 fImportanceAlgorithm.Calculate(fIStore.GetImportance(prekey),
247 fIStore.GetImportance(postkey),
249 fPostStepAction->DoIt(aTrack, fParticleChange, nw);
252 return fParticleChange;
276 if (previousStepSize > 0.)
277 { fGhostSafety -= previousStepSize; }
280 if (fGhostSafety < 0.) { fGhostSafety = 0.0; }
285 if (currentMinimumStep <= fGhostSafety && currentMinimumStep > 0.)
288 returnedStep = currentMinimumStep;
290 proposedSafety = fGhostSafety - currentMinimumStep;
299 = fPathFinder->ComputeStep(fFieldTrack,currentMinimumStep,fNavigatorID,
307 fGhostSafety = fGhostNavigator->ComputeSafety(fEndTrack.GetPosition());
314 proposedSafety = fGhostSafety;
321 returnedStep *= (1.0 + 1.0e-9);
361void G4ImportanceProcess::CopyStep(
const G4Step& step)
G4double condition(const G4ErrorSymMatrix &m)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
@ NotCandidateForSelection
G4GLOB_DLL std::ostream G4cout
static void Update(G4FieldTrack *, const G4Track *)
G4GeometryCell is used for scoring and importance sampling. It defines a "cell", which,...
virtual G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &)
virtual G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
void SetParallelWorld(const G4String ¶llelWorldName)
virtual void KillTrack() const
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)
virtual ~G4ImportanceProcess()
G4ImportanceProcess(const G4VImportanceAlgorithm &aImportanceAlgorithm, const G4VIStore &aIstore, const G4VTrackTerminator *TrackTerminator, const G4String &aName="ImportanceProcess", G4bool para=false)
void StartTracking(G4Track *)
virtual G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
virtual const G4String & GetName() const
G4Nsplit_Weight is a class (struct) used by importance sampling. It contains the number of tracks a m...
static G4PathFinder * GetInstance()
G4StepStatus GetStepStatus() const
const G4VTouchable * GetTouchable() const
void SetStepStatus(const G4StepStatus aValue)
G4VPhysicalVolume * GetPhysicalVolume() const
G4SteppingControl GetControlFlag() const
G4Track * GetTrack() const
void SetStepLength(G4double value)
G4StepPoint * GetPreStepPoint() const
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const
void SetControlFlag(G4SteppingControl StepControlFlag)
void SetTotalEnergyDeposit(G4double value)
G4StepPoint * GetPostStepPoint() const
void SetTrack(G4Track *value)
G4int GetReplicaNumber(G4int depth=0) const
G4TrackStatus GetTrackStatus() const
G4VPhysicalVolume * GetVolume() const
G4VPhysicalVolume * GetNextVolume() const
G4double GetWeight() const
const G4ThreeVector & GetPosition() const
G4int GetCurrentStepNumber() const
const G4ThreeVector & GetMomentumDirection() const
static G4TransportationManager * GetTransportationManager()
G4VIStore is an interface of an "importance store" used by importance sampling. It defines how an imp...
G4VImportanceAlgorithm is an interface used by importance sampling to get the number of copies and we...
virtual void Initialize(const G4Track &)
G4VProcess(const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
G4VParticleChange * pParticleChange
const G4String & GetProcessName() const