Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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// G4IsotopeProperty class implementation
27//
28// Author: H.Kurashige, 5 October 1999
29// --------------------------------------------------------------------
30
31#include "G4ios.hh"
32#include <iomanip>
33
35#include "G4SystemOfUnits.hh"
36#include "G4IsotopeProperty.hh"
37#include "G4DecayTable.hh"
38
39// ######################################################################
40// ### IsotopeProperty ###
41// ######################################################################
42
44 : fFloatLevelBase(G4Ions::G4FloatLevelBase::no_Float)
45{
46}
47
49{
50 if (fDecayTable != nullptr) delete fDecayTable;
51 fDecayTable = nullptr;
52}
53
55 : fAtomicNumber(right.fAtomicNumber),
56 fAtomicMass(right.fAtomicMass),
57 fISpin(right.fISpin),
58 fEnergy(right.fEnergy),
59 fLifeTime(right.fLifeTime),
60 fDecayTable(nullptr),
61 fMagneticMoment(right.fMagneticMoment),
62 fIsomerLevel(right.fIsomerLevel),
63 fFloatLevelBase(right.fFloatLevelBase)
64{
65 // decay table is not copied because G4DecayTable has no copy constructor
66}
67
69{
70 if (this != &right)
71 {
72 fAtomicNumber = right.fAtomicNumber;
73 fAtomicMass = right.fAtomicMass;
74 fISpin = right.fISpin;
75 fMagneticMoment = right.fMagneticMoment;
76 fEnergy = right.fEnergy;
77 fLifeTime = right.fLifeTime;
78 fIsomerLevel = right.fIsomerLevel;
79 fFloatLevelBase = right.fFloatLevelBase;
80 // decay table is not copied because G4DecayTable has no copy constructor
81 fDecayTable = nullptr;
82 }
83 return *this;
84}
85
87{
88 G4bool value = true;
89 value = value && ( fAtomicNumber == right.fAtomicNumber);
90 value = value && ( fAtomicMass == right.fAtomicMass);
91 value = value && ( fISpin == right.fISpin);
92 value = value && ( fMagneticMoment == right.fMagneticMoment);
93 value = value && ( fEnergy == right.fEnergy);
94 value = value && ( fLifeTime == right.fLifeTime);
95 value = value && ( fIsomerLevel == right.fIsomerLevel);
96 value = value && ( fFloatLevelBase == right.fFloatLevelBase);
97 return value;
98}
99
101{
102 return !(*this == right);
103}
104
106{
107#ifdef G4VERBOSE
108 G4cout << "AtomicNumber: " << fAtomicNumber << ", "
109 << "AtomicMass: " << fAtomicMass << G4endl;
110 if (fISpin %2)
111 {
112 G4cout << "Spin: " << fISpin << "/2";
113 }
114 else
115 {
116 G4cout << "Spin: " << fISpin /2;
117 }
118 G4cout << ", " << "MagneticMoment: "
119 << fMagneticMoment/MeV*tesla << "[MeV/T]" <<G4endl;
120 G4cout << "Isomer Level: "
121 << fIsomerLevel
122 << ", Excited Energy: "
123 << std::setprecision(1)
124 << fEnergy/keV;
125 if (fFloatLevelBase != G4Ions::G4FloatLevelBase::no_Float)
126 {
127 G4cout << " +" << G4Ions::FloatLevelBaseChar(fFloatLevelBase);
128 }
129 G4cout << " [keV]"
130 << ", "
131 << std::setprecision(6)
132 << "Life Time: "
133 << fLifeTime/ns << "[ns]"
134 << G4endl;
135 if (fDecayTable != nullptr)
136 {
137 fDecayTable->DumpInfo();
138 }
139 else
140 {
141 // G4cout << "Decay Table is not defined !" << G4endl;
142 }
143#endif
144}
bool G4bool
Definition: G4Types.hh:86
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
void DumpInfo() const
Definition: G4Ions.hh:52
static char FloatLevelBaseChar(G4Ions::G4FloatLevelBase flb)
Definition: G4Ions.cc:172
G4bool operator!=(const G4IsotopeProperty &right) const
G4IsotopeProperty & operator=(G4IsotopeProperty &right)
virtual ~G4IsotopeProperty()
G4bool operator==(const G4IsotopeProperty &right) const
#define ns(x)
Definition: xmltok.c:1649