Geant4  10.00.p02
G4NuclearLevelManager.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: G4NuclearLevelManager.hh 77025 2013-11-20 16:11:51Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 // GEANT 4 class file
30 //
31 // CERN, Geneva, Switzerland
32 //
33 // File name: G4NuclearLevelManager
34 //
35 // Author: Maria Grazia Pia (pia@genova.infn.it)
36 //
37 // Creation date: 25 October 1998
38 //
39 // Modifications:
40 // 21 Nov. 2001, Fan Lei (flei@space.qinetiq.com)
41 // Added K->N+ internal conversion coefficiencies and their access
42 // functions
43 //
44 //
45 // 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
46 // Added half-life, angular momentum, parity, emissioni type
47 // reading from experimental data.
48 // 02 May 2003, Vladimir Ivanchenko remove rublic copy contructor
49 // 06 Oct 2010, M. Kelsey -- Use object storage, not pointers, drop
50 // public access to list
51 // -------------------------------------------------------------------
52 
53 #ifndef G4NUCLEARLEVELMANAGER_HH
54 #define G4NUCLEARLEVELMANAGER_HH 1
55 
56 #include <iosfwd>
57 #include <CLHEP/Units/SystemOfUnits.h>
58 
59 #include "globals.hh"
60 #include "G4PtrLevelVector.hh"
61 
62 class G4NuclearLevel;
63 
64 
66 {
67 
68 public:
69 
70  //G4NuclearLevelManager();
71  G4NuclearLevelManager(G4int Z, G4int A, const G4String& filename);
73 
75 
76  void SetNucleus(G4int Z, G4int A, const G4String& filename);
77 
78  inline G4bool IsValid() const { return _validity; }
79 
80  inline G4int NumberOfLevels() const { return (_levels ? _levels->size() : 0); }
81 
82  const G4NuclearLevel* GetLevel(G4int i) const;
83 
85  G4double eDiffMax=9999.*CLHEP::GeV) const;
86 
87  const G4NuclearLevel* LowestLevel() const;
88  const G4NuclearLevel* HighestLevel() const;
89 
90  G4double MinLevelEnergy() const;
91  G4double MaxLevelEnergy() const;
92 
93  void PrintAll();
94 
95 private:
97  G4bool operator==(const G4NuclearLevelManager &right) const;
98  G4bool operator!=(const G4NuclearLevelManager &right) const;
99 
100  G4bool Read(std::ifstream& aDataFile);
101  G4bool ReadDataLine(std::ifstream& dataFile);
102  G4bool ReadDataItem(std::istream& dataFile, G4double& x);
103  void ProcessDataLine();
104 
105  void MakeLevels();
106  void ClearLevels();
107 
109  void AddDataToLevel(G4NuclearLevel* level);
110  void FinishLevel(G4NuclearLevel* level);
111 
117 
118  // Buffers for reading data file
119  char buffer[30]; // For doubles in scientific notation
137 };
138 
139 #endif
G4NuclearLevelManager(G4int Z, G4int A, const G4String &filename)
const G4NuclearLevel * HighestLevel() const
G4double MinLevelEnergy() const
G4NuclearLevel * UseLevelOrMakeNew(G4NuclearLevel *level)
G4bool Read(std::ifstream &aDataFile)
int G4int
Definition: G4Types.hh:78
G4bool ReadDataItem(std::istream &dataFile, G4double &x)
std::vector< G4NuclearLevel * > G4PtrLevelVector
void SetNucleus(G4int Z, G4int A, const G4String &filename)
const G4NuclearLevel * LowestLevel() const
const G4NuclearLevel * GetLevel(G4int i) const
bool G4bool
Definition: G4Types.hh:79
G4bool operator==(const G4NuclearLevelManager &right) const
static const double GeV
Definition: G4SIunits.hh:196
G4bool ReadDataLine(std::ifstream &dataFile)
static const G4double A[nN]
G4double energy(const ThreeVector &p, const G4double m)
void FinishLevel(G4NuclearLevel *level)
double G4double
Definition: G4Types.hh:76
const G4NuclearLevel * NearestLevel(G4double energy, G4double eDiffMax=9999.*CLHEP::GeV) const
void AddDataToLevel(G4NuclearLevel *level)
G4double MaxLevelEnergy() const
G4bool operator!=(const G4NuclearLevelManager &right) const
const G4NuclearLevelManager & operator=(const G4NuclearLevelManager &right)