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: G4ionIonisation.hh,v 1.38 2005/05/12 11:06:43 vnivanch Exp $ >> 24 // GEANT4 tag $Name: geant4-07-01-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: G4ionIonisation 31 // File name: G4ionIonisation 33 // 32 // 34 // Author: Vladimir Ivanchenko 33 // Author: Vladimir Ivanchenko 35 // 34 // 36 // Creation date: 07.05.2002 35 // Creation date: 07.05.2002 37 // 36 // 38 // Modifications: 37 // Modifications: 39 // 38 // 40 // 26-12-02 Secondary production moved to deri 39 // 26-12-02 Secondary production moved to derived classes (VI) 41 // 24-01-03 Make models region aware (V.Ivanch 40 // 24-01-03 Make models region aware (V.Ivanchenko) 42 // 05-02-03 Fix compilation warnings (V.Ivanch 41 // 05-02-03 Fix compilation warnings (V.Ivanchenko) 43 // 13-02-03 SubCutoff regime is assigned to a 42 // 13-02-03 SubCutoff regime is assigned to a region (V.Ivanchenko) 44 // 15-02-03 Add control on delta pointer (V.Iv 43 // 15-02-03 Add control on delta pointer (V.Ivanchenko) 45 // 23-05-03 Add fluctuation model as a member 44 // 23-05-03 Add fluctuation model as a member function (V.Ivanchenko) 46 // 03-08-03 Add effective charge and saturatio 45 // 03-08-03 Add effective charge and saturation of tmax (V.Ivanchenko) 47 // 12-11-03 Fix problem of negative effective 46 // 12-11-03 Fix problem of negative effective charge (V.Ivanchenko) 48 // 12-11-03 G4EnergyLossSTD -> G4EnergyLossPro 47 // 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko) 49 // 21-01-04 Migrade to G4ParticleChangeForLoss 48 // 21-01-04 Migrade to G4ParticleChangeForLoss (V.Ivanchenko) 50 // 08-11-04 Migration to new interface of Stor 49 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko) 51 // 08-04-05 Major optimisation of internal int 50 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko) 52 // 11-04-05 Move MaxSecondary energy to model 51 // 11-04-05 Move MaxSecondary energy to model (V.Ivanchneko) 53 // 11-04-04 Move MaxSecondaryEnergy to models 52 // 11-04-04 Move MaxSecondaryEnergy to models (V.Ivanchenko) 54 // 10-05-06 Add a possibility to download user << 55 // 22-07-06 Remove obsolete method (V.Ivantche << 56 // 07-11-07 Moved CorrectionsAlongStep to cc ( << 57 // 12-09-08 Removed InitialiseMassCharge and C << 58 // 53 // 59 // Class Description: 54 // Class Description: 60 // 55 // 61 // This class manages the ionisation process f << 56 // This class manages the ionisation process for ions. 62 // nuclear stopping power, energy loss correct << 57 // it inherites from G4VContinuousDiscreteProcess via G4VEnergyLoss. 63 // It inherites from G4VEnergyLossLoss. << 64 // 58 // 65 59 66 // ------------------------------------------- 60 // ------------------------------------------------------------------- 67 // 61 // 68 62 69 #ifndef G4ionIonisation_h 63 #ifndef G4ionIonisation_h 70 #define G4ionIonisation_h 1 64 #define G4ionIonisation_h 1 71 65 72 #include "G4VEnergyLossProcess.hh" 66 #include "G4VEnergyLossProcess.hh" >> 67 #include "G4ionEffectiveCharge.hh" >> 68 #include "G4VEmModel.hh" >> 69 #include "G4EmCorrections.hh" 73 70 74 class G4Material; 71 class G4Material; >> 72 class G4VEmFluctuationModel; 75 73 76 class G4ionIonisation : public G4VEnergyLossPr 74 class G4ionIonisation : public G4VEnergyLossProcess 77 { 75 { 78 public: 76 public: 79 77 80 explicit G4ionIonisation(const G4String& nam << 78 G4ionIonisation(const G4String& name = "ionIoni"); 81 79 82 ~G4ionIonisation() override = default; << 80 virtual ~G4ionIonisation(); 83 81 84 G4bool IsApplicable(const G4ParticleDefiniti << 82 G4bool IsApplicable(const G4ParticleDefinition& p); 85 83 86 void AddStoppingData(G4int Z, G4int A, const << 84 // Print out of the class parameters 87 G4PhysicsVector* dVector); << 85 virtual void PrintInfo(); 88 << 89 void ActivateStoppingData(G4bool); << 90 << 91 // print documentation in html format << 92 void ProcessDescription(std::ostream&) const << 93 << 94 // hide assignment operator << 95 G4ionIonisation & operator=(const G4ionIonis << 96 G4ionIonisation(const G4ionIonisation&) = de << 97 86 98 protected: 87 protected: 99 88 >> 89 void CorrectionsAlongStep( >> 90 const G4MaterialCutsCouple*, >> 91 const G4DynamicParticle*, >> 92 G4double& eloss, >> 93 G4double& length); >> 94 >> 95 virtual std::vector<G4DynamicParticle*>* SecondariesPostStep( >> 96 G4VEmModel*, >> 97 const G4MaterialCutsCouple*, >> 98 const G4DynamicParticle*, >> 99 G4double&); >> 100 100 void InitialiseEnergyLossProcess(const G4Par 101 void InitialiseEnergyLossProcess(const G4ParticleDefinition*, 101 const G4ParticleDefinition*) overri << 102 const G4ParticleDefinition*); 102 103 103 G4double MinPrimaryEnergy(const G4ParticleDe << 104 G4double GetMeanFreePath(const G4Track& track, 104 const G4Material*, G4double cut) fin << 105 G4double previousStepSize, >> 106 G4ForceCondition* condition); 105 107 106 inline G4double BetheBlochEnergyThreshold(); << 108 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p, >> 109 const G4Material*, G4double cut); 107 110 108 private: 111 private: 109 112 >> 113 // hide assignment operator >> 114 G4ionIonisation & operator=(const G4ionIonisation &right); >> 115 G4ionIonisation(const G4ionIonisation&); 110 116 111 const G4ParticleDefinition* theParticle = nu << 117 G4ionEffectiveCharge effCharge; 112 G4double eth; << 118 G4VEmFluctuationModel* flucModel; >> 119 G4EmCorrections* corr; >> 120 >> 121 // cash >> 122 const G4Material* theMaterial; >> 123 const G4ParticleDefinition* currentParticle; >> 124 const G4ParticleDefinition* theParticle; >> 125 const G4ParticleDefinition* theBaseParticle; >> 126 >> 127 G4double preKinEnergy; >> 128 >> 129 G4double eth; >> 130 G4double baseMass; >> 131 G4double massRatio; 113 132 114 G4bool isInitialised = false; << 133 G4bool isInitialised; 115 }; 134 }; 116 135 117 //....oooOO0OOooo........oooOO0OOooo........oo 136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 138 >> 139 inline G4bool G4ionIonisation::IsApplicable(const G4ParticleDefinition& p) >> 140 { >> 141 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived() && >> 142 p.GetParticleType() == "nucleus"); >> 143 } >> 144 >> 145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 146 >> 147 inline G4double G4ionIonisation::MinPrimaryEnergy( >> 148 const G4ParticleDefinition*, const G4Material*, G4double cut) >> 149 { >> 150 G4double x = 0.5*cut/electron_mass_c2; >> 151 G4double g = std::sqrt(1. + x); >> 152 return proton_mass_c2*(g - 1.0); >> 153 } >> 154 >> 155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 156 >> 157 >> 158 inline G4double G4ionIonisation::GetMeanFreePath(const G4Track& track, >> 159 G4double, >> 160 G4ForceCondition* cond) >> 161 { >> 162 >> 163 currentParticle = track.GetDefinition(); >> 164 theMaterial = track.GetMaterial(); >> 165 preKinEnergy = track.GetKineticEnergy(); >> 166 massRatio = baseMass/track.GetDynamicParticle()->GetMass(); >> 167 >> 168 G4double q_2 = effCharge.EffectiveChargeSquareRatio(currentParticle,theMaterial, >> 169 preKinEnergy); >> 170 SetMassRatio(massRatio); >> 171 SetReduceFactor(1.0/(q_2*massRatio)); >> 172 SetChargeSquare(q_2); >> 173 SetChargeSquareRatio(q_2); >> 174 >> 175 return G4VEnergyLossProcess::GetMeanFreePath(track, 0.0, cond); >> 176 } >> 177 >> 178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 179 >> 180 inline void G4ionIonisation::CorrectionsAlongStep( >> 181 const G4MaterialCutsCouple*, >> 182 const G4DynamicParticle*, >> 183 G4double& eloss, >> 184 G4double& s) >> 185 { >> 186 if(eloss < preKinEnergy) { >> 187 if(preKinEnergy*massRatio > eth) >> 188 eloss += s*corr->HighOrderCorrections(currentParticle,theMaterial,preKinEnergy); >> 189 else >> 190 eloss += s*corr->NuclearDEDX(currentParticle,theMaterial,preKinEnergy - eloss*0.5); >> 191 fParticleChange.SetProposedCharge(effCharge.EffectiveCharge(currentParticle, >> 192 theMaterial,preKinEnergy-eloss)); >> 193 } >> 194 } >> 195 >> 196 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 118 197 119 inline G4double G4ionIonisation::BetheBlochEne << 198 inline std::vector<G4DynamicParticle*>* G4ionIonisation::SecondariesPostStep( >> 199 G4VEmModel* model, >> 200 const G4MaterialCutsCouple* couple, >> 201 const G4DynamicParticle* dp, >> 202 G4double& tcut) 120 { 203 { 121 return eth; << 204 return model->SampleSecondaries(couple, dp, tcut); 122 } 205 } 123 206 124 //....oooOO0OOooo........oooOO0OOooo........oo 207 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 208 126 #endif 209 #endif 127 210