57 #include "DetectorConstruction.hh"
70 fParticleIsLooping( false ),
73 fThreshold_Warning_Energy( 100 *
MeV ),
74 fThreshold_Important_Energy( 250 *
MeV ),
75 fThresholdTrials( 10 ),
78 fSumEnergyKilled( 0.0 ), fMaxEnergyKilled( 0.0 ),
79 fShortStepOptimisation(false),
88 #ifdef G4MULTITHREADED
130 G4cout <<
" G4MonopoleTransportation: Statistics for looping particles "
154 G4double geometryStepLength, newSafety ;
184 currentSafety = 0.0 ;
206 G4bool fieldExertsForce = false ;
208 if( (particleMagneticCharge != 0.0) )
228 if( !fieldExertsForce )
235 geometryStepLength = currentMinimumStep ;
248 fPreviousSftOrigin = startPosition ;
254 currentSafety = newSafety ;
260 geometryStepLength = linearStepLength ;
265 geometryStepLength = currentMinimumStep ;
294 particleMagneticCharge );
315 if( currentMinimumStep > 0 )
325 geometryStepLength = lengthAlongCurve ;
327 geometryStepLength = currentMinimumStep ;
332 geometryStepLength = lengthAlongCurve= 0.0 ;
338 fPreviousSftOrigin = startPosition ;
364 if( currentMinimumStep == 0.0 )
377 if( particleMagneticCharge != 0.0 ) {
381 currentSafety = endSafety ;
391 #ifdef G4DEBUG_TRANSPORT
393 G4cout <<
"***G4MonopoleTransportation::AlongStepGPIL ** " <<
G4endl ;
395 <<
" and it returned safety= " << endSafety <<
G4endl ;
397 <<
" to obtain pseudo-safety= " << currentSafety <<
G4endl ;
407 return geometryStepLength ;
418 static G4int noCalls=0;
457 deltaTime = stepLength/finalVelocity ;
459 else if (finalVelocity > 0.0)
463 meanInverseVelocity = 0.5
464 * ( 1.0 / initialVelocity + 1.0 / finalVelocity ) ;
465 deltaTime = stepLength * meanInverseVelocity ;
467 else if( initialVelocity > 0.0 )
469 deltaTime = stepLength/initialVelocity ;
509 G4cout <<
" G4MonopoleTransportation is killing track that is looping or stuck "
512 <<
" MeV energy." <<
G4endl;
514 <<
" No of calls to AlongStepDoIt = " << noCalls
524 G4cout <<
" G4MonopoleTransportation::AlongStepDoIt(): Particle looping - "
526 <<
" No of calls to = " << noCalls
585 LocateGlobalPointAndUpdateTouchableHandle( track.
GetPosition(),
638 if( pNewVol!=0 && pNewMaterialCutsCouple!=0 &&
639 pNewMaterialCutsCouple->
GetMaterial()!=pNewMaterial )
643 pNewMaterialCutsCouple =
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4VIntegrationDriver * GetIntegrationDriver()
G4double fThreshold_Warning_Energy
static G4RunManager * GetRunManager()
G4double GetKineticEnergy() const
virtual void ConfigureForTrack(const G4Track *)
G4ThreeVector fTransportEndSpin
virtual G4double ComputeStep(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double &pNewSafety)
G4ThreeVector fTransportEndMomentumDir
~G4MonopoleTransportation()
CLHEP::Hep3Vector G4ThreeVector
G4SafetyHelper * GetSafetyHelper() const
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
void ProposeGlobalTime(G4double t)
G4LogicalVolume * GetLogicalVolume() const
static G4ParticleTable * GetParticleTable()
static constexpr double MeV
G4VSensitiveDetector * GetSensitiveDetector() const
void SetCurrentSafety(G4double val, const G4ThreeVector &pos)
static G4FieldManagerStore * GetInstance()
G4double fSumEnergyKilled
G4StepPoint * GetPreStepPoint() const
G4double fTransportEndKineticEnergy
virtual void LocateGlobalPointWithinVolume(const G4ThreeVector &position)
G4MonopoleTransportation(const G4Monopole *p, G4int verbosityLevel=1)
G4double GetStepLength() const
const G4ThreeVector & GetMomentumDirection() const
G4ThreeVector fPreviousSftOrigin
void SetSensitiveDetectorInTouchable(G4VSensitiveDetector *fSensitiveDetector)
virtual G4EquationOfMotion * GetEquationOfMotion()=0
G4double fMaxEnergyKilled
const G4TouchableHandle & GetTouchableHandle() const
const G4ThreeVector & GetPolarization() const
G4bool fEndGlobalTimeComputed
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4Navigator * GetNavigatorForTracking() const
void SetPointerToVectorOfAuxiliaryPoints(std::vector< G4ThreeVector > *theNewVectorPointer)
G4PropagatorInField * fFieldPropagator
Definition of the G4Monopole class.
G4double ComputeStep(G4FieldTrack &pFieldTrack, G4double pCurrentProposedStepLength, G4double &pNewSafety, G4VPhysicalVolume *pPhysVol=0)
virtual G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
G4double GetPDGMass() const
void SetStepperAndChordFinder(G4int val)
G4Material * GetMaterial() const
G4double GetVelocity() const
G4double GetProperTime() const
virtual void Initialize(const G4Track &)
G4MonopoleFieldSetup * fMagSetup
G4double endpointDistance
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
G4ThreeVector GetSpin() const
G4ThreeVector GetPosition() const
virtual void StartTracking(G4Track *)
G4double GetPDGSpin() const
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety, G4GPILSelection *selection)
G4double MagneticCharge() const
G4FieldManager * FindAndSetFieldManager(G4VPhysicalVolume *pCurrentPhysVol)
G4ParticleDefinition * GetDefinition() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
#define fPreviousSftOrigin
G4TouchableHandle fCurrentTouchableHandle
G4double GetKineticEnergy() const
void ClearAllChordFindersState()
Definition of the G4MonopoleTransportation class.
void ProposePosition(G4double x, G4double y, G4double z)
G4double GetGlobalTime() const
G4double GetCharge() const
const G4ThreeVector & GetPosition() const
const G4Field * GetDetectorField() const
void ProposeEnergy(G4double finalEnergy)
std::vector< G4ThreeVector > * GimmeTrajectoryVectorAndForgetIt() const
void ProposeTrueStepLength(G4double truePathLength)
G4double GetVelocity() const
G4bool DoesGlobalFieldExist()
static G4TransportationManager * GetTransportationManager()
virtual G4double ComputeSafety(const G4ThreeVector &globalpoint, const G4double pProposedMaxLength=DBL_MAX, const G4bool keepState=true)
static G4ProductionCutsTable * GetProductionCutsTable()
void ProposeProperTime(G4double finalProperTime)
virtual void StartTracking(G4Track *aTrack)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *pForceCond)
const G4Monopole * fParticleDef
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4ThreeVector & GetMomentumDir() const
void SetMaterialInTouchable(G4Material *fMaterial)
G4bool IsParticleLooping() const
void SetProcessSubType(G4int)
G4GLOB_DLL std::ostream G4cout
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
G4double fCandidateEndGlobalTime
G4ProductionCuts * GetProductionCuts() const
G4double fThreshold_Important_Energy
G4PropagatorInField * GetPropagatorInField() const
G4bool fParticleIsLooping
G4bool fGeometryLimitedStep
G4ChordFinder * GetChordFinder()
G4Navigator * fLinearNavigator
const G4Material * GetMaterial() const
G4ThreeVector fTransportEndPosition
G4double GetTotalMomentum() const
void SetTouchableHandle(const G4TouchableHandle &fTouchable)
void SetMaterialCutsCoupleInTouchable(const G4MaterialCutsCouple *fMaterialCutsCouple)
G4TrackStatus GetTrackStatus() const
const G4ThreeVector & GetMomentumDirection() const
G4ParticleChangeForTransport fParticleChange
void ProposeTrackStatus(G4TrackStatus status)
void ClearPropagatorState()
G4double GetLabTimeOfFlight() const
const G4DynamicParticle * GetDynamicParticle() const
G4MonopoleFieldSetup * GetMonopoleFieldSetup() const
virtual void SetChargeMomentumMass(G4ChargeState particleCharge, G4double MomentumXc, G4double MassXc2)=0
const G4VUserDetectorConstruction * GetUserDetectorConstruction() const
void SetMomentumChanged(G4bool b)
Simple detector construction with a box volume placed in a world.
G4SafetyHelper * fpSafetyHelper
void SetGeometricallyLimitedStep()
G4bool fShortStepOptimisation
G4VPhysicalVolume * GetVolume() const
G4double GetTotalEnergy() const