54 fWorldVolume(nullptr),
55 fIsTrackingTime(false),
57 fGhostNavigator(nullptr),
58 fGhostNavigatorIndex(-1),
59 fIsGhostGeometry(false),
62 fFastSimulationManager(nullptr),
63 fFastSimulationTrigger(false)
74 <<
"' is created, and will message geometry with world volume `"
83 fWorldVolume(nullptr),
84 fIsTrackingTime(false),
86 fGhostNavigator(nullptr),
87 fGhostNavigatorIndex(-1),
88 fIsGhostGeometry(false),
91 fFastSimulationManager(nullptr),
92 fFastSimulationTrigger(false)
103 <<
"' is created, and will message geometry with world volume `"
112 fWorldVolume(nullptr),
113 fIsTrackingTime(false),
115 fGhostNavigator(nullptr),
116 fGhostNavigatorIndex(-1),
117 fIsGhostGeometry(false),
120 fFastSimulationManager(nullptr),
121 fFastSimulationTrigger(false)
132 <<
"' is created, and will message geometry with world volume `"
147 if (fIsTrackingTime) {
150 <<
"': changing of world volume at tracking time is not allowed." <<
G4endl;
151 G4Exception(
"G4FastSimulationManagerProcess::SetWorldVolume(const G4String)",
"FastSim002",
156 if (newWorld ==
nullptr) {
158 tellWhatIsWrong <<
"Volume newWorldName = `" << newWorldName
159 <<
"' is not a parallel world nor the mass world volume." <<
G4endl;
160 G4Exception(
"G4FastSimulationManagerProcess::SetWorldVolume(const G4String)",
"FastSim003",
164 if (fWorldVolume !=
nullptr)
166 <<
"': changing world volume from '" << fWorldVolume->
GetName() <<
"' to `"
167 << newWorld <<
"'." <<
G4endl;
170 <<
"': setting world volume from to `" << newWorld->
GetName() <<
"'." <<
G4endl;
172 fWorldVolume = newWorld;
178 if (newWorld !=
nullptr)
182 tellWhatIsWrong <<
"Null pointer passed for world volume." <<
G4endl;
183 G4Exception(
"G4FastSimulationManagerProcess::SetWorldVolume(const G4VPhysicalVolume* newWorld)",
193 fIsTrackingTime =
true;
199 fGhostNavigator = transportationManager->
GetNavigator(fWorldVolume);
201 if (fIsGhostGeometry)
202 fGhostNavigatorIndex = transportationManager->
ActivateNavigator(fGhostNavigator);
204 fGhostNavigatorIndex = -1;
211 fIsTrackingTime =
false;
228 if (fIsGhostGeometry)
233 if (currentVolume !=
nullptr) {
235 if (fFastSimulationManager !=
nullptr) {
237 fFastSimulationTrigger =
239 if (fFastSimulationTrigger) {
278 if (fIsGhostGeometry) {
280 if (endTrack_G4MT_TLS_ ==
nullptr) endTrack_G4MT_TLS_ =
new G4FieldTrack(
'0');
284 if (eLimited_G4MT_TLS_ ==
nullptr) eLimited_G4MT_TLS_ =
new ELimited;
285 ELimited& eLimited = *eLimited_G4MT_TLS_;
287 if (previousStepSize > 0.) fGhostSafety -= previousStepSize;
288 if (fGhostSafety < 0.) fGhostSafety = 0.0;
293 if (currentMinimumStep <= fGhostSafety && currentMinimumStep > 0.) {
295 returnedStep = currentMinimumStep;
296 proposedSafety = fGhostSafety - currentMinimumStep;
301 returnedStep = fPathFinder->
ComputeStep(fFieldTrack, currentMinimumStep, fGhostNavigatorIndex,
308 proposedSafety = fGhostSafety;
329 return &fDummyParticleChange;
342 if (fIsGhostGeometry)
347 if (fFastSimulationManager !=
nullptr) {
349 fFastSimulationTrigger =
351 if (fFastSimulationTrigger) {
G4double condition(const G4ErrorSymMatrix &m)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
@ NotCandidateForSelection
G4GLOB_DLL std::ostream G4cout
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *) override
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
void SetWorldVolume(G4String)
~G4FastSimulationManagerProcess() override
G4FastSimulationManagerProcess(const G4String &processName="G4FastSimulationManagerProcess", G4ProcessType theType=fParameterisation)
void StartTracking(G4Track *) override
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &) override
void EndTracking() override
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &step) override
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection) override
G4VParticleChange * InvokePostStepDoIt()
G4VParticleChange * InvokeAtRestDoIt()
G4bool PostStepGetFastSimulationManagerTrigger(const G4Track &, const G4Navigator *a=nullptr)
G4bool AtRestGetFastSimulationManagerTrigger(const G4Track &, const G4Navigator *a=nullptr)
static void Update(G4FieldTrack *, const G4Track *)
G4ThreeVector GetPosition() const
void RemoveFSMP(G4FastSimulationManagerProcess *)
void AddFSMP(G4FastSimulationManagerProcess *)
static G4GlobalFastSimulationManager * GetGlobalFastSimulationManager()
G4FastSimulationManager * GetFastSimulationManager() const
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
G4VPhysicalVolume * GetWorldVolume() const
G4VPhysicalVolume * GetLocatedVolume(G4int navId) const
G4double ComputeStep(const G4FieldTrack &pFieldTrack, G4double pCurrentProposedStepLength, G4int navigatorId, G4int stepNo, G4double &pNewSafety, ELimited &limitedStep, G4FieldTrack &EndState, G4VPhysicalVolume *currentVolume)
void PrepareNewTrack(const G4ThreeVector &position, const G4ThreeVector &direction, G4VPhysicalVolume *massStartVol=nullptr)
static G4PathFinder * GetInstance()
G4VPhysicalVolume * GetVolume() const
const G4ThreeVector & GetPosition() const
G4int GetCurrentStepNumber() const
const G4ThreeVector & GetMomentumDirection() const
static G4TransportationManager * GetTransportationManager()
G4VPhysicalVolume * IsWorldExisting(const G4String &worldName)
G4Navigator * GetNavigatorForTracking() const
G4int ActivateNavigator(G4Navigator *aNavigator)
void DeActivateNavigator(G4Navigator *aNavigator)
G4Navigator * GetNavigator(const G4String &worldName)
void ProposeTrackStatus(G4TrackStatus status)
virtual void Initialize(const G4Track &)
G4TrackStatus GetTrackStatus() const
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
void SetProcessSubType(G4int)
const G4String & GetProcessName() const