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 // << 27 #include "G4DNATransformElectronModel.hh" 26 #include "G4DNATransformElectronModel.hh" 28 #include "G4SystemOfUnits.hh" << 29 #include "G4ParticleChangeForGamma.hh" 27 #include "G4ParticleChangeForGamma.hh" >> 28 #include "G4Electron.hh" 30 #include "G4NistManager.hh" 29 #include "G4NistManager.hh" 31 #include "G4DNAChemistryManager.hh" 30 #include "G4DNAChemistryManager.hh" 32 #include "G4DNAMolecularMaterial.hh" << 33 31 34 //#define MODEL_VERBOSE << 32 G4DNATransformElectronModel::G4DNATransformElectronModel(const G4ParticleDefinition*, 35 << 33 const G4String& nam): 36 G4DNATransformElectronModel:: << 34 G4VEmModel(nam),fIsInitialised(false) 37 G4DNATransformElectronModel(const G4ParticleDe << 38 const G4String& na << 39 G4VEmModel(nam) << 40 { 35 { 41 fVerboseLevel = 0; << 36 fVerboseLevel = 0 ; 42 SetLowEnergyLimit(0. * eV); << 37 SetLowEnergyLimit(0.*eV); 43 SetHighEnergyLimit(0.025 * eV); << 38 SetHighEnergyLimit(0.025*eV); 44 fParticleChangeForGamma = nullptr; << 39 fParticleChangeForGamma = 0; 45 fpWaterDensity = nullptr; << 46 fpWaterDensity = nullptr; << 47 fEpsilon = 0.0001 * eV; << 48 } 40 } 49 41 50 //____________________________________________ 42 //______________________________________________________________________ 51 G4DNATransformElectronModel::~G4DNATransformEl 43 G4DNATransformElectronModel::~G4DNATransformElectronModel() 52 = default; << 44 {} 53 45 54 //____________________________________________ 46 //______________________________________________________________________ 55 void G4DNATransformElectronModel:: << 47 void G4DNATransformElectronModel::Initialise(const G4ParticleDefinition* particleDefinition, 56 Initialise(const G4ParticleDefinition* particl << 48 const G4DataVector&) 57 const G4DataVector&) << 58 { 49 { 59 #ifdef MODEL_VERBOSE << 50 #ifdef G4VERBOSE 60 if (fVerboseLevel) << 51 if (fVerboseLevel) 61 G4cout << "Calling G4DNATransformElectronM << 52 G4cout << "Calling G4DNATransformElectronModel::Initialise()" << G4endl; 62 #endif 53 #endif 63 << 54 64 if(particleDefinition->GetParticleName() != << 55 if (particleDefinition != G4Electron::ElectronDefinition()) 65 { << 56 { 66 G4ExceptionDescription errMsg; << 57 G4ExceptionDescription exceptionDescription ; 67 errMsg << "Attempting to calculate cross s << 58 exceptionDescription << "Attempting to calculate cross section for wrong particle"; 68 G4Exception("G4DNATransformElectronModel:: << 59 G4Exception("G4DNATransformElectronModel::CrossSectionPerVolume","G4DNATransformElectronModel001", 69 "G4DNATransformElectronModel00 << 60 FatalErrorInArgument,exceptionDescription); 70 return; << 61 return; 71 } << 62 } 72 << 63 73 // Initialize water density pointer << 64 if(!fIsInitialised) 74 fpWaterDensity = G4DNAMolecularMaterial::Ins << 65 { 75 GetNumMolPerVolTableFor(G4Material::GetM << 66 fIsInitialised = true; 76 << 67 fParticleChangeForGamma = GetParticleChangeForGamma(); 77 if(!fIsInitialised) << 68 fNistWater = G4NistManager::Instance()->FindOrBuildMaterial("G4_WATER"); 78 { << 69 } 79 fIsInitialised = true; << 80 fParticleChangeForGamma = GetParticleChang << 81 } << 82 } 70 } 83 71 84 //____________________________________________ 72 //______________________________________________________________________ 85 G4double << 73 G4double G4DNATransformElectronModel::CrossSectionPerVolume(const G4Material* material, 86 G4DNATransformElectronModel::CrossSectionPerVo << 74 const G4ParticleDefinition*, 87 << 75 G4double ekin, 88 << 76 G4double, 89 << 77 G4double) 90 << 91 { 78 { 92 #if MODEL_VERBOSE << 79 #if G4VERBOSE 93 if (fVerboseLevel > 1) << 80 if (fVerboseLevel > 1) 94 G4cout << "Calling CrossSectionPerVolume() << 81 G4cout << "Calling CrossSectionPerVolume() of G4DNATransformElectronModel" << G4endl; 95 #endif 82 #endif 96 << 97 if(ekin - fEpsilon > HighEnergyLimit()) << 98 { << 99 return 0.0; << 100 } << 101 << 102 G4double waterDensity = (*fpWaterDensity)[ma << 103 << 104 if(waterDensity != 0.0) << 105 { << 106 return DBL_MAX; << 107 } << 108 83 109 return 0.0; << 84 if(ekin > HighEnergyLimit()) >> 85 { >> 86 return 0.0; >> 87 } >> 88 >> 89 if (material == fNistWater || material->GetBaseMaterial() == fNistWater) >> 90 { >> 91 if (ekin <= HighEnergyLimit()) >> 92 { >> 93 return DBL_MAX; >> 94 } >> 95 } >> 96 >> 97 return 0.0 ; 110 } 98 } 111 99 112 //____________________________________________ 100 //______________________________________________________________________ 113 void << 101 void G4DNATransformElectronModel::SampleSecondaries(std::vector<G4DynamicParticle*>* /*fvect*/, 114 G4DNATransformElectronModel::SampleSecondaries << 102 const G4MaterialCutsCouple*, 115 c << 103 const G4DynamicParticle* particle, 116 c << 104 G4double, 117 G << 105 G4double) 118 G << 119 { 106 { 120 #if MODEL_VERBOSE << 107 #if G4VERBOSE 121 if (fVerboseLevel) << 108 if (fVerboseLevel) 122 G4cout << "Calling SampleSecondaries() of << 109 G4cout << "Calling SampleSecondaries() of G4DNATransformElectronModel" << G4endl; 123 #endif 110 #endif 124 111 125 G4double k = particle->GetKineticEnergy(); << 112 G4double k = particle->GetKineticEnergy(); 126 113 127 // if (k - fEpsilon <= HighEnergyLimit()) / << 114 if (k <= HighEnergyLimit()) 128 // { << 115 { 129 const G4Track * track = fParticleChangeForGa << 116 const G4Track * track = fParticleChangeForGamma->GetCurrentTrack(); 130 G4DNAChemistryManager::Instance()->CreateSol << 117 G4DNAChemistryManager::Instance()->CreateSolvatedElectron(track); 131 fParticleChangeForGamma->ProposeTrackStatus( << 118 fParticleChangeForGamma->ProposeTrackStatus(fStopAndKill); 132 fParticleChangeForGamma->ProposeLocalEnergyD << 119 fParticleChangeForGamma->ProposeLocalEnergyDeposit(k); 133 // } << 120 } 134 } 121 } 135 122