TPC SC&GL Calibration: Run21 dAu 200 GeV

--> Data set: 
  Collision: d + Au
√s = 200 GeV
Run Period: June 28 - July 11, 2021
Runs used for the space charge calibrations can be fond in the attached file.

--------------Results with EW Asymmetry = kTRUE mode-------------
 Calibration macro found scaler "bbcyb" for 1-parameter fit and "zdcw:bbcw" combo for the 2-parameters fit. The single parameter fit linearity is not good enough. 
 The two parameter fit finds the same scalers combination with the comparable coefficients and offset values for EW mode as well, with slightly higher STDEV.  It seems that there is not much difference between east vs west as the ratio is 1 within error.  

Pass04 with added runs (45 in total)

USING STDDEV sc => 0.000278 :: gapf => 0.014994

*** FINAL CALIBRATION VALUES: ***

sc = (1.0 +/- 0.0369)*(-1.104e-07*(zdcw-( -1275 +/- -120.9))+(1.448e-07*(bbcw)))

  with EWratio = 1.008 +/-0.037

  with GL =  0.01 +/-  0.03

2 Scalers

USING STDDEV sc => 0.000633 :: gapf => 0.020781
 
*** FINAL CALIBRATION VALUES: ***
sc = (1.0 +/- 0.1056)*(-1.124e-07*(zdcw-( -1367 +/-  -7850))+(1.495e-07*(bbcw)))
  with EWratio = 0.984 +/-0.149
  with GL =  0.01 +/-  0.03

1 Scaler (forced "zdcw"):

USING STDDEV sc => 0.004297 :: gapf => 0.020740
 
*** FINAL CALIBRATION VALUES: ***
sc = (1.703e-08 +/- 2.635e-08) * ((zdcw) - (-2.019e+05 +/- 3.554e+05))
  with EWratio = 1.024 +/-2.217
  with GL =  0.01 +/-  0.04

SC fit

1 Scaler (floating scalers):

USING STDDEV sc => 0.001239 :: gapf => 0.020791
 
*** FINAL CALIBRATION VALUES: ***
sc = (1.344e-06 +/- 2.855e-07) * ((bbcyb) - (-28.91 +/-   1317))
  with EWratio = 0.983 +/-0.303
  with GL =  0.01 +/-  0.04

SC fit

HMM....EW Asymmetry mode is not turned on yet, which needs to be turned on for this dataset!

---- TESTS---------------------
1. Fit failed for single scaler (if scaler is not forced).
    Tried forcing "zdcw" and "bbcw". The macro failed for "bbcw" but converged for "zdcw".

USING STDDEV sc => 0.004242 :: gapf => 0.011862
*** FINAL CALIBRATION VALUES: ***
sc = (4.399e-09 +/- 6.742e-09) * ((zdcw) - (-8.693e+05 +/- 1.378e+06))
  with GL =  0.01 +/-  0.04

SC&GL Fit Plot

The large STDDEV value is because of a couple of data points are appeared as "outliers". 

2. Fit results for "bbcw:zdcw"

USING STDDEV sc => 0.000554 :: gapf => 0.011869
 
*** FINAL CALIBRATION VALUES: ***
sc = (1.0 +/- 0.003954)*(1.485e-07*(bbcw-(  1073 +/-  240.5))+(-1.116e-07*(zdcw)))
  with GL =  0.01 +/-  0.04

 SC&GL fit plot

------- BEST RESULT -----------
In early passes (01-02), about 10  sampled runs out of 29 were not included. The last two passes results are with the full sampled runs.
It seems that the fit started to degrades (the higher STDEV value and the coefficients). Fit results from the third pass would be the best
choice for this dataset. 
Pass 03
(all 29 sampled runs used )

USING STDDEV sc => 0.000554 :: gapf => 0.011871
*** FINAL CALIBRATION VALUES: ***
sc = (1.0 +/- 0.0234)*(-1.116e-07*(zdcw-( -1425 +/-  -1907))+(1.485e-07*(bbcw)))
  with GL =  0.01 +/-  0.03

Pass 03 SC&GL Fit
-------------------------------

------- ITERATIONS--------------- 

Pass 04

(all 29 sampled runs used )

USING STDDEV sc => 0.000558 :: gapf => 0.012574
 
*** FINAL CALIBRATION VALUES: ***
sc = (1.0 +/- 0.2215)*(-1.119e-07*(zdcw-( -1316 +/- -1.85e+04))+(1.487e-07*(bbcw)))
  with GL =  0.01 +/-  0.04

Pass 03
(all 29 sampled runs used )

USING STDDEV sc => 0.000554 :: gapf => 0.011871
 
*** FINAL CALIBRATION VALUES: ***
sc = (1.0 +/- 0.0234)*(-1.116e-07*(zdcw-( -1425 +/-  -1907))+(1.485e-07*(bbcw)))
  with GL =  0.01 +/-  0.03

Pass 03 SC&GL Fit

Pass 02
(only ~20 runs used)

USING STDDEV sc => 0.000528 :: gapf => 0.011955
 
*** FINAL CALIBRATION VALUES: ***
sc = (1.0 +/- 0.09559)*(-1.133e-07*(zdcw-( -1702 +/-  -6402))+(1.498e-07*(bbcw)))
  with GL =  0.01 +/-  0.03

Pass 02 SC&GL Fit Plot

Pass 01---------
(only ~20 runs used)

USING STDDEV sc => 0.000594 :: gapf => 0.011694
 
*** FINAL CALIBRATION VALUES: ***
sc = (1.0 +/- 0.1437)*(-1.14e-07*(zdcw-( -2424 +/-  -7312))+(1.499e-07*(bbcw)))
  with GL =  0.01 +/-  0.02
-----------------