ATLAS Offline Software
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 
7 #include <stdexcept>
8 #include <iostream>
9 
11 {
12 }
13 
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 
26  double PropertyValue)
27 {
28  m_MPTC [std::string(key)] = PropertyValue;
29 }
30 
32  double* PhotonMomenta,
33  double* PropertyValues,
34  int NumEntries)
35 {
37  new GeoMaterialPropertyVector(PhotonMomenta,
38  PropertyValues,
39  NumEntries);
40  m_MPT[std::string(key)] = mpv;
41 }
42 
45 {
46  m_MPT [std::string(key)] = mpv;
47 }
48 
50 {
51  m_MPTC.erase(std::string(key));
52 }
53 
55 {
56  m_MPT.erase(std::string(key));
57 }
58 
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 
71 {
72  return m_MPT.begin();
73 }
74 
76 {
77  return m_MPT.end();
78 }
79 
81 {
82  return m_MPTC.begin();
83 }
84 
86 {
87  return m_MPTC.end();
88 }
89 
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 
GeoMaterialPropertyVector.h
GeoMaterialPropertyVector::AddElement
void AddElement(double aPhotonMomentum, double aPropertyValue)
Definition: GeoMaterialPropertyVector.cxx:75
GeoMaterialPropertiesTable::endPMap
GeoMatPMap_ConstIt endPMap() const
Definition: GeoMaterialPropertiesTable.cxx:85
GeoMaterialPropertiesTable::endPVMap
GeoMatPVMap_ConstIt endPVMap() const
Definition: GeoMaterialPropertiesTable.cxx:75
GeoMaterialPropertiesTable::AddProperty
void AddProperty(const char *key, double *PhotonMomenta, double *PropertyValues, int NumEntries)
Definition: GeoMaterialPropertiesTable.cxx:31
GeoMaterialPropertiesTable::AddConstProperty
void AddConstProperty(const char *key, double PropertyValue)
Definition: GeoMaterialPropertiesTable.cxx:25
GeoMaterialPropertiesTable::GeoMatPMap_ConstIt
GeoMatPMap::const_iterator GeoMatPMap_ConstIt
Definition: GeoMaterialPropertiesTable.h:33
GeoMaterialPropertiesTable::RemoveConstProperty
void RemoveConstProperty(const char *key)
Definition: GeoMaterialPropertiesTable.cxx:49
lumiFormat.i
int i
Definition: lumiFormat.py:92
GeoMaterialPropertiesTable::m_MPT
GeoMatPVMap m_MPT
Definition: GeoMaterialPropertiesTable.h:72
GeoMaterialPropertiesTable::~GeoMaterialPropertiesTable
~GeoMaterialPropertiesTable()
Definition: GeoMaterialPropertiesTable.cxx:14
GeoMaterialPropertiesTable::GeoMatPVMap_ConstIt
GeoMatPVMap::const_iterator GeoMatPVMap_ConstIt
Definition: GeoMaterialPropertiesTable.h:32
GeoMaterialPropertiesTable::beginPMap
GeoMatPMap_ConstIt beginPMap() const
Definition: GeoMaterialPropertiesTable.cxx:80
GeoMaterialPropertiesTable::m_MPTC
GeoMatPMap m_MPTC
Definition: GeoMaterialPropertiesTable.h:73
GeoMaterialPropertiesTable.h
GeoMaterialPropertiesTable::DumpTable
void DumpTable() const
Definition: GeoMaterialPropertiesTable.cxx:90
GeoMaterialPropertiesTable::RemoveProperty
void RemoveProperty(const char *key)
Definition: GeoMaterialPropertiesTable.cxx:54
GeoMaterialPropertiesTable::MPTiterator
GeoMatPVMap::iterator MPTiterator
Definition: GeoMaterialPropertiesTable.h:75
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
GeoMaterialPropertyVector
Definition: GeoMaterialPropertyVector.h:12
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
GeoMaterialPropertiesTable::GeoMaterialPropertiesTable
GeoMaterialPropertiesTable()
Definition: GeoMaterialPropertiesTable.cxx:10