Commit c5ca27f1 authored by Eric Buschmann's avatar Eric Buschmann Committed by Simon Spannagel
Browse files

Better handling of SPIDR triggers

parent 7e50176e
......@@ -55,6 +55,7 @@ The following authors, in alphabetical order, have contributed to Corryvreckan:
* Matthew Daniel Buckland, University of Liverpool, @mbucklan
* Carsten Daniel Burgard, DESY, @cburgard
* Eric Buschmann, CERN, @ebuschma
* Manuel Colocci, CERN, @mcolocci
* Jens Dopke, STFC RAL, @jdopke
* Jordi Duarte-Campderros, IFCA, @duarte
......
......@@ -14,6 +14,7 @@
#include <TCanvas.h>
#include <TH1F.h>
#include <TH2F.h>
#include <queue>
#include <stdio.h>
#include "core/module/Module.hpp"
#include "objects/Pixel.hpp"
......@@ -49,6 +50,8 @@ namespace corryvreckan {
TH2F* pixelTOAParameterT;
TH1F* timeshiftPlot;
bool decodeNextWord();
void fillBuffer();
bool loadData(const std::shared_ptr<Clipboard>& clipboard, PixelVector&, SpidrSignalVector&);
void loadCalibration(std::string path, char delim, std::vector<std::vector<float>>& dat);
void maskPixels(std::string);
......@@ -67,6 +70,8 @@ namespace corryvreckan {
std::vector<std::unique_ptr<std::ifstream>> m_files;
std::vector<std::unique_ptr<std::ifstream>>::iterator m_file_iterator;
bool eof_reached;
size_t m_buffer_depth;
unsigned long long int m_syncTime;
bool m_clearedHeader;
long long int m_syncTimeTDC;
......@@ -76,6 +81,18 @@ namespace corryvreckan {
unsigned long long int m_prevTime;
bool m_shutterOpen;
int m_prevTriggerNumber;
int m_triggerOverflowCounter;
template <typename T> struct CompareTimeGreater {
bool operator()(const std::shared_ptr<T> a, const std::shared_ptr<T> b) {
return a->timestamp() > b->timestamp();
}
};
std::priority_queue<std::shared_ptr<Pixel>, PixelVector, CompareTimeGreater<Pixel>> sorted_pixels_;
std::priority_queue<std::shared_ptr<SpidrSignal>, SpidrSignalVector, CompareTimeGreater<SpidrSignal>>
sorted_signals_;
};
} // namespace corryvreckan
#endif // TIMEPIX3EVENTLOADER_H
......@@ -22,6 +22,8 @@ namespace corryvreckan {
// Constructors and destructors
SpidrSignal(){};
SpidrSignal(std::string type, double timestamp) : Object(timestamp), m_type(type){};
SpidrSignal(std::string type, double timestamp, size_t trigger)
: Object(timestamp), m_type(type), m_triggerNumber(trigger){};
/**
* @brief Static member function to obtain base class for storage on the clipboard.
......@@ -36,13 +38,15 @@ namespace corryvreckan {
// Set properties
void type(std::string type) { m_type = type; }
std::string type() const { return m_type; }
size_t trigger() const { return m_triggerNumber; }
protected:
// Member variables
std::string m_type;
size_t m_triggerNumber;
// ROOT I/O class definition - update version number when you change this class!
ClassDef(SpidrSignal, 3)
ClassDef(SpidrSignal, 4)
};
// Vector type declaration
......
......@@ -47,4 +47,4 @@ align_position_axes = "xy" # <-- ...orientation OR position alignment!
max_track_chi2ndof = 3
#DATASET timepix3tel_dut_atlaspix_ebeam120
#PASS T(341.262um,-1.543mm,105mm) R(2.41548deg,1.66765deg,-0.46845deg)
#PASS T(341.201um,-1.54307mm,105mm) R(2.44deg,1.60279deg,-0.470055deg)
......@@ -34,4 +34,4 @@ max_track_chi2ndof = 10
#DATASET timepix3tel_dut_atlaspix_ebeam120
#PASS T(942.734um,285.824um,0) R(10.6472deg,186.43deg,-1.35631deg)
#PASS T(942.726um,285.923um,0) R(10.6448deg,186.43deg,-1.35556deg)
......@@ -19,7 +19,7 @@ time_cut_frameedge = 10ns
#DEPENDS test_io_write_rootobj.conf
#PASS Total efficiency of detector W0013_G02: 100(+0 -0.00534736)%, measured with 34446/34446 matched/total tracks
#PASS Total efficiency of detector W0013_G02: 100(+0 -0.00531864)%, measured with 34632/34632 matched/total tracks
# Please note:
# Pixels are masked in the [EventLoaderTimepix3] when reading in the online configuration files.
......
......@@ -32,4 +32,4 @@ time_cut_frameedge = 10ns
#DATASET timepix3tel_ebeam120
#PASS [F:FileWriter] Wrote 1717542 objects to 15 branches in file:
#PASS [F:FileWriter] Wrote 1722304 objects to 15 branches in file:
......@@ -23,4 +23,4 @@ spatial_cut_abs = 200um, 200um
#DATASET timepix3tel_ebeam120
#PASS Ev: 18.8k Px: 6.23M Tr: 217.5k (11.6/ev) t = 3.7598s
#PASS Ev: 18.8k Px: 6.26M Tr: 217.4k (11.6/ev) t = 3.7598s
......@@ -24,4 +24,4 @@ volume_scattering_length = 304m
#DATASET timepix3tel_ebeam120
#PASS Ev: 18.8k Px: 6.23M Tr: 206.1k (11/ev) t = 3.7598s
#PASS Ev: 18.8k Px: 6.26M Tr: 206.0k (11/ev) t = 3.7598s
......@@ -26,5 +26,4 @@ isolation_cut = 40um
#DATASET timepix3tel_ebeam120
#PASS Ev: 18.8k Px: 6.23M Tr: 188.5k (10/ev) t = 3.7598s
\ No newline at end of file
#PASS Ev: 18.8k Px: 6.26M Tr: 188.9k (10/ev) t = 3.7598s
......@@ -28,4 +28,4 @@ momentum=120GeV
#DATASET timepix3tel_ebeam120
#PASS Ev: 18.8k Px: 6.23M Tr: 188.5k (10/ev) t = 3.7598s
\ No newline at end of file
#PASS Ev: 18.8k Px: 6.26M Tr: 188.9k (10/ev) t = 3.7598s
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