ATLAS Offline Software
RDBMaterialManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELSVC_RDBMATERIALMANAGER_H
6 #define GEOMODELSVC_RDBMATERIALMANAGER_H
7 
8 //---------------------------------------------------------//
9 // //
10 // class RDBMaterialManager This is a material manager //
11 // which gets its material from RDB. //
12 // //
13 // Joe Boudreau March 2003 //
14 // //
15 //---------------------------------------------------------//
18 #include "GeoModelKernel/GeoIntrusivePtr.h"
19 #include "GeoModelKernel/GeoElement.h"
20 
21 #include <string>
22 #include <vector>
23 #include <iosfwd>
24 
25 class GeoMaterial;
26 class 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 
50  virtual StoredMaterialManager::MaterialMapIterator begin() const override;
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 
62  void buildSpecialMaterials();
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 
68  // For DataBase connection and Query
70 
93 
94  using GeoEleVec = std::vector<GeoIntrusivePtr<GeoElement>>;
97 };
98 
99 
100 #endif
RDBMaterialManager::m_indetmatcomponents
IRDBRecordset_ptr m_indetmatcomponents
Definition: RDBMaterialManager.h:86
RDBMaterialManager::m_shieldmatcomponents
IRDBRecordset_ptr m_shieldmatcomponents
Definition: RDBMaterialManager.h:88
RDBMaterialManager::addMaterial
virtual void addMaterial(const std::string &space, GeoMaterial *material) override
Definition: RDBMaterialManager.cxx:671
StoredMaterialManager::MaterialMap
std::map< std::string, GeoIntrusivePtr< GeoMaterial > > MaterialMap
Definition: StoredMaterialManager.h:30
RDBMaterialManager::m_toromaterials
IRDBRecordset_ptr m_toromaterials
Definition: RDBMaterialManager.h:91
RDBMaterialManager::m_larmatcomponents
IRDBRecordset_ptr m_larmatcomponents
Definition: RDBMaterialManager.h:76
RDBMaterialManager::m_sctmaterials
IRDBRecordset_ptr m_sctmaterials
Definition: RDBMaterialManager.h:83
RDBMaterialManager::m_materialMap
StoredMaterialManager::MaterialMap m_materialMap
Definition: RDBMaterialManager.h:96
RDBMaterialManager::m_muomaterials
IRDBRecordset_ptr m_muomaterials
Definition: RDBMaterialManager.h:77
RDBMaterialManager::m_trtmaterials
IRDBRecordset_ptr m_trtmaterials
Definition: RDBMaterialManager.h:71
RDBMaterialManager::m_sctmatcomponents
IRDBRecordset_ptr m_sctmatcomponents
Definition: RDBMaterialManager.h:84
RDBMaterialManager::m_pixmaterials
IRDBRecordset_ptr m_pixmaterials
Definition: RDBMaterialManager.h:79
RDBMaterialManager
Definition: RDBMaterialManager.h:28
RDBMaterialManager::m_stdmatcomponents
IRDBRecordset_ptr m_stdmatcomponents
Definition: RDBMaterialManager.h:74
RDBMaterialManager::m_elementVector
GeoEleVec m_elementVector
Definition: RDBMaterialManager.h:95
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
RDBMaterialManager::m_trtmatcomponents
IRDBRecordset_ptr m_trtmatcomponents
Definition: RDBMaterialManager.h:72
RDBMaterialManager::m_muomatcomponents
IRDBRecordset_ptr m_muomatcomponents
Definition: RDBMaterialManager.h:78
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
RDBMaterialManager::readMaterialsFromDB
StatusCode readMaterialsFromDB(ISvcLocator *pSvcLocator)
Definition: RDBMaterialManager.cxx:141
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
RDBMaterialManager::size
virtual size_t size() override
Definition: RDBMaterialManager.cxx:697
RDBMaterialManager::m_tilematerials
IRDBRecordset_ptr m_tilematerials
Definition: RDBMaterialManager.h:89
RDBMaterialManager::m_pixmatcomponents
IRDBRecordset_ptr m_pixmatcomponents
Definition: RDBMaterialManager.h:80
RDBMaterialManager::m_tilematcomponents
IRDBRecordset_ptr m_tilematcomponents
Definition: RDBMaterialManager.h:90
RDBMaterialManager::getMaterial
virtual const GeoMaterial * getMaterial(const std::string &name) override
Definition: RDBMaterialManager.cxx:376
RDBMaterialManager::m_toromatcomponents
IRDBRecordset_ptr m_toromatcomponents
Definition: RDBMaterialManager.h:92
RDBMaterialManager::m_stdmaterials
IRDBRecordset_ptr m_stdmaterials
Definition: RDBMaterialManager.h:73
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
StoredMaterialManager.h
RDBMaterialManager::printAll
virtual std::ostream & printAll(std::ostream &o=std::cout) const override
Definition: RDBMaterialManager.cxx:702
RDBMaterialManager::getElement
virtual const GeoElement * getElement(const std::string &name) override
Definition: RDBMaterialManager.cxx:581
RDBMaterialManager::m_indetmaterials
IRDBRecordset_ptr m_indetmaterials
Definition: RDBMaterialManager.h:85
RDBMaterialManager::~RDBMaterialManager
virtual ~RDBMaterialManager()
RDBMaterialManager::RDBMaterialManager
RDBMaterialManager(ISvcLocator *pSvcLocator)
Definition: RDBMaterialManager.cxx:134
StoredMaterialManager::MaterialMapIterator
MaterialMap::const_iterator MaterialMapIterator
Definition: StoredMaterialManager.h:31
RDBMaterialManager::buildSpecialMaterials
void buildSpecialMaterials()
Definition: RDBMaterialManager.cxx:719
RDBMaterialManager::searchMaterialMap
GeoMaterial * searchMaterialMap(const std::string &name) const
Definition: RDBMaterialManager.cxx:317
StoredMaterialManager
This class holds one or more material managers and makes them storeable, under StoreGate.
Definition: StoredMaterialManager.h:28
RDBMaterialManager::begin
virtual StoredMaterialManager::MaterialMapIterator begin() const override
Definition: RDBMaterialManager.cxx:687
RDBMaterialManager::m_pixtbmaterials
IRDBRecordset_ptr m_pixtbmaterials
Definition: RDBMaterialManager.h:81
RDBMaterialManager::m_shieldmaterials
IRDBRecordset_ptr m_shieldmaterials
Definition: RDBMaterialManager.h:87
RDBMaterialManager::end
virtual StoredMaterialManager::MaterialMapIterator end() const override
Definition: RDBMaterialManager.cxx:692
RDBMaterialManager::m_pixtbmatcomponents
IRDBRecordset_ptr m_pixtbmatcomponents
Definition: RDBMaterialManager.h:82
RDBMaterialManager::m_elements
IRDBRecordset_ptr m_elements
Definition: RDBMaterialManager.h:69
RDBMaterialManager::searchElementVector
GeoElement * searchElementVector(const std::string &name) const
Definition: RDBMaterialManager.cxx:337
RDBMaterialManager::m_larmaterials
IRDBRecordset_ptr m_larmaterials
Definition: RDBMaterialManager.h:75
RDBMaterialManager::GeoEleVec
std::vector< GeoIntrusivePtr< GeoElement > > GeoEleVec
Definition: RDBMaterialManager.h:94