Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // >> 23 // $Id: G4BraggModel.hh,v 1.1 2004/12/01 17:36:04 vnivanch Exp $ >> 24 // GEANT4 tag $Name: geant4-07-00-patch-01 $ 26 // 25 // 27 // ------------------------------------------- 26 // ------------------------------------------------------------------- 28 // 27 // 29 // GEANT4 Class header file 28 // GEANT4 Class header file 30 // 29 // 31 // 30 // 32 // File name: G4BraggModel 31 // File name: G4BraggModel 33 // 32 // 34 // Author: Vladimir Ivanchenko 33 // Author: Vladimir Ivanchenko 35 // 34 // 36 // Creation date: 03.01.2002 35 // Creation date: 03.01.2002 37 // 36 // 38 // Modifications: 37 // Modifications: 39 // 23-12-02 V.Ivanchenko change interface in o 38 // 23-12-02 V.Ivanchenko change interface in order to moveto cut per region 40 // 24-01-03 Make models region aware (V.Ivanch 39 // 24-01-03 Make models region aware (V.Ivanchenko) 41 // 13-02-03 Add name (V.Ivanchenko) 40 // 13-02-03 Add name (V.Ivanchenko) 42 // 12-11-03 Fix for GenericIons (V.Ivanchenko) 41 // 12-11-03 Fix for GenericIons (V.Ivanchenko) 43 // 11-04-05 Major optimisation of internal int << 42 // 44 // 15-02-06 ComputeCrossSectionPerElectron, Co << 45 // 25-04-06 Added stopping data from PSTAR (V. << 46 // 12-08-08 Added methods GetParticleCharge, G << 47 // CorrectionsAlongStep needed for io << 48 << 49 // 43 // 50 // Class Description: 44 // Class Description: 51 // 45 // 52 // Implementation of energy loss and delta-ele 46 // Implementation of energy loss and delta-electron production 53 // by heavy slow charged particles using ICRU' << 47 // by heavy slow charged particles using eveluated data 54 // for protons << 55 48 56 // ------------------------------------------- 49 // ------------------------------------------------------------------- 57 // 50 // 58 51 59 #ifndef G4BraggModel_h 52 #ifndef G4BraggModel_h 60 #define G4BraggModel_h 1 53 #define G4BraggModel_h 1 61 54 62 #include "G4VEmModel.hh" 55 #include "G4VEmModel.hh" 63 #include "G4PSTARStopping.hh" << 64 << 65 class G4ParticleChangeForLoss; << 66 class G4EmCorrections; << 67 class G4ICRU90StoppingData; << 68 class G4PSTARStopping; << 69 56 70 class G4BraggModel : public G4VEmModel 57 class G4BraggModel : public G4VEmModel 71 { 58 { 72 59 73 public: 60 public: 74 61 75 explicit G4BraggModel(const G4ParticleDefini << 62 G4BraggModel(const G4ParticleDefinition* p = 0, const G4String& nam = "Bragg"); 76 const G4String& nam = "Bragg"); << 63 >> 64 virtual ~G4BraggModel(); >> 65 >> 66 void Initialise(const G4ParticleDefinition*, const G4DataVector&); >> 67 >> 68 G4double HighEnergyLimit(const G4ParticleDefinition*); 77 69 78 ~G4BraggModel() override; << 70 G4double LowEnergyLimit(const G4ParticleDefinition*); 79 71 80 void Initialise(const G4ParticleDefinition*, << 72 void SetHighEnergyLimit(G4double e) {highKinEnergy = e;}; >> 73 >> 74 void SetLowEnergyLimit(G4double e) {lowKinEnergy = e;}; 81 75 82 G4double MinEnergyCut(const G4ParticleDefini 76 G4double MinEnergyCut(const G4ParticleDefinition*, 83 const G4MaterialCutsCouple* couple) over << 77 const G4MaterialCutsCouple*); 84 78 85 G4double ComputeCrossSectionPerElectron( << 79 G4bool IsInCharge(const G4ParticleDefinition*); 86 const G4ParticleDefinition*, << 87 G4double kineticEnergy, << 88 G4double cutEnergy, << 89 G4double maxEnergy); << 90 << 91 G4double ComputeCrossSectionPerAtom( << 92 const G4ParticleDefinition*, << 93 G4double kineticEnergy, << 94 G4double Z, G4double A, << 95 G4double cutEnergy, << 96 G4double maxEnergy) override; << 97 << 98 G4double CrossSectionPerVolume(const G4Mater << 99 const G4ParticleDefinition*, << 100 G4double kineticEnergy, << 101 G4double cutEnergy, << 102 G4double maxEnergy) override; << 103 << 104 G4double ComputeDEDXPerVolume(const G4Materi << 105 const G4ParticleDefinition*, << 106 G4double kineticEnergy, << 107 G4double cutEnergy) override; << 108 << 109 void SampleSecondaries(std::vector<G4Dynamic << 110 const G4MaterialCutsCouple*, << 111 const G4DynamicParticle*, << 112 G4double tmin, << 113 G4double maxEnergy) override; << 114 << 115 // Compute ion charge << 116 G4double GetChargeSquareRatio(const G4Partic << 117 const G4Material*, << 118 G4double kineticEnergy) override; << 119 << 120 G4double GetParticleCharge(const G4ParticleD << 121 const G4Material* mat, << 122 G4double kineticEnergy) override; << 123 80 124 // hide assignment operator << 81 G4double ComputeDEDX(const G4MaterialCutsCouple*, 125 G4BraggModel & operator=(const G4BraggModel << 82 const G4ParticleDefinition*, 126 G4BraggModel(const G4BraggModel&) = delete; << 83 G4double kineticEnergy, >> 84 G4double cutEnergy); >> 85 >> 86 G4double CrossSection(const G4MaterialCutsCouple*, >> 87 const G4ParticleDefinition*, >> 88 G4double kineticEnergy, >> 89 G4double cutEnergy, >> 90 G4double maxEnergy); >> 91 >> 92 G4DynamicParticle* SampleSecondary( >> 93 const G4MaterialCutsCouple*, >> 94 const G4DynamicParticle*, >> 95 G4double tmin, >> 96 G4double maxEnergy); >> 97 >> 98 std::vector<G4DynamicParticle*>* SampleSecondaries( >> 99 const G4MaterialCutsCouple*, >> 100 const G4DynamicParticle*, >> 101 G4double tmin, >> 102 G4double maxEnergy); 127 103 128 protected: << 104 G4double MaxSecondaryEnergy(const G4DynamicParticle*); 129 105 130 void SetParticle(const G4ParticleDefinition* << 106 protected: 131 107 132 G4double MaxSecondaryEnergy(const G4Particle 108 G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 133 G4double kinEnergy) final; << 109 G4double kinEnergy); 134 << 135 inline void SetChargeSquareRatio(G4double va << 136 110 137 private: 111 private: 138 112 139 void HasMaterial(const G4Material* material) << 113 void SetParticle(const G4ParticleDefinition* p); >> 114 >> 115 // hide assignment operator >> 116 G4BraggModel & operator=(const G4BraggModel &right); >> 117 G4BraggModel(const G4BraggModel&); >> 118 >> 119 G4bool HasMaterial(const G4Material* material); 140 120 141 G4double StoppingPower(const G4Material* mat 121 G4double StoppingPower(const G4Material* material, 142 G4double kineticEnergy); << 122 G4double kineticEnergy); 143 123 144 G4double ElectronicStoppingPower(G4double z, 124 G4double ElectronicStoppingPower(G4double z, 145 G4double ki 125 G4double kineticEnergy) const; >> 126 >> 127 void SetMoleculaNumber(G4int number) {iMolecula = number;}; 146 128 147 G4double DEDX(const G4Material* material, G4 129 G4double DEDX(const G4Material* material, G4double kineticEnergy); 148 130 149 G4bool MolecIsInZiegler1988(const G4Material 131 G4bool MolecIsInZiegler1988(const G4Material* material); 150 132 151 G4double ChemicalFactor(G4double kineticEner 133 G4double ChemicalFactor(G4double kineticEnergy, G4double eloss125) const; 152 134 153 protected: << 135 void SetExpStopPower125(G4double value) {expStopPower125 = value;}; 154 136 155 const G4ParticleDefinition* particle = nullp << 137 const G4ParticleDefinition* particle; 156 G4ParticleDefinition* theElectron = nullptr; << 138 G4double mass; 157 G4ParticleChangeForLoss* fParticleChange = n << 139 G4double spin; 158 << 140 G4double chargeSquare; 159 const G4Material* currentMaterial = nullptr; << 141 G4double massRate; 160 const G4Material* baseMaterial = nullptr; << 142 G4double ratio; 161 << 143 G4double highKinEnergy; 162 G4EmCorrections* corr = nullptr; << 144 G4double lowKinEnergy; 163 << 164 static G4ICRU90StoppingData* fICRU90; << 165 static G4PSTARStopping* fPSTAR; << 166 << 167 G4double mass = 0.0; << 168 G4double spin = 0.0; << 169 G4double chargeSquare = 1.0; << 170 G4double massRate = 1.0; << 171 G4double ratio = 1.0; << 172 G4double protonMassAMU = 1.007276; << 173 G4double lowestKinEnergy; 145 G4double lowestKinEnergy; >> 146 G4double protonMassAMU; 174 G4double theZieglerFactor; 147 G4double theZieglerFactor; 175 G4double expStopPower125; // Experimental S << 148 G4double expStopPower125; // Experimental Stopping power at 125keV 176 149 177 G4int iMolecula = -1; // index in the mole << 150 G4int iMolecula; // index in the molecula's table 178 G4int iPSTAR = -1; // index in NIST PST << 151 G4bool isIon; 179 G4int iICRU90 = -1; << 152 }; 180 153 181 private: << 154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 182 155 183 G4bool isIon = false; << 156 inline G4double G4BraggModel::MaxSecondaryEnergy( 184 G4bool isFirst = false; << 157 const G4ParticleDefinition* pd, 185 }; << 158 G4double kinEnergy) >> 159 { >> 160 if(isIon) SetParticle(pd); >> 161 G4double tau = kinEnergy/mass; >> 162 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) / >> 163 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio); >> 164 return tmax; >> 165 } >> 166 >> 167 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 186 168 187 inline void G4BraggModel::SetChargeSquareRatio << 169 inline G4double G4BraggModel::MaxSecondaryEnergy(const G4DynamicParticle* dp) 188 { 170 { 189 chargeSquare = val; << 171 if(isIon) { >> 172 mass = dp->GetMass(); >> 173 ratio = electron_mass_c2/mass; >> 174 } >> 175 G4double tau = dp->GetKineticEnergy()/mass; >> 176 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) / >> 177 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio); >> 178 return tmax; 190 } 179 } 191 180 192 //....oooOO0OOooo........oooOO0OOooo........oo << 181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 193 182 194 #endif 183 #endif 195 184