Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

MJDatabaseIsotope.cc

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------//
00002 //bb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nu//
00003 //                                                                           //
00004 //                         MAJORANA Simulation                               //
00005 //                                                                           //
00006 //      This code implementation is the intellectual property of the         //
00007 //      MAJORANA Collaboration. It is based on Geant4, an intellectual       //
00008 //      property of the RD44 GEANT4 collaboration.                           //
00009 //                                                                           //
00010 //                        *********************                              //
00011 //                                                                           //
00012 //    Neither the authors of this software system, nor their employing       //
00013 //    institutes, nor the agencies providing financial support for this      //
00014 //    work  make  any representation or  warranty, express or implied,       //
00015 //    regarding this software system or assume any liability for its use.    //
00016 //    By copying, distributing or modifying the Program (or any work based   //
00017 //    on on the Program) you indicate your acceptance of this statement,     //
00018 //    and all its terms.                                                     //
00019 //                                                                           //
00020 //bb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nubb0nu//
00021 //---------------------------------------------------------------------------//
00022 //                                                          
00023 // $Id: MJDatabaseIsotope.cc,v 1.2 2004/11/09 13:42:39 xliu Exp $ 
00024 //      
00025 // CLASS IMPLEMENTATION:  MJDatabaseIsotope.cc
00026 //
00027 //---------------------------------------------------------------------------//
00033 // 
00034 //---------------------------------------------------------------------------//
00044 //---------------------------------------------------------------------------//
00045 //
00046 
00047 //---------------------------------------------------------------------------//
00048 
00049 #include "database/MJDatabaseIsotope.hh"      //Present MJ Class Headers 
00050 #include "database/MJDatabaseUtil.hh"
00051 //---------------------------------------------------------------------------//
00052 
00053 MJDatabaseIsotope::MJDatabaseIsotope()
00054 {
00055 }
00056 MJDatabaseIsotope::MJDatabaseIsotope(string name, string sym, int z, int n, double a)
00057   :fName(name), 
00058   fSymb(sym), 
00059   fz(z), 
00060   fn(n), 
00061   fMolarMass(a)
00062 
00063 {
00064 }
00065 MJDatabaseIsotope::MJDatabaseIsotope(const MJDatabaseIsotope & other)
00066   :fName(other.fName), 
00067   fSymb(other.fSymb), 
00068   fz(other.fz), 
00069   fn(other.fn), 
00070   fMolarMass(other.fMolarMass)
00071 {
00072  
00073 }
00074 
00075 MJDatabaseIsotope::~MJDatabaseIsotope()
00076 {
00077 }
00078 MJDatabaseIsotope*
00079 MJDatabaseIsotope::createIsotope(PGresult * res){
00080 
00081   MJDatabaseUtil dbutil;
00082   for (int i = 0; i < PQntuples(res); i++)
00083     {
00084       fName = PQgetvalue(res, i, 0);
00085       fSymb = PQgetvalue(res, i, 1);
00086       fz=dbutil.c_Int(PQgetvalue(res, i, 2));
00087       fn=dbutil.c_Int(PQgetvalue(res, i, 3));
00088       fMolarMass=dbutil.c_Float(PQgetvalue(res, i, 4));
00089       fPnnlkey = PQgetvalue(res, i, 5);
00090       fDecay5 = PQgetvalue(res, i, 6);
00091       fComment = PQgetvalue(res, i, 7);
00092 
00093     }
00094   return this;
00095 }
00096 void
00097 MJDatabaseIsotope::print()
00098 {
00099   cout << "***** Isotope Properties *****\n"
00100        << "Name         :  " << GetName() << endl
00101        << "Symbol       :  " << GetSymbol() << endl
00102        << "Z-number     :  " << GetZ() << endl
00103        << "# of nucleons:  " << GetN() << endl
00104        << "Molar mass   :  " << GetMolarMass() << endl;
00105 }
00106 ostream& operator << (ostream& os, MJDatabaseIsotope & iso){
00107   os << '\n';
00108   os << "***** Isotope Properties *****\n"
00109      << "Name         :  " << iso.GetName() << endl
00110      << "Symbol       :  " << iso.GetSymbol() << endl
00111      << "Z-number     :  " << iso.GetZ() << endl
00112      << "# of nucleons:  " << iso.GetN() << endl
00113      << "Molar mass   :  " << iso.GetMolarMass() << endl;
00114   return os;
00115 }

Generated on Mon Nov 29 16:58:49 2004 for Majorana Simulation by  doxygen 1.3.9.1