Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInspiral 5.0.3.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInspiralValidTemplate.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 David Churches, Peter Shawhan, Thomas Cokelaer
3*
4* This program is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation; either version 2 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with with program; see the file COPYING. If not, write to the
16* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301 USA
18*/
19
20#include <lal/LALInspiralBank.h>
21#include <stdio.h>
22
23/**
24 * \ingroup LALInspiralBank_h
25 * \brief Function which checks whether or not a given template should be kept in the template list.
26 * \author Churches, D. K. and Sathyaprakash, B.S.
27 *
28 * ### Description ###
29 *
30 * Given the parameter values \f$\tau_{0}\f$ and \f$\tau_{2(3)}\f$ this code
31 * checks to see if they correspond to physical values of the masses of
32 * a binary and their symmetric mass ratio \f$\eta.\f$ The parameter values
33 * will be accepted as valid parameters {\em even though} they
34 * may not lie within the search space but their span does, as described below.
35 * At the moment the code allows extra templates only
36 * in the positive-\f$\tau_{2(3)}\f$ direction only. We have found
37 * that placing templates in other directions is redundant.
38 *
39 * ### Algorithm ###
40 *
41 * Consider the point \f$(\tau_0,\tau_{2(3)})\f$ describing the template, and
42 * also a point at \f$(\tau_0,\tau_{2(3)}\mbox{bankParams.dx1/2})\f$ ,
43 * <em>i.e.</em>\ displaced in the negative \f$\tau_{2(3)}\f$ direction.
44 * <tt>bankParams.dx1</tt> is calculated from the metric and corresponds
45 * to the vertical spacing between the horizontal rows of templates being
46 * considered.
47 * Accept the template if at least one of those points is within the search space.
48 */
49void
51 LALStatus *status, /**< LAL status pointer */
52 INT4 *valid, /**< [out] 0 means invalid template, 1 means valid */
53 InspiralBankParams bankParams, /**< [in] Input */
54 InspiralCoarseBankIn coarseIn /**< [in] Input */
55 )
56{
57
58
61
62 ASSERT( coarseIn.fLower > 0, status,
63 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
64
65 *valid = 0;
66 if ( bankParams.x0 <=0 || bankParams.x1 <=0 )
67 {
68 LALInfo( status, "x0 or x1 is less than or equal to zero" );
71 }
72
73 /* We have a valid template either if the template itself, or one */
74 /* of the vertices of the 'ambiguity rectangle', is in the region of */
75 /* interest */
76
77 LALInspiralValidParams( status->statusPtr, valid, bankParams, coarseIn );
79
80 if ( *valid == 1 )
81 {
84 }
85
86 bankParams.x1 = bankParams.x1 - bankParams.dx1/2.;
87
88 LALInspiralValidParams( status->statusPtr, valid, bankParams, coarseIn );
90
91 if ( *valid == 1 )
92 {
94 RETURN( status );
95 }
96
97#if 0
98 bankParams.x0 = bankParams.x0 - 2.*bankParams.dx0;
99 LALInspiralValidParams(status->statusPtr, valid, bankParams, coarseIn);
101 if (*valid == 1)
102 {
104 RETURN(status);
105 }
106 bankParams.x1 = bankParams.x1 + bankParams.dx1;
107 LALInspiralValidParams(status->statusPtr, valid, bankParams, coarseIn);
109 if (*valid == 1)
110 {
112 RETURN(status);
113 }
114 bankParams.x1 = bankParams.x1 - 2.*bankParams.dx1;
115 LALInspiralValidParams(status->statusPtr, valid, bankParams, coarseIn);
117 if (*valid == 1)
118 {
120 RETURN(status);
121 }
122#endif
123
125 RETURN( status );
126}
#define CHECKSTATUSPTR(statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
int32_t INT4
int LALInfo(LALStatus *status, const char *info)
void LALInspiralValidParams(LALStatus *status, INT4 *valid, InspiralBankParams bankParams, InspiralCoarseBankIn coarseIn)
Function which checks whether or not a pair of parameter values are consistent with the search space.
void LALInspiralValidTemplate(LALStatus *status, INT4 *valid, InspiralBankParams bankParams, InspiralCoarseBankIn coarseIn)
Function which checks whether or not a given template should be kept in the template list.
#define LALINSPIRALBANKH_ESIZE
Invalid input range.
This is a structure needed in the inner workings of the LALInspiralCreateCoarseBank code.
REAL8 x1
the second coordinate, chosen to be either or
REAL8 dx0
increment in the x0-direction
REAL8 dx1
increment in the x1-direction
REAL8 x0
the first coordinate, chosen to be always
Input for choosing a template bank.
REAL8 fLower
Lower frequency cutoff.