Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/lowenergy/src/G4eIonisationParameters.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/lowenergy/src/G4eIonisationParameters.cc (Version 11.3.0) and /processes/electromagnetic/lowenergy/src/G4eIonisationParameters.cc (Version 10.1.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
                                                   >>  27 // $Id: G4eIonisationParameters.cc 66241 2012-12-13 18:34:42Z gunter $
 27 //                                                 28 //
 28 // Author: Maria Grazia Pia (Maria.Grazia.Pia@     29 // Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
 29 //                                                 30 //
 30 // History:                                        31 // History:
 31 // -----------                                     32 // -----------
 32 // 31 Jul 2001   MGP        Created, with dumm     33 // 31 Jul 2001   MGP        Created, with dummy implementation
 33 // 12.09.01 V.Ivanchenko    Add param and inte     34 // 12.09.01 V.Ivanchenko    Add param and interpolation of parameters
 34 // 04.10.01 V.Ivanchenko    Add BindingEnergy      35 // 04.10.01 V.Ivanchenko    Add BindingEnergy method
 35 // 25.10.01 MGP             Many bug fixes, mo     36 // 25.10.01 MGP             Many bug fixes, mostly related to the
 36 //                          management of poin     37 //                          management of pointers
 37 // 29.11.01 V.Ivanchenko    New parametrisatio     38 // 29.11.01 V.Ivanchenko    New parametrisation + Excitation
 38 // 30.05.02 V.Ivanchenko    Format and names o     39 // 30.05.02 V.Ivanchenko    Format and names of the data files were
 39 //                          chenged to "ion-..     40 //                          chenged to "ion-..."
 40 // 17.02.04 V.Ivanchenko    Increase buffer si     41 // 17.02.04 V.Ivanchenko    Increase buffer size
 41 // 23.03.09 L.Pandola       Updated warning me     42 // 23.03.09 L.Pandola       Updated warning message
 42 // 03.12.10 V.Ivanchenko    Fixed memory leak      43 // 03.12.10 V.Ivanchenko    Fixed memory leak in LoadData
 43 //                                                 44 //
 44 // -------------------------------------------     45 // -------------------------------------------------------------------
 45                                                    46 
 46 #include "G4eIonisationParameters.hh"              47 #include "G4eIonisationParameters.hh"
 47 #include "G4SystemOfUnits.hh"                      48 #include "G4SystemOfUnits.hh"
 48 #include "G4VEMDataSet.hh"                         49 #include "G4VEMDataSet.hh"
 49 #include "G4ShellEMDataSet.hh"                     50 #include "G4ShellEMDataSet.hh"
 50 #include "G4EMDataSet.hh"                          51 #include "G4EMDataSet.hh"
 51 #include "G4CompositeEMDataSet.hh"                 52 #include "G4CompositeEMDataSet.hh"
 52 #include "G4LinInterpolation.hh"                   53 #include "G4LinInterpolation.hh"
 53 #include "G4LogLogInterpolation.hh"                54 #include "G4LogLogInterpolation.hh"
 54 #include "G4LinLogLogInterpolation.hh"             55 #include "G4LinLogLogInterpolation.hh"
 55 #include "G4SemiLogInterpolation.hh"               56 #include "G4SemiLogInterpolation.hh"
 56 #include "G4Material.hh"                           57 #include "G4Material.hh"
 57 #include "G4DataVector.hh"                         58 #include "G4DataVector.hh"
 58 #include <fstream>                                 59 #include <fstream>
 59 #include <sstream>                                 60 #include <sstream>
 60                                                    61 
 61 //....oooOO0OOooo........oooOO0OOooo........oo << 
 62                                                    62 
 63 G4eIonisationParameters:: G4eIonisationParamet <<  63 G4eIonisationParameters:: G4eIonisationParameters(G4int minZ, G4int maxZ)
                                                   >>  64   : zMin(minZ), zMax(maxZ),
                                                   >>  65   length(24)
 64 {                                                  66 {
 65   LoadData();                                      67   LoadData();
 66 }                                                  68 }
 67                                                    69 
 68 //....oooOO0OOooo........oooOO0OOooo........oo << 
 69                                                    70 
 70 G4eIonisationParameters::~G4eIonisationParamet     71 G4eIonisationParameters::~G4eIonisationParameters()
 71 {                                                  72 { 
 72   // Reset the map of data sets: remove the da     73   // Reset the map of data sets: remove the data sets from the map 
 73   for (auto& pos : param)                      <<  74   std::map<G4int,G4VEMDataSet*,std::less<G4int> >::iterator pos;
                                                   >>  75 
                                                   >>  76   for (pos = param.begin(); pos != param.end(); ++pos)
 74     {                                              77     {
 75       G4VEMDataSet* dataSet =  pos.second;     <<  78       G4VEMDataSet* dataSet = (*pos).second;
 76       delete dataSet;                              79       delete dataSet;
 77       dataSet = nullptr;                       << 
 78     }                                              80     }
 79   for (auto& pos : excit)                      <<  81 
 80     {                                          <<  82   for (pos = excit.begin(); pos != excit.end(); ++pos)
 81       G4VEMDataSet* dataSet =  pos.second;     <<  83     {
                                                   >>  84       G4VEMDataSet* dataSet = (*pos).second;
 82       delete dataSet;                              85       delete dataSet;
 83       dataSet = nullptr;                       << 
 84     }                                              86     }
                                                   >>  87 
 85   activeZ.clear();                                 88   activeZ.clear();
 86 }                                                  89 }
 87                                                    90 
 88 //....oooOO0OOooo........oooOO0OOooo........oo << 
 89                                                    91 
 90 G4double G4eIonisationParameters::Parameter(G4     92 G4double G4eIonisationParameters::Parameter(G4int Z, G4int shellIndex, 
 91                                                    93                                                      G4int parameterIndex, 
 92                                                    94                                                      G4double e) const
 93 {                                                  95 {
 94   G4double value = 0.;                             96   G4double value = 0.;
 95   G4int id = Z*100 + parameterIndex;               97   G4int id = Z*100 + parameterIndex;
                                                   >>  98   std::map<G4int,G4VEMDataSet*,std::less<G4int> >::const_iterator pos;
 96                                                    99 
 97   auto pos = param.find(id);                   << 100   pos = param.find(id);
 98   if (pos!= param.end()) {                        101   if (pos!= param.end()) {
 99     G4VEMDataSet* dataSet = (*pos).second;        102     G4VEMDataSet* dataSet = (*pos).second;
100     G4int nShells = (G4int)dataSet->NumberOfCo << 103     G4int nShells = dataSet->NumberOfComponents();
101                                                   104 
102     if(shellIndex < nShells) {                    105     if(shellIndex < nShells) { 
103       const G4VEMDataSet* component = dataSet-    106       const G4VEMDataSet* component = dataSet->GetComponent(shellIndex);
104       const G4DataVector ener = component->Get    107       const G4DataVector ener = component->GetEnergies(0);
105       G4double ee = std::max(ener.front(),std:    108       G4double ee = std::max(ener.front(),std::min(ener.back(),e));
106       value = component->FindValue(ee);           109       value = component->FindValue(ee);
107     } else {                                      110     } else {
108       G4cout << "WARNING: G4IonisationParamete    111       G4cout << "WARNING: G4IonisationParameters::FindParameter "
109              << "has no parameters for shell=     112              << "has no parameters for shell= " << shellIndex 
110              << "; Z= " << Z                      113              << "; Z= " << Z
111              << G4endl;                           114              << G4endl;
112     }                                             115     }
113   } else {                                        116   } else {
114     G4cout << "WARNING: G4IonisationParameters    117     G4cout << "WARNING: G4IonisationParameters::Parameter "
115            << "did not find ID = "                118            << "did not find ID = "
116            << shellIndex << G4endl;               119            << shellIndex << G4endl;
117   }                                               120   }
118                                                   121 
119   return value;                                   122   return value;
120 }                                                 123 }
121                                                   124 
122 //....oooOO0OOooo........oooOO0OOooo........oo << 
123                                                << 
124 G4double G4eIonisationParameters::Excitation(G    125 G4double G4eIonisationParameters::Excitation(G4int Z, G4double e) const
125 {                                                 126 {
126   G4double value = 0.;                            127   G4double value = 0.;
127   auto pos = excit.find(Z);                    << 128   std::map<G4int,G4VEMDataSet*,std::less<G4int> >::const_iterator pos;
                                                   >> 129 
                                                   >> 130   pos = excit.find(Z);
128   if (pos!= excit.end()) {                        131   if (pos!= excit.end()) {
129     G4VEMDataSet* dataSet = (*pos).second;        132     G4VEMDataSet* dataSet = (*pos).second;
130                                                   133 
131     const G4DataVector ener = dataSet->GetEner    134     const G4DataVector ener = dataSet->GetEnergies(0);
132     G4double ee = std::max(ener.front(),std::m    135     G4double ee = std::max(ener.front(),std::min(ener.back(),e));
133     value = dataSet->FindValue(ee);               136     value = dataSet->FindValue(ee);
134   } else {                                        137   } else {
135     G4cout << "WARNING: G4IonisationParameters    138     G4cout << "WARNING: G4IonisationParameters::Excitation "
136            << "did not find ID = "                139            << "did not find ID = "
137            << Z << G4endl;                        140            << Z << G4endl;
138   }                                               141   }
139                                                   142 
140   return value;                                   143   return value;
141 }                                                 144 }
142                                                   145 
143 //....oooOO0OOooo........oooOO0OOooo........oo << 
144                                                   146 
145 void G4eIonisationParameters::LoadData()          147 void G4eIonisationParameters::LoadData()
146 {                                                 148 {
147   // ---------------------------------------      149   // ---------------------------------------
148   // Please document what are the parameters      150   // Please document what are the parameters 
149   // ---------------------------------------      151   // ---------------------------------------
150                                                   152 
151   // define active elements                       153   // define active elements
152                                                   154 
153   const G4MaterialTable* materialTable = G4Mat    155   const G4MaterialTable* materialTable = G4Material::GetMaterialTable();
154   if (materialTable == nullptr)                << 156   if (materialTable == 0)
155      G4Exception("G4eIonisationParameters::Loa    157      G4Exception("G4eIonisationParameters::LoadData",
156         "em1001",FatalException,"Unable to fin    158         "em1001",FatalException,"Unable to find MaterialTable");
157                                                   159 
158   std::size_t nMaterials = G4Material::GetNumb << 160   G4int nMaterials = G4Material::GetNumberOfMaterials();
159                                                   161   
160   for (std::size_t mLocal=0; mLocal<nMaterials << 162   for (G4int mLocal=0; mLocal<nMaterials; mLocal++) {
161                                                   163 
162     const G4Material* material= (*materialTabl    164     const G4Material* material= (*materialTable)[mLocal];        
163     const G4ElementVector* elementVector = mat    165     const G4ElementVector* elementVector = material->GetElementVector();
164     const std::size_t nElements = material->Ge << 166     const size_t nElements = material->GetNumberOfElements();
165                                                   167       
166     for (std::size_t iEl=0; iEl<nElements; ++i << 168     for (size_t iEl=0; iEl<nElements; iEl++) {
167       G4double Z = (*elementVector)[iEl]->GetZ << 169       G4Element* element = (*elementVector)[iEl];
                                                   >> 170       G4double Z = element->GetZ();
168       if (!(activeZ.contains(Z))) {               171       if (!(activeZ.contains(Z))) {
169   activeZ.push_back(Z);                           172   activeZ.push_back(Z);
170       }                                           173       }
171     }                                             174     }
172   }                                               175   }
173                                                   176   
174   const char* path = G4FindDataDir("G4LEDATA") << 177   char* path = getenv("G4LEDATA");
175   if (!path)                                      178   if (!path)
176     {                                             179     { 
177       G4Exception("G4BremsstrahlungParameters:    180       G4Exception("G4BremsstrahlungParameters::LoadData",
178         "em0006",FatalException,"G4LEDATA envi    181         "em0006",FatalException,"G4LEDATA environment variable not set");
179       return;                                     182       return;
180     }                                             183     }
181                                                   184     
182   G4String pathString(path);                      185   G4String pathString(path);
183   G4String path2("/ioni/ion-sp-");                186   G4String path2("/ioni/ion-sp-");
184   pathString += path2;                            187   pathString += path2;  
185                                                   188   
186   G4double energy, sum;                           189   G4double energy, sum;
187                                                   190   
188   std::size_t nZ = activeZ.size();             << 191   size_t nZ = activeZ.size();
189                                                   192   
190   for (std::size_t i=0; i<nZ; ++i) {           << 193   for (size_t i=0; i<nZ; i++) {
191                                                   194     
192     G4int Z = (G4int)activeZ[i];                  195     G4int Z = (G4int)activeZ[i];
193     std::ostringstream ost;                       196     std::ostringstream ost;
194     ost << pathString << Z << ".dat";             197     ost << pathString << Z << ".dat";
195     G4String name(ost.str());                     198     G4String name(ost.str());
196                                                   199 
197     std::ifstream file(name);                     200     std::ifstream file(name);
198     std::filebuf* lsdp = file.rdbuf();            201     std::filebuf* lsdp = file.rdbuf();
199                                                   202 
200     if (! (lsdp->is_open()) ) {                   203     if (! (lsdp->is_open()) ) {
201       G4String excep = G4String("data file: ")    204       G4String excep = G4String("data file: ")
202       + name + G4String(" not found");            205       + name + G4String(" not found");
203       G4Exception("G4eIonisationParameters::Lo    206       G4Exception("G4eIonisationParameters::LoadData",
204         "em0003",FatalException,excep);           207         "em0003",FatalException,excep);
205     }                                             208     }
206                                                   209 
207     // The file is organized into:                210     // The file is organized into:
208     // For each shell there are two lines:        211     // For each shell there are two lines:
209     //    1st line:                               212     //    1st line:
210     // 1st column is the energy of incident e-    213     // 1st column is the energy of incident e-,
211     // 2d  column is the parameter of screan t    214     // 2d  column is the parameter of screan term;
212     //    2d line:                                215     //    2d line:
213     // 3 energy (MeV) subdividing different ap    216     // 3 energy (MeV) subdividing different approximation area of the spectrum
214     // 20 point on the spectrum                   217     // 20 point on the spectrum
215     // The shell terminates with the pattern:     218     // The shell terminates with the pattern: -1   -1
216     // The file terminates with the pattern: -    219     // The file terminates with the pattern: -2   -2
217                                                   220 
218     std::vector<G4VEMDataSet*> p;                 221     std::vector<G4VEMDataSet*> p;
219     for (std::size_t k=0; k<length; ++k)       << 222     for (size_t k=0; k<length; k++) 
220       {                                           223       {
221   G4VDataSetAlgorithm* inter = new G4LinLogLog    224   G4VDataSetAlgorithm* inter = new G4LinLogLogInterpolation();
222   G4VEMDataSet* composite = new G4CompositeEMD    225   G4VEMDataSet* composite = new G4CompositeEMDataSet(inter,1.,1.);
223   p.push_back(composite);                         226   p.push_back(composite);
224       }                                           227       }
225                                                   228 
226     G4int shell = 0;                              229     G4int shell = 0;
227     std::vector<G4DataVector*> a;                 230     std::vector<G4DataVector*> a;
228     a.resize(length);                             231     a.resize(length);
229     G4DataVector e;                               232     G4DataVector e;
230     G4bool isReady = false;                       233     G4bool isReady = false;
231     do {                                          234     do {
232       file >> energy >> sum;                      235       file >> energy >> sum;
233       //Check if energy is valid                  236       //Check if energy is valid
234       if (energy < -2)                            237       if (energy < -2)
235   {                                               238   {
236     G4String excep("invalid data file");          239     G4String excep("invalid data file");
237           G4Exception("G4eIonisationParameters    240           G4Exception("G4eIonisationParameters::LoadData",
238         "em0005",FatalException,excep);           241         "em0005",FatalException,excep);
239     return;                                       242     return;
240   }                                               243   }
241                                                   244 
242       if (energy == -2) break;                    245       if (energy == -2) break;
243                                                   246 
244       if (energy >  -1) {                         247       if (energy >  -1) {
245   // new energy                                   248   // new energy
246   if(!isReady) {                                  249   if(!isReady) {
247     isReady = true;                               250     isReady = true;
248     e.clear();                                    251     e.clear();
249     for (std::size_t j=0; j<length; ++j) {     << 252     for (size_t j=0; j<length; ++j) { 
250       a[j] = new G4DataVector();                  253       a[j] = new G4DataVector(); 
251     }                                             254     }  
252   }                                               255   }
253         e.push_back(energy);                      256         e.push_back(energy);
254         a[0]->push_back(sum);                     257         a[0]->push_back(sum);
255         for (std::size_t j=1; j<length; ++j) { << 258         for (size_t j=1; j<length; ++j) {
256     G4double qRead;                               259     G4double qRead;
257     file >> qRead;                                260     file >> qRead;
258     a[j]->push_back(qRead);                       261     a[j]->push_back(qRead);
259   }                                               262   }    
260                                                   263 
261       } else {                                    264       } else {
262                                                   265 
263         // End of set for a shell, fill the ma    266         // End of set for a shell, fill the map
264   for (std::size_t k=0; k<length; ++k) {       << 267   for (size_t k=0; k<length; k++) {
265                                                   268 
266           G4VDataSetAlgorithm* interp;            269           G4VDataSetAlgorithm* interp;
267           if(0 == k) { interp  = new G4LinLogL    270           if(0 == k) { interp  = new G4LinLogLogInterpolation(); }
268           else       { interp  = new G4LogLogI    271           else       { interp  = new G4LogLogInterpolation(); }
269                                                   272 
270     G4DataVector* eVector = new G4DataVector;     273     G4DataVector* eVector = new G4DataVector;
271     std::size_t eSize = e.size();              << 274     size_t eSize = e.size();
272     for (std::size_t sLocal=0; sLocal<eSize; + << 275     for (size_t sLocal=0; sLocal<eSize; sLocal++) {
273       eVector->push_back(e[sLocal]);              276       eVector->push_back(e[sLocal]);
274     }                                             277     }
275     G4VEMDataSet* set = new G4EMDataSet(shell,    278     G4VEMDataSet* set = new G4EMDataSet(shell,eVector,a[k],interp,1.,1.);
276                                                   279 
277     p[k]->AddComponent(set);                      280     p[k]->AddComponent(set);
278   }                                               281   } 
279                                                   282     
280   // next shell                                   283   // next shell
281         ++shell;                                  284         ++shell;
282         isReady = false;                          285         isReady = false;
283       }                                           286       }
284     } while (energy > -2);                        287     } while (energy > -2);
285                                                   288     
286     file.close();                                 289     file.close();
287                                                   290 
288     for (G4int kk=0; kk<(G4int)length; ++kk)   << 291     for (size_t kk=0; kk<length; kk++) 
289       {                                           292       {
290         G4int id = Z*100 + kk;                 << 293   G4int id = Z*100 + kk;
291         param[id] = p[kk];                     << 294   param[id] = p[kk];
292       }                                           295       }
293   }                                               296   }
294                                                   297 
295   G4String pathString_a(path);                    298   G4String pathString_a(path);
296   G4String name_a = pathString_a + G4String("/    299   G4String name_a = pathString_a + G4String("/ioni/ion-ex-av.dat");  
297   std::ifstream file_a(name_a);                   300   std::ifstream file_a(name_a);
298   std::filebuf* lsdp_a = file_a.rdbuf();          301   std::filebuf* lsdp_a = file_a.rdbuf();
299   G4String pathString_b(path);                    302   G4String pathString_b(path);
300   G4String name_b = pathString_b + G4String("/    303   G4String name_b = pathString_b + G4String("/ioni/ion-ex-sig.dat");  
301   std::ifstream file_b(name_b);                   304   std::ifstream file_b(name_b);
302   std::filebuf* lsdp_b = file_b.rdbuf();          305   std::filebuf* lsdp_b = file_b.rdbuf();
303                                                   306   
304   if (! (lsdp_a->is_open()) ) {                   307   if (! (lsdp_a->is_open()) ) {
305      G4String excep = G4String("cannot open fi    308      G4String excep = G4String("cannot open file ")
306                     + name_a;                     309                     + name_a;
307      G4Exception("G4eIonisationParameters::Loa    310      G4Exception("G4eIonisationParameters::LoadData",
308         "em0003",FatalException,excep);           311         "em0003",FatalException,excep);
309   }                                               312   }  
310   if (! (lsdp_b->is_open()) ) {                   313   if (! (lsdp_b->is_open()) ) {
311      G4String excep = G4String("cannot open fi    314      G4String excep = G4String("cannot open file ")
312                     + name_b;                     315                     + name_b;
313      G4Exception("G4eIonisationParameters::Loa    316      G4Exception("G4eIonisationParameters::LoadData",
314         "em0003",FatalException,excep);           317         "em0003",FatalException,excep);
315   }                                               318   }  
316                                                   319 
317   // The file is organized into two columns:      320   // The file is organized into two columns:
318   // 1st column is the energy                     321   // 1st column is the energy
319   // 2nd column is the corresponding value        322   // 2nd column is the corresponding value
320   // The file terminates with the pattern: -1     323   // The file terminates with the pattern: -1   -1
321   //                                       -2     324   //                                       -2   -2
322                                                   325 
323   G4double ener, ener1, sig, sig1;                326   G4double ener, ener1, sig, sig1;
324   G4int z    = 0;                                 327   G4int z    = 0;
325                                                   328 
326   G4DataVector e;                                 329   G4DataVector e;
327   e.clear();                                      330   e.clear();
328   G4DataVector d;                                 331   G4DataVector d;
329   d.clear();                                      332   d.clear();
330                                                   333 
331   do {                                            334   do {
332     file_a >> ener >> sig;                        335     file_a >> ener >> sig;
333     file_b >> ener1 >> sig1;                      336     file_b >> ener1 >> sig1;
334                                                   337     
335     if(ener != ener1) {                           338     if(ener != ener1) {
336       G4cout << "G4eIonisationParameters: prob    339       G4cout << "G4eIonisationParameters: problem in excitation data "
337              << "ener= " << ener                  340              << "ener= " << ener
338              << " ener1= " << ener1               341              << " ener1= " << ener1
339              << G4endl;                           342              << G4endl;
340     }                                             343     }
341                                                   344 
342     // End of file                                345     // End of file
343     if (ener == -2) {                             346     if (ener == -2) {
344       break;                                      347       break;
345                                                   348 
346       // End of next element                      349       // End of next element
347     } else if (ener == -1) {                      350     } else if (ener == -1) {
348                                                   351 
349       z++;                                        352       z++;
350       G4double Z = (G4double)z;                   353       G4double Z = (G4double)z;
351                                                   354     
352   // fill map if Z is used                        355   // fill map if Z is used
353       if (activeZ.contains(Z)) {                  356       if (activeZ.contains(Z)) {
354                                                   357 
355   G4VDataSetAlgorithm* inter  = new G4LinInter    358   G4VDataSetAlgorithm* inter  = new G4LinInterpolation();
356   G4DataVector* eVector = new G4DataVector;       359   G4DataVector* eVector = new G4DataVector;
357   G4DataVector* dVector = new G4DataVector;       360   G4DataVector* dVector = new G4DataVector;
358   std::size_t eSize = e.size();                << 361   size_t eSize = e.size();
359   for (std::size_t sLocal2=0; sLocal2<eSize; + << 362   for (size_t sLocal2=0; sLocal2<eSize; sLocal2++) {
360            eVector->push_back(e[sLocal2]);        363            eVector->push_back(e[sLocal2]);
361            dVector->push_back(d[sLocal2]);        364            dVector->push_back(d[sLocal2]);
362   }                                               365   }
363   G4VEMDataSet* set = new G4EMDataSet(z,eVecto    366   G4VEMDataSet* set = new G4EMDataSet(z,eVector,dVector,inter,1.,1.);
364       excit[z] = set;                             367       excit[z] = set; 
365       }                                           368       }
366       e.clear();                                  369       e.clear();
367       d.clear();                                  370       d.clear();
368                                                   371   
369     } else {                                      372     } else {
370                                                   373 
371       e.push_back(ener*MeV);                      374       e.push_back(ener*MeV);
372       d.push_back(sig1*sig*barn*MeV);             375       d.push_back(sig1*sig*barn*MeV);
373     }                                             376     }
374   } while (ener != -2);                           377   } while (ener != -2);
375                                                   378   
376   file_a.close();                                 379   file_a.close();
377                                                   380 
378 }                                                 381 }
379                                                   382 
380 //....oooOO0OOooo........oooOO0OOooo........oo << 
381                                                   383 
382 void G4eIonisationParameters::PrintData() cons    384 void G4eIonisationParameters::PrintData() const
383 {                                                 385 {
384   G4cout << G4endl;                               386   G4cout << G4endl;
385   G4cout << "===== G4eIonisationParameters ===    387   G4cout << "===== G4eIonisationParameters =====" << G4endl;
386   G4cout << G4endl;                               388   G4cout << G4endl;
387                                                   389 
388   std::size_t nZ = activeZ.size();             << 390   size_t nZ = activeZ.size();
389   std::map<G4int,G4VEMDataSet*,std::less<G4int    391   std::map<G4int,G4VEMDataSet*,std::less<G4int> >::const_iterator pos;
390                                                   392 
391   for (std::size_t i=0; i<nZ; i++) {           << 393   for (size_t i=0; i<nZ; i++) {
392     G4int Z = (G4int)activeZ[i];                  394     G4int Z = (G4int)activeZ[i];      
393                                                   395 
394     for (G4int j=0; j<(G4int)length; ++j) {    << 396     for (size_t j=0; j<length; j++) {
395                                                   397     
396       G4int index = Z*100 + j;                    398       G4int index = Z*100 + j;
397                                                   399 
398       pos = param.find(index);                    400       pos = param.find(index);
399       if (pos!= param.cend()) {                << 401       if (pos!= param.end()) {
400         G4VEMDataSet* dataSet = (*pos).second;    402         G4VEMDataSet* dataSet = (*pos).second;
401         std::size_t nShells = dataSet->NumberO << 403         size_t nShells = dataSet->NumberOfComponents();
402                                                   404 
403         for (G4int k=0; k<(G4int)nShells; ++k) << 405         for (size_t k=0; k<nShells; k++) {
404                                                   406 
405           G4cout << "===== Z= " << Z << " shel    407           G4cout << "===== Z= " << Z << " shell= " << k 
406                  << " parameter[" << j << "]      408                  << " parameter[" << j << "]  =====" 
407                  << G4endl;                       409                  << G4endl;
408           const G4VEMDataSet* comp = dataSet->    410           const G4VEMDataSet* comp = dataSet->GetComponent(k);
409           comp->PrintData();                      411           comp->PrintData();
410   }                                               412   }
411       }                                           413       }
412     }                                             414     }
413   }                                               415   }
414   G4cout << "=================================    416   G4cout << "====================================" << G4endl;
415 }                                                 417 }
416                                                   418 
417                                                   419 
418                                                   420