TAC offsets - Run 2024

I am following Rosi's excellent instructions, with modifications for four crates.

1) Log on to the startrg computer and set all the TAC offsets to zero, by soft-linking the eqX_tac.dat files to files that have all zeros in them.
[staruser@startrg ~]$ ln -s /home/startrg/staruser/eq1_tac_run23_zeroed.dat /home/startrg/trg/cal/qt/eq1_tac.dat
[staruser@startrg ~]$ ln -s /home/startrg/staruser/eq2_tac_run23_zeroed.dat /home/startrg/trg/cal/qt/eq2_tac.dat
[staruser@startrg ~]$ ln -s /home/startrg/staruser/eq3_tac_run23_zeroed.dat /home/startrg/trg/cal/qt/eq3_tac.dat
[staruser@startrg ~]$ ln -s /home/startrg/staruser/eq4_tac_run23_zeroed.dat /home/startrg/trg/cal/qt/eq4_tac.dat

2) Ask shift crew to take pedestal_rhic_clock_clean, to have these things loaded.  Importantly, they should only include TRG and DAQ into that pedestal run.  Leave the TPC and other pedestals alone.

3) Have the shift crew take a run with 500k events, with BBC trigger (*not* EPD trigger!), with DAQ and TRG only.  (No harm if other detectors are included, but not needed.)  The run they took (104) was with the "tune" configuration, which is screwed up.  So Rosi found a better one: 25119113

4) On an online node, run the EpdReader to make the epdhist.*.root files, and then hadd them.  Then make a "mapped" epd histo with map_EpdHistos.C.  Code at /ldaphome/lisa/EpdReader2024 on the online nodes.
runEpdTrgHist2024.sh 119 113 100
cd 25119/
hadd epdhist_Summed113.root epdhist.25119113*.root
mv epdhist_Summed113.root ..
cd ..
root4star map_EpdHistos.C\(\"epdhist_Summed113.root\"\)


5) To transfer it to my Mac.
   a) First, get the mapped.root file from the online machine to the bnl gateway machine.
sftp lisa@sftp.sdcc.bnl.gov
put mapped_epdhist_Summed113.root
exit
   b) Then, on my Mac, pull it from the bnl gateway
sftp lisa@sftp.sdcc.bnl.gov <<< $'get mapped_epdhist_Summed113.root .'

6) Then run Rosi's macro MakeTacOffset.C (get it from her blog), which makes the new offset files
root MakeTacOffset2023.C\(\"mapped_epdhist_Summed113.root\"\)

It makes tacoffsetsX.txt (X=1,2,3,4).  They are attached to this page.  It also makes ADCTAC.pdf, which is too large to attach and hard to compress.  It shows slewing curves like the following:




7) Upload the tacoffsetsX.txt files to the startrig computer
   a)  From my laptop:
sftp lisa@sftp.sdcc.bnl.gov: <<< $'put tacoffsets1.txt'
sftp lisa@sftp.sdcc.bnl.gov: <<< $'put tacoffsets2.txt'
sftp lisa@sftp.sdcc.bnl.gov: <<< $'put tacoffsets3.txt'
sftp lisa@sftp.sdcc.bnl.gov: <<< $'put tacoffsets4.txt'
  b) From startrig computer, in /home/startrg/staruser directory:
sftp lisa@sftp.sdcc.bnl.gov
get tacoffsets1.txt
get tacoffsets2.txt
get tacoffsets3.txt
get tacoffsets4.txt
exit

mv  tacoffsets1.txt  tacoffsetsEQ1_04292024.txt
mv  tacoffsets2.txt  tacoffsetsEQ2_04292024.txt
mv  tacoffsets3.txt  tacoffsetsEQ3_04292024.txt
mv  tacoffsets4.txt  tacoffsetsEQ4_04292024.txt

 
8) Set the soft links to use the new files.
rm /home/startrg/trg/cal/qt/eq1_tac.dat
rm /home/startrg/trg/cal/qt/eq2_tac.dat
rm /home/startrg/trg/cal/qt/eq3_tac.dat
rm /home/startrg/trg/cal/qt/eq4_tac.dat
ln -s /home/startrg/staruser/tacoffsetsEQ1_04292024.txt /home/startrg/trg/cal/qt/eq1_tac.dat

ln -s /home/startrg/staruser/tacoffsetsEQ2_04292024.txt /home/startrg/trg/cal/qt/eq2_tac.dat
ln -s /home/startrg/staruser/tacoffsetsEQ3_04292024.txt /home/startrg/trg/cal/qt/eq3_tac.dat
ln -s /home/startrg/staruser/tacoffsetsEQ4_04292024.txt /home/startrg/trg/cal/qt/eq4_tac.dat


9) As in step 2: Ask shift crew to take pedestal_rhic_clock_clean, to have these things loaded.  Importantly, they should only include TRG and DAQ into that pedestal run.  Leave the TPC and other pedestals alone.
Done at 18:40 on 29 April 2024.