CorrelatorPhotonStream class gathers event times and weights.
More...
#include <CorrelatorPhotonStream.h>
|
| CorrelatorPhotonStream ()=default |
| Default constructor for CorrelatorPhotonStream.
|
|
| CorrelatorPhotonStream (const CorrelatorPhotonStream &a) |
| Copy constructor for CorrelatorPhotonStream.
|
|
| ~CorrelatorPhotonStream ()=default |
| Default destructor for CorrelatorPhotonStream.
|
|
bool | empty () const |
| Check if the CorrelatorPhotonStream is empty.
|
|
size_t | size () const |
| Get the size of the CorrelatorPhotonStream.
|
|
void | clear () |
| Clear the CorrelatorPhotonStream.
|
|
void | resize (size_t n, double x=1.0) |
| Resize the CorrelatorPhotonStream.
|
|
void | make_fine (unsigned short *tac, int n_tac, unsigned int number_of_microtime_channels) |
| Make time events fine by adding micro time to macro time.
|
|
void | set_weights (const std::map< short, std::vector< double > > &filter, std::vector< unsigned int > micro_times=std::vector< unsigned int >(), std::vector< signed char > routing_channels=std::vector< signed char >()) |
| Set weights using a filter for time events.
|
|
void | set_events (unsigned long long *t, int n_t, double *weight, int n_weight) |
| Set time events and weights.
|
|
void | coarsen () |
| Coarsen the time events.
|
|
unsigned long long | dt () |
| Compute the time difference in macro time units between the first and last event.
|
|
double | sum_of_weights () |
| Compute the sum of weights in the correlation stream.
|
|
double | mean_count_rate () |
| Compute the mean count rate in the correlation stream.
|
|
void | set_time_axis_calibration (double v) |
| Set the time axis calibration.
|
|
double | get_time_axis_calibration () const |
| Get the calibration of the time axis.
|
|
void | set_tttr (std::shared_ptr< TTTR > tttr, bool make_fine=false) |
| Set the TTTR object for the CorrelatorPhotonStream.
|
|
std::shared_ptr< TTTR > | get_tttr () const |
| Get the TTTR object associated with the CorrelatorPhotonStream.
|
|
|
static void | make_fine_times (unsigned long long *t, unsigned int n_times, unsigned short *tac, unsigned int n_tac) |
| Make time events fine by adding micro time to macro time.
|
|
|
std::vector< unsigned long long > | times |
| The array containing the time points of the first correlation channel.
|
|
std::vector< double > | weights |
| The array containing the weights of the first correlation channel.
|
|
CorrelatorPhotonStream class gathers event times and weights.
◆ CorrelatorPhotonStream() [1/2]
CorrelatorPhotonStream::CorrelatorPhotonStream |
( |
| ) |
|
|
default |
◆ CorrelatorPhotonStream() [2/2]
◆ ~CorrelatorPhotonStream()
CorrelatorPhotonStream::~CorrelatorPhotonStream |
( |
| ) |
|
|
default |
◆ clear()
void CorrelatorPhotonStream::clear |
( |
| ) |
|
|
inline |
◆ coarsen()
void CorrelatorPhotonStream::coarsen |
( |
| ) |
|
Coarsen the time events.
Coarsens the time events by dividing the times by two. If two consecutive time events have the same time, the weights of the two events are added to the following weight element, and the value of the previous weight is set to zero.
◆ dt()
unsigned long long CorrelatorPhotonStream::dt |
( |
| ) |
|
Compute the time difference in macro time units between the first and last event.
- Returns
- The time difference between the first and last event.
◆ empty()
bool CorrelatorPhotonStream::empty |
( |
| ) |
const |
|
inline |
Check if the CorrelatorPhotonStream is empty.
- Returns
- True if both the times and weights arrays are empty, false otherwise.
◆ get_time_axis_calibration()
double CorrelatorPhotonStream::get_time_axis_calibration |
( |
| ) |
const |
|
inline |
Get the calibration of the time axis.
Returns the calibration of the time axis in seconds, which represents the duration of a sync signal (macro time clock).
- Returns
- The calibration of the time axis in seconds.
◆ get_tttr()
std::shared_ptr< TTTR > CorrelatorPhotonStream::get_tttr |
( |
| ) |
const |
|
inline |
◆ make_fine()
void CorrelatorPhotonStream::make_fine |
( |
unsigned short * | tac, |
|
|
int | n_tac, |
|
|
unsigned int | number_of_microtime_channels ) |
Make time events fine by adding micro time to macro time.
Changes the time events by adding the micro time to the macro time. The micro times should match the macro time, i.e., the length of the micro time array should be at least the same length as the macro time array.
- Parameters
-
[in] | tac | An array containing the micro times corresponding to macro times. |
[in] | n_tac | The number of micro times. |
[in] | number_of_microtime_channels | The maximum number of TAC channels of the micro times. |
◆ make_fine_times()
static void CorrelatorPhotonStream::make_fine_times |
( |
unsigned long long * | t, |
|
|
unsigned int | n_times, |
|
|
unsigned short * | tac, |
|
|
unsigned int | n_tac ) |
|
static |
Make time events fine by adding micro time to macro time.
Changes the time events by adding the micro time to the macro time. The micro times should match the macro time, i.e., the length of the micro time array should be at least the same length as the macro time array.
- Parameters
-
[in,out] | t | An array containing the time events (macro times). |
[in] | n_times | The number of macro times. |
[in] | tac | An array containing the micro times corresponding to macro times. |
[in] | n_tac | The number of micro times. |
◆ mean_count_rate()
double CorrelatorPhotonStream::mean_count_rate |
( |
| ) |
|
Compute the mean count rate in the correlation stream.
- Returns
- The mean count rate in counts per macro time clock.
◆ resize()
void CorrelatorPhotonStream::resize |
( |
size_t | n, |
|
|
double | x = 1.0 ) |
|
inline |
Resize the CorrelatorPhotonStream.
Resizes the times and weights arrays to the specified size, setting the initial value of weights to the provided value.
- Parameters
-
n | The new size for the arrays. |
x | The initial value of the weights (default is 1.0). |
◆ set_events()
void CorrelatorPhotonStream::set_events |
( |
unsigned long long * | t, |
|
|
int | n_t, |
|
|
double * | weight, |
|
|
int | n_weight ) |
|
inline |
Set time events and weights.
Sets the time events and their corresponding weights based on provided arrays.
- Parameters
-
[in] | t | Array containing time events. |
[in] | n_t | Number of time events. |
[in] | weight | Array containing weights. |
[in] | n_weight | Number of weights. |
◆ set_time_axis_calibration()
void CorrelatorPhotonStream::set_time_axis_calibration |
( |
double | v | ) |
|
Set the time axis calibration.
The time axis calibration represents the duration between two sync signals (macro time clock).
- Parameters
-
v | The time axis calibration in seconds. |
◆ set_tttr()
void CorrelatorPhotonStream::set_tttr |
( |
std::shared_ptr< TTTR > | tttr, |
|
|
bool | make_fine = false ) |
Set the TTTR object for the CorrelatorPhotonStream.
Sets the TTTR object for the CorrelatorPhotonStream and optionally makes the time events fine by adding the micro time to the macro time.
- Parameters
-
tttr | The TTTR object to set. |
make_fine | If true, makes the time events fine by adding the micro time to the macro time. |
◆ set_weights()
void CorrelatorPhotonStream::set_weights |
( |
const std::map< short, std::vector< double > > & | filter, |
|
|
std::vector< unsigned int > | micro_times = std::vector< unsigned int >(), |
|
|
std::vector< signed char > | routing_channels = std::vector< signed char >() ) |
Set weights using a filter for time events.
The weights are set based on a filter map and optional micro times and routing channels.
- Parameters
-
[in] | filter | Map of filters. The first element in the map is the routing channel number, and the second element of the map is a vector that maps a micro time to a filter value. |
[in] | micro_times | Optional array containing micro times. |
[in] | routing_channels | Optional array containing routing channels. |
◆ size()
size_t CorrelatorPhotonStream::size |
( |
| ) |
const |
|
inline |
◆ sum_of_weights()
double CorrelatorPhotonStream::sum_of_weights |
( |
| ) |
|
Compute the sum of weights in the correlation stream.
- Returns
- The sum of weights in the correlation stream.
◆ Correlator
◆ time_axis_calibration
double CorrelatorPhotonStream::time_axis_calibration = 1.0 |
|
protected |
Time axis calibration is a factor that converts the time axsis of the time events to milliseconds. By default this value is set to 1.0 and the returned time axis is in units of the time events.
◆ times
std::vector<unsigned long long> CorrelatorPhotonStream::times |
The array containing the time points of the first correlation channel.
◆ tttr
std::shared_ptr<TTTR> CorrelatorPhotonStream::tttr = nullptr |
|
protected |
◆ weights
std::vector<double> CorrelatorPhotonStream::weights |
The array containing the weights of the first correlation channel.
The documentation for this class was generated from the following file: