File indexing completed on 2024-05-10 02:21:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef SimG4Core_PhysicsLists_MonopoleTransportation_h
0026 #define SimG4Core_PhysicsLists_MonopoleTransportation_h 1
0027
0028 #include "G4VProcess.hh"
0029 #include "G4FieldManager.hh"
0030
0031 #include "G4Navigator.hh"
0032 #include "G4TransportationManager.hh"
0033 #include "G4PropagatorInField.hh"
0034 #include "G4Track.hh"
0035 #include "G4Step.hh"
0036 #include "G4ParticleChangeForTransport.hh"
0037 #include <CLHEP/Units/SystemOfUnits.h>
0038
0039 #include <memory>
0040
0041 class G4SafetyHelper;
0042 class Monopole;
0043 class CMSFieldManager;
0044
0045 class MonopoleTransportation : public G4VProcess {
0046 public:
0047 MonopoleTransportation(const Monopole* p, G4int verbosityLevel = 1);
0048 ~MonopoleTransportation() override;
0049
0050 G4double AlongStepGetPhysicalInteractionLength(const G4Track& track,
0051 G4double previousStepSize,
0052 G4double currentMinimumStep,
0053 G4double& currentSafety,
0054 G4GPILSelection* selection) override;
0055
0056 G4VParticleChange* AlongStepDoIt(const G4Track& track, const G4Step& stepData) override;
0057
0058 G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& stepData) override;
0059
0060
0061 G4double PostStepGetPhysicalInteractionLength(const G4Track&,
0062 G4double previousStepSize,
0063 G4ForceCondition* pForceCond) override;
0064
0065
0066
0067 G4PropagatorInField* GetPropagatorInField();
0068 void SetPropagatorInField(G4PropagatorInField* pFieldPropagator);
0069
0070
0071 inline G4double GetThresholdWarningEnergy() const;
0072 inline G4double GetThresholdImportantEnergy() const;
0073 inline G4int GetThresholdTrials() const;
0074
0075 inline void SetThresholdWarningEnergy(G4double newEnWarn);
0076 inline void SetThresholdImportantEnergy(G4double newEnImp);
0077 inline void SetThresholdTrials(G4int newMaxTrials);
0078
0079
0080
0081
0082
0083
0084 inline G4double GetMaxEnergyKilled() const;
0085 inline G4double GetSumEnergyKilled() const;
0086 void ResetKilledStatistics(G4int report = 1);
0087
0088
0089 inline void EnableShortStepOptimisation(G4bool optimise = true);
0090
0091
0092 G4double AtRestGetPhysicalInteractionLength(const G4Track&, G4ForceCondition*) override;
0093
0094 G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) override;
0095
0096
0097 void StartTracking(G4Track* aTrack) override;
0098
0099
0100 protected:
0101 G4bool DoesGlobalFieldExist();
0102
0103
0104 private:
0105 const Monopole* fParticleDef;
0106
0107 CMSFieldManager* fieldMgrCMS;
0108
0109 G4Navigator* fLinearNavigator;
0110 G4PropagatorInField* fFieldPropagator;
0111
0112
0113 G4ThreeVector fTransportEndPosition;
0114 G4ThreeVector fTransportEndMomentumDir;
0115 G4double fTransportEndKineticEnergy;
0116 G4ThreeVector fTransportEndSpin;
0117 G4bool fMomentumChanged;
0118
0119 G4bool fEndGlobalTimeComputed;
0120 G4double fCandidateEndGlobalTime;
0121
0122
0123 G4bool fParticleIsLooping;
0124
0125 G4TouchableHandle fCurrentTouchableHandle;
0126
0127 G4bool fGeometryLimitedStep;
0128
0129
0130 G4ThreeVector fPreviousSftOrigin;
0131 G4double fPreviousSafety;
0132
0133
0134 G4ParticleChangeForTransport fParticleChange;
0135
0136
0137 G4double endpointDistance;
0138
0139
0140
0141 G4double fThreshold_Warning_Energy;
0142 G4double fThreshold_Important_Energy;
0143 G4int fThresholdTrials;
0144
0145
0146
0147
0148
0149 G4int fNoLooperTrials;
0150
0151 G4double fSumEnergyKilled;
0152 G4double fMaxEnergyKilled;
0153
0154
0155
0156 G4bool fShortStepOptimisation;
0157
0158 G4SafetyHelper* fpSafetyHelper;
0159 };
0160
0161 inline void MonopoleTransportation::SetPropagatorInField(G4PropagatorInField* pFieldPropagator) {
0162 fFieldPropagator = pFieldPropagator;
0163 }
0164
0165 inline G4PropagatorInField* MonopoleTransportation::GetPropagatorInField() { return fFieldPropagator; }
0166
0167 inline G4bool MonopoleTransportation::DoesGlobalFieldExist() {
0168 G4TransportationManager* transportMgr = G4TransportationManager::GetTransportationManager();
0169 return transportMgr->GetFieldManager()->DoesFieldExist();
0170 }
0171
0172 inline G4double MonopoleTransportation::GetThresholdWarningEnergy() const { return fThreshold_Warning_Energy; }
0173
0174 inline G4double MonopoleTransportation::GetThresholdImportantEnergy() const { return fThreshold_Important_Energy; }
0175
0176 inline G4int MonopoleTransportation::GetThresholdTrials() const { return fThresholdTrials; }
0177
0178 inline void MonopoleTransportation::SetThresholdWarningEnergy(G4double newEnWarn) {
0179 fThreshold_Warning_Energy = newEnWarn;
0180 }
0181
0182 inline void MonopoleTransportation::SetThresholdImportantEnergy(G4double newEnImp) {
0183 fThreshold_Important_Energy = newEnImp;
0184 }
0185
0186 inline void MonopoleTransportation::SetThresholdTrials(G4int newMaxTrials) { fThresholdTrials = newMaxTrials; }
0187
0188
0189
0190
0191
0192
0193 inline G4double MonopoleTransportation::GetMaxEnergyKilled() const { return fMaxEnergyKilled; }
0194
0195 inline G4double MonopoleTransportation::GetSumEnergyKilled() const { return fSumEnergyKilled; }
0196
0197 inline void MonopoleTransportation::EnableShortStepOptimisation(G4bool optimiseShortStep) {
0198 fShortStepOptimisation = optimiseShortStep;
0199 }
0200
0201 #endif