// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // neutron_hp -- source file // J.P. Wellisch, Nov-1996 // A prototype of the low energy neutron transport model. // // 24-Jan-07 Enable to use exact data only and add warnig when substitute file is used T. Koi // 30-Jan-07 Modified method of searching substitute isotope data by T. Koi // 07-06-12 fix memory leaking by T. Koi // 07-06-25 Change data selection logic when G4NEUTRONHP_SKIP_MISSING_ISOTOPES is turn on // Natural Abundance data are allowed. by T. Koi // 07-07-06 Allow _nat_ final state even for isotoped cross sections by T. Koi // 08-09-01 Add protection that deuteron data do not selected for hydrogen and so on by T. Koi // #include "G4NeutronHPNames.hh" #include "G4SandiaTable.hh" #include "G4HadronicException.hh" #include const G4String G4NeutronHPNames::theString[99] = {"Hydrogen", "Helium", "Lithium", "Berylium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminum", "Silicon", "Phosphorous", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", "Bromine", "Krypton", "Rubidium", "Strontium", "Yttrium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium", "Silver", "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Cesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", "Promethium", "Samarium", "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinium", "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium", "Actinium ", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium", "Americium", "Curium", "Berkelium", "Californium", "Einsteinium"}; G4String G4NeutronHPNames::GetName(G4int i) { return theString[i]; } G4NeutronHPDataUsed G4NeutronHPNames::GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool & aFlag) { G4NeutronHPDataUsed result; aFlag = true; if(getenv("NeutronHPNames")) G4cout << "Names::GetName entered for Z = " << Z << ", A = " << A <92.5&&!getenv("AllowForHeavyElements") ) { G4cerr << "Please contact Hans-Peter.Wellisch@cern.ch"<92 are not provided"); } G4String * theName = 0; G4String theFileName(""); // G4int inc = 1; G4int flip_Z = 1; G4int delta_Z = 0; G4int flip_A = 1; G4int delta_A = 0; std::ifstream * check = new std::ifstream(".dummy"); G4bool first = true; if(getenv("NeutronHPNames")) G4cout << "entered GetName!!!"<close(); delete check; } check = new std::ifstream(*theName); if ( !(*check) ) { check->close(); delete check; check = 0; aFlag = false; if ( first ) { aFlag = true; first = false; biff = new G4String(); // delete here as theName *biff = base+"/"+"CrossSection/"+itoa(myZ)+"_"+"nat"+"_"+theString[myZ-1]; if(theName!=0) delete theName; theName = biff; if(getenv("NeutronHPNames")) G4cout <<"HPWD 2 "<<*theName<close(); delete check; check = 0; aFlag = false; } else { biff = new G4String(); // delete here as theName if(theName!=0) delete theName; *biff = base+"/"+rest+itoa(myZ)+"_"+"nat"+"_"+theString[myZ-1]; theName = biff; if(getenv("NeutronHPNames")) G4cout <<"HPWD 3 "<<*theName<theMaxOffSet||myZ==0||myA==0) if ( delta_Z > theMaxOffSet ) { //if ( inc > 0 ) //{ // inc*= -1; // myZ = Z; // myA = A; //} //else //{ G4cout <<"G4NeutronHPNames: Sorry, this material does not come near to any data."< theMaxOffSet ) if ( delta_A > 2*theMaxOffSet ) { delta_A = 0; flip_A = 1; first = true; if ( flip_Z > 0 ) { delta_Z +=1; } myZ = Z + flip_Z * delta_Z; flip_Z *= -1; myA = A; if ( myZ > 99 ) { myZ = 99; } if ( myZ < 1 ) { myZ = 1; } // myZ += inc; } else { if ( flip_A > 0 ) { delta_A += 1; } myA = A + flip_A * delta_A; flip_A *= -1; if ( myA < 1 ) { myA = 1; } // myA += inc; } } while( myZ == 0 || myA == 0 ); // No meaning } while((!check) || (!(*check))); if(getenv("NeutronHPNamesLogging") || getenv("NeutronHPNames")) { G4cout << "Names::GetName: last theName proposal = "<< G4endl; G4cout << *theName <<" "<close(); delete check; check = 0; } return result; }