Changeset 1005 for trunk/source/processes/electromagnetic/standard
- Timestamp:
- Apr 20, 2009, 4:53:50 PM (15 years ago)
- Location:
- trunk/source/processes/electromagnetic/standard
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/History
r991 r1005 1 $Id: History,v 1.43 0 2008/11/24 18:28:09vnivanch Exp $1 $Id: History,v 1.432 2009/02/20 12:11:37 vnivanch Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20 20 February 09: V.Ivant (emstand-V09-02-00) 21 - Move all virtual methods from inline to source 22 G4PEEffectModel - substitute ComputeMeanFreePath by CrossSectionPerVolume 23 (minor CPU speadup for compound materials) 24 G4PAIModel, G4PAIPhotonModel - remove usage of random numbers at 25 initialisation (potential non-reproducibility) 26 G4WentzelVIModel - use generic methods of G4VMscModel to access safety 27 and other geometry information 19 28 20 29 24 November 08: V.Ivant (emstand-V09-01-45) -
trunk/source/processes/electromagnetic/standard/include/G4BetheBlochModel.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BetheBlochModel.hh,v 1.1 6 2008/10/22 16:00:57 vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4BetheBlochModel.hh,v 1.17 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 82 82 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 83 83 84 G4double MinEnergyCut(const G4ParticleDefinition*,85 const G4MaterialCutsCouple*);84 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 85 const G4MaterialCutsCouple*); 86 86 87 87 virtual G4double ComputeCrossSectionPerElectron( … … 131 131 protected: 132 132 133 G4double MaxSecondaryEnergy(const G4ParticleDefinition*,134 G4double kinEnergy);133 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 134 G4double kinEnergy); 135 135 136 136 private: … … 166 166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 167 167 168 inline G4double G4BetheBlochModel::MaxSecondaryEnergy(169 const G4ParticleDefinition* pd,170 G4double kinEnergy)171 {172 if(isIon) SetParticle(pd);173 G4double tau = kinEnergy/mass;174 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /175 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);176 return std::min(tmax,tlimit);177 }178 179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....180 181 168 #endif -
trunk/source/processes/electromagnetic/standard/include/G4BohrFluctuations.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BohrFluctuations.hh,v 1. 3 2007/09/27 13:53:11vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4BohrFluctuations.hh,v 1.4 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 79 79 void InitialiseMe(const G4ParticleDefinition*); 80 80 81 protected:82 83 81 private: 84 82 … … 103 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 104 102 105 106 inline G4double G4BohrFluctuations::Dispersion(107 const G4Material* material,108 const G4DynamicParticle* dp,109 G4double& tmax,110 G4double& length)111 {112 if(!particle) InitialiseMe(dp->GetDefinition());113 114 G4double electronDensity = material->GetElectronDensity();115 kineticEnergy = dp->GetKineticEnergy();116 G4double etot = kineticEnergy + particleMass;117 beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot);118 G4double siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length119 * electronDensity * chargeSquare;120 121 return siga;122 }123 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....125 126 103 #endif 127 104 -
trunk/source/processes/electromagnetic/standard/include/G4BraggIonModel.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BraggIonModel.hh,v 1.1 1 2008/10/22 16:00:57 vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4BraggIonModel.hh,v 1.12 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 77 77 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 78 78 79 G4double MinEnergyCut(const G4ParticleDefinition*,80 const G4MaterialCutsCouple*);79 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 80 const G4MaterialCutsCouple*); 81 81 82 82 virtual G4double ComputeCrossSectionPerElectron( … … 128 128 protected: 129 129 130 G4double MaxSecondaryEnergy(const G4ParticleDefinition*,131 G4double kinEnergy);130 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 131 G4double kinEnergy); 132 132 133 133 private: … … 180 180 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 181 181 182 inline G4double G4BraggIonModel::MaxSecondaryEnergy(183 const G4ParticleDefinition* pd,184 G4double kinEnergy)185 {186 if(pd != particle) SetParticle(pd);187 G4double tau = kinEnergy/mass;188 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /189 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);190 return tmax;191 }192 193 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......194 195 182 inline void G4BraggIonModel::SetParticle(const G4ParticleDefinition* p) 196 183 { -
trunk/source/processes/electromagnetic/standard/include/G4BraggModel.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BraggModel.hh,v 1.1 2 2008/09/14 17:11:48vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4BraggModel.hh,v 1.13 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 80 80 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 81 81 82 G4double MinEnergyCut(const G4ParticleDefinition*,83 const G4MaterialCutsCouple*);82 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 83 const G4MaterialCutsCouple*); 84 84 85 85 virtual G4double ComputeCrossSectionPerElectron( … … 131 131 protected: 132 132 133 G4double MaxSecondaryEnergy(const G4ParticleDefinition*,134 G4double kinEnergy);133 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 134 G4double kinEnergy); 135 135 136 136 private: 137 137 138 void SetParticle(const G4ParticleDefinition* p);138 inline void SetParticle(const G4ParticleDefinition* p); 139 139 140 140 G4bool HasMaterial(const G4Material* material); … … 182 182 G4bool isInitialised; 183 183 }; 184 185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......186 187 inline G4double G4BraggModel::MaxSecondaryEnergy(188 const G4ParticleDefinition* pd,189 G4double kinEnergy)190 {191 if(pd != particle) SetParticle(pd);192 G4double tau = kinEnergy/mass;193 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) /194 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio);195 return tmax;196 }197 184 198 185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/include/G4ComptonScattering.hh
r991 r1005 25 25 // 26 26 // 27 // $Id: G4ComptonScattering.hh,v 1.2 0 2007/05/23 08:47:34vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-02 $27 // $Id: G4ComptonScattering.hh,v 1.21 2009/02/20 12:06:37 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //------------------ G4ComptonScattering physics process ----------------------- … … 82 82 83 83 // true for Gamma only. 84 G4bool IsApplicable(const G4ParticleDefinition&);84 virtual G4bool IsApplicable(const G4ParticleDefinition&); 85 85 86 86 // Print few lines of informations about the process: validity range, 87 87 virtual void PrintInfo(); 88 89 88 90 89 protected: … … 97 96 }; 98 97 99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....101 102 inline103 G4bool G4ComptonScattering::IsApplicable(const G4ParticleDefinition& p)104 {105 return (&p == G4Gamma::Gamma());106 }107 108 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 109 99 -
trunk/source/processes/electromagnetic/standard/include/G4CoulombScattering.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CoulombScattering.hh,v 1.1 1 2008/06/13 08:19:43vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4CoulombScattering.hh,v 1.12 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 104 104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 105 105 106 inline G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p)107 {108 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived());109 }110 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....112 113 106 inline void G4CoulombScattering::SetThetaMin(G4double val) 114 107 { -
trunk/source/processes/electromagnetic/standard/include/G4GammaConversion.hh
r991 r1005 25 25 // 26 26 // 27 // $Id: G4GammaConversion.hh,v 1.2 2 2007/05/23 08:47:34vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-02 $27 // $Id: G4GammaConversion.hh,v 1.23 2009/02/20 12:06:37 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 85 85 86 86 // true for Gamma only. 87 G4bool IsApplicable(const G4ParticleDefinition&);87 virtual G4bool IsApplicable(const G4ParticleDefinition&); 88 88 89 89 // Print few lines of informations about the process: validity range, … … 99 99 }; 100 100 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....103 104 inline G4bool G4GammaConversion::IsApplicable(const G4ParticleDefinition& p)105 {106 return (&p == G4Gamma::Gamma());107 }108 109 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 110 102 -
trunk/source/processes/electromagnetic/standard/include/G4IonFluctuations.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4IonFluctuations.hh,v 1. 8 2008/10/22 16:04:33vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4IonFluctuations.hh,v 1.9 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 84 84 85 85 // Initialisation prestep 86 inlinevoid SetParticleAndCharge(const G4ParticleDefinition*, G4double q2);86 void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2); 87 87 88 88 private: … … 117 117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 118 118 119 inline120 void G4IonFluctuations::SetParticleAndCharge(const G4ParticleDefinition* part,121 G4double q2)122 {123 if(part != particle) {124 particle = part;125 particleMass = part->GetPDGMass();126 charge = part->GetPDGCharge()/eplus;127 chargeSquare = charge*charge;128 }129 effChargeSquare = q2;130 uniFluct.SetParticleAndCharge(part, q2);131 }132 133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....134 135 119 #endif 136 120 -
trunk/source/processes/electromagnetic/standard/include/G4MollerBhabhaModel.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MollerBhabhaModel.hh,v 1. 19 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4MollerBhabhaModel.hh,v 1.20 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 74 74 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 75 75 76 G4double MinEnergyCut(const G4ParticleDefinition*,77 const G4MaterialCutsCouple*);76 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 77 const G4MaterialCutsCouple*); 78 78 79 79 virtual G4double ComputeCrossSectionPerElectron( … … 109 109 protected: 110 110 111 G4double MaxSecondaryEnergy(const G4ParticleDefinition*,112 G4double kinEnergy);111 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 112 G4double kinEnergy); 113 113 114 void SetParticle(const G4ParticleDefinition* p);114 inline void SetParticle(const G4ParticleDefinition* p); 115 115 116 116 const G4ParticleDefinition* particle; … … 127 127 G4MollerBhabhaModel & operator=(const G4MollerBhabhaModel &right); 128 128 G4MollerBhabhaModel(const G4MollerBhabhaModel&); 129 130 G4bool isInitialised; 131 129 132 }; 130 133 131 134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 132 135 133 inline G4double G4MollerBhabhaModel::MaxSecondaryEnergy( 134 const G4ParticleDefinition*, 135 G4double kinEnergy) 136 inline void G4MollerBhabhaModel::SetParticle(const G4ParticleDefinition* p) 136 137 { 137 G4double tmax = kinEnergy; 138 if(isElectron) tmax *= 0.5; 139 return tmax; 138 particle = p; 139 if(p != theElectron) isElectron = false; 140 140 } 141 141 -
trunk/source/processes/electromagnetic/standard/include/G4PAIModel.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PAIModel.hh,v 1.22 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 26 28 // 27 29 // ------------------------------------------------------------------- … … 75 77 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 76 78 77 virtual void InitialiseMe(const G4ParticleDefinition*) {};78 79 virtual G4double ComputeDEDX (const G4MaterialCutsCouple*,79 virtual void InitialiseMe(const G4ParticleDefinition*); 80 81 virtual G4double ComputeDEDXPerVolume(const G4Material*, 80 82 const G4ParticleDefinition*, 81 83 G4double kineticEnergy, 82 84 G4double cutEnergy); 83 85 84 virtual G4double CrossSection (const G4MaterialCutsCouple*,86 virtual G4double CrossSectionPerVolume(const G4Material*, 85 87 const G4ParticleDefinition*, 86 88 G4double kineticEnergy, … … 118 120 119 121 void SetVerboseLevel(G4int verbose){fVerbose=verbose;}; 120 121 122 122 123 123 protected: … … 192 192 }; 193 193 194 /////////////////////////////////////////////////////////////////////195 196 inline G4double G4PAIModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,197 G4double kinEnergy)198 {199 G4double tmax = kinEnergy;200 if(p == fElectron) tmax *= 0.5;201 else if(p != fPositron) {202 G4double mass = p->GetPDGMass();203 G4double ratio= electron_mass_c2/mass;204 G4double gamma= kinEnergy/mass + 1.0;205 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /206 (1. + 2.0*gamma*ratio + ratio*ratio);207 }208 return tmax;209 }210 211 ///////////////////////////////////////////////////////////////212 213 inline void G4PAIModel::DefineForRegion(const G4Region* r)214 {215 fPAIRegionVector.push_back(r);216 }217 218 194 #endif 219 195 -
trunk/source/processes/electromagnetic/standard/include/G4PAIPhotonModel.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PAIPhotonModel.hh,v 1.12 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 26 28 // 27 29 // ------------------------------------------------------------------- … … 74 76 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 75 77 76 virtual void InitialiseMe(const G4ParticleDefinition*) {};77 78 virtual G4double ComputeDEDX (const G4MaterialCutsCouple*,79 80 81 82 83 virtual G4double CrossSection (const G4MaterialCutsCouple*,84 const G4ParticleDefinition*,85 G4double kineticEnergy,86 G4double cutEnergy,87 G4double maxEnergy);78 virtual void InitialiseMe(const G4ParticleDefinition*); 79 80 virtual G4double ComputeDEDXPerVolume(const G4Material*, 81 const G4ParticleDefinition*, 82 G4double kineticEnergy, 83 G4double cutEnergy); 84 85 virtual G4double CrossSectionPerVolume(const G4Material*, 86 const G4ParticleDefinition*, 87 G4double kineticEnergy, 88 G4double cutEnergy, 89 G4double maxEnergy); 88 90 89 91 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, … … 122 124 G4double position, G4int iTransfer ); 123 125 124 125 126 126 protected: 127 127 128 128 G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 129 129 G4double kinEnergy); 130 130 131 131 private: … … 145 145 G4int fVerbose; 146 146 G4PhysicsLogVector* fProtonEnergyVector ; 147 148 149 147 150 148 // vectors … … 204 202 }; 205 203 206 /////////////////////////////////////////////////////////////////////207 208 inline G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,209 G4double kinEnergy)210 {211 G4double tmax = kinEnergy;212 if(p == fElectron) tmax *= 0.5;213 else if(p != fPositron) {214 G4double mass = p->GetPDGMass();215 G4double ratio= electron_mass_c2/mass;216 G4double gamma= kinEnergy/mass + 1.0;217 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /218 (1. + 2.0*gamma*ratio + ratio*ratio);219 }220 return tmax;221 }222 223 ///////////////////////////////////////////////////////////////224 225 inline void G4PAIPhotonModel::DefineForRegion(const G4Region* r)226 {227 fPAIRegionVector.push_back(r);228 }229 230 204 #endif 231 205 -
trunk/source/processes/electromagnetic/standard/include/G4PEEffectModel.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PEEffectModel.hh,v 1. 6 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4PEEffectModel.hh,v 1.7 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 41 41 // 42 42 // 06.02.2006 : added ComputeMeanFreePath() (mma) 43 // 20.02.2009 : move virtual inline to .cc, substitute 44 // ComputeMeanFreePath() by CrossSectionPerVolume (VI) 43 45 // 44 46 // Class Description: … … 70 72 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 71 73 72 G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,73 74 75 76 74 virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 75 G4double kinEnergy, 76 G4double Z, 77 G4double A, 78 G4double, G4double); 77 79 78 G4double ComputeMeanFreePath( const G4ParticleDefinition*, 79 G4double kinEnergy, 80 const G4Material* material, 81 G4double, G4double); 80 virtual G4double CrossSectionPerVolume(const G4Material*, 81 const G4ParticleDefinition*, 82 G4double kineticEnergy, 83 G4double cutEnergy, 84 G4double maxEnergy); 82 85 83 86 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, … … 100 103 }; 101 104 102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....103 104 inline G4double G4PEEffectModel::ComputeCrossSectionPerAtom(105 const G4ParticleDefinition*,106 G4double energy,107 G4double Z, G4double,108 G4double, G4double)109 {110 G4double* SandiaCof = G4SandiaTable::GetSandiaCofPerAtom((G4int)Z, energy);111 112 G4double energy2 = energy*energy, energy3 = energy*energy2,113 energy4 = energy2*energy2;114 115 return SandiaCof[0]/energy + SandiaCof[1]/energy2 +116 SandiaCof[2]/energy3 + SandiaCof[3]/energy4;117 }118 119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....120 121 inline G4double G4PEEffectModel::ComputeMeanFreePath(122 const G4ParticleDefinition*,123 G4double energy,124 const G4Material* material,125 G4double, G4double)126 {127 G4double* SandiaCof = material->GetSandiaTable()128 ->GetSandiaCofForMaterial(energy);129 130 G4double energy2 = energy*energy, energy3 = energy*energy2,131 energy4 = energy2*energy2;132 133 G4double cross = SandiaCof[0]/energy + SandiaCof[1]/energy2 +134 SandiaCof[2]/energy3 + SandiaCof[3]/energy4;135 136 G4double mfp = DBL_MAX;137 if (cross > 0.) mfp = 1./cross;138 return mfp;139 }140 141 105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 142 106 -
trunk/source/processes/electromagnetic/standard/include/G4PhotoElectricEffect.hh
r991 r1005 25 25 // 26 26 // 27 // $Id: G4PhotoElectricEffect.hh,v 1.2 4 2007/05/23 08:47:34vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-02 $27 // $Id: G4PhotoElectricEffect.hh,v 1.25 2009/02/20 12:06:37 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 91 91 92 92 // true for Gamma only. 93 G4bool IsApplicable(const G4ParticleDefinition&);93 virtual G4bool IsApplicable(const G4ParticleDefinition&); 94 94 95 95 // Print few lines of informations about the process: validity range, 96 v oid PrintInfo();96 virtual void PrintInfo(); 97 97 98 98 protected: 99 99 100 v oid InitialiseProcess(const G4ParticleDefinition*);100 virtual void InitialiseProcess(const G4ParticleDefinition*); 101 101 102 102 private: … … 105 105 }; 106 106 107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....109 110 inline111 G4bool G4PhotoElectricEffect::IsApplicable(const G4ParticleDefinition& p)112 {113 return (&p == G4Gamma::Gamma());114 }115 116 107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 117 108 -
trunk/source/processes/electromagnetic/standard/include/G4UniversalFluctuation.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4UniversalFluctuation.hh,v 1. 6 2008/10/22 16:04:33vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4UniversalFluctuation.hh,v 1.8 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 70 70 virtual ~G4UniversalFluctuation(); 71 71 72 G4double SampleFluctuations(const G4Material*,73 74 75 76 72 virtual G4double SampleFluctuations(const G4Material*, 73 const G4DynamicParticle*, 74 G4double&, 75 G4double&, 76 G4double&); 77 77 78 G4double Dispersion( const G4Material*,79 80 81 78 virtual G4double Dispersion( const G4Material*, 79 const G4DynamicParticle*, 80 G4double&, 81 G4double&); 82 82 83 void InitialiseMe(const G4ParticleDefinition*); 83 // Initialisation before the run 84 virtual void InitialiseMe(const G4ParticleDefinition*); 84 85 85 86 // Initialisation prestep 86 inline void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2); 87 88 protected: 87 virtual void SetParticleAndCharge(const G4ParticleDefinition*, G4double q2); 89 88 90 89 private: … … 126 125 }; 127 126 128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....129 130 inline void131 G4UniversalFluctuation::SetParticleAndCharge(const G4ParticleDefinition* part,132 G4double q2)133 {134 if(part != particle) {135 particle = part;136 particleMass = part->GetPDGMass();137 }138 chargeSquare = q2;139 }140 141 127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 142 128 -
trunk/source/processes/electromagnetic/standard/include/G4WentzelVIModel.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4WentzelVIModel.hh,v 1. 7 2008/08/04 08:49:09vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4WentzelVIModel.hh,v 1.8 2009/02/19 19:17:15 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 66 66 class G4LossTableManager; 67 67 class G4ParticleChangeForMSC; 68 class G4SafetyHelper;68 //class G4SafetyHelper; 69 69 class G4ParticleDefinition; 70 70 … … 133 133 G4ParticleChangeForMSC* fParticleChange; 134 134 135 G4SafetyHelper* safetyHelper;135 // G4SafetyHelper* safetyHelper; 136 136 G4PhysicsTable* theLambdaTable; 137 137 G4PhysicsTable* theLambda2Table; -
trunk/source/processes/electromagnetic/standard/include/G4eBremsstrahlung.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlung.hh,v 1.3 6 2007/05/23 08:47:34vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4eBremsstrahlung.hh,v 1.37 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 89 89 virtual ~G4eBremsstrahlung(); 90 90 91 G4bool IsApplicable(const G4ParticleDefinition& p);91 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 92 92 93 93 // Print out of the class parameters … … 111 111 112 112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....114 115 inline G4bool G4eBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)116 {117 return (&p == G4Electron::Electron() || &p == G4Positron::Positron());118 }119 120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....121 113 122 114 #endif -
trunk/source/processes/electromagnetic/standard/include/G4eBremsstrahlungModel.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlungModel.hh,v 1.2 5 2008/11/13 19:28:58vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4eBremsstrahlungModel.hh,v 1.26 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 75 75 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 76 76 77 G4double MinEnergyCut(const G4ParticleDefinition*,78 const G4MaterialCutsCouple*);77 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 78 const G4MaterialCutsCouple*); 79 79 80 80 virtual G4double ComputeDEDXPerVolume(const G4Material*, … … 102 102 103 103 protected: 104 105 inline G4double MaxSecondaryEnergy(const G4ParticleDefinition*,106 G4double kineticEnergy);107 104 108 105 const G4Element* SelectRandomAtom(const G4MaterialCutsCouple* couple); … … 191 188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 192 189 193 inline194 G4double G4eBremsstrahlungModel::MaxSecondaryEnergy(195 const G4ParticleDefinition*,196 G4double kineticEnergy)197 {198 return kineticEnergy;199 }200 201 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....202 203 190 #endif -
trunk/source/processes/electromagnetic/standard/include/G4eBremsstrahlungRelModel.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlungRelModel.hh,v 1.1 0 2008/11/14 09:25:19vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4eBremsstrahlungRelModel.hh,v 1.11 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 71 71 virtual void Initialise(const G4ParticleDefinition*, const G4DataVector&); 72 72 73 G4double MinEnergyCut(const G4ParticleDefinition*,74 const G4MaterialCutsCouple*);73 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 74 const G4MaterialCutsCouple*); 75 75 76 76 virtual G4double ComputeDEDXPerVolume(const G4Material*, … … 97 97 inline G4double LPMconstant() const; 98 98 99 protected:100 101 inline G4double MaxSecondaryEnergy(const G4ParticleDefinition*,102 G4double kineticEnergy);103 104 99 private: 105 100 … … 207 202 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 208 203 209 inline G4double210 G4eBremsstrahlungRelModel::MaxSecondaryEnergy(const G4ParticleDefinition*,211 G4double kineticEnergy)212 {213 return kineticEnergy;214 }215 216 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....217 218 204 219 205 inline G4double G4eBremsstrahlungRelModel::Phi1(G4double gg, G4double) -
trunk/source/processes/electromagnetic/standard/include/G4eIonisation.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eIonisation.hh,v 1.3 5 2007/05/23 08:47:34vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4eIonisation.hh,v 1.36 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 88 88 virtual ~G4eIonisation(); 89 89 90 G4bool IsApplicable(const G4ParticleDefinition& p);90 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 91 91 92 92 // Print out of the class parameters … … 98 98 const G4ParticleDefinition*); 99 99 100 G4double MinPrimaryEnergy(const G4ParticleDefinition*,101 const G4Material*, G4double cut);100 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*, 101 const G4Material*, G4double cut); 102 102 103 103 private: … … 114 114 }; 115 115 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....118 119 inline G4double G4eIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,120 const G4Material*,121 G4double cut)122 {123 G4double x = cut;124 if(isElectron) x += cut;125 return x;126 }127 128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....129 130 inline G4bool G4eIonisation::IsApplicable(const G4ParticleDefinition& p)131 {132 return (&p == G4Electron::Electron() || &p == G4Positron::Positron());133 }134 135 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 136 117 -
trunk/source/processes/electromagnetic/standard/include/G4eplusAnnihilation.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eplusAnnihilation.hh,v 1.2 3 2007/05/23 08:47:34vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4eplusAnnihilation.hh,v 1.24 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 73 73 virtual ~G4eplusAnnihilation(); 74 74 75 G4bool IsApplicable(const G4ParticleDefinition& p);75 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 76 76 77 77 virtual G4VParticleChange* AtRestDoIt( … … 79 79 const G4Step& stepData); 80 80 81 G4double AtRestGetPhysicalInteractionLength(81 virtual G4double AtRestGetPhysicalInteractionLength( 82 82 const G4Track& track, 83 83 G4ForceCondition* condition … … 96 96 }; 97 97 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....100 101 inline G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& p)102 {103 return (&p == G4Positron::Positron());104 }105 106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....107 108 inline109 G4double G4eplusAnnihilation::AtRestGetPhysicalInteractionLength(110 const G4Track&, G4ForceCondition* condition)111 {112 *condition = NotForced;113 return 0.0;114 }115 116 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 117 99 -
trunk/source/processes/electromagnetic/standard/include/G4hIonisation.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4hIonisation.hh,v 1.4 1 2008/09/14 17:11:48vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4hIonisation.hh,v 1.42 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 93 93 virtual ~G4hIonisation(); 94 94 95 G4bool IsApplicable(const G4ParticleDefinition& p);95 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 96 96 97 G4double MinPrimaryEnergy(const G4ParticleDefinition* p,98 const G4Material*, G4double cut);97 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p, 98 const G4Material*, G4double cut); 99 99 100 100 // Print out of the class parameters … … 123 123 124 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....126 127 inline G4bool G4hIonisation::IsApplicable(const G4ParticleDefinition& p)128 {129 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV &&130 !p.IsShortLived());131 }132 133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....134 135 inline G4double G4hIonisation::MinPrimaryEnergy(const G4ParticleDefinition*,136 const G4Material*,137 G4double cut)138 {139 G4double x = 0.5*cut/electron_mass_c2;140 G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio));141 return mass*(g - 1.0);142 }143 144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....145 125 146 126 inline void G4hIonisation::ActivateNuclearStopping(G4bool val) -
trunk/source/processes/electromagnetic/standard/include/G4ionIonisation.hh
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ionIonisation.hh,v 1.5 6 2008/09/14 17:11:48vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4ionIonisation.hh,v 1.57 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 85 85 virtual ~G4ionIonisation(); 86 86 87 inlineG4bool IsApplicable(const G4ParticleDefinition& p);87 virtual G4bool IsApplicable(const G4ParticleDefinition& p); 88 88 89 89 // Print out of the class parameters … … 102 102 const G4ParticleDefinition*); 103 103 104 inlineG4double MinPrimaryEnergy(const G4ParticleDefinition* p,104 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition* p, 105 105 const G4Material*, G4double cut); 106 106 … … 127 127 128 128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....130 131 inline G4bool G4ionIonisation::IsApplicable(const G4ParticleDefinition& p)132 {133 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived() &&134 p.GetParticleType() == "nucleus");135 }136 137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....138 139 inline G4double G4ionIonisation::MinPrimaryEnergy(140 const G4ParticleDefinition* p, const G4Material*, G4double cut)141 {142 return143 p->GetPDGMass()*(std::sqrt(1. + 0.5*cut/CLHEP::electron_mass_c2) - 1.0);144 }145 146 129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 147 130 -
trunk/source/processes/electromagnetic/standard/src/G4BetheBlochModel.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BetheBlochModel.cc,v 1.2 4 2008/10/22 16:00:57 vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4BetheBlochModel.cc,v 1.25 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 111 111 112 112 corrFactor = chargeSquare; 113 // always false before the run 114 SetDeexcitationFlag(false); 113 115 114 116 if(!isInitialised) { … … 453 455 } 454 456 455 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 457 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 458 459 G4double G4BetheBlochModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd, 460 G4double kinEnergy) 461 { 462 if(isIon) SetParticle(pd); 463 G4double tau = kinEnergy/mass; 464 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) / 465 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio); 466 return std::min(tmax,tlimit); 467 } 468 469 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/src/G4BohrFluctuations.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BohrFluctuations.cc,v 1. 6 2007/09/27 14:02:41vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4BohrFluctuations.cc,v 1.7 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 137 137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 138 138 139 G4double G4BohrFluctuations::Dispersion(const G4Material* material, 140 const G4DynamicParticle* dp, 141 G4double& tmax, 142 G4double& length) 143 { 144 if(!particle) InitialiseMe(dp->GetDefinition()); 139 145 146 G4double electronDensity = material->GetElectronDensity(); 147 kineticEnergy = dp->GetKineticEnergy(); 148 G4double etot = kineticEnergy + particleMass; 149 beta2 = kineticEnergy*(kineticEnergy + 2.0*particleMass)/(etot*etot); 150 G4double siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length 151 * electronDensity * chargeSquare; 152 153 return siga; 154 } 155 156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 157 158 -
trunk/source/processes/electromagnetic/standard/src/G4BraggIonModel.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BraggIonModel.cc,v 1.2 2 2008/10/22 16:00:57 vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4BraggIonModel.cc,v 1.23 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 113 113 114 114 corrFactor = chargeSquare; 115 116 // always false before the run 117 SetDeexcitationFlag(false); 115 118 116 119 if(!isInitialised) { … … 352 355 fParticleChange->SetProposedKineticEnergy(kineticEnergy); 353 356 fParticleChange->SetProposedMomentumDirection(finalP); 357 } 358 359 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 360 361 G4double G4BraggIonModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd, 362 G4double kinEnergy) 363 { 364 if(pd != particle) SetParticle(pd); 365 G4double tau = kinEnergy/mass; 366 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) / 367 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio); 368 return tmax; 354 369 } 355 370 -
trunk/source/processes/electromagnetic/standard/src/G4BraggModel.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4BraggModel.cc,v 1.2 0 2008/10/22 16:01:46vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4BraggModel.cc,v 1.21 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 111 111 { 112 112 if(p != particle) SetParticle(p); 113 114 // always false before the run 115 SetDeexcitationFlag(false); 113 116 114 117 if(!isInitialised) { … … 337 340 338 341 vdp->push_back(delta); 342 } 343 344 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 345 346 G4double G4BraggModel::MaxSecondaryEnergy(const G4ParticleDefinition* pd, 347 G4double kinEnergy) 348 { 349 if(pd != particle) SetParticle(pd); 350 G4double tau = kinEnergy/mass; 351 G4double tmax = 2.0*electron_mass_c2*tau*(tau + 2.) / 352 (1. + 2.0*(tau + 1.)*ratio + ratio*ratio); 353 return tmax; 339 354 } 340 355 -
trunk/source/processes/electromagnetic/standard/src/G4ComptonScattering.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ComptonScattering.cc,v 1.3 0 2008/10/15 17:53:44vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4ComptonScattering.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 84 84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 85 85 86 G4bool G4ComptonScattering::IsApplicable(const G4ParticleDefinition& p) 87 { 88 return (&p == G4Gamma::Gamma()); 89 } 90 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 86 93 void G4ComptonScattering::InitialiseProcess(const G4ParticleDefinition*) 87 94 { -
trunk/source/processes/electromagnetic/standard/src/G4CoulombScattering.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4CoulombScattering.cc,v 1. 19 2008/10/15 17:53:44vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4CoulombScattering.cc,v 1.20 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 79 79 G4CoulombScattering::~G4CoulombScattering() 80 80 {} 81 82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 83 84 G4bool G4CoulombScattering::IsApplicable(const G4ParticleDefinition& p) 85 { 86 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived()); 87 } 81 88 82 89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/standard/src/G4GammaConversion.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4GammaConversion.cc,v 1.3 0 2008/10/15 17:53:44vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4GammaConversion.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 90 90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 91 91 92 G4bool G4GammaConversion::IsApplicable(const G4ParticleDefinition& p) 93 { 94 return (&p == G4Gamma::Gamma()); 95 } 96 97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 98 92 99 void G4GammaConversion::InitialiseProcess(const G4ParticleDefinition*) 93 100 { -
trunk/source/processes/electromagnetic/standard/src/G4IonFluctuations.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4IonFluctuations.cc,v 1.2 4 2008/10/22 16:25:21vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4IonFluctuations.cc,v 1.25 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 420 420 421 421 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 422 423 void G4IonFluctuations::SetParticleAndCharge(const G4ParticleDefinition* part, 424 G4double q2) 425 { 426 if(part != particle) { 427 particle = part; 428 particleMass = part->GetPDGMass(); 429 charge = part->GetPDGCharge()/eplus; 430 chargeSquare = charge*charge; 431 } 432 effChargeSquare = q2; 433 uniFluct.SetParticleAndCharge(part, q2); 434 } 435 436 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... -
trunk/source/processes/electromagnetic/standard/src/G4MollerBhabhaModel.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4MollerBhabhaModel.cc,v 1.3 0 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4MollerBhabhaModel.cc,v 1.31 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 74 74 const G4String& nam) 75 75 : G4VEmModel(nam), 76 particle(0), 77 isElectron(true), 78 twoln10(2.0*log(10.0)), 79 lowLimit(0.2*keV) 76 particle(0), 77 isElectron(true), 78 twoln10(2.0*log(10.0)), 79 lowLimit(0.2*keV), 80 isInitialised(false) 80 81 { 81 82 theElectron = G4Electron::Electron(); … … 87 88 G4MollerBhabhaModel::~G4MollerBhabhaModel() 88 89 {} 89 90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......91 92 void G4MollerBhabhaModel::SetParticle(const G4ParticleDefinition* p)93 {94 particle = p;95 if(p != theElectron) isElectron = false;96 }97 90 98 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 108 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 109 102 103 G4double G4MollerBhabhaModel::MaxSecondaryEnergy(const G4ParticleDefinition*, 104 G4double kinEnergy) 105 { 106 G4double tmax = kinEnergy; 107 if(isElectron) tmax *= 0.5; 108 return tmax; 109 } 110 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 112 110 113 void G4MollerBhabhaModel::Initialise(const G4ParticleDefinition* p, 111 114 const G4DataVector&) 112 115 { 113 116 if(!particle) SetParticle(p); 114 if(pParticleChange) 117 SetDeexcitationFlag(false); 118 119 if(isInitialised) return; 120 121 isInitialised = true; 122 if(pParticleChange) { 115 123 fParticleChange = reinterpret_cast<G4ParticleChangeForLoss*> 116 124 (pParticleChange); 117 else125 } else { 118 126 fParticleChange = new G4ParticleChangeForLoss(); 127 } 119 128 } 120 129 -
trunk/source/processes/electromagnetic/standard/src/G4PAIModel.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PAIModel.cc,v 1.46 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 // 29 // ------------------------------------------------------------------- 30 // 31 // GEANT4 Class 26 32 // File name: G4PAIModel.cc 27 33 // … … 177 183 fCutCouple = theCoupleTable->GetMaterialCutsCouple( fMaterial, 178 184 curReg->GetProductionCuts() ); 185 //G4cout << "Reg <" <<curReg->GetName() << "> mat <" 186 // << fMaterial->GetName() << "> fCouple= " 187 // << fCutCouple<<G4endl; 179 188 if( fCutCouple ) { 180 189 fMaterialCutsCoupleVector.push_back(fCutCouple); … … 197 206 } 198 207 } 208 209 ////////////////////////////////////////////////////////////////// 210 211 void G4PAIModel::InitialiseMe(const G4ParticleDefinition*) 212 {} 199 213 200 214 ////////////////////////////////////////////////////////////////// … … 393 407 { 394 408 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 395 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 409 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 410 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 396 411 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 397 412 } … … 435 450 { 436 451 // if ( x1 == x2 ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 437 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 452 // if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 453 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*0.5 ; 438 454 else dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 439 455 } … … 444 460 ////////////////////////////////////////////////////////////////////////////// 445 461 446 G4double G4PAIModel::ComputeDEDX (const G4MaterialCutsCouple* matCC,447 448 449 462 G4double G4PAIModel::ComputeDEDXPerVolume(const G4Material*, 463 const G4ParticleDefinition* p, 464 G4double kineticEnergy, 465 G4double cutEnergy) 450 466 { 451 467 G4int iTkin,iPlace; 452 468 size_t jMat; 469 470 //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy); 471 G4double cut = cutEnergy; 472 453 473 G4double massRatio = fMass/p->GetPDGMass(); 454 474 G4double scaledTkin = kineticEnergy*massRatio; 455 475 G4double charge = p->GetPDGCharge(); 456 G4double charge2 = charge*charge, dEdx; 476 G4double charge2 = charge*charge; 477 const G4MaterialCutsCouple* matCC = CurrentCouple(); 457 478 458 479 for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat ) … … 470 491 iPlace = iTkin - 1; 471 492 if(iPlace < 0) iPlace = 0; 472 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ; 473 493 G4double dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) ); 474 494 if( dEdx < 0.) dEdx = 0.; 475 495 return dEdx; … … 478 498 ///////////////////////////////////////////////////////////////////////// 479 499 480 G4double G4PAIModel::CrossSection ( const G4MaterialCutsCouple* matCC,481 482 483 484 500 G4double G4PAIModel::CrossSectionPerVolume( const G4Material*, 501 const G4ParticleDefinition* p, 502 G4double kineticEnergy, 503 G4double cutEnergy, 504 G4double maxEnergy ) 485 505 { 486 506 G4int iTkin,iPlace; 487 507 size_t jMat; 488 G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 508 G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 509 if(tmax <= cutEnergy) return 0.0; 489 510 G4double massRatio = fMass/p->GetPDGMass(); 490 511 G4double scaledTkin = kineticEnergy*massRatio; 491 512 G4double charge = p->GetPDGCharge(); 492 513 G4double charge2 = charge*charge, cross, cross1, cross2; 514 const G4MaterialCutsCouple* matCC = CurrentCouple(); 493 515 494 516 for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat ) … … 935 957 } 936 958 959 ///////////////////////////////////////////////////////////////////// 960 961 G4double G4PAIModel::MaxSecondaryEnergy( const G4ParticleDefinition* p, 962 G4double kinEnergy) 963 { 964 G4double tmax = kinEnergy; 965 if(p == fElectron) tmax *= 0.5; 966 else if(p != fPositron) { 967 G4double mass = p->GetPDGMass(); 968 G4double ratio= electron_mass_c2/mass; 969 G4double gamma= kinEnergy/mass + 1.0; 970 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) / 971 (1. + 2.0*gamma*ratio + ratio*ratio); 972 } 973 return tmax; 974 } 975 976 /////////////////////////////////////////////////////////////// 977 978 void G4PAIModel::DefineForRegion(const G4Region* r) 979 { 980 fPAIRegionVector.push_back(r); 981 } 937 982 938 983 // -
trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PAIPhotonModel.cc,v 1.21 2009/02/19 19:17:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 // 29 // ------------------------------------------------------------------- 30 // 31 // GEANT4 Class 26 32 // File name: G4PAIPhotonModel.cc 27 33 // … … 217 223 ////////////////////////////////////////////////////////////////// 218 224 225 void G4PAIPhotonModel::InitialiseMe(const G4ParticleDefinition*) 226 {} 227 228 ////////////////////////////////////////////////////////////////// 229 219 230 void G4PAIPhotonModel::ComputeSandiaPhotoAbsCof() 220 231 { … … 487 498 { 488 499 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 489 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 500 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 501 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 490 502 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 491 503 } … … 530 542 { 531 543 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 532 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 544 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 545 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 533 546 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 534 547 } … … 574 587 { 575 588 // if ( x1 == x2 ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 576 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 589 // if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ; 590 if ( std::abs(x1-x2) <= eV ) dNdxCut = y1 + (y2 - y1)*0.5 ; 577 591 else dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 578 592 } … … 617 631 { 618 632 // if ( x1 == x2 ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 619 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 633 // if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ; 634 if ( std::abs(x1-x2) <= eV ) dEdxCut = y1 + (y2 - y1)*0.5 ; 620 635 else dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ; 621 636 } … … 626 641 ////////////////////////////////////////////////////////////////////////////// 627 642 628 G4double G4PAIPhotonModel::ComputeDEDX (const G4MaterialCutsCouple* matCC,629 630 631 643 G4double G4PAIPhotonModel::ComputeDEDXPerVolume(const G4Material*, 644 const G4ParticleDefinition* p, 645 G4double kineticEnergy, 646 G4double cutEnergy) 632 647 { 633 648 G4int iTkin,iPlace; 634 649 size_t jMat; 650 651 //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy); 652 G4double cut = cutEnergy; 653 635 654 G4double particleMass = p->GetPDGMass(); 636 655 G4double scaledTkin = kineticEnergy*proton_mass_c2/particleMass; … … 638 657 G4double charge2 = charge*charge; 639 658 G4double dEdx = 0.; 659 const G4MaterialCutsCouple* matCC = CurrentCouple(); 640 660 641 661 for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat ) … … 653 673 iPlace = iTkin - 1; 654 674 if(iPlace < 0) iPlace = 0; 655 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut Energy) ) ;675 dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) ) ; 656 676 657 677 if( dEdx < 0.) dEdx = 0.; … … 661 681 ///////////////////////////////////////////////////////////////////////// 662 682 663 G4double G4PAIPhotonModel::CrossSection ( const G4MaterialCutsCouple* matCC,664 665 666 667 683 G4double G4PAIPhotonModel::CrossSectionPerVolume( const G4Material*, 684 const G4ParticleDefinition* p, 685 G4double kineticEnergy, 686 G4double cutEnergy, 687 G4double maxEnergy ) 668 688 { 669 689 G4int iTkin,iPlace; 670 690 size_t jMat, jMatCC; 671 G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 691 G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy); 692 if(cutEnergy >= tmax) return 0.0; 672 693 G4double particleMass = p->GetPDGMass(); 673 694 G4double scaledTkin = kineticEnergy*proton_mass_c2/particleMass; … … 675 696 G4double charge2 = charge*charge, cross, cross1, cross2; 676 697 G4double photon1, photon2, plasmon1, plasmon2; 698 699 const G4MaterialCutsCouple* matCC = CurrentCouple(); 677 700 678 701 const G4ProductionCutsTable* theCoupleTable= … … 1225 1248 } 1226 1249 1250 ///////////////////////////////////////////////////////////////////// 1251 1252 G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition* p, 1253 G4double kinEnergy) 1254 { 1255 G4double tmax = kinEnergy; 1256 if(p == fElectron) tmax *= 0.5; 1257 else if(p != fPositron) { 1258 G4double mass = p->GetPDGMass(); 1259 G4double ratio= electron_mass_c2/mass; 1260 G4double gamma= kinEnergy/mass + 1.0; 1261 tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) / 1262 (1. + 2.0*gamma*ratio + ratio*ratio); 1263 } 1264 return tmax; 1265 } 1266 1267 /////////////////////////////////////////////////////////////// 1268 1269 void G4PAIPhotonModel::DefineForRegion(const G4Region* r) 1270 { 1271 fPAIRegionVector.push_back(r); 1272 } 1273 1227 1274 1228 1275 // -
trunk/source/processes/electromagnetic/standard/src/G4PEEffectModel.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PEEffectModel.cc,v 1. 6 2007/05/22 17:34:36vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4PEEffectModel.cc,v 1.7 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 41 41 // 42 42 // 04.12.05 : SetProposedKineticEnergy(0.) for the killed photon (mma) 43 // 20.02.09 : Added initialisation of deexcitation flag and method 44 // CrossSectionPerVolume instead of mfp (V.Ivanchenko) 43 45 // 44 46 // Class Description: … … 66 68 theGamma = G4Gamma::Gamma(); 67 69 theElectron = G4Electron::Electron(); 70 fminimalEnergy = 1.0*eV; 68 71 } 69 72 … … 71 74 72 75 G4PEEffectModel::~G4PEEffectModel() 73 { 74 } 76 {} 75 77 76 78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 79 81 const G4DataVector&) 80 82 { 81 if (isInitialized) return; 82 if (pParticleChange) 83 fParticleChange = 84 reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 85 else 86 fParticleChange = new G4ParticleChangeForGamma(); 87 88 fminimalEnergy = 1.0*eV; 83 // always false before the run 84 SetDeexcitationFlag(false); 85 86 if (isInitialized) return; 87 if (pParticleChange) { 88 fParticleChange = reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange); 89 } else { 90 fParticleChange = new G4ParticleChangeForGamma(); 91 } 92 isInitialized = true; 93 } 94 95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 96 97 G4double G4PEEffectModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 98 G4double energy, 99 G4double Z, G4double, 100 G4double, G4double) 101 { 102 G4double* SandiaCof = G4SandiaTable::GetSandiaCofPerAtom((G4int)Z, energy); 103 104 G4double energy2 = energy*energy; 105 G4double energy3 = energy*energy2; 106 G4double energy4 = energy2*energy2; 107 108 return SandiaCof[0]/energy + SandiaCof[1]/energy2 + 109 SandiaCof[2]/energy3 + SandiaCof[3]/energy4; 110 } 111 112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 113 114 G4double G4PEEffectModel::CrossSectionPerVolume(const G4Material* material, 115 const G4ParticleDefinition*, 116 G4double energy, 117 G4double, G4double) 118 { 119 G4double* SandiaCof = 120 material->GetSandiaTable()->GetSandiaCofForMaterial(energy); 121 122 G4double energy2 = energy*energy; 123 G4double energy3 = energy*energy2; 124 G4double energy4 = energy2*energy2; 125 126 return SandiaCof[0]/energy + SandiaCof[1]/energy2 + 127 SandiaCof[2]/energy3 + SandiaCof[3]/energy4; 89 128 } 90 129 -
trunk/source/processes/electromagnetic/standard/src/G4PhotoElectricEffect.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PhotoElectricEffect.cc,v 1.4 1 2008/10/16 14:12:32vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4PhotoElectricEffect.cc,v 1.42 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // … … 89 89 {} 90 90 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 93 G4bool G4PhotoElectricEffect::IsApplicable(const G4ParticleDefinition& p) 94 { 95 return (&p == G4Gamma::Gamma()); 96 } 97 91 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 92 99 -
trunk/source/processes/electromagnetic/standard/src/G4UniversalFluctuation.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4UniversalFluctuation.cc,v 1.1 6 2008/10/22 16:04:33vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4UniversalFluctuation.cc,v 1.17 2009/02/19 11:26:01 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 305 305 } 306 306 307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 308 309 void 310 G4UniversalFluctuation::SetParticleAndCharge(const G4ParticleDefinition* part, 311 G4double q2) 312 { 313 if(part != particle) { 314 particle = part; 315 particleMass = part->GetPDGMass(); 316 } 317 chargeSquare = q2; 318 } 319 320 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -
trunk/source/processes/electromagnetic/standard/src/G4WentzelVIModel.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4WentzelVIModel.cc,v 1.1 6 2008/11/19 11:47:50vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4WentzelVIModel.cc,v 1.17 2009/02/19 19:17:15 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 60 60 #include "G4LossTableManager.hh" 61 61 #include "G4ParticleChangeForMSC.hh" 62 #include "G4TransportationManager.hh"63 #include "G4SafetyHelper.hh"62 //#include "G4TransportationManager.hh" 63 //#include "G4SafetyHelper.hh" 64 64 #include "G4PhysicsTableHelper.hh" 65 65 #include "G4ElementVector.hh" … … 138 138 fParticleChange = new G4ParticleChangeForMSC(); 139 139 140 safetyHelper = G4TransportationManager::GetTransportationManager() 141 ->GetSafetyHelper(); 142 safetyHelper->InitialiseHelper(); 140 InitialiseSafetyHelper(); 143 141 } 144 142 } … … 277 275 // i.e. when it is needed for optimization purposes 278 276 if(stepStatus != fGeomBoundary && presafety < tlimitminfix) 279 presafety = safetyHelper->ComputeSafety(sp->GetPosition());277 presafety = ComputeSafety(sp->GetPosition(), tlimit); 280 278 /* 281 279 G4cout << "G4WentzelVIModel::ComputeTruePathLengthLimit tlimit= " … … 570 568 571 569 if(r > tlimitminfix) { 572 G4ThreeVector Position = *(fParticleChange->GetProposedPosition()); 573 G4double fac= 1.; 574 if(r >= safety) { 575 // ******* so safety is computed at boundary too ************ 576 G4double newsafety = 577 safetyHelper->ComputeSafety(Position) - tlimitminfix; 578 if(newsafety <= 0.0) fac = 0.0; 579 else if(r > newsafety) fac = newsafety/r ; 580 //G4cout << "NewSafety= " << newsafety << " fac= " << fac 581 // << " r= " << r << " sint= " << sint << " pos " << Position << G4endl; 582 } 583 584 if(fac > 0.) { 585 // compute new endpoint of the Step 586 G4ThreeVector newPosition = Position + fac*pos; 587 588 // check safety after displacement 589 G4double postsafety = safetyHelper->ComputeSafety(newPosition); 590 591 // displacement to boundary 592 if(postsafety <= 0.0) { 593 safetyHelper->Locate(newPosition, newDirection); 594 595 // not on the boundary 596 } else { 597 safetyHelper->ReLocateWithinVolume(newPosition); 598 // if(fac < 1.0) G4cout << "NewPosition " << newPosition << G4endl; 599 } 600 601 fParticleChange->ProposePosition(newPosition); 602 } 570 pos /= r; 571 ComputeDisplacement(fParticleChange, pos, r, safety); 603 572 } 604 573 } -
trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlung.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlung.cc,v 1.5 5 2008/11/14 19:23:07 vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4eBremsstrahlung.cc,v 1.56 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 104 104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 105 105 106 G4bool G4eBremsstrahlung::IsApplicable(const G4ParticleDefinition& p) 107 { 108 return (&p == G4Electron::Electron() || &p == G4Positron::Positron()); 109 } 110 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 112 106 113 void G4eBremsstrahlung::InitialiseEnergyLossProcess( 107 114 const G4ParticleDefinition* p, -
trunk/source/processes/electromagnetic/standard/src/G4eBremsstrahlungRelModel.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eBremsstrahlungRelModel.cc,v 1.1 2 2008/11/13 23:28:27 schaelicExp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4eBremsstrahlungRelModel.cc,v 1.13 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/standard/src/G4eIonisation.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eIonisation.cc,v 1.5 6 2008/10/20 08:56:41vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4eIonisation.cc,v 1.57 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 103 103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 104 104 105 G4double G4eIonisation::MinPrimaryEnergy(const G4ParticleDefinition*, 106 const G4Material*, 107 G4double cut) 108 { 109 G4double x = cut; 110 if(isElectron) x += cut; 111 return x; 112 } 113 114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 115 116 G4bool G4eIonisation::IsApplicable(const G4ParticleDefinition& p) 117 { 118 return (&p == G4Electron::Electron() || &p == G4Positron::Positron()); 119 } 120 121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 122 105 123 void G4eIonisation::InitialiseEnergyLossProcess( 106 124 const G4ParticleDefinition* part, -
trunk/source/processes/electromagnetic/standard/src/G4eplusAnnihilation.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4eplusAnnihilation.cc,v 1. 29 2008/10/15 17:53:44vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4eplusAnnihilation.cc,v 1.30 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 79 79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 80 80 81 G4bool G4eplusAnnihilation::IsApplicable(const G4ParticleDefinition& p) 82 { 83 return (&p == G4Positron::Positron()); 84 } 85 86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 87 88 G4double G4eplusAnnihilation::AtRestGetPhysicalInteractionLength( 89 const G4Track&, G4ForceCondition* condition) 90 { 91 *condition = NotForced; 92 return 0.0; 93 } 94 95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 96 81 97 void G4eplusAnnihilation::InitialiseProcess(const G4ParticleDefinition*) 82 98 { -
trunk/source/processes/electromagnetic/standard/src/G4hIonisation.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4hIonisation.cc,v 1.8 1 2008/10/22 16:02:20vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4hIonisation.cc,v 1.82 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 122 122 {} 123 123 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 126 G4bool G4hIonisation::IsApplicable(const G4ParticleDefinition& p) 127 { 128 return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 10.0*MeV && 129 !p.IsShortLived()); 130 } 131 132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 133 134 G4double G4hIonisation::MinPrimaryEnergy(const G4ParticleDefinition*, 135 const G4Material*, 136 G4double cut) 137 { 138 G4double x = 0.5*cut/electron_mass_c2; 139 G4double g = x*ratio + std::sqrt((1. + x)*(1. + x*ratio*ratio)); 140 return mass*(g - 1.0); 141 } 142 124 143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 144 -
trunk/source/processes/electromagnetic/standard/src/G4ionIonisation.cc
r991 r1005 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ionIonisation.cc,v 1.6 5 2008/10/15 17:53:44vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-02 $26 // $Id: G4ionIonisation.cc,v 1.66 2009/02/20 12:06:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 104 104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 105 105 106 G4bool G4ionIonisation::IsApplicable(const G4ParticleDefinition& p) 107 { 108 return (p.GetPDGCharge() != 0.0 && !p.IsShortLived() && 109 p.GetParticleType() == "nucleus"); 110 } 111 112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 113 114 G4double G4ionIonisation::MinPrimaryEnergy(const G4ParticleDefinition* p, 115 const G4Material*, 116 G4double cut) 117 { 118 return 119 p->GetPDGMass()*(std::sqrt(1. + 0.5*cut/CLHEP::electron_mass_c2) - 1.0); 120 } 121 122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 123 106 124 void G4ionIonisation::InitialiseEnergyLossProcess( 107 125 const G4ParticleDefinition* part,
Note: See TracChangeset
for help on using the changeset viewer.