DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
QutoolsQuTAG.h
Go to the documentation of this file.
1// This file is part of DynExp.
2
9#pragma once
10
11#include "stdafx.h"
12#include "DynExpCore.h"
15
16namespace DynExpInstr
17{
18 class QutoolsQuTAG;
19 class QutoolsQuTAGData;
20
21 namespace QutoolsQuTAGTasks
22 {
24
30
36
42
43 class ReadDataTask final : public DynExp::TaskBase
44 {
45 public:
47
48 private:
50 };
51
62
63 class ClearTask final : public DynExp::TaskBase
64 {
65 public:
67
68 private:
70 };
71
84
95
106
107 class SetDelayTask final : public DynExp::TaskBase
108 {
109 public:
111
112 private:
114
116 };
117
119 {
120 public:
122
123 private:
125
126 const bool Enable;
127 };
128
130 {
131 public:
134
135 private:
137
139 const size_t BinCount;
140 };
141
142 class ResetHBTTask final : public DynExp::TaskBase
143 {
144 public:
146
147 private:
149 };
150 }
151
169
171 {
172 public:
174 virtual ~QutoolsQuTAGParams() = default;
175
176 virtual const char* GetParamClassTag() const noexcept override { return "QutoolsQuTAGParams"; }
177
179 "HardwareAdapter", "qutools TDC device", "Underlying hardware adapter of this instrument", DynExpUI::Icons::HardwareAdapter };
180 Param<ParamsConfigDialog::NumberType> Channel = { *this, "Channel", "Channel",
181 "Channel of the quTAG device this instrument refers to", true, 0, 0, std::numeric_limits<DynExpHardware::QutoolsTDCHardwareAdapter::ChannelType>::max(), 1, 0 };
182 Param<ParamsConfigDialog::NumberType> CrossCorrChannel = { *this, "CrossCorrChannel", "Correlation channel",
183 "Channel of the quTAG device to compute correlations (e.g. g(2)) with", false, 1, 0, std::numeric_limits<DynExpHardware::QutoolsTDCHardwareAdapter::ChannelType>::max(), 1, 0 };
184
185 private:
188 };
189
191 {
192 public:
195
197 virtual ~QutoolsQuTAGConfigurator() = default;
198
199 private:
200 virtual DynExp::ParamsBasePtrType MakeParams(DynExp::ItemIDType ID, const DynExp::DynExpCore& Core) const override { return DynExp::MakeParams<QutoolsQuTAGConfigurator>(ID, Core); }
201 };
202
204 {
205 public:
209
210 constexpr static auto Name() noexcept { return "qutools quTAG"; }
211
213 virtual ~QutoolsQuTAG() {}
214
215 virtual std::string GetName() const override { return Name(); }
216
217 virtual double GetMinThresholdInVolts() const noexcept override { return -2; }
218 virtual double GetMaxThresholdInVolts() const noexcept override { return 3; }
219
220 virtual Util::picoseconds GetResolution() const override;
221 virtual size_t GetBufferSize() const override;
222
223 virtual void ReadData(DynExp::TaskBase::CallbackType CallbackFunc = nullptr) const override { MakeAndEnqueueTask<QutoolsQuTAGTasks::ReadDataTask>(CallbackFunc); }
224 virtual void SetStreamSize(size_t BufferSizeInSamples, DynExp::TaskBase::CallbackType CallbackFunc = nullptr) const override { MakeAndEnqueueTask<QutoolsQuTAGTasks::SetStreamSizeTask>(BufferSizeInSamples, CallbackFunc); }
225 virtual void Clear(DynExp::TaskBase::CallbackType CallbackFunc = nullptr) const override { MakeAndEnqueueTask<QutoolsQuTAGTasks::ClearTask>(CallbackFunc); }
226 virtual void ConfigureInput(bool UseRisingEdge, double ThresholdInVolts, DynExp::TaskBase::CallbackType CallbackFunc = nullptr) const override { MakeAndEnqueueTask<QutoolsQuTAGTasks::ConfigureInputTask>(UseRisingEdge, ThresholdInVolts, CallbackFunc); }
227 virtual void SetExposureTime(Util::picoseconds ExposureTime, DynExp::TaskBase::CallbackType CallbackFunc = nullptr) const override { MakeAndEnqueueTask<QutoolsQuTAGTasks::SetExposureTimeTask>(ExposureTime, CallbackFunc); }
228 virtual void SetCoincidenceWindow(Util::picoseconds CoincidenceWindow, DynExp::TaskBase::CallbackType CallbackFunc = nullptr) const override { MakeAndEnqueueTask<QutoolsQuTAGTasks::SetCoincidenceWindowTask>(CoincidenceWindow, CallbackFunc); }
229 virtual void SetDelay(Util::picoseconds Delay, DynExp::TaskBase::CallbackType CallbackFunc = nullptr) const override { MakeAndEnqueueTask<QutoolsQuTAGTasks::SetDelayTask>(Delay, CallbackFunc); }
230 virtual void SetHBTActive(bool Enable, DynExp::TaskBase::CallbackType CallbackFunc = nullptr) const override { MakeAndEnqueueTask<QutoolsQuTAGTasks::SetHBTActiveTask>(Enable, CallbackFunc); }
231 virtual void ConfigureHBT(Util::picoseconds BinWidth, size_t BinCount, DynExp::TaskBase::CallbackType CallbackFunc = nullptr) const override { MakeAndEnqueueTask<QutoolsQuTAGTasks::ConfigureHBTTask>(BinWidth, BinCount, CallbackFunc); }
232 virtual void ResetHBT(DynExp::TaskBase::CallbackType CallbackFunc = nullptr) const override { MakeAndEnqueueTask<QutoolsQuTAGTasks::ResetHBTTask>(CallbackFunc); }
233
234 private:
235 void ResetImpl(dispatch_tag<TimeTagger>) override final;
237
238 virtual std::unique_ptr<DynExp::InitTaskBase> MakeInitTask() const override { return DynExp::MakeTask<QutoolsQuTAGTasks::InitTask>(); }
239 virtual std::unique_ptr<DynExp::ExitTaskBase> MakeExitTask() const override { return DynExp::MakeTask<QutoolsQuTAGTasks::ExitTask>(); }
240 virtual std::unique_ptr<DynExp::UpdateTaskBase> MakeUpdateTask() const override { return DynExp::MakeTask<QutoolsQuTAGTasks::UpdateTask>(); }
241 };
242}
Defines DynExp's core module as an interface between the UI and DynExp objects.
Implementation of a hardware adapter to control qutools TDC hardware.
Defines a time tagging meta instrument to assign timestamps to (e.g. photon) detection events.
virtual DynExp::ParamsBasePtrType MakeParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core) const override
Override to make derived classes call DynExp::MakeParams with the correct configurator type derived f...
virtual ~QutoolsQuTAGConfigurator()=default
virtual ~QutoolsQuTAGData()=default
void SetChannel(DynExpHardware::QutoolsTDCHardwareAdapter::ChannelType Channel) noexcept
DynExpHardware::QutoolsTDCHardwareAdapter::ChannelType Channel
void ResetImpl(dispatch_tag< TimeTaggerData >) override final
DynExp::LinkedObjectWrapperContainer< DynExpHardware::QutoolsTDCHardwareAdapter > HardwareAdapter
virtual void ResetImpl(dispatch_tag< QutoolsQuTAGData >)
auto GetChannel() const noexcept
Param< ParamsConfigDialog::NumberType > CrossCorrChannel
Param< ParamsConfigDialog::NumberType > Channel
Param< DynExp::ObjectLink< DynExpHardware::QutoolsTDCHardwareAdapter > > HardwareAdapter
virtual ~QutoolsQuTAGParams()=default
virtual void ConfigureParamsImpl(dispatch_tag< QutoolsQuTAGParams >)
QutoolsQuTAGParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
void ConfigureParamsImpl(dispatch_tag< TimeTaggerParams >) override final
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
virtual const char * GetParamClassTag() const noexcept override
This function is intended to be overridden once in each derived class returning the name of the respe...
ClearTask(CallbackType CallbackFunc) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
ConfigureHBTTask(Util::picoseconds BinWidth, size_t BinCount, CallbackType CallbackFunc) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
ConfigureInputTask(bool UseRisingEdge, double ThresholdInVolts, CallbackType CallbackFunc) noexcept
virtual void ExitFuncImpl(dispatch_tag< ExitTask >, DynExp::InstrumentInstance &Instance)
void ExitFuncImpl(dispatch_tag< TimeTaggerTasks::ExitTask >, DynExp::InstrumentInstance &Instance) override final
Deinitializes the respective instrument within the instrument inheritance hierarchy....
virtual void InitFuncImpl(dispatch_tag< InitTask >, DynExp::InstrumentInstance &Instance)
void InitFuncImpl(dispatch_tag< TimeTaggerTasks::InitTask >, DynExp::InstrumentInstance &Instance) override final
Initializes the respective instrument within the instrument inheritance hierarchy....
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
ReadDataTask(CallbackType CallbackFunc) noexcept
ResetHBTTask(CallbackType CallbackFunc) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
SetCoincidenceWindowTask(Util::picoseconds CoincidenceWindow, CallbackType CallbackFunc) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
SetDelayTask(Util::picoseconds Delay, CallbackType CallbackFunc) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
SetExposureTimeTask(Util::picoseconds ExposureTime, CallbackType CallbackFunc) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
SetHBTActiveTask(bool Enable, CallbackType CallbackFunc) noexcept
SetStreamSizeTask(size_t BufferSizeInSamples, CallbackType CallbackFunc) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
void UpdateFuncImpl(dispatch_tag< TimeTaggerTasks::UpdateTask >, DynExp::InstrumentInstance &Instance) override final
Updates the respective instrument within the instrument inheritance hierarchy. Call UpdateFuncImpl() ...
virtual void UpdateFuncImpl(dispatch_tag< UpdateTask >, DynExp::InstrumentInstance &Instance)
virtual void SetStreamSize(size_t BufferSizeInSamples, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Enqueues a task to set the size of the instrument's sample stream. The default implementation just ca...
virtual double GetMaxThresholdInVolts() const noexcept override
Determines the maximal configurable threshold voltage, which needs to be exceeded at the time tagger'...
static constexpr auto Name() noexcept
virtual Util::picoseconds GetResolution() const override
Determines the time tagger's time resolution in assigning timestamps to events.
virtual void ConfigureInput(bool UseRisingEdge, double ThresholdInVolts, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Configures the input channel of the physical device related to this instrument.
virtual void SetExposureTime(Util::picoseconds ExposureTime, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Configures the time tagger's exposure time. This is e.g. relevant to determine count rates in the Tim...
void ResetImpl(dispatch_tag< TimeTagger >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
virtual size_t GetBufferSize() const override
Determines the time tagger's internal buffer size for storing time-tagged events.
virtual void SetCoincidenceWindow(Util::picoseconds CoincidenceWindow, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Configures the time tagger's coincidence window.
virtual std::string GetName() const override
Returns the name of this Object type.
virtual std::unique_ptr< DynExp::InitTaskBase > MakeInitTask() const override
Factory function for an init task (InitTaskBase). Override to define the desired initialization task ...
virtual void ResetHBT(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Resets the time tagger's HBT unit for g^(2) measurements.
virtual void ResetImpl(dispatch_tag< QutoolsQuTAG >)
virtual void Clear(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Clears the recorded time-tagged events from the hardware buffer of the underlying hardware adapter.
virtual void SetHBTActive(bool Enable, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Enables or disables the time tagger's HBT unit for g^(2) measurements.
virtual std::unique_ptr< DynExp::UpdateTaskBase > MakeUpdateTask() const override
Factory function for an update task (UpdateTaskBase). Override to define the desired update task in d...
virtual void ConfigureHBT(Util::picoseconds BinWidth, size_t BinCount, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Configures the time tagger's HBT unit for g^(2) measurements.
virtual void ReadData(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Enqueues a task to read data from the hardware to the data stream. The default implementation does no...
virtual double GetMinThresholdInVolts() const noexcept override
Determines the minimal configurable threshold voltage, which needs to be exceeded at the time tagger'...
virtual void SetDelay(Util::picoseconds Delay, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Configures the time tagger's channel delay. This is useful to compensate different signal delays betw...
virtual std::unique_ptr< DynExp::ExitTaskBase > MakeExitTask() const override
Factory function for an exit task (ExitTaskBase). Override to define the desired deinitialization tas...
Configurator class for TimeTagger.
Definition TimeTagger.h:241
Data class for TimeTagger.
Definition TimeTagger.h:98
Parameter class for TimeTagger.
Definition TimeTagger.h:202
Defines a task for deinitializing an instrument within an instrument inheritance hierarchy....
Definition TimeTagger.h:54
Defines a task for initializing an instrument within an instrument inheritance hierarchy....
Definition TimeTagger.h:27
Defines a task for updating an instrument within an instrument inheritance hierarchy....
Definition TimeTagger.h:67
Meta instrument for a time tagging device to assign timestamps to (e.g. photon) detection events base...
Definition TimeTagger.h:255
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
Definition DynExpCore.h:127
Refer to DynExp::ParamsBase::dispatch_tag.
Refer to DynExp::ParamsBase::dispatch_tag.
Refer to ParamsBase::dispatch_tag.
Definition Instrument.h:146
Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance.
Definition Instrument.h:772
This class holds a pointer (LinkedObjectWrapperPointer) to a LinkedObjectWrapper. Intances of this cl...
Definition Object.h:3160
const std::thread::id OwnerThreadID
Thread id of the thread which has constructed (and owns) this Object instance.
Definition Object.h:2302
const ParamsBasePtrType Params
Pointer to the parameter class instance belonging to this Object instance.
Definition Object.h:2303
Refer to ParamsBase::dispatch_tag.
Definition Object.h:2018
const auto & GetCore() const noexcept
Returns a reference to DynExp's core.
Definition Object.h:1677
const ItemIDType ID
ID of the Object this parameter class instance belongs to.
Definition Object.h:1779
const DynExpCore & Core
Reference to DynExp's core.
Definition Object.h:1780
Tag for function dispatching mechanism within this class used when derived classes are not intended t...
Definition Object.h:349
Base class for all tasks being processed by instruments. The class must not contain public virtual fu...
Definition Instrument.h:892
std::function< void(const TaskBase &, ExceptionContainer &)> CallbackType
Type of a callback function which is invoked when a task has finished, failed or has been aborted....
Definition Instrument.h:939
TaskBase(CallbackType CallbackFunc=nullptr) noexcept
Constructs an instrument task.
Definition Instrument.h:979
const CallbackType CallbackFunc
This callback function is called after the task has finished (either successfully or not) with a refe...
Defines the return type of task functions.
Definition Instrument.h:824
Refer to DynExp::ParamsBase::dispatch_tag.
Pointer to lock a class derived from ISynchronizedPointerLockable for synchronizing between threads....
Definition Util.h:170
void UpdateStreamMode(Util::SynchronizedPointer< QutoolsQuTAGData > &InstrData)
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
constexpr auto HardwareAdapter
std::unique_ptr< ParamsBase > ParamsBasePtrType
Alias for a pointer to the parameter system base class ParamsBase.
Definition Object.h:1807
size_t ItemIDType
ID type of objects/items managed by DynExp.
std::chrono::duration< double, std::pico > picoseconds
Extends std::chrono by a duration data type for picoseconds.
Definition Util.h:762
Accumulates include statements to provide a precompiled header.