Changeset 1196 for trunk/source/processes/electromagnetic/utils/include
- Timestamp:
- Nov 25, 2009, 5:13:58 PM (16 years ago)
- Location:
- trunk/source/processes/electromagnetic/utils/include
- Files:
-
- 25 edited
-
G4DummyModel.hh (modified) (1 diff)
-
G4ElectronIonPair.hh (modified) (1 diff)
-
G4EmCalculator.hh (modified) (8 diffs)
-
G4EmConfigurator.hh (modified) (1 diff)
-
G4EmCorrections.hh (modified) (1 diff)
-
G4EmElementSelector.hh (modified) (2 diffs)
-
G4EmModelManager.hh (modified) (8 diffs)
-
G4EmMultiModel.hh (modified) (1 diff)
-
G4EmProcessOptions.hh (modified) (2 diffs)
-
G4EmProcessSubType.hh (modified) (1 diff)
-
G4EmSaturation.hh (modified) (2 diffs)
-
G4EmTableType.hh (modified) (1 diff)
-
G4EnergyLossMessenger.hh (modified) (2 diffs)
-
G4EnergyLossTables.hh (modified) (1 diff)
-
G4LossTableBuilder.hh (modified) (1 diff)
-
G4LossTableManager.hh (modified) (4 diffs)
-
G4MscStepLimitType.hh (modified) (1 diff)
-
G4VEmFluctuationModel.hh (modified) (1 diff)
-
G4VEmModel.hh (modified) (10 diffs)
-
G4VEmProcess.hh (modified) (15 diffs)
-
G4VEnergyLoss.hh (modified) (1 diff)
-
G4VEnergyLossProcess.hh (modified) (12 diffs)
-
G4VMscModel.hh (modified) (1 diff)
-
G4VMultipleScattering.hh (modified) (11 diffs)
-
G4ionEffectiveCharge.hh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/utils/include/G4DummyModel.hh
r1055 r1196 25 25 // 26 26 // $Id: G4DummyModel.hh,v 1.4 2009/04/07 18:39:47 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4ElectronIonPair.hh
r1007 r1196 25 25 // 26 26 // $Id: G4ElectronIonPair.hh,v 1.2 2008/10/17 14:46:16 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 2$27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // -
trunk/source/processes/electromagnetic/utils/include/G4EmCalculator.hh
r1007 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmCalculator.hh,v 1.1 8 2007/03/15 12:34:46vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4EmCalculator.hh,v 1.19 2009/11/11 23:59:48 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // … … 60 60 #include "globals.hh" 61 61 #include "G4DataVector.hh" 62 #include "G4DynamicParticle.hh" 62 63 63 64 class G4LossTableManager; … … 82 83 ~G4EmCalculator(); 83 84 85 //================================================================================== 84 86 // Methods to access precalculated dE/dx and cross sections 85 87 // Materials should exist in the list of the G4MaterialCutsCouple 88 //================================================================================== 86 89 87 90 G4double GetDEDX(G4double kinEnergy, const G4ParticleDefinition*, const G4Material*, … … 136 139 void PrintInverseRangeTable(const G4ParticleDefinition*); 137 140 141 //================================================================================== 138 142 // Methods to calculate dE/dx and cross sections "on fly" 139 143 // Existing tables and G4MaterialCutsCouples are not used 144 //================================================================================== 140 145 141 146 G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition*, … … 150 155 const G4String& mat, G4double cut = DBL_MAX); 151 156 152 G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition*, const G4Material*); 153 G4double ComputeNuclearDEDX(G4double kinEnergy, const G4String& part, const G4String& mat); 157 G4double ComputeNuclearDEDX(G4double kinEnergy, const G4ParticleDefinition*, 158 const G4Material*); 159 G4double ComputeNuclearDEDX(G4double kinEnergy, const G4String& part, 160 const G4String& mat); 154 161 155 162 G4double ComputeTotalDEDX(G4double kinEnergy, const G4ParticleDefinition*, … … 190 197 const G4String&); 191 198 199 //================================================================================== 200 // Methods to access particles, materials, regions 201 //================================================================================== 202 192 203 const G4ParticleDefinition* FindParticle(const G4String&); 193 204 205 const G4ParticleDefinition* FindIon(G4int Z, G4int A); 206 194 207 const G4Material* FindMaterial(const G4String&); 195 208 … … 199 212 200 213 void SetVerbose(G4int val); 214 215 //================================================================================== 216 // Private methods 217 //================================================================================== 201 218 202 219 private: … … 240 257 const G4ParticleDefinition* theGenericIon; 241 258 G4ionEffectiveCharge* ionEffCharge; 259 G4DynamicParticle dynParticle; 242 260 243 261 G4String currentName; -
trunk/source/processes/electromagnetic/utils/include/G4EmConfigurator.hh
r1007 r1196 25 25 // 26 26 // $Id: G4EmConfigurator.hh,v 1.2 2008/11/21 12:30:29 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 2$27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4EmCorrections.hh
r1007 r1196 25 25 // 26 26 // $Id: G4EmCorrections.hh,v 1.24 2008/09/12 14:44:48 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 2$27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4EmElementSelector.hh
r1055 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmElementSelector.hh,v 1. 4 2009/05/10 18:26:43vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $26 // $Id: G4EmElementSelector.hh,v 1.6 2009/09/29 11:31:37 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 109 109 { 110 110 if (nElmMinusOne > 0) { 111 G4bool b;112 111 G4double x = G4UniformRand(); 113 for(G4int i=0; i<nElmMinusOne; i++) { 114 if (x <= (xSections[i])->GetValue(e,b)) { 112 element = (*theElementVector)[nElmMinusOne]; 113 for(G4int i=0; i<nElmMinusOne; ++i) { 114 if (x <= (xSections[i])->Value(e)) { 115 115 element = (*theElementVector)[i]; 116 116 break; -
trunk/source/processes/electromagnetic/utils/include/G4EmModelManager.hh
r1055 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmModelManager.hh,v 1. 28 2009/04/09 15:53:17vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $26 // $Id: G4EmModelManager.hh,v 1.34 2009/08/11 10:29:30 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 54 54 // 15-03-07 Add maxCutInRange (V.Ivanchenko) 55 55 // 08-04-08 Simplify Select method for only one G4RegionModel (VI) 56 // 03-08-09 Removed unused members and simplify model search if only one 57 // model is used (VI) 56 58 // 57 59 // Class Description: … … 96 98 if (nModelsForRegion>1) { 97 99 idx = nModelsForRegion; 98 do { idx--;} while (idx&& e <= lowKineticEnergy[idx]);100 do {--idx;} while (idx > 0 && e <= lowKineticEnergy[idx]); 99 101 } 100 102 return theListOfModelIndexes[idx]; … … 130 132 class G4Region; 131 133 class G4ParticleDefinition; 132 class G4DataVector;133 134 class G4PhysicsVector; 134 135 class G4MaterialCutsCouple; … … 174 175 175 176 private: 177 178 inline G4double ComputeDEDX(G4VEmModel* model, 179 const G4MaterialCutsCouple*, 180 G4double kinEnergy, 181 G4double cutEnergy, 182 G4double minEnergy); 176 183 177 184 // hide assignment operator … … 195 202 G4int nEmModels; 196 203 G4int nRegions; 197 G4int nCouples; 198 199 G4int* idxOfRegionModels; 200 G4RegionModels** setOfRegionModels; 201 202 G4double minSubRange; 203 G4double maxCutInRange; 204 205 std::vector<G4int> idxOfRegionModels; 206 std::vector<G4RegionModels*> setOfRegionModels; 207 204 208 G4double maxSubCutInRange; 205 209 206 210 const G4ParticleDefinition* particle; 207 const G4ParticleDefinition* secondaryParticle;208 const G4ParticleDefinition* theGamma;209 const G4ParticleDefinition* thePositron;210 211 211 212 G4int verboseLevel; 213 G4bool severalModels; 212 214 213 215 // may be changed in run time 214 216 G4RegionModels* currRegionModel; 217 G4VEmModel* currModel; 215 218 }; 216 219 … … 221 224 size_t& index) 222 225 { 223 if(nRegions > 1) currRegionModel = setOfRegionModels[idxOfRegionModels[index]]; 224 return models[currRegionModel->SelectIndex(kinEnergy)]; 226 if(severalModels) { 227 if(nRegions > 1) { 228 currRegionModel = setOfRegionModels[idxOfRegionModels[index]]; 229 } 230 currModel = models[currRegionModel->SelectIndex(kinEnergy)]; 231 } 232 return currModel; 225 233 } 226 234 … … 248 256 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 249 257 258 inline G4double 259 G4EmModelManager::ComputeDEDX(G4VEmModel* model, 260 const G4MaterialCutsCouple* couple, 261 G4double e, 262 G4double cut, 263 G4double emin) 264 { 265 G4double dedx = 0.0; 266 if(model && cut > emin) { 267 dedx = model->ComputeDEDX(couple,particle,e,cut); 268 if(emin > 0.0) {dedx -= model->ComputeDEDX(couple,particle,e,emin);} 269 } 270 return dedx; 271 } 272 273 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 274 250 275 #endif 251 276 -
trunk/source/processes/electromagnetic/utils/include/G4EmMultiModel.hh
r1007 r1196 25 25 // 26 26 // $Id: G4EmMultiModel.hh,v 1.6 2007/05/22 17:31:57 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 2$27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4EmProcessOptions.hh
r1055 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmProcessOptions.hh,v 1.1 5 2009/02/18 14:40:10vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $26 // $Id: G4EmProcessOptions.hh,v 1.16 2009/10/29 19:25:28 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // … … 128 128 void SetPolarAngleLimit(G4double val); 129 129 130 void SetFactorForAngleLimit(G4double val); 131 130 132 private: 131 133 -
trunk/source/processes/electromagnetic/utils/include/G4EmProcessSubType.hh
r1007 r1196 26 26 // 27 27 // $Id: G4EmProcessSubType.hh,v 1.9 2008/12/18 13:01:42 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2$28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //--------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4EmSaturation.hh
r1007 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmSaturation.hh,v 1. 6 2008/03/17 11:27:32vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 2$26 // $Id: G4EmSaturation.hh,v 1.7 2009/09/25 09:16:40 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // … … 104 104 void Initialise(); 105 105 106 const G4ParticleDefinition* gamma;107 106 const G4ParticleDefinition* electron; 108 const G4ParticleDefinition* neutron;109 107 const G4ParticleDefinition* proton; 110 108 G4LossTableManager* manager; -
trunk/source/processes/electromagnetic/utils/include/G4EmTableType.hh
r1007 r1196 26 26 // 27 27 // $Id: G4EmTableType.hh,v 1.4 2008/10/13 14:56:56 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2$28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //--------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4EnergyLossMessenger.hh
r1055 r1196 25 25 // 26 26 // 27 // $Id: G4EnergyLossMessenger.hh,v 1.2 3 2009/02/18 14:40:10vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // $Id: G4EnergyLossMessenger.hh,v 1.24 2009/10/29 19:25:28 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ------------------------------------------------------------------- … … 126 126 G4UIcmdWithADouble* frCmd; 127 127 G4UIcmdWithADouble* fgCmd; 128 G4UIcmdWithADouble* mscfCmd; 128 129 G4UIcmdWithADoubleAndUnit* angCmd; 129 130 }; -
trunk/source/processes/electromagnetic/utils/include/G4EnergyLossTables.hh
r1007 r1196 26 26 // 27 27 // $Id: G4EnergyLossTables.hh,v 1.19 2006/06/29 19:54:35 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2$28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // $Id: -
trunk/source/processes/electromagnetic/utils/include/G4LossTableBuilder.hh
r1007 r1196 25 25 // 26 26 // $Id: G4LossTableBuilder.hh,v 1.8 2008/07/22 15:55:15 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 2$27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // -
trunk/source/processes/electromagnetic/utils/include/G4LossTableManager.hh
r1055 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4LossTableManager.hh,v 1.5 4 2009/04/09 16:10:57vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $26 // $Id: G4LossTableManager.hh,v 1.55 2009/10/29 19:25:28 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // … … 210 210 void SetBremsstrahlungTh(G4double val); 211 211 212 void SetFactorForAngleLimit(G4double val); 213 212 214 void SetVerbose(G4int val); 213 215 … … 221 223 222 224 G4double BremsstrahlungTh() const; 225 226 G4double FactorForAngleLimit() const; 223 227 224 228 const std::vector<G4VEnergyLossProcess*>& GetEnergyLossProcessVector(); … … 302 306 G4double maxKinEnergyForMuons; 303 307 G4double bremsTh; 308 G4double factorForAngleLimit; 304 309 305 310 G4LossTableBuilder* tableBuilder; -
trunk/source/processes/electromagnetic/utils/include/G4MscStepLimitType.hh
r1007 r1196 26 26 // 27 27 // $Id: G4MscStepLimitType.hh,v 1.2 2007/06/11 14:56:51 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2$28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 //--------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4VEmFluctuationModel.hh
r1055 r1196 25 25 // 26 26 // $Id: G4VEmFluctuationModel.hh,v 1.12 2009/02/19 11:25:50 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4VEmModel.hh
r1055 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEmModel.hh,v 1. 69 2009/05/26 15:00:49vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $26 // $Id: G4VEmModel.hh,v 1.72 2009/09/23 14:42:47 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 137 137 G4double maxEnergy = DBL_MAX); 138 138 139 // main method to compute cross section depending onatom139 // main method to compute cross section per atom 140 140 virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 141 141 G4double kinEnergy, … … 159 159 G4double kineticEnergy); 160 160 161 // add correction to energy loss and ompute non-ionizing energy loss161 // add correction to energy loss and compute non-ionizing energy loss 162 162 virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*, 163 163 const G4DynamicParticle*, … … 171 171 G4double& eloss); 172 172 173 // add region for the model 174 virtual void DefineForRegion(const G4Region*); 175 176 // initilisation at run time for given material 173 // initilisation at run time for a given material 177 174 virtual void SetupForMaterial(const G4ParticleDefinition*, 178 175 const G4Material*, 179 176 G4double kineticEnergy); 177 178 // add a region for the model 179 virtual void DefineForRegion(const G4Region*); 180 180 181 181 protected: … … 209 209 // cross section per volume 210 210 inline G4double CrossSection(const G4MaterialCutsCouple*, 211 const G4ParticleDefinition*,212 G4double kineticEnergy,213 G4double cutEnergy = 0.0,214 G4double maxEnergy = DBL_MAX);211 const G4ParticleDefinition*, 212 G4double kineticEnergy, 213 G4double cutEnergy = 0.0, 214 G4double maxEnergy = DBL_MAX); 215 215 216 216 // compute mean free path via cross section per volume … … 267 267 inline void SetLowEnergyLimit(G4double); 268 268 269 inline void SetActivationHighEnergyLimit(G4double); 270 271 inline void SetActivationLowEnergyLimit(G4double); 272 273 inline G4bool IsActive(G4double kinEnergy); 274 269 275 inline void SetPolarAngleLimit(G4double); 270 276 … … 308 314 G4double lowLimit; 309 315 G4double highLimit; 316 G4double eMinActive; 317 G4double eMaxActive; 310 318 G4double polarAngleLimit; 311 319 G4double secondaryThreshold; … … 434 442 inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm) 435 443 { 444 currentElement = elm; 436 445 G4int N = G4int(elm->GetN() + 0.5); 437 446 G4int ni = elm->GetNumberOfIsotopes(); … … 439 448 G4int idx = 0; 440 449 if(ni > 1) { 441 G4double* ab = currentElement->GetRelativeAbundanceVector();450 G4double* ab = elm->GetRelativeAbundanceVector(); 442 451 G4double x = G4UniformRand(); 443 452 for(; idx<ni; idx++) { … … 517 526 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 518 527 528 inline void G4VEmModel::SetActivationHighEnergyLimit(G4double val) 529 { 530 eMaxActive = val; 531 } 532 533 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 534 535 inline void G4VEmModel::SetActivationLowEnergyLimit(G4double val) 536 { 537 eMinActive = val; 538 } 539 540 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 541 542 inline G4bool G4VEmModel::IsActive(G4double kinEnergy) 543 { 544 return (kinEnergy >= eMinActive && kinEnergy <= eMaxActive); 545 } 546 547 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 548 519 549 inline void G4VEmModel::SetPolarAngleLimit(G4double val) 520 550 { -
trunk/source/processes/electromagnetic/utils/include/G4VEmProcess.hh
r1055 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEmProcess.hh,v 1.5 1 2009/04/07 18:39:47 vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $26 // $Id: G4VEmProcess.hh,v 1.55 2009/09/23 14:42:47 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 202 202 protected: 203 203 // Select model in run time 204 inline void SelectModel(G4double& kinEnergy);204 inline G4VEmModel* SelectModel(G4double& kinEnergy, size_t index); 205 205 206 206 public: … … 344 344 const G4Material* currentMaterial; 345 345 const G4MaterialCutsCouple* currentCouple; 346 size_t current MaterialIndex;346 size_t currentCoupleIndex; 347 347 348 348 G4double mfpKinEnergy; … … 358 358 G4double kineticEnergy, G4double Z, G4double A, G4double cut) 359 359 { 360 SelectModel(kineticEnergy );360 SelectModel(kineticEnergy, currentCoupleIndex); 361 361 G4double x = 0.0; 362 362 if(currentModel) { … … 468 468 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 469 469 470 inline void G4VEmProcess::SelectModel(G4double& kinEnergy) 471 { 472 currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex); 470 inline 471 G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy, size_t index) 472 { 473 currentModel = modelManager->SelectModel(kinEnergy, index); 473 474 currentModel->SetCurrentCouple(currentCouple); 474 } 475 476 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 477 478 inline G4VEmModel* G4VEmProcess::SelectModelForMaterial( 479 G4double kinEnergy, size_t& idxRegion) const 475 return currentModel; 476 } 477 478 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 479 480 inline 481 G4VEmModel* G4VEmProcess::SelectModelForMaterial(G4double kinEnergy, 482 size_t& idxRegion) const 480 483 { 481 484 return modelManager->SelectModel(kinEnergy, idxRegion); … … 545 548 inline size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex() const 546 549 { 547 return current MaterialIndex;550 return currentCoupleIndex; 548 551 } 549 552 … … 552 555 inline G4double G4VEmProcess::GetGammaEnergyCut() 553 556 { 554 return (*theCutsGamma)[current MaterialIndex];557 return (*theCutsGamma)[currentCoupleIndex]; 555 558 } 556 559 … … 559 562 inline G4double G4VEmProcess::GetElectronEnergyCut() 560 563 { 561 return (*theCutsElectron)[current MaterialIndex];564 return (*theCutsElectron)[currentCoupleIndex]; 562 565 } 563 566 … … 583 586 preStepKinEnergy = track.GetKineticEnergy(); 584 587 DefineMaterial(track.GetMaterialCutsCouple()); 588 SelectModel(preStepKinEnergy, currentCoupleIndex); 585 589 if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX; 586 590 } … … 593 597 currentCouple = couple; 594 598 currentMaterial = couple->GetMaterial(); 595 current MaterialIndex = couple->GetIndex();599 currentCoupleIndex = couple->GetIndex(); 596 600 mfpKinEnergy = DBL_MAX; 597 601 } … … 602 606 inline void G4VEmProcess::ComputeIntegralLambda(G4double e) 603 607 { 604 mfpKinEnergy = theEnergyOfCrossSectionMax[current MaterialIndex];608 mfpKinEnergy = theEnergyOfCrossSectionMax[currentCoupleIndex]; 605 609 if (e <= mfpKinEnergy) { 606 610 preStepLambda = GetLambdaFromTable(e); … … 616 620 } 617 621 } else { 618 preStepLambda = theCrossSectionMax[current MaterialIndex];622 preStepLambda = theCrossSectionMax[currentCoupleIndex]; 619 623 } 620 624 } … … 625 629 inline G4double G4VEmProcess::GetLambdaFromTable(G4double e) 626 630 { 627 G4bool b; 628 return (((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b)); 631 return (((*theLambdaTable)[currentCoupleIndex])->Value(e)); 629 632 } 630 633 … … 634 637 { 635 638 G4double x = 0.0; 636 if(theLambdaTable) x = GetLambdaFromTable(e);637 else x = ComputeCurrentLambda(e);639 if(theLambdaTable) { x = GetLambdaFromTable(e); } 640 else { x = ComputeCurrentLambda(e); } 638 641 return x; 639 642 } … … 643 646 inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e) 644 647 { 645 SelectModel(e); 646 G4double x = 0.0; 647 if(currentModel) { 648 x = currentModel->CrossSectionPerVolume(currentMaterial,particle, 649 e,(*theCuts)[currentMaterialIndex]); 650 } 651 return x; 648 SelectModel(e, currentCoupleIndex); 649 return currentModel->CrossSectionPerVolume(currentMaterial,particle, 650 e,(*theCuts)[currentCoupleIndex]); 652 651 } 653 652 -
trunk/source/processes/electromagnetic/utils/include/G4VEnergyLoss.hh
r1007 r1196 26 26 // 27 27 // $Id: G4VEnergyLoss.hh,v 1.18 2006/06/29 19:54:47 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-0 2$28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // -
trunk/source/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh
r1055 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEnergyLossProcess.hh,v 1.8 7 2009/04/07 18:39:47 vnivanch Exp $26 // $Id: G4VEnergyLossProcess.hh,v 1.89 2009/07/03 14:39:17 vnivanch Exp $ 27 27 // GEANT4 tag $Name: 28 28 // … … 355 355 inline void SetLambdaFactor(G4double val); 356 356 inline void SetStepFunction(G4double v1, G4double v2); 357 inline void SetLowestEnergyLimit(G4double); 357 358 358 359 inline G4int NumberOfSubCutoffRegions() const; … … 717 718 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 718 719 720 inline void G4VEnergyLossProcess::SetLowestEnergyLimit(G4double val) 721 { 722 lowestKinEnergy = val; 723 } 724 725 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 726 719 727 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const 720 728 { … … 958 966 { 959 967 G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass(); 960 G4bool b; 961 G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b)); 968 G4double s = fRange*std::pow(10.,vstrag->Value(e)); 962 969 G4double x = fRange + G4RandGauss::shoot(0.0,s); 963 970 if(x > 0.0) fRange = x; … … 992 999 inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e) 993 1000 { 994 G4bool b; 995 G4double x = 996 ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio; 1001 G4double x = ((*theDEDXTable)[currentMaterialIndex]->Value(e))*chargeSqRatio; 997 1002 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 998 1003 return x; … … 1003 1008 inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e) 1004 1009 { 1005 G4bool b; 1006 G4double x = 1007 ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio; 1010 G4double x = ((*theDEDXSubTable)[currentMaterialIndex]->Value(e))*chargeSqRatio; 1008 1011 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1009 1012 return x; … … 1014 1017 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e) 1015 1018 { 1016 G4bool b; 1017 G4double x = 0.0; 1019 //G4double x = 0.0; 1018 1020 // if(theIonisationTable) { 1019 x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b)) 1020 *chargeSqRatio; 1021 G4double x = ((*theIonisationTable)[currentMaterialIndex]->Value(e))*chargeSqRatio; 1021 1022 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1022 1023 //} … … 1029 1030 G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e) 1030 1031 { 1031 G4bool b; 1032 G4double x = 0.0; 1032 // G4double x = 0.0; 1033 1033 //if(theIonisationSubTable) { 1034 x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b)) 1035 *chargeSqRatio; 1034 G4double x = ((*theIonisationSubTable)[currentMaterialIndex]->Value(e))*chargeSqRatio; 1036 1035 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1037 1036 //} … … 1043 1042 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e) 1044 1043 { 1045 G4bool b; 1046 G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b); 1044 G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->Value(e); 1047 1045 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1048 1046 return x; … … 1054 1052 G4double e) 1055 1053 { 1056 G4bool b;1057 1054 G4double x; 1058 1055 1059 1056 if (e < maxKinEnergyCSDA) { 1060 x = ((*theCSDARangeTable)[currentMaterialIndex])-> GetValue(e, b);1057 x = ((*theCSDARangeTable)[currentMaterialIndex])->Value(e); 1061 1058 if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy); 1062 1059 } else { … … 1072 1069 { 1073 1070 G4PhysicsVector* v = (*theInverseRangeTable)[currentMaterialIndex]; 1074 G4double rmin = v-> GetLowEdgeEnergy(0);1071 G4double rmin = v->Energy(0); 1075 1072 G4double e = 0.0; 1076 if(r >= rmin) { 1077 G4bool b; 1078 e = v->GetValue(r, b); 1079 } else if(r > 0.0) { 1073 if(r >= rmin) { e = v->Value(r); } 1074 else if(r > 0.0) { 1080 1075 G4double x = r/rmin; 1081 1076 e = minKinEnergy*x*x; … … 1088 1083 inline G4double G4VEnergyLossProcess::GetLambdaForScaledEnergy(G4double e) 1089 1084 { 1090 G4bool b; 1091 return 1092 chargeSqRatio*(((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b)); 1085 return chargeSqRatio*(((*theLambdaTable)[currentMaterialIndex])->Value(e)); 1093 1086 } 1094 1087 -
trunk/source/processes/electromagnetic/utils/include/G4VMscModel.hh
r1055 r1196 25 25 // 26 26 // $Id: G4VMscModel.hh,v 1.9 2009/04/07 18:39:47 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- -
trunk/source/processes/electromagnetic/utils/include/G4VMultipleScattering.hh
r1055 r1196 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VMultipleScattering.hh,v 1. 56 2009/04/07 18:39:47vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-03- beta-cand-01 $26 // $Id: G4VMultipleScattering.hh,v 1.62 2009/10/29 17:56:04 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 127 127 void PrintInfoDefinition(); 128 128 129 G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);130 131 G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);132 133 129 // Store PhysicsTable in a file. 134 130 // Return false in case of failure at I/O … … 158 154 // The function overloads the corresponding function of the base 159 155 // class. 160 G4double PostStepGetPhysicalInteractionLength(156 inline G4double PostStepGetPhysicalInteractionLength( 161 157 const G4Track&, 162 158 G4double previousStepSize, 163 159 G4ForceCondition* condition); 160 161 // Along step actions 162 inline G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&); 163 164 // Post step actions 165 inline G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); 164 166 165 167 // This method does not used for tracking, it is intended only for tests … … 209 211 void AddEmModel(G4int order, G4VEmModel*, const G4Region* region = 0); 210 212 213 // Assign a model to a process 214 void SetModel(G4VMscModel*, G4int index = 1); 215 216 // return the assigned model 217 G4VMscModel* Model(G4int index = 1); 218 211 219 // Access to models by index 212 G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false) ;220 G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false) const; 213 221 214 222 //------------------------------------------------------------------------ … … 255 263 G4double& kineticEnergy); 256 264 257 // This method is used for tracking, it returns step limit258 inline G4double GetMscContinuousStepLimit(const G4Track& track,259 G4double scaledKinEnergy,260 G4double currentMinimalStep,261 G4double& currentSafety);262 263 265 // defines current material in run time 264 266 inline void DefineMaterial(const G4MaterialCutsCouple* couple); … … 278 280 279 281 // ======== Parameters of the class fixed at initialisation ======= 282 283 std::vector<G4VMscModel*> mscModels; 280 284 281 285 G4PhysicsTable* theLambdaTable; … … 294 298 295 299 G4bool latDisplasment; 300 G4bool isIon; 296 301 297 302 // ======== Cashed values - may be state dependent ================ … … 322 327 G4double& currentSafety) 323 328 { 324 return Get MscContinuousStepLimit(track,previousStepSize,currentMinimalStep,325 currentSafety);329 return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep, 330 currentSafety); 326 331 } 327 332 … … 500 505 G4double x; 501 506 if(theLambdaTable) { 502 G4bool b; 503 x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b); 507 x = ((*theLambdaTable)[currentMaterialIndex])->Value(e); 504 508 } else { 505 509 x = currentModel->CrossSection(currentCouple,p,e); … … 512 516 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 513 517 514 inline G4double G4VMultipleScattering::GetMscContinuousStepLimit(515 const G4Track& track,516 G4double scaledKinEnergy,517 G4double currentMinimalStep,518 G4double&)519 {520 G4double x = currentMinimalStep;521 DefineMaterial(track.GetMaterialCutsCouple());522 currentModel = static_cast<G4VMscModel*>(SelectModel(scaledKinEnergy));523 if(x > 0.0 && scaledKinEnergy > 0.0) {524 G4double tPathLength =525 currentModel->ComputeTruePathLengthLimit(track, theLambdaTable, x);526 if (tPathLength < x) valueGPILSelectionMSC = CandidateForSelection;527 x = currentModel->ComputeGeomPathLength(tPathLength);528 // G4cout << "tPathLength= " << tPathLength529 // << " stepLimit= " << x530 // << " currentMinimalStep= " << currentMinimalStep<< G4endl;531 }532 return x;533 }534 535 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....536 537 518 inline 538 519 void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple) … … 553 534 554 535 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 536 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 537 538 // Follwoing methods are virtual, they are inlined because they applied at 539 // each simulation step and some compilers may inline these methods 540 541 inline G4double 542 G4VMultipleScattering::PostStepGetPhysicalInteractionLength( 543 const G4Track&, G4double, G4ForceCondition* condition) 544 { 545 *condition = Forced; 546 return DBL_MAX; 547 } 548 549 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 550 551 inline G4VParticleChange* 552 G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step) 553 { 554 if(currentModel->IsActive(track.GetKineticEnergy())) { 555 fParticleChange.ProposeTrueStepLength(currentModel->ComputeTrueStepLength(step.GetStepLength())); 556 } 557 return &fParticleChange; 558 } 559 560 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 561 562 inline G4VParticleChange* 563 G4VMultipleScattering::PostStepDoIt(const G4Track& track, const G4Step& step) 564 { 565 fParticleChange.Initialize(track); 566 if(currentModel->IsActive(track.GetKineticEnergy())) { 567 currentModel->SampleScattering(track.GetDynamicParticle(), 568 step.GetPostStepPoint()->GetSafety()); 569 } 570 return &fParticleChange; 571 } 572 573 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 555 574 556 575 #endif -
trunk/source/processes/electromagnetic/utils/include/G4ionEffectiveCharge.hh
r1007 r1196 25 25 // 26 26 // $Id: G4ionEffectiveCharge.hh,v 1.12 2008/09/20 19:39:34 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-0 2$27 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 28 28 // 29 29 // -------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.
