1#ifndef CALIBRATION_H_INCLUDED
2#define CALIBRATION_H_INCLUDED
14#include "tof_typedefs.h"
22void spike_cleaning_drs4(Vec<Vec<f32>> &wf, u16 tCell, i32 spikes[]);
25void spike_cleaning_simple(Vec<Vec<f32>> &voltages,
bool calibrated =
true);
28void spike_cleaning_all(Vec<Vec<f32>> &voltages,
bool calibrated =
true);
35 static constexpr u16 HEAD = 0xAAAA;
36 static constexpr u16 TAIL = 0x5555;
37 static bool serialize_event_data;
45 Vec<Vec<f32>> v_offsets;
61 Vec<Vec<f32>> nanoseconds (
const RBEvent &event)
const;
64 Vec<f32> nanoseconds(
const RBEvent &event,
const u8 channel)
const;
74 bool discard_events =
true)
80 [[deprecated(
"Replaced by from_file, we will no longer write human readable calibration files")]]
87 static auto from_file(
const String &filename,
bool discard_events =
true)
100 bool channel_check(u8 channel) const;
107 auto load_tof_calibrations(std::string
const &pathname) -> std::map<u8, RBCalibration>;
110std::ostream& operator<<(std::ostream& os,
const RBCalibration& pck);
113typedef std::map<u8, RBCalibration> RBCalibrationMap;
Definition calibration.h:105
Definition calibration.h:34
static auto from_file(const String &filename, bool discard_events=true) -> RBCalibration
auto to_string() const -> std::string
String representation for printing.
static RBCalibration from_txtfile(const String &filename)
f32 d_v
voltage difference between noi and voltage data
Definition calibration.h:42
Vec< Vec< f32 > > voltages(const RBEvent &event, bool spike_cleaning=false) const
get the voltage values for the traces of the event
static void disable_eventdata()
Vec< RBEvent > noi_data
The no-input data used to calculate the constants.
Definition calibration.h:51
Vec< RBEvent > vcal_data
The constant voltage data used to calculate the constants.
Definition calibration.h:53
static auto from_bytestream(const Vec< u8 > &bytestream, u64 &pos, bool discard_events=true) -> RBCalibration
u32 timestamp
timestamp when the calibration has been taken
Definition calibration.h:44
Vec< RBEvent > tcal_data
The timing calibration data used to calculate the constants.
Definition calibration.h:55
u8 rb_id
id of the RB this calibration belongs to
Definition calibration.h:40