BTOF Calibrations

Barrel Time-of-Flight Detector Calibrations Overview

 

TOF Calibration Requirements


 

Links to several older calibration details with historical data


Run 8 - 10 time resolutions
Run 8 - 10 BTOF time resolutions


TOF MRPC Prototype resolutions

 TOF MRPC prototype time resolutions

Run 10 - 200 GeV Calibrations

Run 10 Calibrations

 

Run 10 200 GeV FF


[This a test page for now.  Soon to be edited.]

 

The calibration began with ntuples generated from a preproduction:

  /star/data57/reco/AuAu200_production/FullField/P10ih_calib1/2010/*/*

    log files on /star/rcf/prodlog/P10ih_calib1/log/daq

The ntuples can be found:

28 files (61810 events):
/star/data05/scratch/rderradi/run10/TofCalib/ntuples/200GeV_1/out/

316 files (2398210 events):
/star/data05/scratch/rderradi/run10/TofCalib/ntuples/200GeV_2/out/

77 files (497944 events) - not properly closed:
/star/data05/scratch/rderradi/run10/TofCalib/ntuples/200GeV_3/out/

The 77 files not properly closed were merged with hadd to properly close them.

Then the ntuples were used for the start side(vpd) calibration.  The code package used for this is attached and can be found here:

http://drupal.star.bnl.gov/STAR/system/files/startside.tar_.gz

To run the start side calibration: ./doCalib filelist traynumber

Tray number for start side can be any tray number, I recommend 0.   Start side calibration used a 20% outlier cut.  This can be selected in doCalib.cpp and changing the value pCut =0.20.

The outlier removes the upper 20% of slowest hits--highest leading edge times.

 Produced from the start side calibration is pvpdCali.dat and pvpdCali.root.  These files are used to shift the vpdvz offset between the east and west vpd, and ultimately, the vpd's calibration parameters that are loaded into the database.  To shift the offset, perform a Gaussian fit to VzCorr2->ProjectionY() and take that mean value.  This is the VzOffset.   Apply it to the convertVpd.C macro (http://drupal.star.bnl.gov/STAR/system/files/convertVpd.tar_.gz) on the line: 2454.21696153-VzOffset.  This macro generates pvpdCali_4DB.dat.  These are the parameters loaded into the database. 

Now apply the shift to pvpdCali.root so that T0's are properly corrected for the stop side(TOF) calibration.   This is done with the code in this package:

http://drupal.star.bnl.gov/STAR/system/files/shiftedT0s.tar_.gz

To run the code: use ./doCalib filelist traynumber .  The traynumber does not matter, use 0 again.  Be sure this is the same file list as before and that the generated pvpdCali.root and pvpdCali_4DB.dat files are in the same directory.  This way the VzOffset is applied.  An updated pvpdCali.root is produced.

 Typically, the pvpdCali.root is then used in the stop side calibration.  But because we are doing a cell based calibration, we wanted to increase statistics.  This caused an increase in IO from disk and delayed calibration since data for all trays is cycled over regardless of which tray is being calibrated.  To get around this, we used a splitting macro that reads in the ntuples and pvpdCali.root, and then it splits the ntuples into TDIG based files with the startside information stored with it.  The splitting macro is attached to this page here:

http://drupal.star.bnl.gov/STAR/system/files/Splitter.tar_.gz
 

The board based ntuples are then used to calibrate on a cell level for each board.  This is done with this code package:  

http://drupal.star.bnl.gov/STAR/system/files/stopside.tar__0.gz

 

To run it: ./doCalib filelist traynumber boardnumber.  Here tray number is 0-119 and board number is 0-959.  It is important that the proper board is selected from the given tray number.  For example tray 0 has boards 0-7, tray 1 has boards 8-15 and so on.

Produced among other files are tray_$tray#_board_$board#_$iteration#.dat files.  These files are added together for all trays and create the parameter files used for the database.  To add them together, the macros addZtdig.C, addT0Ttdig.C, and addt0tig.C were used(http://drupal.star.bnl.gov/STAR/system/files/addstopsidemacros.tar_.gz) and generated zCali_4DB.dat, totCali_4DB.dat, and t0_4DB.dat respectively.  

To check the produced calibration parameters, use a check macro that reads in matchmaker produced ntuples and applies the parameters (http://drupal.star.bnl.gov/STAR/system/files/simpleQAmacro.tar_.gz).  The result is a .root file that can be used QA checking.  The macro needs to be edited to find the proper parameters and the proper name for an output file. It works with './checknew filelist_location'    In addition, there are other methods for QA checking.

The calibration was performed over:

Run #        -events
>
> 11004071   -623835
> 11009017   -497717
> 11015019   -499030
> 11020023   -500001
> 11026034   -500001
> 11035026   -699977
>
> total:3320561 events.

---Issues that came up during the calibration procedure---

First off is the outlier rejection.  Not inserting the outlier rejection in all stages of the start side calibration caused issues.  This was seen when shifting the T0s for the stopside calibration and in comparing different QA checking macros.  This can lead to 40ps differences in the time.  Also, there is  a slight difference in the way the outlier is handled in the calibration procedure versus the vpdcalibmaker.  This difference of T0s averages out over events to be on the order of 2-3 ps. We kept this difference in place for 200, because this method used in the  production of 39 earlier in the year.

   Other differences  include the selection criteria for events.  Needed to replace dcaZ with vertexZ since in heavy ion the primary vertex is filled and more reliable(dcaZ was used in pp where the primary vertex was not always filled).  Same with dcaX and dcaY to vertexX and vertexY respectively.  Also dropped the if(sqrt(pow(tofr->vertexX,2)+pow(tofr->vertexY,2))>rCut) cut.  This is because by selecting a primary vertex with vertexZ, this should have already been applied in order to be a primary vertex.

 

Another minor one was in the QA macro calculating the vpdMean.  Turns out it was being handled incorrectly, but okay now.  Originally it looked like (bad structure):Old vpdMean

And with the fix, it became:

fixed vpdMean




 

Run 10 200GeV RFF


Place holder.  Two samples used.

Run 11 - 19 GeV Calibration

Place holder.  Board+cell based calibration.

Run 11 - 62 GeV Calibration

Place holder.  40ns.

Run 17 calibrations

 Run 17 Calibrations

Run 18 Calibrations

Isobar Calibrations


27 GeV Calibrations

First Half ( days - 141)

Second Half (days 142-168)

  • VPD calibration QA
  • BTOF alignment
  • BTOF T0
  • Comments:
    • BTOF slewing and Local-Z re-used from past full calibration (Run16)
    • calalgo=1 (startless mode, VPD is not used for the BTOF start time)

Fixed Target Calibrations 




Run 19 Calibrations

 Run 19 Calibrations

19.6 GeV Calibrations

  • VPD Calibration QA
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA
  • Comments:
    • BTOF slewing and Local-Z re-used from past full calibration (Run16)
    • calalgo=1 (startless mode, VPD is not used for the BTOF start time)

19.6 GeV Calibrations with new TPC alignment

  • VPD Calibration QA
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA
  • Comments: Charged particle mass splitting is observed.

Fixed Target Calibrations 

200 GeV Calibrations

  • VPD Calibration QA
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA

4p59/3p85 GeV Calibrations with new TPC alignment

  • Startless mode
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA




Run 20 Calibrations

 Run 20 Calibrations

BToF time resolution for Startless mode is around 0.06ns and is 0.14ns (11.5GeV), 0.16ns(9.2GeV) for Vpdstart mode.
 

Run20 FXT Calibrations: 5p75/7p3/9p8 GeV

  • Startless mode
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA


11.5 GeV Calibrations

  • VPD Calibration QA
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA

9.2 GeV Calibrations

  • VPD Calibration QA
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA

Run 21 Calibrations

 

Run21 Calibrations

AuAu 7.7 GeV Calibrations

  • VPD Calibration QA
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA

OO 200GeV Calibrations

  • VPD Calibration QA
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA
  • charged particle mass splitting for FF data

AuAu 17.3 GeV Calibrations

  • VPD Calibration QA
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA

dAu 200 GeV Calibrations

  • VPD Calibration QA
  • BTOF alignment 
    • xqa
    • yqa
  • BTOF T0
    • SummaryQA
  • asymmetry in VpdVz-TPCVz plot

AuAu FXT Calibrations (3.85GeV, 26.5GeV, 44.5GeV, 70GeV, 100GeV)

  • Using Run21 17.3GeV parameter tables
  • BTOF T0
    • SummaryQA


TOF/VPD Calibration How-To's

 

Trigger Window Determination

Here is documentation on how to determine the trigger windows for ToFs 120 trays and the 2 start detectors.

I determined the trigger windows on run 13037090.  To do this, I used StRoot.tar.gz and extracted it to my work directory.  Then changed directory to StRoot/RTS/src/RTS_EXAMPLE and ran Rts_Example.sh.  This creates the executable rts_example from rts_example.C.  Both Rts_Example.sh and rts_example.C have been customized from the typical StRoot version to translate information given in a .daq file into a useful .root file.  To run rts_example, I use run_test.csh.  This is essentially:

starver SL11e

rts_example -o tof_13037090.root -D tof inputfilepath/st_physics_13037090_raw_1010001.daq

where tof_run#.root is your output file and .daq is your input file.

Then the trigger windows are determined from the .root file by running over it with plot_trgwindow.C.

To do this:

root

.x plot_trgwindow.C("run#");

run number is important because this is how the script knows to read in tof_run#.root.

Produced is a .dat file that lists the high and low limits for each tray's trigger window and a postscript that shows the new limits in blue for each tray and if defined inside plot_trgwindow.C, red lines for the old trigger window limits(testrun11.dat in this example).

Attached to this page is the StRoot.tar.gz package, run_test.csh, plot_trgwindow.C, old trigger window limits, new trigger window limits, and a postscript displaying the limits on top of the data.  (I put them in zip containers due to the file attachment restrictions.)

VPD Slewing corrections for bbq & mxq

 

1. Acquiring VPD gain setting data

At the sc5.starp station, there are two GUIs on the upVPD monitor:

"large GUI" shows all the channel values, and where one powers them on/off...
"small GUI" selects between different gain sets A, B, C, & default...

start with the VPD HV **off**

once there is a decent non-VPD-based trigger and stable beam:

1. on small GUI, click "! upVPD HV A" button
2. on large GUI, click in lower left corner to power on upVPD HV
3. wait until all channels are "green" (~20 sec).
4. make sure the values (upper left corner of large GUI,
     leftmost column) are as expected
5. wait ~1min for PMTs to settle (or take some other test run)
6. start run: TRG+DAQ+TOF only, 300k events.
     use string "upVPD HV A" in the shiftlog entry
7. power off HV (large GUI lower left corner)
8. wait until channels reach 0 (~20 sec)

9. on small GUI, click "! upVPD HV B" button
10. on large GUI, click in lower left corner to power on upVPD HV
11. wait until all channels are "green" (~20 sec).
12. make sure the values (upper left corner of large GUI,
     leftmost column) are as expected
13. wait ~1min for PMTs to settle (or take some other test run)
14. start run: TRG+DAQ+TOF only, 300k events.
     use string "upVPD HV B" in the shiftlog entry
15. power off HV (large GUI lower left corner)

16. on small GUI, click "! upVPD HV C" button
17. on large GUI, click in lower left corner to power on upVPD HV
18. wait until all channels are "green" (~20 sec).
19. make sure the values (upper left corner of large GUI,
     leftmost column) are as expected
20. wait ~1min for PMTs to settle (or take some other test run)
21. start run: TRG+DAQ+TOF only, 300k events.
     use string "upVPD HV C" in the shiftlog entry
22. power off HV (large GUI lower left corner)

23. on small GUI, click "! DEFAULT" button.
24. power on the VPD HV. 

Do not use the small GUI anymore. In fact, feel free to close it!

At this point, I will get the data from HPSS, calculate the new gains, and then upload them to sc5. 

make sure the shift log says which gain set (A, B, or C) was used for a given run 

2. Calculate VPD Gains


1. Get DAQ files containing gain fit runs
Copied Run 160390{19, 22, 23} over from hpss :
hpss_user.pl /home/starsink/raw/daq/2015/039/16039019/st_physics_16039019_raw_0000001.daq   /star/data03/daq/jdb/pp200/vpdGainFit/
 
 
2. Running DaqDoer:
./daqdoer /star/data03/daq/jdb/pp200/vpdGainFit/st_physics_16039019_raw_0000001.daq
Then:
What kind of Data?
0=beam,  save trigger detector info, no trees...
1=noise, save TOF/MTD hits trees, no coarse counter cut...
2=beam,  save **MTD** hits trees, w/ coarse counter cut...
3=beam,  no coarse counter cut for trigger time plots (TOF&MTD)...

0->online->gainfit, 1->noise, 2->mtdview (_mtd), 3->thub (_tof)
0 >> enter
Then:
Enter run string for output file name
(16039019) Run# >> enter
 
let it work and it will produce a file daqdoer_***.root
- Rename it to be daqdoer_run#.root if not already
 
3. Run the Online Plot Maker
- cd into online working dir
- move daq files from daqdoer into dd/
- ensure that daq files have name daqdoer_run#.root
- run make to ensure online is fully built
- Run online util with "-r run#" :
./online -r 16039019
and output will be something like
..... Main ... krun = 16039019
..... online::online kRunUse = 16039019
Error in <TTree::SetBranchAddress>: unknown branch -> p2p_sin
..... online::loop Opening online_16039019.root
0x866d270
..... online::loop Nentries = 300000
1 Processing 0  run 16039019 16039019
...
and it will produce 3 files 
1. online_run#.root
2. online_run#.ps (example attached)
 
3. online_run#.pdf
 
Repeat this on the files from all 3 gain runs { A, B, C}
 
4. Running gainfit.C Macro
1. Copy from sc5.starp.bnl.gov:/home/sysuser/llope/VPD/set{A, B, C}.save to working dir
2. Copy the online_run#*.root to working dir
3. Open gainfit.C and change the run# in each filename to match the 3 you are using
4. Run the GainFit.C macro: root -l gainfit.C
- Will produce gainfit.root and gainfit.ps (example attached )
 
5. Export the newvpdhv to a text file with correct format
6. Fill in the 6 tof only trays using the correlation plot on left of page 4 in gainfit.ps - in the past this has ben roughly equivalent to adding ~160V to the hv calculated with <ADC> only. ( right now I am doing this step by hand but it would be better to write a script - TODO)
7. The gains should undergo a sanity check - none should be too low or too high (above ~2100 V )

 

5. Upload the gains to the auto-loaded file on
- Make sure that the VPD HV is **OFF** before uploading - otherwise the HV values will not be set properly.
- autoload location : sc5.starp.bnl.gov:/home/sysuser/epics3.13.10/Application/BBCApp/config/upVPD/upVPD.save
 
6. Have someone ( lijuan’s team ) take new runs with the “good” gain settings to set the TAC and MXQ offsets.
 
7. VPD is commissioned 

3. Collect data for VPD Slewing corrections

1. Data should be taken using a VPD based trigger
2. For AuAu collisions ~ 100K minimum events are needed
3. For pp200 ~200K events were needed
4. As soon as the data is acquired (or even before ) make arrangments with Lidia for the fast offline production to be started. It needs to start immediately

4. Perform VPD Slewing corrections for bbq & mxq crates

1. Plot the TAC{East} - TAC{West} + 4096 vs. TPC vz to determine the TAC to ps conversion factor. Bbq and Mxq are not neccessarily the same - so check both.

2. Create calibration tuples from MuDsts - these contain just the VPD data, TPC z vertex etc. that we need.
Current tuple maker is at : /star/institutions/rice/jdb/calib/ntupler/

3. Setup a config file for slewing corrections - set data uri, bbq or mxq datasource and output filenames for qa and parameters

4. Run the slewing jobs 
5. Check the QA and if there is time before uploading have Shuai check the resolution.
6. Upload parameter files to startrg.starp.bnl.gov in the ~staruser/ location with names like (m)vpd_slew_corr.<date>.txt for bbq (mxq)
7. check the md5sums of the two files you just made and compare them to the original parameter files - sometimes the line-endings get scrambled
7. Make a soft link from 
 (m)vpd_slew_corr.<date>.txt to (m)vpd_slew_corr.txt for bbq (mxq).
8. Have Jack run the script to write slewing corrections to crates.


5. Check VPD plots - if everything looks good then you are done


QA from run15 pA200 is attached for the full statistics runs