Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:03:53

0001 #! /bin/bash
0002 
0003 #include common helper functions to make it easier across years
0004 source helperCalibHGCROC.sh
0005 
0006 PlotBaseDir=..
0007 runList=../configs/TB2026/DataTakingDB_TBSPSH2_202605_HGCROC.csv
0008 
0009 # running example:
0010 # bash runCalibration_2024.sh fbockExt2 muoncalibA1 improvedWBC4th
0011 
0012 
0013 dataDirRaw=""
0014 dataDirOut=""
0015 
0016 if [ $1 = "fbockTB" ]; then 
0017   dataDirRaw=/media/fbock/ALICE2-4TB/202605_SPSH2/HGCROCData
0018   dataDirOut=/media/fbock/ALICE2-4TB/202605_SPSH2/HGCROCData
0019   PlotBaseDir=/media/fbock/ALICE2-4TB/202605_SPSH2/
0020 elif [ $1 = "atamis" ]; then 
0021   dataDirRaw=/home/drewtam20/Documents/eic/LFHCALDATA/Converted
0022   dataDirOut=/home/drewtam20/Documents/eic/LFHCALDATA/Converted
0023   PlotBaseDir=/home/drewtam20/Documents/eic/LFHCALDATA/Plots
0024 elif [ $1 = "ehagen" ]; then 
0025   dataDirRaw=/Users/hagen/Githubs/TB_data
0026   dataDirOut=/Users/hagen/Githubs/TB_data
0027   PlotBaseDir=/Users/hagen/Githubs/TB_data/plots
0028 elif [ $1 = "egpott" ]; then
0029   dataDirRaw=/Users/egpott/rhig/lfhcal/data/TB2025_HVscan1/rawroot
0030   dataDirOut=/Users/egpott/rhig/lfhcal/data/TB2025_HVscan1/rawroot
0031   PlotBaseDir=/Users/egpott/rhig/lfhcal/data/TB2025_HVscan1/plots
0032 elif [ $1 = "Preet" ]; then
0033   dataDirRaw=/home/lfhcal/HGCROCData
0034   dataDirOut=/home/lfhcal/HGCROCData
0035   PlotBaseDir=/home/lfhcal/HGCROCData/plots
0036 else
0037   echo "Please select a known user name, otherwise I don't know where the data is"
0038   exit
0039 fi
0040 
0041 # run pedest extraction for different run numbers
0042 if [ $2 = "pedestal" ]; then
0043   runs='';
0044   # different number of KCUs & asics
0045   if [ $3 = "Test" ]; then
0046     runs='72'  
0047   elif [ $3 = "FullSetA" ]; then
0048     runs='48' #pedestals
0049   # Full Scan B
0050   elif [ $3 = "FullSetB" ]; then
0051 #     runs='71' #pedestals
0052     runs='126' #pedestals
0053   elif [ $3 = "FullSetC" ]; then
0054 #     runs='134 135 137' #pedestals
0055     runs='135' #pedestals
0056     # runs='71' #pedestals
0057   elif [ $3 = "FullSetE" ]; then
0058     runs='372' #pedestals
0059  elif [ $3 = "HVScan" ]; then
0060     runs='188' #pedestals
0061   elif [ $3 = "HadronScan" ]; then
0062     runs='207' #pedestals
0063   fi
0064   for runNr in $runs; do 
0065     printf -v runNrPed "%03d" "$runNr"
0066     Pedestal $2 $runNrPed $dataDirRaw $dataDirOut Run$runNrPed pdf
0067 #     ./DataPrep -a -d 1 -p -i $dataDirRaw/rawHGCROC_$runNrPed.root -f -o $dataDirOut/rawHGCROC_wPed_$runNrPed.root -O $PlotBaseDir/PlotsPedestal/Run$runNrPed -r $runList
0068   done
0069 fi
0070 
0071 if [ $2 = "toaPhase" ]; then   
0072   if [ $3 = "FullSetB" ]; then
0073     runNrPed='071'
0074     if [ $4 = "Hadron" ]; then 
0075       runs=''
0076     elif [ $4 = "Muon" ]; then 
0077       runs='072' # 1st 0,0
0078     fi
0079   elif [ $3 = "HVScan" ]; then
0080     runNrPed='188'
0081     if [ $4 = "Muon" ]; then
0082       runs='202' # 1st 0,0
0083     fi
0084   fi
0085   if [ $4 = "Hadron" ]; then 
0086     for runNr in $runs; do 
0087       ./DataPrep -d 1 -f -i $dataDirRaw/rawHGCROC_$runNr.root -o $dataDirOut/rawHGCROC_toaPhase_$runNr.root -O $PlotBaseDir/ToAPhaseExtraction/Run$runNr -r $runList -g $dataDirOut/rawHGCROC_wPed_$runNrPed.root #-F png
0088     done
0089   elif [ $4 = "Muon" ]; then 
0090     for runNr in $runs; do 
0091       echo $runNr
0092       ./DataPrep -d 1 -f -i $dataDirRaw/rawHGCROC_wPed_$runNr.root -o $dataDirOut/rawHGCROC_toaPhase_$runNr.root -O $PlotBaseDir/ToAPhaseExtraction/Run$runNr -r $runList -g $dataDirRaw/rawHGCROC_wPed_$runNrPed.root
0093       #./DataPrep -d 1 -f -i $dataDirRaw/rawHGCROC_miptrigg_wPedwMuon_wBC_$runNr.root -o $dataDirOut/rawHGCROC_toaPhase_$runNr.root -O $PlotBaseDir/ToAPhaseExtraction/Run$runNr -r $runList -g $dataDirRaw/rawHGCROC_miptrigg_wPedwMuon_wBC_$runNr.root #-F png
0094     done
0095   fi
0096 
0097 fi
0098 
0099 if [ $2 = "wave" ]; then
0100   echo "Add runnumbers before you try this & remove exit"
0101   exit
0102   runs=''
0103   for runNr in $runs; do
0104     WaveformHGCROC $3 $runNr $dataDirRaw Run_$runNr
0105   done
0106 fi
0107 
0108 
0109 if [ $2 == "calibMuon" ]; then
0110   toaPhaseOffset=''
0111   if [ $4 = "FullSetB_A" ]; then
0112     runPed='071'
0113     runs='072'
0114     toaPhaseOffset='../configs/TB2026/ToAOffsets_TBSPS2026_FullSetB.csv'
0115     
0116   elif [ $4 = "FullSetB_1" ]; then
0117     runPed='071'
0118     runs='Muon_FullSetB_1'
0119     toaPhaseOffset='../configs/TB2026/ToAOffsets_TBSPS2026_FullSetB.csv'
0120   elif [ $4 = "FullSetB_2" ]; then
0121     runPed='126'
0122     runs='Muon_FullSetB_2'
0123     toaPhaseOffset='../configs/TB2026/ToAOffsets_TBSPS2026_FullSetB.csv'
0124   elif [ $4 = "FullSetE_1" ]; then
0125     runPed='372'
0126     runs='Muon_FullSetE_1'
0127     toaPhaseOffset='../configs/TB2026/ToAOffsets_TBSPS2026_FullSetB.csv'
0128   
0129   
0130   elif [ $4 = "HVScan" ]; then
0131     runPed='188'
0132     runs='194 195 196 197 198 199 200 201 202'
0133     toaPhaseOffset='../configs/TB2026/ToAOffsets_TBSPS2026_FullSetB.csv'
0134   else 
0135     echo "No run selected, exiting..."
0136     exit
0137   fi
0138 
0139   badChannelMap=../configs/TB2026/badChannel_HGCROC_SPSTB2026_dummy.txt
0140 
0141   for runNr in $runs; do
0142     echo "$runNr   $runPed"
0143     MuonCalibHGCROC $3 $runPed $runNr $dataDirRaw $dataDirOut Run_$runNr $badChannelMap $toaPhaseOffset         
0144   done
0145 fi
0146