SHiP Geometry
SHiP experiment geometry implementation using GeoModel.
Loading...
Searching...
No Matches
SHiPMaterials.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) CERN for the benefit of the SHiP Collaboration
3
4#pragma once
5
6#include <map>
7#include <string>
8
9class GeoMaterial;
10class GeoElement;
11
12namespace SHiPGeometry {
13
21 public:
23 ~SHiPMaterials() = default;
24
25 // Prevent copying (materials should be shared)
26 SHiPMaterials(const SHiPMaterials&) = delete;
28
34 [[nodiscard]] GeoMaterial* getMaterial(const std::string& name) const;
35
42 [[nodiscard]] GeoMaterial* requireMaterial(const std::string& name) const;
43
44 private:
45 void createElements();
46 void createMaterials();
47
48 std::map<std::string, GeoElement*> m_elements;
49 std::map<std::string, GeoMaterial*> m_materials;
50};
51
52} // namespace SHiPGeometry
Central material manager for the SHiP detector.
Definition SHiPMaterials.h:20
GeoMaterial * requireMaterial(const std::string &name) const
Get a material by name, throwing if not found.
Definition SHiPMaterials.cpp:24
GeoMaterial * getMaterial(const std::string &name) const
Get a material by name.
Definition SHiPMaterials.cpp:19
SHiPMaterials(const SHiPMaterials &)=delete
SHiPMaterials()
Definition SHiPMaterials.cpp:14
SHiPMaterials & operator=(const SHiPMaterials &)=delete
Definition SHiPGeometry.h:8