Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4ImportanceProcess Class Reference

#include <G4ImportanceProcess.hh>

Inheritance diagram for G4ImportanceProcess:
G4VProcess G4VTrackTerminator

Public Member Functions

 G4ImportanceProcess (const G4VImportanceAlgorithm &aImportanceAlgorithm, const G4VIStore &aIstore, const G4VTrackTerminator *TrackTerminator, const G4String &aName="ImportanceProcess", G4bool para=false)
 
virtual ~G4ImportanceProcess ()
 
void SetParallelWorld (G4String parallelWorldName)
 
void StartTracking (G4Track *)
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &)
 
virtual void KillTrack () const
 
virtual const G4StringGetName () const
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &, const G4Step &)
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &, const G4Step &)
 
- Public Member Functions inherited from G4VProcess
 G4VProcess (const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
 
 G4VProcess (const G4VProcess &right)
 
virtual ~G4VProcess ()
 
G4int operator== (const G4VProcess &right) const
 
G4int operator!= (const G4VProcess &right) const
 
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 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
 
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 &)
 
- Public Member Functions inherited from G4VTrackTerminator
 G4VTrackTerminator ()
 
virtual ~G4VTrackTerminator ()
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double previousStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager
 
G4VParticleChangepParticleChange
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft
 
G4double currentInteractionLength
 
G4double theInitialNumberOfInteractionLength
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType
 
G4int theProcessSubType
 
G4double thePILfactor
 
G4bool enableAtRestDoIt
 
G4bool enableAlongStepDoIt
 
G4bool enablePostStepDoIt
 
G4int verboseLevel
 
- Protected Attributes inherited from G4VTrackTerminator
G4double kCarTolerance
 

Detailed Description

Definition at line 61 of file G4ImportanceProcess.hh.

Constructor & Destructor Documentation

G4ImportanceProcess::G4ImportanceProcess ( const G4VImportanceAlgorithm aImportanceAlgorithm,
const G4VIStore aIstore,
const G4VTrackTerminator TrackTerminator,
const G4String aName = "ImportanceProcess",
G4bool  para = false 
)

Definition at line 55 of file G4ImportanceProcess.cc.

References FatalException, G4cout, G4endl, G4Exception(), G4PathFinder::GetInstance(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4VProcess::GetProcessName(), G4TransportationManager::GetTransportationManager(), G4VProcess::pParticleChange, and G4VProcess::verboseLevel.

59  : G4VProcess(aName),
60  fParticleChange(new G4ParticleChange),
61  fImportanceAlgorithm(aImportanceAlgorithm),
62  fIStore(aIstore),
63  fPostStepAction(0),
64  fGhostWorldName("NoParallelWorld"),fGhostWorld(0),
65  fGhostNavigator(0), fNavigatorID(-1), fFieldTrack('0'),
66  paraflag(para)
67 
68 {
69  G4cout << G4endl << G4endl << G4endl;
70  G4cout << "G4ImportanceProcess:: Creating " << G4endl;
71  if (TrackTerminator)
72  {
73  fPostStepAction = new G4SamplingPostStepAction(*TrackTerminator);
74  }
75  else
76  {
77  fPostStepAction = new G4SamplingPostStepAction(*this);
78  }
79  if (!fParticleChange)
80  {
81  G4Exception("G4ImportanceProcess::G4ImportanceProcess()",
82  "FatalError", FatalException,
83  "Failed allocation of G4ParticleChange !");
84  }
85  G4VProcess::pParticleChange = fParticleChange;
86 
87 
88  fGhostStep = new G4Step();
89  fGhostPreStepPoint = fGhostStep->GetPreStepPoint();
90  fGhostPostStepPoint = fGhostStep->GetPostStepPoint();
91 
92  fTransportationManager = G4TransportationManager::GetTransportationManager();
93  fPathFinder = G4PathFinder::GetInstance();
94 
95  if (verboseLevel>0)
96  {
97  G4cout << GetProcessName() << " is created " << G4endl;
98  }
99 
100  G4cout << "G4ImportanceProcess:: importance process paraflag is: " << paraflag << G4endl;
101 
102 }
static G4PathFinder * GetInstance()
Definition: G4PathFinder.cc:57
G4int verboseLevel
Definition: G4VProcess.hh:368
G4VProcess(const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
Definition: G4VProcess.cc:52
G4StepPoint * GetPreStepPoint() const
G4GLOB_DLL std::ostream G4cout
Definition: G4Step.hh:76
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4TransportationManager * GetTransportationManager()
G4StepPoint * GetPostStepPoint() const
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
#define G4endl
Definition: G4ios.hh:61
G4ImportanceProcess::~G4ImportanceProcess ( )
virtual

Definition at line 104 of file G4ImportanceProcess.cc.

105 {
106 
107  delete fPostStepAction;
108  delete fParticleChange;
109  // delete fGhostStep;
110  // delete fGhostWorld;
111  // delete fGhostNavigator;
112 
113 }

Member Function Documentation

G4VParticleChange * G4ImportanceProcess::AlongStepDoIt ( const G4Track aTrack,
const G4Step  
)
virtual

Implements G4VProcess.

Definition at line 453 of file G4ImportanceProcess.cc.

References G4VParticleChange::Initialize(), and G4VProcess::pParticleChange.

454 {
455  // Dummy ParticleChange ie: does nothing
456  // Expecting G4Transportation to move the track
457  //AH G4cout << " along step do it " << G4endl;
458  pParticleChange->Initialize(aTrack);
459  return pParticleChange;
460  // return 0;
461 }
virtual void Initialize(const G4Track &)
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4double G4ImportanceProcess::AlongStepGetPhysicalInteractionLength ( const G4Track track,
G4double  previousStepSize,
G4double  currentMinimumStep,
G4double proposedSafety,
G4GPILSelection selection 
)
virtual

Implements G4VProcess.

Definition at line 358 of file G4ImportanceProcess.cc.

References CandidateForSelection, G4Navigator::ComputeSafety(), G4PathFinder::ComputeStep(), DBL_MAX, G4ThreadLocal, G4Track::GetCurrentStepNumber(), G4Track::GetVolume(), kDoNot, kSharedOther, kSharedTransport, kUnique, NotCandidateForSelection, and G4FieldTrackUpdator::Update().

361 {
362 
363  //AH G4cout << " along step physical interaction length " << G4endl;
364 
365  if(paraflag) {
366  static G4ThreadLocal G4FieldTrack *endTrack_G4MT_TLS_ = 0 ; if (!endTrack_G4MT_TLS_) endTrack_G4MT_TLS_ = new G4FieldTrack ('0') ; G4FieldTrack &endTrack = *endTrack_G4MT_TLS_;
367  static G4ThreadLocal ELimited *eLimited_G4MT_TLS_ = 0 ; if (!eLimited_G4MT_TLS_) eLimited_G4MT_TLS_ = new ELimited ; ELimited &eLimited = *eLimited_G4MT_TLS_;
368 
369  *selection = NotCandidateForSelection;
370  G4double returnedStep = DBL_MAX;
371 
372  if (previousStepSize > 0.)
373  { fGhostSafety -= previousStepSize; }
374  // else
375  // { fGhostSafety = -1.; }
376  if (fGhostSafety < 0.) fGhostSafety = 0.0;
377 
378  // ------------------------------------------
379  // Determination of the proposed STEP LENGTH:
380  // ------------------------------------------
381  if (currentMinimumStep <= fGhostSafety && currentMinimumStep > 0.)
382  {
383  // I have no chance to limit
384  returnedStep = currentMinimumStep;
385  fOnBoundary = false;
386  proposedSafety = fGhostSafety - currentMinimumStep;
387  //AH G4cout << " step not limited, why? " << G4endl;
388  }
389  else // (currentMinimumStep > fGhostSafety: I may limit the Step)
390  {
391  G4FieldTrackUpdator::Update(&fFieldTrack,&track);
392  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
393  // ComputeStep
394  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
395  returnedStep
396  = fPathFinder->ComputeStep(fFieldTrack,currentMinimumStep,fNavigatorID,
397  track.GetCurrentStepNumber(),fGhostSafety,eLimited,
398  endTrack,track.GetVolume());
399  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
400  if(eLimited == kDoNot)
401  {
402  //AH G4cout << " computestep came back with not-boundary " << G4endl;
403  // Track is not on the boundary
404  fOnBoundary = false;
405  fGhostSafety = fGhostNavigator->ComputeSafety(endTrack.GetPosition());
406  }
407  else
408  {
409  // Track is on the boundary
410  //AH G4cout << " FOUND A BOUNDARY ! " << track.GetCurrentStepNumber() << G4endl;
411  fOnBoundary = true;
412  // proposedSafety = fGhostSafety;
413  }
414  proposedSafety = fGhostSafety;
415  if(eLimited == kUnique || eLimited == kSharedOther) {
416  *selection = CandidateForSelection;
417  }else if (eLimited == kSharedTransport) {
418  returnedStep *= (1.0 + 1.0e-9);
419  // Expand to disable its selection in Step Manager comparison
420  }
421 
422  }
423 
424  // ----------------------------------------------
425  // Returns the fGhostSafety as the proposedSafety
426  // The SteppingManager will take care of keeping
427  // the smallest one.
428  // ----------------------------------------------
429  return returnedStep;
430 
431  } else {
432 
433  return DBL_MAX;
434 
435  }
436 
437 }
ELimited
#define G4ThreadLocal
Definition: tls.hh:52
G4int GetCurrentStepNumber() const
G4double ComputeStep(const G4FieldTrack &pFieldTrack, G4double pCurrentProposedStepLength, G4int navigatorId, G4int stepNo, G4double &pNewSafety, ELimited &limitedStep, G4FieldTrack &EndState, G4VPhysicalVolume *currentVolume)
G4VPhysicalVolume * GetVolume() const
double G4double
Definition: G4Types.hh:76
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
#define DBL_MAX
Definition: templates.hh:83
static void Update(G4FieldTrack *, const G4Track *)
G4VParticleChange * G4ImportanceProcess::AtRestDoIt ( const G4Track ,
const G4Step  
)
virtual

Implements G4VProcess.

Definition at line 447 of file G4ImportanceProcess.cc.

448 {
449  return 0;
450 }
G4double G4ImportanceProcess::AtRestGetPhysicalInteractionLength ( const G4Track ,
G4ForceCondition  
)
virtual

Implements G4VProcess.

Definition at line 440 of file G4ImportanceProcess.cc.

442 {
443  return -1.0;
444 }
const G4String & G4ImportanceProcess::GetName ( void  ) const
virtual

Implements G4VTrackTerminator.

Definition at line 352 of file G4ImportanceProcess.cc.

References G4VProcess::theProcessName.

353 {
354  return theProcessName;
355 }
G4String theProcessName
Definition: G4VProcess.hh:335
void G4ImportanceProcess::KillTrack ( ) const
virtual

Implements G4VTrackTerminator.

Definition at line 347 of file G4ImportanceProcess.cc.

References fStopAndKill, and G4VParticleChange::ProposeTrackStatus().

348 {
349  fParticleChange->ProposeTrackStatus(fStopAndKill);
350 }
void ProposeTrackStatus(G4TrackStatus status)
G4VParticleChange * G4ImportanceProcess::PostStepDoIt ( const G4Track aTrack,
const G4Step aStep 
)
virtual

Implements G4VProcess.

Definition at line 212 of file G4ImportanceProcess.cc.

References G4PathFinder::CreateTouchableHandle(), G4SamplingPostStepAction::DoIt(), fGeomBoundary, fStopAndKill, G4cout, G4endl, G4VIStore::GetImportance(), G4StepPoint::GetPhysicalVolume(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4VTouchable::GetReplicaNumber(), G4Step::GetStepLength(), G4StepPoint::GetStepStatus(), G4StepPoint::GetTouchable(), G4StepPoint::GetTouchableHandle(), G4Track::GetTrackStatus(), G4Track::GetWeight(), G4ParticleChange::Initialize(), G4VTrackTerminator::kCarTolerance, and G4StepPoint::SetTouchableHandle().

214 {
215  fParticleChange->Initialize(aTrack);
216 
217  if(paraflag) {
218  fOldGhostTouchable = fGhostPostStepPoint->GetTouchableHandle();
219  //xbug? fOnBoundary = false;
220  CopyStep(aStep);
221 
222  if(fOnBoundary)
223  {
224 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
225 // Locate the point and get new touchable
226 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
227  //?? fPathFinder->Locate(step.GetPostStepPoint()->GetPosition(),
228  //?? step.GetPostStepPoint()->GetMomentumDirection());
229  fNewGhostTouchable = fPathFinder->CreateTouchableHandle(fNavigatorID);
230  //AH G4cout << " on boundary " << G4endl;
231 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
232  }
233  else
234  {
235  // Do I need this ??????????????????????????????????????????????????????????
236  // fGhostNavigator->LocateGlobalPointWithinVolume(track.GetPosition());
237  // ?????????????????????????????????????????????????????????????????????????
238 
239  // fPathFinder->ReLocate(track.GetPosition());
240 
241  // reuse the touchable
242  fNewGhostTouchable = fOldGhostTouchable;
243  //AH G4cout << " NOT on boundary " << G4endl;
244  }
245 
246  fGhostPreStepPoint->SetTouchableHandle(fOldGhostTouchable);
247  fGhostPostStepPoint->SetTouchableHandle(fNewGhostTouchable);
248 
249 // if ( (aStep.GetPostStepPoint()->GetStepStatus() == fGeomBoundary)
250 // && (aStep.GetStepLength() > kCarTolerance) )
251 // {
252 // if (aTrack.GetTrackStatus()==fStopAndKill)
253 // {
254 // G4cout << "WARNING - G4ImportanceProcess::PostStepDoIt()"
255 // << " StopAndKill track." << G4endl;
256 // }
257 
258 // G4StepPoint *prepoint = aStep.GetPreStepPoint();
259 // G4StepPoint *postpoint = aStep.GetPostStepPoint();
260 // G4GeometryCell prekey(*(prepoint->GetPhysicalVolume()),
261 // prepoint->GetTouchable()->GetReplicaNumber());
262 // G4GeometryCell postkey(*(postpoint->GetPhysicalVolume()),
263 // postpoint->GetTouchable()->GetReplicaNumber());
264 
265 
266  if ( (fGhostPostStepPoint->GetStepStatus() == fGeomBoundary)
267  && (aStep.GetStepLength() > kCarTolerance) )
268  {
269  if (aTrack.GetTrackStatus()==fStopAndKill)
270  {
271  G4cout << "WARNING - G4ImportanceProcess::PostStepDoIt()"
272  << " StopAndKill track. on boundary" << G4endl;
273  }
274 
275  G4GeometryCell prekey(*(fGhostPreStepPoint->GetPhysicalVolume()),
276  fGhostPreStepPoint->GetTouchable()->GetReplicaNumber());
277  G4GeometryCell postkey(*(fGhostPostStepPoint->GetPhysicalVolume()),
278  fGhostPostStepPoint->GetTouchable()->GetReplicaNumber());
279 
280  //AH
281  /*
282  G4cout << G4endl;
283  G4cout << G4endl;
284  G4cout << " inside parallel importance process " << aTrack.GetCurrentStepNumber() << G4endl;
285  G4cout << G4endl;
286  G4cout << G4endl;
287  G4cout << " prekey: " << fGhostPreStepPoint->GetPhysicalVolume()->GetName() << " replica:"
288  << fGhostPreStepPoint->GetTouchable()->GetReplicaNumber() << G4endl;
289  G4cout << " prekey ISTORE: " << fIStore.GetImportance(prekey) << G4endl;
290  G4cout << " postkey: " << G4endl;
291  G4cout << " postkey ISTORE: " << fIStore.GetImportance(postkey) << G4endl;
292  */
293  //AH
294  G4Nsplit_Weight nw = fImportanceAlgorithm.
295  Calculate(fIStore.GetImportance(prekey),
296  fIStore.GetImportance(postkey),
297  aTrack.GetWeight());
298  //AH
299  /*
300  G4cout << " prekey weight: " << fIStore.GetImportance(prekey)
301  << " postkey weight: " << fIStore.GetImportance(postkey)
302  << " split weight: " << nw << G4endl;
303  G4cout << " before poststepaction " << G4endl;
304  */
305  //AH
306  fPostStepAction->DoIt(aTrack, fParticleChange, nw);
307  //AH G4cout << " after post step do it " << G4endl;
308  }
309  } else {
310  if ( (aStep.GetPostStepPoint()->GetStepStatus() == fGeomBoundary)
311  && (aStep.GetStepLength() > kCarTolerance) )
312  {
313  //AH G4cout << " inside non-parallel importance process " << G4endl;
314  if (aTrack.GetTrackStatus()==fStopAndKill)
315  {
316  G4cout << "WARNING - G4ImportanceProcess::PostStepDoIt()"
317  << " StopAndKill track. on boundary non-parallel" << G4endl;
318  }
319 
320  G4StepPoint *prepoint = aStep.GetPreStepPoint();
321  G4StepPoint *postpoint = aStep.GetPostStepPoint();
322 
323  G4GeometryCell prekey(*(prepoint->GetPhysicalVolume()),
324  prepoint->GetTouchable()->GetReplicaNumber());
325  G4GeometryCell postkey(*(postpoint->GetPhysicalVolume()),
326  postpoint->GetTouchable()->GetReplicaNumber());
327 
328  G4Nsplit_Weight nw = fImportanceAlgorithm.
329  Calculate(fIStore.GetImportance(prekey),
330  fIStore.GetImportance(postkey),
331  aTrack.GetWeight());
332  //AH
333  /*
334  G4cout << " prekey weight: " << fIStore.GetImportance(prekey)
335  << " postkey weight: " << fIStore.GetImportance(postkey)
336  << " split weight: " << nw << G4endl;
337  G4cout << " before poststepaction 2 " << G4endl;
338  */
339  //AH
340  fPostStepAction->DoIt(aTrack, fParticleChange, nw);
341  //AH G4cout << " after poststepaction 2 " << G4endl;
342  }
343  }
344  return fParticleChange;
345 }
G4double GetStepLength() const
G4StepStatus GetStepStatus() const
G4TrackStatus GetTrackStatus() const
G4TouchableHandle CreateTouchableHandle(G4int navId) const
const G4VTouchable * GetTouchable() const
G4StepPoint * GetPreStepPoint() const
G4GLOB_DLL std::ostream G4cout
G4VPhysicalVolume * GetPhysicalVolume() const
virtual G4double GetImportance(const G4GeometryCell &gCell) const =0
virtual void Initialize(const G4Track &)
void DoIt(const G4Track &aTrack, G4ParticleChange *aParticleChange, const G4Nsplit_Weight &nw)
G4StepPoint * GetPostStepPoint() const
virtual G4int GetReplicaNumber(G4int depth=0) const
Definition: G4VTouchable.cc:58
G4double GetWeight() const
#define G4endl
Definition: G4ios.hh:61
void SetTouchableHandle(const G4TouchableHandle &apValue)
const G4TouchableHandle & GetTouchableHandle() const
G4double G4ImportanceProcess::PostStepGetPhysicalInteractionLength ( const G4Track aTrack,
G4double  previousStepSize,
G4ForceCondition condition 
)
virtual

Implements G4VProcess.

Definition at line 199 of file G4ImportanceProcess.cc.

References DBL_MAX, and Forced.

202 {
203 // *condition = Forced;
204 // return kInfinity;
205 
206 // *condition = StronglyForced;
207  *condition = Forced;
208  return DBL_MAX;
209 }
G4double condition(const G4ErrorSymMatrix &m)
#define DBL_MAX
Definition: templates.hh:83
void G4ImportanceProcess::SetParallelWorld ( G4String  parallelWorldName)

Definition at line 123 of file G4ImportanceProcess.cc.

References G4cout, G4endl, G4TransportationManager::GetNavigator(), and G4TransportationManager::GetParallelWorld().

Referenced by G4ImportanceConfigurator::Configure().

124 {
125  G4cout << G4endl << G4endl << G4endl;
126  G4cout << "G4ImportanceProcess:: SetParallelWorld name = " << parallelWorldName << G4endl;
127 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
128 // Get pointers of the parallel world and its navigator
129 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
130  fGhostWorldName = parallelWorldName;
131  fGhostWorld = fTransportationManager->GetParallelWorld(fGhostWorldName);
132  fGhostNavigator = fTransportationManager->GetNavigator(fGhostWorld);
133 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
134 }
G4GLOB_DLL std::ostream G4cout
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
G4Navigator * GetNavigator(const G4String &worldName)
#define G4endl
Definition: G4ios.hh:61
void G4ImportanceProcess::StartTracking ( G4Track trk)
virtual

Reimplemented from G4VProcess.

Definition at line 157 of file G4ImportanceProcess.cc.

References G4TransportationManager::ActivateNavigator(), G4PathFinder::CreateTouchableHandle(), FatalException, G4Exception(), G4Track::GetMomentumDirection(), G4Track::GetPosition(), G4PathFinder::PrepareNewTrack(), and G4StepPoint::SetTouchableHandle().

158 {
159 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
160 // Activate navigator and get the navigator ID
161 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
162 // G4cout << " G4ParallelWorldScoringProcess::StartTracking" << G4endl;
163 
164  if(paraflag) {
165  if(fGhostNavigator)
166  { fNavigatorID = fTransportationManager->ActivateNavigator(fGhostNavigator); }
167  else
168  {
169  G4Exception("G4ImportanceProcess::StartTracking",
170  "ProcParaWorld000",FatalException,
171  "G4ImportanceProcess is used for tracking without having a parallel world assigned");
172  }
173 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
174 
175 // G4cout << "G4ParallelWorldScoringProcess::StartTracking <<<<<<<<<<<<<<<<<< " << G4endl;
176 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
177 // Let PathFinder initialize
178 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
179  fPathFinder->PrepareNewTrack(trk->GetPosition(),trk->GetMomentumDirection());
180 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
181 
182 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
183 // Setup initial touchables for the first step
184 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
185  fOldGhostTouchable = fPathFinder->CreateTouchableHandle(fNavigatorID);
186  fGhostPreStepPoint->SetTouchableHandle(fOldGhostTouchable);
187  fNewGhostTouchable = fOldGhostTouchable;
188  fGhostPostStepPoint->SetTouchableHandle(fNewGhostTouchable);
189 
190  // Initialize
191  fGhostSafety = -1.;
192  fOnBoundary = false;
193  }
194 
195 }
void PrepareNewTrack(const G4ThreeVector &position, const G4ThreeVector &direction, G4VPhysicalVolume *massStartVol=0)
const G4ThreeVector & GetPosition() const
G4TouchableHandle CreateTouchableHandle(G4int navId) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4int ActivateNavigator(G4Navigator *aNavigator)
const G4ThreeVector & GetMomentumDirection() const
void SetTouchableHandle(const G4TouchableHandle &apValue)

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