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 <functional>
7#include <map>
8#include <string>
9#include <string_view>
10
11class GeoMaterial;
12class GeoElement;
13
14namespace SHiPGeometry {
15
23 public:
25 ~SHiPMaterials() = default;
26
27 // Prevent copying (materials should be shared)
28 SHiPMaterials(const SHiPMaterials&) = delete;
30
36 [[nodiscard]] GeoMaterial* getMaterial(std::string_view name) const;
37
44 [[nodiscard]] GeoMaterial* requireMaterial(std::string_view name) const;
45
46 private:
47 void createElements();
48 void createMaterials();
49
50 std::map<std::string, GeoElement*> m_elements;
51 std::map<std::string, GeoMaterial*, std::less<>> m_materials;
52};
53
54} // namespace SHiPGeometry
Central material manager for the SHiP detector.
Definition SHiPMaterials.h:22
SHiPMaterials(const SHiPMaterials &)=delete
GeoMaterial * getMaterial(std::string_view name) const
Get a material by name.
Definition SHiPMaterials.cpp:20
SHiPMaterials()
Definition SHiPMaterials.cpp:15
GeoMaterial * requireMaterial(std::string_view name) const
Get a material by name, throwing if not found.
Definition SHiPMaterials.cpp:25
SHiPMaterials & operator=(const SHiPMaterials &)=delete
Definition Placement.h:14