cpixe-eff/cpixe-eff.c

Go to the documentation of this file.
00001 
00002 /***************************************************************************
00003     Copyright (C) 2007 by Carlos Pascual-Izarra
00004     carlos.pascual_AT_users.sourceforge.net                                                  *
00005 
00006     This program is free software: you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation, either version 3 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 
00019  ***************************************************************************/
00020 
00029 #ifdef HAVE_CONFIG_H
00030 #include <config.h>
00031 #endif
00032 
00033 #include <stdio.h>
00034 #include <stdlib.h>
00035 #include <math.h>
00036 #include <string.h>
00037 
00038 #include "../libcpixe/libcpixe.h"
00039 #include "../libcpixe/compilopt.h"
00040 
00041 //This overrides the setting in compilopt!
00042 #define CPIXEVERBOSITY 0
00043 
00044 #define OUTPUTABLE 1
00045 #define OUTPUTBLOCK 1
00046 
00047 int main(int argc, char *argv[]);
00052 int main(int argc, char *argv[])
00053 {
00054     STATFILENAME crystalfilename="detcrystal.det";
00055     STATFILENAME windowfilename="detwindow.det";
00056     STATFILENAME abscoeffilename="xabs.abs";
00057     STATFILENAME xenerfilename="xener.dat";
00058     TwoCol *EffTable;
00059     CalibYld *EffBlockArray;
00060     double factor=1.;
00061     int i,maxZ,dimEffTable;
00062 
00063     if (argc>1)strcpy(crystalfilename,argv[1]);
00064     if (argc>2)strcpy(windowfilename,argv[2]);
00065     if (argc>3)strcpy(abscoeffilename,argv[3]);
00066     if (argc>4)strcpy(xenerfilename,argv[4]);
00067 
00068     maxZ=CreateEff(abscoeffilename, xenerfilename, windowfilename,crystalfilename, factor ,&EffBlockArray, &dimEffTable, &EffTable);
00069 
00070 #if OUTPUTABLE > 1
00071     for (i=0; i<dimEffTable;i++)printf("\n%le\t%le",EffTable[i].x,EffTable[i].y);
00072     fprintf(stdout,"\n");
00073 #endif
00074 #if OUTPUTBLOCK > 1
00075     for (i=0; i<maxZ;i++)
00076     {
00077         fprintf(stdout,"\n%d\t%2s:", i,ChemicalSymbol[i]);
00078         fprintf(stdout,"\n");
00079         fprintCALIBYLD(stdout,&EffBlockArray[i]);
00080         fprintf(stdout,"\n");
00081     }
00082 #endif
00083 
00084     free(EffBlockArray);
00085     free(EffTable);
00086 
00087     return EXIT_SUCCESS;
00088 }
00089 
00090 

Generated on Sat Dec 8 23:11:36 2007 for libCPIXE by  doxygen 1.5.4