56G4LENDManager::G4LENDManager()
63 if( dataDir == NULL ) {
64 throw G4HadronicException(__FILE__, __LINE__,
" Please setenv G4LENDDATA to point to the LEND files." );
67 std::string G4LENDDATA(dataDir);
70 G4String xmcf = G4LENDDATA +
"/neutrons.map";
71 G4String xmcf_gamma = G4LENDDATA +
"/gammas.map";
72 G4String xmcf_p = G4LENDDATA +
"/protons.map";
73 G4String xmcf_d = G4LENDDATA +
"/deuterons.map";
74 G4String xmcf_t = G4LENDDATA +
"/tritons.map";
75 G4String xmcf_h = G4LENDDATA +
"/helions.map";
76 G4String xmcf_a = G4LENDDATA +
"/alphas.map";
84 proj_lend_map.insert ( std::pair < G4ParticleDefinition* , G4GIDI* > (
G4Neutron::Neutron() ,
new G4GIDI( 1 , xmcf ) ) );
86 proj_lend_map.insert ( std::pair < G4ParticleDefinition* , G4GIDI* > (
G4Gamma::Gamma() ,
new G4GIDI( 0 , xmcf_gamma ) ) );
89 aFile.open( xmcf_p.c_str() );
92 proj_lend_map.insert ( std::pair < G4ParticleDefinition* , G4GIDI* > (
G4Proton::Proton() ,
new G4GIDI( 2 , xmcf_p ) ) );
96 aFile.open( xmcf_d.c_str() );
103 aFile.open( xmcf_t.c_str() );
104 if ( aFile.good() ) {
106 proj_lend_map.insert ( std::pair < G4ParticleDefinition* , G4GIDI* > (
G4Triton::Triton() ,
new G4GIDI( 4 , xmcf_t ) ) );
110 aFile.open( xmcf_h.c_str() );
111 if ( aFile.good() ) {
113 proj_lend_map.insert ( std::pair < G4ParticleDefinition* , G4GIDI* > (
G4He3::He3() ,
new G4GIDI( 5 , xmcf_h ) ) );
117 aFile.open( xmcf_a.c_str() );
118 if ( aFile.good() ) {
120 proj_lend_map.insert ( std::pair < G4ParticleDefinition* , G4GIDI* > (
G4Alpha::Alpha() ,
new G4GIDI( 6 , xmcf_a ) ) );
129 v_lend_target.clear();
138 pdgCode= 10000 * 27 + 10 * 58 + 1;
139 pdgCode = GetNucleusEncoding( 27 , 58 , 1 );
140 mExcitationEnergy.insert(std::pair<G4int,G4double>( pdgCode, 24890 *CLHEP::eV));
141 pdgCode= 10000 * 47 + 10 * 110 + 1;
142 pdgCode = GetNucleusEncoding( 47 , 110 , 1 );
143 mExcitationEnergy.insert(std::pair<G4int,G4double>( pdgCode, 117590 *CLHEP::eV));
144 pdgCode= 10000 * 48 + 10 * 115 + 1;
145 pdgCode = GetNucleusEncoding( 48 , 115 , 1 );
146 mExcitationEnergy.insert(std::pair<G4int,G4double>( pdgCode, 181000 *CLHEP::eV));
147 pdgCode= 10000 * 52 + 10 * 127 + 1;
148 pdgCode = GetNucleusEncoding( 52 , 127 , 1 );
149 mExcitationEnergy.insert(std::pair<G4int,G4double>( pdgCode, 88260 *CLHEP::eV));
150 pdgCode= 10000 * 52 + 10 * 129 + 1;
151 pdgCode = GetNucleusEncoding( 52 , 129 , 1 );
152 mExcitationEnergy.insert(std::pair<G4int,G4double>( pdgCode, 105280 *CLHEP::eV));
153 pdgCode= 10000 * 61 + 10 * 148 + 1;
154 pdgCode = GetNucleusEncoding( 61 , 148 , 1 );
155 mExcitationEnergy.insert(std::pair<G4int,G4double>( pdgCode, 137900 *CLHEP::eV));
156 pdgCode= 10000 * 67 + 10 * 166 + 1;
157 pdgCode = GetNucleusEncoding( 67 , 166 , 1 );
158 mExcitationEnergy.insert(std::pair<G4int,G4double>( pdgCode, 5985 *CLHEP::eV));
159 pdgCode= 10000 * 95 + 10 * 242 + 1;
160 pdgCode = GetNucleusEncoding( 95 , 242 , 1 );
161 mExcitationEnergy.insert(std::pair<G4int,G4double>( pdgCode, 48600 *CLHEP::eV));
162 pdgCode= 10000 * 95 + 10 * 244 + 1;
163 pdgCode = GetNucleusEncoding( 95 , 244 , 1 );
164 mExcitationEnergy.insert(std::pair<G4int,G4double>( pdgCode, 87999.9*CLHEP::eV));
165 pdgCode= 10000 * 99 + 10 * 254 + 1;
166 pdgCode = GetNucleusEncoding( 99 , 254 , 1 );
167 mExcitationEnergy.insert(std::pair<G4int,G4double>( pdgCode, 84200 *CLHEP::eV));
173G4LENDManager::~G4LENDManager()
177 for (
auto it = v_lend_target.cbegin() ; it != v_lend_target.cend() ; ++it )
179 (*it).lend->freeTarget( it->target );
183 for (
auto it = proj_lend_map.cbegin() ; it != proj_lend_map.cend() ; ++it )
189 delete nistElementBuilder;
201 throw G4HadronicException(__FILE__, __LINE__,
"Requested isomer level of target is too high." );
207 for (
auto it = v_lend_target.cbegin() ; it != v_lend_target.cend() ; ++it )
209 if ( it->proj == proj && it->target_code == iTarg && it->evaluation == evaluation )
217 if ( proj_lend_map.find ( proj ) == proj_lend_map.cend() ) {
222 G4GIDI* xlend = proj_lend_map.find ( proj ) -> second;
227 if ( verboseLevel > 1 ) {
228 G4cout << evaluation <<
" for " << ionTable->GetIonName( iZ , iA , 0 )
229 <<
" with Isomer level of " << iM <<
" is exist in this LEND." <<
G4endl;
232 anLENDTarget = xlend->
readTarget( evaluation , iZ , iA , iM );
235 new_target.
lend = xlend;
236 new_target.
target = anLENDTarget;
237 new_target.
proj = proj;
241 v_lend_target.push_back( std::move(new_target) );
253 if ( verboseLevel > 1 )
254 G4cout << evaluation <<
" for " << ionTable->GetIonName( iZ , iA , 0 )
255 <<
" with Isomer level of " << iM <<
" is not exist in this LEND." <<
G4endl;
258 if ( available->size() > 0 ) {
260 if ( verboseLevel > 1 )
262 G4cout <<
" However you can use following evaluation(s) for the target. " <<
G4endl;
264 for (
auto its = available->cbegin() ; its != available->cend() ; ++its )
274 if ( verboseLevel > 1 )
275 G4cout <<
" However you can use natural abundance data for the target. " <<
G4endl;
281 if ( available_nat->size() > 0 ) {
283 if ( verboseLevel > 1 ) {
284 G4cout <<
" However you can use following evaluation(s) for natural abundace of the target. " <<
G4endl;
286 for (
auto its = available_nat->cbegin() ; its != available_nat->cend() ; ++its )
291 delete available_nat;
305 std::vector< G4String > vEvaluation;
306 if ( proj_lend_map.find ( proj ) == proj_lend_map.cend() )
312 G4GIDI* xlend = proj_lend_map.find ( proj ) -> second;
315 if ( available->size() > 0 ) {
316 for (
auto its = available->cbegin() ; its != available->cend() ; ++its )
317 vEvaluation.push_back ( *its );
328 G4int value = ionTable->GetNucleusEncoding( iZ , iA );
336void G4LENDManager::printBanner()
339 G4cout <<
" Copyright (c) 2010, Lawrence Livermore National Security, LLC. " <<
G4endl;
340 G4cout <<
" Produced at the Lawrence Livermore National Laboratory " <<
G4endl;
341 G4cout <<
" Written by Bret R. Beck, beck6@llnl.gov. " <<
G4endl;
345 G4cout <<
" This file is part of GIDI. For details, see nuclear.llnl.gov. " <<
G4endl;
346 G4cout <<
" Please also read the \"Additional BSD Notice\" at nuclear.llnl.gov. " <<
G4endl;
348 G4cout <<
" Redistribution and use in source and binary forms, with or without modification, " <<
G4endl;
349 G4cout <<
" are permitted provided that the following conditions are met: " <<
G4endl;
351 G4cout <<
" 1) Redistributions of source code must retain the above copyright notice, " <<
G4endl;
352 G4cout <<
" this list of conditions and the disclaimer below. " <<
G4endl;
353 G4cout <<
" 2) Redistributions in binary form must reproduce the above copyright notice, " <<
G4endl;
354 G4cout <<
" this list of conditions and the disclaimer (as noted below) in the " <<
G4endl;
355 G4cout <<
" documentation and/or other materials provided with the distribution. " <<
G4endl;
356 G4cout <<
" 3) Neither the name of the LLNS/LLNL nor the names of its contributors may be " <<
G4endl;
357 G4cout <<
" used to endorse or promote products derived from this software without " <<
G4endl;
358 G4cout <<
" specific prior written permission. " <<
G4endl;
360 G4cout <<
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY " <<
G4endl;
361 G4cout <<
" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES " <<
G4endl;
362 G4cout <<
" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT " <<
G4endl;
363 G4cout <<
" SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR " <<
G4endl;
364 G4cout <<
" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR " <<
G4endl;
365 G4cout <<
" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS " <<
G4endl;
366 G4cout <<
" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED " <<
G4endl;
367 G4cout <<
" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT " <<
G4endl;
368 G4cout <<
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, " <<
G4endl;
369 G4cout <<
" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. " <<
G4endl;
377 if ( newValue >= verboseLevel)
379 verboseLevel = newValue;
384 G4cout <<
"Since other LEND model or cross section have set the higher verbose level (" << verboseLevel <<
") in LENDManager, you cannot change the value now." <<
G4endl;
394 auto it = mExcitationEnergy.find( nucCode );
395 if ( it != mExcitationEnergy.cend() ) {
399 G4cout <<
"G4LENDManager::GetExcitationEnergyOfExcitedIsomer is called for ground state (iM=0) nucleus" <<
G4endl;
401 G4cout <<
"Can not find excitation energy for Z = " << iZ <<
", A = " << iA <<
", M = " << iM <<
" and the energy set to 0." <<
G4endl;
const char * G4FindDataDir(const char *)
void G4GIDI_initialize(std::string const &a_dataPath)
G4GLOB_DLL std::ostream G4cout
static G4Deuteron * Deuteron()
std::vector< std::string > * getNamesOfAvailableLibraries(G4int a_Z, G4int a_A, G4int a_M=0) const
G4GIDI_target * readTarget(std::string const &lib_name, G4int a_Z, G4int a_A, G4int a_M=0, bool a_bind=true)
bool isThisDataAvailable(std::string const &a_lib_name, G4int a_Z, G4int a_A, G4int a_M=0) const
G4double GetExcitationEnergyOfExcitedIsomer(G4int, G4int, G4int)
G4GIDI_target * GetLENDTarget(G4ParticleDefinition *, const G4String &, G4int iZ, G4int iA, G4int iM=0)
std::vector< G4String > IsLENDTargetAvailable(G4ParticleDefinition *, G4int iZ, G4int iA, G4int iM=0)
G4bool RequestChangeOfVerboseLevel(G4int)
G4int GetNucleusEncoding(G4int iZ, G4int iA, G4int iM)
static G4Neutron * Neutron()
const G4String & GetParticleName() const
G4IonTable * GetIonTable() const
static G4ParticleTable * GetParticleTable()
static G4Proton * Proton()
static G4Triton * Triton()
G4ParticleDefinition * proj