LALInspiralValidParams.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 David Churches, Duncan Brown, Jolien Creighton, Peter Shawhan, B.S. Sathyaprakash, Craig Robinson , Thomas Cokelaer
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 /* <lalVerbatim file="LALInspiralValidParamsCV">
00021 Author: Churches, D. K. and Sathyaprakash, B.S.
00022 $Id: LALInspiralValidParams.c,v 1.16 2007/06/08 14:41:42 bema Exp $
00023 </lalVerbatim>  */
00024 
00025 
00026 /*  <lalLaTeX>
00027 
00028 \subsection{Module \texttt{LALInspiralValidParams.c}}
00029 Module which checks whether or not a pair of parameter 
00030 values are consistent with the search space.
00031 
00032 \subsubsection*{Prototypes}
00033 \vspace{0.1in}
00034 \input{LALInspiralValidParamsCP}
00035 \idx{LALInspiralValidParams()}
00036 \begin{itemize}
00037    \item \texttt{valid,} Output, 0 means invalid template, 1 means valid
00038    \item \texttt{bankParams,} Input
00039    \item \texttt{coarseIn,} Input
00040 \end{itemize}
00041 
00042 Module which checks whether or not a pair of parameter 
00043 values $\tau_{0}$ and $\tau_{2(3)}$ correspond to
00044 a user specified range of component masses \texttt{(mMin,mMax)} OR to a
00045 minimum value of the component masses \texttt{mMin} and maximum total
00046 mass \texttt{MMax.} In the first case chirptimes satisfying the
00047 constraint \texttt{mMin}~$\le m_1, m_2 \le$~\texttt{mMax} are accepted
00048 as valid systems. In the second cases chirptimes satisfying the
00049 constraint \texttt{mMin}~$\le m_1, m_2,$ and \texttt{MMax}$\le m=m_1+m_2$
00050 are treated as valid. 
00051 
00052 \subsubsection*{Description}
00053 
00054 We start with the definition of the chirp times $\tau_{0}$ and $\tau_{3}$,
00055 \begin{equation}
00056 \tau_{0} = \frac{5}{256 (\pi f_{a} )^{8/3} m^{5/3} \eta}
00057 \end{equation}
00058 and
00059 \begin{equation}
00060 \tau_{3} = \frac{1}{8 (\pi^{2} f_{a}^{5} )^{1/3} m^{2/3} \eta}
00061 \end{equation}
00062  These equations may be inverted to yield
00063 \begin{equation}
00064 m = \frac{5}{32 \pi^{2} f_{a}} \frac{\tau_{3}}{\tau_{0}}
00065 \end{equation}
00066 and
00067 \begin{equation}
00068 \eta = \left( \frac{2 \pi^{2}}{25 f_{a}^{3}} \frac{\tau_{0}^{2}}{\tau_{3}^{1/3}}
00069 \right)^{5}\end{equation}
00070 
00071 The individual masses may be calculated as follows.  We have
00072 \begin{equation}
00073 m = m_{1} + m_{2}
00074 \label{mass}
00075 \end{equation}
00076 and
00077 \begin{equation}
00078 \eta = \frac{m_{1} m_{2}}{(m_{1} + m_{2})^{2}}
00079 \label{eta}
00080 \end{equation}
00081 From Eq.(\ref{mass}) we may eliminate either $m_{1}$ or $m_{2}$,
00082 \begin{equation}
00083 m_{1} = m - m_{2}
00084 \end{equation}
00085 This may be substituted into Eq.(\ref{eta}) to give
00086 \begin{equation}
00087 \eta = \frac{(m - m_{2}) m_{2}}{\left[ (m - m_{2}) + m_{2} \right]^{2}}
00088      = \frac{(m - m_{2}) m_{2}}{m^{2}}
00089 \end{equation}
00090 which may be re--arranged to give
00091 \begin{equation}
00092 m_{2}^{2} - m m_{2} + \eta m^{2} = 0,
00093 \end{equation}
00094 i.e.\
00095 \begin{equation}
00096 m_{2} = \frac{ m \pm \sqrt{m^{2}(1 - 4 \eta) }}{2}
00097 \end{equation}
00098 Therefore, since we know that $\eta \leq 1/4$, real roots are guaranteed.
00099 If we had eliminated $m_{2}$ rather than $m_{1}$ then we would have arrived at an identical
00100 expression for
00101 $m_{1}$, and so of one object has mass
00102 \begin{equation}
00103 m_{1} = \frac{m + \sqrt{m^{2}(1-4 \eta)}}{2}
00104 \end{equation}
00105 then the other object must have mass
00106 \begin{equation}
00107 m_{2} = \frac{m - \sqrt{m^{2}(1-4 \eta)}}{2}
00108 \end{equation}
00109 This function is also given \texttt{mMin} and \texttt{MMax} as inputs, which it may 
00110 use to calculate the minimum value of $\eta$ which is possible with those inputs,
00111 \begin{equation}
00112 \eta_{min} = \mathtt{ \frac{mMin(MMax - mMin)}{MMax^{2}} }
00113 \end{equation}
00114 
00115 To recap, the function calculates $m$, $\eta$, $\eta_{min}$ and $m_{1,2}$.
00116 It then checks that
00117 \begin{equation}
00118 \eta_{min} \leq \eta \leq 1/4
00119 \end{equation}
00120 and that
00121 \begin{equation}
00122 m_{1} \geq \mathtt{mMin}
00123 \end{equation}
00124 and
00125 \begin{equation}
00126 m_{2} \geq \mathtt{mMin}
00127 \end{equation}
00128 
00129 \subsubsection*{Algorithm}
00130 
00131 \subsubsection*{Uses}
00132 
00133 \subsubsection*{Notes}
00134 
00135 \vfill{\footnotesize\input{LALInspiralValidParamsCV}}
00136 
00137 </lalLaTeX>  */
00138 
00139 
00140 #include <lal/LALInspiralBank.h>
00141 #include <stdio.h>
00142 
00143 NRCSID (LALINSPIRALVALIDPARAMSC, "$Id: LALInspiralValidParams.c,v 1.16 2007/06/08 14:41:42 bema Exp $");
00144 
00145 /*  <lalVerbatim file="LALInspiralValidParamsCP">  */
00146 
00147 void LALInspiralValidParams(
00148     LALStatus            *status,
00149     INT4                 *valid,
00150     InspiralBankParams   bankParams, 
00151     InspiralCoarseBankIn coarseIn
00152     )
00153 /* </lalVerbatim> */
00154 {
00155 
00156   InspiralTemplate *Pars=NULL;
00157 
00158   INITSTATUS( status, "LALInspiralValidParams", LALINSPIRALVALIDPARAMSC );
00159   ATTATCHSTATUSPTR( status );
00160   
00161   ASSERT( coarseIn.fLower > 0.L, status, 
00162       LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
00163 
00164   *valid = 0;
00165 
00166   if ( bankParams.x0 <=0 || bankParams.x1 <=0 )
00167   {
00168     LALInfo( status, "x0 or x1 are less than or equal to zero" );
00169     DETATCHSTATUSPTR( status );
00170     RETURN( status );
00171   }
00172 
00173   Pars = (InspiralTemplate *) LALCalloc( 1, sizeof(InspiralTemplate) );
00174   if ( ! Pars )
00175   {
00176     ABORT (status, LALINSPIRALBANKH_EMEM, LALINSPIRALBANKH_MSGEMEM);
00177   }
00178 
00179   /* First set the chirp times of Pars to be as in bankParams */
00180   Pars->t0 = bankParams.x0;
00181   Pars->fLower = coarseIn.fLower;
00182   switch ( coarseIn.space ) 
00183   {
00184     case Tau0Tau2:
00185       Pars->t2 = bankParams.x1;
00186       Pars->massChoice = t02;
00187       break;
00188     case Tau0Tau3:
00189       Pars->t3 = bankParams.x1;
00190       Pars->massChoice = t03;
00191       break;
00192     default:
00193       ABORT( status, LALINSPIRALBANKH_ECHOICE, LALINSPIRALBANKH_MSGECHOICE );
00194   }
00195 
00196   /* Compute all the parameters, including masses, */
00197   /* corresponding to (t0,t2/t3)                   */
00198   LALInspiralParameterCalc( status->statusPtr, Pars );
00199   CHECKSTATUSPTR( status );
00200 
00201   /* If the masses are in the correct range accept as valid parameters */
00202   switch (coarseIn.massRange) 
00203   {
00204     case MinComponentMassMaxTotalMass:
00205       if (
00206           Pars->mass1 >= coarseIn.mMin &&
00207           Pars->mass2 >= coarseIn.mMin &&
00208           Pars->totalMass <= coarseIn.MMax &&
00209           Pars->eta <= 0.25 && 
00210           Pars->eta >= coarseIn.etamin
00211          ) 
00212       {
00213         *valid = 1;
00214       }
00215       break;
00216     
00217     case MinMaxComponentMass:
00218       if (
00219           Pars->mass1 >= coarseIn.mMin &&
00220           Pars->mass2 >= coarseIn.mMin &&
00221           Pars->mass1 <= coarseIn.mMax &&
00222           Pars->mass2 <= coarseIn.mMax &&
00223           Pars->eta <= 0.25 && 
00224           Pars->eta >= coarseIn.etamin
00225          ) 
00226       {
00227         *valid = 1;
00228       }
00229       break;
00230 
00231     case MinMaxComponentTotalMass:
00232       if (
00233           Pars->mass1 >= coarseIn.mMin &&
00234           Pars->mass2 >= coarseIn.mMin &&
00235           Pars->totalMass <= coarseIn.MMax &&
00236           Pars->totalMass >= coarseIn.MMin &&
00237           Pars->eta <= 0.25 &&
00238           Pars->eta >= coarseIn.etamin
00239          )
00240       {
00241         *valid = 1;
00242       }
00243       break;
00244       
00245     default:
00246       ABORT(status, 999, "Invalid choice for enum InspiralBankMassRange");
00247   }
00248 
00249   LALFree( Pars );
00250 
00251   DETATCHSTATUSPTR( status );
00252   RETURN( status );
00253 }

Generated on Sun Oct 12 02:32:06 2008 for LAL by  doxygen 1.5.2