Commit 726d32e2 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

EventLoaders Timepix1/3: update parameter names, removed unused parameters

parent b877548a
Pipeline #639187 failed with stages
in 2 minutes and 3 seconds
......@@ -34,7 +34,7 @@ bool EventLoaderTimepix1::sortByTime(string filename1, string filename2) {
void EventLoaderTimepix1::initialise() {
// Take input directory from global parameters
m_inputDirectory = m_config.getPath("inputDirectory");
m_inputDirectory = m_config.getPath("input_directory");
// Each input directory contains a series of .txt files. Each of these
// contains several events (frames) with different times
......
......@@ -7,10 +7,10 @@
This module loads raw data from Timepix1 devices and adds it to the clipboard as `pixel` objects. The input file must have extension `.txt`, and these files are sorted into time order using the file titles.
### Parameters
* `inputDirectory`: Path of the directory above the data files.
* `input_directory`: Path of the directory above the data files.
### Usage
```toml
[Timepix1EventLoader]
inputDirectory = "path/to/directory"
input_directory = "path/to/directory"
```
......@@ -18,16 +18,14 @@ EventLoaderTimepix3::EventLoaderTimepix3(Configuration config, std::shared_ptr<D
m_shutterOpen(false) {
// Take input directory from global parameters
m_inputDirectory = m_config.getPath("inputDirectory");
m_triggerLatency = m_config.get<double>("triggerLatency", 0.0);
m_minNumberOfPlanes = m_config.get<int>("minNumerOfPlanes", 1);
m_inputDirectory = m_config.getPath("input_directory");
// Check whether event length or pixel count should be used to separate events:
m_numberPixelHits = m_config.get<size_t>("number_of_pixelhits", 2000);
// Calibration parameters
if(m_config.has("calibrationPath")) {
calibrationPath = m_config.getPath("calibrationPath");
if(m_config.has("calibration_path")) {
calibrationPath = m_config.getPath("calibration_path");
threshold = m_config.get<std::string>("threshold", "");
}
}
......@@ -161,7 +159,7 @@ void EventLoaderTimepix3::initialise() {
// Calibration
pixelToT_beforecalibration = new TH1F("pixelToT_beforecalibration", "pixelToT_beforecalibration", 100, 0, 200);
if(m_detector->isDUT() && m_config.has("calibrationPath") && m_config.has("threshold")) {
if(m_detector->isDUT() && m_config.has("calibration_path") && m_config.has("threshold")) {
LOG(INFO) << "Applying calibration from " << calibrationPath;
applyCalibration = true;
......@@ -300,7 +298,7 @@ void EventLoaderTimepix3::loadCalibration(std::string path, char delim, std::vec
// check if file is open
if(!f.is_open()) {
LOG(ERROR) << "Cannot open input file:\n\t" << path;
throw InvalidValueError(m_config, "calibrationPath", "Parsing error in calibration file.");
throw InvalidValueError(m_config, "calibration_path", "Parsing error in calibration file.");
}
// read file line by line
......@@ -326,7 +324,7 @@ void EventLoaderTimepix3::loadCalibration(std::string path, char delim, std::vec
// warn if too few entries
if(dat.size() != 256 * 256) {
LOG(ERROR) << "Something went wrong. Found only " << i << " entries. Not enough for TPX3.\n\t";
throw InvalidValueError(m_config, "calibrationPath", "Parsing error in calibration file.");
throw InvalidValueError(m_config, "calibration_path", "Parsing error in calibration file.");
}
f.close();
......
......@@ -43,9 +43,7 @@ namespace corryvreckan {
void maskPixels(std::string);
// configuration paramaters:
double m_triggerLatency;
std::string m_inputDirectory;
int m_minNumberOfPlanes;
bool temporalSplit;
size_t m_numberPixelHits;
......
......@@ -17,11 +17,11 @@ See also the Timepix3 chip manual version 1.9, section 3.2.1 and/or [@timepix3-t
When running in time mode (`number_of_pixelhits` not set), this module requires either another event loader of another detector type before which defines the event start and end times (variables `eventStart` and `eventEnd` on the clipboard) or an instance of the Metronome module which provides this information.
### Parameters
* `inputDirectory`: Path to the directory above the data directory for each device. The device name is added to the path during the module.
* `minNumberOfPlanes`: Minimum number of planes with loaded data required for each event to be stored. Default value is `1`.
* `input_directory`: Path to the directory above the data directory for each device. The device name is added to the path during the module.
* `number_of_pixelhits`: Maximum number of pixel hits on each detector per event. Default value is `2000`. This is only used if this parameter is present in the configuration file, otherwise the data is split into events using the event length information from the clipboard.
* `calibrationPath`: Path to the calibration directory. If this parameter is set, calibration will be applied to the DUT. Assumed folder structure is `"[calibrationPath]/[detector name]/cal_thr_[thr dac]_ik_[ikrum dac]/[detector name]_cal_[tot/toa].txt"`. The assumed file structure is `[col | row | val1 | val2 | etc.]`.
* `DUT`: Name of the DUT plane.
* `trigger_latency`:
* `calibration_path`: Path to the calibration directory. If this parameter is set, calibration will be applied to the DUT. Assumed folder structure is `"[calibration_path]/[detector name]/cal_thr_[thr dac]_ik_[ikrum dac]/[detector name]_cal_[tot/toa].txt"`. The assumed file structure is `[col | row | val1 | val2 | etc.]`.
* `threshold`: String defining the `[thr dac]` value for loading the appropriate calibration file, See above.
### Plots produced
* Histogram with pixel ToT before and after calibration
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment