1#ifndef TTTRLIB_CORRELATORPHOTONSTREAM_H
2#define TTTRLIB_CORRELATORPHOTONSTREAM_H
25 std::shared_ptr<TTTR>
tttr =
nullptr;
50 std::vector<unsigned long long>
times;
94 void resize(
size_t n,
double x = 1.0){
113 unsigned long long *t,
unsigned int n_times,
131 unsigned short *tac,
int n_tac,
132 unsigned int number_of_microtime_channels
147 const std::map<
short, std::vector<double>>& filter,
148 std::vector<unsigned int> micro_times = std::vector<unsigned int>(),
149 std::vector<signed char> routing_channels = std::vector<signed char>()
163 unsigned long long *t,
int n_t,
164 double* weight,
int n_weight
166 resize(std::min(n_t, n_weight));
167 for(
size_t i = 0; i <
size();i++){
187 unsigned long long dt();
Definition Correlator.h:21
CorrelatorPhotonStream class gathers event times and weights.
Definition CorrelatorPhotonStream.h:14
double sum_of_weights()
Compute the sum of weights in the correlation stream.
void set_events(unsigned long long *t, int n_t, double *weight, int n_weight)
Set time events and weights.
Definition CorrelatorPhotonStream.h:162
void set_time_axis_calibration(double v)
Set the time axis calibration.
bool empty() const
Check if the CorrelatorPhotonStream is empty.
Definition CorrelatorPhotonStream.h:62
std::shared_ptr< TTTR > tttr
Definition CorrelatorPhotonStream.h:25
std::vector< unsigned long long > times
The array containing the time points of the first correlation channel.
Definition CorrelatorPhotonStream.h:50
std::vector< double > weights
The array containing the weights of the first correlation channel.
Definition CorrelatorPhotonStream.h:55
std::shared_ptr< TTTR > get_tttr() const
Get the TTTR object associated with the CorrelatorPhotonStream.
Definition CorrelatorPhotonStream.h:240
size_t size() const
Get the size of the CorrelatorPhotonStream.
Definition CorrelatorPhotonStream.h:71
CorrelatorPhotonStream(const CorrelatorPhotonStream &a)
Copy constructor for CorrelatorPhotonStream.
Definition CorrelatorPhotonStream.h:39
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 clear()
Clear the CorrelatorPhotonStream.
Definition CorrelatorPhotonStream.h:80
double mean_count_rate()
Compute the mean count rate in the correlation stream.
void resize(size_t n, double x=1.0)
Resize the CorrelatorPhotonStream.
Definition CorrelatorPhotonStream.h:94
double get_time_axis_calibration() const
Get the calibration of the time axis.
Definition CorrelatorPhotonStream.h:220
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_tttr(std::shared_ptr< TTTR > tttr, bool make_fine=false)
Set the TTTR object for the CorrelatorPhotonStream.
CorrelatorPhotonStream()=default
Default constructor for CorrelatorPhotonStream.
void coarsen()
Coarsen the time events.
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.
double time_axis_calibration
Definition CorrelatorPhotonStream.h:23
~CorrelatorPhotonStream()=default
Default destructor for CorrelatorPhotonStream.
unsigned long long dt()
Compute the time difference in macro time units between the first and last event.