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.33 2004/12/01 19:37:13 vnivanch Exp $ >> 24 // GEANT4 tag $Name: geant4-07-00-cand-03 $ 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 << 52 // 11-04-05 Move MaxSecondary energy to model << 53 // 11-04-04 Move MaxSecondaryEnergy to models << 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 // 50 // 59 // Class Description: 51 // Class Description: 60 // 52 // 61 // This class manages the ionisation process f << 53 // This class manages the ionisation process for ions. 62 // nuclear stopping power, energy loss correct << 54 // it inherites from G4VContinuousDiscreteProcess via G4VEnergyLoss. 63 // It inherites from G4VEnergyLossLoss. << 64 // 55 // 65 56 66 // ------------------------------------------- 57 // ------------------------------------------------------------------- 67 // 58 // 68 59 69 #ifndef G4ionIonisation_h 60 #ifndef G4ionIonisation_h 70 #define G4ionIonisation_h 1 61 #define G4ionIonisation_h 1 71 62 72 #include "G4VEnergyLossProcess.hh" 63 #include "G4VEnergyLossProcess.hh" >> 64 #include "G4ionEffectiveCharge.hh" 73 65 74 class G4Material; 66 class G4Material; >> 67 class G4VEmFluctuationModel; 75 68 76 class G4ionIonisation : public G4VEnergyLossPr 69 class G4ionIonisation : public G4VEnergyLossProcess 77 { 70 { >> 71 78 public: 72 public: 79 73 80 explicit G4ionIonisation(const G4String& nam << 74 G4ionIonisation(const G4String& name = "ionIoni"); 81 75 82 ~G4ionIonisation() override = default; << 76 virtual ~G4ionIonisation(); 83 77 84 G4bool IsApplicable(const G4ParticleDefiniti << 78 G4bool IsApplicable(const G4ParticleDefinition& p); 85 79 86 void AddStoppingData(G4int Z, G4int A, const << 80 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p, 87 G4PhysicsVector* dVector); << 81 const G4Material*, G4double cut); 88 82 89 void ActivateStoppingData(G4bool); << 83 virtual std::vector<G4Track*>* SecondariesAlongStep( >> 84 const G4Step&, >> 85 G4double&, >> 86 G4double&, >> 87 G4double&); 90 88 91 // print documentation in html format << 89 virtual void SecondariesPostStep( 92 void ProcessDescription(std::ostream&) const << 90 G4VEmModel*, >> 91 const G4MaterialCutsCouple*, >> 92 const G4DynamicParticle*, >> 93 G4double&, >> 94 G4double&); 93 95 94 // hide assignment operator << 96 void SetSubCutoff(G4bool val); 95 G4ionIonisation & operator=(const G4ionIonis << 97 96 G4ionIonisation(const G4ionIonisation&) = de << 98 void PrintInfoDefinition(); >> 99 // Print out of the class parameters 97 100 98 protected: 101 protected: 99 102 100 void InitialiseEnergyLossProcess(const G4Par << 103 virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*, 101 const G4ParticleDefinition*) overri << 104 const G4ParticleDefinition*); 102 105 103 G4double MinPrimaryEnergy(const G4ParticleDe << 106 virtual G4double GetMeanFreePath(const G4Track& track, 104 const G4Material*, G4double cut) fin << 107 G4double previousStepSize, >> 108 G4ForceCondition* condition); 105 109 106 inline G4double BetheBlochEnergyThreshold(); << 110 virtual G4double MaxSecondaryEnergy(const G4DynamicParticle* dynParticle); 107 111 108 private: 112 private: 109 113 >> 114 // hide assignment operator >> 115 G4ionIonisation & operator=(const G4ionIonisation &right); >> 116 G4ionIonisation(const G4ionIonisation&); >> 117 >> 118 G4ionEffectiveCharge effCharge; 110 119 111 const G4ParticleDefinition* theParticle = nu << 120 // cash 112 G4double eth; << 121 const G4Material* theMaterial; >> 122 const G4ParticleDefinition* currentParticle; >> 123 const G4ParticleDefinition* theParticle; >> 124 const G4ParticleDefinition* theBaseParticle; >> 125 G4VEmFluctuationModel* flucModel; 113 126 114 G4bool isInitialised = false; << 127 G4bool isInitialised; >> 128 G4bool subCutoff; 115 }; 129 }; 116 130 117 //....oooOO0OOooo........oooOO0OOooo........oo 131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 133 >> 134 inline G4bool G4ionIonisation::IsApplicable(const G4ParticleDefinition& p) >> 135 { >> 136 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived() && p.GetParticleType() == "nucleus"); >> 137 } >> 138 >> 139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 140 >> 141 inline G4double G4ionIonisation::MinPrimaryEnergy( >> 142 const G4ParticleDefinition*, const G4Material*, G4double cut) >> 143 { >> 144 G4double x = 0.5*cut/electron_mass_c2; >> 145 G4double g = std::sqrt(1. + x); >> 146 return proton_mass_c2*(g - 1.0); >> 147 } >> 148 >> 149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 150 >> 151 inline G4double G4ionIonisation::MaxSecondaryEnergy(const G4DynamicParticle* dynParticle) >> 152 { >> 153 G4double mass = dynParticle->GetMass(); >> 154 G4double gamma = dynParticle->GetKineticEnergy()/mass + 1.0; >> 155 G4double tmax = electron_mass_c2*std::min(2.0*(gamma*gamma - 1.), >> 156 51200.*std::pow(proton_mass_c2/mass,0.66667)); >> 157 return tmax; >> 158 } >> 159 >> 160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 161 >> 162 >> 163 inline G4double G4ionIonisation::GetMeanFreePath(const G4Track& track, >> 164 G4double, >> 165 G4ForceCondition* cond) >> 166 { >> 167 >> 168 currentParticle = track.GetDefinition(); >> 169 theMaterial = track.GetMaterial(); >> 170 G4double q_2 = effCharge.EffectiveChargeSquareRatio(currentParticle,theMaterial, >> 171 track.GetKineticEnergy()); >> 172 G4double mRatio = proton_mass_c2/track.GetDynamicParticle()->GetMass(); >> 173 >> 174 SetMassRatio(mRatio); >> 175 SetReduceFactor(1.0/(q_2*mRatio)); >> 176 SetChargeSquare(q_2); >> 177 SetChargeSquareRatio(q_2); >> 178 >> 179 return G4VEnergyLossProcess::GetMeanFreePath(track, 0.0, cond); >> 180 } >> 181 >> 182 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 183 >> 184 #include "G4VSubCutoffProcessor.hh" >> 185 >> 186 inline std::vector<G4Track*>* G4ionIonisation::SecondariesAlongStep( >> 187 const G4Step& step, >> 188 G4double& tmax, >> 189 G4double& eloss, >> 190 G4double& scaledEnergy) >> 191 { >> 192 std::vector<G4Track*>* newp = 0; >> 193 G4double e = step.GetTrack()->GetKineticEnergy() - eloss; >> 194 fParticleChange.SetProposedCharge(effCharge.EffectiveCharge(currentParticle,theMaterial,e)); >> 195 if(subCutoff) { >> 196 G4VSubCutoffProcessor* sp = SubCutoffProcessor(CurrentMaterialCutsCoupleIndex()); >> 197 if (sp) { >> 198 G4VEmModel* model = SelectModel(scaledEnergy); >> 199 newp = sp->SampleSecondaries(step,tmax,eloss,model); >> 200 } >> 201 } >> 202 return newp; >> 203 } >> 204 >> 205 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 206 >> 207 #include "G4VEmModel.hh" 118 208 119 inline G4double G4ionIonisation::BetheBlochEne << 209 inline void G4ionIonisation::SecondariesPostStep( >> 210 G4VEmModel* model, >> 211 const G4MaterialCutsCouple* couple, >> 212 const G4DynamicParticle* dp, >> 213 G4double& tcut, >> 214 G4double& kinEnergy) 120 { 215 { 121 return eth; << 216 G4DynamicParticle* delta = model->SampleSecondary(couple, dp, tcut, kinEnergy); >> 217 if(delta) { >> 218 fParticleChange.SetNumberOfSecondaries(1); >> 219 fParticleChange.AddSecondary(delta); >> 220 G4ThreeVector finalP = dp->GetMomentum(); >> 221 kinEnergy -= delta->GetKineticEnergy(); >> 222 fParticleChange.SetProposedCharge(effCharge.EffectiveCharge(currentParticle,theMaterial,kinEnergy)); >> 223 finalP -= delta->GetMomentum(); >> 224 finalP = finalP.unit(); >> 225 fParticleChange.SetProposedMomentumDirection(finalP); >> 226 } 122 } 227 } 123 228 124 //....oooOO0OOooo........oooOO0OOooo........oo 229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 230 126 #endif 231 #endif 127 232