Commit a3e5d377 authored by Petja Skomina's avatar Petja Skomina
Browse files

Fixed an issue, with the unit on the y-axis -- amplitude -- of the response graph.

parent 8d8cdcc3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -65,7 +65,8 @@ CSADigitizerModule::CSADigitizerModule(Configuration& config, Messenger* messeng
        config_.setDefault<double>("weak_inversion_slope", 1.5);
        config_.setDefault<double>("temperature", 293.15);
    } else if(model_ == DigitizerType::GRAPH) {
        config_.setDefault<double>("graph_time_unit_", Units::get(1, "s"));
        config_.setDefault<double>("graph_time_unit", Units::get(1, "s"));
        config_.setDefault<double>("graph_amplitude_unit", Units::get(1.0, "V/e"));
    }

    // Copy some variables from configuration to avoid lookups:
@@ -173,6 +174,7 @@ CSADigitizerModule::CSADigitizerModule(Configuration& config, Messenger* messeng
        const auto graph_path = config_.getPath("graph_file", true);
        graph_impulse_response_ = std::make_unique<TGraph>(graph_path.c_str(), "%lg,%lg");
        graph_time_unit_ = config_.get<double>("graph_time_unit");
        graph_amplitude_unit_ = config_.get<double>("graph_amplitude_unit");
    }

    output_plots_ = config_.get<bool>("output_plots");
@@ -261,7 +263,8 @@ void CSADigitizerModule::run(Event* event) {
                               << graph_impulse_response_->Eval(timestep * static_cast<double>(itimepoint) /
                                                                graph_time_unit_);
                    impulse_response_function_.push_back(
                        graph_impulse_response_->Eval(timestep * static_cast<double>(itimepoint) / graph_time_unit_));
                        graph_impulse_response_->Eval(timestep * static_cast<double>(itimepoint) / graph_time_unit_) *
                        graph_amplitude_unit_);
                }
            }

+2 −0
Original line number Diff line number Diff line
@@ -85,6 +85,8 @@ namespace allpix {
        std::unique_ptr<TGraph> graph_impulse_response_;
        // Time unit on the response function graph
        double graph_time_unit_;
        // Amplitude unit on the response function graph
        double graph_amplitude_unit_;

        // Parameters of the electronics: Noise, time-over-threshold logic
        double sigmaNoise_{}, clockToT_{}, clockToA_{}, threshold_{};
+4 −1
Original line number Diff line number Diff line
@@ -83,7 +83,8 @@ If this behavior is not desired, the `ignore_polarity` parameter can be set to c

* `graph_file`: The path to the .csv file containing the graph of the response function.
* The file should be written in the following format: `x,y` (comma separated values), where x is the time and y the amplitude of the response function at that time point. Each pair of values should be written in a new line.
* `graph_time_unit`: Time unit in which the time on the response function graph is expressed. Should be a double.
* `graph_time_unit`: Time unit in which the time on the response function graph is expressed. Should be a double. Defaults to seconds (s).
* `graph_amplitude_unit`: The unit in which data on the y-axis of the response function graph is expressed. Should be a double. Defaults to volts per electron (V/e).

### Plotting parameters

@@ -139,12 +140,14 @@ clock_bin_tot = 8ns
```

Example for the `graph` model:

```ini
[CSADigitizer]
model = "graph"
graph_file = /path/to/response_function.csv
integration_time = 10ns
graph_time_unit = 1s
graph_amplitude_unit = 1.0V/e
```

[@kleczek]: https://doi.org/10.1109/MIXDES.2015.7208529