G4NuclearLevelStore Class Reference

#include <G4NuclearLevelStore.hh>


Public Member Functions

G4NuclearLevelManagerGetManager (G4int Z, G4int A)
G4LevelManagerGetLevelManager (G4int Z, G4int A)
 ~G4NuclearLevelStore ()
void AddUserEvaporationDataFile (G4int Z, G4int A, const G4String &filename)

Static Public Member Functions

static G4NuclearLevelStoreGetInstance ()


Detailed Description

Definition at line 48 of file G4NuclearLevelStore.hh.


Constructor & Destructor Documentation

G4NuclearLevelStore::~G4NuclearLevelStore (  ) 

Definition at line 66 of file G4NuclearLevelStore.cc.

00067 {
00068   ManagersMap::iterator i;
00069   for (i = theManagers.begin(); i != theManagers.end(); ++i)
00070     { delete i->second; }
00071   MapForHEP::iterator j;
00072   for (j = managersForHEP.begin(); j != managersForHEP.end(); ++j)
00073     { delete j->second; }
00074   if(userFiles) {
00075     std::map<G4int, G4String>::iterator k;
00076     for (k = theUserDataFiles.begin(); k != theUserDataFiles.end(); ++k)
00077       { delete k->second; }
00078   }
00079 }


Member Function Documentation

void G4NuclearLevelStore::AddUserEvaporationDataFile ( G4int  Z,
G4int  A,
const G4String filename 
)

Definition at line 82 of file G4NuclearLevelStore.cc.

References G4cout, and G4endl.

Referenced by G4RadioactiveDecaymessenger::SetNewValue().

00084 { 
00085   if (Z<1 || A<2) {
00086     G4cout<<"G4NuclearLevelStore::AddUserEvaporationDataFile "
00087           <<" Z= " << Z << " and A= " << A << " not valid!"<<G4endl;
00088   }
00089 
00090   std::ifstream DecaySchemeFile(filename);
00091   if (DecaySchemeFile){
00092     G4int ID_ion=Z*1000+A;//A*1000+Z;
00093     theUserDataFiles[ID_ion]=filename;
00094     userFiles = true;
00095   }
00096   else {
00097     G4cout<<"The file "<<filename<<" does not exist!"<<G4endl;
00098   }
00099 }

G4NuclearLevelStore * G4NuclearLevelStore::GetInstance (  )  [static]

Definition at line 41 of file G4NuclearLevelStore.cc.

Referenced by G4RadioactiveDecay::AddDecayRateTable(), G4DiscreteGammaDeexcitation::CreateTransition(), G4ContinuumGammaDeexcitation::CreateTransition(), G4PromptPhotonEvaporation::G4PromptPhotonEvaporation(), and G4RadioactiveDecaymessenger::SetNewValue().

00042 {
00043   if(!theInstance) {
00044     static G4NuclearLevelStore store;
00045     theInstance = &store;
00046   }
00047   return theInstance;
00048 }

G4LevelManager * G4NuclearLevelStore::GetLevelManager ( G4int  Z,
G4int  A 
)

Definition at line 149 of file G4NuclearLevelStore.cc.

00150 {
00151   G4LevelManager * result = 0; 
00152   // Generate the key = filename
00153   G4int key = Z*1000+A; 
00154     
00155   // Check if already exists that key
00156   MapForHEP::iterator idx = managersForHEP.find(key);
00157   // If doesn't exists then create it
00158   if ( idx == managersForHEP.end() ) {
00159     result = new G4LevelManager(Z,A,reader,
00160                                 dirName + GenerateFileName(Z,A));
00161     managersForHEP.insert(std::make_pair(key,result));
00162 
00163     // it exists
00164   } else {
00165     result = idx->second;
00166   }
00167     
00168   return result; 
00169 }

G4NuclearLevelManager * G4NuclearLevelStore::GetManager ( G4int  Z,
G4int  A 
)

Definition at line 111 of file G4NuclearLevelStore.cc.

Referenced by G4RadioactiveDecay::AddDecayRateTable(), G4DiscreteGammaDeexcitation::CreateTransition(), G4ContinuumGammaDeexcitation::CreateTransition(), and G4PromptPhotonEvaporation::GetEmissionProbability().

00112 {
00113   G4NuclearLevelManager * result = 0; 
00114   if (A < 1 || Z < 1 || A < Z)
00115     {
00116       //G4cerr << "G4NuclearLevelStore::GetManager: Wrong values Z = " << Z 
00117       //               << " A = " << A << '\n';
00118       return result;
00119     }
00120 
00121   // Generate the key = filename
00122   G4int key = Z*1000+A; //GenerateKey(Z,A);
00123     
00124   // Check if already exists that key
00125   ManagersMap::iterator idx = theManagers.find(key);
00126   // If doesn't exists then create it
00127   if ( idx == theManagers.end() )
00128     {
00129       G4String file = dirName + GenerateFileName(Z,A);
00130 
00131       //Check if data have been provided by the user
00132       if(userFiles) {
00133         G4String file1 = theUserDataFiles[key];//1000*A+Z];
00134         if (file1 != "") { file = file1; }
00135       }
00136       result = new G4NuclearLevelManager(Z,A,file);
00137       theManagers.insert(std::make_pair(key,result));
00138     }
00139   // But if it exists...
00140   else
00141     {
00142       result = idx->second;
00143     }
00144     
00145   return result; 
00146 }


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