spaceChargeCorR2.20071101.000001.C

Under:

Note that the ewratio should be set to 1.0 for all symmetric beam species (e.g. AuAu, CuCu, pp). The example shown here is from dAu where the ratio of 1.202 was used.

spaceChargeCorR2.20071101.000001.C

TDataSet *CreateTable() { 
// -----------------------------------------------------------------
// spaceChargeCorR2 Allocated rows: 1  Used rows: 1  Row size: 56 bytes
//  Table: spaceChargeCor_st[0]--> spaceChargeCor_st[0]
// ====================================================================
// ------  Test whether this table share library was loaded ------
  if (!gROOT->GetClass("St_spaceChargeCor")) return 0;
spaceChargeCor_st row;
St_spaceChargeCor *tableSet = new St_spaceChargeCor("spaceChargeCorR2",1);
//
memset(&row,0,tableSet->GetRowSize());
    row.fullFieldB	 = 2.82e-7; // Negative Full Field Correction  ;
    row.halfFieldB	 = 2.82e-7; // Negative Half Field Correction  ;
    row.zeroField	 =     44; // Zero Field " "  ;
    row.halfFieldA	 = 2.82e-7; // Postive Half " " ;
    row.fullFieldA	 = 2.82e-7; // Postive Full " " ;
    row.satRate	 =          1e10; // Saturation Rate Hz  ;
    row.factor	 =          1; // Multiplicative Factor ;
    row.detector	 =          2; // 0=RICH, 1=BBCx, 2=ZDCx, 3=ZDCsum, 4=BBCsum ;
    row.offset	 =          270; // 0=RICH, 1=BBC, 2=ZDC ;
    row.ewratio	 =          1.202; // 1.202 for dAu, 1.0 for all else
tableSet->AddAt(&row);
// ----------------- end of code ---------------
 return (TDataSet *)tableSet;
}

Also note that the values stored in the database are easily accessible through some mysql commands from any RCAS node. Here is an example of finding the parameters which were used on May 1, 2008 12:00 GMT:

mysql -h dbx.star.bnl.gov -P 3316 -C Calibrations_rich -e \
 'select * from spaceChargeCorR2 where beginTime<"2008-03-01 12:00:00" \
 order by beginTime desc limit 1'

Things can be more complicated. The code is arranged such that multiple detectors can be used in the determination of the luminosity relevant for SpaceCharge. This was true for dAu in Run 8, and this set of commands returns the parameters used on January 23, 2008:

set vtime = "2008-01-23"
set btime = `mysql -h dbx.star.bnl.gov -P 3316 -C Calibrations_rich -e \
 "select beginTime from spaceChargeCorR2 where beginTime<'$vtime' \
 order by beginTime desc limit 1" | grep 20 | cut -d ' ' -f 1,2`
mysql -h dbx.star.bnl.gov -P 3316 -C Calibrations_rich -e \
 "select * from spaceChargeCorR2 where beginTime='$btime'"