LALInspiralValidTemplate.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 David Churches, Peter Shawhan, 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="LALInspiralValidTemplateCV">
00021 Author: Churches, D. K. and Sathyaprakash, B.S.
00022 $Id: LALInspiralValidTemplate.c,v 1.6 2007/06/08 14:41:42 bema Exp $
00023 </lalVerbatim>  */
00024 
00025 
00026 /*  <lalLaTeX>
00027 
00028 \subsection{Module \texttt{LALInspiralValidTemplate.c}}
00029 
00030 Module which checks whether or not a given template should
00031 be kept in the template list.
00032 
00033 \subsubsection*{Prototypes}
00034 \vspace{0.1in}
00035 \input{LALInspiralValidTemplateCP}
00036 \index{\verb&LALInspiralValidTemplate()&}
00037 \begin{itemize}
00038    \item \texttt{valid,} Output, 0 means invalid template, 1 means valid
00039    \item \texttt{bankParams,} Input
00040    \item \texttt{coarseIn,} Input
00041 \end{itemize}
00042 
00043 \subsubsection*{Description}
00044 Given the parameter values $\tau_{0}$ and $\tau_{2(3)}$ this code 
00045 checks to see if they correspond to physical values of the masses of 
00046 a binary and their symmetric mass ratio $\eta.$ The parameter values
00047 will be accepted as valid parameters {\em even though} they
00048 may not lie within the search space but their span does, as described below.
00049 At the moment the code allows extra templates only
00050 in the positive-$\tau_{2(3)}$ direction only. We have found
00051 that placing templates in other directions is redundant.
00052 
00053 
00054 \subsubsection*{Algorithm}
00055 %-- The following is not an accurate description of the current algorithm:
00056 %Compute the coordinates at the corners of the ambiguity rectangle.
00057 %Accept if at least one of those points corresponds to the search space.
00058 
00059 Consider the point $(\tau_0,\tau_{2(3)})$ describing the template, and
00060 also a point at $(\tau_0,\tau_{2(3)}$$-$$\mbox{\texttt{bankParams.dx1/2}})$ ,
00061 {\it i.e.}\ displaced in the negative $\tau_{2(3)}$ direction.
00062 \texttt{bankParams.dx1} is calculated from the metric and corresponds
00063 to the vertical spacing between the horizontal rows of templates being
00064 considered.
00065 Accept the template if at least one of those points is within the search space.
00066 
00067 \subsubsection*{Uses}
00068 
00069 \subsubsection*{Notes}
00070 
00071 \vfill{\footnotesize\input{LALInspiralValidTemplateCV}}
00072 
00073 </lalLaTeX>  */
00074 
00075 
00076 #include <lal/LALInspiralBank.h>
00077 #include <stdio.h>
00078 
00079 NRCSID (LALINSPIRALVALIDTEMPLATEC, "$Id: LALInspiralValidTemplate.c,v 1.6 2007/06/08 14:41:42 bema Exp $");
00080 
00081 /*  <lalVerbatim file="LALInspiralValidTemplateCP">  */
00082 
00083 void 
00084 LALInspiralValidTemplate(
00085   LALStatus            *status,
00086   INT4                 *valid,
00087   InspiralBankParams   bankParams, 
00088   InspiralCoarseBankIn coarseIn)
00089 {  /*  </lalVerbatim>  */
00090 
00091 
00092   INITSTATUS( status, "LALInspiralValidTemplate", LALINSPIRALVALIDTEMPLATEC );
00093   ATTATCHSTATUSPTR( status );
00094   
00095   ASSERT( coarseIn.fLower > 0, status, 
00096       LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
00097 
00098   *valid = 0;
00099   if ( bankParams.x0 <=0 || bankParams.x1 <=0 )
00100   {
00101     LALInfo( status, "x0 or x1 is less than or equal to zero" );
00102     DETATCHSTATUSPTR(status);
00103     RETURN(status);
00104   }
00105   
00106   /* We have a valid template either if the template itself, or one     */
00107   /* of the vertices of the 'ambiguity rectangle', is in the region of  */
00108   /* interest                                                           */
00109 
00110   LALInspiralValidParams( status->statusPtr, valid, bankParams, coarseIn ); 
00111   CHECKSTATUSPTR( status );
00112 
00113   if ( *valid == 1 ) 
00114   {
00115     DETATCHSTATUSPTR(status);
00116     RETURN(status);
00117   }
00118 
00119   bankParams.x1 = bankParams.x1 - bankParams.dx1/2.;
00120   
00121   LALInspiralValidParams( status->statusPtr, valid, bankParams, coarseIn ); 
00122   CHECKSTATUSPTR( status );
00123   
00124   if ( *valid == 1 ) 
00125   {
00126     DETATCHSTATUSPTR( status );
00127     RETURN( status );
00128   }
00129 
00130 #if 0
00131   bankParams.x0 = bankParams.x0 - 2.*bankParams.dx0;
00132   LALInspiralValidParams(status->statusPtr, valid, bankParams, coarseIn); 
00133   CHECKSTATUSPTR(status);
00134   if (*valid == 1) 
00135   {
00136     DETATCHSTATUSPTR(status);
00137     RETURN(status);
00138   }
00139   bankParams.x1 = bankParams.x1 + bankParams.dx1;
00140   LALInspiralValidParams(status->statusPtr, valid, bankParams, coarseIn); 
00141   CHECKSTATUSPTR(status);
00142   if (*valid == 1) 
00143   {
00144     DETATCHSTATUSPTR(status);
00145     RETURN(status);
00146   }
00147   bankParams.x1 = bankParams.x1 - 2.*bankParams.dx1;
00148   LALInspiralValidParams(status->statusPtr, valid, bankParams, coarseIn); 
00149   CHECKSTATUSPTR(status);
00150   if (*valid == 1) 
00151   {
00152     DETATCHSTATUSPTR(status);
00153     RETURN(status);
00154   }
00155 #endif
00156 
00157   DETATCHSTATUSPTR( status );
00158   RETURN( status );
00159 }

Generated on Sat Sep 6 03:07:11 2008 for LAL by  doxygen 1.5.2