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 // 00028 // MODULE: G4RadioactivityTable.cc 00029 // 00030 // Version: 0.a 00031 // Date: 29/10/2010 00032 // Author: F Lei 00033 // Organisation: QinetiQ UK 00034 // Customer: ESA/ESTEC, NOORDWIJK 00035 // Contract: 12115/96/JG/NL Work Order No. 3 00036 // 00037 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 00038 // 00039 // CHANGE HISTORY 00040 // -------------- 00041 // 00042 // 29 October 2010, F. Lei QinetiQ UK 00043 // first release. 00044 // 00046 00047 00048 #include "G4RadioactivityTable.hh" 00049 00050 #include <map> 00051 00052 G4RadioactivityTable::G4RadioactivityTable() 00053 { 00054 } 00056 // 00057 G4RadioactivityTable::~G4RadioactivityTable() 00058 { 00059 fRadioactivity.clear(); 00060 } 00062 // 00063 00064 G4int G4RadioactivityTable::Entries() const 00065 { 00066 return (G4int) fRadioactivity.size(); 00067 } 00069 // 00070 void G4RadioactivityTable::AddIsotope(G4int Z, G4int A, G4double E, G4double rate, G4double weight) 00071 { 00072 G4double drate = rate*weight; 00073 G4double derror = drate*rate; 00074 G4TwoVector entry = G4TwoVector(drate,derror); 00075 std::map<G4ThreeVector,G4TwoVector>::iterator it; 00076 it = fRadioactivity.find(G4ThreeVector(Z,A,E)); 00077 if (it == fRadioactivity.end()) { 00078 fRadioactivity[G4ThreeVector(Z,A,E)] = entry; 00079 } else { 00080 fRadioactivity[G4ThreeVector(Z,A,E)] += entry; 00081 } 00082 } 00084 // 00085 G4TwoVector G4RadioactivityTable::GetRate(G4int Z, G4int A, G4double E) 00086 { 00087 if (fRadioactivity.end() == fRadioactivity.find(G4ThreeVector(Z,A,E))) { 00088 G4cout << G4ThreeVector(Z,A,E) << " is not in the map" << G4endl; 00089 G4TwoVector rate = G4TwoVector(0.,0.); 00090 return rate ; 00091 } 00092 else 00093 return fRadioactivity[G4ThreeVector(Z,A,E)]; 00094 } 00096 // 00097 map<G4ThreeVector,G4TwoVector>* G4RadioactivityTable::GetTheMap() 00098 { 00099 return &fRadioactivity; 00100 } 00102 // 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116