Geant4  10.03.p03
 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: G4IsotopeProperty.cc 98732 2016-08-09 10:50:57Z 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  fFloatLevelBase(G4Ions::G4FloatLevelBase::no_Float)
55 {
56 }
57 
58 
60 {
61  if (fDecayTable != 0) delete fDecayTable;
62 }
63 
65 {
66  fAtomicNumber = right.fAtomicNumber;
67  fAtomicMass = right.fAtomicMass;
68  fISpin = right.fISpin;
69  fMagneticMoment = right.fMagneticMoment;
70  fEnergy = right.fEnergy;
71  fLifeTime = right.fLifeTime;
72  fIsomerLevel = right.fIsomerLevel;
73  fFloatLevelBase = right.fFloatLevelBase;
74  // decay table is not copied because G4DecayTable has no copy constructor
75  fDecayTable = 0;
76 }
77 
78 // Assignment operator
80 {
81  if (this != &right) {
82  fAtomicNumber = right.fAtomicNumber;
83  fAtomicMass = right.fAtomicMass;
84  fISpin = right.fISpin;
85  fMagneticMoment = right.fMagneticMoment;
86  fEnergy = right.fEnergy;
87  fLifeTime = right.fLifeTime;
88  fIsomerLevel = right.fIsomerLevel;
89  fFloatLevelBase = right.fFloatLevelBase;
90  // decay table is not copied because G4DecayTable has no copy constructor
91  fDecayTable = 0;
92  }
93  return *this;
94 }
95 
96 
97 // equal / unequal operator
99 {
100  G4bool value = true;
101  value = value && ( fAtomicNumber == right.fAtomicNumber);
102  value = value && ( fAtomicMass == right.fAtomicMass);
103  value = value && ( fISpin == right.fISpin);
104  value = value && ( fMagneticMoment == right.fMagneticMoment);
105  value = value && ( fEnergy == right.fEnergy);
106  value = value && ( fLifeTime == right.fLifeTime);
107  value = value && ( fIsomerLevel == right.fIsomerLevel);
108  value = value && ( fFloatLevelBase == right.fFloatLevelBase);
109  return value;
110 }
111 
113 {
114  return !(*this == right);
115 }
116 
118 {
119 #ifdef G4VERBOSE
120  G4cout << "AtomicNumber: " << fAtomicNumber << ", "
121  << "AtomicMass: " << fAtomicMass << G4endl;
122  if (fISpin %2){
123  G4cout << "Spin: " << fISpin << "/2";
124  } else {
125  G4cout << "Spin: " << fISpin /2;
126  }
127  G4cout << ", " << "MagneticMoment: "
128  << fMagneticMoment/MeV*tesla << "[MeV/T]" <<G4endl;
129  G4cout << "Isomer Level: "
130  << fIsomerLevel
131  << ", Excited Energy: "
132  << std::setprecision(1)
133  << fEnergy/keV;
134  if(fFloatLevelBase!=G4Ions::G4FloatLevelBase::no_Float)
135  { G4cout << " +" << G4Ions::FloatLevelBaseChar(fFloatLevelBase); }
136  G4cout << " [keV]"
137  << ", "
138  << std::setprecision(6)
139  << "Life Time: "
140  << fLifeTime/ns << "[ns]"
141  << G4endl;
142  if (fDecayTable != 0) {
143  fDecayTable->DumpInfo();
144  } else {
145  // G4cout << "Decay Table is not defined !" << G4endl;
146  }
147 #endif
148 }
149 
150 
151 
152 
153 
154 
155 
static constexpr double tesla
Definition: G4SIunits.hh:268
static char FloatLevelBaseChar(G4Ions::G4FloatLevelBase flb)
Definition: G4Ions.hh:253
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
const XML_Char int const XML_Char * value
Definition: expat.h:331
Definition: G4Ions.hh:51
bool G4bool
Definition: G4Types.hh:79
void DumpInfo() const
virtual ~G4IsotopeProperty()
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
static constexpr double keV
Definition: G4SIunits.hh:216
#define ns
Definition: xmlparse.cc:614