Commit 04d5a4e2 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Merge branch 'eventloaderatlaspix_documentation' into 'master'

Eventloaderatlaspix documentation

Closes #47

See merge request !86
parents 1bb98524 90f16152
Pipeline #655305 passed with stages
in 15 minutes and 4 seconds
...@@ -7,25 +7,19 @@ using namespace std; ...@@ -7,25 +7,19 @@ 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>("timewalk_correction_factors", std::vector<double>());
m_inputDirectory = m_config.getPath("input_directory"); m_inputDirectory = m_config.getPath("input_directory");
if(m_config.has("calibration_file")) {
m_calibrationFile = m_config.getPath("calibration_file");
}
m_clockCycle = m_config.get<double>("clock_cycle", 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>("legacy_format", false); m_legacyFormat = m_config.get<bool>("legacy_format", false);
m_startTime = m_config.get<double>("start_time", 0.);
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;
if(m_config.has("calibration_file")) {
m_calibrationFile = m_config.getPath("calibration_file");
}
// ts1Range = 0x800 * m_clkdivendM; // ts1Range = 0x800 * m_clkdivendM;
ts2Range = 0x40 * m_clkdivend2M; ts2Range = 0x40 * m_clkdivend2M;
} }
...@@ -149,11 +143,6 @@ void EventLoaderATLASpix::initialise() { ...@@ -149,11 +143,6 @@ void EventLoaderATLASpix::initialise() {
calibration.close(); calibration.close();
} }
LOG(INFO) << "Timewalk correction factors: ";
for(auto& ts : m_timewalkCorrectionFactors) {
LOG(INFO) << ts;
}
LOG(INFO) << "Using clock cycle length of " << m_clockCycle << " ns." << std::endl; LOG(INFO) << "Using clock cycle length of " << m_clockCycle << " ns." << std::endl;
m_oldtoa = 0; m_oldtoa = 0;
...@@ -542,15 +531,6 @@ Pixels* EventLoaderATLASpix::read_legacy_data(double, double) { ...@@ -542,15 +531,6 @@ Pixels* EventLoaderATLASpix::read_legacy_data(double, double) {
double toa_timestamp = double toa_timestamp =
4096. * 2 * static_cast<double>(toa); // runs with 20MHz, multiply by 2 to scale counter value to 40MHz 4096. * 2 * static_cast<double>(toa); // runs with 20MHz, multiply by 2 to scale counter value to 40MHz
// Timewalk correction:
if(m_timewalkCorrectionFactors.size() == 5) {
double corr = m_timewalkCorrectionFactors.at(0) + m_timewalkCorrectionFactors.at(1) * tot +
m_timewalkCorrectionFactors.at(2) * tot * tot +
m_timewalkCorrectionFactors.at(3) * tot * tot * tot +
m_timewalkCorrectionFactors.at(4) * tot * tot * tot * tot;
toa_timestamp -= corr * 163840000000; //(40000000 * 4096)
}
// Convert TOA to nanoseconds: // Convert TOA to nanoseconds:
toa_timestamp /= (4096. * 0.04); toa_timestamp /= (4096. * 0.04);
......
...@@ -68,15 +68,12 @@ namespace corryvreckan { ...@@ -68,15 +68,12 @@ namespace corryvreckan {
TH1F* hPixelsOverTime; TH1F* hPixelsOverTime;
// Parameters: // Parameters:
std::vector<double> m_timewalkCorrectionFactors;
std::vector<double> m_calibrationFactors;
std::string m_inputDirectory; std::string m_inputDirectory;
std::string m_calibrationFile;
double m_startTime;
bool m_toaMode;
bool m_detectorBusy; bool m_detectorBusy;
bool m_legacyFormat; bool m_legacyFormat;
double m_clockCycle; double m_clockCycle;
std::string m_calibrationFile;
std::vector<double> m_calibrationFactors;
// int m_clkdivendM; // int m_clkdivendM;
int m_clkdivend2M; int m_clkdivend2M;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
**Status**: Functional **Status**: Functional
### Description ### Description
This module reads in data for the ATLASpix device from an input file created by the CaRIBou readout system. It supports binary output format. This module reads in data for the ATLASpix device from an input file created by the Caribou readout system. It supports binary output format.
The module opens and reads one data file named `data.bin` in the specified input directory. For each hit it, stores the detectorID, row, column, and ToT. The module opens and reads one data file named `data.bin` in the specified input directory. For each hit it, stores the detectorID, row, column, and ToT.
...@@ -14,7 +14,9 @@ This module requires either another event loader of another detector type before ...@@ -14,7 +14,9 @@ This module requires either another event loader of another detector type before
### Parameters ### Parameters
* `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. * `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.
* `clock_cycle`: 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`.
* `legacy_format`: Set `true` if using legacy data format of the Karlsruhe readout system. Default is `false`, corresponding the the format of the Caribou readout system.
* `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`.
* `calibration_file` (optional): input file for pixel-wise calibration from ToT to charge in electrons. If not provided, the pixel charge is equivalent to pixel ToT.
### Plots produced ### Plots produced
* 2D Hit map * 2D Hit map
......
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