Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4IsotopeProperty.cc
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 //
27 // $Id$
28 //
29 //
30 // ----------------------------------------------------------------------
31 // GEANT 4 class implementation file
32 //
33 // **********************************************************************
34 // New design using G4VIsotopeTable 5 Oct. 99 H.Kurashige
35 
36 #include "G4ios.hh"
37 #include <iomanip>
38 
39 #include "G4PhysicalConstants.hh"
40 #include "G4SystemOfUnits.hh"
41 #include "G4IsotopeProperty.hh"
42 #include "G4DecayTable.hh"
43 
44 // ######################################################################
45 // ### IsotopeProperty ###
46 // ######################################################################
47 
49  fAtomicNumber(0),fAtomicMass(0),
50  fISpin(0),fEnergy(0.0),
51  fLifeTime(-1.0),fDecayTable(0),
52  fMagneticMoment(0.0)
53 {
54 }
55 
56 
58 {
59  if (fDecayTable != 0) delete fDecayTable;
60 }
61 
63 {
64  fAtomicNumber = right.fAtomicNumber;
65  fAtomicMass = right.fAtomicMass;
66  fISpin = right.fISpin;
67  fMagneticMoment = right.fMagneticMoment;
68  fEnergy = right.fEnergy;
69  fLifeTime = right.fLifeTime;
70  // decay table is not copied because G4DecayTable has no copy constructor
71  fDecayTable = 0;
72 }
73 
74 // Assignment operator
76 {
77  if (this != &right) {
78  fAtomicNumber = right.fAtomicNumber;
79  fAtomicMass = right.fAtomicMass;
80  fISpin = right.fISpin;
81  fMagneticMoment = right.fMagneticMoment;
82  fEnergy = right.fEnergy;
83  fLifeTime = right.fLifeTime;
84  // decay table is not copied because G4DecayTable has no copy constructor
85  fDecayTable = 0;
86  }
87  return *this;
88 }
89 
90 
91 // equal / unequal operator
93 {
94  G4bool value = true;
95  value = value && ( fAtomicNumber == right.fAtomicNumber);
96  value = value && ( fAtomicMass == right.fAtomicMass);
97  value = value && ( fISpin == right.fISpin);
98  value = value && ( fMagneticMoment == right.fMagneticMoment);
99  value = value && ( fEnergy == right.fEnergy);
100  value = value && ( fLifeTime == right.fLifeTime);
101  return value;
102 }
104 {
105  return !(*this == right);
106 }
107 
109 {
110 #ifdef G4VERBOSE
111  G4cout << "AtomicNumber: " << fAtomicNumber << G4endl;
112  G4cout << "AtomicMass: " << fAtomicMass << G4endl;
113  if (fISpin %2){
114  G4cout << "Spin: " << fISpin << "/2" << G4endl;
115  } else {
116  G4cout << "Spin: " << fISpin /2 << G4endl;
117  }
118  G4cout << "MagneticMoment: "
119  << fMagneticMoment/MeV*tesla << "[MeV/T]" <<G4endl;
120  G4cout << "Excited Energy: "
121  << std::setprecision(1)
122  << fEnergy/keV << "[keV]"
123  << std::setprecision(6)
124  << G4endl;
125  G4cout << "Life Time: "
126  << fLifeTime/ns << "[ns]" << G4endl;
127  if (fDecayTable != 0) {
128  fDecayTable->DumpInfo();
129  } else {
130  G4cout << "Decay Table is not defined !" << G4endl;
131  }
132 #endif
133 }
134 
135 
136 
137 
138 
139 
140