Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

5) If one motor says "Uninitialized" click on Initialize and then Home. The motor will be sent home and recalibratedre-calibrated

6) If was just a transient error, this should clear up and recover the motor functionality.


Offline Baseline+Thresholds Procedure

APV25 channel pedestals shift with occupancy, and can significantly change after beam is introduced, in comparison to an online baseline run (no beam) in channels close to the beam, especially in the first 2 layers. Additionally, the pedestals can change over time with radiation exposure, so the more time that elapses between online baseline runs, the more likely the high occupancy channel pedestals may no longer be consistent. For these reasons, we have an offline baseline fitting tool to extract the pedestals from production run data.

TO FIT OFFLINE BASELINES AND GENERATE A BASELINE AND THRESHOLD DATABASE FILE FOR A RUN:

1) SETUP OFFLINE FIT RUN DIRECTORY ON CLONFARM1

  1.  From behind the hall gateway →  'ssh -XY -C clonfarm1'
  2. Access bash tools required for running environment scripts → 'scl enable devtoolset-8 bash' 
  3.  Setup environment to run fit jobs → 'source /data/hps/src/setupHpstrEnv.sh'
  4. Check setup → Enter 'which hpstr' into terminal. Should return "/data/hps/src/hpstr/install/bin/hpstr" if successfully setup.
  5. Navigate to offline fit job run directory → 'cd /data/hps/slac_svt/server/offlinePedestals'
  6. Make evio storage directory → 'mkdir hps_0<run_number>'

2) COPY ONGOING RUN EVIOS FROM CLONDAQ7 TO CLONFARM1

  1. Open another terminal and from behind the hall gateway → 'ssh -XY -C clondaq7'
  2. Enter 'bash' into terminal to access bash tools 
  3. Navigate to ongoing run data staging → 'cd /data/stage7/hps_0<run_number>'
  4. Offline baseline fitting requires 30 evio files, so make sure enough files exist
  5. Copy <n> sequential files to clonfarm1:
    1. From inside the above data directory → 'scp hps_0<run_number>.evio.00{m..m+29} <user>@clonfarm1.jlab.org:/data/hps/slac_svt/server/offlinePedestals/<run_folder>'
    2. "first_file" = m

3) SETUP AND RUN JOBS ON CLONFARM1

  1. Return to clonfarm1 terminal
  2. Run evio → rawsvthits_hh jobs to create sample0 histograms to fit baselines
    1. Modify 'vars.json' → 'vim /data/hps/slac_svt/server/offlinePedestals/vars.json'
      1. update "run_number" to match the current run
      2. update "first_file" to match the first file number from 2) step 5.b.
      3. save changes and close file
    2. Create jobs → 'source /data/hps/slac_svt/server/offlinePedestals/mkjobs.sh'
    3. Run jobs → 'source run_pool.sh'
    4. When jobs finish, combine histograms into one file → 'hadd output/rawsvthits_<run_number>_hh.root output/rawsvthits_0<run_number>*.root'
    5. Wait for jobs to finish before proceeding to step 3.
  3. Run offline_baseline_fit jobs  
    1. Create jobs → 'source /data/hps/slac_svt/server/offlinePedestals/mkjobs_blfits.sh'
    2. Run jobs → 'source run_pool_blfits.sh'
    3. When jobs finish, combine layer fits into one file → 'hadd output/hps_<run_number>_offline_baseline_fits.root output/hps_<run_number>_offline_baseline_layer*.root'

4) GENERATE OFFLINE BASELINE AND THRESHOLD DATABASE FILES

  1. Copy most recent online baseline run file to clonfarm1 
    1. Open new terminal, log in to ifarm, and navigate to '/work/hallb/hps/phys2021_svt_calibrations/'
    2. Find the "svt_<online_run_number>_cond.dat" file with run_number closest to, but less than, the current run being fit.
    3. Copy online baseline file to clonfarm1 → 'scp /work/hallb/hps/phys2021_svt_calibrations/svt_<online_run_number>_cond.dat> <user>@clonfarm1.jlab.org:/data/hps/slac_svt/server/offlinePedestals/output/'
  2. Run python analysis script
    1. Return to clonfarm1 directory /data/hps/slac_svt/server/offlinePedestals/
    2. Run python analysis → 'python3 offlineBaselineFitAnalysis.py -i output/hps_<run_number>_offline_baseline_fits.root -o output/hps_<run_number>_offline_baseline_fits_analysis.root -b output/svt_<online_run_number>_cond.dat -csv output/hps_<run_number>_offline_baselines.dat -thresh output/hps_<run_number>_offline_thresholds.dat'
      1. new offline baselines are located → output/hps_<run_number>_offline_baselines.dat
      2. new offline thresholds are located → output/hps_<run_number>_offline_thresholds.dat
  3. Cleanup the output directory
    1. 'mkdir output/<run_number>' and move "output/rawsvthits_0<run_number>_hh.root", "output/hps_<run_number>_offline_baseline_fits_analysis.root" and all of the "<file>.dat" files into that output/<run_number> directory for safe-keeping.
    2. Remove everything else