28#include <lal/LALString.h>
44#define ENTRY_NONE WEAVE_STATISTIC_NONE, "none", " ", 0, \
45 "No statistic selected"
47#define ENTRY_COH2F WEAVE_STATISTIC_COH2F, "coh2F", " ", 0, \
48 "Per-segment multi-detector coherent 2F statistic"
50#define ENTRY_COH2F_DET WEAVE_STATISTIC_COH2F_DET, "coh2F_det", " ", 0, \
51 "Per-segment per-detector coherent 2F statistic"
53#define ENTRY_MAX2F WEAVE_STATISTIC_MAX2F, "max2F", " ", WEAVE_STATISTIC_COH2F, \
54 "Maximum over segments multi-detector coherent 2F statistic"
56#define ENTRY_MAX2F_DET WEAVE_STATISTIC_MAX2F_DET, "max2F_det", " ", WEAVE_STATISTIC_COH2F_DET, \
57 "Maximum over segments per-detector coherent 2F statistic"
59#define ENTRY_SUM2F WEAVE_STATISTIC_SUM2F, "sum2F", " ", WEAVE_STATISTIC_COH2F, \
60 "Sum over segments of multi-detector coherent 2F statistic"
62#define ENTRY_SUM2F_DET WEAVE_STATISTIC_SUM2F_DET, "sum2F_det", " ", WEAVE_STATISTIC_COH2F_DET, \
63 "Sum over segments of single-detector coherent 2F statistic"
65#define ENTRY_MEAN2F WEAVE_STATISTIC_MEAN2F, "mean2F", " ", WEAVE_STATISTIC_SUM2F, \
66 "Average over segments of multi-detector coherent 2F statistic"
68#define ENTRY_MEAN2F_DET WEAVE_STATISTIC_MEAN2F_DET, "mean2F_det", " ", WEAVE_STATISTIC_SUM2F_DET, \
69 "Average over segments of single-detector coherent 2F statistic"
71#define ENTRY_BSGL WEAVE_STATISTIC_BSGL, "log10BSGL", " ", WEAVE_STATISTIC_SUM2F|WEAVE_STATISTIC_SUM2F_DET, \
72 "Bayes factor 'Signal' vs 'Gaussian noise' or 'Line'"
74#define ENTRY_BSGLtL WEAVE_STATISTIC_BSGLtL, "log10BSGLtL", " ", WEAVE_STATISTIC_SUM2F|WEAVE_STATISTIC_SUM2F_DET|WEAVE_STATISTIC_MAX2F_DET, \
75 "Bayes factor 'Signal' vs 'Gaussian noise' or 'Line' or 'transient Line'."
77#define ENTRY_BtSGLtL WEAVE_STATISTIC_BtSGLtL, "log10BtSGLtL", " ", WEAVE_STATISTIC_MAX2F|WEAVE_STATISTIC_SUM2F_DET|WEAVE_STATISTIC_MAX2F_DET, \
78 "Bayes factor 'transient Signal' vs 'Gaussian noise' or 'Line' or 'transient Line'."
80#define ENTRY_NCOUNT WEAVE_STATISTIC_NCOUNT, "ncount", " ", WEAVE_STATISTIC_COH2F, \
81 "Multi-detector 'Hough' number count of 'threshold crossings' heavyside(2F - 2Fth) over segments"
83#define ENTRY_NCOUNT_DET WEAVE_STATISTIC_NCOUNT_DET, "ncount_det", " ", WEAVE_STATISTIC_COH2F_DET, \
84 "Per-detector 'Hough' number count of 'threshold crossings' heavyside(2F - 2Fth) over segments"
86#define ENTRY_2_NAME(X) ENTRY_2_NAME_X(X)
87#define ENTRY_2_NAME_X(v,n,s,d,h) [XLAL_BIT2IDX(v)] = n
89#define ENTRY_2_MAP(X) ENTRY_2_MAP_X(X)
90#define ENTRY_2_MAP_X(v,n,s,d,h) { .val = v, .name = n, .dependencies = d, .help = h }
92#define ENTRY_2_CHOICES(X) ENTRY_2_CHOICES_X(X)
93#define ENTRY_2_CHOICES_X(v,n,s,d,h) { .val = v, .name = n }
95#define ENTRY_2_HELPSTR(X) ENTRY_2_HELPSTR_X(X)
96#define ENTRY_2_HELPSTR_X(v,n,s,d,h) " - " n s ": " h ".\n"
134#define SUPPORTED_STATISTICS ( \
136 | WEAVE_STATISTIC_COH2F \
137 | WEAVE_STATISTIC_COH2F_DET \
138 | WEAVE_STATISTIC_MAX2F \
139 | WEAVE_STATISTIC_MAX2F_DET \
140 | WEAVE_STATISTIC_SUM2F \
141 | WEAVE_STATISTIC_SUM2F_DET \
142 | WEAVE_STATISTIC_MEAN2F \
143 | WEAVE_STATISTIC_MEAN2F_DET \
144 | WEAVE_STATISTIC_BSGL \
145 | WEAVE_STATISTIC_BSGLtL \
146 | WEAVE_STATISTIC_BtSGLtL \
147 | WEAVE_STATISTIC_NCOUNT \
148 | WEAVE_STATISTIC_NCOUNT_DET \
184#define SUPPORTED_TOPLISTS ( \
186 | WEAVE_STATISTIC_MEAN2F \
187 | WEAVE_STATISTIC_SUM2F \
188 | WEAVE_STATISTIC_BSGL \
189 | WEAVE_STATISTIC_BSGLtL \
190 | WEAVE_STATISTIC_BtSGLtL \
236 WeaveStatisticsParams *statistics_params,
255 prev_stats_to_compute = stats_to_compute;
256 prev_mainloop_stats = mainloop_stats;
261 }
while ( ( prev_stats_to_compute != stats_to_compute ) && ( prev_mainloop_stats != mainloop_stats ) );
272 WeaveStatisticType completionloop_stats_stage0 = stats_to_compute & ( ~mainloop_stats );
281 mainloop_stats_to_keep |= ( mainloop_stats & stage0_stats_to_output );
286 mainloop_stats_to_keep |= ( mainloop_stats & completionloop_stage0_deps );
292 prev_recalc_stats_deps = recalc_stats_deps;
294 }
while ( prev_recalc_stats_deps != recalc_stats_deps );
296 stats_to_compute |= recalc_stats_deps;
299 statistics_params->toplist_statistics = toplist_stats;
300 statistics_params->statistics_to_output[0] = stage0_stats_to_output;
301 statistics_params->statistics_to_output[1] = recalc_stats;
303 statistics_params->mainloop_statistics = mainloop_stats;
304 statistics_params->mainloop_statistics_to_keep = mainloop_stats_to_keep;
305 statistics_params->completionloop_statistics[0] = completionloop_stats_stage0;
306 statistics_params->completionloop_statistics[1] = recalc_stats_deps;
308 statistics_params->all_statistics_to_compute = stats_to_compute;
311 statistics_params->ntoplists = 0;
313 if ( statistics_params->toplist_statistics &
XLAL_IDX2BIT( idx ) ) {
314 ++statistics_params->ntoplists;
326 WeaveStatisticsParams *statistics_params
329 if ( statistics_params == NULL ) {
335 if ( statistics_params->coh_input != NULL ) {
336 for (
size_t i = 0;
i < statistics_params->nsegments; ++
i ) {
339 XLALFree( statistics_params->coh_input );
341 if ( statistics_params->coh_input_recalc != NULL ) {
342 for (
size_t i = 0;
i < statistics_params->nsegments; ++
i ) {
345 XLALFree( statistics_params->coh_input_recalc );
void XLALWeaveCohResultsDestroy(WeaveCohResults *coh_res)
Destroy coherent results.
void XLALWeaveCohInputDestroy(WeaveCohInput *coh_input)
Destroy coherent input data.
Module which computes coherent and semicoherent results.
enum tagWeaveStatisticType WeaveStatisticType
const WeaveStatisticMap statistic_map[]
Array of descriptor structs for all statistics supported by Weave.
#define SUPPORTED_TOPLISTS
#define ENTRY_2_CHOICES(X)
const char *const WeaveStatisticNamesByIndex[XLAL_BIT2IDX(WEAVE_STATISTIC_MAX)]
#define SUPPORTED_STATISTICS
int XLALWeaveStatisticsParamsSetDependencyMap(WeaveStatisticsParams *statistics_params, const WeaveStatisticType toplist_stats, const WeaveStatisticType extra_output_stats, const WeaveStatisticType recalc_stats)
Fill StatisticsParams logic for given toplist and extra-output stats.
int XLALWeaveStatisticsSetDirectDependencies(WeaveStatisticType *deps, const WeaveStatisticType stats)
Set all bits in 'deps' corresponding to direct dependencies of the set of input statistics 'stat'.
const char *const WeaveToplistHelpString
User input help string for toplist ranking statistics.
#define ENTRY_NONE
Sets of toplists, extra statistics and dependencies handled by this code.
const UserChoices WeaveToplistChoices
User input choices for toplist ranking statistics.
const char *const WeaveStatisticHelpString
User input help string for all supported statistics.
const UserChoices WeaveStatisticChoices
User input choices for all supported statistics.
void XLALWeaveStatisticsParamsDestroy(WeaveStatisticsParams *statistics_params)
Destroy a StatisticsParams struct.
@ WEAVE_STATISTIC_COH2F
Per segment multi-detector F-statistic.
@ WEAVE_STATISTIC_COH2F_DET
Per segment per-detector F-statistic.
@ WEAVE_STATISTIC_MAX
Marker +1 of maximal combined valid statistics value.
void XLALDestroyBSGLSetup(BSGLSetup *setup)
void XLALDestroyStringVector(LALStringVector *vect)
#define XLAL_CHECK(assertion,...)
Struct defining the global 'statistics map' that contains all the defining properties of the supporte...
WeaveStatisticType val
bitflag value for this statistic
const char *const name
internal name of this statistics
WeaveStatisticType dependencies
set of direct input dependencies of this statistic
const char *const help
help string explaining this statistic