File indexing completed on 2026-07-13 08:21:05
0001 #ifndef G4HepEmTrackingManager_h
0002 #define G4HepEmTrackingManager_h 1
0003
0004 #include "G4EventManager.hh"
0005 #include "G4VTrackingManager.hh"
0006 #include "globals.hh"
0007
0008 class G4HepEmRunManager;
0009 class G4HepEmRandomEngine;
0010 class G4HepEmNoProcess;
0011 class G4HepEmTLData;
0012 class G4SafetyHelper;
0013 class G4Step;
0014 class G4VProcess;
0015 class G4VParticleChange;
0016 class G4Region;
0017 class G4HepEmWoodcockHelper;
0018 class G4HepEmConfig;
0019
0020 #include <vector>
0021
0022
0023
0024 class G4HepEmTrackingManager : public G4VTrackingManager {
0025 public:
0026 G4HepEmTrackingManager(G4int verbose=1);
0027 virtual ~G4HepEmTrackingManager();
0028
0029 void BuildPhysicsTable(const G4ParticleDefinition &) override;
0030
0031 void PreparePhysicsTable(const G4ParticleDefinition &) override;
0032
0033 void HandOverOneTrack(G4Track *aTrack) override;
0034
0035
0036 G4HepEmConfig* GetConfig() { return fConfig; }
0037
0038
0039 void SetVerbose(G4int verbose);
0040
0041
0042
0043 void RebindG4RandomEngine();
0044
0045
0046 G4bool IsWDTRegion(G4int regionId) const;
0047
0048
0049 G4double GetWDTKineticEnergyLimit() const;
0050
0051
0052
0053
0054 G4int GetWDTCoupleHepEmIndex(G4int regionId, G4int logicalVolumeId) const;
0055
0056
0057
0058
0059 std::vector<G4HepEmNoProcess *>& GetElectronNoProcessVector() {
0060 return fElectronNoProcessVector;
0061 }
0062
0063 std::vector<G4HepEmNoProcess *>& GetGammaNoProcessVector() {
0064 return fGammaNoProcessVector;
0065 }
0066
0067 G4HepEmNoProcess* GetTransportNoProcess() { return fTransportNoProcess; }
0068
0069
0070 G4VProcess* GetGammaNuclearProcess() { return fGNucProcess; }
0071
0072 G4VProcess* GetElectronNuclearProcess() { return fENucProcess; }
0073
0074 G4VProcess* GetPositronNuclearProcess() { return fPNucProcess; }
0075
0076
0077
0078
0079
0080
0081 double PerformNuclear(G4Track* aG4Track, G4Step* theG4Step, int particleID, bool isApplyCuts);
0082
0083
0084
0085
0086
0087 void SetXTRProcessName(const std::string& name) { fXTRProcessName = name; }
0088 void SetXTRRegionName(const std::string& name) { fXTRRegionName = name; }
0089
0090 protected:
0091 bool TrackElectron(G4Track *aTrack);
0092 bool TrackGamma(G4Track *aTrack);
0093
0094
0095
0096 G4VProcess* fFastSimProcess[3];
0097
0098 private:
0099
0100
0101 double StackSecondaries(G4HepEmTLData* aTLData, G4Track* aG4PrimaryTrack,
0102 const G4VProcess* aG4CreatorProcess, int aG4IMC,
0103 bool isApplyCuts);
0104
0105
0106
0107 double StackG4Secondaries(G4VParticleChange* particleChange,
0108 G4Track* aG4PrimaryTrack, G4Step* theStep,
0109 const G4VProcess* aG4CreatorProcess, int aG4IMC,
0110 bool isApplyCuts);
0111
0112 void InitNuclearProcesses(int particleID);
0113
0114
0115
0116 void InitFastSimRelated(int particleID);
0117
0118
0119
0120
0121
0122
0123
0124 void InitXTRRelated();
0125
0126
0127 void ReportExtraProcesses(int particleID);
0128
0129 #ifdef G4HepEm_EARLY_TRACKING_EXIT
0130
0131
0132
0133
0134
0135 virtual bool CheckEarlyTrackingExit(G4Track *track, G4EventManager *evtMgr,
0136 G4UserTrackingAction *userTrackingAction,
0137 G4TrackVector &secondaries) const {
0138 return false;
0139 }
0140 #endif
0141
0142 G4HepEmRunManager *fRunManager;
0143 G4HepEmRandomEngine *fRandomEngine;
0144 G4SafetyHelper *fSafetyHelper;
0145 G4Step *fStep;
0146
0147 const std::vector<G4double> *theCutsGamma = nullptr;
0148 const std::vector<G4double> *theCutsElectron = nullptr;
0149 const std::vector<G4double> *theCutsPositron = nullptr;
0150
0151
0152
0153
0154 std::vector<G4HepEmNoProcess *> fElectronNoProcessVector;
0155 std::vector<G4HepEmNoProcess *> fGammaNoProcessVector;
0156 G4HepEmNoProcess* fTransportNoProcess;
0157
0158
0159 G4VProcess* fGNucProcess;
0160
0161
0162 G4VProcess* fENucProcess;
0163 G4VProcess* fPNucProcess;
0164
0165
0166
0167
0168 G4VProcess* fXTRProcess;
0169 G4Region* fXTRRegion;
0170
0171 std::string fXTRProcessName = {"XTR"};
0172 std::string fXTRRegionName = {"TRT_RADIATOR"};
0173
0174
0175 G4HepEmWoodcockHelper* fWDTHelper;
0176
0177
0178 G4HepEmConfig* fConfig;
0179
0180
0181 G4int fVerbose;
0182 };
0183
0184
0185
0186 #endif