Geant4 Cross Reference |
>> 1 // This code implementation is the intellectual property of >> 2 // the GEANT4 collaboration. 1 // 3 // 2 // ******************************************* << 4 // By copying, distributing or modifying the Program (or any work 3 // * License and Disclaimer << 5 // based on the Program) you indicate your acceptance of this statement, 4 // * << 6 // and all its terms. 5 // * The Geant4 software is copyright of th << 6 // * the Geant4 Collaboration. It is provided << 7 // * conditions of the Geant4 Software License << 8 // * LICENSE and available at http://cern.ch/ << 9 // * include a list of copyright holders. << 10 // * << 11 // * Neither the authors of this software syst << 12 // * institutes,nor the agencies providing fin << 13 // * work make any representation or warran << 14 // * regarding this software system or assum << 15 // * use. Please see the license in the file << 16 // * for the full disclaimer and the limitatio << 17 // * << 18 // * This code implementation is the result << 19 // * technical work of the GEANT4 collaboratio << 20 // * By using, copying, modifying or distri << 21 // * any work based on the software) you ag << 22 // * use in resulting scientific publicati << 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* << 25 // 7 // 26 // G4IsotopeProperty class implementation << 8 // $Id: G4IsotopeProperty.cc,v 1.2 1999/12/15 14:51:12 gunter Exp $ >> 9 // GEANT4 tag $Name: geant4-02-00 $ 27 // 10 // 28 // Author: H.Kurashige, 5 October 1999 << 11 // 29 // ------------------------------------------- << 12 // ---------------------------------------------------------------------- >> 13 // GEANT 4 class implementation file >> 14 // >> 15 // For information related to this code contact: >> 16 // CERN, CN Division, ASD Group >> 17 // ********************************************************************** >> 18 // New design using G4VIsotopeTable 5 Oct. 99 H.Kurashige 30 19 31 #include "G4IsotopeProperty.hh" << 20 #include "G4ios.hh" >> 21 #include "g4std/iomanip" 32 22 >> 23 #include "G4IsotopeProperty.hh" 33 #include "G4DecayTable.hh" 24 #include "G4DecayTable.hh" 34 #include "G4PhysicalConstants.hh" << 35 #include "G4SystemOfUnits.hh" << 36 #include "G4ios.hh" << 37 25 38 #include <iomanip> << 26 // ###################################################################### >> 27 // ### IsotopeProperty ### >> 28 // ###################################################################### >> 29 >> 30 G4IsotopeProperty::G4IsotopeProperty(): >> 31 fAtomicNumber(0),fAtomicMass(0), >> 32 fISpin(0),fEnergy(0.0), >> 33 fLifeTime(-1.0),fDecayTable(0) >> 34 { >> 35 } >> 36 39 37 40 G4IsotopeProperty::~G4IsotopeProperty() 38 G4IsotopeProperty::~G4IsotopeProperty() 41 { 39 { 42 delete fDecayTable; << 40 if (fDecayTable != 0) delete fDecayTable; 43 fDecayTable = nullptr; << 44 } 41 } 45 42 46 G4IsotopeProperty::G4IsotopeProperty(const G4I << 43 G4IsotopeProperty::G4IsotopeProperty(const G4IsotopeProperty& right) 47 : fAtomicNumber(right.fAtomicNumber), << 48 fAtomicMass(right.fAtomicMass), << 49 fISpin(right.fISpin), << 50 fEnergy(right.fEnergy), << 51 fLifeTime(right.fLifeTime), << 52 << 53 fMagneticMoment(right.fMagneticMoment), << 54 fIsomerLevel(right.fIsomerLevel), << 55 fFloatLevelBase(right.fFloatLevelBase) << 56 { 44 { >> 45 fAtomicNumber = right.fAtomicNumber; >> 46 fAtomicMass = right.fAtomicMass; >> 47 fISpin = right.fISpin; >> 48 fEnergy = right.fEnergy; >> 49 fLifeTime = right.fLifeTime; 57 // decay table is not copied because G4Decay 50 // decay table is not copied because G4DecayTable has no copy constructor >> 51 fDecayTable = 0; 58 } 52 } 59 53 60 G4IsotopeProperty& G4IsotopeProperty::operator << 54 // Assignment operator >> 55 G4IsotopeProperty & G4IsotopeProperty::operator=(G4IsotopeProperty& right) 61 { 56 { 62 if (this != &right) { 57 if (this != &right) { 63 fAtomicNumber = right.fAtomicNumber; 58 fAtomicNumber = right.fAtomicNumber; 64 fAtomicMass = right.fAtomicMass; << 59 fAtomicMass = right.fAtomicMass; 65 fISpin = right.fISpin; << 60 fISpin = right.fISpin; 66 fMagneticMoment = right.fMagneticMoment; << 61 fEnergy = right.fEnergy; 67 fEnergy = right.fEnergy; << 62 fLifeTime = right.fLifeTime; 68 fLifeTime = right.fLifeTime; << 69 fIsomerLevel = right.fIsomerLevel; << 70 fFloatLevelBase = right.fFloatLevelBase; << 71 // decay table is not copied because G4Dec 63 // decay table is not copied because G4DecayTable has no copy constructor 72 fDecayTable = nullptr; << 64 fDecayTable = 0; 73 } 65 } 74 return *this; 66 return *this; 75 } 67 } 76 68 77 G4bool G4IsotopeProperty::operator==(const G4I << 69 >> 70 // equal / unequal operator >> 71 G4int G4IsotopeProperty::operator==(const G4IsotopeProperty &right) const 78 { 72 { 79 G4bool value = true; 73 G4bool value = true; 80 value = value && (fAtomicNumber == right.fAt << 74 value = value && ( fAtomicNumber == right.fAtomicNumber); 81 value = value && (fAtomicMass == right.fAtom << 75 value = value && ( fAtomicMass == right.fAtomicMass); 82 value = value && (fISpin == right.fISpin); << 76 value = value && ( fISpin == right.fISpin); 83 value = value && (fMagneticMoment == right.f << 77 value = value && ( fEnergy == right.fEnergy); 84 value = value && (fEnergy == right.fEnergy); << 78 value = value && ( fLifeTime == right.fLifeTime); 85 value = value && (fLifeTime == right.fLifeTi << 86 value = value && (fIsomerLevel == right.fIso << 87 value = value && (fFloatLevelBase == right.f << 88 return value; 79 return value; 89 } 80 } 90 << 81 G4int G4IsotopeProperty::operator!=(const G4IsotopeProperty &right) const 91 G4bool G4IsotopeProperty::operator!=(const G4I << 92 { 82 { 93 return !(*this == right); 83 return !(*this == right); 94 } 84 } 95 85 96 void G4IsotopeProperty::DumpInfo() const 86 void G4IsotopeProperty::DumpInfo() const 97 { 87 { 98 #ifdef G4VERBOSE << 88 G4cout << "AtomicNumber: " << fAtomicNumber << G4endl; 99 G4cout << "AtomicNumber: " << fAtomicNumber << 89 G4cout << "AtomicMass: " << fAtomicMass << G4endl; 100 << "AtomicMass: " << fAtomicMass << G << 90 G4cout << "Spin: " << fISpin << "/2" << G4endl; 101 if ((fISpin % 2) != 0) { << 91 G4cout << "Excited Energy: " << G4std::setprecision(1) << fEnergy/keV << "[keV]" << G4endl; 102 G4cout << "Spin: " << fISpin << "/2"; << 92 G4cout << "Life Time: " << fLifeTime/ns << "[ns]" << G4endl; 103 } << 93 if (fDecayTable != 0) { 104 else { << 105 G4cout << "Spin: " << fISpin / 2; << 106 } << 107 G4cout << ", " << 108 << "MagneticMoment: " << fMagneticMom << 109 G4cout << "Isomer Level: " << fIsomerLevel < << 110 << fEnergy / keV; << 111 if (fFloatLevelBase != G4Ions::G4FloatLevelB << 112 G4cout << " +" << G4Ions::FloatLevelBaseCh << 113 } << 114 G4cout << " [keV]" << 115 << ", " << std::setprecision(6) << << 116 if (fDecayTable != nullptr) { << 117 fDecayTable->DumpInfo(); 94 fDecayTable->DumpInfo(); >> 95 } else { >> 96 G4cout << "Decay Table is not defined !" << G4endl; 118 } 97 } 119 else { << 120 // G4cout << "Decay Table is not defined ! << 121 } << 122 #endif << 123 } 98 } >> 99 >> 100 >> 101 >> 102 >> 103 >> 104 >> 105 124 106