Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4LENDManager Class Reference

#include <G4LENDManager.hh>

Public Member Functions

G4GIDI_targetGetLENDTarget (G4ParticleDefinition *, 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)
 

Static Public Member Functions

static G4LENDManagerGetInstance ()
 

Detailed Description

Definition at line 63 of file G4LENDManager.hh.

Member Function Documentation

static 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  };

Here is the caller graph for this function:

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

Definition at line 174 of file G4LENDManager.cc.

175 {
176 
177  G4GIDI_target* anLENDTarget = NULL;
178 
179  if ( iM > 9 ) {
180  throw G4HadronicException(__FILE__, __LINE__, "Requested isomer level of target is too high." );
181  }
182 
183  G4int iTarg = GetNucleusEncoding( iZ , iA , iM );
184 
185  // Searching in current map
186  for ( std::vector < lend_target >::iterator
187  it = v_lend_target.begin() ; it != v_lend_target.end() ; it++ )
188  {
189  if ( it->proj == proj && it->target_code == iTarg && it->evaluation == evaluation )
190  {
191  //find!
192  return it->target;
193  }
194  }
195 
196 
197  if ( proj_lend_map.find ( proj ) == proj_lend_map.end() ) {
198  G4cout << proj->GetParticleName() << " is not supported by this LEND library." << G4endl;
199  return anLENDTarget; // return NULL
200  }
201 
202  G4GIDI* xlend = proj_lend_map.find ( proj ) -> second;
203 
204  if ( xlend->isThisDataAvailable( evaluation, iZ, iA , iM ) )
205  {
206 
207  if ( verboseLevel > 1 ) {
208  G4cout << evaluation << " for " << ionTable->GetIonName( iZ , iA , 0 )
209  << " with Isomer level of " << iM << " is exist in this LEND." << G4endl;
210  }
211 
212  anLENDTarget = xlend->readTarget( evaluation , iZ , iA , iM );
213 
214  lend_target new_target;
215  new_target.lend = xlend;
216  new_target.target = anLENDTarget;
217  new_target.proj = proj;
218  new_target.evaluation = evaluation;
219  new_target.target_code = iTarg;
220 
221  v_lend_target.push_back( new_target );
222 
223 // found EXACT
224  return anLENDTarget;
225 
226  }
227  else
228  {
229 // NO EXACT DATA (Evaluatino & Z,A,M)
230 
231  //Searching available evaluation and natural abundance data and give suggestions.
232  //
233  if ( verboseLevel > 1 )
234  G4cout << evaluation << " for " << ionTable->GetIonName( iZ , iA , 0 )
235  << " with Isomer level of " << iM << " is not exist in this LEND." << G4endl;
236 
237  std::vector< std::string >* available = xlend->getNamesOfAvailableLibraries( iZ, iA , iM );
238  if ( available->size() > 0 ) {
239 // EXACT Z,A,M but Evaluation is different
240  if ( verboseLevel > 1 )
241  {
242  G4cout << " However you can use following evaluation(s) for the target. " << G4endl;
243 
244  std::vector< std::string >::iterator its;
245  for ( its = available->begin() ; its != available->end() ; its++ )
246  G4cout << *its << G4endl;
247 
248  G4cout << G4endl;
249  }
250  } else if ( xlend->isThisDataAvailable( evaluation, iZ, 0 , iM ) ) {
251 //
252 // checking natural abundance data for Z
253 //
254 // EXACT natural abundance data for the evaluation
255  if ( verboseLevel > 1 )
256  G4cout << " However you can use natural abundance data for the target. " << G4endl;
257  }
258  else
259  {
260  std::vector< std::string >* available_nat = xlend->getNamesOfAvailableLibraries( iZ, 0 , iM );
261 //
262  if ( available_nat->size() > 0 ) {
263 // EXACT natural abundance data for Z but differnet evaluation
264  if ( verboseLevel > 1 ) {
265  G4cout << " However you can use following evaluation(s) for natural abundace of the target. " << G4endl;
266 
267  std::vector< std::string >::iterator its;
268  for ( its = available_nat->begin() ; its != available_nat->end() ; its++ )
269  G4cout << *its << G4endl;
270  G4cout << G4endl;
271  }
272  }
273  delete available_nat;
274  }
275  delete available;
276 // return NULL if exact data is not available
277  return anLENDTarget; // return NULL
278  }
279 
280  return anLENDTarget;
281 }
G4String evaluation
static constexpr double second
Definition: G4SIunits.hh:157
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
const G4String & GetIonName(G4int Z, G4int A, G4int lvl=0) const
Definition: G4IonTable.cc:1094
G4int GetNucleusEncoding(G4int iZ, G4int iA, G4int iM)
G4ParticleDefinition * proj
G4GLOB_DLL std::ostream G4cout
std::vector< std::string > * getNamesOfAvailableLibraries(int iZ, int iA, int iM=0)
Definition: G4GIDI.cc:237
bool isThisDataAvailable(std::string &lib_name, int iZ, int iA, int iM=0)
Definition: G4GIDI.cc:169
G4GIDI_target * readTarget(std::string &lib_name, int iZ, int iA, int iM=0, bool bind=true)
Definition: G4GIDI.cc:289
G4int target_code
#define G4endl
Definition: G4ios.hh:61
G4GIDI_target * target
G4GIDI * lend
Definition: G4GIDI.hh:43

Here is the call graph for this function:

G4NistElementBuilder* G4LENDManager::GetNistElementBuilder ( )
inline

Definition at line 87 of file G4LENDManager.hh.

87 { return nistElementBuilder; };

Here is the caller graph for this function:

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

Definition at line 309 of file G4LENDManager.cc.

310 {
311  G4int value = ionTable->GetNucleusEncoding( iZ , iA ); // Ground State
312  // G4double E=0.0, G4int J=0);
313  value += iM;
314  return value;
315 }
static G4int GetNucleusEncoding(G4int Z, G4int A, G4double E=0.0, G4int lvl=0)
Definition: G4IonTable.cc:949
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the call graph for this function:

Here is the caller graph for this function:

G4int G4LENDManager::GetVerboseLevel ( )
inline

Definition at line 89 of file G4LENDManager.hh.

89 { return verboseLevel; };
std::vector< G4String > G4LENDManager::IsLENDTargetAvailable ( G4ParticleDefinition proj,
G4int  iZ,
G4int  iA,
G4int  iM = 0 
)

Definition at line 284 of file G4LENDManager.cc.

285 {
286 
287  std::vector< G4String > vEvaluation;
288  if ( proj_lend_map.find ( proj ) == proj_lend_map.end() )
289  {
290  G4cout << proj->GetParticleName() << " is not supported by this LEND." << G4endl;
291  return vEvaluation; // return empty
292  }
293 
294  G4GIDI* xlend = proj_lend_map.find ( proj ) -> second;
295  std::vector< std::string >* available = xlend->getNamesOfAvailableLibraries( iZ, iA , iM );
296 
297  if ( available->size() > 0 ) {
298  std::vector< std::string >::iterator its;
299  for ( its = available->begin() ; its != available->end() ; its++ )
300  vEvaluation.push_back ( *its );
301  }
302  delete available;
303 
304  return vEvaluation;
305 }
static constexpr double second
Definition: G4SIunits.hh:157
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
std::vector< std::string > * getNamesOfAvailableLibraries(int iZ, int iA, int iM=0)
Definition: G4GIDI.cc:237
#define G4endl
Definition: G4ios.hh:61
Definition: G4GIDI.hh:43

Here is the call graph for this function:

G4bool G4LENDManager::RequestChangeOfVerboseLevel ( G4int  newValue)

Definition at line 357 of file G4LENDManager.cc.

358 {
359  G4bool result=false;
360  if ( newValue >= verboseLevel)
361  {
362  verboseLevel = newValue;
363  result=true;
364  }
365  else
366  {
367  G4cout << "Since other LEND model or cross section have set the higher verbose level (" << verboseLevel << ") in LENDManager, you cannot change the value now." << G4endl;
368  }
369 
370  return result;
371 }
G4double G4ParticleHPJENDLHEData::G4double result
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:


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