Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (15 years ago)
Author:
garnier
Message:

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

Location:
trunk/source/materials/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/materials/src/G4AtomicShells.cc

    r1196 r1315  
    2525//
    2626//
    27 // $Id: G4AtomicShells.cc,v 1.7 2006/10/17 15:15:46 vnivanch Exp $
    28 // GEANT4 tag $Name: materials-V09-02-18 $
     27// $Id: G4AtomicShells.cc,v 1.8 2010/04/30 13:09:22 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
     
    3434// 19-07-04, add a protection in GetNumberOfShells(), mma
    3535// 11-02-05, GetNumberOfElectrons(Z,ShellNb), V.Ivanchenko
     36// 30-04-10, added fIndexOfShells, V.Ivanchenko
    3637
    3738//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
     
    4445
    4546const G4int
    46 G4AtomicShells::fNumberOfShells[101] =
     47G4AtomicShells::fNumberOfShells[101] = 
    4748{
    4849 0 ,  // nonexisting zero element
     
    7475// The total shell number is:
    7576// 1 + G4AtomicShells::TotalNumberOfShells(100) = 1 + 1539 = 1540
     77
     78//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
     79
     80const G4int   
     81G4AtomicShells::fIndexOfShells[101] =
     82  {    0,
     83       1,    2,    3,    5,    7,   10,   13,   17,   21,   24, 
     84      28,   33,   38,   44,   50,   56,   62,   68,   75,   83, 
     85      91,  100,  109,  118,  127,  136,  145,  154,  164,  174, 
     86     184,  195,  206,  217,  228,  239,  251,  264,  277,  291, 
     87     305,  319,  333,  347,  361,  375,  390,  405,  420,  436, 
     88     452,  468,  484,  500,  517,  535,  553,  572,  591,  610, 
     89     629,  648,  667,  686,  706,  725,  744,  763,  782,  801, 
     90     821,  842,  863,  884,  905,  926,  947,  968,  989, 1011, 
     91    1033, 1056, 1079, 1102, 1125, 1149, 1173, 1198, 1223, 1249, 
     92    1275, 1302, 1329, 1356, 1382, 1408, 1435, 1462, 1488, 1514
     93  };
    7694
    7795//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
     
    729747G4AtomicShells::GetNumberOfShells(G4int Z) 
    730748{
    731   assert (Z>=1 && Z<=101);
     749  assert (Z>0 && Z<101);
    732750  return fNumberOfShells[Z];
    733751}
     
    738756G4AtomicShells::GetBindingEnergy(G4int Z, G4int ShellNb)
    739757{
    740   assert (Z>=1 && Z<=101 && ShellNb<fNumberOfShells[Z]);
    741  
    742   G4int indice = 1;
    743   for (G4int z = 1 ; z < Z ; z++) indice += fNumberOfShells[z];
    744   indice += ShellNb; 
    745   return fBindingEnergies[indice]*eV;
     758  assert (Z>0 && Z<101 && ShellNb<fNumberOfShells[Z]);
     759  return fBindingEnergies[fIndexOfShells[Z] + ShellNb]*CLHEP::eV;
    746760}
    747761
     
    751765G4AtomicShells::GetNumberOfElectrons(G4int Z, G4int ShellNb)
    752766{
    753   assert (Z>=1 && Z<=101 && ShellNb<fNumberOfShells[Z]);
    754  
    755   G4int indice = 1;
    756   for (G4int z = 1 ; z < Z ; z++) indice += fNumberOfShells[z];
    757   indice += ShellNb; 
    758   return fNumberOfElectrons[indice];
     767  assert (Z>0 && Z<101 && ShellNb<fNumberOfShells[Z]);
     768  return fNumberOfElectrons[fIndexOfShells[Z] + ShellNb];
    759769}
    760770
     
    763773G4double G4AtomicShells::GetTotalBindingEnergy (G4int Z)
    764774{
    765   assert (Z>=1 && Z<=101);
     775  assert (Z>=1 && Z<101);
    766776 
    767   G4int idx = 1;
    768   for (G4int z = 1 ; z < Z ; z++) idx += fNumberOfShells[z];
     777  G4int idx = fIndexOfShells[Z];
     778  G4int idxmax = idx +  fNumberOfShells[Z];
    769779  G4double energy = 0.0;
    770   G4int idxmax = idx +  fNumberOfShells[Z];
    771   for (G4int i=idx; i<idxmax; i++) {energy += fBindingEnergies[i];}
    772   return energy*eV;
     780  for (G4int i=idx; i<idxmax; ++i) {energy += fBindingEnergies[i];}
     781  return energy*CLHEP::eV;
    773782}
    774783
  • trunk/source/materials/src/G4DensityEffectData.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4DensityEffectData.cc,v 1.9 2009/12/01 08:24:21 gcosmo Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4DensityEffectData.cc,v 1.12 2010/05/15 15:37:33 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929
    3030//---------------------------------------------------------------------------
     
    7474    {
    7575      indexZ[i] = -1;
     76      state[i]  = kStateSolid;
    7677    }
    7778
    78 //G4_H  index=0
     79//G4_lH2  index=0
     80  G4double M1[NDENSARRAY]={7.031,1.546,3.2632,0.4759,1.9215,0.13483,5.6249,0,0.021};
     81  AddMaterial(M1,"G4_lH2");
     82
     83//G4_H  index=1
    7984  G4double M0[NDENSARRAY]={0.263,1.412,9.5835,1.8639,3.2718,0.14092,5.7273,0.0,0.024};
    8085  AddMaterial(M0,"G4_H");
    81   indexZ[0]=0;
    82 
    83 //G4_lH2  index=1
    84   G4double M1[NDENSARRAY]={7.031,1.546,3.2632,0.4759,1.9215,0.13483,5.6249,0,0.021};
    85   AddMaterial(M1,"G4_lH2");
     86  indexZ[1]=1;
     87  state[1]=kStateGas;
    8688
    8789//G4_He  index=2
     
    8991  AddMaterial(M2,"G4_He");
    9092  indexZ[2]=2;
     93  state[2]=kStateGas;
    9194
    9295//G4_Li  index=3
     
    114117  AddMaterial(M7,"G4_N");
    115118  indexZ[7]=7;
     119  state[7]=kStateGas;
    116120
    117121//G4_O  index=8
     
    119123  AddMaterial(M8,"G4_O");
    120124  indexZ[8]=8;
     125  state[8]=kStateGas;
    121126
    122127//G4_F  index=9
     
    124129  AddMaterial(M9,"G4_F");
    125130  indexZ[9]=9;
     131  state[9]=kStateGas;
    126132
    127133//G4_Ne  index=10
     
    129135  AddMaterial(M10,"G4_Ne");
    130136  indexZ[10]=10;
     137  state[10]=kStateGas;
    131138
    132139//G4_Na  index=11
     
    164171  AddMaterial(M17,"G4_Cl");
    165172  indexZ[17]=17;
     173  state[17]=kStateGas;
    166174
    167175//G4_Ar  index=18
     
    169177  AddMaterial(M18,"G4_Ar");
    170178  indexZ[18]=18;
     179  state[18]=kStateGas;
    171180
    172181//G4_K  index=19
     
    243252  G4double M33[NDENSARRAY]={45.779,2.219,5.0510,0.1767,3.5702,0.06633,3.4176,0.00,0.030};
    244253  AddMaterial(M33,"G4_As");
    245    indexZ[33]=33;
     254  indexZ[33]=33;
    246255
    247256//G4_Se  index=34
     
    254263  AddMaterial(M35,"G4_Br");
    255264  indexZ[35]=35;
     265  state[35]=kStateGas;
    256266
    257267//G4_Kr  index=36
     
    259269  AddMaterial(M36,"G4_Kr");
    260270  indexZ[36]=36;
     271  state[36]=kStateGas;
    261272
    262273//G4_Ru  index=37
     
    349360  AddMaterial(M54,"G4_Xe");
    350361  indexZ[54]=54;
     362  state[54]=kStateGas;
    351363
    352364//G4_Cs  index=55
     
    444456  AddMaterial(M73,"G4_Ta");
    445457  indexZ[73]=73;
     458
    446459//G4_W  index=74
    447460  G4double M74[NDENSARRAY]={80.315,1.997,5.4059,0.2167,3.496,0.15509,2.8447,0.14,0.027};
     
    503516  AddMaterial(M85,"G4_Rn");
    504517  indexZ[86]=85;
     518  state[86]=kStateGas;
    505519
    506520//G4_Ra  index=86
     
    12841298}
    12851299
    1286 G4int G4DensityEffectData::GetIndex(G4int Z)
     1300G4int G4DensityEffectData::GetElementIndex(G4int Z, G4State st)
    12871301{
    12881302  G4int idx = -1;
    1289   if(Z >= 0 && Z < NDENSELEM) idx = indexZ[Z];
     1303  if(Z > 0 && Z < NDENSELEM) {
     1304    if(st == state[Z])             { idx = indexZ[Z]; }
     1305    else if(st == kStateUndefined) { idx = indexZ[Z]; }
     1306  }
    12901307  return idx;
    12911308}
  • trunk/source/materials/src/G4Element.cc

    r1196 r1315  
    2525//
    2626//
    27 // $Id: G4Element.cc,v 1.34 2009/09/18 15:35:36 vnivanch Exp $
    28 // GEANT4 tag $Name: materials-V09-02-18 $
     27// $Id: G4Element.cc,v 1.35 2010/04/30 13:19:26 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    5757
    5858#include "G4Element.hh"
     59#include "G4AtomicShells.hh"
    5960#include <iomanip>
    6061
  • trunk/source/materials/src/G4IonisParamElm.cc

    r1196 r1315  
    2525//
    2626//
    27 // $Id: G4IonisParamElm.cc,v 1.15 2008/06/03 14:30:10 vnivanch Exp $
    28 // GEANT4 tag $Name: materials-V09-02-18 $
    29 //
    30 //
    31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
    32 //
     27// $Id: G4IonisParamElm.cc,v 1.16 2010/04/29 11:11:56 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
     29//
     30//
     31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
     32//
     33// 09-07-98, data moved from G4Element. M.Maire
     34// 22-11-00, tabulation of ionisation potential from
     35//           the ICRU Report N#37. V.Ivanchenko
     36// 08-03-01, correct handling of fShellCorrectionVector. M.Maire
     37// 17-10-02, Fix excitation energy interpolation. V.Ivanchenko
    3338// 06-09-04, Update calculated values after any change of ionisation
    3439//           potential change. V.Ivanchenko
    35 // 17-10-02, Fix excitation energy interpolation. V.Ivanchenko
    36 // 08-03-01, correct handling of fShellCorrectionVector. M.Maire
    37 // 22-11-00, tabulation of ionisation potential from
    38 //           the ICRU Report N#37. V.Ivanchenko
    39 // 09-07-98, data moved from G4Element. M.Maire
     40// 29-04-10, Using G4Pow and mean ionisation energy from NIST V.Ivanchenko
    4041//
    4142//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
    4243
    4344#include "G4IonisParamElm.hh"
    44 
    45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
    46 
    47 G4IonisParamElm::G4IonisParamElm(G4double Z)
    48 {
    49   if (Z < 1.)
     45#include "G4NistManager.hh"
     46#include "G4Pow.hh"
     47
     48//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
     49
     50G4IonisParamElm::G4IonisParamElm(G4double AtomNumber)
     51{
     52  G4int Z = G4int(AtomNumber + 0.5);
     53  if (Z < 1) {
    5054    G4Exception (" ERROR! It is not allowed to create an Element with Z < 1" );
    51    
     55  }
     56  G4Pow* g4pow = G4Pow::GetInstance();
     57
    5258  // some basic functions of the atomic number
    53   fZ = Z;
    54   fZ3  = std::pow(fZ, 1./3.);
    55   fZZ3 = std::pow(fZ*(fZ+1.), 1./3.);
    56   flogZ3 = std::log(fZ)/3.;
     59  fZ     = Z;
     60  fZ3    = g4pow->Z13(Z);
     61  fZZ3   = fZ3*g4pow->Z13(Z+1);
     62  flogZ3 = g4pow->logZ(Z)/3.;
    5763   
    5864  // Parameters for energy loss by ionisation   
    59 
     65  /*
    6066  // Mean excitation energy
    6167  // from "Stopping Powers for Electrons and Positrons"
     
    7379     9.6,  9.7,  9.7,  9.8,  9.8,  9.8,  9.8,  9.9,  9.9,  9.9 };
    7480
    75   G4int iz = (G4int)Z - 1 ;
    76   if(0  > iz) iz = 0;
    77   else if(99 < iz) iz = 99 ;
    7881  fMeanExcitationEnergy = fZ * exc[iz] * eV ;
     82  */
     83
     84  fMeanExcitationEnergy =
     85    G4NistManager::Instance()->GetMeanIonisationEnergy(Z);
    7986
    8087  // compute parameters for ion transport
     
    8592  // Fast ions or hadrons
    8693
    87   if(91 < iz) iz = 91;
     94  G4int iz = Z - 1;
     95  if(91 < iz) { iz = 91; }
    8896
    8997  static G4double vFermi[92] = {
     
    150158G4IonisParamElm::G4IonisParamElm(__void__&)
    151159  : fShellCorrectionVector(0)
    152 {
    153 }
     160{}
    154161
    155162//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
     
    157164G4IonisParamElm::~G4IonisParamElm()
    158165{
    159   if (fShellCorrectionVector) delete [] fShellCorrectionVector;
     166  if (fShellCorrectionVector) { delete [] fShellCorrectionVector; }
    160167}
    161168
     
    184191      fClow                  = right.fClow;
    185192      fMeanExcitationEnergy  = right.fMeanExcitationEnergy;
    186       if (fShellCorrectionVector) delete [] fShellCorrectionVector;           
     193      if (fShellCorrectionVector) { delete [] fShellCorrectionVector; }
    187194      fShellCorrectionVector = new G4double[3];           
    188195      fShellCorrectionVector[0] = right.fShellCorrectionVector[0];
  • trunk/source/materials/src/G4IonisParamMat.cc

    r1228 r1315  
    2525//
    2626//
    27 // $Id: G4IonisParamMat.cc,v 1.34 2009/11/30 15:48:04 vnivanch Exp $
    28 // GEANT4 tag $Name: geant4-09-03 $
     27// $Id: G4IonisParamMat.cc,v 1.38 2010/05/15 15:37:33 vnivanch Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    6262  fD0density = 0.0;
    6363  fAdjustmentFactor = 1.0;
    64   if(!fDensityData) fDensityData = new G4DensityEffectData();
     64  if(!fDensityData) { fDensityData = new G4DensityEffectData(); }
    6565
    6666  // compute parameters
     
    146146  // R.M. Sternheimer, Atomic Data and Nuclear Data Tables, 30: 261 (1984)
    147147  G4int idx = fDensityData->GetIndex(fMaterial->GetName());
    148   // if(idx < 0 && fMaterial->GetNumberOfElements() == 1) {
    149   //  idx = fDensityData->GetIndex(G4int(fMaterial->GetZ()));
    150   // }
     148  if(idx < 0 && fMaterial->GetNumberOfElements() == 1) {
     149    idx = fDensityData->GetElementIndex(G4int(fMaterial->GetZ()),
     150                                        fMaterial->GetState());
     151  }
    151152
    152153  //G4cout << "DensityEffect for " << fMaterial->GetName() << "  " << idx << G4endl;
     
    309310  //  loop for the elements in the material
    310311  //  to find out average values Z, vF, lF
    311   G4double z = 0.0, vF = 0.0, lF = 0.0, norm = 0.0 ;
     312  G4double z(0.0), vF(0.0), lF(0.0), norm(0.0), a23(0.0);
    312313
    313314  if( 1 == NumberOfElements ) {
     
    316317    vF= element->GetIonisation()->GetFermiVelocity();
    317318    lF= element->GetIonisation()->GetLFactor();
     319    a23 = std::pow(element->GetN(),-2./3.);
    318320
    319321  } else {
     
    326328        vF   += element->GetIonisation()->GetFermiVelocity() * weight ;
    327329        lF   += element->GetIonisation()->GetLFactor() * weight ;
     330        a23  += std::pow(element->GetN(),-2./3.) * weight ;
    328331      }
    329     z  /= norm ;
    330     vF /= norm ;
    331     lF /= norm ;
     332    z  /= norm;
     333    vF /= norm;
     334    lF /= norm;
     335    a23 /= norm;
    332336  } 
    333337  fZeff        = z;
    334338  fLfactor     = lF;
    335339  fFermiEnergy = 25.*keV*vF*vF;
     340  fInvA23      = a23;
    336341}
    337342
     
    340345void G4IonisParamMat::SetMeanExcitationEnergy(G4double value)
    341346{
    342   if(value == fMeanExcitationEnergy || value <= 0.0) return;
     347  if(value == fMeanExcitationEnergy || value <= 0.0) { return; }
    343348
    344349  /*
  • trunk/source/materials/src/G4MaterialPropertyVector.cc

    r1196 r1315  
    2525//
    2626//
    27 // $Id: G4MaterialPropertyVector.cc,v 1.17 2009/04/21 15:35:45 gcosmo Exp $
    28 // GEANT4 tag $Name: materials-V09-02-18 $
     27// $Id: G4MaterialPropertyVector.cc,v 1.18 2010/04/22 21:15:19 gum Exp $
     28// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2929//
    3030//
     
    154154G4double G4MaterialPropertyVector::GetProperty(G4double aPhotonEnergy) const
    155155{
    156   G4MPVEntry *target, *temp;
    157156  G4int left, right;
    158157  G4double ratio1, ratio2, pmright, pmleft, InterpolatedValue;
     
    175174    G4Exception("G4MaterialPropertyVector::GetProperty()", "OutOfRange",
    176175                JustWarning, "Attempt to retrieve property below range !");
     176    G4cout << "   aPhotonEnergy = " <<  aPhotonEnergy/MeV
     177           << " [MeV]  PMmin = " << PMmin << " [MeV]" << G4endl;         
    177178    return minProp;
    178179  }
     
    182183    G4Exception("G4MaterialPropertyVector::GetProperty()", "OutOfRange",
    183184                JustWarning, "Attempt to retrieve property above range !");
     185    G4cout << "   aPhotonEnergy = " <<  aPhotonEnergy/MeV
     186           << " [MeV]  PMmax = " << PMmax << " [MeV]" << G4endl;         
    184187    return maxProp;
    185188  }
    186  
    187   target = new G4MPVEntry(aPhotonEnergy, 0.0);
    188 
    189   temp = 0;
    190   //temp = MPV.find(target);
    191   std::vector<G4MPVEntry*>::const_iterator i;
    192   for (i = MPV.begin(); i != MPV.end(); i++)
    193   {
    194     if (**i == *target)  { temp = *i; break; }
    195   }
    196   if (temp != 0)
    197   {
    198     ////////////////////////
    199     // Return actual value
    200     ////////////////////////
    201 
    202     G4double retval = temp->GetProperty();
    203     delete target;
    204     return retval;
    205   }
    206   else
    207   {
    208     //////////////////////////////
    209     // Return interpolated value
    210     //////////////////////////////
    211 
    212     GetAdjacentBins(aPhotonEnergy, &left, &right);
    213 
    214     pmleft = MPV[left]->GetPhotonEnergy();
    215     pmright = MPV[right]->GetPhotonEnergy();
    216     ratio1 = (aPhotonEnergy-pmleft)/(pmright-pmleft);
    217     ratio2 = 1 - ratio1;
    218     InterpolatedValue = MPV[left]->GetProperty()*ratio2 +
    219                         MPV[right]->GetProperty()*ratio1;
    220     delete target;
    221     return InterpolatedValue;
    222   } 
     189
     190  //////////////////////////////
     191  // Return interpolated value
     192  //////////////////////////////
     193
     194  GetAdjacentBins(aPhotonEnergy, &left, &right);
     195  pmleft = MPV[left]->GetPhotonEnergy();
     196  pmright = MPV[right]->GetPhotonEnergy();
     197  ratio1 = (aPhotonEnergy-pmleft)/(pmright-pmleft);
     198  ratio2 = 1 - ratio1;
     199  InterpolatedValue = MPV[left]->GetProperty()*ratio2 +
     200                      MPV[right]->GetProperty()*ratio1;
     201  return InterpolatedValue;
    223202}
    224203
     
    340319  {
    341320    mid = (*left + *right)/2;
    342     if (MPV[mid]->GetPhotonEnergy() < aPhotonEnergy)
     321    if (MPV[mid]->GetPhotonEnergy() <= aPhotonEnergy)
    343322    {
    344323      *left = mid;
  • trunk/source/materials/src/G4NistMaterialBuilder.cc

    r1228 r1315  
    2424// ********************************************************************
    2525//
    26 // $Id: G4NistMaterialBuilder.cc,v 1.23 2009/11/24 17:19:10 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-03 $
     26// $Id: G4NistMaterialBuilder.cc,v 1.27 2010/05/20 13:08:22 vnivanch Exp $
     27// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
    2828//
    2929//
     
    9595
    9696  G4String name = matname;
    97   if("G4_NYLON-6/6" == matname)  name = "G4_NYLON-6-6";
    98   if("G4_NYLON-6/10" == matname) name = "G4_NYLON-6-10";
     97  if("G4_NYLON-6/6" == matname)  { name = "G4_NYLON-6-6"; }
     98  if("G4_NYLON-6/10" == matname) { name = "G4_NYLON-6-10";}
    9999
    100100  if (verbose > 1) {
     
    107107  G4Material* mat = 0;
    108108
    109   for (G4int i=0; i<nMaterials; i++) {
     109  for (G4int i=0; i<nMaterials; ++i) {
    110110
    111111    // Is inside NIST DB?
     
    124124  // Check the list of all materials
    125125  if (nmat > 0) {
    126     for (G4int i=0; i<nmat; i++) {
     126    for (G4int i=0; i<nmat; ++i) {
    127127      if(name == ((*theMaterialTable)[i])->GetName()) {
    128128        mat = (*theMaterialTable)[i];
     
    152152  if (nMaterials == 0)  return mat;
    153153
    154   for (G4int i=0; i<nMaterials; i++) {
     154  for (G4int i=0; i<nMaterials; ++i) {
    155155    if (name == names[i]) {
    156156      mat = BuildMaterial(i, isotopes);
     
    226226  AddMaterial(name,dens*cm3/g,0,0.,nm,state,temp,pressure);
    227227
    228   for (G4int i=0; i<nm; i++) {
     228  for (G4int i=0; i<nm; ++i) {
    229229    G4int Z = G4int((elmBuilder->FindOrBuildElement(elm[i]))->GetZ());
    230230    AddElementByAtomCount(Z, nbAtoms[i]);
     
    258258  AddMaterial(name,dens*cm3/g,0,0.,nm,state,temp,pressure);
    259259
    260   for (G4int i=0; i<nm; i++) {
     260  for (G4int i=0; i<nm; ++i) {
    261261    G4int Z = G4int((elmBuilder->FindOrBuildElement(elm[i]))->GetZ());
    262262    AddElementByWeightFraction(Z, w[i]);
     
    276276{
    277277  G4int idx = -1;
    278   for (G4int i=0; i<nMaterials; i++) {
     278  for (G4int i=0; i<nMaterials; ++i) {
    279279    if (name == names[i]) {
    280280      G4cout << "G4NistMaterialBuilder::ConstructNewMaterial:"
     
    350350//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    351351
    352 void G4NistMaterialBuilder::ListMaterials(const G4String& list)
    353 {
    354   if (list == "simple")   ListNistSimpleMaterials();
    355   if (list == "compound") ListNistCompoundMaterials();
    356   if (list == "hep")      ListHepMaterials();
    357 
    358   if (list == "all") {
     352void G4NistMaterialBuilder::ListMaterials(const G4String& mnam)
     353{
     354  if (mnam == "simple")        { ListNistSimpleMaterials(); }
     355  else if (mnam == "compound") { ListNistCompoundMaterials(); }
     356  else if (mnam == "hep")      { ListHepMaterials(); }
     357  else if (mnam == "space")    { ListSpaceMaterials(); }
     358
     359  else if (mnam == "all") {
    359360    ListNistSimpleMaterials();
    360361    ListNistCompoundMaterials();
    361362    ListHepMaterials();
     363    ListSpaceMaterials();
    362364  }
    363365}
     
    372374  G4cout << " Z Name  ChFormula        density(g/cm^3)  I(eV)       " << G4endl;
    373375  G4cout << "=======================================================" << G4endl;
    374   for (G4int i=0; i<nElementary; i++) {DumpElm(i);}
     376  for (G4int i=0; i<nElementary; ++i) {DumpElm(i);}
    375377  G4cout << "=======================================================" << G4endl;
    376378}
     
    384386  G4cout << " Ncomp Name  ChFormula        density(g/cm^3)  I(eV)   " << G4endl;
    385387  G4cout << "=======================================================" << G4endl;
    386   for (G4int i=nElementary; i<nNIST; i++) {DumpMix(i);}
     388  for (G4int i=nElementary; i<nNIST; ++i) {DumpMix(i);}
    387389  G4cout << "=======================================================" << G4endl;
    388390}
     
    397399  G4cout << " Ncomp Name  ChFormula        density(g/cm^3)  I(eV)   " << G4endl;
    398400  G4cout << "=======================================================" << G4endl;
    399   for (G4int i=nNIST; i<nMaterials; i++) {DumpMix(i);}
     401  for (G4int i=nNIST; i<nHEP; ++i) {DumpMix(i);}
     402  G4cout << "=======================================================" << G4endl;
     403}
     404
     405//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     406
     407void G4NistMaterialBuilder::ListSpaceMaterials()
     408{
     409  G4cout << "=======================================================" << G4endl;
     410  G4cout << "###           Space ISS Materials                    ##" << G4endl;
     411  G4cout << "=======================================================" << G4endl;
     412  G4cout << " Ncomp Name  ChFormula        density(g/cm^3)  I(eV)   " << G4endl;
     413  G4cout << "=======================================================" << G4endl;
     414  for (G4int i=nHEP; i<nMaterials; ++i) {DumpMix(i);}
    400415  G4cout << "=======================================================" << G4endl;
    401416}
     
    470485  }
    471486
    472   nMaterials++;
     487  ++nMaterials;
    473488
    474489  if(verbose > 1) {
     
    497512    return;
    498513  } else {
    499     for(G4int i=0; i<nMaterials; i++) {
     514    for(G4int i=0; i<nMaterials; ++i) {
    500515      if(nameMat == names[i]) {
    501516        chFormulas[i] = ch;
     
    526541    return;
    527542  } else {
    528     for(G4int i=0; i<nMaterials; i++) {
     543    for(G4int i=0; i<nMaterials; ++i) {
    529544      if(nameMat == names[i]) {
    530545        temperatures[i] = t;
     
    545560  elements.push_back(Z);
    546561  fractions.push_back(w);
    547   nCurrent--;
    548   nComponents++;
     562  --nCurrent;
     563  ++nComponents;
    549564  if (nCurrent == 0) {
    550565    G4int n = nMaterials - 1;
     
    553568    G4int imax = imin + components[n];
    554569
    555     for(G4int i=imin; i<imax; i++) {sum += fractions[i];}
    556     if (sum > 0.0) for (G4int i=imin; i<imax; i++) {fractions[i] /= sum;}
     570    for(G4int i=imin; i<imax; ++i) {sum += fractions[i];}
     571    if (sum > 0.0) for (G4int i=imin; i<imax; ++i) {fractions[i] /= sum;}
    557572  }
    558573}
     
    590605void G4NistMaterialBuilder::Initialise()
    591606{
    592   if (verbose > 0)
     607  if (verbose > 0) {
    593608    G4cout << "### G4NistMaterialBuilder::Initialise()" << G4endl;
    594 
     609  }
    595610  NistSimpleMaterials();
    596611  NistCompoundMaterials();
    597612  HepAndNuclearMaterials();
    598 
    599   if (verbose > 1) ListMaterials("all");
     613  SpaceMaterials();
     614
     615  if (verbose > 1) { ListMaterials("all"); }
    600616}
    601617
     
    13191335  AddElementByWeightFraction( 7, 0.035451);
    13201336  AddElementByWeightFraction( 8, 0.7101  );
    1321 
     1337 
    13221338  AddMaterial("G4_MUSCLE_WITHOUT_SUCROSE", 1.07, 0, 74.2, 4);
    13231339  AddElementByWeightFraction( 1, 0.101969);
     
    14431459
    14441460  AddMaterial("G4_POLYTRIFLUOROCHLOROETHYLENE", 2.1, 0, 120.7, 3);
     1461  // correct chemical name Polychlorotrifluoroethylene [CF2CClF]n, IvantchenkoA.
    14451462  AddElementByWeightFraction( 6, 0.20625 );
    14461463  AddElementByWeightFraction( 9, 0.489354);
     
    17131730
    17141731  AddMaterial("G4_GRAPHITE", 2.21, 6, 78.);
     1732  AddChemicalFormula("G4_GRAPHITE","Graphite");
     1733
    17151734  nNIST = nMaterials;
    1716   AddChemicalFormula("G4_GRAPHITE","Graphite");
    17171735}
    17181736
     
    17381756
    17391757  AddMaterial("G4_GRAPHITE_POROUS", 1.7, 6, 78.);
    1740   AddChemicalFormula("G4_GRAPHITE","Graphite");
    1741 
    1742 }
    1743 
    1744 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    1745 
     1758  AddChemicalFormula("G4_GRAPHITE_POROUS","Graphite");
     1759
     1760  // LUCITE is equal to plustiglass
     1761  AddMaterial("G4_LUCITE", 1.19, 0, 74., 3);
     1762  AddElementByWeightFraction( 1, 0.080538);
     1763  AddElementByWeightFraction( 6, 0.599848);
     1764  AddElementByWeightFraction( 8, 0.319614);
     1765
     1766  // SRIM-2008 materials
     1767  AddMaterial("G4_BRASS", 8.52, 0, 0.0, 3);
     1768  AddElementByAtomCount("Cu", 62);
     1769  AddElementByAtomCount("Zn", 35);
     1770  AddElementByAtomCount("Pb" , 3);
     1771
     1772  AddMaterial("G4_BRONZE", 8.82, 0, 0.0, 3);
     1773  AddElementByAtomCount("Cu", 89);
     1774  AddElementByAtomCount("Zn",  9);
     1775  AddElementByAtomCount("Pb" , 2);
     1776
     1777  AddMaterial("G4_STAINLESS-STEEL", 8.00, 0, 0.0, 3);
     1778  AddElementByAtomCount("Fe", 74);
     1779  AddElementByAtomCount("Cr",  8);
     1780  AddElementByAtomCount("Ni" ,18);
     1781
     1782  nHEP = nMaterials;
     1783}
     1784
     1785//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     1786
     1787void G4NistMaterialBuilder::SpaceMaterials()
     1788{
     1789  // density in g/cm3
     1790
     1791  AddMaterial("G4_KEVLAR" , 1.44, 0, 0.0, 4);
     1792  AddElementByAtomCount("C", 14);
     1793  AddElementByAtomCount("H", 10);
     1794  AddElementByAtomCount("O", 2);
     1795  AddElementByAtomCount("N", 2);
     1796
     1797  AddMaterial("G4_DACRON" , 1.40, 0, 0.0, 3);   // G4_POLYETHYLENE_TEREPHTALATE
     1798  AddElementByAtomCount("C", 10);
     1799  AddElementByAtomCount("H", 8);
     1800  AddElementByAtomCount("O", 4);
     1801
     1802  AddMaterial("G4_NEOPRENE" , 1.23, 0, 0.0, 3);   // POLYCLOROPRENE
     1803  AddElementByAtomCount("C", 4);
     1804  AddElementByAtomCount("H", 5);
     1805  AddElementByAtomCount("Cl", 1);
     1806}
     1807
     1808
     1809
     1810
Note: See TracChangeset for help on using the changeset viewer.