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

Added `potential_depth` keyword, to set the depth the imported weighting...

Added `potential_depth` keyword, to set the depth the imported weighting potential should be stretched over
parent 8304ec26
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -43,8 +43,13 @@ void WeightingPotentialReaderModule::initialize() {

    // Calculate thickness domain
    auto model = detector_->getModel();
    auto potential_depth = config_.get<double>("potential_depth", model->getSensorSize().z());
    if(potential_depth - model->getSensorSize().z() > std::numeric_limits<double>::epsilon()) {
        throw InvalidValueError(
            config_, "potential_depth", "Weighting potential depth can not be larger than the sensor thickness");
    }
    auto sensor_max_z = model->getSensorCenter().z() + model->getSensorSize().z() / 2.0;
    auto thickness_domain = std::make_pair(sensor_max_z - model->getSensorSize().z(), sensor_max_z);
    auto thickness_domain = std::make_pair(sensor_max_z - potential_depth, sensor_max_z);

    // Calculate the potential depending on the configuration
    if(field_model == WeightingPotential::MESH) {