- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/utils/src/G4VEmProcess.cc
r1228 r1315 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4VEmProcess.cc,v 1. 79 2009/11/10 20:30:55vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 3$26 // $Id: G4VEmProcess.cc,v 1.87 2010/05/10 13:35:32 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 53 53 // 27-10-07 Virtual functions moved to source (V.Ivanchenko) 54 54 // 24-06-09 Removed hidden bin in G4PhysicsVector (V.Ivanchenko) 55 // 17-02-10 Added pointer currentParticle (VI) 55 56 // 56 57 // Class Description: … … 98 99 currentModel(0), 99 100 particle(0), 101 currentParticle(0), 100 102 currentCouple(0) 101 103 { … … 165 167 G4VEmFluctuationModel* fm = 0; 166 168 modelManager->AddEmModel(order, p, fm, region); 167 if(p) p->SetParticleChange(pParticleChange);169 if(p) { p->SetParticleChange(pParticleChange); } 168 170 } 169 171 … … 205 207 void G4VEmProcess::PreparePhysicsTable(const G4ParticleDefinition& part) 206 208 { 207 if(!particle) particle = ∂209 if(!particle) { SetParticle(&part); } 208 210 if(1 < verboseLevel) { 209 211 G4cout << "G4VEmProcess::PreparePhysicsTable() for " … … 214 216 } 215 217 216 (G4LossTableManager::Instance())-> EmConfigurator()->AddModels();218 (G4LossTableManager::Instance())->PreparePhysicsTable(&part, this); 217 219 218 220 if(particle == &part) { … … 230 232 } 231 233 232 theCuts = modelManager->Initialise(particle,secondaryParticle,2.,verboseLevel); 234 theCuts = modelManager->Initialise(particle,secondaryParticle, 235 2.,verboseLevel); 233 236 const G4ProductionCutsTable* theCoupleTable= 234 237 G4ProductionCutsTable::GetProductionCutsTable(); … … 242 245 } 243 246 } 244 // Sub Cutoff andDeexcitation247 // Deexcitation 245 248 if (nDERegions>0) { 246 249 … … 287 290 } 288 291 292 (G4LossTableManager::Instance())->BuildPhysicsTable(particle); 289 293 if(buildLambdaTable) { 290 294 BuildLambdaTable(); … … 294 298 // reduce printout for nuclear stopping 295 299 G4bool gproc = true; 296 if(GetProcessName() == "nuclearStopping" && 300 G4int st = GetProcessSubType(); 301 if(st == fCoulombScattering && part.GetParticleType() == "nucleus" && 297 302 partname != "GenericIon" && partname != "alpha") { gproc = false; } 298 303 … … 354 359 << particle->GetParticleName() 355 360 << G4endl; 356 if(2 < verboseLevel) {357 G4cout << *theLambdaTable << G4endl;358 }359 361 } 360 362 } … … 385 387 if(verboseLevel > 2 && buildLambdaTable) { 386 388 G4cout << " LambdaTable address= " << theLambdaTable << G4endl; 387 if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;389 if(theLambdaTable) { G4cout << (*theLambdaTable) << G4endl; } 388 390 } 389 391 } … … 399 401 *condition = NotForced; 400 402 G4double x = DBL_MAX; 401 if(previousStepSize <= DBL_MIN) theNumberOfInteractionLengthLeft = -1.0;403 if(previousStepSize <= DBL_MIN) { theNumberOfInteractionLengthLeft = -1.0; } 402 404 InitialiseStep(track); 403 if(!currentModel->IsActive(preStepKinEnergy)) return x;405 if(!currentModel->IsActive(preStepKinEnergy)) { return x; } 404 406 405 407 if(preStepKinEnergy < mfpKinEnergy) { … … 428 430 G4cout << "G4VEmProcess::PostStepGetPhysicalInteractionLength "; 429 431 G4cout << "[ " << GetProcessName() << "]" << G4endl; 430 G4cout << " for " << particle->GetParticleName()432 G4cout << " for " << currentParticle->GetParticleName() 431 433 << " in Material " << currentMaterial->GetName() 432 434 << " Ekin(MeV)= " << preStepKinEnergy/MeV … … 461 463 // Do not make anything if particle is stopped, the annihilation then 462 464 // should be performed by the AtRestDoIt! 463 if (track.GetTrackStatus() == fStopButAlive) return &fParticleChange;465 if (track.GetTrackStatus() == fStopButAlive) { return &fParticleChange; } 464 466 465 467 G4double finalT = track.GetKineticEnergy(); … … 469 471 G4double lx = GetLambda(finalT, currentCouple); 470 472 if(preStepLambda<lx && 1 < verboseLevel) { 471 G4cout << "WARING: for " << particle->GetParticleName()473 G4cout << "WARING: for " << currentParticle->GetParticleName() 472 474 << " and " << GetProcessName() 473 475 << " E(MeV)= " << finalT/MeV … … 483 485 484 486 SelectModel(finalT, currentCoupleIndex); 485 if(!currentModel->IsActive(finalT)) return &fParticleChange;487 if(!currentModel->IsActive(finalT)) { return &fParticleChange; } 486 488 if(useDeexcitation) { 487 489 currentModel->SetDeexcitationFlag(idxDERegions[currentCoupleIndex]); … … 662 664 SelectModel(kineticEnergy, currentCoupleIndex); 663 665 cross = currentModel->CrossSectionPerVolume(currentMaterial, 664 particle,kineticEnergy); 665 } 666 666 currentParticle,kineticEnergy); 667 } 668 669 if(cross < 0.0) { cross = 0.0; } 667 670 return cross; 668 671 } … … 676 679 *condition = NotForced; 677 680 return G4VEmProcess::MeanFreePath(track); 681 } 682 683 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 684 685 G4double G4VEmProcess::MeanFreePath(const G4Track& track) 686 { 687 DefineMaterial(track.GetMaterialCutsCouple()); 688 preStepLambda = GetCurrentLambda(track.GetKineticEnergy()); 689 G4double x = DBL_MAX; 690 if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda; 691 return x; 692 } 693 694 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 695 696 G4double 697 G4VEmProcess::ComputeCrossSectionPerAtom(G4double kineticEnergy, 698 G4double Z, G4double A, G4double cut) 699 { 700 SelectModel(kineticEnergy, currentCoupleIndex); 701 G4double x = 0.0; 702 if(currentModel) { 703 x = currentModel->ComputeCrossSectionPerAtom(currentParticle,kineticEnergy, 704 Z,A,cut); 705 } 706 return x; 678 707 } 679 708 … … 714 743 theEnergyOfCrossSectionMax[i] = emax; 715 744 theCrossSectionMax[i] = smax; 716 if( 2< verboseLevel) {745 if(1 < verboseLevel) { 717 746 G4cout << "For " << particle->GetParticleName() 718 747 << " Max CS at i= " << i << " emax(MeV)= " << emax/MeV … … 733 762 734 763 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 764 765 const G4Element* G4VEmProcess::GetCurrentElement() const 766 { 767 const G4Element* elm = 0; 768 if(currentModel) {elm = currentModel->GetCurrentElement(); } 769 return elm; 770 } 771 772 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Note: See TracChangeset
for help on using the changeset viewer.