Geant4  10.01
G4GIDI.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 /*
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.
59 # <<END-copyright>>
60 */
61 #ifndef G4GIDI_h_included
62 #define G4GIDI_h_included 1
63 
64 #include <string>
65 #include <list>
66 #include <vector>
67 
68 #include <G4GIDI_Misc.hh>
69 #include <G4GIDI_map.hh>
70 #include <G4GIDI_target.hh>
71 #include <G4GIDI_mass.hh>
72 
73 class G4GIDI {
74 
75  private:
77  std::list<G4GIDI_map *> dataDirectories;
78  std::vector<G4GIDI_target *> targets;
79 
80  int init( int ip );
81 
82  public:
83  G4GIDI( int ip, std::string &dataDirectory );
84  G4GIDI( int ip, std::list<std::string> &dataDirectory );
85  ~G4GIDI( );
86 
87  int numberOfDataDirectories( void );
88  int addDataDirectory( std::string &dataDirectory );
89  int removeDataDirectory( std::string &dataDirectory );
90  std::string getDataDirectoryAtIndex( int index );
91  std::vector<std::string> *getDataDirectories( void );
92 
93  bool isThisDataAvailable( std::string &lib_name, int iZ, int iA, int iM = 0 );
94  bool isThisDataAvailable( std::string &lib_name, std::string &targetName );
95 
96  char *dataFilename( std::string &lib_name, int iZ, int iA, int iM = 0 );
97  char *dataFilename( std::string &lib_name, std::string &targetName );
98 
99  std::vector<std::string> *getNamesOfAvailableLibraries( int iZ, int iA, int iM = 0 );
100  std::vector<std::string> *getNamesOfAvailableLibraries( std::string &targetName );
101 
102  std::vector<std::string> *getNamesOfAvailableTargets( void );
103 
104  G4GIDI_target *readTarget( std::string &lib_name, int iZ, int iA, int iM = 0, bool bind = true );
105  G4GIDI_target *readTarget( std::string &lib_name, std::string &targetName, bool bind = true );
106 
107  G4GIDI_target *getAlreadyReadTarget( int iZ, int iA, int iM = 0 );
108  G4GIDI_target *getAlreadyReadTarget( std::string &targetName );
109 
110  int freeTarget( int iZ, int iA, int iM = 0 );
111  int freeTarget( std::string &targetSymbol );
112  int freeTarget( G4GIDI_target *target );
113 
114  std::vector<std::string> *getListOfReadTargetsNames( void );
115 };
116 
117 #endif // End of G4GIDI_h_included
char * dataFilename(std::string &lib_name, int iZ, int iA, int iM=0)
Definition: G4GIDI.cc:211
std::vector< std::string > * getDataDirectories(void)
Definition: G4GIDI.cc:172
std::string getDataDirectoryAtIndex(int index)
Definition: G4GIDI.cc:155
G4GIDI_target * getAlreadyReadTarget(int iZ, int iA, int iM=0)
Definition: G4GIDI.cc:325
int init(int ip)
Definition: G4GIDI.cc:109
std::vector< G4GIDI_target * > targets
Definition: G4GIDI.hh:78
int numberOfDataDirectories(void)
Definition: G4GIDI.cc:117
int freeTarget(int iZ, int iA, int iM=0)
Definition: G4GIDI.cc:367
std::vector< std::string > * getNamesOfAvailableLibraries(int iZ, int iA, int iM=0)
Definition: G4GIDI.cc:240
bool isThisDataAvailable(std::string &lib_name, int iZ, int iA, int iM=0)
Definition: G4GIDI.cc:184
std::vector< std::string > * getListOfReadTargetsNames(void)
Definition: G4GIDI.cc:393
~G4GIDI()
Definition: G4GIDI.cc:90
G4GIDI_target * readTarget(std::string &lib_name, int iZ, int iA, int iM=0, bool bind=true)
Definition: G4GIDI.cc:293
std::list< G4GIDI_map * > dataDirectories
Definition: G4GIDI.hh:77
G4GIDI(int ip, std::string &dataDirectory)
Definition: G4GIDI.cc:72
int removeDataDirectory(std::string &dataDirectory)
Definition: G4GIDI.cc:140
int projectileID
Definition: G4GIDI.hh:76
int addDataDirectory(std::string &dataDirectory)
Definition: G4GIDI.cc:124
std::vector< std::string > * getNamesOfAvailableTargets(void)
Definition: G4GIDI.cc:275
Definition: G4GIDI.hh:73