Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4IsotopeProperty class implementation 26 // G4IsotopeProperty class implementation 27 // 27 // 28 // Author: H.Kurashige, 5 October 1999 28 // Author: H.Kurashige, 5 October 1999 29 // ------------------------------------------- 29 // -------------------------------------------------------------------- 30 30 31 #include "G4IsotopeProperty.hh" << 31 #include "G4ios.hh" >> 32 #include <iomanip> 32 33 33 #include "G4DecayTable.hh" << 34 #include "G4PhysicalConstants.hh" 34 #include "G4PhysicalConstants.hh" 35 #include "G4SystemOfUnits.hh" 35 #include "G4SystemOfUnits.hh" 36 #include "G4ios.hh" << 36 #include "G4IsotopeProperty.hh" >> 37 #include "G4DecayTable.hh" 37 38 38 #include <iomanip> << 39 // ###################################################################### >> 40 // ### IsotopeProperty ### >> 41 // ###################################################################### >> 42 >> 43 G4IsotopeProperty::G4IsotopeProperty() >> 44 : fFloatLevelBase(G4Ions::G4FloatLevelBase::no_Float) >> 45 { >> 46 } 39 47 40 G4IsotopeProperty::~G4IsotopeProperty() 48 G4IsotopeProperty::~G4IsotopeProperty() 41 { 49 { 42 delete fDecayTable; << 50 if (fDecayTable != nullptr) delete fDecayTable; 43 fDecayTable = nullptr; 51 fDecayTable = nullptr; 44 } 52 } 45 53 46 G4IsotopeProperty::G4IsotopeProperty(const G4I 54 G4IsotopeProperty::G4IsotopeProperty(const G4IsotopeProperty& right) 47 : fAtomicNumber(right.fAtomicNumber), 55 : fAtomicNumber(right.fAtomicNumber), 48 fAtomicMass(right.fAtomicMass), 56 fAtomicMass(right.fAtomicMass), 49 fISpin(right.fISpin), 57 fISpin(right.fISpin), 50 fEnergy(right.fEnergy), 58 fEnergy(right.fEnergy), 51 fLifeTime(right.fLifeTime), 59 fLifeTime(right.fLifeTime), 52 << 60 fDecayTable(nullptr), 53 fMagneticMoment(right.fMagneticMoment), 61 fMagneticMoment(right.fMagneticMoment), 54 fIsomerLevel(right.fIsomerLevel), 62 fIsomerLevel(right.fIsomerLevel), 55 fFloatLevelBase(right.fFloatLevelBase) 63 fFloatLevelBase(right.fFloatLevelBase) 56 { 64 { 57 // decay table is not copied because G4Decay 65 // decay table is not copied because G4DecayTable has no copy constructor 58 } 66 } 59 67 60 G4IsotopeProperty& G4IsotopeProperty::operator << 68 G4IsotopeProperty & G4IsotopeProperty::operator=(G4IsotopeProperty& right) 61 { 69 { 62 if (this != &right) { << 70 if (this != &right) 63 fAtomicNumber = right.fAtomicNumber; << 71 { 64 fAtomicMass = right.fAtomicMass; << 72 fAtomicNumber = right.fAtomicNumber; 65 fISpin = right.fISpin; << 73 fAtomicMass = right.fAtomicMass; 66 fMagneticMoment = right.fMagneticMoment; << 74 fISpin = right.fISpin; 67 fEnergy = right.fEnergy; << 75 fMagneticMoment = right.fMagneticMoment; 68 fLifeTime = right.fLifeTime; << 76 fEnergy = right.fEnergy; 69 fIsomerLevel = right.fIsomerLevel; << 77 fLifeTime = right.fLifeTime; 70 fFloatLevelBase = right.fFloatLevelBase; << 78 fIsomerLevel = right.fIsomerLevel; >> 79 fFloatLevelBase = right.fFloatLevelBase; 71 // decay table is not copied because G4Dec 80 // decay table is not copied because G4DecayTable has no copy constructor 72 fDecayTable = nullptr; << 81 fDecayTable = nullptr; 73 } 82 } 74 return *this; 83 return *this; 75 } 84 } 76 85 77 G4bool G4IsotopeProperty::operator==(const G4I 86 G4bool G4IsotopeProperty::operator==(const G4IsotopeProperty& right) const 78 { 87 { 79 G4bool value = true; 88 G4bool value = true; 80 value = value && (fAtomicNumber == right.fAt << 89 value = value && ( fAtomicNumber == right.fAtomicNumber); 81 value = value && (fAtomicMass == right.fAtom << 90 value = value && ( fAtomicMass == right.fAtomicMass); 82 value = value && (fISpin == right.fISpin); << 91 value = value && ( fISpin == right.fISpin); 83 value = value && (fMagneticMoment == right.f << 92 value = value && ( fMagneticMoment == right.fMagneticMoment); 84 value = value && (fEnergy == right.fEnergy); << 93 value = value && ( fEnergy == right.fEnergy); 85 value = value && (fLifeTime == right.fLifeTi << 94 value = value && ( fLifeTime == right.fLifeTime); 86 value = value && (fIsomerLevel == right.fIso << 95 value = value && ( fIsomerLevel == right.fIsomerLevel); 87 value = value && (fFloatLevelBase == right.f << 96 value = value && ( fFloatLevelBase == right.fFloatLevelBase); 88 return value; 97 return value; 89 } 98 } 90 99 91 G4bool G4IsotopeProperty::operator!=(const G4I 100 G4bool G4IsotopeProperty::operator!=(const G4IsotopeProperty& right) const 92 { 101 { 93 return !(*this == right); 102 return !(*this == right); 94 } 103 } 95 104 96 void G4IsotopeProperty::DumpInfo() const 105 void G4IsotopeProperty::DumpInfo() const 97 { 106 { 98 #ifdef G4VERBOSE 107 #ifdef G4VERBOSE 99 G4cout << "AtomicNumber: " << fAtomicNumber 108 G4cout << "AtomicNumber: " << fAtomicNumber << ", " 100 << "AtomicMass: " << fAtomicMass << G 109 << "AtomicMass: " << fAtomicMass << G4endl; 101 if ((fISpin % 2) != 0) { << 110 if (fISpin %2) >> 111 { 102 G4cout << "Spin: " << fISpin << "/2"; 112 G4cout << "Spin: " << fISpin << "/2"; 103 } 113 } 104 else { << 114 else 105 G4cout << "Spin: " << fISpin / 2; << 115 { >> 116 G4cout << "Spin: " << fISpin /2; 106 } 117 } 107 G4cout << ", " << 118 G4cout << ", " << "MagneticMoment: " 108 << "MagneticMoment: " << fMagneticMom << 119 << fMagneticMoment/MeV*tesla << "[MeV/T]" <<G4endl; 109 G4cout << "Isomer Level: " << fIsomerLevel < << 120 G4cout << "Isomer Level: " 110 << fEnergy / keV; << 121 << fIsomerLevel 111 if (fFloatLevelBase != G4Ions::G4FloatLevelB << 122 << ", Excited Energy: " >> 123 << std::setprecision(1) >> 124 << fEnergy/keV; >> 125 if (fFloatLevelBase != G4Ions::G4FloatLevelBase::no_Float) >> 126 { 112 G4cout << " +" << G4Ions::FloatLevelBaseCh 127 G4cout << " +" << G4Ions::FloatLevelBaseChar(fFloatLevelBase); 113 } 128 } 114 G4cout << " [keV]" << 129 G4cout << " [keV]" 115 << ", " << std::setprecision(6) << << 130 << ", " 116 if (fDecayTable != nullptr) { << 131 << std::setprecision(6) >> 132 << "Life Time: " >> 133 << fLifeTime/ns << "[ns]" >> 134 << G4endl; >> 135 if (fDecayTable != nullptr) >> 136 { 117 fDecayTable->DumpInfo(); 137 fDecayTable->DumpInfo(); 118 } 138 } 119 else { << 139 else >> 140 { 120 // G4cout << "Decay Table is not defined ! 141 // G4cout << "Decay Table is not defined !" << G4endl; 121 } 142 } 122 #endif 143 #endif 123 } 144 } 124 145