Commit cdb6e9e9 authored by Paul Schütze's avatar Paul Schütze
Browse files

Rename "Cons" to "Cone"

parent 1ff6d705
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@ material = "copper"
role = "passive"


[cons1]
type = "cons"
[cone1]
type = "cone"
outer_radius_pDz = 10mm
inner_radius_pDz =  9mm
outer_radius_mDz = 20mm
+3 −3
Original line number Diff line number Diff line
@@ -27,8 +27,8 @@
#include "MaterialManager.hpp"
#include "PassiveMaterialModel.hpp"
#include "passive_models/BoxModel.hpp"
#include "passive_models/ConeModel.hpp"
#include "passive_models/CylinderModel.hpp"
#include "passive_models/ConsModel.hpp"
#include "passive_models/GDMLModel.hpp"
#include "passive_models/SphereModel.hpp"

@@ -44,8 +44,8 @@ std::shared_ptr<PassiveMaterialModel> allpix::PassiveMaterialModel::factory(cons
        return std::make_shared<CylinderModel>(config, geo_manager);
    } else if(type == "sphere") {
        return std::make_shared<SphereModel>(config, geo_manager);
    } else if(type == "cons"){
        return std::make_shared<ConsModel>(config, geo_manager);        
    } else if(type == "cone") {
        return std::make_shared<ConeModel>(config, geo_manager);
    } else if(type == "gdml") {
#ifdef Geant4_GDML
        return std::make_shared<GDMLModel>(config, geo_manager);
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ The necessary module errors and warnings have been included to make sure the use

Note: If the VisualizationGeant4 module is used in conjunction with and `arc_length_theta` different from 180deg, the Visualization GUI will show an error "Inconsistency in bounding boxes for solid". The origin of this error is unknown but the error can be ignored.

#### Cons:
#### Cone:
A cone or partly made cone with an inner and outer radius at the (- half-length , + half-length)
 outer_radius_mDz : at - half-length the outer radius
                outer_radius_pDz : at + half-length the outer radius
+49 −32
Original line number Diff line number Diff line
/**
 * @file
 * @brief Parameters of a CONS passive material model
 * @brief Parameters of a CONE passive material model
 *
 * @copyright Copyright (c) 2017-2020 CERN and the Allpix Squared authors.
 * This software is distributed under the terms of the MIT License, copied verbatim in the file "LICENSE.md".
@@ -8,8 +8,8 @@
 * Intergovernmental Organization or submit itself to any jurisdiction.
 */

#ifndef ALLPIX_PASSIVE_MATERIAL_CONS_H
#define ALLPIX_PASSIVE_MATERIAL_CONS_H
#ifndef ALLPIX_PASSIVE_MATERIAL_CONE_H
#define ALLPIX_PASSIVE_MATERIAL_CONE_H

#include <string>

@@ -19,17 +19,17 @@
#include "tools/geant4/geant4.h"

namespace allpix {
    class ConsModel : public PassiveMaterialModel {
    class ConeModel : public PassiveMaterialModel {
    public:
        /**
         * @brief Constructs the Cons passive material model
         * @brief Constructs the Cone passive material model
         * @param config Configuration with description of the model
         * @param geo_manager Pointer to the global geometry manager
         */
        explicit ConsModel(const Configuration& config, GeometryManager* geo_manager)
        explicit ConeModel(const Configuration& config, GeometryManager* geo_manager)
            : PassiveMaterialModel(config, geo_manager) {

            // Set the CONS specifications
            // Set the CONE specifications
            /*
            must-fill :
                outer_radius_mDz : at - half-length the outer radius
@@ -46,17 +46,28 @@ namespace allpix {
            setArcLength(config_.get<double>("arc_length", 360 * CLHEP::deg));
            std::string name = config_.getName();
            // Limit the values that can be given
            if(inner_radius_mDz >= outer_radius_mDz) throw InvalidValueError(config_, "inner_radius_mDz", "inner_radius (-half Legth)  cannot be larger than the outer_radius (+ half Length)");            
            if(inner_radius_pDz >= outer_radius_pDz) throw InvalidValueError(config_, "inner_radius_pDz", "inner_radius (+half Length) cannot be larger than the outer_raidus (+ half Length)");                     
            if(inner_radius_mDz >= outer_radius_mDz)
                throw InvalidValueError(
                    config_,
                    "inner_radius_mDz",
                    "inner_radius (-half Legth)  cannot be larger than the outer_radius (+ half Length)");
            if(inner_radius_pDz >= outer_radius_pDz)
                throw InvalidValueError(
                    config_,
                    "inner_radius_pDz",
                    "inner_radius (+half Length) cannot be larger than the outer_raidus (+ half Length)");
            if(arc_length_ > 360 * CLHEP::deg) {
                throw InvalidValueError(config_, "arc_length", "arc_length exceeds the maximum value of 360 degrees");
            }

            solid_ = make_shared_no_delete<G4Cons>(
                name + "_volume", inner_radius_mDz, outer_radius_mDz, 
                                  inner_radius_pDz, outer_radius_pDz, 
            solid_ = make_shared_no_delete<G4Cons>(name + "_volume",
                                                   inner_radius_mDz,
                                                   outer_radius_mDz,
                                                   inner_radius_pDz,
                                                   outer_radius_pDz,
                                                   length_ / 2.,
                                  starting_angle_, arc_length_);
                                                   starting_angle_,
                                                   arc_length_);

            // Get the maximum of the size parameters
            max_size_ = std::max(2 * inner_radius_pDz, length_);
@@ -85,31 +96,37 @@ namespace allpix {
        double arc_length_;

        /**
         * @brief Set the inner radius of the CONS in the XY-plane at -halfLenght and +halfLength
         * @param val Inner radius of the CONS
         * @brief Set the inner radius of the CONE in the XY-plane at -halfLenght and +halfLength
         * @param val Inner radius of the CONE
         */
        void setInnerRadius(double val_mDz, double val_pDz ) { inner_radius_mDz = val_mDz; inner_radius_pDz = val_pDz; }
        void setInnerRadius(double val_mDz, double val_pDz) {
            inner_radius_mDz = val_mDz;
            inner_radius_pDz = val_pDz;
        }
        /**
         * @brief Set the outer radius of the CONS in the XY-plane at -halfLenght and +halfLength
         * @param val Outer radius of the CONS
         * @brief Set the outer radius of the CONE in the XY-plane at -halfLenght and +halfLength
         * @param val Outer radius of the CONE
         */
        void setOuterRadius(double val_mDz, double val_pDz ) { outer_radius_mDz = val_mDz; outer_radius_pDz = val_pDz; }
        void setOuterRadius(double val_mDz, double val_pDz) {
            outer_radius_mDz = val_mDz;
            outer_radius_pDz = val_pDz;
        }
        /**
         * @brief Set the length of the CONS in the Z-directior
         * @brief Set the length of the CONE in the Z-directior
         * @param val Offset from the pixel grid center
         */
        void setLength(double val) { length_ = val; }
        /**
         * @brief Set starting angle of the circumference of the CONS in degrees
         * @param val Starting angle of the CONS
         * @brief Set starting angle of the circumference of the CONE in degrees
         * @param val Starting angle of the CONE
         */
        void setStartingAngle(double val) { starting_angle_ = val; }
        /**
         * @brief Set arc length of the circumference in degrees
         * @param val Arc length of the CONS
         * @param val Arc length of the CONE
         */
        void setArcLength(double val) { arc_length_ = val; }
    };
} // namespace allpix

#endif /* ALLPIX_PASSIVE_MATERIAL_CONS_H */
#endif /* ALLPIX_PASSIVE_MATERIAL_CONE_H */