BurstProcess.h

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Julien Sylvestre
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 #ifndef BURSTPROCESSH
00021 #define BURSTPROCESSH
00022 
00023 #include <stdlib.h>
00024 #include <sys/types.h>
00025 #include <regex.h>
00026 
00027 /*
00028 #include <lal/EPSearch.h>
00029 #include <BurstProcessTypeDef.h>
00030 */
00031 
00032 #include <Coincidences.h>
00033 
00034 #define regex(s1_,s2_) regexec(s1_,s2_,0,NULL,0)
00035 
00036 /******************************************************************/
00037 typedef struct tagBurstSegInfo {
00038 
00039   char *params; /* comma separated list of job parameters */
00040   char *info;   /* comma separated list of info from segment */
00041 
00042   struct tagBurstSegInfo *next;
00043 
00044 } BurstSegInfo;
00045 
00046 typedef struct tagBurstSegParams {
00047 
00048   char *params;
00049 
00050   int t0s;
00051   int t0ns;
00052 
00053 } BurstSegParams;
00054 
00055 int BurstProcess(
00056                  unsigned int *nback, /* number of background segments */
00057                  BurstSegInfo *backData, /* params,info for each segment */ 
00058                  int (*backFun)(char **, SnglBurstTableC *, void *, BurstSegParams *), /* function to process each segment */
00059                  void *backParams0,
00060                  size_t backSize,
00061                  unsigned int *nfore,
00062                  BurstSegInfo *foreData,
00063                  int (*foreFun)(char **, SnglBurstTableC *, void *, BurstSegParams *),
00064                  void *foreParams0,
00065                  size_t foreSize,
00066                  char **files,
00067                  int nfiles
00068                  );
00069 
00070 int BurstProcessSub(
00071                  unsigned int *nback, /* number of background segments */
00072                  BurstSegInfo *backData, /* params,info for each segment */ 
00073                  int (*backFun)(char **, SnglBurstTableC *, void *, BurstSegParams *), /* function to process each segment */
00074                  void *backParams0,
00075                  size_t backSize,
00076                  unsigned int *nfore,
00077                  BurstSegInfo *foreData,
00078                  int (*foreFun)(char **, SnglBurstTableC *, void *, BurstSegParams *),
00079                  void *foreParams0,
00080                  size_t foreSize,
00081                  char **files,
00082                  int nfiles,
00083                  char *match
00084                  );
00085 
00086 int BurstProcess2(
00087                   unsigned int *nback, /* number of background segments */
00088                   BurstSegInfo *backData, /* params,info for each segment */ 
00089                   int (*backFun)(char **, SnglBurstTableC *, SnglBurstTableC *, void *, BurstSegParams *, BurstSegParams *), /* function to process each segment */
00090                   void *backParams0,
00091                   size_t backSize,
00092                   unsigned int *nfore,
00093                   BurstSegInfo *foreData,
00094                   int (*foreFun)(char **, SnglBurstTableC *, SnglBurstTableC *, void *, BurstSegParams *, BurstSegParams *),
00095                   void *foreParams0,
00096                   size_t foreSize,
00097                   char **files1,
00098                   int nfiles1,
00099                   char **files2,
00100                   int nfiles2,
00101                   int mixETGParams,
00102                   char *IFO1,
00103                   char *IFO2
00104                   );
00105 
00106 /******************************************************************/
00107 typedef struct tagBackFunNumberOfUnclusteredEventsParams {
00108   int nBursts;
00109   int nSegments;
00110 
00111   int Nbands;
00112   double Fbands[10];
00113   int nBurstsBands[10];
00114 
00115 } BackFunNumberOfUnclusteredEventsParams;
00116 
00117 int BackFunNumberOfUnclusteredEvents(
00118                                      char **info,
00119                                      SnglBurstTableC *input,
00120                                      void *parameters,
00121                                      BurstSegParams *bparams
00122                                      );
00123 
00124 
00125 /******************************************************************/
00126 typedef struct tagForeFunIsDetectedParams {
00127 
00128   int dType;
00129   
00130   int nDetected;
00131   int nInjected;
00132 
00133   double twin;
00134   double toff;
00135 
00136   int doFCut;
00137   double f0, f1;
00138 
00139 } ForeFunIsDetectedParams;
00140 
00141 int ForeFunIsDetected(
00142                       char **info,
00143                       SnglBurstTableC *input,
00144                       void *parameters,
00145                       BurstSegParams *bparams
00146                       );
00147 
00148 /******************************************************************/
00149 typedef struct tagEstimationErrorsParams {
00150   
00151   int nDetected;
00152   int nInjected;
00153 
00154   double dt, dt2;
00155   double df, df2;
00156   double dur, dur2;
00157   double bw, bw2;
00158   double h, h2;
00159   double conf, conf2;
00160   double snr, snr2;
00161 
00162   double bw0;
00163   double dur0;
00164   double f0;
00165 
00166   double twin;
00167   double toff;
00168 
00169   int outfile;
00170 
00171   int reportAll;
00172 
00173 } EstimationErrorsParams;
00174 
00175 int EstimationErrors(
00176                      char **info,
00177                      SnglBurstTableC *input,
00178                      void *parameters,
00179                      BurstSegParams *bparams
00180                      );
00181 
00182 /******************************************************************/
00183 
00184 typedef struct tagBackFunNumberOfUnclusteredEventsC2Params {
00185 
00186   Coincidence2Params *cparams;
00187 
00188   double nBursts;
00189   int nSegments; 
00190 
00191   double dtmin;
00192   double dtmax;
00193   double dt;
00194 
00195 } BackFunNumberOfUnclusteredEventsC2Params;
00196 
00197 
00198 int BackFunNumberOfUnclusteredEventsC2(
00199                                        char **, 
00200                                        SnglBurstTableC *, 
00201                                        SnglBurstTableC *, 
00202                                        void *, 
00203                                        BurstSegParams *, 
00204                                        BurstSegParams *
00205                                        );
00206 
00207 /******************************************************************/
00208 typedef struct tagForeFunIsDetectedC2Params {
00209   
00210   Coincidence2Params *cparams;
00211 
00212   int nDetected;
00213   int nInjected;
00214 
00215   double twin;
00216   double toff;
00217 
00218 } ForeFunIsDetectedC2Params;
00219 
00220 int ForeFunIsDetectedC2(
00221                         char **info,
00222                         SnglBurstTableC *input1,
00223                         SnglBurstTableC *input2,
00224                         void *parameters,
00225                         BurstSegParams *bparams1,
00226                         BurstSegParams *bparams2
00227                       );
00228 #endif

Generated on Thu Aug 28 03:11:57 2008 for LAL by  doxygen 1.5.2