ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
GeoModel
GeoModelUtilities
src
GeoMaterialPropertiesTable.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
GeoModelUtilities/GeoMaterialPropertiesTable.h
"
6
#include "
GeoModelUtilities/GeoMaterialPropertyVector.h
"
7
#include <stdexcept>
8
#include <iostream>
9
10
GeoMaterialPropertiesTable::GeoMaterialPropertiesTable
()
11
{
12
}
13
14
GeoMaterialPropertiesTable::~GeoMaterialPropertiesTable
()
15
{
16
MPTiterator
i;
17
for
(i =
m_MPT
.begin(); i!=
m_MPT
.end(); i++)
18
delete
(*i).second;
19
20
m_MPT
.clear();
21
m_MPTC
.clear();
22
}
23
24
25
void
GeoMaterialPropertiesTable::AddConstProperty
(
const
char
*key,
26
double
PropertyValue)
27
{
28
m_MPTC
[std::string(key)] = PropertyValue;
29
}
30
31
void
GeoMaterialPropertiesTable::AddProperty
(
const
char
*key,
32
double
* PhotonMomenta,
33
double
* PropertyValues,
34
int
NumEntries)
35
{
36
GeoMaterialPropertyVector
*mpv =
37
new
GeoMaterialPropertyVector
(PhotonMomenta,
38
PropertyValues,
39
NumEntries);
40
m_MPT
[std::string(key)] = mpv;
41
}
42
43
void
GeoMaterialPropertiesTable::AddProperty
(
const
char
*key,
44
GeoMaterialPropertyVector
*mpv)
45
{
46
m_MPT
[std::string(key)] = mpv;
47
}
48
49
void
GeoMaterialPropertiesTable::RemoveConstProperty
(
const
char
*key)
50
{
51
m_MPTC
.erase(std::string(key));
52
}
53
54
void
GeoMaterialPropertiesTable::RemoveProperty
(
const
char
*key)
55
{
56
m_MPT
.erase(std::string(key));
57
}
58
59
void
GeoMaterialPropertiesTable::AddEntry
(
const
char
*key,
60
double
aPhotonMomentum,
61
double
aPropertyValue)
62
{
63
GeoMaterialPropertyVector
*targetVector=
m_MPT
[std::string(key)];
64
if
(targetVector != 0)
65
targetVector->
AddElement
(aPhotonMomentum, aPropertyValue);
66
else
67
throw
std::runtime_error(
"GeoMaterialPropertiesTable::AddEntry ==> Material Property Vector not found."
);
68
}
69
70
GeoMaterialPropertiesTable::GeoMatPVMap_ConstIt
GeoMaterialPropertiesTable::beginPVMap
()
const
71
{
72
return
m_MPT
.begin();
73
}
74
75
GeoMaterialPropertiesTable::GeoMatPVMap_ConstIt
GeoMaterialPropertiesTable::endPVMap
()
const
76
{
77
return
m_MPT
.end();
78
}
79
80
GeoMaterialPropertiesTable::GeoMatPMap_ConstIt
GeoMaterialPropertiesTable::beginPMap
()
const
81
{
82
return
m_MPTC
.begin();
83
}
84
85
GeoMaterialPropertiesTable::GeoMatPMap_ConstIt
GeoMaterialPropertiesTable::endPMap
()
const
86
{
87
return
m_MPTC
.end();
88
}
89
90
void
GeoMaterialPropertiesTable::DumpTable
()
const
91
{
92
for
(
GeoMatPVMap_ConstIt
i=
m_MPT
.begin(); i!=
m_MPT
.end(); ++i)
93
{
94
std::cout << (*i).first <<
"\n"
;
95
if
((*i).second != 0)
96
(*i).second->DumpVector();
97
else
98
std::cout <<
"NULL Material Property Vector Pointer."
<<
"\n"
;
99
}
100
101
for
(
GeoMatPMap_ConstIt
j =
m_MPTC
.begin(); j !=
m_MPTC
.end(); ++j)
102
{
103
std::cout << j->first <<
"\n"
;
104
if
(j->second != 0)
105
std::cout << j->second <<
"\n"
;
106
else
107
std::cout <<
"No Material Constant Property."
<<
"\n"
;
108
}
109
}
110
GeoMaterialPropertiesTable.h
GeoMaterialPropertyVector.h
GeoMaterialPropertiesTable::GeoMaterialPropertiesTable
GeoMaterialPropertiesTable()
Definition
GeoMaterialPropertiesTable.cxx:10
GeoMaterialPropertiesTable::MPTiterator
GeoMatPVMap::iterator MPTiterator
Definition
GeoMaterialPropertiesTable.h:75
GeoMaterialPropertiesTable::AddConstProperty
void AddConstProperty(const char *key, double PropertyValue)
Definition
GeoMaterialPropertiesTable.cxx:25
GeoMaterialPropertiesTable::GeoMatPVMap_ConstIt
GeoMatPVMap::const_iterator GeoMatPVMap_ConstIt
Definition
GeoMaterialPropertiesTable.h:32
GeoMaterialPropertiesTable::endPMap
GeoMatPMap_ConstIt endPMap() const
Definition
GeoMaterialPropertiesTable.cxx:85
GeoMaterialPropertiesTable::AddProperty
void AddProperty(const char *key, double *PhotonMomenta, double *PropertyValues, int NumEntries)
Definition
GeoMaterialPropertiesTable.cxx:31
GeoMaterialPropertiesTable::RemoveConstProperty
void RemoveConstProperty(const char *key)
Definition
GeoMaterialPropertiesTable.cxx:49
GeoMaterialPropertiesTable::AddEntry
void AddEntry(const char *key, double aPhotonMomentum, double aPropertyValue)
Definition
GeoMaterialPropertiesTable.cxx:59
GeoMaterialPropertiesTable::beginPVMap
GeoMatPVMap_ConstIt beginPVMap() const
Definition
GeoMaterialPropertiesTable.cxx:70
GeoMaterialPropertiesTable::DumpTable
void DumpTable() const
Definition
GeoMaterialPropertiesTable.cxx:90
GeoMaterialPropertiesTable::m_MPT
GeoMatPVMap m_MPT
Definition
GeoMaterialPropertiesTable.h:72
GeoMaterialPropertiesTable::RemoveProperty
void RemoveProperty(const char *key)
Definition
GeoMaterialPropertiesTable.cxx:54
GeoMaterialPropertiesTable::~GeoMaterialPropertiesTable
~GeoMaterialPropertiesTable()
Definition
GeoMaterialPropertiesTable.cxx:14
GeoMaterialPropertiesTable::GeoMatPMap_ConstIt
GeoMatPMap::const_iterator GeoMatPMap_ConstIt
Definition
GeoMaterialPropertiesTable.h:33
GeoMaterialPropertiesTable::beginPMap
GeoMatPMap_ConstIt beginPMap() const
Definition
GeoMaterialPropertiesTable.cxx:80
GeoMaterialPropertiesTable::m_MPTC
GeoMatPMap m_MPTC
Definition
GeoMaterialPropertiesTable.h:73
GeoMaterialPropertiesTable::endPVMap
GeoMatPVMap_ConstIt endPVMap() const
Definition
GeoMaterialPropertiesTable.cxx:75
GeoMaterialPropertyVector
Definition
GeoMaterialPropertyVector.h:12
GeoMaterialPropertyVector::AddElement
void AddElement(double aPhotonMomentum, double aPropertyValue)
Definition
GeoMaterialPropertyVector.cxx:75
Generated on
for ATLAS Offline Software by
1.17.0