TDCBase

tdclifetm.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Project: TDC Control Library
4 *
5 * Filename: tdclifetm.h
6 *
7 * Purpose: Lifetime measurment
8 *
9 * Author: NHands GmbH & Co KG
10 */
11 /*****************************************************************************/
32 /*****************************************************************************/
33 /* $Id: tdclifetm.h,v 1.4 2021/02/03 13:40:15 trurl Exp $ */
34
35 #ifndef __TDCLIFETM_H
36 #define __TDCLIFETM_H
37
38 #include "tdcdecl.h"
39
41 #define LFT_PARAM_SIZE 4
42
51 typedef enum {
52 LFTTYPE_NONE,
53 LFTTYPE_EXP,
56 LFTTYPE_DBL_EXP,
60 LFTTYPE_KOHLRAUSCH
62 } LFT_FctType;
63
64
79 typedef struct {
80 Int32 capacity;
81 Int32 size;
82 Int32 binWidth;
83 double values[1];
84 } TDC_LftFunction;
85
86
103 TDC_API int TDC_CC TDC_enableLft( Bln32 enable );
104
105
116 TDC_API int TDC_CC TDC_setLftStartInput( Int32 startChan );
117
118
128 TDC_API int TDC_CC TDC_addLftHistogram( Int32 stopCh, Bln32 add );
129
130
137 TDC_API int TDC_CC TDC_getLftStartInput( Int32 * startChan );
138
139
151 TDC_API int TDC_CC TDC_setLftParams( Int32 binWidth,
152 Int32 binCount );
153
154
163 TDC_API int TDC_CC TDC_getLftParams( Int32 * binWidth,
164 Int32 * binCount );
165
166
172 TDC_API int TDC_CC TDC_resetLftHistograms( void );
173
174
184 TDC_API TDC_LftFunction * TDC_CC TDC_createLftFunction( void );
185
186
193 TDC_API void TDC_CC TDC_releaseLftFunction( TDC_LftFunction * fct );
194
195
210 TDC_API void TDC_CC TDC_analyseLftFunction( const TDC_LftFunction * fct,
211 Int32 * capacity,
212 Int32 * size,
213 Int32 * binWidth,
214 double * values,
215 Int32 bufSize );
216
217
243 TDC_API int TDC_CC TDC_getLftHistogram( Int32 channel,
244 Bln32 reset,
245 TDC_LftFunction * fct,
246 Int32 * tooBig,
247 Int32 * startEvts,
248 Int32 * stopEvts,
249 Int64 * expTime );
250
251
262 TDC_API int TDC_CC TDC_calcLftModelFct( LFT_FctType fctType,
263 const double * params,
264 TDC_LftFunction * fct );
265
266
278 TDC_API int TDC_CC TDC_generateLftDemo( LFT_FctType fctType,
279 const double * params,
280 double noiseLv );
281
282
297 TDC_API int TDC_CC TDC_fitLftHistogram( const TDC_LftFunction * fct,
298 LFT_FctType fitType,
299 const double * startParams,
300 double * fitParams,
301 Int32 * iterations );
302
303 #endif
TDC_LftFunction
Histogram Function.
Definition: tdclifetm.h:79
TDC_LftFunction::binWidth
Int32 binWidth
Size of a t step in TDC time units.
Definition: tdclifetm.h:82
TDC_LftFunction::size
Int32 size
Number of valid items in values.
Definition: tdclifetm.h:81
TDC_LftFunction::capacity
Int32 capacity
Array size of values.
Definition: tdclifetm.h:80
tdcdecl.h
Technical declarations for the DLL interface and basic type defs.
Bln32
__int32 Bln32
integer used as boolean
Definition: tdcdecl.h:57
Int32
__int32 Int32
32 bit integer for MSVC
Definition: tdcdecl.h:54
TDC_CC
#define TDC_CC
Calling convention
Definition: tdcdecl.h:34
Int64
__int64 Int64
64 bit integer for MSVC
Definition: tdcdecl.h:55
TDC_API
#define TDC_API
External DLL interface.
Definition: tdcdecl.h:38
TDC_resetLftHistograms
TDC_API int TDC_CC TDC_resetLftHistograms(void)
Reset Histograms.
TDC_calcLftModelFct
TDC_API int TDC_CC TDC_calcLftModelFct(LFT_FctType fctType, const double *params, TDC_LftFunction *fct)
Calculate Model Function.
TDC_getLftParams
TDC_API int TDC_CC TDC_getLftParams(Int32 *binWidth, Int32 *binCount)
Get Histogram Parameters.
LFT_FctType
LFT_FctType
Type of a model function.
Definition: tdclifetm.h:51
LFTTYPE_KOHLRAUSCH
@ LFTTYPE_KOHLRAUSCH
Kohlrausch decay.
Definition: tdclifetm.h:60
LFTTYPE_DBL_EXP
@ LFTTYPE_DBL_EXP
Double exponential decay.
Definition: tdclifetm.h:56
LFTTYPE_EXP
@ LFTTYPE_EXP
Mono exponential decay.
Definition: tdclifetm.h:53
LFTTYPE_NONE
@ LFTTYPE_NONE
No function, invalid.
Definition: tdclifetm.h:52
TDC_analyseLftFunction
TDC_API void TDC_CC TDC_analyseLftFunction(const TDC_LftFunction *fct, Int32 *capacity, Int32 *size, Int32 *binWidth, double *values, Int32 bufSize)
Analyse Function Description.
TDC_getLftStartInput
TDC_API int TDC_CC TDC_getLftStartInput(Int32 *startChan)
Get TDC Channel for Start Input.
TDC_addLftHistogram
TDC_API int TDC_CC TDC_addLftHistogram(Int32 stopCh, Bln32 add)
Add a histogram.
TDC_fitLftHistogram
TDC_API int TDC_CC TDC_fitLftHistogram(const TDC_LftFunction *fct, LFT_FctType fitType, const double *startParams, double *fitParams, Int32 *iterations)
Fit Histogram.
TDC_createLftFunction
TDC_API TDC_LftFunction *TDC_CC TDC_createLftFunction(void)
Create Function Description.
TDC_setLftStartInput
TDC_API int TDC_CC TDC_setLftStartInput(Int32 startChan)
Set TDC Channel for Start Input.
TDC_enableLft
TDC_API int TDC_CC TDC_enableLft(Bln32 enable)
Enable Lifetime Calculations.
TDC_getLftHistogram
TDC_API int TDC_CC TDC_getLftHistogram(Int32 channel, Bln32 reset, TDC_LftFunction *fct, Int32 *tooBig, Int32 *startEvts, Int32 *stopEvts, Int64 *expTime)
Retrieve Histogram.
TDC_releaseLftFunction
TDC_API void TDC_CC TDC_releaseLftFunction(TDC_LftFunction *fct)
Release Function Description.
TDC_setLftParams
TDC_API int TDC_CC TDC_setLftParams(Int32 binWidth, Int32 binCount)
Set Histogram Parameters.
TDC_generateLftDemo
TDC_API int TDC_CC TDC_generateLftDemo(LFT_FctType fctType, const double *params, double noiseLv)
Generate Demo Data.