Commit 42693164 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

ELTPX3: remove some unused guff

parent 0aa06319
Pipeline #716695 passed with stages
in 18 minutes and 4 seconds
......@@ -14,15 +14,11 @@ using namespace corryvreckan;
using namespace std;
EventLoaderTimepix3::EventLoaderTimepix3(Configuration config, std::shared_ptr<Detector> detector)
: Module(std::move(config), detector), m_detector(detector), temporalSplit(false), m_currentEvent(0), m_prevTime(0),
m_shutterOpen(false) {
: Module(std::move(config), detector), m_detector(detector), m_currentEvent(0), m_prevTime(0), m_shutterOpen(false) {
// Take input directory from global parameters
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("calibration_path")) {
calibrationPath = m_config.getPath("calibration_path");
......@@ -32,14 +28,6 @@ EventLoaderTimepix3::EventLoaderTimepix3(Configuration config, std::shared_ptr<D
void EventLoaderTimepix3::initialise() {
if(m_config.has("number_of_pixelhits")) {
LOG(INFO) << "Splitting events by number of pixel hits on detector plane.";
temporalSplit = false;
} else {
LOG(INFO) << "Event length set, splitting events by time.";
temporalSplit = true;
}
// File structure is RunX/ChipID/files.dat
// Open the root directory
......@@ -251,14 +239,7 @@ StatusCode EventLoaderTimepix3::run(std::shared_ptr<Clipboard> clipboard) {
}
// Otherwise tell event loop to keep running
IFLOG(INFO) {
if(temporalSplit) {
LOG_PROGRESS(DEBUG, "tpx3_loader")
<< "Current time: " << Units::display(event->start(), {"s", "ms", "us", "ns"});
} else {
LOG_PROGRESS(DEBUG, "tpx3_loader") << "Current event: " << m_currentEvent;
}
}
LOG_PROGRESS(DEBUG, "tpx3_loader") << "Current time: " << Units::display(event->start(), {"s", "ms", "us", "ns"});
return StatusCode::Success;
}
......@@ -417,14 +398,9 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard, Pixels*
// (We observed these packets a few times per run in various telescope planes in the
// November 2018 test beam.)
if(!m_detector->isDUT()) {
if(temporalSplit) {
LOG(WARNING) << "Current time: " << Units::display(event->start(), {"s", "ms", "us", "ns"})
<< " detector " << detectorID << " "
<< "header == 0x0! (indicates power pulsing.) Ignoring this.";
} else {
LOG(WARNING) << "Current event: " << m_currentEvent << " detector " << detectorID << " "
<< "header == 0x0! (indicates power pulsing.) Ignoring this.";
}
LOG(WARNING) << "Current time: " << Units::display(event->start(), {"s", "ms", "us", "ns"}) << " detector "
<< detectorID << " "
<< "header == 0x0! (indicates power pulsing.) Ignoring this.";
continue;
}
// Note that the following code is probably outdated and/or not much tested
......@@ -447,12 +423,10 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard, Pixels*
// Stop looking at data if the signal is after the current event window
// (and rewind the file
// reader so that we start with this signal next event)
if(temporalSplit) {
if(timestamp > event->end()) {
(*m_file_iterator)->seekg(-1 * static_cast<int>(sizeof(pixdata)), std::ios_base::cur);
LOG(TRACE) << "Signal has a time beyond the current event: " << Units::display(timestamp, "ns");
break;
}
if(timestamp > event->end()) {
(*m_file_iterator)->seekg(-1 * static_cast<int>(sizeof(pixdata)), std::ios_base::cur);
LOG(TRACE) << "Signal has a time beyond the current event: " << Units::display(timestamp, "ns");
break;
}
SpidrSignal* powerSignal =
......@@ -577,7 +551,7 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard, Pixels*
const double timestamp = static_cast<double>(time) / (4096. / 25.) + m_detector->timingOffset();
// Ignore pixel data if it is before the "eventStart" read from the clipboard storage:
if(temporalSplit && (timestamp < event->start())) {
if(timestamp < event->start()) {
LOG(TRACE) << "Skipping pixel, is before event window (" << Units::display(timestamp, {"s", "us", "ns"})
<< " < " << Units::display(event->start(), {"s", "us", "ns"}) << ")";
continue;
......@@ -585,7 +559,7 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard, Pixels*
// Stop looking at data if the pixel is after the current event window
// (and rewind the file reader so that we start with this pixel next event)
if(temporalSplit && (timestamp > event->end())) {
if(timestamp > event->end()) {
LOG(DEBUG) << "Stopping processing event, pixel is after "
"event window ("
<< Units::display(timestamp, {"s", "us", "ns"}) << " > "
......@@ -643,11 +617,6 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard, Pixels*
m_prevTime = time;
}
// Stop when we reach some large number of pixels (if events not based on time)
if(!temporalSplit && devicedata->size() >= m_numberPixelHits) {
break;
}
}
// Now we have data buffered into the temporary storage. We will sort this by time, and then load
......
......@@ -45,9 +45,6 @@ namespace corryvreckan {
// configuration paramaters:
std::string m_inputDirectory;
bool temporalSplit;
size_t m_numberPixelHits;
bool applyCalibration;
std::string calibrationPath;
std::string threshold;
......
......@@ -14,11 +14,10 @@ In Timepix3, the phase of the 40 MHz clock can be shifted from one double column
This mode is used in the CLICdp telescope, and thus, the column-to-column phase shift is taken into account when calculating the hit arrival times.
See also the Timepix3 chip manual version 1.9, section 3.2.1 and/or [@timepix3-talk], slides 25 and 48.
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.
This module requires either another event loader of another detector type before which defines the event start and end times (Event object on the clipboard) or an instance of the Metronome module which provides this information.
### Parameters
* `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.
* `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_[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.
......
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