ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4IsotopeProperty.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4IsotopeProperty.cc
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 //
28 //
29 // ----------------------------------------------------------------------
30 // GEANT 4 class implementation file
31 //
32 // **********************************************************************
33 // New design using G4VIsotopeTable 5 Oct. 99 H.Kurashige
34 
35 #include "G4ios.hh"
36 #include <iomanip>
37 
38 #include "G4PhysicalConstants.hh"
39 #include "G4SystemOfUnits.hh"
40 #include "G4IsotopeProperty.hh"
41 #include "G4DecayTable.hh"
42 
43 // ######################################################################
44 // ### IsotopeProperty ###
45 // ######################################################################
46 
48  fAtomicNumber(0),fAtomicMass(0),
49  fISpin(0),fEnergy(0.0),
50  fLifeTime(-1.0),
51  fDecayTable(nullptr),
52  fMagneticMoment(0.0),
53  fIsomerLevel(-1),
54  fFloatLevelBase(G4Ions::G4FloatLevelBase::no_Float)
55 {
56 }
57 
58 
60 {
61  if (fDecayTable != nullptr) delete fDecayTable;
62  fDecayTable = nullptr;
63 }
64 
66  :fAtomicNumber(right.fAtomicNumber),
67  fAtomicMass(right.fAtomicMass),
68  fISpin(right.fISpin),
69  fEnergy(right.fEnergy),
70  fLifeTime(right.fLifeTime),
71  fDecayTable(nullptr),
72  fMagneticMoment(right.fMagneticMoment),
73  fIsomerLevel(right.fIsomerLevel),
74  fFloatLevelBase(right.fFloatLevelBase)
75 {
76  // decay table is not copied because G4DecayTable has no copy constructor
77 }
78 
79 // Assignment operator
81 {
82  if (this != &right) {
84  fAtomicMass = right.fAtomicMass;
85  fISpin = right.fISpin;
87  fEnergy = right.fEnergy;
88  fLifeTime = right.fLifeTime;
89  fIsomerLevel = right.fIsomerLevel;
91  // decay table is not copied because G4DecayTable has no copy constructor
92  fDecayTable = nullptr;
93  }
94  return *this;
95 }
96 
97 
98 // equal / unequal operator
100 {
101  G4bool value = true;
102  value = value && ( fAtomicNumber == right.fAtomicNumber);
103  value = value && ( fAtomicMass == right.fAtomicMass);
104  value = value && ( fISpin == right.fISpin);
105  value = value && ( fMagneticMoment == right.fMagneticMoment);
106  value = value && ( fEnergy == right.fEnergy);
107  value = value && ( fLifeTime == right.fLifeTime);
108  value = value && ( fIsomerLevel == right.fIsomerLevel);
109  value = value && ( fFloatLevelBase == right.fFloatLevelBase);
110  return value;
111 }
112 
114 {
115  return !(*this == right);
116 }
117 
119 {
120 #ifdef G4VERBOSE
121  G4cout << "AtomicNumber: " << fAtomicNumber << ", "
122  << "AtomicMass: " << fAtomicMass << G4endl;
123  if (fISpin %2){
124  G4cout << "Spin: " << fISpin << "/2";
125  } else {
126  G4cout << "Spin: " << fISpin /2;
127  }
128  G4cout << ", " << "MagneticMoment: "
129  << fMagneticMoment/MeV*tesla << "[MeV/T]" <<G4endl;
130  G4cout << "Isomer Level: "
131  << fIsomerLevel
132  << ", Excited Energy: "
133  << std::setprecision(1)
134  << fEnergy/keV;
135  if(fFloatLevelBase!=G4Ions::G4FloatLevelBase::no_Float)
137  G4cout << " [keV]"
138  << ", "
139  << std::setprecision(6)
140  << "Life Time: "
141  << fLifeTime/ns << "[ns]"
142  << G4endl;
143  if (fDecayTable != nullptr) {
145  } else {
146  // G4cout << "Decay Table is not defined !" << G4endl;
147  }
148 #endif
149 }
150 
151 
152 
153 
154 
155 
156