Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInspiral 5.0.3.1-6c6b863
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInspiralValidParams.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 David Churches, Duncan Brown, Jolien Creighton, Peter Shawhan, B.S. Sathyaprakash, Craig Robinson , 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
21#include <lal/LALInspiralBank.h>
22#include <stdio.h>
23
24/**
25 * \ingroup LALInspiralBank_h
26 * \author Churches, D. K. and Sathyaprakash, B.S.
27 * \brief Function which checks whether or not a pair of parameter values are consistent with the search space.
28 *
29 * Module which checks whether or not a pair of parameter
30 * values \f$\tau_{0}\f$ and \f$\tau_{2(3)}\f$ correspond to
31 * a user specified range of component masses <tt>(mMin,mMax)</tt> OR to a
32 * minimum value of the component masses \c mMin and maximum total
33 * mass <tt>MMax.</tt> In the first case chirptimes satisfying the
34 * constraint \c mMin\f$\le m_1, m_2 \le\f$\c mMax are accepted
35 * as valid systems. In the second cases chirptimes satisfying the
36 * constraint \c mMin\f$\le m_1, m_2,\f$ and \c MMax\f$\le m=m_1+m_2\f$
37 * are treated as valid.
38 *
39 * ### Description ###
40 *
41 * We start with the definition of the chirp times \f$\tau_{0}\f$ and \f$\tau_{3}\f$,
42 * \f{equation}{
43 * \tau_{0} = \frac{5}{256 (\pi f_{a} )^{8/3} m^{5/3} \eta}
44 * \f}
45 * and
46 * \f{equation}{
47 * \tau_{3} = \frac{1}{8 (\pi^{2} f_{a}^{5} )^{1/3} m^{2/3} \eta}
48 * \f}
49 * These equations may be inverted to yield
50 * \f{equation}{
51 * m = \frac{5}{32 \pi^{2} f_{a}} \frac{\tau_{3}}{\tau_{0}}
52 * \f}
53 * and
54 * \f{equation}{
55 * \eta = \left( \frac{2 \pi^{2}}{25 f_{a}^{3}} \frac{\tau_{0}^{2}}{\tau_{3}^{1/3}}
56 * \right)^{5}\f}
57 *
58 * The individual masses may be calculated as follows. We have
59 * \f{equation}{
60 * \label{eq_mass}
61 * m = m_{1} + m_{2}
62 * \f}
63 * and
64 * \f{equation}{
65 * \label{eq_eta}
66 * \eta = \frac{m_{1} m_{2}}{(m_{1} + m_{2})^{2}}
67 * \f}
68 * From \eqref{eq_mass} we may eliminate either \f$m_{1}\f$ or \f$m_{2}\f$,
69 * \f{equation}{
70 * m_{1} = m - m_{2}
71 * \f}
72 * This may be substituted into \eqref{eq_eta} to give
73 * \f{equation}{
74 * \eta = \frac{(m - m_{2}) m_{2}}{\left[ (m - m_{2}) + m_{2} \right]^{2}}
75 * = \frac{(m - m_{2}) m_{2}}{m^{2}}
76 * \f}
77 * which may be re--arranged to give
78 * \f{equation}{
79 * m_{2}^{2} - m m_{2} + \eta m^{2} = 0,
80 * \f}
81 * i.e.
82 * \f{equation}{
83 * m_{2} = \frac{ m \pm \sqrt{m^{2}(1 - 4 \eta) }}{2}
84 * \f}
85 * Therefore, since we know that \f$\eta \leq 1/4\f$, real roots are guaranteed.
86 * If we had eliminated \f$m_{2}\f$ rather than \f$m_{1}\f$ then we would have arrived at an identical
87 * expression for
88 * \f$m_{1}\f$, and so of one object has mass
89 * \f{equation}{
90 * m_{1} = \frac{m + \sqrt{m^{2}(1-4 \eta)}}{2}
91 * \f}
92 * then the other object must have mass
93 * \f{equation}{
94 * m_{2} = \frac{m - \sqrt{m^{2}(1-4 \eta)}}{2}
95 * \f}
96 * This function is also given \c mMin and \c MMax as inputs, which it may
97 * use to calculate the minimum value of \f$\eta\f$ which is possible with those inputs,
98 * \f{equation}{
99 * \eta_{min} = \mathtt{ \frac{mMin(MMax - mMin)}{MMax^{2}} }
100 * \f}
101 *
102 * To recap, the function calculates \f$m\f$, \f$\eta\f$, \f$\eta_{min}\f$ and \f$m_{1,2}\f$.
103 * It then checks that
104 * \f{equation}{
105 * \eta_{min} \leq \eta \leq 1/4
106 * \f}
107 * and that
108 * \f{equation}{
109 * m_{1} \geq \mathtt{mMin}
110 * \f}
111 * and
112 * \f{equation}{
113 * m_{2} \geq \mathtt{mMin}
114 * \f}
115 */
117 LALStatus *status, /**< LAL status pointer */
118 INT4 *valid, /**< [out] 0 means invalid template, 1 means valid */
119 InspiralBankParams bankParams, /**< [in] Input */
120 InspiralCoarseBankIn coarseIn /**< [in] Input */
121 )
122
123{
124
125 InspiralTemplate *Pars=NULL;
126
129
130 ASSERT( coarseIn.fLower > 0.L, status,
131 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
132
133 *valid = 0;
134
135 if ( bankParams.x0 <=0 || bankParams.x1 <=0 )
136 {
137 LALInfo( status, "x0 or x1 are less than or equal to zero" );
139 RETURN( status );
140 }
141
142 Pars = (InspiralTemplate *) LALCalloc( 1, sizeof(InspiralTemplate) );
143 if ( ! Pars )
144 {
145 ABORT (status, LALINSPIRALBANKH_EMEM, LALINSPIRALBANKH_MSGEMEM);
146 }
147
148 /* First set the chirp times of Pars to be as in bankParams */
149 Pars->t0 = bankParams.x0;
150 Pars->fLower = coarseIn.fLower;
151 switch ( coarseIn.space )
152 {
153 case Tau0Tau2:
154 Pars->t2 = bankParams.x1;
155 Pars->massChoice = t02;
156 break;
157 case Tau0Tau3:
158 Pars->t3 = bankParams.x1;
159 Pars->massChoice = t03;
160 break;
161 default:
162 ABORT( status, LALINSPIRALBANKH_ECHOICE, LALINSPIRALBANKH_MSGECHOICE );
163 }
164
165 /* Compute all the parameters, including masses, */
166 /* corresponding to (t0,t2/t3) */
167 LALInspiralParameterCalc( status->statusPtr, Pars );
169
170 /* If the masses are in the correct range accept as valid parameters */
171 switch (coarseIn.massRange)
172 {
174 if (
175 Pars->mass1 >= coarseIn.mMin &&
176 Pars->mass2 >= coarseIn.mMin &&
177 Pars->totalMass <= coarseIn.MMax &&
178 Pars->eta <= 0.25 &&
179 Pars->eta >= coarseIn.etamin
180 )
181 {
182 *valid = 1;
183 }
184 break;
185
187 if (
188 Pars->mass1 >= coarseIn.mMin &&
189 Pars->mass2 >= coarseIn.mMin &&
190 Pars->mass1 <= coarseIn.mMax &&
191 Pars->mass2 <= coarseIn.mMax &&
192 Pars->eta <= 0.25 &&
193 Pars->eta >= coarseIn.etamin
194 )
195 {
196 *valid = 1;
197 }
198 break;
199
201 if (
202 Pars->mass1 >= coarseIn.mMin &&
203 Pars->mass2 >= coarseIn.mMin &&
204 Pars->totalMass <= coarseIn.MMax &&
205 Pars->totalMass >= coarseIn.MMin &&
206 Pars->eta <= 0.25 &&
207 Pars->eta >= coarseIn.etamin
208 )
209 {
210 *valid = 1;
211 }
212 break;
213
214 default:
215 ABORT(status, 999, "Invalid choice for enum InspiralBankMassRange");
216 }
217
218 LALFree( Pars );
219
221 RETURN( status );
222}
void LALInspiralParameterCalc(LALStatus *status, InspiralTemplate *params)
#define LALCalloc(m, n)
#define LALFree(p)
#define ABORT(statusptr, code, mesg)
#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)
@ t03
chirptimes and , and
Definition: LALInspiral.h:185
@ t02
chirptimes and
Definition: LALInspiral.h:184
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.
#define LALINSPIRALBANKH_ECHOICE
Invalid choice for an input parameter.
#define LALINSPIRALBANKH_ESIZE
Invalid input range.
#define LALINSPIRALBANKH_EMEM
Memory allocation failure.
@ MinMaxComponentTotalMass
@ MinMaxComponentMass
@ MinComponentMassMaxTotalMass
@ Tau0Tau2
space of chirptimes
@ Tau0Tau3
space of chirptimes
This is a structure needed in the inner workings of the LALInspiralCreateCoarseBank code.
REAL8 x1
the second coordinate, chosen to be either or
REAL8 x0
the first coordinate, chosen to be always
Input for choosing a template bank.
REAL8 mMin
minimum mass of components to search for
REAL8 mMax
maximum mass of components to search for
InspiralBankMassRange massRange
enum that determines whether templates should be chosen using fixed ranges for component masses or to...
REAL8 MMax
alternatively, maximum total mass of binary to search for
REAL8 etamin
minimum value of eta in our search
REAL8 fLower
Lower frequency cutoff.
CoordinateSpace space
enum that decides whether to use or in constructing the template bank
REAL8 MMin
UNDOCUMENTED.
The inspiral waveform parameter structure containing information about the waveform to be generated.
Definition: LALInspiral.h:205
REAL8 t2
first post-Newtonian chirp time in seconds (input/output)
Definition: LALInspiral.h:295
REAL8 eta
symmetric mass ratio (input/output)
Definition: LALInspiral.h:291
REAL8 totalMass
total mass of the binary in solar mass (input/output)
Definition: LALInspiral.h:292
REAL8 mass1
Mass of the primary in solar mass (input/output)
Definition: LALInspiral.h:211
REAL8 t3
1.5 post-Newtonian chirp time in seconds (input/output)
Definition: LALInspiral.h:296
REAL8 t0
Newtonain chirp time in seconds (input/output)
Definition: LALInspiral.h:294
REAL8 mass2
Mass of the secondary in solar mass (mass1 need not be larger than mass2 (input/output)
Definition: LALInspiral.h:212
InputMasses massChoice
The pair of (mass) parameters given (see structure defining this member for more details) (input)
Definition: LALInspiral.h:323
REAL8 fLower
lower frequency cutoff of the detector in Hz (input)
Definition: LALInspiral.h:217