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)
G4NistElementBuilderGetNistElementBuilder ()
G4int GetVerboseLevel ()
G4bool RequestChangeOfVerboseLevel (G4int)

Static Public Member Functions

static G4LENDManagerGetInstance ()

Protected Member Functions

 G4LENDManager ()
 G4LENDManager (const G4LENDManager &)
 ~G4LENDManager ()


Detailed Description

Definition at line 63 of file G4LENDManager.hh.


Constructor & Destructor Documentation

G4LENDManager::G4LENDManager (  )  [protected]

Definition at line 47 of file G4LENDManager.cc.

References G4Neutron::Neutron().

Referenced by GetInstance().

00048 :verboseLevel( 0 )
00049 {
00050 
00051    printBanner();
00052 
00053    if(!getenv("G4LENDDATA")) 
00054       throw G4HadronicException(__FILE__, __LINE__, " Please setenv G4LENDDATA to point to the LEND files." );
00055 
00056    G4String xmcf = getenv("G4LENDDATA");
00057    xmcf = xmcf+"/xmcf.n_1.map";
00058 
00059 // for neutron
00060 
00061    G4GIDI* axLEND = new G4GIDI( 1 , xmcf );
00062 
00063    if ( proj_lend_map.find ( G4Neutron::Neutron() ) == proj_lend_map.end() )
00064    {
00065       proj_lend_map.insert ( std::pair < G4ParticleDefinition* , G4GIDI* > ( G4Neutron::Neutron() , axLEND ) ); 
00066    }
00067       
00068    v_lend_target.clear();
00069 
00070    ionTable = new G4IonTable();
00071    nistElementBuilder = new G4NistElementBuilder( 0 );
00072 
00073 }

G4LENDManager::G4LENDManager ( const G4LENDManager  )  [inline, protected]

Definition at line 70 of file G4LENDManager.hh.

00070 {;};

G4LENDManager::~G4LENDManager (  )  [protected]

Definition at line 77 of file G4LENDManager.cc.

00078 {
00079    
00080 // deleting target
00081    for ( std::vector < lend_target >::iterator 
00082          it = v_lend_target.begin() ; it != v_lend_target.end() ; it++ )
00083    {
00084         (*it).lend->freeTarget( it->target ); 
00085    }
00086 
00087 // deleting lend
00088    for ( std::map < G4ParticleDefinition* , G4GIDI* >::iterator 
00089          it = proj_lend_map.begin() ; it != proj_lend_map.end() ; it++ )
00090    {
00091       delete it->second;
00092    }
00093 
00094    delete ionTable;
00095    delete nistElementBuilder;
00096 
00097 }


Member Function Documentation

static G4LENDManager* G4LENDManager::GetInstance (  )  [inline, static]

Definition at line 75 of file G4LENDManager.hh.

References G4LENDManager().

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

00076       {
00077          if ( lend_manager == NULL) lend_manager = new G4LENDManager();
00078          return lend_manager;
00079       };

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

Definition at line 101 of file G4LENDManager.cc.

References lend_target::evaluation, G4cout, G4endl, G4IonTable::GetIonName(), G4GIDI::getNamesOfAvailableLibraries(), G4IonTable::GetNucleusEncoding(), G4ParticleDefinition::GetParticleName(), G4GIDI::isThisDataAvailable(), lend_target::lend, lend_target::proj, G4GIDI::readTarget(), lend_target::target, and lend_target::target_code.

00102 {
00103 
00104    G4GIDI_target* anLENDTarget = NULL;
00105 
00106    G4int iTarg = ionTable->GetNucleusEncoding( iZ , iA );
00107                                                      // G4double E=0.0, G4int J=0);
00108 
00109    for ( std::vector < lend_target >::iterator 
00110          it = v_lend_target.begin() ; it != v_lend_target.end() ; it++ )
00111    {
00112 //    find the target
00113       if ( it->proj == proj && it->target_code == iTarg && it->evaluation == evaluation ) 
00114       {
00115          return it->target;
00116       }
00117    }
00118 
00119    if ( proj_lend_map.find ( proj ) == proj_lend_map.end() ) 
00120    {
00121       G4cout << proj->GetParticleName() << " is not supported by this LEND." << G4endl;
00122       return anLENDTarget; // return NULL 
00123    }
00124 
00125    G4GIDI* xlend = proj_lend_map.find ( proj ) -> second; 
00126 
00127    if ( xlend->isThisDataAvailable( evaluation, iZ, iA , iM ) )
00128    {
00129 
00130       if ( verboseLevel > 1 ) 
00131          G4cout << evaluation << " for " << ionTable->GetIonName( iZ , iA , 0 ) << " is exist in this LEND." << G4endl;
00132 
00133       anLENDTarget = xlend->readTarget( evaluation , iZ , iA , iM );
00134 
00135       lend_target new_target; 
00136       new_target.lend = xlend; 
00137       new_target.target = anLENDTarget; 
00138       new_target.proj = proj;
00139       new_target.evaluation = evaluation;
00140       new_target.target_code = iTarg;
00141       
00142       v_lend_target.push_back( new_target );
00143 
00144 //    found EXACT
00145       return anLENDTarget;
00146 
00147    }
00148    else 
00149    {
00150 //    NO EXACT DATA (Evaluatino & Z,A,M)
00151                                                                         // This is for ground state
00152       if ( verboseLevel > 1 ) 
00153          G4cout << evaluation << " for " << ionTable->GetIonName( iZ , iA , 0 ) << " is not exist in this LEND." << G4endl;
00154 
00155       std::vector< std::string >* available =  xlend->getNamesOfAvailableLibraries( iZ, iA , iM );
00156       if ( available->size() > 0 )
00157       {
00158 //       EXACT Z,A,M but Evaluation is different 
00159          if ( verboseLevel > 1 ) 
00160          {
00161             G4cout << " However you can use following evaluation(s) for the target. " << G4endl;
00162 
00163             std::vector< std::string >::iterator its;
00164             for ( its = available->begin() ; its != available->end() ; its++ ) 
00165                G4cout << *its << G4endl;
00166 
00167             G4cout << G4endl;
00168          }
00169       }
00170 //      
00171 //    checking natural abundance data for Z
00172 //
00173       else if ( xlend->isThisDataAvailable( evaluation, iZ, 0 , iM ) )
00174       {
00175 //       EXACT natural abundance data for the evaluation 
00176          if ( verboseLevel > 1 ) 
00177             G4cout << " However you can use natural abundance data for the target. " << G4endl;
00178       }
00179       else
00180       {
00181          std::vector< std::string >* available_nat =  xlend->getNamesOfAvailableLibraries( iZ, 0 , iM );
00182 //
00183          if ( available_nat->size() > 0 )
00184          {
00185 //          EXACT natural abundance data for Z but differnet evaluation
00186             if ( verboseLevel > 1 ) 
00187             {
00188                G4cout << " However you can use following evaluation(s) for natural abundace of the target. " << G4endl;
00189 
00190                std::vector< std::string >::iterator its;
00191                for ( its = available_nat->begin() ; its != available_nat->end() ; its++ ) 
00192                   G4cout << *its << G4endl;
00193                G4cout << G4endl;
00194             }
00195          }
00196       }
00197 
00198 //    return NULL if exact data is not available               
00199       return anLENDTarget; // return NULL   
00200    }
00201    
00202    return anLENDTarget; 
00203 }

G4NistElementBuilder* G4LENDManager::GetNistElementBuilder (  )  [inline]

Definition at line 86 of file G4LENDManager.hh.

Referenced by G4LENDModel::create_used_target_map(), and G4LENDCrossSection::create_used_target_map().

00086 { return nistElementBuilder; };

G4int G4LENDManager::GetNucleusEncoding ( G4int  iZ,
G4int  iA 
) [inline]

Definition at line 83 of file G4LENDManager.hh.

References G4IonTable::GetNucleusEncoding().

Referenced by G4LENDModel::ApplyYourself(), G4LENDInelastic::ApplyYourself(), G4LENDFission::ApplyYourself(), G4LENDElastic::ApplyYourself(), G4LENDCapture::ApplyYourself(), G4LENDModel::create_used_target_map(), G4LENDCrossSection::create_used_target_map(), and G4LENDCrossSection::GetIsoCrossSection().

00084       { return ionTable->GetNucleusEncoding( iZ , iA ); };

G4int G4LENDManager::GetVerboseLevel (  )  [inline]

Definition at line 88 of file G4LENDManager.hh.

00088 { return verboseLevel; };

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

Definition at line 207 of file G4LENDManager.cc.

References G4cout, G4endl, G4GIDI::getNamesOfAvailableLibraries(), and G4ParticleDefinition::GetParticleName().

00208 {
00209 
00210    std::vector< G4String > answer;
00211    if ( proj_lend_map.find ( proj ) == proj_lend_map.end() ) 
00212    {
00213       G4cout << proj->GetParticleName() << " is not supported by this LEND." << G4endl;
00214       return answer; // return NULL 
00215    }
00216 
00217    G4GIDI* xlend = proj_lend_map.find ( proj ) -> second; 
00218    std::vector< std::string >* available =  xlend->getNamesOfAvailableLibraries( iZ, iA , iM );
00219 
00220    if ( available->size() > 0 )
00221    {
00222       std::vector< std::string >::iterator its;
00223       for ( its = available->begin() ; its != available->end() ; its++ ) 
00224          answer.push_back ( *its );
00225    }
00226 
00227    return answer;
00228 }

G4bool G4LENDManager::RequestChangeOfVerboseLevel ( G4int   ) 

Definition at line 270 of file G4LENDManager.cc.

References G4cout, and G4endl.

Referenced by G4LENDModel::create_used_target_map(), and G4LENDCrossSection::create_used_target_map().

00271 {
00272    G4bool result=false;
00273    if ( newValue >= verboseLevel) 
00274    {
00275       verboseLevel = newValue;
00276       result=true;
00277    }
00278    else
00279    {
00280       G4cout << "Since other LEND model or cross section have set the higher verbose level (" << verboseLevel << ") in LENDManager, you cannot change the value now." << G4endl; 
00281    }
00282 
00283    return result;
00284 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:23 2013 for Geant4 by  doxygen 1.4.7