src/modules/GeometryBuilderGeant4/PassiveMaterialModel.hpp

Base of passive material volumes. More…

Namespaces

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

Classes

Name
class allpix::PassiveMaterialModel
Base of all passive material models.

Detailed Description

Base of passive material volumes.

Copyright: Copyright (c) 2019-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_MODULE_PASSIVE_MATERIAL_MODEL_H
#define ALLPIX_MODULE_PASSIVE_MATERIAL_MODEL_H

#include "core/config/Configuration.hpp"
#include "core/config/exceptions.h"
#include "core/geometry/GeometryManager.hpp"
#include "core/utils/log.h"
#include "tools/ROOT.h"

#include <G4LogicalVolume.hh>
#include <G4RotationMatrix.hh>
#include <G4VSolid.hh>

namespace allpix {
    class PassiveMaterialModel {
    public:
        static std::shared_ptr<PassiveMaterialModel> factory(const Configuration& config, GeometryManager* geo_manager);

        PassiveMaterialModel(const Configuration& config, GeometryManager* geo_manager);

        virtual ~PassiveMaterialModel() = default;

        virtual double getMaxSize() const = 0;

        virtual void buildVolume(const std::shared_ptr<G4LogicalVolume>& world_log);

        const std::string& getName() const { return name_; }

        const std::string& getMotherVolume() const { return mother_volume_; }

    protected:
        virtual std::shared_ptr<G4VSolid> get_solid() const = 0;

        void set_visualization_attributes(G4LogicalVolume* volume, G4LogicalVolume* mother_volume);

        void add_points();

        Configuration config_;
        GeometryManager* geo_manager_;
        double max_size_{};

        std::string name_;
        ROOT::Math::Rotation3D orientation_;
        ROOT::Math::XYZPoint position_;
        std::shared_ptr<G4RotationMatrix> rotation_;
        std::string mother_volume_;

        // Storage of internal objects
        std::vector<std::shared_ptr<G4VSolid>> solids_;
    };
} // namespace allpix

#endif // ALLPIX_MODULE_PASSIVE_MATERIAL_MODEL_H

Updated on 2025-02-27 at 14:14:46 +0000