VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
Geant4GM
source
materials
IsotopeMap.cxx
Go to the documentation of this file.
1
// $Id$
2
3
// -----------------------------------------------------------------------
4
// The Geant4GM package of the Virtual Geometry Model
5
// Copyright (C) 2007, Ivana Hrivnacova
6
// All rights reserved.
7
//
8
// For the licensing terms see vgm/LICENSE.
9
// Contact: ivana@ipno.in2p3.fr
10
// -----------------------------------------------------------------------
11
12
//
13
// Class IsotopeMap
14
// ------------------
15
// The map between VGM and Geant4 isotopes.
16
//
17
// Author: Ivana Hrivnacova; IPN Orsay
18
19
#include "
VGM/materials/IIsotope.h
"
20
21
#include "
Geant4GM/materials/IsotopeMap.h
"
22
23
#include "G4Isotope.hh"
24
25
Geant4GM::IsotopeMap
* Geant4GM::IsotopeMap::fgInstance = 0;
26
27
//_____________________________________________________________________________
28
Geant4GM::IsotopeMap
*
Geant4GM::IsotopeMap::Instance
()
29
{
31
32
if
(!fgInstance)
new
IsotopeMap
();
33
34
return
fgInstance;
35
}
36
37
//_____________________________________________________________________________
38
Geant4GM::IsotopeMap::IsotopeMap
() : fG4Isotopes(), fVgmIsotopes()
39
{
41
42
fgInstance =
this
;
43
}
44
45
//_____________________________________________________________________________
46
Geant4GM::IsotopeMap::IsotopeMap
(
const
IsotopeMap
&)
47
{
49
}
50
51
//_____________________________________________________________________________
52
Geant4GM::IsotopeMap::~IsotopeMap
()
53
{
54
//
55
fgInstance = 0;
56
}
57
58
//
59
// public methods
60
//
61
62
//_____________________________________________________________________________
63
void
Geant4GM::IsotopeMap::AddIsotope
(
64
VGM::IIsotope
* iIsotope, G4Isotope* g4Isotope)
65
{
67
68
fG4Isotopes[iIsotope] = g4Isotope;
69
fVgmIsotopes[g4Isotope] = iIsotope;
70
}
71
72
//_____________________________________________________________________________
73
void
Geant4GM::IsotopeMap::Print
()
const
74
{
76
77
std::cout <<
"Geant4 Isotopes Map: "
<< std::endl;
78
79
int
counter = 0;
80
G4IsotopeMapCIterator
i;
81
for
(i = fG4Isotopes.begin(); i != fG4Isotopes.end(); i++) {
82
VGM::IIsotope
* iIsotope = (*i).first;
83
G4Isotope* g4Isotope = (*i).second;
84
85
std::cout <<
" "
<< counter++ <<
"th entry:"
86
<<
" vgmIsotope "
<< iIsotope <<
" "
<< iIsotope->
Name
()
87
<<
" g4Isotope "
<< g4Isotope <<
" "
<< g4Isotope->GetName()
88
<< std::endl;
89
}
90
}
91
92
//_____________________________________________________________________________
93
G4Isotope*
Geant4GM::IsotopeMap::GetIsotope
(
VGM::IIsotope
* iIsotope)
const
94
{
96
97
G4IsotopeMapCIterator
i = fG4Isotopes.find(iIsotope);
98
if
(i != fG4Isotopes.end())
99
return
(*i).second;
100
else
101
return
0;
102
}
103
104
//_____________________________________________________________________________
105
VGM::IIsotope
*
Geant4GM::IsotopeMap::GetIsotope
(G4Isotope*
Isotope
)
const
106
{
108
109
VgmIsotopeMapCIterator
i = fVgmIsotopes.find(
Isotope
);
110
if
(i != fVgmIsotopes.end())
111
return
(*i).second;
112
else
113
return
0;
114
}
IsotopeMap.h
IIsotope.h
Geant4GM::IsotopeMap
The map between VGM and Geant4 isotopes.
Definition
IsotopeMap.h:36
Geant4GM::IsotopeMap::IsotopeMap
IsotopeMap()
Definition
IsotopeMap.cxx:38
Geant4GM::IsotopeMap::G4IsotopeMapCIterator
G4IsotopeMap::const_iterator G4IsotopeMapCIterator
Definition
IsotopeMap.h:39
Geant4GM::IsotopeMap::Instance
static IsotopeMap * Instance()
Definition
IsotopeMap.cxx:28
Geant4GM::IsotopeMap::~IsotopeMap
virtual ~IsotopeMap()
Definition
IsotopeMap.cxx:52
Geant4GM::IsotopeMap::AddIsotope
void AddIsotope(VGM::IIsotope *, G4Isotope *)
Definition
IsotopeMap.cxx:63
Geant4GM::IsotopeMap::GetIsotope
G4Isotope * GetIsotope(VGM::IIsotope *iIsotope) const
Definition
IsotopeMap.cxx:93
Geant4GM::IsotopeMap::Print
void Print() const
Definition
IsotopeMap.cxx:73
Geant4GM::IsotopeMap::VgmIsotopeMapCIterator
VgmIsotopeMap::const_iterator VgmIsotopeMapCIterator
Definition
IsotopeMap.h:42
Geant4GM::Isotope
VGM implementation for Geant4 Isotope.
Definition
Isotope.h:32
VGM::IIsotope
The VGM interface to elements.
Definition
IIsotope.h:28
VGM::IIsotope::Name
virtual std::string Name() const =0
Return the name of this element.
Generated on
for VGM by
1.17.0