- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/utils/src/G4EmSaturation.cc
r1337 r1340 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EmSaturation.cc,v 1.1 0 2009/09/25 09:16:40vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-04-beta-01$26 // $Id: G4EmSaturation.cc,v 1.11 2010/10/25 17:23:01 vnivanch Exp $ 27 // GEANT4 tag $Name: emutils-V09-03-23 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 59 59 verbose = 1; 60 60 manager = 0; 61 61 62 curMaterial = 0; 62 curBirks = 0.0;63 curRatio = 1.0;63 curBirks = 0.0; 64 curRatio = 1.0; 64 65 curChargeSq = 1.0; 65 nMaterials = 0; 66 nMaterials = 0; 67 66 68 electron = 0; 69 proton = 0; 70 nist = G4NistManager::Instance(); 71 67 72 Initialise(); 68 73 } … … 82 87 G4double niel) 83 88 { 84 if(edep <= 0.0) return 0.0;89 if(edep <= 0.0) { return 0.0; } 85 90 86 91 G4double evis = edep; … … 109 114 110 115 // continues energy loss 111 if(eloss > 0.0) eloss /= (1.0 + bfactor*eloss/length);116 if(eloss > 0.0) { eloss /= (1.0 + bfactor*eloss/length); } 112 117 113 118 // non-ionizing energy loss 114 119 if(nloss > 0.0) { 115 if(!proton) { proton = G4Proton::Proton();}120 if(!proton) { proton = G4Proton::Proton(); } 116 121 G4double escaled = nloss*curRatio; 117 122 G4double s = manager->GetRange(proton,escaled,couple)/curChargeSq; … … 133 138 // is this material in the vector? 134 139 135 for(G4int j=0; j<nG4Birks; j++) {140 for(G4int j=0; j<nG4Birks; ++j) { 136 141 if(name == g4MatNames[j]) { 137 142 if(verbose > 0) … … 152 157 if(!manager) { 153 158 manager = G4LossTableManager::Instance(); 154 nist = G4NistManager::Instance();155 159 electron= G4Electron::Electron(); 156 proton = 0; 157 } 158 159 if(mat == curMaterial) return curBirks; 160 } 161 162 if(mat == curMaterial) { return curBirks; } 160 163 161 164 curMaterial = mat; … … 165 168 166 169 // seach in the run-time list 167 for(G4int i=0; i<nMaterials; i++) {170 for(G4int i=0; i<nMaterials; ++i) { 168 171 if(mat == matPointers[i]) { 169 172 curBirks = mat->GetIonisation()->GetBirksConstant(); … … 180 183 // seach in the Geant4 list 181 184 if(curBirks == 0.0) { 182 for(G4int j=0; j<nG4Birks; j++) {185 for(G4int j=0; j<nG4Birks; ++j) { 183 186 if(name == g4MatNames[j]) { 184 187 mat->GetIonisation()->SetBirksConstant(g4MatData[j]); … … 201 204 const G4double* theAtomNumDensityVector = mat->GetVecNbOfAtomsPerVolume(); 202 205 size_t nelm = mat->GetNumberOfElements(); 203 for (size_t i=0; i<nelm; i++) {206 for (size_t i=0; i<nelm; ++i) { 204 207 const G4Element* elm = (*theElementVector)[i]; 205 208 G4double Z = elm->GetZ(); … … 231 234 if(nMaterials > 0) { 232 235 G4cout << "### Birks coeffitients used in run time" << G4endl; 233 for(G4int i=0; i<nMaterials; i++) {236 for(G4int i=0; i<nMaterials; ++i) { 234 237 G4double br = matPointers[i]->GetIonisation()->GetBirksConstant(); 235 238 G4cout << " " << matNames[i] << " " … … 248 251 if(nG4Birks > 0) { 249 252 G4cout << "### Birks coeffitients for Geant4 materials" << G4endl; 250 for(G4int i=0; i<nG4Birks; i++) {253 for(G4int i=0; i<nG4Birks; ++i) { 251 254 G4cout << " " << g4MatNames[i] << " " 252 255 << g4MatData[i]*MeV/mm << " mm/MeV" << G4endl;
Note: See TracChangeset
for help on using the changeset viewer.