Privacy and Security Notice

run database

Shell scripts to convert database to table form 08/07/05

The script cy_alias and cy_cut are called with the variables one would like displayed.  For example:
   
cy_alias xcointime dcointime
will make a table where the first column is the run number, the second is xcointime (the mean of the cointime peak) and the third dcointime (the sigma of the cointime peak).  For now the scripts read a runlist from file (C_H_DUMMY.dat), but they can be easily changed to read the entire db/online04 database directory.  The output from the above command is sent to the file listdb.dat, which looks like this:
run    xcointime  dcointime
49543  -58.8      0.218
49544  -58.76     0.206
49585  -58.9      0.217
49586  -58.93     0.212
49587  -58.9      0.207

The other script, cy_cut, can be used to list those entries of the database that are cuts.  These need to be called with quotes, for example:
  cy_cut '$75'

There are also two scripts that convert the tables back to the database, including any changes made to the tables.  Rows and columns in the table can be deleted as part of the modifications, so long as the run number is still the first column and the titles are still the first row.  The scripts cby_alias and cby_cut are for converting "alias" and "cuts" database entries respectively.  They do not need any command line arguments.

Run database instructions 04/13/05 

Here is a sample kumac that uses the database.  It loops over runs, checks the database was read successfully, and then uses the variable xcointime in a plot.  The plots from all runs are added together and plotted at the end.

A shell script example that will get a variable value was given in the entry below on 04/04/05.

Run database 04/04/05 

While waiting for the multiple attempts at submitting the pass1 ntuples to finish, I have been working on generating a run database.  Working on the database does not need modifications of the Analyzer or the PARAM files, whereas working on the optics and heepcheck does.

The requirements of the database was that it be a text file that is easily searchable.  It should contain information about errors, detector trips, coincidence time information, charge collected, efficiencies, etc.

I decided to have a separate file for each run, and to make each file a kumac.  The 500+ files are located in ~clasie/work/replay/db/online04/#####db.kumac.  An example is included below.

Using the database in this format has obvious advantages for paw.  In addition, the cointime cuts can be in the database for the 24 runs in the July running period where the cointime was not stable during the run.  The database is also searchable because each value is preceeded by a distinct variable name.  For example, a shell script could retrieve the mean cointime for the run using
`grep "xcointime" 49540db.kumac |  tail -1 | awk '{printf "%s\n",$3}'`.




do i=1, [#]                    |loop over all input parameters
   alias/create dbsuccess 1    |set this to zero before executing this kumac
  
   if ([%i]='checks') then
     alias/create disksize 1    |(0=bad, 1=good) Size on tape vs. size on disk
     alias/create noerr 1       |(0=bad, 1=good) ERROR: was found in batch output file
     
   elseif ([%i]='cuts') then
     alias/create xhsbeta 0.998227      |mean of hsbeta
     alias/create dhsbeta 0.033138      |sigma of hsbeta
     alias/create xssbeta 0.999407
     alias/create dssbeta 0.0278341
     alias/create xcointime -58.7997  |mean of the cointime peak (ns)
     alias/create dcointime 0.192  |cointime sigma (ns)
     alias/create wcointime 1.0  |cointime cut width (ns)
     ntuple/cut $70 1.<2.       |use these to adjust the cointime cut during jumps
     ntuple/cut $71 1.<2.
     ntuple/cut $72 1.<2.
     ntuple/cut $73 1.<2.
     ntuple/cut $74 1.<2.
     ntuple/cut $75 abs(cointime-(xcointime))<(wcointime)
     
   elseif ([%i]='effic') then
     alias/create hefideff 0.9663       | HMS electron fid efficiency
*$$$     alias/create hpifideff #       | HMS pion fid efficiency
*$$$     alias/create hpfideff #        | HMS proton fid efficiency
*$$$     alias/create sefideff #        |
*$$$     alias/create spfideff #        |
     alias/create hpre 93971349.0
     alias/create hpre2 94038535.0
     alias/create htrg 90888595.0
     alias/create htrg2 90951842.0
     alias/create spre 24743313.0
     alias/create spre2 24737212.0
     alias/create strg 23923652.0
     alias/create strg2 23919725.0
     alias/create cpre 173520.0
     alias/create cpre2 172210.0
     alias/create ctrg 169146.0
     alias/create ctrg2 165926.0
*$$$     alias/create helecdt # | HMS electronic dead time
*$$$     alias/create selecdt #
     
   elseif ([%i]='runinfo') then
     alias/create ps1 1800
     alias/create ps2 500
     alias/create ps3 1                 | coincidence prescale
     alias/create bcm1 83121    | cumulative charge uA
     alias/create bcm2 83180
 
   elseif ([%i]='kine') then
     alias/create gtarg_num 5
     alias/create gpbeam 5.012
     alias/create hpcentral 3.187
     alias/create htheta_lab 13.44
     alias/create spcentral 1.73
     alias/create stheta_lab 28.85
     alias/create hpartmass 0.139570
     alias/create spartmass 0.000511
   endif
 enddo