ATLAS Offline Software
Loading...
Searching...
No Matches
RDBMaterialManager.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef GEOMODELSVC_RDBMATERIALMANAGER_H
6#define GEOMODELSVC_RDBMATERIALMANAGER_H
7
14
17#include "GeoModelKernel/GeoIntrusivePtr.h"
18#include "GeoModelKernel/GeoElement.h"
20
21#include <string>
22#include <vector>
23#include <iosfwd>
24
25class GeoMaterial;
26class ISvcLocator;
27
29
30 public:
31
32 // Constructor:
33 RDBMaterialManager(ISvcLocator* pSvcLocator);
34
35 // Destructor:
37
38 // Query the material:
39 virtual const GeoMaterial *getMaterial(const std::string &name) override;
40
41 // Query the elements:
42 virtual const GeoElement *getElement(const std::string & name) override;
43
44 // Query the elements (by atomic number):
45 virtual const GeoElement *getElement(unsigned int atomicNumber) override;
46
47 // Add new material
48 virtual void addMaterial(const std::string& space, GeoMaterial* material) override;
49
51 virtual StoredMaterialManager::MaterialMapIterator end() const override;
52
53 // Number of materials in the manager
54 virtual size_t size() override;
55
56 virtual std::ostream & printAll(std::ostream & o=std::cout) const override;
57
58 private:
59
60 StatusCode readMaterialsFromDB(ISvcLocator* pSvcLocator);
61
63
64 GeoElement *searchElementVector (const std::string & name) const;
65 GeoElement *searchElementVector (const unsigned int atomicNumber) const;
66 GeoMaterial *searchMaterialMap (const std::string & name) const;
67
69
70 using GeoEleVec = std::vector<GeoIntrusivePtr<GeoElement>>;
73
75 {
76 DetectorAuxData(const std::string& prim_key
77 , IRDBRecordset_ptr materials
78 , IRDBRecordset_ptr matcomponents)
79 : m_prim_key(prim_key)
80 , m_materials(std::move(materials))
81 , m_matcomponents(std::move(matcomponents))
82 {}
83
84 std::string m_prim_key{};
87 };
88
89 std::map<std::string,DetectorAuxData> m_detData;
90};
91
92
93#endif
Definition of the abstract IRDBAccessSvc interface.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
GeoMaterial * searchMaterialMap(const std::string &name) const
virtual std::ostream & printAll(std::ostream &o=std::cout) const override
StatusCode readMaterialsFromDB(ISvcLocator *pSvcLocator)
virtual StoredMaterialManager::MaterialMapIterator end() const override
virtual const GeoMaterial * getMaterial(const std::string &name) override
std::vector< GeoIntrusivePtr< GeoElement > > GeoEleVec
virtual void addMaterial(const std::string &space, GeoMaterial *material) override
std::map< std::string, DetectorAuxData > m_detData
virtual StoredMaterialManager::MaterialMapIterator begin() const override
RDBMaterialManager(ISvcLocator *pSvcLocator)
IRDBRecordset_ptr m_elements
GeoElement * searchElementVector(const std::string &name) const
StoredMaterialManager::MaterialMap m_materialMap
virtual size_t size() override
virtual ~RDBMaterialManager()
virtual const GeoElement * getElement(const std::string &name) override
StoredMaterialManager()=default
MaterialMap::const_iterator MaterialMapIterator
std::map< std::string, GeoIntrusivePtr< GeoMaterial > > MaterialMap
STL namespace.
DetectorAuxData(const std::string &prim_key, IRDBRecordset_ptr materials, IRDBRecordset_ptr matcomponents)