S800 Utilities
The main justification for producing a S800 Utilities library comes from the use of Numerical Recipes software in the S800 and Sweeper versions of the NSCL SpecTcl analysis program. The fitting method used in calculating the position along the pad direction in the CRDC detectors utilizes the least square fitting provided in Numerical Recipes. According to the terms of the "Single-Screen" license that I own, I am not authorized to distribute the Numerical Recipes software in the form of a compiled library of their subroutines, but I can incorporate them into my own set of compiled subroutines as long as they cannot be directly accessed by other users. The exact terms of the license can be found following this link.
If you or your institution owns a Numerical Recipes license, and you are authorized to use it, you can keep the S800 and Sweeper SpecTcl software as it is, as long as you do not redistribute it to other users without a license.
If on the other hand you do not possess a valid license, the following steps are required (for Linux and Mac OS X installations only):
- Remove any existing copy of the compiled library libnumrec.a and any source from Numerical Recipes (such as the include file nrutil.h) from your system
- Replace it by the library libs800utilities.a available in Linux and Mac OS X formats
- In the file CS800.cpp or CSweeper.cpp, depending on which one you use, make the following modifications
- At the top of the file, remove the following lines:
// Fitting program from Numerical Recipes (Levenberg-Marquardt method)
void
mrqmin(double x[], double y[], double sig[], int ndata, double a[], int ia[],
int ma, double **covar, double **alpha, double *chisq,
void (*funcs)(double, double[], double*, double[], int),
double *alamda);
extern short gNumrecError;
- Replace them by the following prototype declaration:
int
S800CalculateGaussianFit(double *x, double *y, double *sig, double *a, int MA, int NPoints, double *chisq);
- Remove the subroutine fgauss.
- Replace the method CS800FpCrdcCalc::CalculateFit() or CSweeperFpCrdcCalc::CalculateFit() by the following versions found in these files for the S800 and the Sweeper respectively.
- In the Makefile used to compile and link these versions of SpecTcl, the following modifications are needed:
- Remove the equivalent of the following two lines, where the paths to the Numerical Recipes library and include files are declared:
INCLUDES+= -I/user/s800/daq/numrec
LIBDIRS+= -L/user/s800/daq/numrec
- Replace the library declaration -lnumrec by -ls800utilities in the list of libraries used in the link command
- Recompile SpecTcl by typing make clean and then make.
By following these steps, you will ensure that you are compliant with the terms of the Numerical Recipes license. Thank you for your help with this matter!
D. Bazin
December 28th, 2005