Geant4  10.02.p01
G4NuclearLevelStore.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4NuclearLevelStore.hh 88406 2015-02-18 09:13:29Z gcosmo $
27 //
28 // 04-10-2010 M. Kelsey -- Replace G4String keys with integers (ZZZAAA),
29 // move string operation to GenerateFilename()
30 // 17-11-2010 V. Ivanchenko - make as a classical singleton.
31 //
32 // 17-10-2011 L. Desorgher -- Allow the user to replace the radioactive
33 // decay data provided in Geant4 by its own data file for
34 // a given isotope
35 // 06-01-2012 V. Ivanchenko - added nuclear level data structure for
36 // usage in HEP where internal conversion is neglected;
37 // cleanup the code; new method GetLevelManager
38 // 19-11-2014 M. Asai - protection against reading the same file from
39 // more than one worker threads
40 
41 #ifndef G4NuclearLevelStore_hh
42 #define G4NuclearLevelStore_hh 1
43 
44 #include "G4NuclearLevelManager.hh"
46 #include "globals.hh"
47 #include <map>
48 
50 {
51 
53 
54 private:
55 
57 
58 public:
59 
61 
63 
65 
67  const G4String& filename);
68 
69 private:
70 
71  G4int GenerateKey(G4int Z, G4int A) const { return Z*1000+A; }
72 
74 
75  typedef std::map<G4int,G4NuclearLevelManager*> ManagersMap;
76 
77  ManagersMap theManagers;
78 
80 
82 #ifdef G4MULTITHREADED
83  static G4NuclearLevelStore* theShadowInstance;
84 #endif
85 
87  std::map<G4int, G4String> theUserDataFiles;
88 
89 #ifdef G4MULTITHREADED
90 public:
91  static G4Mutex nuclearLevelStoreMutex;
92 #endif
93 };
94 #endif
std::map< G4int, G4String > theUserDataFiles
static G4NuclearLevelStore * GetInstance()
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
static G4ThreadLocal G4NuclearLevelStore * theInstance
void AddUserEvaporationDataFile(G4int Z, G4int A, const G4String &filename)
double A(double temperature)
bool G4bool
Definition: G4Types.hh:79
G4int GenerateKey(G4int Z, G4int A) const
G4NuclearLevelManager * GetManager(G4int Z, G4int A)
G4int G4Mutex
Definition: G4Threading.hh:173
G4String GenerateFileName(G4int Z, G4int A) const
std::map< G4int, G4NuclearLevelManager * > ManagersMap