G0Analysis Release 0.19 Paul King; 2003/07/03, 11:45 The principle change is the inclusion of Jason's 120 Hz analysis routines. Changes since release 0.18: =========================== * I have modified the routine which fills the "na_rates" table so that it will write out the rate information for all eight octants. So the "na_rates" table will have the rates calculated using the NA technique for all eight octants; perhaps we will rename this table in a future version of the database. The problem is that the array of the "measured rates calulated using the Fastbus data" is valid for all eight octants, and not just the four NA octants. This array had been accessed by looping over the first four octants, getting the detector ID, and then outputing the data from the array. So, the "na_rates" table as it exists in the database right now has the rate data for octants 1, 2, 3, and 4. There is not a problem with the detector ID in the "na_rates" table. * Fixed bug that caused duplicate entries in the 'polarized_source', 'sms', and 'target' tables (and their subsidiary data tables). Now the database will be checked prior to filling the tables to make sure the data is not already in there. * Added Jason's 120 Hz analysis routines: The revision adds 120Hz analysis to g0analysis, defining the new flag --120Hz. 2 new features are also added : - beam offsets are now normalized against clock, which takes into account small clock counts variations (typically +/- 1 over ~133330 in 30Hz mode and over ~33330). - Device used for normalization can be specified at runtime. Corresponding flag is : --normcharge - Beam cuts can be inhibited, allowing to decode test runs with no beam data. Corresponding flag is --nobeamcuts In order to introduce 120Hz data handling without affecting the code structure, the 30Hz objects are replicated and switched regularly within the standard loop. Basically, all data structures are instanciated and initialized as usual. If 120Hz analysis is required then a G0120Hz object is created that adopts and replicates all the previous objects. Its main task in the main g0analysis loop is to keep track of the 120Hz counter and switch around the 120Hz replica accordingly. Such a scheme makes the whole G0 analysis code extensively reusable with minor compatibility issues as each 120Hz structure is handled as an independent 30Hz structure. Only minor non transversal changes had to be here and there (see bellow), the main of which are the special handling of the French data which are still acquired on an MPS per MPS basis and the addition of a series of new tests in the main G0Analysis file. The output is similar to that of the 30Hz code, with a few caveats: a few variables are added in the standard ntuples, namely phase60Hz, phase60HzSum and phase120Hz; phase60Hz is a float comprised between -pi and pi : it is the power line 60Hz phase as reconstructed from the 3 ADC values 60HzPhaseADC# in the beam ntuple. phase60HSum is the same, but the reconstructed value increases ad infinitum and no modulo is applied any more. phase120Hz is the 120Hz phase counter, ranging from 0 to 5 (0 and 5 have special meaning : 0 == 1+2+3+4 and 5 = 1-2+3-4) The standard histograms are distributed between directories "phase0" though "phase5" and their names are slightly modified, with the suffixes "_ph0" through "_ph5" appended. All the rest is preserved. e.g. : tof/fr_tof201 -> phase#/tof/fr_tof201_ph# Change log : ** Asymmetry.C : operator += and -= were declared but not defined ** G060HzPhaseMonitor.h/G060HzPhaseMonitor.C : Calibration method added, which is used to determine the constants to reconstruct the power line 60Hz phase. Right now the latter constants are still hard-coded. ** G0BeamMonitor.h/G0BeamMonitor.C : - all beam vector renamed from "name" to "name_per_clock" for clarity - New parameter NOMINAL_30Hz_CLOCK for pedestal normalisation; right now is a constant : may have to be defined as a variable and be put in the data base - New parameter fNormChargeIndex, defines which charge is used as normalisation. - operator += and -= (expected by G0120Handler) - Clock computation separated from charge computation in new method Comp_clock() ** G0Buddies.h/G0Buddies.C : added members oversampledphase[4],phase60Hz[4], phase60HzSum[4]; ** G0CodaEvent.h : Revised Is120HzMode() test method ** G0EPICSEvent.C : Changed test value.Contains(digit_regex) into test value[0]>='0'&&value[0]<='9' (regular expressions handling is too recent a feature in ROOT) ** G0FrenchDetector.h/G0FrenchDetector.C : - New method Decode120Hz() to handle special French 120Hz data structure - Method ResetValues() to prevent transmissions of non-zero values from run to run (typically, after a config change, where a subsystem wouldn't be read any more, for test reasons, then the corresponding ROC CODA header are missing, but the buffers were not reinitilaized) ** G0Hists.C : Naming scheme slightly altered to distinguish between 120Hz histograms ** G0NADetector.h/G0NADetector.C : - Method ResetValues() to prevent transmissions of non-zero values from run to run (typically, after a config change, where a subsystem wouldn't be read any more, for test reasons, then the corresponding ROC CODA header are missing, but the buffers were not reinitilaized) - Defined operator += and -= which used to be only declared (expected by class G0120HzHandler) ** G0Ntuples.h/G0Ntuples.C : 3 branches added to the 4 standard ntuples : "phase120Hz","phase60Hz","phase60HzSum" ** G0ReplayPrms.h/G0ReplayPrms.C : - rootfile, fNoROOTFile are now static (necessary in 120Hz as closure time is random with regard to the 120Hz counter) - Flags (+ getters and setters) added for 120Hz mode, charge normalisation selection and beam cuts inhibitions ** G0TriggerSupervisor.h : - transfered 60Hz phase computation in method ProcessEvent() ** GetInputData.C : added line beam->SetNormChargeIndex(io->GetNormChargeIndex()) ** Helicity.h/Helicity.C : explicit default copy ctor added ** GetReplayPrms.C : flags "--120Hz", "--nobeamcuts", "--normcharge" ** MapScalerChan.C : scope of vectors changed, to prevent memory effect in initialisation. They are also made static to make sure changes don't propagate. It required distinguishing between counters kChannel and kChannelforBeam. Each call to MapScalerChannel() now first resets the vectors. ** beam.in.01-12-03/beam.in.01-13-03/beam.in.01-23-03/ beam.in.11-07-02/beam.in.11-13-02.swappedV-F/beam.in.11-21-02/ beam.in.11-21-02.swappedV-F 11th field of beam buffer is now defined as "Phase120Hz" (used to be "Spare") ** G0Analysis.h/G0Analysis.C : - Conditional instantiation of G0120Hz object. - Various tests on the 120Hz phase to keep the analysis in synch (see comments therein) - Hard-coded reordering of French 120Hz data (correction for the shifted Grey code that labels the different 120Hz phases) - Several bypassing tests to prevent unwanted effects such as beam cuts on a single 120Hz phase (typically the "5th"), which destroys the synchronisation ** Added classes G0120Hz and G0120Handler : the latter is a templated container class that refers to 6 copies of a definite data structure. It expects for the data classes that the operator =, +=, -= be defined. The former is a "synchronising" class. It contains almost as many G0120Handlers as there are data structures in normal 30Hz analysis. Its task is to maintain a synched index which defines uniquely the sets of buffers currently used in the analysis (corresponding simply to the indexth elements in the G0120Handlers). G0Analysis Release 0.20 Paul King; 2003/07/09, 11:00 The principle change is the 10 sigma cuts we impose on the yield in each timebin. If any time bin in a detectors fails this cut, the whole detector will be thrown away from this particular MPS and quartet, i.e. the calculation of yield correlations, asymmetries, etc will be skipped. This is to remove the non-statistical fluctuation we saw on the detector yields, and hence asymmetries and the slopes. Also, Guilliaume's new deadtime correction routine for the French detectors has been added. A bug in the helicity correlated angle difference calculation was corrected. Included the hardware counters of the MPS and QRT in the database. Changes since release 0.19: =========================== * Modified G0Scintillator class. For each G0Scintillator object, added an internal flag fGood, and a good event(quartet) counter, nGood. Various additions to the computation methods to calculate based on the goodness flag and the internal counter(for running average, etc ...). * Kaz modified the linear regression routine accordingly. Added interal event counters for individual detectors. Only calculates proton yield slopes (and later applies the correction) when the detector goodness flag is true. Due to cuts (and counters) on different detectors, the 6x6 matrices have to be computed for individual detector. * Modified G0Cuts class. Defined a few G0Octant vectors to store the 10 sigma cuts in the form of octant[].scint[].dtimebin[]. * Added files CutsOnDetectors.{C,h}, which are a collection of functions involved in the yield cuts. -- TagBadDetIfErrorAlert() looks at the LTD error counters and SDMCH alerts to tag the bad scintillator accordingly. This is the 1st level protection. -- CalcBinYieldRMS(). Called at the the beginning of the replay. Sacrifice 100 "good" MPS to compute the mean and RMS of the normalized yield of each bin. After this the 10 sigma cuts around the mean is calculated for each bin. -- TagBadDetIfFailYieldCuts(). Actual implementation of the 10 sigma cuts on the timebin yield. If any bin fails, tag the whole detector as bad. -- ResetDetFlgs(). Resets fGood for each detectors at the beginning of a new MPS. -- TagBadQRT4EachDet(). If any of the 4 MPS is tagged bad for a certain detector, tag the quartet as bad for this detector as well. -- ReportGoodQRTCounters(). Output the nGood counters for each detector. * Parallel modifications in the G0NADetector, G0FrenchDetector classes for flagging and increment of internal counters. Similar modifications in higher level Helicity and Asymmetry classes. * Misc. modifications CalcAsyms(), CalcYieldAve(). Also modified the quartet histogramming and ntupling routines to check the goodness flag before filling. * Corresponding changes in the main routine. Moved the calls of Kaz's regression methods inside the quartet cuts. Merged against Jason's recent mod. on 120Hz analysis. Added the command line switch, "--cutonyield". * Put Guillaume's new French DT corrections in. This version utilize a "dead" probability lookup file to modify the yield correction due to the singles timebin by timebin, based on the singles ToF info from fastbus. Now the default correction routine! Added a redundant switch "--french_dt npn_single_tof". * Fixed a bug in the helicity correlated angle difference calculation. This bug caused the beam angle differences not filled properly in the DB during the 2nd pass replay. * Put the value of the hardware MPS and QRT counter into the run table in DB. Also put the value of the hardware MPS counter into fastbus ntuple->misc.macro. G0Analysis Release 0.21 Paul King; 2003/07/11, 17:30 Included some minor changes in the database filling routines related to the "10 sigma" yield cuts. Changes since release 0.20: =========================== * Some minor fixes in the database filling routines; the changes are related to the 10sigma yield cuts. Added the filling of "cutonyield" flag in the analysis table. Added the filling of "n_qrt" detector by detector in the measurement table. Added the filling of "n_mps" detector by detector in the slope table.