- Timestamp:
- Apr 6, 2009, 12:21:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/standard/src/G4hMultipleScattering.cc
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4hMultipleScattering.cc,v 1. 7 2007/12/07 17:35:52vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 1-patch-02 $26 // $Id: G4hMultipleScattering.cc,v 1.13 2008/10/15 17:53:44 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 // ----------------------------------------------------------------------------- … … 58 58 : G4VMultipleScattering(processName) 59 59 { 60 dtrl = 0.05; 61 lambdalimit = 1.*mm; 62 63 samplez = false ; 64 isInitialized = false; 65 66 SetLateralDisplasmentFlag(true); 67 SetSkin(0.0); 68 SetRangeFactor(0.2); 69 SetGeomFactor(0.1); 60 isInitialized = false; 61 isIon = false; 70 62 SetStepLimitType(fMinimal); 71 63 } … … 89 81 // Modification of parameters between runs 90 82 if(isInitialized) { 91 if (p->GetParticleType() != "nucleus" ) {83 if (p->GetParticleType() != "nucleus" && p->GetPDGMass() < GeV) { 92 84 mscUrban->SetStepLimitType(StepLimitType()); 93 85 mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag()); … … 99 91 } 100 92 93 // defaults for ions, which cannot be overwritten 94 if (p->GetParticleType() == "nucleus" || p->GetPDGMass() > GeV) { 95 SetStepLimitType(fMinimal); 96 SetLateralDisplasmentFlag(false); 97 SetBuildLambdaTable(false); 98 if(p->GetParticleType() == "nucleus") isIon = true; 99 } 100 101 101 // initialisation of parameters 102 102 G4String part_name = p->GetParticleName(); 103 mscUrban = new G4UrbanMscModel90( RangeFactor(),dtrl,lambdalimit,104 GeomFactor(),Skin(), 105 samplez,StepLimitType());103 mscUrban = new G4UrbanMscModel90(); 104 105 mscUrban->SetStepLimitType(StepLimitType()); 106 106 mscUrban->SetLateralDisplasmentFlag(LateralDisplasmentFlag()); 107 mscUrban->SetSkin(Skin()); 108 mscUrban->SetRangeFactor(RangeFactor()); 109 mscUrban->SetGeomFactor(GeomFactor()); 107 110 108 if (p->GetParticleType() == "nucleus") {109 mscUrban->SetStepLimitType(fMinimal);110 SetLateralDisplasmentFlag(false);111 SetBuildLambdaTable(false);112 SetSkin(0.0);113 SetRangeFactor(0.2);114 }115 111 AddEmModel(1,mscUrban); 116 112 isInitialized = true; … … 121 117 void G4hMultipleScattering::PrintInfo() 122 118 { 123 G4cout << " Boundary/stepping algorithm is active with RangeFactor= " 124 << RangeFactor() 125 << " Step limit type " << StepLimitType() 119 G4cout << " RangeFactor= " << RangeFactor() 120 << ", step limit type: " << StepLimitType() 121 << ", lateralDisplacement: " << LateralDisplasmentFlag() 122 << ", skin= " << Skin() 123 // << ", geomFactor= " << GeomFactor() 126 124 << G4endl; 127 125 } … … 129 127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 130 128 129 G4double G4hMultipleScattering::AlongStepGetPhysicalInteractionLength( 130 const G4Track& track, 131 G4double, 132 G4double currentMinimalStep, 133 G4double& currentSafety, 134 G4GPILSelection* selection) 135 { 136 // get Step limit proposed by the process 137 valueGPILSelectionMSC = NotCandidateForSelection; 138 139 G4double escaled = track.GetKineticEnergy(); 140 if(isIon) escaled *= track.GetDynamicParticle()->GetMass()/proton_mass_c2; 141 142 G4double steplength = GetMscContinuousStepLimit(track, 143 escaled, 144 currentMinimalStep, 145 currentSafety); 146 // G4cout << "StepLimit= " << steplength << G4endl; 147 // set return value for G4GPILSelection 148 *selection = valueGPILSelectionMSC; 149 return steplength; 150 } 151 152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 153
Note: See TracChangeset
for help on using the changeset viewer.