Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:22

0001 #!/usr/bin/env bash
0002 #
0003 # run_tcal.sh <fname>
0004 # do tq timing offset calibrations
0005 # <fname> is the name of the root file with the waveforms
0006 
0007 # Check that user specifies a file
0008 if [[ $# -lt 1 ]]
0009 then
0010   echo "Usage: run_tcal.sh <rootfname>"
0011   exit -1
0012 fi
0013 
0014 mbd_uncalrootf=$1    # DST_UNCALMBD ROOT filename
0015 
0016 nevt=0
0017 if [[ $# -gt 1 ]]
0018 then
0019   nevt=$2
0020   echo Processing $2 events
0021 fi
0022 
0023 echo PATH=$PATH
0024 echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
0025 
0026 # process up to 100K uncalibrated events for t0 calibration
0027 #tcalib_events=100000
0028 tcalib_events=0
0029 if [[ $nevt -ne 0 ]] && [[ $nevt -le 100000 ]]
0030 then
0031   tcalib_events=${nevt}
0032 fi
0033 
0034 # if not interactive, run ROOT in batch mode
0035 if [ ! -z $PS1 ]
0036 then
0037   BATCH=-b
0038 fi
0039 
0040 pass=0
0041 runtype=0 # 0=auau,1=pp
0042 #dbtag="ProdA_2024"
0043 dbtag=""
0044 if [[ -n "$PASS0DIR" ]]
0045 then
0046   dbtag=""
0047 fi
0048 
0049 echo root.exe $BATCH -q cal_mbd.C\(\"${mbd_uncalrootf}\",${pass},${tcalib_events},${runtype},\"${dbtag}\"\)
0050 root.exe $BATCH -q cal_mbd.C\(\"${mbd_uncalrootf}\",${pass},${tcalib_events},${runtype},\"${dbtag}\"\)
0051