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

Added check for unused sections.

Cleaned up a bit, removed extraneous log messages
parent 9beef140
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -80,13 +80,7 @@ void ConfigManager::parse_detectors() {

    std::ifstream detector_file(detector_file_name);
    ConfigReader detector_reader(detector_file, detector_file_name);
    auto detector_configs =
        detector_reader
            .getConfigurations(); // Holds all the sub-configs of the detector geometry file definition. Like [implant]
    LOG(ERROR) << "Number of sub-headers: " << detector_configs.size();
    for(auto& conf : detector_configs) {
        LOG(ERROR) << "Name: " << conf.getName();
    }
    auto detector_configs = detector_reader.getConfigurations();
    detector_configs_ = std::list<Configuration>(detector_configs.begin(), detector_configs.end());
}

+0 −1
Original line number Diff line number Diff line
@@ -84,7 +84,6 @@ DetectorModel::DetectorModel(std::string type,
                             Configuration& header_config)
    : type_(std::move(type)), assembly_(std::move(assembly)), reader_(std::move(reader)) {
    using namespace ROOT::Math;
    LOG(ERROR) << "Address of header_config DetectorModel constructor: " << &header_config;

    // Sensor thickness
    setSensorThickness(header_config.get<double>("sensor_thickness"));
+6 −2
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ void GeometryManager::load(ConfigManager* conf_manager, RandomNumberGenerator& s
            throw InvalidValueError(geometry_section, "role", "unknown role");
        }

        LOG(ERROR) << "Detector " << geometry_section.getName() << ":";
        LOG(DEBUG) << "Detector " << geometry_section.getName() << ":";
        // Get the position and orientation of the detector
        auto [position, orientation] = calculate_orientation(geometry_section);

@@ -438,8 +438,12 @@ void GeometryManager::close_geometry() {
            // Get the configuration of the model
            Configuration new_config("");
            auto model_configs = model->getConfigurations();
            std::vector<std::string> valid_sections = {"", "implant", "support"};
            for(auto& conf : model_configs) {
                LOG(ERROR) << "Name in GeometryManager.cpp: " << conf.getName();
                auto section_name = allpix::transform(conf.getName(), ::tolower);
                if(std::find(valid_sections.begin(), valid_sections.end(), section_name) == valid_sections.end()) {
                    LOG(WARNING) << "Section [" << section_name << "] is not valid in sensor geometry definition.";
                }
            }

            // Add all non internal parameters to the config for a specialized model