ATLAS Offline Software
Loading...
Searching...
No Matches
AGDDMaterialStore.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9#include <iostream>
10
16
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}
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}
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}
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}
61
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}
75
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}
89
90void AGDDMaterialStore::PrintElement(const std::string& n)
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}
97
98void AGDDMaterialStore::PrintMaterial(const std::string& n)
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}
void RegisterElement(AGDDElement *)
AGDDMaterialMap m_theMaterials
void RegisterMaterial(AGDDSimpleMaterial *)
AGDDSimpleMaterial * GetMaterial(std::string)
void PrintElement(const std::string &n)
AGDDElementMap m_theElements
void PrintMaterial(const std::string &n)
AGDDElement * GetElement(std::string)