source: trunk/source/particles/management/src/G4IsotopeProperty.cc @ 1276

Last change on this file since 1276 was 1196, checked in by garnier, 15 years ago

update CVS release candidate geant4.9.3.01

File size: 4.7 KB
Line 
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// $Id: G4IsotopeProperty.cc,v 1.8 2009/08/17 14:52:19 kurasige Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30//
31// ----------------------------------------------------------------------
32//      GEANT 4 class implementation file
33//
34// **********************************************************************
35//      New design using G4VIsotopeTable          5 Oct. 99 H.Kurashige
36
37#include "G4ios.hh"
38#include <iomanip>
39
40#include "G4IsotopeProperty.hh"
41#include "G4DecayTable.hh"
42
43// ######################################################################
44// ###                           IsotopeProperty                      ###
45// ######################################################################
46
47G4IsotopeProperty::G4IsotopeProperty():
48                   fAtomicNumber(0),fAtomicMass(0),
49                   fISpin(0),fEnergy(0.0),
50                   fLifeTime(-1.0),fDecayTable(0),
51                   fMagneticMoment(0.0)
52{
53}
54
55
56G4IsotopeProperty::~G4IsotopeProperty()
57{
58  if (fDecayTable != 0) delete fDecayTable;
59}
60
61G4IsotopeProperty::G4IsotopeProperty(const  G4IsotopeProperty& right)
62{
63  fAtomicNumber    = right.fAtomicNumber;
64  fAtomicMass      = right.fAtomicMass;
65  fISpin           = right.fISpin;
66  fMagneticMoment  = right.fMagneticMoment;
67  fEnergy          = right.fEnergy;
68  fLifeTime        = right.fLifeTime;
69  // decay table is not copied because G4DecayTable has no copy constructor
70  fDecayTable   = 0;
71}
72
73// Assignment operator
74G4IsotopeProperty & G4IsotopeProperty::operator=(G4IsotopeProperty& right)
75{
76  if (this != &right) {
77    fAtomicNumber    = right.fAtomicNumber;
78    fAtomicMass      = right.fAtomicMass;
79    fISpin           = right.fISpin;
80    fMagneticMoment  = right.fMagneticMoment;
81    fEnergy          = right.fEnergy;
82    fLifeTime        = right.fLifeTime;
83    // decay table is not copied because G4DecayTable has no copy constructor
84    fDecayTable   = 0;
85  }
86  return *this;
87}
88
89 
90// equal / unequal operator
91G4int G4IsotopeProperty::operator==(const G4IsotopeProperty &right) const
92{
93  G4bool value = true;
94  value = value && ( fAtomicNumber    == right.fAtomicNumber);
95  value = value && ( fAtomicMass      == right.fAtomicMass);
96  value = value && ( fISpin           == right.fISpin);
97  value = value && ( fMagneticMoment  == right.fMagneticMoment);
98  value = value && ( fEnergy          == right.fEnergy);
99  value = value && ( fLifeTime        == right.fLifeTime);
100  return value;
101}
102G4int G4IsotopeProperty::operator!=(const G4IsotopeProperty &right) const
103{
104  return !(*this == right);
105}
106
107void G4IsotopeProperty::DumpInfo() const
108{
109#ifdef G4VERBOSE
110  G4cout << "AtomicNumber: " << fAtomicNumber << G4endl;
111  G4cout << "AtomicMass: " << fAtomicMass << G4endl;
112  if (fISpin %2){
113    G4cout << "Spin: " << fISpin << "/2" << G4endl;
114  } else {
115    G4cout << "Spin: " << fISpin /2  << G4endl;
116  }
117  G4cout << "MagneticMoment: " << fMagneticMoment/MeV*tesla << "[MeV/T]" <<G4endl;
118  G4cout << "Excited Energy: " << std::setprecision(1) << fEnergy/keV << "[keV]" << G4endl;
119  G4cout << "Life Time: " << fLifeTime/ns << "[ns]" << G4endl;
120  if (fDecayTable != 0) {
121    fDecayTable->DumpInfo();
122  } else {
123    G4cout << "Decay Table is not defined !" << G4endl;
124  }
125#endif
126}
127
128
129
130
131
132
133
Note: See TracBrowser for help on using the repository browser.