Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/hadrontherapy/src/HadrontherapyInteractionParameters.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 /examples/advanced/hadrontherapy/src/HadrontherapyInteractionParameters.cc (Version 11.3.0) and /examples/advanced/hadrontherapy/src/HadrontherapyInteractionParameters.cc (Version 10.0.p4)


  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 // Hadrontherapy advanced example for Geant4   <<  26 // This is the *BASIC* version of Hadrontherapy, a Geant4-based application
 27 // See more at: https://twiki.cern.ch/twiki/bi <<  27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
                                                   >>  28 //
                                                   >>  29 // Visit the Hadrontherapy web site (http://www.lns.infn.it/link/Hadrontherapy) to request 
                                                   >>  30 // the *COMPLETE* version of this program, together with its documentation;
                                                   >>  31 // Hadrontherapy (both basic and full version) are supported by the Italian INFN
                                                   >>  32 // Institute in the framework of the MC-INFN Group
                                                   >>  33 //
 28                                                    34 
 29 #include <fstream>                                 35 #include <fstream>
 30 #include <iostream>                                36 #include <iostream>
 31 #include <sstream>                                 37 #include <sstream>
 32 #include <cmath>                                   38 #include <cmath>
 33 #include <vector>                                  39 #include <vector>
 34                                                    40 
 35 #include "HadrontherapyInteractionParameters.h     41 #include "HadrontherapyInteractionParameters.hh"
 36 #include "HadrontherapyParameterMessenger.hh"      42 #include "HadrontherapyParameterMessenger.hh"
 37 #include "HadrontherapyDetectorConstruction.hh     43 #include "HadrontherapyDetectorConstruction.hh"
 38                                                    44 
 39 #include "globals.hh"                              45 #include "globals.hh"
 40 #include "G4SystemOfUnits.hh"                      46 #include "G4SystemOfUnits.hh"
 41 #include "G4UnitsTable.hh"                         47 #include "G4UnitsTable.hh"
 42 #include "G4UImanager.hh"                          48 #include "G4UImanager.hh"
 43 #include "G4RunManager.hh"                         49 #include "G4RunManager.hh"
 44 #include "G4LossTableManager.hh"                   50 #include "G4LossTableManager.hh"
 45 #include "G4Material.hh"                           51 #include "G4Material.hh"
 46 #include "G4MaterialCutsCouple.hh"                 52 #include "G4MaterialCutsCouple.hh"
 47 #include "G4ParticleDefinition.hh"                 53 #include "G4ParticleDefinition.hh"
 48 #include "G4ParticleTable.hh"                      54 #include "G4ParticleTable.hh"
 49 #include "G4NistManager.hh"                        55 #include "G4NistManager.hh"
 50 #include "G4Element.hh"                            56 #include "G4Element.hh"
 51 #include "G4StateManager.hh"                       57 #include "G4StateManager.hh"
 52                                                    58 
 53 HadrontherapyInteractionParameters::Hadronther     59 HadrontherapyInteractionParameters::HadrontherapyInteractionParameters(G4bool wantMessenger): 
 54     nistEle(new G4NistElementBuilder(0)),          60     nistEle(new G4NistElementBuilder(0)),                     
 55     nistMat(new G4NistMaterialBuilder(nistEle,     61     nistMat(new G4NistMaterialBuilder(nistEle, 0)),                   
 56     data(G4cout.rdbuf()),                          62     data(G4cout.rdbuf()), 
 57     pMessenger(0),                                 63     pMessenger(0),
 58     beamFlag(false)                                64     beamFlag(false)
 59                                                <<  65 #ifdef G4ANALYSIS_USE_ROOT 
                                                   >>  66     ,theRootCanvas(0),
                                                   >>  67     theRootGraph(0)
                                                   >>  68 #endif
 60 {                                                  69 {
 61     if (wantMessenger) pMessenger = new Hadron     70     if (wantMessenger) pMessenger = new HadrontherapyParameterMessenger(this); 
 62 }                                                  71 }
 63                                                    72 
 64 HadrontherapyInteractionParameters::~Hadronthe     73 HadrontherapyInteractionParameters::~HadrontherapyInteractionParameters()
 65 {                                                  74 {
 66     if (pMessenger) delete pMessenger;             75     if (pMessenger) delete pMessenger; 
 67     delete nistMat;                                76     delete nistMat; 
 68     delete nistEle;                                77     delete nistEle; 
 69 }                                                  78 }
 70                                                    79 
 71 G4double HadrontherapyInteractionParameters::G     80 G4double HadrontherapyInteractionParameters::GetStopping (G4double ene, 
 72                                                    81                                                     const G4ParticleDefinition* pDef, 
 73                       const G4Material* pMat,      82                       const G4Material* pMat,
 74                 G4double dens)                     83                 G4double dens)
 75 {                                                  84 {
 76     if (dens) return ComputeTotalDEDX(ene, pDe     85     if (dens) return ComputeTotalDEDX(ene, pDef, pMat)/dens;
 77     return ComputeTotalDEDX(ene, pDef, pMat);      86     return ComputeTotalDEDX(ene, pDef, pMat);
 78 }                                                  87 }
 79 bool HadrontherapyInteractionParameters::GetSt     88 bool HadrontherapyInteractionParameters::GetStoppingTable(const G4String& vararg)
 80 {                                                  89 {
 81   // Check arguments                               90   // Check arguments
 82   if ( !ParseArg(vararg)) return false;            91   if ( !ParseArg(vararg)) return false;
 83   // Clear previous energy & mass sp vectors       92   // Clear previous energy & mass sp vectors
 84         energy.clear();                            93         energy.clear(); 
 85         massDedx.clear();                          94         massDedx.clear();
 86   // log scale                                     95   // log scale 
 87   if (kinEmin != kinEmax && npoints >1)            96   if (kinEmin != kinEmax && npoints >1)
 88   {                                                97   {
 89       G4double logmin = std::log10(kinEmin);       98       G4double logmin = std::log10(kinEmin);
 90       G4double logmax = std::log10(kinEmax);       99       G4double logmax = std::log10(kinEmax); 
 91       G4double en;                                100       G4double en;
 92       // uniform log space                        101       // uniform log space
 93             for (G4double c = 0.; c < npoints;    102             for (G4double c = 0.; c < npoints; c++)
 94          {                                        103          {
 95         en = std::pow(10., logmin + ( c*(logma    104         en = std::pow(10., logmin + ( c*(logmax-logmin)  / (npoints - 1.)) );  
 96         energy.push_back(en/MeV);                 105         energy.push_back(en/MeV);
 97         dedxtot =  ComputeTotalDEDX (en, parti    106         dedxtot =  ComputeTotalDEDX (en, particle, material);
 98               massDedx.push_back ( (dedxtot /     107               massDedx.push_back ( (dedxtot / density)/(MeV*cm2/g) );
 99          }                                        108          }
100   }                                               109   }
101   else // one point only                          110   else // one point only
102   {                                               111   {
103       energy.push_back(kinEmin/MeV);              112       energy.push_back(kinEmin/MeV);
104       dedxtot =  ComputeTotalDEDX (kinEmin, pa    113       dedxtot =  ComputeTotalDEDX (kinEmin, particle, material);
105       massDedx.push_back ( (dedxtot / density)    114       massDedx.push_back ( (dedxtot / density)/(MeV*cm2/g) );
106   }                                               115   }
107                                                   116 
108     G4cout.precision(6);                          117     G4cout.precision(6);  
109     data <<  "MeV             " << "MeV*cm2/g     118     data <<  "MeV             " << "MeV*cm2/g      " << particle << " (into " << 
110       material << ", density = " << G4BestUnit    119       material << ", density = " << G4BestUnit(density,"Volumic Mass") << ")" << G4endl;
111     data << G4endl;                               120     data << G4endl;
112     data << std::left << std::setfill(' ');       121     data << std::left << std::setfill(' ');
113     for (size_t i=0; i<energy.size(); i++){       122     for (size_t i=0; i<energy.size(); i++){
114     data << std::setw(16) << energy[i] << mass    123     data << std::setw(16) << energy[i] << massDedx[i] << G4endl;
115   }                                               124   }
116     outfile.close();                              125     outfile.close();
117     // This will plot                          << 126     // This will plot 
                                                   >> 127 #ifdef G4ANALYSIS_USE_ROOT 
                                                   >> 128     PlotStopping("pdf");
                                                   >> 129 #endif
118                                                   130 
119 // Info to user                                   131 // Info to user
120     G4String ofName = (filename == "") ? G4Str << 132     G4String ofName = (filename == "") ? "User terminal": filename;
121     G4cout << "User choice:\n";                   133     G4cout << "User choice:\n";
122     G4cout << "Kinetic energy lower limit= "<<    134     G4cout << "Kinetic energy lower limit= "<< G4BestUnit(kinEmin,"Energy") << 
123         ", Kinetic energy upper limit= " << G4    135         ", Kinetic energy upper limit= " << G4BestUnit(kinEmax,"Energy") << 
124            ", npoints= "<< npoints << ", parti    136            ", npoints= "<< npoints << ", particle= \"" << particle << 
125      "\", material= \"" << material << "\", fi    137      "\", material= \"" << material << "\", filename= \""<< 
126      ofName << "\"" << G4endl;                    138      ofName << "\"" << G4endl;
127     return true;                                  139     return true;
128 }                                                 140 }
                                                   >> 141 ///////////////////////////////////////////////////////////////////////////////////
                                                   >> 142 // Save Plot  
                                                   >> 143 #ifdef G4ANALYSIS_USE_ROOT 
                                                   >> 144 void HadrontherapyInteractionParameters::PlotStopping(const G4String& filetype)
                                                   >> 145 {
                                                   >> 146     if (!theRootCanvas)
                                                   >> 147     {
                                                   >> 148   gROOT->Reset(); 
                                                   >> 149   gROOT->SetStyle("Plain");
                                                   >> 150   theRootCanvas = new TCanvas("theRootCanvas","Interaction Parameters",200, 10, 600,400);
                                                   >> 151   theRootCanvas -> SetFillColor(20);
                                                   >> 152   theRootCanvas -> SetBorderMode(1);
                                                   >> 153   theRootCanvas -> SetBorderSize(1);
                                                   >> 154   theRootCanvas -> SetFrameBorderMode(0);
                                                   >> 155   theRootCanvas -> SetGrid();
                                                   >> 156   // Use global pad: root manual pgg 109,...
                                                   >> 157     }
                                                   >> 158 
                                                   >> 159     if (theRootGraph) delete theRootGraph;
                                                   >> 160     theRootGraph = new TGraph(energy.size(), &energy[0], &massDedx[0]);
                                                   >> 161     //theRootGraph = new TGraph();
                                                   >> 162     axisX = theRootGraph -> GetXaxis(),
                                                   >> 163     axisY = theRootGraph -> GetYaxis();
                                                   >> 164     axisX -> SetTitle("MeV");
                                                   >> 165     axisY -> SetTitle("Stopping Power (MeV cm2/g)");
                                                   >> 166     //axisX -> SetNdivisions(500,kTRUE);
                                                   >> 167     //axisX -> SetTickLength(0.03);
                                                   >> 168     //axisX -> SetLabelOffset(2.005);
                                                   >> 169     axisX -> SetAxisColor(2);
                                                   >> 170     axisY -> SetAxisColor(2);
                                                   >> 171     gPad -> SetLogx(1);
                                                   >> 172     gPad -> SetLogy(1);
                                                   >> 173     theRootGraph -> SetMarkerColor(4);
                                                   >> 174     theRootGraph -> SetMarkerStyle(20);// circle
                                                   >> 175     theRootGraph -> SetMarkerSize(.5);
                                                   >> 176 
                                                   >> 177     G4String gName = particle.substr(0, particle.find("[") ); // cut excitation energy   
                                                   >> 178     gName = gName + "_" + material;
                                                   >> 179     G4String fName = "./referenceData/interaction/" + gName + "." + filetype;
                                                   >> 180     theRootGraph -> SetTitle(gName);
                                                   >> 181     theRootGraph -> Draw("AP");
                                                   >> 182     //theRootCanvas -> Update();
                                                   >> 183     //theRootCanvas -> Draw();
                                                   >> 184     theRootCanvas -> SaveAs(fName);
                                                   >> 185 }
                                                   >> 186 #endif
                                                   >> 187 
129 // Search for user material choice inside G4Ni    188 // Search for user material choice inside G4NistManager database
130 G4Material* HadrontherapyInteractionParameters    189 G4Material* HadrontherapyInteractionParameters::GetNistMaterial(G4String mat)
131 {                                                 190 {
132     Pmaterial = G4NistManager::Instance()->Fin    191     Pmaterial = G4NistManager::Instance()->FindOrBuildMaterial(mat);
133     if (Pmaterial) density = Pmaterial -> GetD    192     if (Pmaterial) density = Pmaterial -> GetDensity(); 
134     return Pmaterial;                             193     return Pmaterial;
135 }                                                 194 }
136 // Parse arguments line                           195 // Parse arguments line
137 bool HadrontherapyInteractionParameters::Parse    196 bool HadrontherapyInteractionParameters::ParseArg(const G4String& vararg)
138 {                                                 197 {
139   kinEmin = kinEmax = npoints = 0.;               198   kinEmin = kinEmax = npoints = 0.;
140   particle = material = filename = "";            199   particle = material = filename = "";
141   // set internal variables                       200   // set internal variables
142   std::istringstream strParam(vararg);            201   std::istringstream strParam(vararg);
143   // TODO here check for number and parameters    202   // TODO here check for number and parameters consistency 
144   strParam >> std::skipws >> material >> kinEm    203   strParam >> std::skipws >> material >> kinEmin >> kinEmax >> npoints >> particle >> filename;
145   // npoints must be an integer!                  204   // npoints must be an integer!
146   npoints = std::floor(npoints);                  205   npoints = std::floor(npoints); 
147                                                   206 
148 // Check that  kinEmax >= kinEmin > 0 &&  npoi    207 // Check that  kinEmax >= kinEmin > 0 &&  npoints >= 1 
149 // TODO NIST points and linear scale              208 // TODO NIST points and linear scale
150    if (kinEmax == 0. && kinEmin > 0. ) kinEmax    209    if (kinEmax == 0. && kinEmin > 0. ) kinEmax = kinEmin;
151    if (kinEmax == 0. && kinEmin == 0. ) kinEma    210    if (kinEmax == 0. && kinEmin == 0. ) kinEmax = kinEmin = 1.*MeV;
152    if (kinEmax < kinEmin)                         211    if (kinEmax < kinEmin) 
153    {                                              212    {
154      G4cout << "WARNING: kinEmin must not exce    213      G4cout << "WARNING: kinEmin must not exceed kinEmax!" << G4endl;
155      G4cout << "Usage: /parameter/command  mat << 214      G4cout << "Usage: /parameter/command  material kinetic Emin kinetic Emax nPoints [particle] [output filename]" << G4endl;  
156      return false;                                215      return false;
157    }                                              216    }
158   if (npoints < 1) npoints = 1;                   217   if (npoints < 1) npoints = 1;
159                                                   218 
160     // check if element/material is into datab    219     // check if element/material is into database
161     if (!GetNistMaterial(material) )              220     if (!GetNistMaterial(material) )
162      {                                            221      {
163        G4cout << "WARNING: material \"" << mat    222        G4cout << "WARNING: material \"" << material << "\" doesn't exist in NIST elements/materials"
164            " table [$G4INSTALL/source/material    223            " table [$G4INSTALL/source/materials/src/G4NistMaterialBuilder.cc]" << G4endl; 
165        G4cout << "Use command \"/parameter/nis    224        G4cout << "Use command \"/parameter/nist\" to see full materials list" << G4endl; 
166        return false;                              225        return false;
167      }                                            226      }
168     // Check for particle                         227     // Check for particle
169     if (particle == "") particle = "proton"; /    228     if (particle == "") particle = "proton"; // default to "proton"
170     else if ( !FindParticle(particle) )           229     else if ( !FindParticle(particle) )
171      {                                            230      {
172     G4cout << "WARNING: Particle \"" << partic    231     G4cout << "WARNING: Particle \"" << particle << "\" isn't supported." << G4endl;
173     G4cout << "Try the command \"/particle/lis    232     G4cout << "Try the command \"/particle/list\" to get full supported particles list." << G4endl;
174     G4cout << "If you are interested in an ion    233     G4cout << "If you are interested in an ion that isn't in this list you must give it to the particle gun."
175               "\nTry the commands:\n/gun/parti    234               "\nTry the commands:\n/gun/particle ion"
176         "\n/gun/ion <atomic number> <mass numb    235         "\n/gun/ion <atomic number> <mass number> <[charge]>" << G4endl << G4endl;
177     return false;                                 236     return false;
178      }                                            237      }
179     // start physics by forcing a G4RunManager    238     // start physics by forcing a G4RunManager::BeamOn(): 
180     BeamOn();                                     239     BeamOn();
181     // Set output file                            240     // Set output file
182     if( filename != "" )                          241     if( filename != "" ) 
183        {                                          242        {
184           outfile.open(filename,std::ios_base:    243           outfile.open(filename,std::ios_base::trunc); // overwrite existing file
185           data.rdbuf(outfile.rdbuf());            244           data.rdbuf(outfile.rdbuf());
186        }                                          245        }
187     else data.rdbuf(G4cout.rdbuf());  // outpu    246     else data.rdbuf(G4cout.rdbuf());  // output is G4cout!                
188     return true;                                  247     return true;
189 }                                                 248 }
190 // Force physics tables build                     249 // Force physics tables build
191 void HadrontherapyInteractionParameters::BeamO    250 void HadrontherapyInteractionParameters::BeamOn()
192 {                                                 251 {
193     // first check if RunManager is above G4St    252     // first check if RunManager is above G4State_Idle 
194     G4StateManager* mState = G4StateManager::G    253     G4StateManager* mState = G4StateManager::GetStateManager();
195     G4ApplicationState  aState = mState -> Get    254     G4ApplicationState  aState = mState -> GetCurrentState(); 
196     if ( aState <= G4State_Idle && beamFlag ==    255     if ( aState <= G4State_Idle && beamFlag == false)
197    {                                              256    {
198       G4cout << "Issuing a G4RunManager::beamO    257       G4cout << "Issuing a G4RunManager::beamOn()... "; 
199       G4cout << "Current Run State is " << mSt    258       G4cout << "Current Run State is " << mState -> GetStateString( aState ) << G4endl; 
200       G4RunManager::GetRunManager() -> BeamOn(    259       G4RunManager::GetRunManager() -> BeamOn(0);
201       beamFlag = true;                            260       beamFlag = true;
202    }                                              261    }
203                                                   262 
204 }                                                 263 }
205 // print a list of Nist elements and materials    264 // print a list of Nist elements and materials
206 void HadrontherapyInteractionParameters::ListO    265 void HadrontherapyInteractionParameters::ListOfNistMaterials(const G4String& vararg)
207 {                                                 266 {
208 /*                                                267 /*
209  $G4INSTALL/source/materials/src/G4NistElement    268  $G4INSTALL/source/materials/src/G4NistElementBuilder.cc
210  You can also construct a new material by the     269  You can also construct a new material by the ConstructNewMaterial method:
211  see $G4INSTALL/source/materials/src/G4NistMat    270  see $G4INSTALL/source/materials/src/G4NistMaterialBuilder.cc
212 */                                                271 */
213     // Get simplest full list                     272     // Get simplest full list
214      if (vararg =="list")                         273      if (vararg =="list")
215     {                                             274     {
216       const std::vector<G4String>& vec =  nist    275       const std::vector<G4String>& vec =  nistMat -> GetMaterialNames(); 
217       for (size_t i=0; i<vec.size(); i++)         276       for (size_t i=0; i<vec.size(); i++)
218        {                                          277        {
219           G4cout << std::setw(12) << std::left    278           G4cout << std::setw(12) << std::left << i+1 << vec[i] << G4endl;
220        }                                          279        }
221       G4cout << G4endl;                           280       G4cout << G4endl;
222           }                                       281           }
223     else if (vararg =="all" || vararg =="simpl    282     else if (vararg =="all" || vararg =="simple" || vararg =="compound" || vararg =="hep" )
224   {                                               283   {
225     nistMat -> ListMaterials(vararg);             284     nistMat -> ListMaterials(vararg);
226   }                                               285   }
227 }                                                 286 }
228                                                   287 
229                                                   288 
230                                                   289