Commit 8a9fa957 authored by Morag Jean Williams's avatar Morag Jean Williams
Browse files

Merge branch 'unify_configkeys' into 'master'

Unify Configuration Keys

Closes #46

See merge request !81
parents 98dd6f1f 582cfa5a
Pipeline #652109 passed with stages
in 17 minutes and 55 seconds
...@@ -6,7 +6,7 @@ using namespace std; ...@@ -6,7 +6,7 @@ using namespace std;
Clustering4D::Clustering4D(Configuration config, std::shared_ptr<Detector> detector) Clustering4D::Clustering4D(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector) { : Module(std::move(config), detector), m_detector(detector) {
timingCut = m_config.get<double>("timingCut", static_cast<double>(Units::convert(100, "ns"))); // 100 ns timingCut = m_config.get<double>("timing_cut", static_cast<double>(Units::convert(100, "ns"))); // 100 ns
neighbour_radius_row = m_config.get<int>("neighbour_radius_row", 1); neighbour_radius_row = m_config.get<int>("neighbour_radius_row", 1);
neighbour_radius_col = m_config.get<int>("neighbour_radius_col", 1); neighbour_radius_col = m_config.get<int>("neighbour_radius_col", 1);
} }
......
...@@ -10,7 +10,7 @@ This module performs clustering on data from a Timepix3 device. The clustering m ...@@ -10,7 +10,7 @@ This module performs clustering on data from a Timepix3 device. The clustering m
Split clusters can be recovered using a larger search radius for neighbouring pixels. Split clusters can be recovered using a larger search radius for neighbouring pixels.
### Parameters ### Parameters
* `timingCut`: The maximum value of the time difference between two pixels for them to be associated in a cluster. Default value is `100ns`. * `timing_cut`: The maximum value of the time difference between two pixels for them to be associated in a cluster. Default value is `100ns`.
* `neighbour_radius_col`: Search radius for neighbouring pixels in column direction, defaults to `1` (do not allow split clusters) * `neighbour_radius_col`: Search radius for neighbouring pixels in column direction, defaults to `1` (do not allow split clusters)
* `neighbour_radius_row`: Search radius for neighbouring pixels in row direction, defaults to `1` (do not allow split clusters) * `neighbour_radius_row`: Search radius for neighbouring pixels in row direction, defaults to `1` (do not allow split clusters)
...@@ -26,5 +26,5 @@ For each detector the following plots are produced: ...@@ -26,5 +26,5 @@ For each detector the following plots are produced:
### Usage ### Usage
```toml ```toml
[Timepix3Clustering] [Timepix3Clustering]
timingCut = 0.0000002 timing_cut = 200ns
``` ```
...@@ -6,8 +6,8 @@ using namespace std; ...@@ -6,8 +6,8 @@ using namespace std;
DUTAssociation::DUTAssociation(Configuration config, std::shared_ptr<Detector> detector) DUTAssociation::DUTAssociation(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector) { : Module(std::move(config), detector), m_detector(detector) {
timingCut = m_config.get<double>("timingCut", static_cast<double>(Units::convert(200, "ns"))); timingCut = m_config.get<double>("timing_cut", static_cast<double>(Units::convert(200, "ns")));
spatialCut = m_config.get<XYVector>("spatialCut", 2 * m_detector->pitch()); spatialCut = m_config.get<XYVector>("spatial_cut", 2 * m_detector->pitch());
} }
StatusCode DUTAssociation::run(std::shared_ptr<Clipboard> clipboard) { StatusCode DUTAssociation::run(std::shared_ptr<Clipboard> clipboard) {
......
...@@ -9,8 +9,8 @@ Module to establish an association between clusters on a DUT plane and a referen ...@@ -9,8 +9,8 @@ Module to establish an association between clusters on a DUT plane and a referen
The association allows for cuts in position and time. The association allows for cuts in position and time.
### Parameters ### Parameters
* `spatialCut`: Maximum spatial distance in x- and y-direction allowed between cluster and track for association with the DUT. Expects two values for the two coordinates, defaults to twice the pixel pitch. * `spatial_cut`: Maximum spatial distance in x- and y-direction allowed between cluster and track for association with the DUT. Expects two values for the two coordinates, defaults to twice the pixel pitch.
* `timingCut`: Maximum time difference allowed between cluster and track for association for the DUT. Default value is `200ns`. * `timing_cut`: Maximum time difference allowed between cluster and track for association for the DUT. Default value is `200ns`.
### Plots produced ### Plots produced
No histograms are produced. No histograms are produced.
......
...@@ -5,9 +5,9 @@ using namespace std; ...@@ -5,9 +5,9 @@ using namespace std;
EtaCalculation::EtaCalculation(Configuration config, std::shared_ptr<Detector> detector) EtaCalculation::EtaCalculation(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector) { : Module(std::move(config), detector), m_detector(detector) {
m_chi2ndofCut = m_config.get<double>("chi2ndofCut", 100.); m_chi2ndofCut = m_config.get<double>("chi2ndof_cut", 100.);
m_etaFormulaX = m_config.get<std::string>("EtaFormulaX", "[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5"); m_etaFormulaX = m_config.get<std::string>("eta_formula_x", "[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5");
m_etaFormulaY = m_config.get<std::string>("EtaFormulaY", "[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5"); m_etaFormulaY = m_config.get<std::string>("eta_formula_y", "[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5");
} }
void EtaCalculation::initialise() { void EtaCalculation::initialise() {
...@@ -121,9 +121,9 @@ void EtaCalculation::finalise() { ...@@ -121,9 +121,9 @@ void EtaCalculation::finalise() {
std::stringstream config; std::stringstream config;
config << std::endl config << std::endl
<< "EtaConstantsX_" << m_detector->name() << " =" << fit(m_etaFitX, "etaFormulaX", m_etaDistributionXprofile); << "eta_constants_x_" << m_detector->name() << " =" << fit(m_etaFitX, "etaFormulaX", m_etaDistributionXprofile);
config << std::endl config << std::endl
<< "EtaConstantsY_" << m_detector->name() << " =" << fit(m_etaFitY, "etaFormulaY", m_etaDistributionYprofile); << "eta_constants_y_" << m_detector->name() << " =" << fit(m_etaFitY, "etaFormulaY", m_etaDistributionYprofile);
LOG(INFO) << "\"EtaCorrection\":" << config.str(); LOG(INFO) << "\"EtaCorrection\":" << config.str();
} }
...@@ -11,8 +11,8 @@ At the end of the run, fits to the recorded profiles are performed using the pro ...@@ -11,8 +11,8 @@ At the end of the run, fits to the recorded profiles are performed using the pro
In order to measure the correct $`\eta`$-distribution, no additional $`\eta`$-correction should be applied during this calculation, i.e. by using the EtaCorrection module. In order to measure the correct $`\eta`$-distribution, no additional $`\eta`$-correction should be applied during this calculation, i.e. by using the EtaCorrection module.
### Parameters ### Parameters
* `chi2ndofCut`: Track quality cut on its Chi2 over numbers of degrees of freedom. Default value is `100`. * `chi2ndof_cut`: Track quality cut on its Chi2 over numbers of degrees of freedom. Default value is `100`.
* `EtaFormulaX` / `EtaFormulaY`: Formula to for to the recorded $`\eta`$-distributions, defaults to a polynomial of fifth order, i.e. `[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5`. * `eta_formula_x` / `eta_formula_y`: Formula to for to the recorded $`\eta`$-distributions, defaults to a polynomial of fifth order, i.e. `[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5`.
### Plots produced ### Plots produced
For each detector the following plots are produced: For each detector the following plots are produced:
...@@ -23,5 +23,5 @@ For each detector the following plots are produced: ...@@ -23,5 +23,5 @@ For each detector the following plots are produced:
### Usage ### Usage
```toml ```toml
[EtaCalculation] [EtaCalculation]
chi2ndofCut = 100 chi2ndof_cut = 100
``` ```
...@@ -5,8 +5,8 @@ using namespace std; ...@@ -5,8 +5,8 @@ using namespace std;
EtaCorrection::EtaCorrection(Configuration config, std::shared_ptr<Detector> detector) EtaCorrection::EtaCorrection(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector) { : Module(std::move(config), detector), m_detector(detector) {
m_etaFormulaX = m_config.get<std::string>("EtaFormulaX", "[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5"); m_etaFormulaX = m_config.get<std::string>("eta_formula_x", "[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5");
m_etaFormulaY = m_config.get<std::string>("EtaFormulaY", "[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5"); m_etaFormulaY = m_config.get<std::string>("eta_formula_y", "[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5");
} }
void EtaCorrection::initialise() { void EtaCorrection::initialise() {
...@@ -16,8 +16,8 @@ void EtaCorrection::initialise() { ...@@ -16,8 +16,8 @@ void EtaCorrection::initialise() {
double pitchY = m_detector->pitch().Y(); double pitchY = m_detector->pitch().Y();
// Get info from configuration: // Get info from configuration:
std::vector<double> m_etaConstantsX = m_config.getArray<double>("EtaConstantsX_" + m_detector->name(), {}); std::vector<double> m_etaConstantsX = m_config.getArray<double>("eta_constants_x_" + m_detector->name(), {});
std::vector<double> m_etaConstantsY = m_config.getArray<double>("EtaConstantsY_" + m_detector->name(), {}); std::vector<double> m_etaConstantsY = m_config.getArray<double>("eta_constants_y_" + m_detector->name(), {});
if(!m_etaConstantsX.empty() || !m_etaConstantsY.empty()) { if(!m_etaConstantsX.empty() || !m_etaConstantsY.empty()) {
LOG(INFO) << "Found Eta correction factors for detector \"" << m_detector->name() LOG(INFO) << "Found Eta correction factors for detector \"" << m_detector->name()
<< "\": " << (m_etaConstantsX.empty() ? "" : "X ") << (m_etaConstantsY.empty() ? "" : "Y "); << "\": " << (m_etaConstantsX.empty() ? "" : "X ") << (m_etaConstantsY.empty() ? "" : "Y ");
......
...@@ -10,8 +10,8 @@ This module applies previously determined $`\eta`$-corrections to cluster positi ...@@ -10,8 +10,8 @@ This module applies previously determined $`\eta`$-corrections to cluster positi
This module does not calculate the $`\eta`$ distribution. This module does not calculate the $`\eta`$ distribution.
### Parameters ### Parameters
* `EtaFormulaX` / `EtaFormulaY`: The formula for the $`\eta`$ correction to be applied for the X an Y coordinate, respectively. It defaults to a polynomial of fifth ordern, i.e. `[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5`. * `eta_formula_x` / `eta_formula_y`: The formula for the $`\eta`$ correction to be applied for the X an Y coordinate, respectively. It defaults to a polynomial of fifth ordern, i.e. `[0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5`.
* `EtaConstantsX_<detector>` / `EtaConstantsY_<detector>`: Vector of correction factors, representing the parameters of the above correction function, in X and Y coordinates, respectively. Defaults to an empty vector, i.e. by default no correction is applied. The `<detector>` part of the variable has to be replaced with the respective unique name of the detector given in the setup file. * `eta_constants_x_<detector>` / `eta_constants_y_<detector>`: Vector of correction factors, representing the parameters of the above correction function, in X and Y coordinates, respectively. Defaults to an empty vector, i.e. by default no correction is applied. The `<detector>` part of the variable has to be replaced with the respective unique name of the detector given in the setup file.
### Plots produced ### Plots produced
Currently, no plots are produced. The result of the $`\eta`$-correction is best observed in residual distributions of the respective detector. Currently, no plots are produced. The result of the $`\eta`$-correction is best observed in residual distributions of the respective detector.
...@@ -19,6 +19,6 @@ Currently, no plots are produced. The result of the $`\eta`$-correction is best ...@@ -19,6 +19,6 @@ Currently, no plots are produced. The result of the $`\eta`$-correction is best
### Usage ### Usage
```toml ```toml
[EtaCorrection] [EtaCorrection]
EtaFormulaX = [0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5 eta_formula_x = [0] + [1]*x + [2]*x^2 + [3]*x^3 + [4]*x^4 + [5]*x^5
EtaConstantsX_dut = 0.025 0.038 6.71 -323.58 5950.3 -34437.5 eta_constants_x_dut = 0.025 0.038 6.71 -323.58 5950.3 -34437.5
``` ```
...@@ -7,21 +7,21 @@ using namespace std; ...@@ -7,21 +7,21 @@ using namespace std;
EventLoaderATLASpix::EventLoaderATLASpix(Configuration config, std::shared_ptr<Detector> detector) EventLoaderATLASpix::EventLoaderATLASpix(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector) { : Module(std::move(config), detector), m_detector(detector) {
m_timewalkCorrectionFactors = m_config.getArray<double>("timewalkCorrectionFactors", std::vector<double>()); m_timewalkCorrectionFactors = m_config.getArray<double>("timewalk_correction_factors", std::vector<double>());
m_inputDirectory = m_config.getPath("inputDirectory"); m_inputDirectory = m_config.getPath("input_directory");
if(m_config.has("calibrationFile")) { if(m_config.has("calibration_file")) {
m_calibrationFile = m_config.getPath("calibrationFile"); m_calibrationFile = m_config.getPath("calibration_file");
} }
m_clockCycle = m_config.get<double>("clockCycle", static_cast<double>(Units::convert(6.25, "ns"))); m_clockCycle = m_config.get<double>("clock_cycle", static_cast<double>(Units::convert(6.25, "ns")));
// Allow reading of legacy data format using the Karlsruhe readout system: // Allow reading of legacy data format using the Karlsruhe readout system:
m_legacyFormat = m_config.get<bool>("legacyFormat", false); m_legacyFormat = m_config.get<bool>("legacy_format", false);
m_startTime = m_config.get<double>("startTime", 0.); m_startTime = m_config.get<double>("start_time", 0.);
m_toaMode = m_config.get<bool>("toaMode", false); m_toaMode = m_config.get<bool>("toa_mode", false);
// m_clkdivendM = m_config.get<int>("clkdivend", 0.) + 1; // m_clkdivendM = m_config.get<int>("clkdivend", 0.) + 1;
m_clkdivend2M = m_config.get<int>("clkdivend2", 0.) + 1; m_clkdivend2M = m_config.get<int>("clkdivend2", 0.) + 1;
......
...@@ -12,9 +12,8 @@ The module opens and reads one data file named `data.bin` in the specified input ...@@ -12,9 +12,8 @@ The module opens and reads one data file named `data.bin` in the specified input
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. 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 ### Parameters
* `inputDirectory`: Path to the directory containing the `data.bin` file. This path should lead to the directory above the ALTASpix directory, as this string is added to the input directory in the module. * `input_directory`: Path to the directory containing the `data.bin` file. This path should lead to the directory above the ALTASpix directory, as this string is added to the input directory in the module.
* `clockCycle`: Period of the clock used to count the trigger timestamps in, defaults to `6.25ns`. * `clock_cycle`: Period of the clock used to count the trigger timestamps in, defaults to `6.25ns`.
* `DUT`: Name of the DUT plane.
* `clkdivend2`: Value of clkdivend2 register in ATLASPix specifying the speed of TS2 counter. Default is `0`. * `clkdivend2`: Value of clkdivend2 register in ATLASPix specifying the speed of TS2 counter. Default is `0`.
### Plots produced ### Plots produced
...@@ -25,6 +24,5 @@ This module requires either another event loader of another detector type before ...@@ -25,6 +24,5 @@ This module requires either another event loader of another detector type before
### Usage ### Usage
```toml ```toml
[ATLASpixEventLoader] [ATLASpixEventLoader]
DUT = "W0005_H03" input_directory = /user/data/directory
inputDirectory = /user/data/directory
``` ```
...@@ -13,7 +13,7 @@ void EventLoaderCLICpix::initialise() { ...@@ -13,7 +13,7 @@ void EventLoaderCLICpix::initialise() {
// File structure is RunX/CLICpix/RunX.dat // File structure is RunX/CLICpix/RunX.dat
// Take input directory from global parameters // Take input directory from global parameters
string inputDirectory = m_config.getPath("inputDirectory") + "/CLICpix"; string inputDirectory = m_config.getPath("input_directory");
// Open the root directory // Open the root directory
DIR* directory = opendir(inputDirectory.c_str()); DIR* directory = opendir(inputDirectory.c_str());
......
...@@ -10,8 +10,7 @@ This module reads in data for a CLICpix device from an input file. ...@@ -10,8 +10,7 @@ This module reads in data for a CLICpix device from an input file.
The module opens and reads one data file in the specified input directory with the ending `.dat`. For each hit it stores the detectorID, row, column, and ToT. The shutter rise and fall time information are used to set the current time and event length. The module opens and reads one data file in the specified input directory with the ending `.dat`. For each hit it stores the detectorID, row, column, and ToT. The shutter rise and fall time information are used to set the current time and event length.
### Parameters ### Parameters
* `inputDirectory`: Path to the directory containing the `.dat` file. This path should lead to the directory above the CLICpix directory, as this string is added onto the input directory in the module. * `input_directory`: Path to the directory containing the `.dat` file.
* `DUT`: Name of the DUT plane. The CLICpix device is assumed to be the DUT device.
### Plots produced ### Plots produced
* 2D Hit map * 2D Hit map
...@@ -22,6 +21,5 @@ The module opens and reads one data file in the specified input directory with t ...@@ -22,6 +21,5 @@ The module opens and reads one data file in the specified input directory with t
### Usage ### Usage
```toml ```toml
[CLICpixEventLoader] [CLICpixEventLoader]
DUT = "W0005_H03" input_directory = /user/data/directory/CLICpix/
inputDirectory = /user/data/directory
``` ```
...@@ -11,13 +11,13 @@ using namespace clicpix2_utils; ...@@ -11,13 +11,13 @@ using namespace clicpix2_utils;
EventLoaderCLICpix2::EventLoaderCLICpix2(Configuration config, std::shared_ptr<Detector> detector) EventLoaderCLICpix2::EventLoaderCLICpix2(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector) { : Module(std::move(config), detector), m_detector(detector) {
discardZeroToT = m_config.get<bool>("discardZeroToT", false); discardZeroToT = m_config.get<bool>("discard_zero_tot", false);
} }
void EventLoaderCLICpix2::initialise() { void EventLoaderCLICpix2::initialise() {
// Take input directory from global parameters // Take input directory from global parameters
string inputDirectory = m_config.getPath("inputDirectory"); string inputDirectory = m_config.getPath("input_directory");
// Open the root directory // Open the root directory
DIR* directory = opendir(inputDirectory.c_str()); DIR* directory = opendir(inputDirectory.c_str());
......
...@@ -12,20 +12,9 @@ The module opens and reads one data file in the specified input directory. ...@@ -12,20 +12,9 @@ The module opens and reads one data file in the specified input directory.
The input directory is searched for a data file with the file extension `.raw` and a pixel matrix configuration file required for decoding with the file extension `.cfg` and a name starting with `matrix`. The input directory is searched for a data file with the file extension `.raw` and a pixel matrix configuration file required for decoding with the file extension `.cfg` and a name starting with `matrix`.
The data is decoded using the CLICpix2 data decoder shipped with the Peary DAQ framework. For each pixel hit, the detectorID, the pixel's column and row address as well as ToT and ToA values are stored, depending on their availability from data. The shutter rise and fall time information are used to set the current time and event length as described above. The data is decoded using the CLICpix2 data decoder shipped with the Peary DAQ framework. For each pixel hit, the detectorID, the pixel's column and row address as well as ToT and ToA values are stored, depending on their availability from data. The shutter rise and fall time information are used to set the current time and event length as described above.
### Dependencies
This module is not built by default since it requires an installation of [Peary](https://gitlab.cern.ch/Caribou/peary) with its CLICPix2 component built.
This is used for on-the-fly decoding of raw data.
In order to build this module, Peary should be made available and the module should be explicitely switched on:
```
export PEARY_PATH=/path/to/peary
cmake -DBUILD_eventLoaderCLICpix2=ON ..
```
### Parameters ### Parameters
* `inputDirectory`: Path to the directory containing the `.csv` file. This path should lead to the directory above the CLICpix directory, as this string is added onto the input directory in the module. * `input_directory`: Path to the directory containing the `.csv` file. This path should lead to the directory above the CLICpix directory, as this string is added onto the input directory in the module.
* `DUT`: Name of the DUT plane. * `discard_zero_tot`: Discard all pixel hits with a ToT value of zero. Defaults to `false`.
### Plots produced ### Plots produced
* 2D Hit map * 2D Hit map
...@@ -39,6 +28,5 @@ cmake -DBUILD_eventLoaderCLICpix2=ON .. ...@@ -39,6 +28,5 @@ cmake -DBUILD_eventLoaderCLICpix2=ON ..
### Usage ### Usage
```toml ```toml
[CLICpix2EventLoader] [CLICpix2EventLoader]
DUT = "W0005_H03" input_directory = /user/data/directory
inputDirectory = /user/data/directory
``` ```
...@@ -34,7 +34,7 @@ bool EventLoaderTimepix1::sortByTime(string filename1, string filename2) { ...@@ -34,7 +34,7 @@ bool EventLoaderTimepix1::sortByTime(string filename1, string filename2) {
void EventLoaderTimepix1::initialise() { void EventLoaderTimepix1::initialise() {
// Take input directory from global parameters // 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 // Each input directory contains a series of .txt files. Each of these
// contains several events (frames) with different times // contains several events (frames) with different times
......
...@@ -7,10 +7,10 @@ ...@@ -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. 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 ### Parameters
* `inputDirectory`: Path of the directory above the data files. * `input_directory`: Path of the directory above the data files.
### Usage ### Usage
```toml ```toml
[Timepix1EventLoader] [Timepix1EventLoader]
inputDirectory = "path/to/directory" input_directory = "path/to/directory"
``` ```
...@@ -18,16 +18,14 @@ EventLoaderTimepix3::EventLoaderTimepix3(Configuration config, std::shared_ptr<D ...@@ -18,16 +18,14 @@ EventLoaderTimepix3::EventLoaderTimepix3(Configuration config, std::shared_ptr<D
m_shutterOpen(false) { m_shutterOpen(false) {
// Take input directory from global parameters // Take input directory from global parameters
m_inputDirectory = m_config.getPath("inputDirectory"); m_inputDirectory = m_config.getPath("input_directory");
m_triggerLatency = m_config.get<double>("triggerLatency", 0.0);
m_minNumberOfPlanes = m_config.get<int>("minNumerOfPlanes", 1);
// Check whether event length or pixel count should be used to separate events: // Check whether event length or pixel count should be used to separate events:
m_numberPixelHits = m_config.get<size_t>("number_of_pixelhits", 2000); m_numberPixelHits = m_config.get<size_t>("number_of_pixelhits", 2000);
// Calibration parameters // Calibration parameters
if(m_config.has("calibrationPath")) { if(m_config.has("calibration_path")) {
calibrationPath = m_config.getPath("calibrationPath"); calibrationPath = m_config.getPath("calibration_path");
threshold = m_config.get<std::string>("threshold", ""); threshold = m_config.get<std::string>("threshold", "");
} }
} }
...@@ -161,7 +159,7 @@ void EventLoaderTimepix3::initialise() { ...@@ -161,7 +159,7 @@ void EventLoaderTimepix3::initialise() {
// Calibration // Calibration
pixelToT_beforecalibration = new TH1F("pixelToT_beforecalibration", "pixelToT_beforecalibration", 100, 0, 200); 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; LOG(INFO) << "Applying calibration from " << calibrationPath;
applyCalibration = true; applyCalibration = true;
...@@ -300,7 +298,7 @@ void EventLoaderTimepix3::loadCalibration(std::string path, char delim, std::vec ...@@ -300,7 +298,7 @@ void EventLoaderTimepix3::loadCalibration(std::string path, char delim, std::vec
// check if file is open // check if file is open
if(!f.is_open()) { if(!f.is_open()) {
LOG(ERROR) << "Cannot open input file:\n\t" << path; 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 // read file line by line
...@@ -326,7 +324,7 @@ void EventLoaderTimepix3::loadCalibration(std::string path, char delim, std::vec ...@@ -326,7 +324,7 @@ void EventLoaderTimepix3::loadCalibration(std::string path, char delim, std::vec
// warn if too few entries // warn if too few entries
if(dat.size() != 256 * 256) { if(dat.size() != 256 * 256) {
LOG(ERROR) << "Something went wrong. Found only " << i << " entries. Not enough for TPX3.\n\t"; 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(); f.close();
......
...@@ -43,9 +43,7 @@ namespace corryvreckan { ...@@ -43,9 +43,7 @@ namespace corryvreckan {
void maskPixels(std::string); void maskPixels(std::string);
// configuration paramaters: // configuration paramaters:
double m_triggerLatency;
std::string m_inputDirectory; std::string m_inputDirectory;
int m_minNumberOfPlanes;
bool temporalSplit; bool temporalSplit;
size_t m_numberPixelHits; 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 ...@@ -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. 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 ### Parameters
* `inputDirectory`: Path to the directory above the data directory for each device. The device name is added to the path during the module. * `input_directory`: 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`.
* `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. * `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.]`. * `trigger_latency`:
* `DUT`: Name of the DUT plane. * `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_[threshold]_ik_[ikrum dac]/[detector name]_cal_[tot/toa].txt`. The assumed file structure is `[col | row | val1 | val2 | etc.]`.
* `threshold`: String defining the `[threshold]` DAC value for loading the appropriate calibration file, See above.
### Plots produced ### Plots produced
* Histogram with pixel ToT before and after calibration * Histogram with pixel ToT before and after calibration
...@@ -30,13 +30,10 @@ When running in time mode (`number_of_pixelhits` not set), this module requires ...@@ -30,13 +30,10 @@ When running in time mode (`number_of_pixelhits` not set), this module requires
### Usage ### Usage
```toml ```toml
[Timepix3EventLoader] [Timepix3EventLoader]
inputDirectory = "path/to/directory" input_directory = "path/to/directory"
calibrationPath = "path/to/calibration" calibration_path = "path/to/calibration"
threshold = 1148 threshold = 1148
minNumberOfPlanes = 5
eventLength = 0.0000002
number_of_pixelhits = 0 number_of_pixelhits = 0
DUT = "W0005_H03"
``` ```
[@timepix-talk] X. Llopart, The Timepix3 chip, EP-ESE seminar, https://indico.cern.ch/event/267425, [@timepix-talk] X. Llopart, The Timepix3 chip, EP-ESE seminar, https://indico.cern.ch/event/267425,
...@@ -6,14 +6,14 @@ using namespace std; ...@@ -6,14 +6,14 @@ using namespace std;
FileReader::FileReader(Configuration config, std::vector<std::shared_ptr<Detector>> detectors) FileReader::FileReader(Configuration config, std::vector<std::shared_ptr<Detector>> detectors)
: Module(std::move(config), std::move(detectors)) { : Module(std::move(config), std::move(detectors)) {
m_readPixels = m_config.get<bool>("readPixels", true); m_readPixels = m_config.get<bool>("read_pixels", true);
m_readClusters = m_config.get<bool>("readClusters", false); m_readClusters = m_config.get<bool>("read_clusters", false);
m_readTracks = m_config.get<bool>("readTracks", false); m_readTracks = m_config.get<bool>("read_tracks", false);
m_fileName = m_config.getPath("fileName", true); m_fileName = m_config.getPath("file_name", true);
m_timeWindow = m_config.get<double>("timeWindow", static_cast<double>(Units::convert(1., "s"))); m_timeWindow = m_config.get<double>("time_window", static_cast<double>(Units::convert(1., "s")));
m_readMCParticles = m_config.get<bool>("readMCParticles", false); m_readMCParticles = m_config.get<bool>("read_mcparticles", false);
// checking if DUT parameter is in the configuration file, if so then check if should only output the DUT // checking if DUT parameter is in the configuration file, if so then check if should only output the DUT
m_onlyDUT = m_config.get<bool>("onlyDUT", false); m_onlyDUT = m_config.get<bool>("only_dut", false);
m_currentTime = 0.; m_currentTime = 0.;
} }
......
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