Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LENDManager Class Reference

#include <G4LENDManager.hh>

Public Member Functions

G4GIDI_targetGetLENDTarget (G4ParticleDefinition *, const G4String &, G4int iZ, G4int iA, G4int iM=0)
std::vector< G4StringIsLENDTargetAvailable (G4ParticleDefinition *, G4int iZ, G4int iA, G4int iM=0)
G4int GetNucleusEncoding (G4int iZ, G4int iA, G4int iM)
G4NistElementBuilderGetNistElementBuilder ()
G4int GetVerboseLevel ()
G4bool RequestChangeOfVerboseLevel (G4int)
G4double GetExcitationEnergyOfExcitedIsomer (G4int, G4int, G4int)

Static Public Member Functions

static G4LENDManagerGetInstance ()

Detailed Description

Definition at line 63 of file G4LENDManager.hh.

Member Function Documentation

◆ GetExcitationEnergyOfExcitedIsomer()

G4double G4LENDManager::GetExcitationEnergyOfExcitedIsomer ( G4int iZ,
G4int iA,
G4int iM )

Definition at line 390 of file G4LENDManager.cc.

391{
392 G4double EE = 0.0;
393 G4int nucCode = GetNucleusEncoding( iZ , iA , iM );
394 auto it = mExcitationEnergy.find( nucCode );
395 if ( it != mExcitationEnergy.cend() ) {
396 EE = it->second;
397 } else {
398 if ( iM == 0 ) {
399 G4cout << "G4LENDManager::GetExcitationEnergyOfExcitedIsomer is called for ground state (iM=0) nucleus" << G4endl;
400 } else {
401 G4cout << "Can not find excitation energy for Z = " << iZ << ", A = " << iA << ", M = " << iM << " and the energy set to 0." << G4endl;
402 }
403 }
404 return EE;
405}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4int GetNucleusEncoding(G4int iZ, G4int iA, G4int iM)

Referenced by G4LENDElastic::ApplyYourself().

◆ GetInstance()

G4LENDManager * G4LENDManager::GetInstance ( )
inlinestatic

Definition at line 77 of file G4LENDManager.hh.

78 {
79 if ( lend_manager == NULL) lend_manager = new G4LENDManager();
80 return lend_manager;
81 };

Referenced by G4LENDElastic::ApplyYourself(), G4LENDCrossSection::G4LENDCrossSection(), and G4LENDModel::G4LENDModel().

◆ GetLENDTarget()

G4GIDI_target * G4LENDManager::GetLENDTarget ( G4ParticleDefinition * proj,
const G4String & evaluation,
G4int iZ,
G4int iA,
G4int iM = 0 )

Definition at line 195 of file G4LENDManager.cc.

196{
197
198 G4GIDI_target* anLENDTarget = NULL;
199
200 if ( iM > 9 ) {
201 throw G4HadronicException(__FILE__, __LINE__, "Requested isomer level of target is too high." );
202 }
203
204 G4int iTarg = GetNucleusEncoding( iZ , iA , iM );
205
206 // Searching in current map
207 for ( auto it = v_lend_target.cbegin() ; it != v_lend_target.cend() ; ++it )
208 {
209 if ( it->proj == proj && it->target_code == iTarg && it->evaluation == evaluation )
210 {
211 //find!
212 return it->target;
213 }
214 }
215
216
217 if ( proj_lend_map.find ( proj ) == proj_lend_map.cend() ) {
218 G4cout << proj->GetParticleName() << " is not supported by this LEND library." << G4endl;
219 return anLENDTarget; // return NULL
220 }
221
222 G4GIDI* xlend = proj_lend_map.find ( proj ) -> second;
223
224 if ( xlend->isThisDataAvailable( evaluation, iZ, iA , iM ) )
225 {
226
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;
230 }
231
232 anLENDTarget = xlend->readTarget( evaluation , iZ , iA , iM );
233
234 lend_target new_target;
235 new_target.lend = xlend;
236 new_target.target = anLENDTarget;
237 new_target.proj = proj;
238 new_target.evaluation = evaluation;
239 new_target.target_code = iTarg;
240
241 v_lend_target.push_back( std::move(new_target) );
242
243// found EXACT
244 return anLENDTarget;
245
246 }
247 else
248 {
249// NO EXACT DATA (Evaluatino & Z,A,M)
250
251 //Searching available evaluation and natural abundance data and give suggestions.
252 //
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;
256
257 std::vector< std::string >* available = xlend->getNamesOfAvailableLibraries( iZ, iA , iM );
258 if ( available->size() > 0 ) {
259// EXACT Z,A,M but Evaluation is different
260 if ( verboseLevel > 1 )
261 {
262 G4cout << " However you can use following evaluation(s) for the target. " << G4endl;
263
264 for ( auto its = available->cbegin() ; its != available->cend() ; ++its )
265 G4cout << *its << G4endl;
266
267 G4cout << G4endl;
268 }
269 } else if ( xlend->isThisDataAvailable( evaluation, iZ, 0 , iM ) ) {
270//
271// checking natural abundance data for Z
272//
273// EXACT natural abundance data for the evaluation
274 if ( verboseLevel > 1 )
275 G4cout << " However you can use natural abundance data for the target. " << G4endl;
276 }
277 else
278 {
279 std::vector< std::string >* available_nat = xlend->getNamesOfAvailableLibraries( iZ, 0 , iM );
280//
281 if ( available_nat->size() > 0 ) {
282// EXACT natural abundance data for Z but differnet evaluation
283 if ( verboseLevel > 1 ) {
284 G4cout << " However you can use following evaluation(s) for natural abundace of the target. " << G4endl;
285
286 for ( auto its = available_nat->cbegin() ; its != available_nat->cend() ; ++its )
287 G4cout << *its << G4endl;
288 G4cout << G4endl;
289 }
290 }
291 delete available_nat;
292 }
293 delete available;
294// return NULL if exact data is not available
295 return anLENDTarget; // return NULL
296 }
297
298 return anLENDTarget;
299}
std::vector< std::string > * getNamesOfAvailableLibraries(G4int a_Z, G4int a_A, G4int a_M=0) const
Definition G4GIDI.cc:268
G4GIDI_target * readTarget(std::string const &lib_name, G4int a_Z, G4int a_A, G4int a_M=0, bool a_bind=true)
Definition G4GIDI.cc:331
bool isThisDataAvailable(std::string const &a_lib_name, G4int a_Z, G4int a_A, G4int a_M=0) const
Definition G4GIDI.cc:199
const G4String & GetParticleName() const
G4ParticleDefinition * proj
G4GIDI_target * target
G4GIDI * lend
G4String evaluation

◆ GetNistElementBuilder()

G4NistElementBuilder * G4LENDManager::GetNistElementBuilder ( )
inline

Definition at line 87 of file G4LENDManager.hh.

87{ return nistElementBuilder; };

◆ GetNucleusEncoding()

G4int G4LENDManager::GetNucleusEncoding ( G4int iZ,
G4int iA,
G4int iM )

Definition at line 326 of file G4LENDManager.cc.

327{
328 G4int value = ionTable->GetNucleusEncoding( iZ , iA ); // Ground State
329 // G4double E=0.0, G4int J=0);
330 value += iM;
331 return value;
332}

Referenced by GetExcitationEnergyOfExcitedIsomer(), and GetLENDTarget().

◆ GetVerboseLevel()

G4int G4LENDManager::GetVerboseLevel ( )
inline

Definition at line 89 of file G4LENDManager.hh.

89{ return verboseLevel; };

◆ IsLENDTargetAvailable()

std::vector< G4String > G4LENDManager::IsLENDTargetAvailable ( G4ParticleDefinition * proj,
G4int iZ,
G4int iA,
G4int iM = 0 )

Definition at line 302 of file G4LENDManager.cc.

303{
304
305 std::vector< G4String > vEvaluation;
306 if ( proj_lend_map.find ( proj ) == proj_lend_map.cend() )
307 {
308 G4cout << proj->GetParticleName() << " is not supported by this LEND." << G4endl;
309 return vEvaluation; // return empty
310 }
311
312 G4GIDI* xlend = proj_lend_map.find ( proj ) -> second;
313 std::vector< std::string >* available = xlend->getNamesOfAvailableLibraries( iZ, iA , iM );
314
315 if ( available->size() > 0 ) {
316 for ( auto its = available->cbegin() ; its != available->cend() ; ++its )
317 vEvaluation.push_back ( *its );
318 }
319 delete available;
320
321 return vEvaluation;
322}

◆ RequestChangeOfVerboseLevel()

G4bool G4LENDManager::RequestChangeOfVerboseLevel ( G4int newValue)

Definition at line 374 of file G4LENDManager.cc.

375{
376 G4bool result=false;
377 if ( newValue >= verboseLevel)
378 {
379 verboseLevel = newValue;
380 result=true;
381 }
382 else
383 {
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;
385 }
386
387 return result;
388}
bool G4bool
Definition G4Types.hh:86

The documentation for this class was generated from the following files: