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