00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 /* 00027 # <<BEGIN-copyright>> 00028 # Copyright (c) 2010, Lawrence Livermore National Security, LLC. 00029 # Produced at the Lawrence Livermore National Laboratory 00030 # Written by Bret R. Beck, beck6@llnl.gov. 00031 # CODE-461393 00032 # All rights reserved. 00033 # 00034 # This file is part of GIDI. For details, see nuclear.llnl.gov. 00035 # Please also read the "Additional BSD Notice" at nuclear.llnl.gov. 00036 # 00037 # Redistribution and use in source and binary forms, with or without modification, 00038 # are permitted provided that the following conditions are met: 00039 # 00040 # 1) Redistributions of source code must retain the above copyright notice, 00041 # this list of conditions and the disclaimer below. 00042 # 2) Redistributions in binary form must reproduce the above copyright notice, 00043 # this list of conditions and the disclaimer (as noted below) in the 00044 # documentation and/or other materials provided with the distribution. 00045 # 3) Neither the name of the LLNS/LLNL nor the names of its contributors may be 00046 # used to endorse or promote products derived from this software without 00047 # specific prior written permission. 00048 # 00049 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 00050 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00051 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 00052 # SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR 00053 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00054 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00055 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00056 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00057 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00058 # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00059 # <<END-copyright>> 00060 */ 00061 #ifndef G4GIDI_h_included 00062 #define G4GIDI_h_included 1 00063 00064 #include <string> 00065 #include <list> 00066 #include <vector> 00067 00068 #include <G4GIDI_Misc.hh> 00069 #include <G4GIDI_map.hh> 00070 #include <G4GIDI_target.hh> 00071 #include <G4GIDI_mass.hh> 00072 00073 class G4GIDI { 00074 00075 private: 00076 int projectileID; 00077 std::list<G4GIDI_map *> dataDirectories; 00078 std::vector<G4GIDI_target *> targets; 00079 00080 int init( int ip ); 00081 00082 public: 00083 G4GIDI( int ip, std::string &dataDirectory ); 00084 G4GIDI( int ip, std::list<std::string> &dataDirectory ); 00085 ~G4GIDI( ); 00086 00087 int numberOfDataDirectories( void ); 00088 int addDataDirectory( std::string &dataDirectory ); 00089 int removeDataDirectory( std::string &dataDirectory ); 00090 std::string getDataDirectoryAtIndex( int index ); 00091 std::vector<std::string> *getDataDirectories( void ); 00092 00093 bool isThisDataAvailable( std::string &lib_name, int iZ, int iA, int iM = 0 ); 00094 bool isThisDataAvailable( std::string &lib_name, std::string &targetName ); 00095 00096 char *dataFilename( std::string &lib_name, int iZ, int iA, int iM = 0 ); 00097 char *dataFilename( std::string &lib_name, std::string &targetName ); 00098 00099 std::vector<std::string> *getNamesOfAvailableLibraries( int iZ, int iA, int iM = 0 ); 00100 std::vector<std::string> *getNamesOfAvailableLibraries( std::string &targetName ); 00101 00102 std::vector<std::string> *getNamesOfAvailableTargets( void ); 00103 00104 G4GIDI_target *readTarget( std::string &lib_name, int iZ, int iA, int iM = 0, bool bind = true ); 00105 G4GIDI_target *readTarget( std::string &lib_name, std::string &targetName, bool bind = true ); 00106 00107 G4GIDI_target *getAlreadyReadTarget( int iZ, int iA, int iM = 0 ); 00108 G4GIDI_target *getAlreadyReadTarget( std::string &targetName ); 00109 00110 int freeTarget( int iZ, int iA, int iM = 0 ); 00111 int freeTarget( std::string &targetSymbol ); 00112 int freeTarget( G4GIDI_target *target ); 00113 00114 std::vector<std::string> *getListOfReadTargetsNames( void ); 00115 }; 00116 00117 #endif // End of G4GIDI_h_included