Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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$
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
54class G4LevelReader;
55
57{
58
59public:
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
72private:
73
74 G4LevelManager(const G4LevelManager & right);
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;
80 G4int nLevels;
81 G4int theZ;
82 G4int theA;
83 G4double fEdiffMax;
84};
85
87{
88 return nLevels;
89}
90
92{
93 return fLevel[i];
94}
95
96inline 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
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4int NumberOfLevels() const
const G4NucLevel * GetLevel(G4int i) const
const G4NucLevel * NearestLevel(G4double energy) const
G4double LevelEnergy() const
Definition: G4NucLevel.hh:85