G0Analysis Release 0.16 Paul King; 2003/06/03, 19:25 The principle bug fix is in the NA deadtime correction routines used to extract the "tartan table" rates from the database records. This bug resulted in the zeroing of the deadtime corrections in the previous full pass of the analysis. Changes since release 0.15: =========================== * A "nasty" bug fixed related to the "70ns" NA deadtime correction. After the retrieval of the tartan rates fit parameters, a small calculation routine is needed go from the 4x4 tartan rates to CFD, MT, coin rates fit parameters. This piece of calculation code was present in the input file routine, but was missing in the database reading routines. This caused the failure of performing the NA DT correction properly with the DB I/O. Strip it out as a small subroutine. * Reinterpret ToF PID cuts definitions [low,high] to be inclusive of the cut edges. So [15,18] bin cut represents 15,16,17,18. Modified G0Scintillator::CalcPIDSum(). * Added the "!=" translation in the SQL cuts translator. G0Analysis Release 0.17 Paul King; 2003/06/06, 10:45 The principle bug fixes are to: the "beam trip cut" and the regression analysis routines. The fix to the "beam trip cut" is so that runs which do not have the beam on at the beginning of the run are handled properly. The fix to the regression analysis corrected several errors which corrupted the slopes calculated in the analyser. Changes since release 0.16: =========================== * It was discovered that rolling averaged PID yields were unreasonably large, for a few runs where the beam was off at the beginning. I forgot to tag the quartet as bad, if the MPS passes the beam current cut but failed Sivliu's trip cut (2000 MPS after the beam recovery). For the 2001 MPS after the beam recovery, say if it is the 4th MPS in a quartet, the asymmetry and the yield would be calcuated, since the quartet was mistaken as good. But the first 3 slots had some unknown values, which created crazy results ... So the quartet flag is explicitly set to false whenever a MPS cut is failed. Also put the safety belt in PassedCuts() routine. Modified the c-tor of G0Scintillator so that it explicitly sets all the initial values to zero. * Fixed several bugs with Kaz in the linear regression code. It was discovered that although the output correlation slopes appeared to be zero after the correction was applied, the true correlation still existed and made the asymmetry senseless. Most of the issues were due to the incompatibity between g0analysis and the original root script of the regression analysis. We removed the incorrectly incremented internal event counter from the octant and detector loop. Also moved the incorrected running summing of the beam parameters outside the loop. Changed the way the rolling sum is calculated to MPS-wise, instead of quartet-wise. Otherwise this had a very pethogical flaw, so that if the replay ends at the middle of the quartet the slope will NOT be correctly calculated. * Put a quick fix in G0CodaEvent::FillFrenchCfgBuffer(), so that if the bank frag length appears zero, reassign it to 389. This is a hack to get through a couple of runs, where the French config event length appeared to be zero and caused the segv in the replay. * Added a function G0ReplayPrms::SetThisRun() to set a internal variable to the current run number. * Changed the default flags for the replay database host, database name, username, etc according to the new DB on wmg0. * Just commented a couple of debugging output in G0LinearRegression. G0Analysis Release 0.18 Paul King; 2003/06/06, 16:15 There were some changes in the database access routines for filling and extracting data. Changes since release 0.17: =========================== * Modified G0EPICSEvent::WriteDatabase() to handled cases where "static" EPICS variables change in the middle of a run. The static variables include target position, insertable half wave plate state, and charge feedback state. If the target position changes during the run, then the position will be set to 'u' in the database. If IHWP or charge feedback state changes, then the value in the database will be NULL. * Raw SQL will no longer be printed to standard out by default before the query is submitted to the database. * Defined two ERR constants in Math_Func, InvalidAsym = 100,000. and InvalidSigma = -100,000. The former is to indicate divide-by-zero error when calculation asymmetry, the other is to eliminate the pathological case where -* < 0, due to the rounding error. * When filling the DB with the FPD, beam and correlation slopes values, check whether the numbers indicates the record is invalid due to the above two errors. If yes, fill NULL into the DB fields. Modified G0SQL::Process() routine to handel NULL records in retrieval (the row with any NULL record will be skipped).