ATLAS Offline Software
Loading...
Searching...
No Matches
AGDDMaterialStore Class Reference

#include <AGDDMaterialStore.h>

Collaboration diagram for AGDDMaterialStore:

Public Member Functions

 AGDDMaterialStore ()
void RegisterElement (AGDDElement *)
void RegisterMaterial (AGDDSimpleMaterial *)
AGDDSimpleMaterialGetMaterial (std::string)
AGDDElementGetElement (std::string)
int NumberOfMaterials ()
int NumberOfElements ()
MaterialIterator MaterialBegin ()
MaterialIterator MaterialEnd ()
ElementIterator ElementBegin ()
ElementIterator ElementEnd ()
void PrintElementNames ()
void PrintMaterialNames ()
void PrintElement (const std::string &n)
void PrintMaterial (const std::string &n)

Private Attributes

AGDDMaterialMap m_theMaterials
AGDDElementMap m_theElements
int m_nrOfMaterials
int m_nrOfElements

Detailed Description

Definition at line 23 of file AGDDMaterialStore.h.

Constructor & Destructor Documentation

◆ AGDDMaterialStore()

AGDDMaterialStore::AGDDMaterialStore ( )

Definition at line 11 of file AGDDMaterialStore.cxx.

12{
13 m_theMaterials.clear();
14 m_theElements.clear();
15}
AGDDMaterialMap m_theMaterials
AGDDElementMap m_theElements

Member Function Documentation

◆ ElementBegin()

ElementIterator AGDDMaterialStore::ElementBegin ( )
inline

Definition at line 36 of file AGDDMaterialStore.h.

36{return m_theElements.begin();}

◆ ElementEnd()

ElementIterator AGDDMaterialStore::ElementEnd ( )
inline

Definition at line 37 of file AGDDMaterialStore.h.

37{return m_theElements.end();}

◆ GetElement()

AGDDElement * AGDDMaterialStore::GetElement ( std::string el)

Definition at line 51 of file AGDDMaterialStore.cxx.

52{
53 if (m_theElements.find(el) != m_theElements.end())
54 return m_theElements[el];
55 else
56 {
57 std::cout<<" Element "<<el<<" not found!"<<std::endl;
58 return 0;
59 }
60}

◆ GetMaterial()

AGDDSimpleMaterial * AGDDMaterialStore::GetMaterial ( std::string mat)

Definition at line 41 of file AGDDMaterialStore.cxx.

42{
43 if (m_theMaterials.find(mat) != m_theMaterials.end())
44 return m_theMaterials[mat];
45 else
46 {
47 std::cout<<" Material "<<mat<<" not found!"<<std::endl;
48 return 0;
49 }
50}

◆ MaterialBegin()

MaterialIterator AGDDMaterialStore::MaterialBegin ( )
inline

Definition at line 34 of file AGDDMaterialStore.h.

34{return m_theMaterials.begin();}

◆ MaterialEnd()

MaterialIterator AGDDMaterialStore::MaterialEnd ( )
inline

Definition at line 35 of file AGDDMaterialStore.h.

35{return m_theMaterials.end();}

◆ NumberOfElements()

int AGDDMaterialStore::NumberOfElements ( )
inline

Definition at line 32 of file AGDDMaterialStore.h.

32{return m_nrOfElements;}

◆ NumberOfMaterials()

int AGDDMaterialStore::NumberOfMaterials ( )
inline

Definition at line 31 of file AGDDMaterialStore.h.

31{return m_nrOfMaterials;}

◆ PrintElement()

void AGDDMaterialStore::PrintElement ( const std::string & n)

Definition at line 90 of file AGDDMaterialStore.cxx.

91{
92 if (m_theElements.find(n)!=m_theElements.end())
93 std::cout<<*(m_theElements[n]);
94 else
95 std::cout<<"Element "<<n<<" not found!"<<std::endl;
96}

◆ PrintElementNames()

void AGDDMaterialStore::PrintElementNames ( )

Definition at line 62 of file AGDDMaterialStore.cxx.

63{
64 std::cout<<"List of elements so far defined: "<<
65 std::endl<<"-----> ";
66 AGDDElementMap::const_iterator it;
67 int i=0;
68 for (it=m_theElements.begin();it!=m_theElements.end();++it)
69 {
70 i++;
71 if (!(i%5)) std::cout<<std::endl<<"-----> ";
72 std::cout<<(*it).first<<",";
73 }
74}

◆ PrintMaterial()

void AGDDMaterialStore::PrintMaterial ( const std::string & n)

Definition at line 98 of file AGDDMaterialStore.cxx.

99{
100 if (m_theMaterials.find(n)!=m_theMaterials.end())
101 std::cout<<*(m_theMaterials[n]);
102 else
103 std::cout<<"Material "<<n<<" not found!"<<std::endl;
104}

◆ PrintMaterialNames()

void AGDDMaterialStore::PrintMaterialNames ( )

Definition at line 76 of file AGDDMaterialStore.cxx.

77{
78 std::cout<<"List of materials so far defined: "<<
79 std::endl<<"-----> ";
80 AGDDMaterialMap::const_iterator it;
81 int i=0;
82 for (it=m_theMaterials.begin();it!=m_theMaterials.end();++it)
83 {
84 i++;
85 if (!(i%5)) std::cout<<std::endl<<"-----> ";
86 std::cout<<(*it).first<<",";
87 }
88}

◆ RegisterElement()

void AGDDMaterialStore::RegisterElement ( AGDDElement * el)

Definition at line 17 of file AGDDMaterialStore.cxx.

18{
19 if (m_theElements.find(el->GetName()) != m_theElements.end())
20 {
21 std::cout<<"Element "<<el->GetName()<<" already defined:skipping"<<std::endl;
22 }
23 else
24 {
26 m_theElements[el->GetName()]=el;
27 }
28}

◆ RegisterMaterial()

void AGDDMaterialStore::RegisterMaterial ( AGDDSimpleMaterial * mat)

Definition at line 29 of file AGDDMaterialStore.cxx.

30{
31 if (m_theMaterials.find(mat->GetName()) != m_theMaterials.end())
32 {
33 std::cout<<"Material "<<mat->GetName()<<" already defined:skipping"<<std::endl;
34 }
35 else
36 {
38 m_theMaterials[mat->GetName()]=mat;
39 }
40}

Member Data Documentation

◆ m_nrOfElements

int AGDDMaterialStore::m_nrOfElements
private

Definition at line 50 of file AGDDMaterialStore.h.

◆ m_nrOfMaterials

int AGDDMaterialStore::m_nrOfMaterials
private

Definition at line 49 of file AGDDMaterialStore.h.

◆ m_theElements

AGDDElementMap AGDDMaterialStore::m_theElements
private

Definition at line 47 of file AGDDMaterialStore.h.

◆ m_theMaterials

AGDDMaterialMap AGDDMaterialStore::m_theMaterials
private

Definition at line 46 of file AGDDMaterialStore.h.


The documentation for this class was generated from the following files: