Commit e5e32ec5 authored by David Keitel's avatar David Keitel

HSGCT: fix logic for recomputing log10BSGLtL and toplist sorting

 -user options combination --getMaxFperSeg=0 --SortToplist>=4 now fail
 -log10BSGLtLr only computed and output if log10BSGLtL from main loop is present
  (i.e. for --getMaxFperSeg=1)
 -this makes combination --recalcToplistStats=1 --BSGLlogcorr=1 possible again
 -refs #5146
Original: ac6f6953552dc92d73480454d38ca86fb5e5f94a
parent f329e420
...@@ -636,6 +636,11 @@ int MAIN( int argc, char *argv[]) { ...@@ -636,6 +636,11 @@ int MAIN( int argc, char *argv[]) {
fprintf(stderr, "Toplist sorting by BSGL only possible if --computeBSGL given.\n"); fprintf(stderr, "Toplist sorting by BSGL only possible if --computeBSGL given.\n");
return( HIERARCHICALSEARCH_EBAD ); return( HIERARCHICALSEARCH_EBAD );
} }
if ( ( uvar_SortToplist == SORTBY_BSGLtL || uvar_SortToplist == SORTBY_BtSGLtL ||
uvar_SortToplist == SORTBY_TRIPLE_BStSGLtL ) && !uvar_getMaxFperSeg ) {
fprintf(stderr, "Toplist sorting by B[t]SGLtL only possible if --getMaxFperSeg given.\n");
return( HIERARCHICALSEARCH_EBAD );
}
/* create toplist -- semiCohToplist has the same structure /* create toplist -- semiCohToplist has the same structure
as a fstat candidate, so treat it as a fstat candidate */ as a fstat candidate, so treat it as a fstat candidate */
...@@ -1097,7 +1102,9 @@ int MAIN( int argc, char *argv[]) { ...@@ -1097,7 +1102,9 @@ int MAIN( int argc, char *argv[]) {
column_headings_string_length += 6 + 11 + numDetectors*9; /* 6 for " <2Fr>" and 9 per detector for " <2Fr_XY>" */ column_headings_string_length += 6 + 11 + numDetectors*9; /* 6 for " <2Fr>" and 9 per detector for " <2Fr_XY>" */
if ( uvar_computeBSGL) { if ( uvar_computeBSGL) {
column_headings_string_length += 11; /* for " log10BSGLr" */ column_headings_string_length += 11; /* for " log10BSGLr" */
column_headings_string_length += 13; /* for " log10BSGLtLr" */ if ( uvar_getMaxFperSeg ) {
column_headings_string_length += 13; /* for " log10BSGLtLr" */
}
} }
if (XLALUserVarWasSet(&uvar_f3dot)) { if (XLALUserVarWasSet(&uvar_f3dot)) {
column_headings_string_length += 1; column_headings_string_length += 1;
...@@ -1150,7 +1157,7 @@ int MAIN( int argc, char *argv[]) { ...@@ -1150,7 +1157,7 @@ int MAIN( int argc, char *argv[]) {
strcat ( column_headings_string, headingX ); strcat ( column_headings_string, headingX );
} }
} }
if ( uvar_computeBSGL) { if ( uvar_computeBSGL && uvar_getMaxFperSeg ) {
strcat ( column_headings_string, " log10BSGLtLr" ); strcat ( column_headings_string, " log10BSGLtLr" );
} }
} }
...@@ -1831,9 +1838,10 @@ int MAIN( int argc, char *argv[]) { ...@@ -1831,9 +1838,10 @@ int MAIN( int argc, char *argv[]) {
timing.RecalcMethodStr = XLALGetFstatInputMethodName ( recalcParams.Fstat_in_vec->data[0] ); timing.RecalcMethodStr = XLALGetFstatInputMethodName ( recalcParams.Fstat_in_vec->data[0] );
recalcParams.detectorIDs = usefulParams.detectorIDs; recalcParams.detectorIDs = usefulParams.detectorIDs;
recalcParams.startTstack = usefulParams.startTstack; recalcParams.startTstack = usefulParams.startTstack;
recalcParams.refTimeGPS = refTimeGPS; recalcParams.refTimeGPS = refTimeGPS;
recalcParams.BSGLsetup = usefulParams.BSGLsetup; recalcParams.BSGLsetup = usefulParams.BSGLsetup;
recalcParams.loudestSegOutput = uvar_loudestSegOutput; recalcParams.loudestSegOutput = uvar_loudestSegOutput;
recalcParams.computeBSGLtL = uvar_getMaxFperSeg;
XLAL_CHECK ( XLAL_SUCCESS == XLALComputeExtraStatsForToplist ( semiCohToplist, &recalcParams ), XLAL_CHECK ( XLAL_SUCCESS == XLALComputeExtraStatsForToplist ( semiCohToplist, &recalcParams ),
HIERARCHICALSEARCH_EXLAL, "XLALComputeExtraStatsForToplist() failed with xlalErrno = %d.\n\n", xlalErrno HIERARCHICALSEARCH_EXLAL, "XLALComputeExtraStatsForToplist() failed with xlalErrno = %d.\n\n", xlalErrno
); );
......
...@@ -104,6 +104,7 @@ int XLALComputeExtraStatsForToplist ( toplist_t *list, /**< list of cancidate ...@@ -104,6 +104,7 @@ int XLALComputeExtraStatsForToplist ( toplist_t *list, /**< list of cancidate
/* recalculate multi- and single-IFO Fstats for all segments for this candidate */ /* recalculate multi- and single-IFO Fstats for all segments for this candidate */
RecalcStatsComponents XLAL_INIT_DECL(recalcStats); /* struct containing multi-detector F-stat, single-detector F-stats, BSGL */ RecalcStatsComponents XLAL_INIT_DECL(recalcStats); /* struct containing multi-detector F-stat, single-detector F-stats, BSGL */
recalcStats.log10BSGL = -LAL_REAL4_MAX; /* proper initialization here is not 0 */ recalcStats.log10BSGL = -LAL_REAL4_MAX; /* proper initialization here is not 0 */
recalcStats.log10BSGLtL = -LAL_REAL4_MAX;
XLAL_CHECK ( XLALComputeExtraStatsSemiCoherent( &recalcStats, &candidateDopplerParams, recalcParams ) == XLAL_SUCCESS, XLAL_EFUNC, "Failed call to XLALComputeExtraStatsSemiCoherent()." ); XLAL_CHECK ( XLALComputeExtraStatsSemiCoherent( &recalcStats, &candidateDopplerParams, recalcParams ) == XLAL_SUCCESS, XLAL_EFUNC, "Failed call to XLALComputeExtraStatsSemiCoherent()." );
/* save values in toplist */ /* save values in toplist */
...@@ -258,8 +259,11 @@ int XLALComputeExtraStatsSemiCoherent ( RecalcStatsComponents *recalcStats, /** ...@@ -258,8 +259,11 @@ int XLALComputeExtraStatsSemiCoherent ( RecalcStatsComponents *recalcStats, /**
recalcStats->log10BSGL = XLALComputeBSGL ( sumTwoF, sumTwoFX, recalcParams->BSGLsetup ); recalcStats->log10BSGL = XLALComputeBSGL ( sumTwoF, sumTwoFX, recalcParams->BSGLsetup );
XLAL_CHECK ( xlalErrno == 0, XLAL_EFUNC, "XLALComputeBSGL() failed with xlalErrno = %d\n", xlalErrno ); XLAL_CHECK ( xlalErrno == 0, XLAL_EFUNC, "XLALComputeBSGL() failed with xlalErrno = %d\n", xlalErrno );
recalcStats->log10BSGLtL = XLALComputeBSGLtL ( sumTwoF, sumTwoFX, maxTwoFXl, recalcParams->BSGLsetup ); if ( recalcParams->computeBSGLtL )
XLAL_CHECK ( xlalErrno == 0, XLAL_EFUNC, "XLALComputeBSGLtL() failed with xlalErrno = %d\n", xlalErrno ); {
recalcStats->log10BSGLtL = XLALComputeBSGLtL ( sumTwoF, sumTwoFX, maxTwoFXl, recalcParams->BSGLsetup );
XLAL_CHECK ( xlalErrno == 0, XLAL_EFUNC, "XLALComputeBSGLtL() failed with xlalErrno = %d\n", xlalErrno );
}
} // if BSGLsetup != NULL } // if BSGLsetup != NULL
/* get average stats over all segments */ /* get average stats over all segments */
......
...@@ -70,6 +70,7 @@ typedef struct tagRecalcStatsParams { ...@@ -70,6 +70,7 @@ typedef struct tagRecalcStatsParams {
LIGOTimeGPSVector *startTstack; /**< starting GPS time of each stack */ LIGOTimeGPSVector *startTstack; /**< starting GPS time of each stack */
LIGOTimeGPS refTimeGPS; /**< reference time for fkdot values in toplist */ LIGOTimeGPS refTimeGPS; /**< reference time for fkdot values in toplist */
BSGLSetup *BSGLsetup; /**< pre-computed setup for line-robust statistic BSGL */ BSGLSetup *BSGLsetup; /**< pre-computed setup for line-robust statistic BSGL */
BOOLEAN computeBSGLtL; /**< re-compute BSGLtL as well, or not */
BOOLEAN loudestSegOutput; /**< return extra info about loudest segment */ BOOLEAN loudestSegOutput; /**< return extra info about loudest segment */
} RecalcStatsParams; } RecalcStatsParams;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment