Geant4  10.00.p01
G4LevelManager.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: G4LevelManager.hh 67983 2013-03-13 10:42:03Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 header file
31 //
32 // File name: G4NucLevel
33 //
34 // Author: V.Ivanchenko
35 //
36 // Creation date: 4 January 2012
37 //
38 // Modifications:
39 //
40 // -------------------------------------------------------------------
41 //
42 // Nuclear level manager for photon de-excitation process
43 // Providing management of levels for high energy generators
44 // The internal conversion is excluded because there are no atomic shell
45 //
46 
47 #ifndef G4LEVELMANAGER_HH
48 #define G4LEVELMANAGER_HH 1
49 
50 #include "globals.hh"
51 #include "G4NucLevel.hh"
52 #include <vector>
53 
54 class G4LevelReader;
55 
57 {
58 
59 public:
60 
62  const G4String& filename);
63 
65 
66  inline G4int NumberOfLevels() const;
67 
68  inline const G4NucLevel* GetLevel(G4int i) const;
69 
70  inline const G4NucLevel* NearestLevel(G4double energy) const;
71 
72 private:
73 
75  const G4LevelManager& operator=(const G4LevelManager &right);
76  G4bool operator==(const G4LevelManager &right) const;
77  G4bool operator!=(const G4LevelManager &right) const;
78 
79  std::vector<G4NucLevel*> fLevel;
84 };
85 
87 {
88  return nLevels;
89 }
90 
92 {
93  return fLevel[i];
94 }
95 
96 inline const G4NucLevel*
98 {
99  const G4NucLevel* p = 0;
100  if(energy < fLevel[nLevels-1]->LevelEnergy() + fEdiffMax) {
101  for(G4int i=nLevels-1; i>=0; --i) {
102  p = fLevel[i];
103  G4double lEnergy = p->LevelEnergy();
104  if(0 == i || energy > lEnergy) { break; }
105  if(lEnergy - energy <= 0.5*(lEnergy - fLevel[i-1]->LevelEnergy()))
106  { break; }
107  }
108  }
109  return p;
110 }
111 
112 #endif
const G4NucLevel * NearestLevel(G4double energy) const
G4double LevelEnergy() const
Definition: G4NucLevel.hh:85
G4int NumberOfLevels() const
G4bool operator!=(const G4LevelManager &right) const
int G4int
Definition: G4Types.hh:78
G4LevelManager(G4int Z, G4int A, G4LevelReader &reader, const G4String &filename)
const G4LevelManager & operator=(const G4LevelManager &right)
bool G4bool
Definition: G4Types.hh:79
G4bool operator==(const G4LevelManager &right) const
static const G4double A[nN]
const G4NucLevel * GetLevel(G4int i) const
G4double energy(const ThreeVector &p, const G4double m)
double G4double
Definition: G4Types.hh:76
std::vector< G4NucLevel * > fLevel
G4double fEdiffMax