Belle II Software  release-05-01-25
G4MonopoleTransportation.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Dmitrii Neverov *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 // modified from GEANT4 exoticphysics/monopole/*
12 
13 #include <simulation/monopoles/G4MonopoleTransportation.h>
14 #include <simulation/monopoles/G4Monopole.h>
15 
16 #include <G4ProductionCutsTable.hh>
17 #include <G4ParticleTable.hh>
18 #include <G4ChordFinder.hh>
19 #include <G4SafetyHelper.hh>
20 #include <G4FieldManagerStore.hh>
21 #include <G4TransportationProcessType.hh>
22 #include <CLHEP/Units/SystemOfUnits.h>
23 #include <framework/logging/Logger.h>
24 
25 class G4VSensitiveDetector;
26 
27 using namespace std;
28 using namespace Belle2;
29 using namespace Belle2::Monopoles;
30 using namespace CLHEP;
31 
32 G4MonopoleTransportation::G4MonopoleTransportation(const G4Monopole* mpl,
33  G4int verb)
34  : G4VProcess(G4String("MonopoleTransportation"), fTransportation),
35  fParticleDef(mpl),
36  fMagSetup(0),
37  fLinearNavigator(0),
38  fFieldPropagator(0),
39  fParticleIsLooping(false),
40  fPreviousSftOrigin(0., 0., 0.),
41  fPreviousSafety(0.0),
42  fThreshold_Trap_Energy(10 * MeV),
43  fThreshold_Warning_Energy(100 * MeV),
44  fThreshold_Important_Energy(250 * MeV),
45  fThresholdTrials(10),
46  fNoLooperTrials(0),
47  fSumEnergyKilled(0.0), fMaxEnergyKilled(0.0),
48  fShortStepOptimisation(false), // Old default: true (=fast short steps)
49  fpSafetyHelper(0)
50 {
51  verboseLevel = verb;
52 
53  // set Process Sub Type
54  SetProcessSubType(TRANSPORTATION);
55 
57 
58  G4TransportationManager* transportMgr ;
59 
60  transportMgr = G4TransportationManager::GetTransportationManager() ;
61 
62  fLinearNavigator = transportMgr->GetNavigatorForTracking() ;
63 
64  // fGlobalFieldMgr = transportMgr->GetFieldManager() ;
65 
66  fFieldPropagator = transportMgr->GetPropagatorInField() ;
67 
68  fpSafetyHelper = transportMgr->GetSafetyHelper(); // New
69 
70  // Cannot determine whether a field exists here,
71  // because it would only work if the field manager has informed
72  // about the detector's field before this transportation process
73  // is constructed.
74  // Instead later the method DoesGlobalFieldExist() is called
75 
76  static G4TouchableHandle nullTouchableHandle; // Points to (G4VTouchable*) 0
77  fCurrentTouchableHandle = nullTouchableHandle;
78 
79  fEndGlobalTimeComputed = false;
81 }
82 
84 {
85  if ((verboseLevel > 0) && (fSumEnergyKilled > 0.0)) {
86  B2DEBUG(25, " G4MonopoleTransportation: Statistics for looping particles ");
87  B2DEBUG(25, " Sum of energy of loopers killed: " << fSumEnergyKilled);
88  B2DEBUG(25, " Max energy of loopers killed: " << fMaxEnergyKilled);
89  }
90 }
91 
92 // Responsibilities:
93 // Find whether the geometry limits the Step, and to what length
94 // Calculate the new value of the safety and return it.
95 // Store the final time, position and momentum.
96 
99  G4double, // previousStepSize
100  G4double currentMinimumStep,
101  G4double& currentSafety,
102  G4GPILSelection* selection)
103 {
105  // change to monopole equation
106 
107  G4double geometryStepLength, newSafety ;
108  fParticleIsLooping = false ;
109 
110  // Initial actions moved to StartTrack()
111  // --------------------------------------
112  // Note: in case another process changes touchable handle
113  // it will be necessary to add here (for all steps)
114  // fCurrentTouchableHandle = aTrack->GetTouchableHandle();
115 
116  // GPILSelection is set to defaule value of CandidateForSelection
117  // It is a return value
118  //
119  *selection = CandidateForSelection ;
120 
121  // Get initial Energy/Momentum of the track
122  //
123  const G4DynamicParticle* pParticle = track.GetDynamicParticle() ;
124  G4ThreeVector startMomentumDir = pParticle->GetMomentumDirection() ;
125  G4ThreeVector startPosition = track.GetPosition() ;
126 
127  // G4double theTime = track.GetGlobalTime() ;
128 
129  // The Step Point safety can be limited by other geometries and/or the
130  // assumptions of any process - it's not always the geometrical safety.
131  // We calculate the starting point's isotropic safety here.
132  //
133  G4ThreeVector OriginShift = startPosition - fPreviousSftOrigin ;
134  G4double MagSqShift = OriginShift.mag2() ;
135  if (MagSqShift >= sqr(fPreviousSafety)) {
136  currentSafety = 0.0 ;
137  } else {
138  currentSafety = fPreviousSafety - std::sqrt(MagSqShift) ;
139  }
140 
141  // Is the monopole charged ?
142  //
143  G4double particleMagneticCharge = fParticleDef->MagneticCharge() ;
144  G4double particleElectricCharge = pParticle->GetCharge();
145 
146  fGeometryLimitedStep = false ;
147  // fEndGlobalTimeComputed = false ;
148 
149  // There is no need to locate the current volume. It is Done elsewhere:
150  // On track construction
151  // By the tracking, after all AlongStepDoIts, in "Relocation"
152 
153  // Check whether the particle have an (EM) field force exerting upon it
154  //
155  G4FieldManager* fieldMgr = nullptr;
156  G4bool fieldExertsForce = false ;
157 
158  if ((particleMagneticCharge != 0.0)) {
159  fieldMgr = fFieldPropagator->FindAndSetFieldManager(track.GetVolume());
160  if (fieldMgr != 0) {
161  // Message the field Manager, to configure it for this track
162  fieldMgr->ConfigureForTrack(&track);
163  // Moved here, in order to allow a transition
164  // from a zero-field status (with fieldMgr->(field)0
165  // to a finite field status
166 
167  // If the field manager has no field, there is no field !
168  fieldExertsForce = (fieldMgr->GetDetectorField() != 0);
169  }
170  }
171 
172  // Choose the calculation of the transportation: Field or not
173  //
174  if (!fieldExertsForce) {
175  G4double linearStepLength ;
176  if (fShortStepOptimisation && (currentMinimumStep <= currentSafety)) {
177  // The Step is guaranteed to be taken
178  //
179  geometryStepLength = currentMinimumStep ;
180  fGeometryLimitedStep = false ;
181  } else {
182  // Find whether the straight path intersects a volume
183  //
184  linearStepLength = fLinearNavigator->ComputeStep(startPosition,
185  startMomentumDir,
186  currentMinimumStep,
187  newSafety) ;
188  // Remember last safety origin & value.
189  //
190  fPreviousSftOrigin = startPosition ;
191  fPreviousSafety = newSafety ;
192  // fpSafetyHelper->SetCurrentSafety( newSafety, startPosition);
193 
194  // The safety at the initial point has been re-calculated:
195  //
196  currentSafety = newSafety ;
197 
198  fGeometryLimitedStep = (linearStepLength <= currentMinimumStep);
199  if (fGeometryLimitedStep) {
200  // The geometry limits the Step size (an intersection was found.)
201  geometryStepLength = linearStepLength ;
202  } else {
203  // The full Step is taken.
204  geometryStepLength = currentMinimumStep ;
205  }
206  }
207  endpointDistance = geometryStepLength ;
208 
209  // Calculate final position
210  //
211  fTransportEndPosition = startPosition + geometryStepLength * startMomentumDir ;
212 
213  // Momentum direction, energy and polarisation are unchanged by transport
214  //
215  fTransportEndMomentumDir = startMomentumDir ;
216  fTransportEndKineticEnergy = track.GetKineticEnergy() ;
217  fTransportEndSpin = track.GetPolarization();
218  fParticleIsLooping = false ;
219  fMomentumChanged = false ;
220  fEndGlobalTimeComputed = false ;
221  } else { // A field exerts force
222  G4double momentumMagnitude = pParticle->GetTotalMomentum() ;
223  G4ThreeVector EndUnitMomentum ;
224  G4double lengthAlongCurve ;
225  G4double restMass = fParticleDef->GetPDGMass() ;
226 
227  G4ChargeState chargeState(particleElectricCharge, // The charge can change (dynamic)
228  fParticleDef->GetPDGSpin(),
229  0, // Magnetic moment: pParticleDef->GetMagneticMoment(),
230  0, // Electric Dipole moment - not in Particle Definition
231  particleMagneticCharge); // in units of the positron charge
232 
233  G4EquationOfMotion* equationOfMotion =
234  (fFieldPropagator->GetChordFinder()->GetIntegrationDriver()->GetStepper())
235  ->GetEquationOfMotion();
236 
237  equationOfMotion
238  ->SetChargeMomentumMass(chargeState,
239  momentumMagnitude,
240  restMass) ;
241  // SetChargeMomentumMass now passes both the electric and magnetic charge - in chargeState
242 
243  G4ThreeVector spin = track.GetPolarization() ;
244  G4FieldTrack aFieldTrack = G4FieldTrack(startPosition,
245  track.GetMomentumDirection(),
246  0.0,
247  track.GetKineticEnergy(),
248  restMass,
249  track.GetVelocity(),
250  track.GetGlobalTime(), // Lab.
251  track.GetProperTime(), // Part.
252  &spin) ;
253  if (currentMinimumStep > 0) {
254  // Do the Transport in the field (non recti-linear)
255  //
256  lengthAlongCurve = fFieldPropagator->ComputeStep(aFieldTrack,
257  currentMinimumStep,
258  currentSafety,
259  track.GetVolume()) ;
260  fGeometryLimitedStep = lengthAlongCurve < currentMinimumStep;
261  if (fGeometryLimitedStep) {
262  geometryStepLength = lengthAlongCurve ;
263  } else {
264  geometryStepLength = currentMinimumStep ;
265  }
266  } else {
267  geometryStepLength = lengthAlongCurve = 0.0 ;
268  fGeometryLimitedStep = false ;
269  }
270 
271  // Remember last safety origin & value.
272  //
273  fPreviousSftOrigin = startPosition ;
274  fPreviousSafety = currentSafety ;
275  // fpSafetyHelper->SetCurrentSafety( newSafety, startPosition);
276 
277  // Get the End-Position and End-Momentum (Dir-ection)
278  //
279  fTransportEndPosition = aFieldTrack.GetPosition() ;
280 
281  // Momentum: Magnitude and direction can be changed too now ...
282  //
283  fMomentumChanged = true ;
284  fTransportEndMomentumDir = aFieldTrack.GetMomentumDir() ;
285 
286  fTransportEndKineticEnergy = aFieldTrack.GetKineticEnergy() ;
287 
288  fCandidateEndGlobalTime = aFieldTrack.GetLabTimeOfFlight();
289  fEndGlobalTimeComputed = true;
290 
291  fTransportEndSpin = aFieldTrack.GetSpin();
292  fParticleIsLooping = fFieldPropagator->IsParticleLooping() ;
293  endpointDistance = (fTransportEndPosition - startPosition).mag() ;
294  }
295 
296  // If we are asked to go a step length of 0, and we are on a boundary
297  // then a boundary will also limit the step -> we must flag this.
298  //
299  if (currentMinimumStep == 0.0) {
300  if (currentSafety == 0.0) fGeometryLimitedStep = true ;
301  }
302 
303  // Update the safety starting from the end-point,
304  // if it will become negative at the end-point.
305  //
306  if (currentSafety < endpointDistance) {
307  // if( particleMagneticCharge == 0.0 )
308  // G4cout << " Avoiding call to ComputeSafety : charge = 0.0 " << G4endl;
309 
310  if (particleMagneticCharge != 0.0) {
311 
312  G4double endSafety =
313  fLinearNavigator->ComputeSafety(fTransportEndPosition) ;
314  currentSafety = endSafety ;
316  fPreviousSafety = currentSafety ;
317  fpSafetyHelper->SetCurrentSafety(currentSafety, fTransportEndPosition);
318 
319  // Because the Stepping Manager assumes it is from the start point,
320  // add the StepLength
321  //
322  currentSafety += endpointDistance ;
323 
324 #ifdef G4DEBUG_TRANSPORT
325  G4cout.precision(12) ;
326  G4cout << "***G4MonopoleTransportation::AlongStepGPIL ** " << G4endl ;
327  G4cout << " Called Navigator->ComputeSafety at " << fTransportEndPosition
328  << " and it returned safety= " << endSafety << G4endl ;
329  G4cout << " Adding endpoint distance " << endpointDistance
330  << " to obtain pseudo-safety= " << currentSafety << G4endl ;
331 #endif
332  }
333  }
334 
335  fParticleChange.ProposeTrueStepLength(geometryStepLength) ;
336 
338  // change back to usual equation
339 
340  return geometryStepLength ;
341 }
342 
343 //
344 // Initialize ParticleChange (by setting all its members equal
345 // to corresponding members in G4Track)
346 
347 G4VParticleChange* G4MonopoleTransportation::AlongStepDoIt(const G4Track& track,
348  const G4Step& stepData)
349 {
350  static G4int noCalls = 0;
351  static const G4ParticleDefinition* fOpticalPhoton =
352  G4ParticleTable::GetParticleTable()->FindParticle("opticalphoton");
353 
354  noCalls++;
355 
356  fParticleChange.Initialize(track) ;
357 
358  // Code for specific process
359  //
360  fParticleChange.ProposePosition(fTransportEndPosition) ;
361  fParticleChange.ProposeMomentumDirection(fTransportEndMomentumDir) ;
363  fParticleChange.SetMomentumChanged(fMomentumChanged) ;
364 
365  fParticleChange.ProposePolarization(fTransportEndSpin);
366 
367  G4double deltaTime = 0.0 ;
368 
369  // Calculate Lab Time of Flight (ONLY if field Equations used it!)
370  // G4double endTime = fCandidateEndGlobalTime;
371  // G4double delta_time = endTime - startTime;
372 
373  G4double startTime = track.GetGlobalTime() ;
374 
375  if (!fEndGlobalTimeComputed) {
376  // The time was not integrated .. make the best estimate possible
377  //
378  G4double finalVelocity = track.GetVelocity() ;
379  G4double initialVelocity = stepData.GetPreStepPoint()->GetVelocity() ;
380  G4double stepLength = track.GetStepLength() ;
381 
382  deltaTime = 0.0; // in case initialVelocity = 0
383  const G4DynamicParticle* fpDynamicParticle = track.GetDynamicParticle();
384  if (fpDynamicParticle->GetDefinition() == fOpticalPhoton) {
385  // A photon is in the medium of the final point
386  // during the step, so it has the final velocity.
387  deltaTime = stepLength / finalVelocity ;
388  } else if (finalVelocity > 0.0) {
389  G4double meanInverseVelocity ;
390  // deltaTime = stepLength/finalVelocity ;
391  meanInverseVelocity = 0.5
392  * (1.0 / initialVelocity + 1.0 / finalVelocity) ;
393  deltaTime = stepLength * meanInverseVelocity ;
394  } else if (initialVelocity > 0.0) {
395  deltaTime = stepLength / initialVelocity ;
396  }
397  fCandidateEndGlobalTime = startTime + deltaTime ;
398  } else {
399  deltaTime = fCandidateEndGlobalTime - startTime ;
400  }
401 
402  fParticleChange.ProposeGlobalTime(fCandidateEndGlobalTime) ;
403 
404  // Now Correct by Lorentz factor to get "proper" deltaTime
405 
406  G4double restMass = track.GetDynamicParticle()->GetMass() ;
407  G4double deltaProperTime = deltaTime * (restMass / track.GetTotalEnergy()) ;
408 
409  fParticleChange.ProposeProperTime(track.GetProperTime() + deltaProperTime) ;
410  //fParticleChange. ProposeTrueStepLength( track.GetStepLength() ) ;
411 
412  // If the particle is caught looping or is stuck (in very difficult
413  // boundaries) in a magnetic field (doing many steps)
414  // THEN this kills it ...
415  //
416  if (fParticleIsLooping) {
417  G4double endEnergy = fTransportEndKineticEnergy;
418 
419  if ((endEnergy < fThreshold_Important_Energy)
421  // Kill the looping particle
422  //
423  fParticleChange.ProposeTrackStatus(fStopAndKill) ;
424 
425  // 'Bare' statistics
426  fSumEnergyKilled += endEnergy;
427  if (endEnergy > fMaxEnergyKilled) { fMaxEnergyKilled = endEnergy; }
428 
429 #ifdef G4VERBOSE
430  if ((verboseLevel > 1) ||
431  (endEnergy > fThreshold_Warning_Energy)) {
432  B2DEBUG(25, " G4MonopoleTransportation is killing track that is looping or stuck ");
433  B2DEBUG(25, " This track has " << track.GetKineticEnergy() / MeV << " MeV energy.");
434  B2DEBUG(25, " Number of trials = " << fNoLooperTrials
435  << " No of calls to AlongStepDoIt = " << noCalls);
436  }
437 #endif
438  fNoLooperTrials = 0;
439  } else {
440  fNoLooperTrials ++;
441 #ifdef G4VERBOSE
442  if ((verboseLevel > 2)) {
443  B2DEBUG(25, " G4MonopoleTransportation::AlongStepDoIt(): Particle looping - "
444  << " Number of trials = " << fNoLooperTrials
445  << " No of calls to = " << noCalls);
446  }
447 #endif
448  }
449  } else {
450  fNoLooperTrials = 0;
451  }
452 
453  // Another (sometimes better way) is to use a user-limit maximum Step size
454  // to alleviate this problem ..
455 
456  // Introduce smooth curved trajectories to particle-change
457  //
458  fParticleChange.SetPointerToVectorOfAuxiliaryPoints
459  (fFieldPropagator->GimmeTrajectoryVectorAndForgetIt());
460 
461  //Monopole bounding
463  fParticleChange.ProposeTrackStatus(fStopAndKill);
464  B2DEBUG(150, "Monopole bound in " << fCurrentTouchableHandle->GetVolume()->GetName());
465  B2DEBUG(150, "with energy " << fTransportEndKineticEnergy << " MeV");
466  }
467 
468  return &fParticleChange ;
469 }
470 
471 // This ensures that the PostStep action is always called,
472 // so that it can do the relocation if it is needed.
473 //
474 
477  G4double, // previousStepSize
478  G4ForceCondition* pForceCond)
479 {
480  *pForceCond = Forced ;
481  return DBL_MAX ; // was kInfinity ; but convention now is DBL_MAX
482 }
483 
484 G4VParticleChange* G4MonopoleTransportation::PostStepDoIt(const G4Track& track,
485  const G4Step&)
486 {
487  G4TouchableHandle retCurrentTouchable ; // The one to return
488 
489  // Initialize ParticleChange (by setting all its members equal
490  // to corresponding members in G4Track)
491  // fParticleChange.Initialize(track) ; // To initialise TouchableChange
492 
493  fParticleChange.ProposeTrackStatus(track.GetTrackStatus()) ;
494 
495  // If the Step was determined by the volume boundary,
496  // logically relocate the particle
497 
498  if (fGeometryLimitedStep) {
499  // fCurrentTouchable will now become the previous touchable,
500  // and what was the previous will be freed.
501  // (Needed because the preStepPoint can point to the previous touchable)
502 
503  fLinearNavigator->SetGeometricallyLimitedStep() ;
505  LocateGlobalPointAndUpdateTouchableHandle(track.GetPosition(),
506  track.GetMomentumDirection(),
508  true) ;
509  // Check whether the particle is out of the world volume
510  // If so it has exited and must be killed.
511  //
512  if (fCurrentTouchableHandle->GetVolume() == 0) {
513  fParticleChange.ProposeTrackStatus(fStopAndKill) ;
514  }
515  retCurrentTouchable = fCurrentTouchableHandle ;
516  fParticleChange.SetTouchableHandle(fCurrentTouchableHandle) ;
517  } else { // fGeometryLimitedStep is false
518  // This serves only to move the Navigator's location
519  //
520  fLinearNavigator->LocateGlobalPointWithinVolume(track.GetPosition()) ;
521 
522  // The value of the track's current Touchable is retained.
523  // (and it must be correct because we must use it below to
524  // overwrite the (unset) one in particle change)
525  // It must be fCurrentTouchable too ??
526  //
527  fParticleChange.SetTouchableHandle(track.GetTouchableHandle()) ;
528  retCurrentTouchable = track.GetTouchableHandle() ;
529  } // endif ( fGeometryLimitedStep )
530 
531  const G4VPhysicalVolume* pNewVol = retCurrentTouchable->GetVolume() ;
532  G4Material* pNewMaterial = nullptr ;
533  G4VSensitiveDetector* pNewSensitiveDetector = nullptr ;
534 
535  if (pNewVol != 0) {
536  pNewMaterial = pNewVol->GetLogicalVolume()->GetMaterial();
537  pNewSensitiveDetector = pNewVol->GetLogicalVolume()->GetSensitiveDetector();
538  }
539 
540  fParticleChange.SetMaterialInTouchable(
541  pNewMaterial) ;
542  fParticleChange.SetSensitiveDetectorInTouchable(
543  pNewSensitiveDetector) ;
544 
545  const G4MaterialCutsCouple* pNewMaterialCutsCouple = 0;
546  if (pNewVol != 0) {
547  pNewMaterialCutsCouple = pNewVol->GetLogicalVolume()->GetMaterialCutsCouple();
548  }
549 
550  if (pNewVol != 0 && pNewMaterialCutsCouple != 0 &&
551  pNewMaterialCutsCouple->GetMaterial() != pNewMaterial) {
552  // for parametrized volume
553  //
554  pNewMaterialCutsCouple =
555  G4ProductionCutsTable::GetProductionCutsTable()
556  ->GetMaterialCutsCouple(pNewMaterial,
557  pNewMaterialCutsCouple->GetProductionCuts());
558  }
559  fParticleChange.SetMaterialCutsCoupleInTouchable(pNewMaterialCutsCouple);
560 
561  // temporarily until Get/Set Material of ParticleChange,
562  // and StepPoint can be made const.
563  // Set the touchable in ParticleChange
564  // this must always be done because the particle change always
565  // uses this value to overwrite the current touchable pointer.
566  //
567  fParticleChange.SetTouchableHandle(retCurrentTouchable) ;
568 
569  return &fParticleChange ;
570 }
571 
572 // New method takes over the responsibility to reset the state
573 // of G4MonopoleTransportation object at the start of a new track
574 // or the resumption of a suspended track.
575 
576 void
578 {
579  G4VProcess::StartTracking(aTrack);
580 
581 // The actions here are those that were taken in AlongStepGPIL
582 // when track.GetCurrentStepNumber()==1
583 
584  // reset safety value and center
585  //
586  fPreviousSafety = 0.0 ;
587  fPreviousSftOrigin = G4ThreeVector(0., 0., 0.) ;
588 
589  // reset looping counter -- for motion in field
590  fNoLooperTrials = 0;
591  // Must clear this state .. else it depends on last track's value
592  // --> a better solution would set this from state of suspended track TODO ?
593  // Was if( aTrack->GetCurrentStepNumber()==1 ) { .. }
594 
595  // ChordFinder reset internal state
596  //
597  if (DoesGlobalFieldExist()) {
598  fFieldPropagator->ClearPropagatorState();
599  // Resets all state of field propagator class (ONLY)
600  // including safety values (in case of overlaps and to wipe for first track).
601 
602  // G4ChordFinder* chordF= fFieldPropagator->GetChordFinder();
603  // if( chordF ) chordF->ResetStepEstimate();
604  }
605 
606  // Make sure to clear the chord finders of all fields (ie managers)
607  static G4FieldManagerStore* fieldMgrStore = G4FieldManagerStore::GetInstance();
608  fieldMgrStore->ClearAllChordFindersState();
609 
610  // Update the current touchable handle (from the track's)
611  //
612  fCurrentTouchableHandle = aTrack->GetTouchableHandle();
613 }
Belle2::Monopoles::G4MonopoleTransportation::fMomentumChanged
G4bool fMomentumChanged
The particle's state after this Step, Store for DoIt.
Definition: G4MonopoleTransportation.h:189
Belle2::Monopoles::G4MonopoleTransportation::fShortStepOptimisation
G4bool fShortStepOptimisation
Whether to avoid calling G4Navigator for short step ( < safety) If using it, the safety estimate for ...
Definition: G4MonopoleTransportation.h:226
Belle2::Monopoles::G4MonopoleTransportation::fThreshold_Trap_Energy
G4double fThreshold_Trap_Energy
Assume monopoles below this can bound to material.
Definition: G4MonopoleTransportation.h:207
Belle2::Monopoles::G4MonopoleTransportation::fFieldPropagator
G4PropagatorInField * fFieldPropagator
Propagator used to transport the particle.
Definition: G4MonopoleTransportation.h:183
Belle2::Monopoles::G4Monopole::MagneticCharge
G4double MagneticCharge() const
Returns magnetic charge of the monopole.
Definition: G4Monopole.cc:49
Belle2::Monopoles::G4MonopoleFieldSetup::GetMonopoleFieldSetup
static G4MonopoleFieldSetup * GetMonopoleFieldSetup()
Returns G4MonopoleFieldSetup instance.
Definition: G4MonopoleFieldSetup.cc:45
Belle2::Monopoles::G4MonopoleTransportation::fThresholdTrials
G4int fThresholdTrials
Nubmer of trials for looping particles.
Definition: G4MonopoleTransportation.h:212
Belle2::Monopoles::G4MonopoleTransportation::fNoLooperTrials
G4int fNoLooperTrials
Counter for steps in which particle reports 'looping', if it is above 'Important' Energy.
Definition: G4MonopoleTransportation.h:218
Belle2::Monopoles::G4MonopoleTransportation::PostStepDoIt
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
G4VProcess::PostStepDoIt() implementation.
Definition: G4MonopoleTransportation.cc:484
Belle2::Monopoles::G4MonopoleTransportation::fCurrentTouchableHandle
G4TouchableHandle fCurrentTouchableHandle
Current touchable handle.
Definition: G4MonopoleTransportation.h:196
Belle2::Monopoles::G4MonopoleTransportation::AlongStepDoIt
virtual G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
G4VProcess::AlongStepDoIt() implementation, Proposes changes during step to fParticleChange of this c...
Definition: G4MonopoleTransportation.cc:347
Belle2::Monopoles::G4MonopoleFieldSetup::SwitchChordFinder
void SwitchChordFinder(G4int val)
Switches chord finder between 1 - basf2 FullSim chord finder 2 - monopole chord finder Since monopole...
Definition: G4MonopoleFieldSetup.cc:62
Belle2::Monopoles::G4MonopoleTransportation::fTransportEndSpin
G4ThreeVector fTransportEndSpin
The particle's state after this Step, Store for DoIt.
Definition: G4MonopoleTransportation.h:188
Belle2::Monopoles::G4MonopoleTransportation::fCandidateEndGlobalTime
G4double fCandidateEndGlobalTime
The particle's state after this Step, Store for DoIt.
Definition: G4MonopoleTransportation.h:192
Belle2::Monopoles::G4MonopoleTransportation::~G4MonopoleTransportation
~G4MonopoleTransportation()
Destructor.
Definition: G4MonopoleTransportation.cc:83
Belle2::Monopoles::G4MonopoleTransportation::fPreviousSafety
G4double fPreviousSafety
Remember last safety value.
Definition: G4MonopoleTransportation.h:201
Belle2::Monopoles::G4MonopoleTransportation::fGeometryLimitedStep
G4bool fGeometryLimitedStep
Flag to determine whether a boundary was reached.
Definition: G4MonopoleTransportation.h:198
Belle2::Monopoles::G4MonopoleTransportation::fTransportEndMomentumDir
G4ThreeVector fTransportEndMomentumDir
The particle's state after this Step, Store for DoIt.
Definition: G4MonopoleTransportation.h:186
Belle2::Monopoles::G4MonopoleTransportation::fEndGlobalTimeComputed
G4bool fEndGlobalTimeComputed
The particle's state after this Step, Store for DoIt.
Definition: G4MonopoleTransportation.h:191
Belle2::Monopoles::G4MonopoleTransportation::fPreviousSftOrigin
G4ThreeVector fPreviousSftOrigin
Remember last safety origin.
Definition: G4MonopoleTransportation.h:200
Belle2::Monopoles::G4MonopoleTransportation::fTransportEndKineticEnergy
G4double fTransportEndKineticEnergy
The particle's state after this Step, Store for DoIt.
Definition: G4MonopoleTransportation.h:187
Belle2::Monopoles::G4MonopoleTransportation::AlongStepGetPhysicalInteractionLength
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
G4VProcess::AlongStepGetPhysicalInteractionLength() implementation.
Definition: G4MonopoleTransportation.cc:98
Belle2::Monopoles::G4MonopoleTransportation::StartTracking
virtual void StartTracking(G4Track *aTrack)
Reset state for new (potentially resumed) track.
Definition: G4MonopoleTransportation.cc:577
Belle2::Monopoles::G4MonopoleTransportation::fMagSetup
G4MonopoleFieldSetup * fMagSetup
Monpole field setup.
Definition: G4MonopoleTransportation.h:180
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Monopoles::G4MonopoleTransportation::PostStepGetPhysicalInteractionLength
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *pForceCond)
G4VProcess::PostStepGetPhysicalInteractionLength() implementation.
Definition: G4MonopoleTransportation.cc:476
Belle2::Monopoles::G4MonopoleTransportation::endpointDistance
G4double endpointDistance
Endpint distance.
Definition: G4MonopoleTransportation.h:205
Belle2::Monopoles::G4MonopoleTransportation::fParticleDef
const G4Monopole * fParticleDef
Monopole definition for charge and mass reference.
Definition: G4MonopoleTransportation.h:178
Belle2::Monopoles::G4MonopoleTransportation::fParticleChange
G4ParticleChangeForTransport fParticleChange
New ParticleChange.
Definition: G4MonopoleTransportation.h:203
Belle2::Monopoles::G4MonopoleTransportation::fTransportEndPosition
G4ThreeVector fTransportEndPosition
The particle's state after this Step, Store for DoIt.
Definition: G4MonopoleTransportation.h:185
Belle2::Monopoles::G4MonopoleTransportation::fSumEnergyKilled
G4double fSumEnergyKilled
Sum of abandoned looping tracks energies.
Definition: G4MonopoleTransportation.h:219
Belle2::Monopoles::G4MonopoleTransportation::fThreshold_Warning_Energy
G4double fThreshold_Warning_Energy
Warn above this energy about looping particle.
Definition: G4MonopoleTransportation.h:210
Belle2::Monopoles::G4MonopoleTransportation::fLinearNavigator
G4Navigator * fLinearNavigator
Propagator used to transport the particle.
Definition: G4MonopoleTransportation.h:182
Belle2::Monopoles::G4MonopoleTransportation::fThreshold_Important_Energy
G4double fThreshold_Important_Energy
Hesitate above this about looping particle for a certain no of trials.
Definition: G4MonopoleTransportation.h:211
Belle2::Monopoles::G4MonopoleTransportation::DoesGlobalFieldExist
G4bool DoesGlobalFieldExist()
Checks whether a field exists for the "global" field manager.
Definition: G4MonopoleTransportationInline.h:45
Belle2::Monopoles::G4MonopoleTransportation::fpSafetyHelper
G4SafetyHelper * fpSafetyHelper
To pass it the safety value obtained.
Definition: G4MonopoleTransportation.h:228
Belle2::Monopoles::G4MonopoleTransportation::fParticleIsLooping
G4bool fParticleIsLooping
Is the monopole stuck in looping.
Definition: G4MonopoleTransportation.h:194
Belle2::Monopoles::G4Monopole
A class to hold monopole description as a particle.
Definition: G4Monopole.h:43
Belle2::Monopoles::G4MonopoleTransportation::fMaxEnergyKilled
G4double fMaxEnergyKilled
Max of abandoned looping tracks energies.
Definition: G4MonopoleTransportation.h:220