TDCBase

tdchbt.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Project: TDC Control Library
4 *
5 * Filename: tdchbt.h
6 *
7 * Purpose: g(2) Functions and Fitting
8 *
9 * Author: NHands GmbH & Co KG
10 */
11 /*****************************************************************************/
27 /*****************************************************************************/
28 /* $Id: tdchbt.h,v 1.2 2020/11/25 14:55:45 trurl Exp $ */
29
30 #ifndef __TDCHBT_H
31 #define __TDCHBT_H
32
33 #include "tdcdecl.h"
34
36 #define HBT_PARAM_SIZE 5
37
46 typedef enum {
47 FCTTYPE_NONE,
49 FCTTYPE_COHERENT,
51 FCTTYPE_THERMAL,
53 FCTTYPE_SINGLE,
56 FCTTYPE_ANTIBUNCH,
59 FCTTYPE_THERM_JIT,
61 FCTTYPE_SINGLE_JIT,
64 FCTTYPE_ANTIB_JIT,
67 FCTTYPE_THERMAL_OFS,
69 FCTTYPE_SINGLE_OFS,
72 FCTTYPE_ANTIB_OFS,
75 FCTTYPE_THERM_JIT_OFS,
77 FCTTYPE_SINGLE_JIT_OFS,
80 FCTTYPE_ANTIB_JIT_OFS
83 } HBT_FctType;
84
85
103 typedef struct {
104 Int32 capacity;
105 Int32 size;
106 Int32 binWidth;
107 Int32 indexOffset;
108 double values[1];
109 } TDC_HbtFunction;
110
111
125 TDC_API int TDC_CC TDC_enableHbt( Bln32 enable );
126
127
139 TDC_API int TDC_CC TDC_setHbtParams( Int32 binWidth,
140 Int32 binCount );
141
142
150 TDC_API int TDC_CC TDC_getHbtParams( Int32 * binWidth,
151 Int32 * binCount );
152
153
162 TDC_API int TDC_CC TDC_setHbtDetectorParams( double jitter );
163
164
172 TDC_API int TDC_CC TDC_getHbtDetectorParams( double * jitter );
173
174
184 TDC_API int TDC_CC TDC_setHbtInput( Int32 channel1,
185 Int32 channel2 );
186
187
196 TDC_API int TDC_CC TDC_getHbtInput( Int32 * channel1,
197 Int32 * channel2 );
198
199
205 TDC_API int TDC_CC TDC_resetHbtCorrelations();
206
207
221 TDC_API int TDC_CC TDC_getHbtEventCount( Int64 * totalCount,
222 Int64 * lastCount,
223 double * lastRate );
224
225
234 TDC_API int TDC_CC TDC_getHbtIntegrationTime( double * intTime );
235
236
249 TDC_API int TDC_CC TDC_getHbtCorrelations( Bln32 forward,
250 TDC_HbtFunction * fct );
251
252
262 TDC_API int TDC_CC TDC_calcHbtG2( TDC_HbtFunction * fct );
263
264
282 TDC_API int TDC_CC TDC_fitHbtG2( const TDC_HbtFunction * fct,
283 HBT_FctType fitType,
284 const double * startParams,
285 double * fitParams,
286 Int32 * iterations );
287
288
298 TDC_API const double * TDC_CC TDC_getHbtFitStartParams( HBT_FctType fctType,
299 double * params );
300
301
312 TDC_API int TDC_CC TDC_calcHbtModelFct( HBT_FctType fctType,
313 const double * params,
314 TDC_HbtFunction * fct );
315
316
329 TDC_API int TDC_CC TDC_generateHbtDemo( HBT_FctType fctType,
330 const double * params,
331 double noiseLv );
332
333
343 TDC_API TDC_HbtFunction * TDC_CC TDC_createHbtFunction( void );
344
345
352 TDC_API void TDC_CC TDC_releaseHbtFunction( TDC_HbtFunction * fct );
353
354
370 TDC_API void TDC_CC TDC_analyseHbtFunction( const TDC_HbtFunction * fct,
371 Int32 * capacity,
372 Int32 * size,
373 Int32 * binWidth,
374 Int32 * iOffset,
375 double * values,
376 Int32 bufSize );
377
378 #endif
TDC_HbtFunction
Correlation Function or g(2) Function.
Definition: tdchbt.h:103
TDC_HbtFunction::binWidth
Int32 binWidth
Size of a t step in TDC time units.
Definition: tdchbt.h:106
TDC_HbtFunction::size
Int32 size
Number of valid items in values.
Definition: tdchbt.h:105
TDC_HbtFunction::indexOffset
Int32 indexOffset
Index for element of values that represents t=0.
Definition: tdchbt.h:107
TDC_HbtFunction::capacity
Int32 capacity
Array size of values.
Definition: tdchbt.h:104
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_fitHbtG2
TDC_API int TDC_CC TDC_fitHbtG2(const TDC_HbtFunction *fct, HBT_FctType fitType, const double *startParams, double *fitParams, Int32 *iterations)
Fit g(2) Function.
TDC_resetHbtCorrelations
TDC_API int TDC_CC TDC_resetHbtCorrelations()
Reset Correlation Functions.
TDC_setHbtInput
TDC_API int TDC_CC TDC_setHbtInput(Int32 channel1, Int32 channel2)
Set TDC Channels for Input.
TDC_analyseHbtFunction
TDC_API void TDC_CC TDC_analyseHbtFunction(const TDC_HbtFunction *fct, Int32 *capacity, Int32 *size, Int32 *binWidth, Int32 *iOffset, double *values, Int32 bufSize)
Analyse Function Description.
TDC_createHbtFunction
TDC_API TDC_HbtFunction *TDC_CC TDC_createHbtFunction(void)
Create Function Description.
TDC_calcHbtG2
TDC_API int TDC_CC TDC_calcHbtG2(TDC_HbtFunction *fct)
Calculate g(2) Function.
TDC_getHbtEventCount
TDC_API int TDC_CC TDC_getHbtEventCount(Int64 *totalCount, Int64 *lastCount, double *lastRate)
Retrieve Event Count and Rate.
TDC_setHbtParams
TDC_API int TDC_CC TDC_setHbtParams(Int32 binWidth, Int32 binCount)
Set Correlation Function Parameters.
TDC_generateHbtDemo
TDC_API int TDC_CC TDC_generateHbtDemo(HBT_FctType fctType, const double *params, double noiseLv)
Generate Demo Data.
TDC_getHbtFitStartParams
TDC_API const double *TDC_CC TDC_getHbtFitStartParams(HBT_FctType fctType, double *params)
Get Recommended Fit Start Parameters.
TDC_getHbtCorrelations
TDC_API int TDC_CC TDC_getHbtCorrelations(Bln32 forward, TDC_HbtFunction *fct)
Retrieve Correlation Function.
TDC_enableHbt
TDC_API int TDC_CC TDC_enableHbt(Bln32 enable)
Enable HBT Calculations.
TDC_getHbtInput
TDC_API int TDC_CC TDC_getHbtInput(Int32 *channel1, Int32 *channel2)
Get TDC Channels for Input.
TDC_getHbtDetectorParams
TDC_API int TDC_CC TDC_getHbtDetectorParams(double *jitter)
Get Detector Parameters.
TDC_setHbtDetectorParams
TDC_API int TDC_CC TDC_setHbtDetectorParams(double jitter)
Set Detector Parameters.
TDC_getHbtIntegrationTime
TDC_API int TDC_CC TDC_getHbtIntegrationTime(double *intTime)
Retrieve Integration Time.
TDC_releaseHbtFunction
TDC_API void TDC_CC TDC_releaseHbtFunction(TDC_HbtFunction *fct)
Release Function Description.
HBT_FctType
HBT_FctType
Type of a model function.
Definition: tdchbt.h:46
FCTTYPE_SINGLE_OFS
@ FCTTYPE_SINGLE_OFS
Single photon with addtitional fit of detector offset The function requires 2 parameters: t1,...
Definition: tdchbt.h:69
FCTTYPE_THERMAL
@ FCTTYPE_THERMAL
Thermal light source.
Definition: tdchbt.h:51
FCTTYPE_SINGLE_JIT
@ FCTTYPE_SINGLE_JIT
Single photon with detector jitter considered.
Definition: tdchbt.h:61
FCTTYPE_THERM_JIT_OFS
@ FCTTYPE_THERM_JIT_OFS
Thermal with detector jitter considered and offset fit The function requires 4 parameters: A,...
Definition: tdchbt.h:75
FCTTYPE_ANTIB_JIT_OFS
@ FCTTYPE_ANTIB_JIT_OFS
Three level system with detector jitter considered and offset fit The function requires 5 parameters:...
Definition: tdchbt.h:80
FCTTYPE_COHERENT
@ FCTTYPE_COHERENT
Coherent light.
Definition: tdchbt.h:49
FCTTYPE_THERM_JIT
@ FCTTYPE_THERM_JIT
Thermal with detector jitter considered.
Definition: tdchbt.h:59
FCTTYPE_ANTIB_JIT
@ FCTTYPE_ANTIB_JIT
Three level system with detector jitter.
Definition: tdchbt.h:64
FCTTYPE_NONE
@ FCTTYPE_NONE
No function, invalid.
Definition: tdchbt.h:47
FCTTYPE_THERMAL_OFS
@ FCTTYPE_THERMAL_OFS
Thermal with addtitional fit of detector offset The function requires 4 parameters: A,...
Definition: tdchbt.h:67
FCTTYPE_ANTIBUNCH
@ FCTTYPE_ANTIBUNCH
Three level system light source.
Definition: tdchbt.h:56
FCTTYPE_ANTIB_OFS
@ FCTTYPE_ANTIB_OFS
Three level system with addtitional fit of detector offset The function requires 5 parameters: pf2,...
Definition: tdchbt.h:72
FCTTYPE_SINGLE
@ FCTTYPE_SINGLE
Single photon light source.
Definition: tdchbt.h:53
FCTTYPE_SINGLE_JIT_OFS
@ FCTTYPE_SINGLE_JIT_OFS
Single photon with detector jitter considered and offset fit The function requires 2 parameters: t1,...
Definition: tdchbt.h:77
TDC_calcHbtModelFct
TDC_API int TDC_CC TDC_calcHbtModelFct(HBT_FctType fctType, const double *params, TDC_HbtFunction *fct)
Calculate Model Function.
TDC_getHbtParams
TDC_API int TDC_CC TDC_getHbtParams(Int32 *binWidth, Int32 *binCount)
Get Correlation Function Parameters.