Commit 57c7cad7 authored by Petja Skomina's avatar Petja Skomina
Browse files

Resolved the remaining requested changes after initial merge request of branch digi.

parent a1c6274b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ The following authors, in alphabetical order, have developed or contributed to A
* Sebastian Schmidt, FAU Erlangen, [schmidtseb](https://github.com/schmidtseb)
* Sanchit Sharma, Kansas State University, [SanchitKratos](https://github.com/SanchitKratos)
* Xin Shi, Institute of High Energy Physics Beijing, [xshi](https://gitlab.cern.ch/xshi)
* Petja Skomina, Nikhef, [pskomina](https://gitlab.cern.ch/pskomina)
* Petr Smolyanskiy, Czech Technical Univbersity Prague, [psmolyan](https://gitlab.cern.ch/psmolyan)
* Viktor Sonesten, GSOC2018 Student, [tmplt](https://github.com/tmplt)
* Reem Taibah, Université de Paris, [retaibah](https://gitlab.cern.ch/retaibah)
+4 −3
Original line number Diff line number Diff line
@@ -168,8 +168,9 @@ CSADigitizerModule::CSADigitizerModule(Configuration& config, Messenger* messeng

        LOG(DEBUG) << "Response function successfully initialized with " << parameters.size() << " parameters";
    } else if(model_ == DigitizerType::GRAPH) {
        const auto graph_path = config_.getPath("graph_file", true); // perhaps change auto later
        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<std::string>("graph_time_unit", "s");
    }

    output_plots_ = config_.get<bool>("output_plots");
@@ -256,8 +257,8 @@ void CSADigitizerModule::run(Event* event) {
                } else {
                    LOG(TRACE) << timestep * static_cast<double>(itimepoint) << ", "
                               << graph_impulse_response_->Eval(timestep * static_cast<double>(itimepoint));
                    impulse_response_function_.push_back(graph_impulse_response_->Eval(static_cast<double>(Units::convert(
                        timestep * static_cast<double>(itimepoint), config_.get<std::string>("csv_time_unit", "s")))));
                    impulse_response_function_.push_back(graph_impulse_response_->Eval(
                        static_cast<double>(Units::convert(timestep * static_cast<double>(itimepoint), graph_time_unit_))));
                }
            }

+5 −2
Original line number Diff line number Diff line
@@ -22,9 +22,9 @@
#include "objects/PixelCharge.hpp"

#include <TFormula.h>
#include <TGraph.h>
#include <TH1D.h>
#include <TH2D.h>
#include <TGraph.h>

namespace allpix {
    /**
@@ -81,7 +81,10 @@ namespace allpix {

        // Function to calculate impulse response
        std::unique_ptr<TFormula> calculate_impulse_response_;
        // Graph to store interpolated data points as response function
        std::unique_ptr<TGraph> graph_impulse_response_;
        // Time unit on the response function graph
        std::string graph_time_unit_;

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

## Parameters

* `model`: Choice between different CSA models. Currently implemented are two parametrizations of the circuit from \[[@kleczek]\], `simple` and `csa`, and the `custom` model for a custom impulse response.
* `model`: Choice between different CSA models. Currently implemented are two parametrizations of the circuit from \[[@kleczek]\], `simple` and `csa`, the `custom` model for a custom impulse response, and the `graph` model, which takes a .csv file as input and reads out the graph of the transfer function.
* `integration_time`: The length of time the amplifier output is registered. Defaults to 500 ns.
* `sigma_noise`: Standard deviation of the Gaussian-distributed noise added to the output signal. Defaults to 0.1 mV.
* `threshold`: Threshold for TOT/TOA logic, for considering the output signal as a hit. Defaults to 10mV.
@@ -72,6 +72,11 @@ If this behavior is not desired, the `ignore_polarity` parameter can be set to c
* `response_function`: A 1-dimensional `ROOT::TFormula` \[[@rootformula]\] expression for the impulse response function.
* `response_parameters`: Array of the parameters in the response function. The number of parameters given need to match up with the number of parameters in the formula.

### Parameters for the graph model

* `graph_file`: The path to the .csv file containing the graph of the response function.
* `graph_time_unit`: Time unit in which the time on the response function graph is expressed.

### Plotting parameters

* `output_plots`: Enables simple output histograms to be generated from the data in every step (slows down simulation considerably). Disabled by default.
@@ -122,6 +127,14 @@ clock_bin_toa = 8ns
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 = "s"
```

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