57 {
return fpHyperStep; }
63 :
G4VProcess(processName,theType),fGhostWorld(nullptr),fGhostNavigator(nullptr),
64 fNavigatorID(-1),fFieldTrack(
'0'),fGhostSafety(0.),fOnBoundary(false),
65 layeredMaterialFlag(false)
68 if(!fpHyperStep) fpHyperStep =
new G4Step();
69 iParallelWorld = ++nParallelWorlds;
81 fGhostWorldName =
"** NotDefined **";
94 if(nParallelWorlds==0)
104 fGhostWorldName = parallelWorldName;
106 fGhostNavigator = fTransportationManager->
GetNavigator(fGhostWorld);
113 fGhostWorldName = parallelWorld->
GetName();
114 fGhostWorld = parallelWorld;
115 fGhostNavigator = fTransportationManager->
GetNavigator(fGhostWorld);
125 G4Exception(
"G4ParallelWorldProcess::StartTracking",
127 "G4ParallelWorldProcess is used for tracking without having a parallel world assigned");
133 fNewGhostTouchable = fOldGhostTouchable;
150 if(layeredMaterialFlag)
153 SwitchMaterial(realWorldPostStepPoint);
189 fNewGhostTouchable = fOldGhostTouchable;
201 aSD->
Hit(fGhostStep);
235 fNewGhostTouchable = fOldGhostTouchable;
256 if(layeredMaterialFlag)
260 SwitchMaterial(realWorldPostStepPoint);
277 if (previousStepSize > 0.)
278 { fGhostSafety -= previousStepSize; }
279 if (fGhostSafety < 0.) fGhostSafety = 0.0;
281 if (currentMinimumStep <= fGhostSafety && currentMinimumStep > 0.)
284 returnedStep = currentMinimumStep;
286 proposedSafety = fGhostSafety - currentMinimumStep;
293 #ifdef G4DEBUG_PARALLEL_WORLD_PROCESS
297 if( localVerb == 1 ) {
299 }
else if( localVerb > 1 ) {
300 G4cout <<
"----------------------------------------------" <<
G4endl;
301 G4cout <<
" ParallelWorldProcess: field Track set to : " <<
G4endl;
302 G4cout <<
"----------------------------------------------" <<
G4endl;
304 G4cout <<
"----------------------------------------------" <<
G4endl;
310 = fPathFinder->
ComputeStep(fFieldTrack,currentMinimumStep,fNavigatorID,
316 fGhostSafety = fGhostNavigator->
ComputeSafety(endTrack.GetPosition());
323 proposedSafety = fGhostSafety;
328 returnedStep *= (1.0 + 1.0e-9);
333 if(iParallelWorld==nParallelWorlds) fNavIDHyp = 0;
345 void G4ParallelWorldProcess::CopyStep(
const G4Step & step)
354 fGhostStep->
SetSecondary((const_cast<G4Step&>(step)).GetfSecondary());
365 if(iParallelWorld==1)
385 void G4ParallelWorldProcess::SwitchMaterial(
G4StepPoint* realWorldStepPoint)
400 if(ghostProdCuts) prodCuts = ghostProdCuts;
415 G4cout <<
"!!! MaterialCutsCouple is not found for "
417 <<
" Material in real world ("
419 <<
") is used." <<
G4endl;
431 if(partName==
"opticalphoton")
return false;
432 if(partName==
"geantino")
return false;
433 if(partName==
"chargedgeantino")
return false;
437 if(pdgCode==22)
return false;
438 if(pdgCode==11)
return false;
439 if(pdgCode==2212)
return false;
440 if(pdgCode==-12)
return false;
441 if(pdgCode==12)
return false;
442 if(pdgCode==-14)
return false;
443 if(pdgCode==14)
return false;
444 if(pdgCode==-16)
return false;
445 if(pdgCode==16)
return false;
void PrepareNewTrack(const G4ThreeVector &position, const G4ThreeVector &direction, G4VPhysicalVolume *massStartVol=0)
static G4PathFinder * GetInstance()
G4double condition(const G4ErrorSymMatrix &m)
void SetStepLength(G4double value)
virtual void Initialize(const G4Track &)
G4ProductionCuts * GetProductionCuts() const
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
void SetTrack(G4Track *value)
G4Material * GetMaterial() const
G4double GetStepLength() const
void StartTracking(G4Track *)
G4bool IsAtRestRequired(G4ParticleDefinition *)
G4StepStatus GetStepStatus() const
const G4String & GetName() const
G4Material * GetMaterial() const
G4double GetNonIonizingEnergyDeposit() const
const G4ThreeVector & GetPosition() const
virtual ~G4ParallelWorldProcess()
G4Navigator * GetNavigatorForTracking() const
G4TouchableHandle CreateTouchableHandle(G4int navId) const
G4int GetPDGEncoding() const
G4SteppingControl GetControlFlag() const
void SetSecondary(G4TrackVector *value)
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double, G4ForceCondition *)
G4Region * GetRegion() const
const G4Step * GetStep() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
void SetStepStatus(const G4StepStatus aValue)
const G4String & GetParticleName() const
static G4ParallelWorldProcessStore * GetInstance()
G4StepPoint * GetPreStepPoint() const
static G4int GetHypNavigatorID()
void SetParallelWorld(G4String parallelWorldName)
void SetSensitiveDetector(G4VSensitiveDetector *)
G4GLOB_DLL std::ostream G4cout
G4int GetCurrentStepNumber() const
const G4String & GetName() const
void SetControlFlag(G4SteppingControl StepControlFlag)
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
void SetParallelWorld(G4ParallelWorldProcess *proc, G4String parallelWorldName)
G4double ComputeStep(const G4FieldTrack &pFieldTrack, G4double pCurrentProposedStepLength, G4int navigatorId, G4int stepNo, G4double &pNewSafety, ELimited &limitedStep, G4FieldTrack &EndState, G4VPhysicalVolume *currentVolume)
G4bool Hit(G4Step *aStep)
void SetProcessSubType(G4int)
const G4String & GetProcessName() const
G4double GetTotalEnergyDeposit() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4TransportationManager * GetTransportationManager()
static G4ProductionCutsTable * GetProductionCutsTable()
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
G4int ActivateNavigator(G4Navigator *aNavigator)
G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &)
const G4ThreeVector & GetMomentumDirection() const
G4LogicalVolume * GetLogicalVolume() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
G4Navigator * GetNavigator(const G4String &worldName)
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4StepPoint * GetPostStepPoint() const
void SetNonIonizingEnergyDeposit(G4double value)
G4VParticleChange * pParticleChange
G4VPhysicalVolume * GetVolume() const
void SetPushVerbosity(G4bool mode)
void SetTotalEnergyDeposit(G4double value)
G4VSensitiveDetector * GetSensitiveDetector() const
void SetMaterial(G4Material *)
G4ParallelWorldProcess(const G4String &processName="ParaWorld", G4ProcessType theType=fParallel)
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
G4Track * GetTrack() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
void SetMaterialCutsCouple(const G4MaterialCutsCouple *)
G4ProductionCuts * GetProductionCuts() const
G4VSensitiveDetector * GetSensitiveDetector() const
const G4TouchableHandle & GetTouchableHandle() const
static void Update(G4FieldTrack *, const G4Track *)
static const G4Step * GetHyperStep()