Geant4 Cross Reference |
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 # <<BEGIN-copyright>> 27 # <<BEGIN-copyright>> >> 28 # Copyright (c) 2010, Lawrence Livermore National Security, LLC. >> 29 # Produced at the Lawrence Livermore National Laboratory >> 30 # Written by Bret R. Beck, beck6@llnl.gov. >> 31 # CODE-461393 >> 32 # All rights reserved. >> 33 # >> 34 # This file is part of GIDI. For details, see nuclear.llnl.gov. >> 35 # Please also read the "Additional BSD Notice" at nuclear.llnl.gov. >> 36 # >> 37 # Redistribution and use in source and binary forms, with or without modification, >> 38 # are permitted provided that the following conditions are met: >> 39 # >> 40 # 1) Redistributions of source code must retain the above copyright notice, >> 41 # this list of conditions and the disclaimer below. >> 42 # 2) Redistributions in binary form must reproduce the above copyright notice, >> 43 # this list of conditions and the disclaimer (as noted below) in the >> 44 # documentation and/or other materials provided with the distribution. >> 45 # 3) Neither the name of the LLNS/LLNL nor the names of its contributors may be >> 46 # used to endorse or promote products derived from this software without >> 47 # specific prior written permission. >> 48 # >> 49 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY >> 50 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES >> 51 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT >> 52 # SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR >> 53 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >> 54 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS >> 55 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED >> 56 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >> 57 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, >> 58 # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 # <<END-copyright>> 59 # <<END-copyright>> 29 */ 60 */ >> 61 30 #include "G4GIDI_map.hh" 62 #include "G4GIDI_map.hh" 31 63 >> 64 using namespace std; 32 using namespace GIDI; 65 using namespace GIDI; 33 66 34 /* 67 /* 35 ********************************************** 68 *************************************************************** 36 */ 69 */ 37 G4GIDI_map::G4GIDI_map( const std::string &dat << 70 G4GIDI_map::G4GIDI_map( string &dataDirectory ) { 38 71 39 smr_initialize( &smr, smr_status_Ok, 0 ); << 72 smr_initialize( &smr ); 40 map = MCGIDI_map_readFile( &smr, NULL, dat << 73 map = tpia_map_readFile( &smr, NULL, dataDirectory.c_str( ) ); 41 if( !smr_isOk( &smr ) ) { 74 if( !smr_isOk( &smr ) ) { 42 smr_print( &smr, 1 ); << 75 smr_print( &smr, stderr, 1 ); 43 throw 1; 76 throw 1; 44 } 77 } 45 } 78 } 46 /* 79 /* 47 ********************************************** 80 *************************************************************** 48 */ 81 */ 49 G4GIDI_map::~G4GIDI_map( void ) { 82 G4GIDI_map::~G4GIDI_map( void ) { 50 83 51 if( map != NULL ) MCGIDI_map_free( NULL, m << 84 if( map != NULL ) tpia_map_free( NULL, map ); 52 smr_release( &smr ); 85 smr_release( &smr ); 53 } 86 } 54 /* 87 /* 55 ********************************************** 88 *************************************************************** 56 */ 89 */ 57 std::string G4GIDI_map::fileName( void ) { << 90 string G4GIDI_map::fileName( void ) { 58 91 59 return( map->mapFileName ); 92 return( map->mapFileName ); 60 } 93 } 61 /* 94 /* 62 ********************************************** 95 *************************************************************** 63 */ 96 */ 64 std::string G4GIDI_map::path( void ) { << 97 string G4GIDI_map::path( void ) { 65 98 66 return( map->path ); 99 return( map->path ); 67 } 100 } 68 101