tttrlib
A library for time-tagged time resolved data
Loading...
Searching...
No Matches
DecayConvolution.h
Go to the documentation of this file.
1#ifndef TTTRLIB_FSCONV_H
2#define TTTRLIB_FSCONV_H
3
4#include <cmath> /* std::ceil */
5#include <numeric> /* std::accumulate */
6#include <iostream>
7#include <vector>
8#include <algorithm> /* std::max */
9#include <string.h> /* strcmp */
10
11#if defined(_MSC_VER)
12 /* Microsoft C/C++-compatible compiler */
13 #include <intrin.h>
14 #include <immintrin.h>
15#endif
16
17#if defined(__AVX__)
18 #if (defined(__GNUC__) || defined(__clang__))
19 #include <immintrin.h>
20 #include <avxintrin.h>
21 #endif
22 #if !defined(__FMA__)
23 #define __FMA__ 1
24 #endif
25#endif
26
27
46void rescale(double *fit, double *decay, double *scale, int start, int stop);
47
48
69void rescale_w(double *fit, double *decay, double *w_sq, double *scale, int start, int stop);
70
71
93void rescale_w_bg(double *fit, double *decay, double *w_sq, double bg, double *scale, int start, int stop);
94
95
113void fconv(double *fit, double *x, double *lamp, int numexp, int start, int stop, double dt=0.05);
114
115
133void fconv_avx(double *fit, double *x, double *lamp, int numexp, int start, int stop, double dt=0.05);
134
135
157 double *fit, double *x, double *lamp, int numexp, int start, int stop,
158 int n_points, double period, double dt=0.05
159);
181 double *fit, double *x, double *lamp, int numexp, int start, int stop,
182 int n_points, double period, double dt=0.05
183);
184
185
203void fconv_per_cs(double *fit, double *x, double *lamp, int numexp, int stop,
204 int n_points, double period, int conv_stop, double dt);
205
206
230void fconv_ref(double *fit, double *x, double *lamp, int numexp, int start, int stop, double tauref, double dt=0.05);
231
232
245void sconv(double *fit, double *p, double *lamp, int start, int stop);
246
247
258void shift_lamp(double *lampsh, double *lamp, double ts, int n_points, double out_value=0.0);
259
260
285 double* model, int n_model,
286 double* data, int n_data,
287 double repetition_rate,
288 double instrument_dead_time,
289 double measurement_time,
290 std::string pile_up_model = "coates",
291 int start = 0,
292 int stop = -1
293);
294
295
307 double* lifetime_spectrum, int n_lifetime_spectrum,
308 double amplitude_threshold
309);
310
311
347 double *model, int n_model,
348 double *time_axis, int n_time_axis,
349 double *irf, int n_irf,
350 double *lifetime_spectrum, int n_lifetime_spectrum,
351 int convolution_start = 0,
352 int convolution_stop = -1,
353 double period = 100.0
354);
355
356
389 double *inplace_output, int n_output,
390 double *time_axis, int n_time_axis,
391 double *instrument_response_function, int n_instrument_response_function,
392 double *lifetime_spectrum, int n_lifetime_spectrum,
393 int convolution_start = 0,
394 int convolution_stop = -1
395);
396
397
398
399#endif //TTTRLIB_FSCONV_H
void fconv(double *fit, double *x, double *lamp, int numexp, int start, int stop, double dt=0.05)
Convolve lifetime spectrum with instrument response (fast convolution, low repetition rate)
void shift_lamp(double *lampsh, double *lamp, double ts, int n_points, double out_value=0.0)
shift instrumnet response function
void discriminate_small_amplitudes(double *lifetime_spectrum, int n_lifetime_spectrum, double amplitude_threshold)
Threshold the amplitudes in the interleaved lifetime spectrum.
void rescale_w_bg(double *fit, double *decay, double *w_sq, double bg, double *scale, int start, int stop)
Scale the model function to the data considering weights and background.
void fconv_per_cs(double *fit, double *x, double *lamp, int numexp, int stop, int n_points, double period, int conv_stop, double dt)
Convolve lifetime spectrum - fast convolution, high repetition rate, with convolution stop.
void fconv_ref(double *fit, double *x, double *lamp, int numexp, int start, int stop, double tauref, double dt=0.05)
Convolve lifetime spectrum - fast convolution with reference compound decay.
void fconv_per_avx(double *fit, double *x, double *lamp, int numexp, int start, int stop, int n_points, double period, double dt=0.05)
Convolve lifetime spectrum with instrument response (fast convolution, high repetition rate),...
void rescale(double *fit, double *decay, double *scale, int start, int stop)
Scale model function to the data (old version)
void add_pile_up_to_model(double *model, int n_model, double *data, int n_data, double repetition_rate, double instrument_dead_time, double measurement_time, std::string pile_up_model="coates", int start=0, int stop=-1)
Add a pile-up distortion to the model function.
void fconv_cs_time_axis(double *inplace_output, int n_output, double *time_axis, int n_time_axis, double *instrument_response_function, int n_instrument_response_function, double *lifetime_spectrum, int n_lifetime_spectrum, int convolution_start=0, int convolution_stop=-1)
Compute the fluorescence decay for a lifetime spectrum and an instrument response function.
void sconv(double *fit, double *p, double *lamp, int start, int stop)
Convolve fluorescence decay curve with irf.
void fconv_per_cs_time_axis(double *model, int n_model, double *time_axis, int n_time_axis, double *irf, int n_irf, double *lifetime_spectrum, int n_lifetime_spectrum, int convolution_start=0, int convolution_stop=-1, double period=100.0)
Compute the fluorescence decay for a lifetime spectrum and an instrument response function considerin...
void fconv_per(double *fit, double *x, double *lamp, int numexp, int start, int stop, int n_points, double period, double dt=0.05)
Convolve lifetime spectrum with instrument response (fast convolution, high repetition rate)
void fconv_avx(double *fit, double *x, double *lamp, int numexp, int start, int stop, double dt=0.05)
Convolve lifetime spectrum with instrument response (fast convolution, AVX optimized for large lifeti...
void rescale_w(double *fit, double *decay, double *w_sq, double *scale, int start, int stop)
Scale model function to the data (with weights)