TDCBase
Functions
tdcstartstop.h File Reference

Start Stop Histograms. More...

#include "tdcdecl.h"

Go to the source code of this file.

Functions

TDC_API int TDC_CC TDC_enableStartStop (Bln32 enable)
 Enable Start Stop Histograms. More...
 
TDC_API int TDC_CC TDC_addHistogram (Int32 startCh, Int32 stopCh, Bln32 add)
 Add a histogram. More...
 
TDC_API int TDC_CC TDC_setHistogramParams (Int32 binWidth, Int32 binCount)
 Set Start Stop Histogram Parameters. More...
 
TDC_API int TDC_CC TDC_getHistogramParams (Int32 *binWidth, Int32 *binCount)
 Read back Start Stop Histogram Parameters. More...
 
TDC_API int TDC_CC TDC_clearAllHistograms ()
 Clear Start Stop Histograms. More...
 
TDC_API int TDC_CC TDC_getHistogram (Int32 chStart, Int32 chStop, Bln32 reset, Int32 *data, Int32 *count, Int32 *tooSmall, Int32 *tooLarge, Int32 *starts, Int32 *stops, Int64 *expTime)
 Retrieve Start Stop Histogram. More...
 

Detailed Description

Start Stop Histograms.

The header defines functions that process TDC data to a set of start stop histograms. Every histogram has a start and stop input channel; histograms can be configured for all combinations of those. Only the first stop event after a start is counted. The histograms are calculated on the PC.

Use the functions of tdcbase.h to control the device. TDC_setHistogramParams allows to configure the histogram functions, TDC_getHistogram is used to retrieve the data. If a set of data is required that belongs to the same time, use TDC_freezeBuffers to synchronize.

Definition in file tdcstartstop.h.

Function Documentation

TDC_API int TDC_CC TDC_addHistogram ( Int32  startCh,
Int32  stopCh,
Bln32  add 
)

Add a histogram.

Adds or removes a histogram with specified start and stop channels. All time differences beween a start and the first following stop event will contribute to the histogram. A channel independent histogram that integrates all events is always provided and hasn't to be added, see TDC_getHistogram.

Parameters
startChchannel number of the histogram's start channel, Range = 1...32
stopChchannel number of the histogram's stop channel, Range = 1...32
addadd (true) or remove (false) the histogram. If an existing histogram is added or a missing histogram is removed, nothing happens.
Returns
Error code
TDC_API int TDC_CC TDC_clearAllHistograms ( )

Clear Start Stop Histograms.

Clears all internally generated start stop histograms, i.e. all bins are set to 0.

Returns
Error code
TDC_API int TDC_CC TDC_enableStartStop ( Bln32  enable)

Enable Start Stop Histograms.

Enables the calculation of start stop histograms. When enabled, all incoming events contribute to the histograms. When disabled, all corresponding functions are unavailable. The function implicitly clears the histograms. Use TDC_freezeBuffers to interrupt the accumulation of events without clearing the functions and TDC_clearAllHistograms to clear without interrupt.

Parameters
enableEnable or disable
Returns
Error code
TDC_API int TDC_CC TDC_getHistogram ( Int32  chStart,
Int32  chStop,
Bln32  reset,
Int32 data,
Int32 count,
Int32 tooSmall,
Int32 tooLarge,
Int32 starts,
Int32 stops,
Int64 expTime 
)

Retrieve Start Stop Histogram.

Retrieves one of the start stop histograms accumulated internally. Besides the histograms that have been configured using TDC_addHistogram, one histogram is provided for the time differences of every event the device has detected (channel independent).

Parameters
chStartStart channel of the channel pair. If this parameter is negative, the channel independent histogram is retrieved.
chStopStop channel of the channel pair. 0 or negative encode for the channel independent histogram.
resetIf the histogram should be cleared after retrieving.
dataOutput: Histogram data. The array must have at least binCount (see TDC_setHistogramParams ) elements. A NULL pointer is allowed to ignore the data.
countOutput: Total number of time diffs in the histogram. A NULL pointer is allowed to ignore the data.
tooSmallOutput: Number of time diffs that were smaller than the smallest histogram bin. A NULL pointer is allowed to ignore the data.
tooLargeOutput: Number of time diffs that were bigger than the biggest histogram bin. A NULL pointer is allowed to ignore the data.
startsOutput: Number of events on the start channel contributing to the histogram. A NULL pointer is allowed to ignore the data.
stopsOutput: Number of events on the stop channel contributing to the histogram. A NULL pointer is allowed to ignore the data.
expTimeOutput: Total exposure time for the histogram: the time difference between the first and the last event that contribute to the histogram. In timebase units. A NULL pointer is allowed to ignore the data.
Returns
TDC_Ok
TDC_API int TDC_CC TDC_getHistogramParams ( Int32 binWidth,
Int32 binCount 
)

Read back Start Stop Histogram Parameters.

Reads back the parameters that have been set with TDC_setHistogramParams. All output parameters may be NULL to ignore the value.

Parameters
binWidthOutput: Width of the histograms bins.
binCountOutput: Number of bins in the histogram buffers.
Returns
Error code
TDC_API int TDC_CC TDC_setHistogramParams ( Int32  binWidth,
Int32  binCount 
)

Set Start Stop Histogram Parameters.

Sets parameters for the internally generated start stop histograms. If the function is not called, default values are in place. When the function is called, all collected histogram data are cleared.

Parameters
binWidthWidth of the histogram bins in units of the TDC Time Base, see TDC_getTimebase . Range = 1 ... 1000000, default = 1.
binCountNumber of bins in the histogram buffers. Range = 2 ... 1000000, default = 10000.
Returns
Error code