Geant4  10.01.p02
G4RadioactivityTable.cc
Go to the documentation of this file.
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 //
28 // MODULE: G4RadioactivityTable.cc
29 //
30 // Version: 0.a
31 // Date: 29/10/2010
32 // Author: F Lei
33 // Organisation: QinetiQ UK
34 // Customer: ESA/ESTEC, NOORDWIJK
35 // Contract: 12115/96/JG/NL Work Order No. 3
36 //
37 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 //
39 // CHANGE HISTORY
40 // --------------
41 //
42 // 29 October 2010, F. Lei QinetiQ UK
43 // first release.
44 //
46 
47 
48 #include "G4RadioactivityTable.hh"
49 
50 #include <map>
51 
53 {
54 }
56 //
58 {
59  fRadioactivity.clear();
60 }
62 //
63 
65 {
66  return (G4int) fRadioactivity.size();
67 }
69 //
71 {
72  G4double drate = rate*weight;
73  G4double derror = drate*rate;
74  G4TwoVector entry = G4TwoVector(drate,derror);
75  std::map<G4ThreeVector,G4TwoVector>::iterator it;
76  it = fRadioactivity.find(G4ThreeVector(Z,A,E));
77  if (it == fRadioactivity.end()) {
78  fRadioactivity[G4ThreeVector(Z,A,E)] = entry;
79  } else {
80  fRadioactivity[G4ThreeVector(Z,A,E)] += entry;
81  }
82 }
84 //
86 {
87  if (fRadioactivity.end() == fRadioactivity.find(G4ThreeVector(Z,A,E))) {
88  G4cout << G4ThreeVector(Z,A,E) << " is not in the map" << G4endl;
89  G4TwoVector rate = G4TwoVector(0.,0.);
90  return rate ;
91  }
92  else
93  return fRadioactivity[G4ThreeVector(Z,A,E)];
94 }
96 //
97 map<G4ThreeVector,G4TwoVector>* G4RadioactivityTable::GetTheMap()
98 {
99  return &fRadioactivity;
100 }
102 //
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 
map< G4ThreeVector, G4TwoVector > * GetTheMap()
CLHEP::Hep3Vector G4ThreeVector
int G4int
Definition: G4Types.hh:78
G4TwoVector GetRate(G4int, G4int, G4double)
G4GLOB_DLL std::ostream G4cout
static const G4double A[nN]
void AddIsotope(G4int, G4int, G4double, G4double, G4double)
CLHEP::Hep2Vector G4TwoVector
Definition: G4TwoVector.hh:42
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
map< G4ThreeVector, G4TwoVector > fRadioactivity