Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParallelGeometriesLimiterProcess Class Reference

#include <G4ParallelGeometriesLimiterProcess.hh>

+ Inheritance diagram for G4ParallelGeometriesLimiterProcess:

Public Member Functions

 G4ParallelGeometriesLimiterProcess (const G4String &processName="biasLimiter")
 
virtual ~G4ParallelGeometriesLimiterProcess ()
 
void AddParallelWorld (const G4String &parallelWorldName)
 
void RemoveParallelWorld (const G4String &parallelWorldName)
 
const std::vector< G4VPhysicalVolume * > & GetParallelWorlds () const
 
G4int GetParallelWorldIndex (const G4VPhysicalVolume *parallelWorld) const
 
G4int GetParallelWorldIndex (G4String parallelWorldName) const
 
const std::vector< G4Navigator * > & GetActiveNavigators () const
 
const G4NavigatorGetNavigator (G4int worldIndex) const
 
const std::vector< const G4VPhysicalVolume * > & GetCurrentVolumes () const
 
const std::vector< const G4VPhysicalVolume * > & GetPreviousVolumes () const
 
const G4VPhysicalVolumeGetCurrentVolume (G4int worldIndex) const
 
const G4VPhysicalVolumeGetPreviousVolume (G4int worldIndex) const
 
const std::vector< G4bool > & GetIsLimiting () const
 
const std::vector< G4bool > & GetWasLimiting () const
 
G4bool GetIsLimiting (G4int worldIndex) const
 
G4bool GetWasLimiting (G4int worldIndex) const
 
void StartTracking (G4Track *)
 
void EndTracking ()
 
G4double PostStepGetPhysicalInteractionLength (const G4Track &, G4double, G4ForceCondition *)
 
G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &)
 
G4double AlongStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
 
G4VParticleChangeAlongStepDoIt (const G4Track &track, const G4Step &step)
 
G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
G4VParticleChangeAtRestDoIt (const G4Track &, const G4Step &)
 
virtual void SetProcessManager (const G4ProcessManager *)
 
- Public Member Functions inherited from G4VProcess
 G4VProcess (const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
 
 G4VProcess (const G4VProcess &right)
 
virtual ~G4VProcess ()
 
G4VProcessoperator= (const G4VProcess &)=delete
 
G4bool operator== (const G4VProcess &right) const
 
G4bool operator!= (const G4VProcess &right) const
 
virtual G4VParticleChangePostStepDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)=0
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &track, G4ForceCondition *condition)=0
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)=0
 
G4double GetCurrentInteractionLength () const
 
void SetPILfactor (G4double value)
 
G4double GetPILfactor () const
 
G4double AlongStepGPIL (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
 
G4double AtRestGPIL (const G4Track &track, G4ForceCondition *condition)
 
G4double PostStepGPIL (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void PreparePhysicsTable (const G4ParticleDefinition &)
 
virtual G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
virtual G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
const G4StringGetPhysicsTableFileName (const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
 
const G4StringGetProcessName () const
 
G4ProcessType GetProcessType () const
 
void SetProcessType (G4ProcessType)
 
G4int GetProcessSubType () const
 
void SetProcessSubType (G4int)
 
virtual const G4VProcessGetCreatorProcess () const
 
virtual void StartTracking (G4Track *)
 
virtual void EndTracking ()
 
virtual void SetProcessManager (const G4ProcessManager *)
 
virtual const G4ProcessManagerGetProcessManager ()
 
virtual void ResetNumberOfInteractionLengthLeft ()
 
G4double GetNumberOfInteractionLengthLeft () const
 
G4double GetTotalNumberOfInteractionLengthTraversed () const
 
G4bool isAtRestDoItIsEnabled () const
 
G4bool isAlongStepDoItIsEnabled () const
 
G4bool isPostStepDoItIsEnabled () const
 
virtual void DumpInfo () const
 
virtual void ProcessDescription (std::ostream &outfile) const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
virtual void SetMasterProcess (G4VProcess *masterP)
 
const G4VProcessGetMasterProcess () const
 
virtual void BuildWorkerPhysicsTable (const G4ParticleDefinition &part)
 
virtual void PrepareWorkerPhysicsTable (const G4ParticleDefinition &)
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double prevStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager = nullptr
 
G4VParticleChangepParticleChange = nullptr
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft = -1.0
 
G4double currentInteractionLength = -1.0
 
G4double theInitialNumberOfInteractionLength = -1.0
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType = fNotDefined
 
G4int theProcessSubType = -1
 
G4double thePILfactor = 1.0
 
G4int verboseLevel = 0
 
G4bool enableAtRestDoIt = true
 
G4bool enableAlongStepDoIt = true
 
G4bool enablePostStepDoIt = true
 

Detailed Description

Definition at line 61 of file G4ParallelGeometriesLimiterProcess.hh.

Constructor & Destructor Documentation

◆ G4ParallelGeometriesLimiterProcess()

G4ParallelGeometriesLimiterProcess::G4ParallelGeometriesLimiterProcess ( const G4String processName = "biasLimiter")

Definition at line 40 of file G4ParallelGeometriesLimiterProcess.cc.

40 :
41 G4VProcess(processName, fParallel),
42 fParallelWorldSafety( 0.0 ),
43 fIsTrackingTime ( false ),
44 fFieldTrack ( '0' )
45{
46 // -- Process Sub Type ? §§
47
48 fPathFinder = G4PathFinder::GetInstance();
50}
@ fParallel
static G4PathFinder * GetInstance()
Definition: G4PathFinder.cc:52
static G4TransportationManager * GetTransportationManager()

◆ ~G4ParallelGeometriesLimiterProcess()

virtual G4ParallelGeometriesLimiterProcess::~G4ParallelGeometriesLimiterProcess ( )
inlinevirtual

Definition at line 70 of file G4ParallelGeometriesLimiterProcess.hh.

71 {}

Member Function Documentation

◆ AddParallelWorld()

void G4ParallelGeometriesLimiterProcess::AddParallelWorld ( const G4String parallelWorldName)

Definition at line 56 of file G4ParallelGeometriesLimiterProcess.cc.

57{
58
59 // -- Refuse adding parallel geometry during tracking time:
60 if (fIsTrackingTime)
61 {
63 ed << "G4ParallelGeometriesLimiterProcess `" << GetProcessName()
64 << "': adding a parallel world volume at tracking time is not allowed." << G4endl;
65 G4Exception("G4ParallelGeometriesLimiterProcess::AddParallelWorld(const G4String& parallelWorldName)",
66 "BIAS.GEN.21",
67 JustWarning, ed,
68 "Call ignored.");
69 return;
70 }
71
72 else
73
74 {
75 G4VPhysicalVolume* newWorld = fTransportationManager->IsWorldExisting( parallelWorldName );
76
77 // -- Fatal exception if requested world does not exist:
78 if (newWorld == 0)
79 {
80 G4ExceptionDescription tellWhatIsWrong;
81 tellWhatIsWrong << "Volume `" << parallelWorldName
82 << "' is not a parallel world nor the mass world volume."
83 << G4endl;
84 G4Exception("G4ParallelGeometriesLimiterProcess::SetWorldVolume(const G4String)",
85 "BIAS.GEN.22",
87 tellWhatIsWrong);
88 }
89
90 // -- Protection against adding the mass geometry world as parallel world:
91 if ( newWorld == fTransportationManager->GetNavigatorForTracking()->GetWorldVolume() )
92 {
94 ed << "G4ParallelGeometriesLimiterProcess `" << GetProcessName()
95 << "': trying to add the world volume for tracking as a parallel world." << G4endl;
96 G4Exception("G4ParallelGeometriesLimiterProcess::AddParallelWorld(const G4String& parallelWorldName)",
97 "BIAS.GEN.23",
98 JustWarning, ed,
99 "Call ignored.");
100 return;
101 }
102
103 // -- Add parallel world, taking care it is not in the list yet:
104 G4bool isNew = true;
105 for ( auto knownWorld : fParallelWorlds )
106 {
107 if ( knownWorld == newWorld ) isNew = false;
108 }
109 if ( isNew ) fParallelWorlds.push_back( newWorld );
110 else
111 {
113 ed << "G4ParallelGeometriesLimiterProcess `" << GetProcessName()
114 << "': trying to re-add the parallel world volume `" << parallelWorldName << "'." << G4endl;
115 G4Exception("G4ParallelGeometriesLimiterProcess::AddParallelWorld(const G4String& parallelWorldName)",
116 "BIAS.GEN.24",
117 JustWarning, ed,
118 "Call ignored.");
119 return;
120 }
121 }
122
123}
@ JustWarning
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
bool G4bool
Definition: G4Types.hh:86
#define G4endl
Definition: G4ios.hh:57
G4VPhysicalVolume * GetWorldVolume() const
G4VPhysicalVolume * IsWorldExisting(const G4String &worldName)
G4Navigator * GetNavigatorForTracking() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:386

◆ AlongStepDoIt()

G4VParticleChange * G4ParallelGeometriesLimiterProcess::AlongStepDoIt ( const G4Track track,
const G4Step step 
)
virtual

Implements G4VProcess.

Definition at line 370 of file G4ParallelGeometriesLimiterProcess.cc.

372{
373
374 fDummyParticleChange.Initialize(track);
375 return &fDummyParticleChange;
376}
virtual void Initialize(const G4Track &track)

◆ AlongStepGetPhysicalInteractionLength()

G4double G4ParallelGeometriesLimiterProcess::AlongStepGetPhysicalInteractionLength ( const G4Track track,
G4double  previousStepSize,
G4double  currentMinimumStep,
G4double proposedSafety,
G4GPILSelection selection 
)
virtual

Implements G4VProcess.

Definition at line 253 of file G4ParallelGeometriesLimiterProcess.cc.

258{
259
260 // -- Init:
261 // -- Note that the returnedStep must be physically meaningful, even if we return NotCandidateForSelection as condition;
262 // -- the reason is that the stepping manager always takes the smallest alongstep among the returned ones (point related
263 // -- to geometry step length wrt to true path length).
264 *selection = NotCandidateForSelection;
265 G4double returnedStep = DBL_MAX;
266
267 // -- G4FieldTrack and ELimited:
268 static G4ThreadLocal G4FieldTrack *endTrack_G4MT_TLS_ = 0 ;
269 if (!endTrack_G4MT_TLS_) endTrack_G4MT_TLS_ = new G4FieldTrack ('0') ;
270 G4FieldTrack &endTrack = *endTrack_G4MT_TLS_;
271
272 static G4ThreadLocal ELimited *eLimited_G4MT_TLS_ = 0 ;
273 if (!eLimited_G4MT_TLS_) eLimited_G4MT_TLS_ = new ELimited ;
274 ELimited &eLimited = *eLimited_G4MT_TLS_;
275
276
277 // -------------------
278 // -- Update safeties:
279 // -------------------
280 if ( previousStepSize > 0.0 )
281 {
282 for ( auto& parallelWorldSafety : fParallelWorldSafeties )
283 {
284 parallelWorldSafety -= previousStepSize;
285 if ( parallelWorldSafety < 0. ) parallelWorldSafety = 0.0;
286 fParallelWorldSafety = parallelWorldSafety < fParallelWorldSafety ? parallelWorldSafety : fParallelWorldSafety ;
287 }
288 }
289
290
291 // ------------------------------------------
292 // Determination of the proposed step length:
293 // ------------------------------------------
294 if ( ( currentMinimumStep <= fParallelWorldSafety ) && ( currentMinimumStep > 0. ) )
295 {
296 // -- No chance to limit the step, as proposed move inside safety
297
298 returnedStep = currentMinimumStep;
299 proposedSafety = fParallelWorldSafety - currentMinimumStep;
300 }
301 else
302 {
303 // -- Proposed move exceeds common safety, need to state
304 G4double smallestReturnedStep = -1.0;
305 ELimited eLimitedForSmallestStep = kDoNot;
306 for ( size_t i = 0 ; i < fParallelWorldNavigatorIndeces.size() ; i++ )
307 {
308 // -- Update safety of geometries having safety smaller than current minimum step
309 if ( currentMinimumStep >= fParallelWorldSafeties[i] )
310 {
311 G4FieldTrackUpdator::Update(&fFieldTrack, &track);
312 G4double tmpReturnedStep = fPathFinder->ComputeStep(fFieldTrack,
313 currentMinimumStep,
314 fParallelWorldNavigatorIndeces[i],
315 track.GetCurrentStepNumber(),
316 fParallelWorldSafeties[i],
317 eLimited,
318 endTrack,
319 track.GetVolume());
320
321 if ( ( smallestReturnedStep < 0.0 ) || ( tmpReturnedStep <= smallestReturnedStep ) )
322 {
323 smallestReturnedStep = tmpReturnedStep;
324 eLimitedForSmallestStep = eLimited;
325 }
326
327 if (eLimited == kDoNot)
328 {
329 // -- Step not limited by this geometry
330 fParallelWorldSafeties[i] = fParallelWorldNavigators[i]->ComputeSafety(endTrack.GetPosition());
331 fParallelWorldIsLimiting[i] = false;
332 }
333 else
334 {
335 fParallelWorldIsLimiting[i] = true;
336 }
337 }
338
339 // -- update with smallest safety:
340 fParallelWorldSafety = fParallelWorldSafeties[i] < fParallelWorldSafety ? fParallelWorldSafeties[i] : fParallelWorldSafety ;
341 }
342
343 // -- no geometry limitation among all geometries, can return currentMinimumStep (or DBL_MAX):
344 // -- Beware : the returnedStep must be physically meaningful, even if we say "NotCandidateForSelection" !
345 if ( eLimitedForSmallestStep == kDoNot )
346 {
347 returnedStep = currentMinimumStep;
348 }
349 // -- proposed step length of limiting geometry:
350 if ( eLimitedForSmallestStep == kUnique ||
351 eLimitedForSmallestStep == kSharedOther )
352 {
353 *selection = CandidateForSelection;
354 returnedStep = smallestReturnedStep;
355 }
356 else if ( eLimitedForSmallestStep == kSharedTransport)
357 {
358 returnedStep = smallestReturnedStep* (1.0 + 1.0e-9); // -- Expand to disable its selection in Step Manager comparison
359 }
360
361 // -- and smallest safety among geometries:
362 proposedSafety = fParallelWorldSafety ;
363 }
364
365 // -- returns step length, and proposedSafety
366 return returnedStep;
367}
@ CandidateForSelection
@ NotCandidateForSelection
ELimited
@ kDoNot
@ kUnique
@ kSharedOther
@ kSharedTransport
double G4double
Definition: G4Types.hh:83
static void Update(G4FieldTrack *, const G4Track *)
G4ThreeVector GetPosition() const
G4double ComputeStep(const G4FieldTrack &pFieldTrack, G4double pCurrentProposedStepLength, G4int navigatorId, G4int stepNo, G4double &pNewSafety, ELimited &limitedStep, G4FieldTrack &EndState, G4VPhysicalVolume *currentVolume)
G4VPhysicalVolume * GetVolume() const
G4int GetCurrentStepNumber() const
#define DBL_MAX
Definition: templates.hh:62
#define G4ThreadLocal
Definition: tls.hh:77

◆ AtRestDoIt()

G4VParticleChange * G4ParallelGeometriesLimiterProcess::AtRestDoIt ( const G4Track ,
const G4Step  
)
inlinevirtual

Implements G4VProcess.

Definition at line 156 of file G4ParallelGeometriesLimiterProcess.hh.

157 { return nullptr; }

◆ AtRestGetPhysicalInteractionLength()

G4double G4ParallelGeometriesLimiterProcess::AtRestGetPhysicalInteractionLength ( const G4Track ,
G4ForceCondition  
)
inlinevirtual

Implements G4VProcess.

Definition at line 152 of file G4ParallelGeometriesLimiterProcess.hh.

154 { return DBL_MAX; }

◆ EndTracking()

void G4ParallelGeometriesLimiterProcess::EndTracking ( )
virtual

Reimplemented from G4VProcess.

Definition at line 228 of file G4ParallelGeometriesLimiterProcess.cc.

229{
230 fIsTrackingTime = false;
231 for ( auto parallelWorldNavigator : fParallelWorldNavigators )
232 fTransportationManager->DeActivateNavigator( parallelWorldNavigator );
233}
void DeActivateNavigator(G4Navigator *aNavigator)

◆ GetActiveNavigators()

const std::vector< G4Navigator * > & G4ParallelGeometriesLimiterProcess::GetActiveNavigators ( ) const
inline

Definition at line 94 of file G4ParallelGeometriesLimiterProcess.hh.

94{ return fParallelWorldNavigators; }

◆ GetCurrentVolume()

const G4VPhysicalVolume * G4ParallelGeometriesLimiterProcess::GetCurrentVolume ( G4int  worldIndex) const
inline

Definition at line 111 of file G4ParallelGeometriesLimiterProcess.hh.

111{ return fCurrentVolumes[size_t(worldIndex)]; }

◆ GetCurrentVolumes()

const std::vector< const G4VPhysicalVolume * > & G4ParallelGeometriesLimiterProcess::GetCurrentVolumes ( ) const
inline

Definition at line 107 of file G4ParallelGeometriesLimiterProcess.hh.

107{ return fCurrentVolumes; }

Referenced by G4BiasingProcessInterface::PostStepGetPhysicalInteractionLength().

◆ GetIsLimiting() [1/2]

const std::vector< G4bool > & G4ParallelGeometriesLimiterProcess::GetIsLimiting ( ) const
inline

Definition at line 114 of file G4ParallelGeometriesLimiterProcess.hh.

114{ return fParallelWorldIsLimiting; }

◆ GetIsLimiting() [2/2]

G4bool G4ParallelGeometriesLimiterProcess::GetIsLimiting ( G4int  worldIndex) const
inline

Definition at line 118 of file G4ParallelGeometriesLimiterProcess.hh.

118{ return fParallelWorldIsLimiting[size_t(worldIndex)]; }

◆ GetNavigator()

const G4Navigator * G4ParallelGeometriesLimiterProcess::GetNavigator ( G4int  worldIndex) const
inline

Definition at line 97 of file G4ParallelGeometriesLimiterProcess.hh.

97{ return fParallelWorldNavigators[size_t(worldIndex)]; }

Referenced by StartTracking().

◆ GetParallelWorldIndex() [1/2]

G4int G4ParallelGeometriesLimiterProcess::GetParallelWorldIndex ( const G4VPhysicalVolume parallelWorld) const

Definition at line 406 of file G4ParallelGeometriesLimiterProcess.cc.

407{
408 G4int toReturn = -1;
409 G4int iWorld = 0;
410 for ( auto world : fParallelWorlds )
411 {
412 if ( world == parallelWorld )
413 {
414 toReturn = iWorld;
415 break;
416 }
417 iWorld++;
418 }
419 return toReturn;
420}
int G4int
Definition: G4Types.hh:85

Referenced by GetParallelWorldIndex().

◆ GetParallelWorldIndex() [2/2]

G4int G4ParallelGeometriesLimiterProcess::GetParallelWorldIndex ( G4String  parallelWorldName) const

Definition at line 423 of file G4ParallelGeometriesLimiterProcess.cc.

424{
425 G4VPhysicalVolume* aWorld = fTransportationManager->IsWorldExisting( parallelWorldName ); // note aWorld might be nullptr
426 return GetParallelWorldIndex( aWorld );
427}
G4int GetParallelWorldIndex(const G4VPhysicalVolume *parallelWorld) const

◆ GetParallelWorlds()

const std::vector< G4VPhysicalVolume * > & G4ParallelGeometriesLimiterProcess::GetParallelWorlds ( ) const
inline

Definition at line 80 of file G4ParallelGeometriesLimiterProcess.hh.

80{ return fParallelWorlds; }

◆ GetPreviousVolume()

const G4VPhysicalVolume * G4ParallelGeometriesLimiterProcess::GetPreviousVolume ( G4int  worldIndex) const
inline

Definition at line 112 of file G4ParallelGeometriesLimiterProcess.hh.

112{ return fPreviousVolumes[size_t(worldIndex)]; }

◆ GetPreviousVolumes()

const std::vector< const G4VPhysicalVolume * > & G4ParallelGeometriesLimiterProcess::GetPreviousVolumes ( ) const
inline

Definition at line 108 of file G4ParallelGeometriesLimiterProcess.hh.

108{ return fPreviousVolumes; }

◆ GetWasLimiting() [1/2]

const std::vector< G4bool > & G4ParallelGeometriesLimiterProcess::GetWasLimiting ( ) const
inline

Definition at line 115 of file G4ParallelGeometriesLimiterProcess.hh.

115{ return fParallelWorldWasLimiting; }

Referenced by G4BiasingProcessInterface::PostStepGetPhysicalInteractionLength().

◆ GetWasLimiting() [2/2]

G4bool G4ParallelGeometriesLimiterProcess::GetWasLimiting ( G4int  worldIndex) const
inline

Definition at line 119 of file G4ParallelGeometriesLimiterProcess.hh.

119{ return fParallelWorldWasLimiting[size_t(worldIndex)]; }

◆ PostStepDoIt()

G4VParticleChange * G4ParallelGeometriesLimiterProcess::PostStepDoIt ( const G4Track ,
const G4Step  
)
inlinevirtual

Implements G4VProcess.

Definition at line 135 of file G4ParallelGeometriesLimiterProcess.hh.

136 { return nullptr; }

◆ PostStepGetPhysicalInteractionLength()

G4double G4ParallelGeometriesLimiterProcess::PostStepGetPhysicalInteractionLength ( const G4Track ,
G4double  ,
G4ForceCondition condition 
)
virtual

Implements G4VProcess.

Definition at line 236 of file G4ParallelGeometriesLimiterProcess.cc.

237{
238
239 // -- push previous step limitation flags and volumes:
240 // -- §§ consider switching pointers insteads of making copies of std::vector's:
241 fParallelWorldWasLimiting = fParallelWorldIsLimiting;
242 fPreviousVolumes = fCurrentVolumes;
243
244 // -- update volumes:
245 size_t i = 0;
246 for ( auto navigatorIndex : fParallelWorldNavigatorIndeces ) fCurrentVolumes[i++] = fPathFinder->GetLocatedVolume( navigatorIndex );
247
249 return DBL_MAX;
250}
G4double condition(const G4ErrorSymMatrix &m)
@ NotForced
G4VPhysicalVolume * GetLocatedVolume(G4int navId) const

◆ RemoveParallelWorld()

void G4ParallelGeometriesLimiterProcess::RemoveParallelWorld ( const G4String parallelWorldName)

Definition at line 126 of file G4ParallelGeometriesLimiterProcess.cc.

127{
128
129 // -- Refuse refuse removing parallel geometry during tracking time:
130 if (fIsTrackingTime)
131 {
133 ed << "G4ParallelGeometriesLimiterProcess `" << GetProcessName()
134 << "': removing a parallel world volume at tracking time is not allowed." << G4endl;
135 G4Exception("G4ParallelGeometriesLimiterProcess::RemoveParallelWorld(const G4String& parallelWorldName)",
136 "BIAS.GEN.25",
137 JustWarning, ed,
138 "Call ignored.");
139 return;
140 }
141
142 else
143
144 {
145 G4VPhysicalVolume* newWorld = fTransportationManager->IsWorldExisting( parallelWorldName );
146
147 if (newWorld == 0)
148 {
149
151 ed << "G4ParallelGeometriesLimiterProcess `" << GetProcessName()
152 << "': trying to remove an inexisting parallel world '" << parallelWorldName << "'." << G4endl;
153 G4Exception("G4ParallelGeometriesLimiterProcess::RemoveParallelWorld(const G4String& parallelWorldName)",
154 "BIAS.GEN.26",
155 JustWarning, ed,
156 "Call ignored.");
157 return;
158 }
159
160 // -- get position of world volume in list:
161 size_t iWorld = 0;
162 for ( auto knownWorld : fParallelWorlds )
163 {
164 if ( knownWorld == newWorld ) break;
165 iWorld++;
166 }
167
168 if ( iWorld == fParallelWorlds.size() )
169 {
171 ed << "G4ParallelGeometriesLimiterProcess `" << GetProcessName()
172 << "': trying to remove an non-registerered parallel world '" << parallelWorldName << "'." << G4endl;
173 G4Exception("G4ParallelGeometriesLimiterProcess::RemoveParallelWorld(const G4String& parallelWorldName)",
174 "BIAS.GEN.27",
175 JustWarning, ed,
176 "Call ignored.");
177 return;
178 }
179
180 // -- remove from vector:
181 fParallelWorlds.erase( fParallelWorlds.begin() + iWorld );
182
183 }
184
185
186
187}

◆ SetProcessManager()

void G4ParallelGeometriesLimiterProcess::SetProcessManager ( const G4ProcessManager mgr)
virtual

Reimplemented from G4VProcess.

Definition at line 379 of file G4ParallelGeometriesLimiterProcess.cc.

380{
381 G4BiasingProcessSharedData *sharedData(nullptr);
382
383 // -- initialize sharedData pointer:
384 if ( G4BiasingProcessSharedData::fSharedDataMap.Find(mgr) == G4BiasingProcessSharedData::fSharedDataMap.End() )
385 {
386 sharedData = new G4BiasingProcessSharedData( mgr );
387 G4BiasingProcessSharedData::fSharedDataMap[mgr] = sharedData;
388 }
389 else sharedData = G4BiasingProcessSharedData::fSharedDataMap[mgr] ;
390
391 // -- add itself to the shared data:
392 if ( sharedData->fParallelGeometriesLimiterProcess == nullptr ) sharedData->fParallelGeometriesLimiterProcess = this;
393 else
394 {
396 ed << " Trying to add more than one G4ParallelGeometriesLimiterProcess process to the process manager " << mgr
397 << " (process manager for `" << mgr->GetParticleType()->GetParticleName() << "'). Only one is needed. Call ignored." << G4endl;
398 G4Exception(" G4ParallelGeometriesLimiterProcess::SetProcessManager(...)",
399 "BIAS.GEN.29",
401 ed);
402 }
403}
const G4String & GetParticleName() const
G4ParticleDefinition * GetParticleType() const

◆ StartTracking()

void G4ParallelGeometriesLimiterProcess::StartTracking ( G4Track track)
virtual

Reimplemented from G4VProcess.

Definition at line 193 of file G4ParallelGeometriesLimiterProcess.cc.

194{
195 fIsTrackingTime = true;
196
197 // -- fetch the navigators, their indeces, and activate:
198 fParallelWorldNavigators .clear();
199 fParallelWorldNavigatorIndeces.clear();
200 fParallelWorldSafeties .clear();
201 fParallelWorldIsLimiting .clear();
202 fParallelWorldWasLimiting .clear();
203 fCurrentVolumes .clear();
204 fPreviousVolumes .clear();
205 for ( auto parallelWorld : fParallelWorlds )
206 {
207 fParallelWorldNavigators .push_back( fTransportationManager-> GetNavigator( parallelWorld ) );
208 fParallelWorldNavigatorIndeces.push_back( fTransportationManager->ActivateNavigator( fParallelWorldNavigators.back() ) );
209 fParallelWorldSafeties .push_back( 0.0 );
210 fParallelWorldIsLimiting .push_back( false );
211 fParallelWorldWasLimiting .push_back( false );
212 }
213
214 fPathFinder->PrepareNewTrack( track->GetPosition(), track->GetMomentumDirection() );
215 // -- §§ does it work at this level, after "PrepareNewTrack" above ?
216 for ( auto navigatorIndex : fParallelWorldNavigatorIndeces )
217 {
218 fPreviousVolumes.push_back( nullptr );
219 fCurrentVolumes .push_back( fPathFinder->GetLocatedVolume( navigatorIndex ) );
220 }
221
222 // -- will force updating safety:
223 fParallelWorldSafety = 0.0;
224 for ( size_t i = 0 ; i < fParallelWorldNavigatorIndeces.size() ; i++ ) fParallelWorldSafeties[i] = 0.0;
225}
const G4Navigator * GetNavigator(G4int worldIndex) const
void PrepareNewTrack(const G4ThreeVector &position, const G4ThreeVector &direction, G4VPhysicalVolume *massStartVol=nullptr)
const G4ThreeVector & GetPosition() const
const G4ThreeVector & GetMomentumDirection() const
G4int ActivateNavigator(G4Navigator *aNavigator)

The documentation for this class was generated from the following files: