G4IsotopeProperty.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // 
00030 // ----------------------------------------------------------------------
00031 //      GEANT 4 class implementation file
00032 //
00033 // **********************************************************************
00034 //      New design using G4VIsotopeTable          5 Oct. 99 H.Kurashige
00035 
00036 #include "G4ios.hh"
00037 #include <iomanip>
00038 
00039 #include "G4PhysicalConstants.hh"
00040 #include "G4SystemOfUnits.hh"
00041 #include "G4IsotopeProperty.hh"
00042 #include "G4DecayTable.hh"
00043 
00044 // ######################################################################
00045 // ###                           IsotopeProperty                      ###
00046 // ######################################################################
00047 
00048 G4IsotopeProperty::G4IsotopeProperty():
00049                    fAtomicNumber(0),fAtomicMass(0),
00050                    fISpin(0),fEnergy(0.0),
00051                    fLifeTime(-1.0),fDecayTable(0),
00052                    fMagneticMoment(0.0)
00053 {
00054 }
00055 
00056 
00057 G4IsotopeProperty::~G4IsotopeProperty()
00058 {
00059   if (fDecayTable != 0) delete fDecayTable;
00060 }
00061 
00062 G4IsotopeProperty::G4IsotopeProperty(const  G4IsotopeProperty& right)
00063 {
00064   fAtomicNumber    = right.fAtomicNumber;
00065   fAtomicMass      = right.fAtomicMass;
00066   fISpin           = right.fISpin;
00067   fMagneticMoment  = right.fMagneticMoment;
00068   fEnergy          = right.fEnergy;
00069   fLifeTime        = right.fLifeTime;
00070   // decay table is not copied because G4DecayTable has no copy constructor
00071   fDecayTable   = 0;
00072 }
00073 
00074 // Assignment operator
00075 G4IsotopeProperty & G4IsotopeProperty::operator=(G4IsotopeProperty& right)
00076 {
00077   if (this != &right) {
00078     fAtomicNumber    = right.fAtomicNumber;
00079     fAtomicMass      = right.fAtomicMass;
00080     fISpin           = right.fISpin;
00081     fMagneticMoment  = right.fMagneticMoment;
00082     fEnergy          = right.fEnergy;
00083     fLifeTime        = right.fLifeTime;
00084     // decay table is not copied because G4DecayTable has no copy constructor
00085     fDecayTable   = 0;
00086   }
00087   return *this;
00088 }
00089 
00090  
00091 // equal / unequal operator
00092 G4int G4IsotopeProperty::operator==(const G4IsotopeProperty &right) const
00093 {
00094   G4bool value = true;
00095   value = value && ( fAtomicNumber    == right.fAtomicNumber);
00096   value = value && ( fAtomicMass      == right.fAtomicMass);
00097   value = value && ( fISpin           == right.fISpin);
00098   value = value && ( fMagneticMoment  == right.fMagneticMoment);
00099   value = value && ( fEnergy          == right.fEnergy);
00100   value = value && ( fLifeTime        == right.fLifeTime);
00101   return value;
00102 }
00103 G4int G4IsotopeProperty::operator!=(const G4IsotopeProperty &right) const
00104 {
00105   return !(*this == right);
00106 }
00107 
00108 void G4IsotopeProperty::DumpInfo() const
00109 {
00110 #ifdef G4VERBOSE
00111   G4cout << "AtomicNumber: " << fAtomicNumber << G4endl;
00112   G4cout << "AtomicMass: " << fAtomicMass << G4endl;
00113   if (fISpin %2){
00114     G4cout << "Spin: " << fISpin << "/2" << G4endl;
00115   } else {
00116     G4cout << "Spin: " << fISpin /2  << G4endl;
00117   }
00118   G4cout << "MagneticMoment: " 
00119          << fMagneticMoment/MeV*tesla << "[MeV/T]" <<G4endl;
00120   G4cout << "Excited Energy: " 
00121          << std::setprecision(1) 
00122          << fEnergy/keV << "[keV]" 
00123          << std::setprecision(6) 
00124          << G4endl;
00125   G4cout << "Life Time: " 
00126          << fLifeTime/ns << "[ns]" << G4endl;
00127   if (fDecayTable != 0) {
00128     fDecayTable->DumpInfo();
00129   } else {
00130     G4cout << "Decay Table is not defined !" << G4endl;
00131   }
00132 #endif
00133 }
00134 
00135 
00136 
00137 
00138 
00139 
00140 

Generated on Mon May 27 17:48:41 2013 for Geant4 by  doxygen 1.4.7