src/modules/GeometryBuilderGeant4/MaterialManager.hpp

Light-weigth material manager for the GeometryBuilderGeant4 module. More…

Namespaces

Name
allpix
Helper class to hold support layers for a detector model.

Classes

Name
class allpix::Materials

Detailed Description

Light-weigth material manager for the GeometryBuilderGeant4 module.

Copyright: Copyright (c) 2021-2024 CERN and the Allpix Squared authors. This software is distributed under the terms of the MIT License, copied verbatim in the file “LICENSE.md”. In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction. SPDX-License-Identifier: MIT

Source code


#ifndef ALLPIX_GEANT4_MATERIALS_H
#define ALLPIX_GEANT4_MATERIALS_H

#include "core/utils/log.h"

#include <G4Material.hh>
#include <G4NistManager.hh>

namespace allpix {

    class Materials {
    public:
        Materials(Materials const&) = delete;
        void operator=(Materials const&) = delete;

        static Materials& getInstance();

        G4Material* get(const std::string& material) const;

        void set(const std::string& name, G4Material* material);

    private:
        Materials() { init_materials(); };

        void init_materials();

        // Map of materials
        std::map<std::string, G4Material*> materials_;
    };

} // namespace allpix

#endif /* ALLPIX_GEANT4_MATERIALS_H */

Updated on 2024-12-13 at 08:31:37 +0000