Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:03:51

0001 /* histogram/ntuple.h
0002  * 
0003  * Copyright (C) 2000 Simone Piccardi
0004  * 
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 3 of the License, or (at
0008  * your option) any later version.
0009  * 
0010  * This program is distributed in the hope that it will be useful, but
0011  * WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * General Public License for more details.
0014  * 
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program; if not, write to the Free Software
0017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018  *
0019  */
0020 
0021 /* Jan/2001 Modified by Brian Gough. Minor changes for GSL */
0022 
0023 #ifndef __GSL_NTUPLE_H__
0024 #define __GSL_NTUPLE_H__
0025 
0026 #include <stdlib.h>
0027 #include <stdio.h>
0028 #include <gsl/gsl_errno.h>
0029 #include <gsl/gsl_histogram.h>
0030 
0031 #undef __BEGIN_DECLS
0032 #undef __END_DECLS
0033 #ifdef __cplusplus
0034 # define __BEGIN_DECLS extern "C" {
0035 # define __END_DECLS }
0036 #else
0037 # define __BEGIN_DECLS /* empty */
0038 # define __END_DECLS /* empty */
0039 #endif
0040 
0041 __BEGIN_DECLS
0042 
0043 typedef struct {
0044     FILE * file;
0045     void * ntuple_data;
0046     size_t size;
0047 } gsl_ntuple;
0048 
0049 typedef struct {
0050   int (* function) (void * ntuple_data, void * params);
0051   void * params;
0052 } gsl_ntuple_select_fn;
0053 
0054 typedef struct {
0055   double (* function) (void * ntuple_data, void * params);
0056   void * params;
0057 } gsl_ntuple_value_fn;
0058 
0059 gsl_ntuple * 
0060 gsl_ntuple_open (char * filename, void * ntuple_data, size_t size);
0061 
0062 gsl_ntuple * 
0063 gsl_ntuple_create (char * filename, void * ntuple_data, size_t size);
0064 
0065 int gsl_ntuple_write (gsl_ntuple * ntuple);
0066 int gsl_ntuple_read (gsl_ntuple * ntuple);
0067 
0068 int gsl_ntuple_bookdata (gsl_ntuple * ntuple);  /* synonym for write */
0069 
0070 int gsl_ntuple_project (gsl_histogram * h, gsl_ntuple * ntuple, 
0071                         gsl_ntuple_value_fn *value_func,
0072                         gsl_ntuple_select_fn *select_func);
0073 
0074 int gsl_ntuple_close (gsl_ntuple * ntuple);
0075 
0076 __END_DECLS
0077 
0078 #endif /* __GSL_NTUPLE_H__ */
0079 
0080 
0081 
0082