Commit e08e4650 authored by Håkan Wennlöf's avatar Håkan Wennlöf
Browse files

Added more constness

parent 2a0526c2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ namespace allpix {
         * is guaranteed to have a configuration value 'identifier' that contains an unique identifier for every same config
         * name.
         */
        std::list<Configuration>& getInstanceConfigurations() { return instance_configs_; }
        const std::list<Configuration>& getInstanceConfigurations() const { return instance_configs_; }

        /**
         * @brief Drops an instance configuration from instance configuration storage
+3 −3
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ namespace allpix {
         * Detector assembly constructor
         * @param config Configuration reference holding the unnamed section of detector configuration
         */
        explicit DetectorAssembly(Configuration& config) {
        explicit DetectorAssembly(const Configuration& config) {

            // Chip thickness
            thickness_ = config.get<double>("chip_thickness", 0);
@@ -83,7 +83,7 @@ namespace allpix {
         * Constructor for hybrid assemblies
         * @param config  Configuration reference holding the unnamed section of detector configuration
         */
        explicit HybridAssembly(Configuration& config) : DetectorAssembly(config) {
        explicit HybridAssembly(const Configuration& config) : DetectorAssembly(config) {

            // Excess around the chip from the pixel grid
            auto default_assembly_excess = config.get<double>("chip_excess", 0);
@@ -153,7 +153,7 @@ namespace allpix {
         * Constructor for monolithic assemblies
         * @param config Configuration reference holding the unnamed section of detector configuration
         */
        explicit MonolithicAssembly(Configuration& config) : DetectorAssembly(config) {
        explicit MonolithicAssembly(const Configuration& config) : DetectorAssembly(config) {

            // Excess around the chip is copied from sensor size
            auto default_assembly_excess = config.get<double>("sensor_excess", 0);
+3 −3
Original line number Diff line number Diff line
@@ -79,8 +79,8 @@ std::shared_ptr<DetectorModel> DetectorModel::factory(const std::string& name, c

DetectorModel::DetectorModel(std::string type,
                             std::shared_ptr<DetectorAssembly> assembly,
                             ConfigReader reader,
                             Configuration& config)
                             const ConfigReader reader,
                             const Configuration& config)
    : type_(std::move(type)), assembly_(std::move(assembly)), reader_(std::move(reader)) {
    using namespace ROOT::Math;

@@ -170,7 +170,7 @@ void DetectorModel::addImplant(const Implant::Type& type,
                               ROOT::Math::XYZVector size,
                               const ROOT::Math::XYVector& offset,
                               double orientation,
                               Configuration config) {
                               const Configuration config) {
    // Calculate offset from sensor center - sign of the shift depends on whether it's on front- or backside:
    auto offset_z = (getSensorSize().z() - size.z()) / 2. * (type == Implant::Type::FRONTSIDE ? 1 : -1);
    ROOT::Math::XYZVector full_offset(offset.x(), offset.y(), offset_z);
+3 −3
Original line number Diff line number Diff line
@@ -184,8 +184,8 @@ namespace allpix {
         */
        explicit DetectorModel(std::string type,
                               std::shared_ptr<DetectorAssembly> assembly,
                               ConfigReader reader,
                               Configuration& config);
                               const ConfigReader reader,
                               const Configuration& config);

        /**
         * @brief Essential virtual destructor
@@ -543,7 +543,7 @@ namespace allpix {
                        ROOT::Math::XYZVector size,
                        const ROOT::Math::XYVector& offset,
                        double orientation,
                        Configuration config);
                        const Configuration config);

        /**
         * @brief Add a new layer of support
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ void GeometryManager::load(ConfigManager* conf_manager, RandomNumberGenerator& s
    }

    // Load the list of standard model paths
    Configuration& global_config = conf_manager->getGlobalConfiguration();
    const Configuration& global_config = conf_manager->getGlobalConfiguration();
    if(global_config.has("model_paths")) {
        auto extra_paths = global_config.getPathArray("model_paths", true);
        model_paths_.insert(model_paths_.end(), extra_paths.begin(), extra_paths.end());
Loading