Geant4.10
 All Data Structures 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: G4IsotopeProperty.cc 69557 2013-05-08 12:01:40Z gcosmo $
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  fIsomerLevel(-1)
54 {
55 }
56 
57 
59 {
60  if (fDecayTable != 0) delete fDecayTable;
61 }
62 
64 {
65  fAtomicNumber = right.fAtomicNumber;
66  fAtomicMass = right.fAtomicMass;
67  fISpin = right.fISpin;
68  fMagneticMoment = right.fMagneticMoment;
69  fEnergy = right.fEnergy;
70  fLifeTime = right.fLifeTime;
71  fIsomerLevel = right.fIsomerLevel;
72  // decay table is not copied because G4DecayTable has no copy constructor
73  fDecayTable = 0;
74 }
75 
76 // Assignment operator
78 {
79  if (this != &right) {
80  fAtomicNumber = right.fAtomicNumber;
81  fAtomicMass = right.fAtomicMass;
82  fISpin = right.fISpin;
83  fMagneticMoment = right.fMagneticMoment;
84  fEnergy = right.fEnergy;
85  fLifeTime = right.fLifeTime;
86  fIsomerLevel = right.fIsomerLevel;
87  // decay table is not copied because G4DecayTable has no copy constructor
88  fDecayTable = 0;
89  }
90  return *this;
91 }
92 
93 
94 // equal / unequal operator
96 {
97  G4bool value = true;
98  value = value && ( fAtomicNumber == right.fAtomicNumber);
99  value = value && ( fAtomicMass == right.fAtomicMass);
100  value = value && ( fISpin == right.fISpin);
101  value = value && ( fMagneticMoment == right.fMagneticMoment);
102  value = value && ( fEnergy == right.fEnergy);
103  value = value && ( fLifeTime == right.fLifeTime);
104  value = value && ( fIsomerLevel == right.fIsomerLevel);
105  return value;
106 }
107 
109 {
110  return !(*this == right);
111 }
112 
114 {
115 #ifdef G4VERBOSE
116  G4cout << "AtomicNumber: " << fAtomicNumber << ", "
117  << "AtomicMass: " << fAtomicMass << G4endl;
118  if (fISpin %2){
119  G4cout << "Spin: " << fISpin << "/2";
120  } else {
121  G4cout << "Spin: " << fISpin /2;
122  }
123  G4cout << ", " << "MagneticMoment: "
124  << fMagneticMoment/MeV*tesla << "[MeV/T]" <<G4endl;
125  G4cout << "Isomer Level: "
126  << fIsomerLevel
127  << ", Excited Energy: "
128  << std::setprecision(1)
129  << fEnergy/keV << "[keV]"
130  << ", "
131  << std::setprecision(6)
132  << "Life Time: "
133  << fLifeTime/ns << "[ns]" << G4endl;
134  if (fDecayTable != 0) {
135  fDecayTable->DumpInfo();
136  } else {
137  // G4cout << "Decay Table is not defined !" << G4endl;
138  }
139 #endif
140 }
141 
142 
143 
144 
145 
146 
147 
G4int operator!=(const G4IsotopeProperty &right) const
G4int operator==(const G4IsotopeProperty &right) const
void DumpInfo() const
G4IsotopeProperty & operator=(G4IsotopeProperty &right)
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
void DumpInfo() const
virtual ~G4IsotopeProperty()
const XML_Char int const XML_Char * value
#define G4endl
Definition: G4ios.hh:61
#define ns
Definition: xmlparse.cc:597