IMP.bff
Loading...
Searching...
No Matches
DecayRoutines.h
Go to the documentation of this file.
1
10#ifndef IMPBFF_DECAYROUTINES_H
11#define IMPBFF_DECAYROUTINES_H
12
13#include <IMP/bff/bff_config.h>
14
15#include <cmath> /* std::ceil */
16#include <numeric> /* std::accumulate */
17#include <iostream>
18#include <vector>
19#include <algorithm> /* std::max */
20#include <string.h> /* strcmp */
21
22#if defined(__AVX__)
23 #if defined(_MSC_VER)
24 /* Microsoft C/C++-compatible compiler */
25 #include <intrin.h>
26 #include <immintrin.h>
27 #endif
28 #if (defined(__GNUC__) || defined(__clang__))
29 #include <immintrin.h>
30 #endif
31 #if !defined(__FMA__)
32 #define __FMA__ 1
33 #endif
34#endif //__AVX__
35
36IMPBFF_BEGIN_NAMESPACE
37
inline int mod_p(int a, int n){
49 return (n + (a % n)) % n;
50}
51
67IMPBFFEXPORT void decay_rescale(double *fit, double *decay, double *scale, int start, int stop);
68
69
90IMPBFFEXPORT void decay_rescale_w(double *fit, double *decay, double *w_sq, double *scale, int start, int stop);
91
112IMPBFFEXPORT void decay_rescale_w_bg(double *fit, double *decay, double *e_sq, double bg, double *scale, int start, int stop);
113
114
131IMPBFFEXPORT void decay_fconv(double *fit, double *x, double *lamp, int numexp, int start, int stop, double dt=0.05);
132
148IMPBFFEXPORT void decay_fconv_avx(double *fit, double *x, double *lamp, int numexp, int start, int stop, double dt=0.05);
149
167IMPBFFEXPORT void decay_fconv_per(
168 double *fit, double *x, double *lamp, int numexp, int start, int stop,
169 int n_points, double period, double dt=0.05
170);
171
189IMPBFFEXPORT void decay_fconv_per_avx(
190 double *fit, double *x, double *lamp, int numexp, int start, int stop,
191 int n_points, double period, double dt=0.05
192);
193
210IMPBFFEXPORT void decay_fconv_per_cs(double *fit, double *x, double *lamp, int numexp, int stop,
211 int n_points, double period, int conv_stop, double dt);
212
233IMPBFFEXPORT void decay_fconv_ref(double *fit, double *x, double *lamp, int numexp, int start, int stop, double tauref, double dt=0.05);
234
247IMPBFFEXPORT void decay_sconv(double *fit, double *p, double *lamp, int start, int stop);
248
259IMPBFFEXPORT void decay_shift_lamp(double *lampsh, double *lamp, double ts, int n_points, double out_value=0.0);
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
306 double* lifetime_spectrum, int n_lifetime_spectrum,
307 double amplitude_threshold
308);
309
344 double *model, int n_model,
345 double *time_axis, int n_time_axis,
346 double *irf, int n_irf,
347 double *lifetime_spectrum, int n_lifetime_spectrum,
348 int convolution_start = 0,
349 int convolution_stop = -1,
350 double period = 100.0
351);
352
390IMPBFFEXPORT void decay_fconv_cs_time_axis(
391 double *inplace_output, int n_output,
392 double *time_axis, int n_time_axis,
393 double *irf, int n_irf,
394 double *lifetime_spectrum, int n_lifetime_spectrum,
395 int convolution_start = 0,
396 int convolution_stop = -1
397);
398
399
400IMPBFF_END_NAMESPACE
401
402#endif //IMPBFF_DECAYROUTINES_H
IMPBFFEXPORT void decay_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)
IMPBFFEXPORT void decay_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...
IMPBFFEXPORT void decay_sconv(double *fit, double *p, double *lamp, int start, int stop)
Convolve fluorescence decay curve with irf.
IMPBFFEXPORT void decay_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.
IMPBFFEXPORT void decay_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),...
IMPBFFEXPORT void decay_shift_lamp(double *lampsh, double *lamp, double ts, int n_points, double out_value=0.0)
shift instrument response function
IMPBFFEXPORT void decay_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.
IMPBFFEXPORT void decay_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.
IMPBFFEXPORT void decay_rescale(double *fit, double *decay, double *scale, int start, int stop)
Scale model function to the data (old version).
IMPBFFEXPORT void decay_fconv_cs_time_axis(double *inplace_output, int n_output, 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)
IMPBFFEXPORT void discriminate_small_amplitudes(double *lifetime_spectrum, int n_lifetime_spectrum, double amplitude_threshold)
IMPBFFEXPORT void decay_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)
IMPBFF_BEGIN_NAMESPACE int mod_p(int a, int n)
Compute the modulo of a number with respect to a positive integer.
Definition DecayRoutines.h:48
IMPBFFEXPORT void decay_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)
IMPBFFEXPORT void decay_rescale_w_bg(double *fit, double *decay, double *e_sq, double bg, double *scale, int start, int stop)
Scale model function to the data (with weights and background)
IMPBFFEXPORT void decay_rescale_w(double *fit, double *decay, double *w_sq, double *scale, int start, int stop)
Scale model function to the data (with weights).