source: trunk/source/particles/management/src/G4NucleiPropertiesTableA.cc@ 1164

Last change on this file since 1164 was 992, checked in by garnier, 17 years ago

fichiers oublies

File size: 4.6 KB
RevLine 
[824]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//
[890]27// $Id: G4NucleiPropertiesTableA.cc,v 1.11 2008/10/23 13:34:59 kurasige Exp $
[992]28// GEANT4 tag $Name: geant4-09-02-ref-02 $
[824]29//
30// -------------------------------------------------------------------
31// GEANT 4 class file --- Copyright CERN 1997
32// CERN Geneva Switzerland
33//
34//
35// File name: G4NucleiPropertiesTable.cc
36//
37// Authors: Vicente Lara (Vicente.Lara@cern.ch)
38// Christian V'olcker (Christian.Volcker@cern.ch),
39//
40// Creation date: November 1997
41//
42// Modifications:
43// -------------------------------------------------------------------
44// Migrate into particles category by H.Kurashige (17 Nov. 98)
45// Remove "theInstance" by H.Kurashige (12 Dec. 03)
46
47#include "G4NucleiPropertiesTable.hh"
48
49// Class G4NucleiPropertiesTable
50
51// Determine the table index for a Nuclide with Z protons and A nucleons
52
53G4int G4NucleiPropertiesTable::GetIndex(G4int Z, G4int A)
54{
55 if(A>G4NucleiPropertiesTable::MaxA) {
56 G4Exception("G4NucleiPropertiesTable::GetIndex",
57 "Illegal arguemnt",
58 EventMustBeAborted,"Nucleon number larger than 273!");
59 } else if(A<1) {
60 G4Exception("G4NucleiPropertiesTable::GetIndex",
61 "Illegal arguemnt",
62 EventMustBeAborted," Nucleon number is negative!");
63 } else if(Z>A) {
64 G4Exception("G4NucleiPropertiesTable::GetIndex",
65 "Illegal arguemnt",
66 EventMustBeAborted, "Nucleon number smaller than Z!");
67 }
68
69 G4int i = shortTable[A-1];
70 while ( i < shortTable[A] ) {
71 if (indexArray[0][i] != Z ) {
72 i++;
73 } else {
74 return i;
75 }
76 }
77 return -1;
78}
79
80
81G4int G4NucleiPropertiesTable::MinZ(G4int A)
82{
83 G4int i = shortTable[A-1];
84 return indexArray[0][i];
85}
86
87
88G4int G4NucleiPropertiesTable::MaxZ(G4int A)
89{
90 G4int i = shortTable[A]-1;
91 return indexArray[0][i];
92}
93
94
95
96
97G4double G4NucleiPropertiesTable::GetNuclearMass(G4int Z, G4int A)
98{
99 G4int i=GetIndex(Z, A);
100 if (i >= 0){
101 const G4double NuclearMass = GetAtomicMass(Z,A) - G4double(Z)*electron_mass_c2 +
102 1.433e-5*MeV*std::pow(G4double(Z),2.39);
103 return NuclearMass;
104 } else {
105 return 0.0;
106 }
107}
108
109
110G4double G4NucleiPropertiesTable::GetMassExcess(G4int Z, G4int A)
111{
112 G4int i=GetIndex(Z, A);
113 if (i >= 0) {
114 return MassExcess[i]*keV;
115 } else {
116 return 0.0;
117 }
118}
119
120G4double G4NucleiPropertiesTable::GetBindingEnergy(G4int Z, G4int A)
121{
122 G4int i=GetIndex(Z, A);
123 if (i >= 0){
124 return (G4double(A-Z)*MassExcess[0] + G4double(Z)*MassExcess[1] - MassExcess[i])*keV;
125 } else {
126 return 0.0;
127 }
128}
129
130G4double G4NucleiPropertiesTable::GetBetaDecayEnergy(G4int Z, G4int A)
131{
132 G4int i=GetIndex(Z, A);
133 if (i >= 0){
134 return BetaEnergy[i]*keV;
135 } else {
136 return 0.0;
137 }
138}
139
140G4double G4NucleiPropertiesTable::GetAtomicMass(G4int Z, G4int A)
141{
142 G4int i=GetIndex(Z, A);
143 if (i >= 0){
144 return MassExcess[i]*keV + G4double(A)*amu_c2;
145 } else {
146 return 0.0;
147 }
148}
149
150
151G4bool G4NucleiPropertiesTable::IsInTable(G4int Z, G4int A)
152{
153 return (Z <= A && A >= 1 && A <= 273 && Z >= 0 && Z <= 110 && GetIndex(Z, A) >= 0);
154}
155
Note: See TracBrowser for help on using the repository browser.