Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/utils/src/G4EmSaturation.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4EmSaturation.cc,v 1.10 2009/09/25 09:16:40 vnivanch 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 $
    2828//
    2929// -------------------------------------------------------------------
     
    5959  verbose = 1;
    6060  manager = 0;
     61
    6162  curMaterial = 0;
    62   curBirks = 0.0;
    63   curRatio = 1.0;
     63  curBirks    = 0.0;
     64  curRatio    = 1.0;
    6465  curChargeSq = 1.0;
    65   nMaterials = 0;
     66  nMaterials  = 0;
     67
    6668  electron = 0;
     69  proton   = 0;
     70  nist     = G4NistManager::Instance();
     71
    6772  Initialise();
    6873}
     
    8287                                      G4double niel)
    8388{
    84   if(edep <= 0.0) return 0.0;
     89  if(edep <= 0.0) { return 0.0; }
    8590
    8691  G4double evis = edep;
     
    109114
    110115      // 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); }
    112117 
    113118      // non-ionizing energy loss
    114119      if(nloss > 0.0) {
    115         if(!proton) {proton = G4Proton::Proton();}
     120        if(!proton) { proton = G4Proton::Proton(); }
    116121        G4double escaled = nloss*curRatio;
    117122        G4double s = manager->GetRange(proton,escaled,couple)/curChargeSq;
     
    133138  // is this material in the vector?
    134139 
    135   for(G4int j=0; j<nG4Birks; j++) {
     140  for(G4int j=0; j<nG4Birks; ++j) {
    136141    if(name == g4MatNames[j]) {
    137142      if(verbose > 0)
     
    152157  if(!manager) {
    153158    manager = G4LossTableManager::Instance();
    154     nist    = G4NistManager::Instance();
    155159    electron= G4Electron::Electron();
    156     proton  = 0;
    157   }
    158 
    159   if(mat == curMaterial) return curBirks;
     160  }
     161
     162  if(mat == curMaterial) { return curBirks; }
    160163
    161164  curMaterial = mat;
     
    165168
    166169  // seach in the run-time list
    167   for(G4int i=0; i<nMaterials; i++) {
     170  for(G4int i=0; i<nMaterials; ++i) {
    168171    if(mat == matPointers[i]) {
    169172      curBirks = mat->GetIonisation()->GetBirksConstant();
     
    180183  // seach in the Geant4 list
    181184  if(curBirks == 0.0) {
    182     for(G4int j=0; j<nG4Birks; j++) {
     185    for(G4int j=0; j<nG4Birks; ++j) {
    183186      if(name == g4MatNames[j]) {
    184187        mat->GetIonisation()->SetBirksConstant(g4MatData[j]);
     
    201204  const G4double* theAtomNumDensityVector = mat->GetVecNbOfAtomsPerVolume();
    202205  size_t nelm = mat->GetNumberOfElements();
    203   for (size_t i=0; i<nelm; i++) {
     206  for (size_t i=0; i<nelm; ++i) {
    204207    const G4Element* elm = (*theElementVector)[i];
    205208    G4double Z = elm->GetZ();
     
    231234  if(nMaterials > 0) {
    232235    G4cout << "### Birks coeffitients used in run time" << G4endl;
    233     for(G4int i=0; i<nMaterials; i++) {
     236    for(G4int i=0; i<nMaterials; ++i) {
    234237      G4double br = matPointers[i]->GetIonisation()->GetBirksConstant();
    235238      G4cout << "   " << matNames[i] << "     "
     
    248251  if(nG4Birks > 0) {
    249252    G4cout << "### Birks coeffitients for Geant4 materials" << G4endl;
    250     for(G4int i=0; i<nG4Birks; i++) {
     253    for(G4int i=0; i<nG4Birks; ++i) {
    251254      G4cout << "   " << g4MatNames[i] << "   "
    252255             << g4MatData[i]*MeV/mm << " mm/MeV" << G4endl;
Note: See TracChangeset for help on using the changeset viewer.