Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4TransportationWithMsc 26 // G4TransportationWithMsc 27 // 27 // 28 // Class Description: 28 // Class Description: 29 // 29 // 30 // It is a generic process of transportation w 30 // It is a generic process of transportation with multiple scattering included 31 // in the step limitation and propagation. 31 // in the step limitation and propagation. 32 // 32 // 33 // Original author: Jonas Hahnfeld, 2022 33 // Original author: Jonas Hahnfeld, 2022 34 34 35 #ifndef G4TrasportationWithMsc_h 35 #ifndef G4TrasportationWithMsc_h 36 #define G4TrasportationWithMsc_h 1 36 #define G4TrasportationWithMsc_h 1 37 37 38 #include "G4Transportation.hh" 38 #include "G4Transportation.hh" 39 39 40 #include <vector> 40 #include <vector> 41 41 42 class G4DataVector; << 43 class G4EmDataHandler; << 44 class G4EmModelManager; 42 class G4EmModelManager; 45 class G4LossTableManager; 43 class G4LossTableManager; 46 class G4ParticleChangeForGamma; << 47 class G4ParticleChangeForMSC; 44 class G4ParticleChangeForMSC; 48 class G4ParticleDefinition; 45 class G4ParticleDefinition; 49 class G4PhysicsTable; << 50 class G4Region; 46 class G4Region; 51 class G4VEmModel; << 52 class G4VEnergyLossProcess; << 53 class G4VMscModel; 47 class G4VMscModel; 54 48 55 //....oooOO0OOooo........oooOO0OOooo........oo 49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 56 50 57 class G4TransportationWithMsc : public G4Trans 51 class G4TransportationWithMsc : public G4Transportation 58 { 52 { 59 public: << 53 public: 60 enum class ScatteringType << 54 enum class ScatteringType 61 { << 55 { 62 MultipleScattering, << 56 MultipleScattering, 63 SingleScattering, << 57 }; 64 }; << 65 58 66 explicit G4TransportationWithMsc(Scatterin << 59 explicit G4TransportationWithMsc(ScatteringType type, G4int verbosity = 0); 67 60 68 ~G4TransportationWithMsc() override; << 61 ~G4TransportationWithMsc() override; 69 62 70 inline void SetMultipleSteps(G4bool val); << 63 inline void SetMultipleSteps(G4bool val); 71 inline G4bool MultipleSteps() const; << 64 inline G4bool MultipleSteps() const; 72 65 73 void AddMscModel(G4VMscModel* mscModel, G4 << 66 void AddMscModel(G4VMscModel* mscModel, G4int order = 0, >> 67 const G4Region* region = nullptr); 74 68 75 void AddSSModel(G4VEmModel* model, G4int o << 69 public: >> 70 void PreparePhysicsTable(const G4ParticleDefinition& part) override; >> 71 void BuildPhysicsTable(const G4ParticleDefinition& part) override; 76 72 77 public: << 73 void StartTracking(G4Track* track) override; 78 void PreparePhysicsTable(const G4ParticleD << 79 void BuildPhysicsTable(const G4ParticleDef << 80 74 81 void StartTracking(G4Track* track) overrid << 75 G4double AlongStepGetPhysicalInteractionLength( >> 76 const G4Track& track, G4double previousStepSize, >> 77 G4double currentMinimumStep, G4double& proposedSafety, >> 78 G4GPILSelection* selection) override; 82 79 83 G4double AlongStepGetPhysicalInteractionLe << 80 private: 84 << 81 const ScatteringType fType; 85 << 82 G4bool fMultipleSteps = false; 86 << 87 83 88 private: << 84 G4LossTableManager* fEmManager; 89 const ScatteringType fType; << 85 G4EmModelManager* fModelManager; 90 G4bool fMultipleSteps = false; << 86 const G4ParticleDefinition* fFirstParticle = nullptr; 91 87 92 G4LossTableManager* fEmManager; << 88 // For ScatteringType::MultipleScattering 93 G4EmModelManager* fModelManager; << 89 G4ParticleChangeForMSC* fParticleChangeForMSC = nullptr; 94 90 95 // Not initialized in the constructor, but << 91 G4DynamicParticle* fSubStepDynamicParticle; 96 const G4DataVector* fCuts = nullptr; << 92 G4Track* fSubStepTrack; 97 const G4ParticleDefinition* fFirstParticle << 93 G4Step* fSubStep; 98 G4VEnergyLossProcess* fIonisation = nullpt << 99 << 100 // For ScatteringType::MultipleScattering << 101 G4ParticleChangeForMSC* fParticleChangeFor << 102 << 103 // For ScatteringType::SingleScattering << 104 G4EmDataHandler* fEmData = nullptr; << 105 G4PhysicsTable* fLambdaTable = nullptr; << 106 G4ParticleChangeForGamma* fParticleChangeF << 107 std::vector<G4DynamicParticle*>* fSecondar << 108 << 109 G4DynamicParticle* fSubStepDynamicParticle << 110 G4Track* fSubStepTrack; << 111 G4Step* fSubStep; << 112 }; 94 }; 113 95 114 //....oooOO0OOooo........oooOO0OOooo........oo 96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 115 97 116 inline void G4TransportationWithMsc::SetMultip 98 inline void G4TransportationWithMsc::SetMultipleSteps(G4bool val) 117 { 99 { 118 fMultipleSteps = val; 100 fMultipleSteps = val; 119 } 101 } 120 102 121 //....oooOO0OOooo........oooOO0OOooo........oo 103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 122 104 123 inline G4bool G4TransportationWithMsc::Multipl 105 inline G4bool G4TransportationWithMsc::MultipleSteps() const 124 { 106 { 125 return fMultipleSteps; 107 return fMultipleSteps; 126 } 108 } 127 109 128 //....oooOO0OOooo........oooOO0OOooo........oo 110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 129 111 130 #endif 112 #endif 131 113